]> source.dussan.org Git - nextcloud-server.git/commitdiff
Move the systemtags to core/src 21118/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Tue, 26 May 2020 19:56:40 +0000 (21:56 +0200)
committernpmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Thu, 28 May 2020 19:05:09 +0000 (19:05 +0000)
* Move to the handlebar loader from webpack

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
26 files changed:
apps/systemtags/templates/admin.php
apps/workflowengine/lib/AppInfo/Application.php
core/js/core.json
core/js/dist/systemtags.js
core/js/dist/systemtags.js.map
core/js/systemtags/merged-systemtags.js [deleted file]
core/js/systemtags/systemtagmodel.js [deleted file]
core/js/systemtags/systemtags.js [deleted file]
core/js/systemtags/systemtagscollection.js [deleted file]
core/js/systemtags/systemtagsinputfield.js [deleted file]
core/js/systemtags/systemtagsmappingcollection.js [deleted file]
core/js/systemtags/templates.js [deleted file]
core/js/systemtags/templates/result.handlebars [deleted file]
core/js/systemtags/templates/result_form.handlebars [deleted file]
core/js/systemtags/templates/selection.handlebars [deleted file]
core/src/systemtags/merged-systemtags.js [new file with mode: 0644]
core/src/systemtags/systemtagmodel.js [new file with mode: 0644]
core/src/systemtags/systemtags.js [new file with mode: 0644]
core/src/systemtags/systemtagscollection.js [new file with mode: 0644]
core/src/systemtags/systemtagsinputfield.js [new file with mode: 0644]
core/src/systemtags/systemtagsmappingcollection.js [new file with mode: 0644]
core/src/systemtags/templates/result.handlebars [new file with mode: 0644]
core/src/systemtags/templates/result_form.handlebars [new file with mode: 0644]
core/src/systemtags/templates/selection.handlebars [new file with mode: 0644]
core/webpack.js
tests/karma.config.js

index 7b6a20efdd30af331fc78af74a59c1acb86ba4a1..27fad5bc47bfc57aae34f95d700c5627643e3ec0 100644 (file)
@@ -20,9 +20,7 @@
  */
 
 script('core', [
-       'systemtags/systemtags',
-       'systemtags/systemtagmodel',
-       'systemtags/systemtagscollection',
+       'dist/systemtags',
 ]);
 
 script('systemtags', 'admin');
index 70b5468c55325fc48ff129f6f47df5dc866461a9..a92f35678531e28d81012768b33517d6fb73ce7c 100644 (file)
@@ -66,9 +66,7 @@ class Application extends \OCP\AppFramework\App {
                                script('core', [
                                        'files/fileinfo',
                                        'files/client',
-                                       'systemtags/systemtags',
-                                       'systemtags/systemtagmodel',
-                                       'systemtags/systemtagscollection',
+                                       'dist/systemtags',
                                ]);
 
                                script(self::APP_ID, [
index 80a3032d6ff683de35daa1246041f5acfbfed446..f82587e73a5625df63aad7b541dcbdaf859210f8 100644 (file)
                "setupchecks.js",
                "../search/js/search.js",
                "mimetype.js",
-               "mimetypelist.js",
-               "systemtags/systemtags.js",
-               "systemtags/templates.js",
-               "systemtags/systemtagmodel.js",
-               "systemtags/systemtagscollection.js",
-               "systemtags/systemtagsmappingcollection.js",
-               "systemtags/systemtagsinputfield.js"
+               "mimetypelist.js"
        ]
 }
index 05ba0b8234377790ee285c1a2ca7edf422949126..0df7f13ab733bcf03c0c04708108bb79cdd82b71 100644 (file)
@@ -1,2 +1,9 @@
-!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=0)}([function(e,t,n){"use strict";n.r(t);n(1),n(2),n(3),n(4),n(5),n(6),n(7)},function(e,n){!function(e){e.SystemTags={getDescriptiveTag:function(e){if(_.isUndefined(e.name)&&!_.isUndefined(e.toJSON)&&(e=e.toJSON()),_.isUndefined(e.name))return $("<span>").addClass("non-existing-tag").text(t("core","Non-existing tag #{tag}",{tag:e}));var n,s=$("<span>");return s.append(escapeHTML(e.name)),e.userAssignable||(n=t("core","restricted")),e.userVisible||(n=t("core","invisible")),n&&s.append($("<em>").text(" ("+n+")")),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 l,a,o=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t\t<span class="label">'+(null!=(l="function"==typeof(a=null!=(a=o(n,"tagMarkup")||(null!=t?o(t,"tagMarkup"):t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"tagMarkup",hash:{},data:i,loc:{start:{line:4,column:22},end:{line:4,column:37}}}):a)?l:"")+"</span>\n"},5:function(e,t,n,s,i){var l,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t\t<span class="label">'+e.escapeExpression("function"==typeof(l=null!=(l=a(n,"name")||(null!=t?a(t,"name"):t))?l:e.hooks.helperMissing)?l.call(null!=t?t:e.nullContext||{},{name:"name",hash:{},data:i,loc:{start:{line:6,column:22},end:{line:6,column:30}}}):l)+"</span>\n"},7:function(e,t,n,s,i){var l,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t\t<span class="systemtags-actions">\n\t\t\t<a href="#" class="rename icon icon-rename" title="'+e.escapeExpression("function"==typeof(l=null!=(l=a(n,"renameTooltip")||(null!=t?a(t,"renameTooltip"):t))?l:e.hooks.helperMissing)?l.call(null!=t?t:e.nullContext||{},{name:"renameTooltip",hash:{},data:i,loc:{start:{line:10,column:54},end:{line:10,column:71}}}):l)+'"></a>\n\t\t</span>\n'},compiler:[8,">= 4.3.0"],main:function(e,t,s,i,l){var a,o,r,c=null!=t?t:e.nullContext||{},u=e.hooks.helperMissing,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]},m='<span class="systemtags-item'+(null!=(a=d(s,"if").call(c,null!=t?d(t,"isNew"):t,{name:"if",hash:{},fn:e.program(1,l,0),inverse:e.noop,data:l,loc:{start:{line:1,column:28},end:{line:1,column:57}}}))?a:"")+'" data-id="'+e.escapeExpression("function"===n(o=null!=(o=d(s,"id")||(null!=t?d(t,"id"):t))?o:u)?o.call(c,{name:"id",hash:{},data:l,loc:{start:{line:1,column:68},end:{line:1,column:74}}}):o)+'">\n<span class="checkmark icon icon-checkmark"></span>\n'+(null!=(a=d(s,"if").call(c,null!=t?d(t,"isAdmin"):t,{name:"if",hash:{},fn:e.program(3,l,0),inverse:e.program(5,l,0),data:l,loc:{start:{line:3,column:1},end:{line:7,column:8}}}))?a:"");return o=null!=(o=d(s,"allowActions")||(null!=t?d(t,"allowActions"):t))?o:u,r={name:"allowActions",hash:{},fn:e.program(7,l,0),inverse:e.noop,data:l,loc:{start:{line:8,column:1},end:{line:12,column:18}}},a="function"===n(o)?o.call(c,r):o,d(s,"allowActions")||(a=e.hooks.blockHelperMissing.call(t,a,r)),null!=a&&(m+=a),m+"</span>\n"},useData:!0}),i.result_form=s({1:function(e,t,n,s,i){var l,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t\t<a href="#" class="delete icon icon-delete" title="'+e.escapeExpression("function"==typeof(l=null!=(l=a(n,"deleteTooltip")||(null!=t?a(t,"deleteTooltip"):t))?l:e.hooks.helperMissing)?l.call(null!=t?t:e.nullContext||{},{name:"deleteTooltip",hash:{},data:i,loc:{start:{line:5,column:53},end:{line:5,column:70}}}):l)+'"></a>\n'},compiler:[8,">= 4.3.0"],main:function(e,t,s,i,l){var a,o,r=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing,u=e.escapeExpression,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<form class="systemtags-rename-form">\n\t <label class="hidden-visually" for="'+u("function"===n(o=null!=(o=d(s,"cid")||(null!=t?d(t,"cid"):t))?o:c)?o.call(r,{name:"cid",hash:{},data:l,loc:{start:{line:2,column:38},end:{line:2,column:45}}}):o)+'-rename-input">'+u("function"===n(o=null!=(o=d(s,"renameLabel")||(null!=t?d(t,"renameLabel"):t))?o:c)?o.call(r,{name:"renameLabel",hash:{},data:l,loc:{start:{line:2,column:60},end:{line:2,column:75}}}):o)+'</label>\n\t<input id="'+u("function"===n(o=null!=(o=d(s,"cid")||(null!=t?d(t,"cid"):t))?o:c)?o.call(r,{name:"cid",hash:{},data:l,loc:{start:{line:3,column:12},end:{line:3,column:19}}}):o)+'-rename-input" type="text" value="'+u("function"===n(o=null!=(o=d(s,"name")||(null!=t?d(t,"name"):t))?o:c)?o.call(r,{name:"name",hash:{},data:l,loc:{start:{line:3,column:53},end:{line:3,column:61}}}):o)+'">\n'+(null!=(a=d(s,"if").call(r,null!=t?d(t,"isAdmin"):t,{name:"if",hash:{},fn:e.program(1,l,0),inverse:e.noop,data:l,loc:{start:{line:4,column:1},end:{line:6,column:8}}}))?a:"")+"</form>\n"},useData:!0}),i.selection=s({1:function(e,t,n,s,i){var l,a,o=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t<span class="label">'+(null!=(l="function"==typeof(a=null!=(a=o(n,"tagMarkup")||(null!=t?o(t,"tagMarkup"):t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"tagMarkup",hash:{},data:i,loc:{start:{line:2,column:21},end:{line:2,column:36}}}):a)?l:"")+"</span>\n"},3:function(e,t,n,s,i){var l,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t<span class="label">'+e.escapeExpression("function"==typeof(l=null!=(l=a(n,"name")||(null!=t?a(t,"name"):t))?l:e.hooks.helperMissing)?l.call(null!=t?t:e.nullContext||{},{name:"name",hash:{},data:i,loc:{start:{line:4,column:21},end:{line:4,column:29}}}):l)+"</span>\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,s,i){var l,a=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(l=a(n,"if").call(null!=t?t:e.nullContext||{},null!=t?a(t,"isAdmin"):t,{name:"if",hash:{},fn:e.program(1,i,0),inverse:e.program(3,i,0),data:i,loc:{start:{line:1,column:0},end:{line:5,column:7}}}))?l:""},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'<input class="systemTagsInputField" type="hidden" name="tags" value=""/>'},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"),l=this.collection.get(i).get("name"),a=$(e.SystemTags.Templates.result_form({cid:this.cid,name:l,deleteTooltip:t("core","Delete"),renameLabel:t("core","Rename"),isAdmin:this._isAdmin}));return s.find(".label").after(a),s.find(".label, .systemtags-actions").addClass("hidden"),s.closest(".select2-result").addClass("has-form"),a.find("[title]").tooltip({placement:"bottom",container:"body"}),a.find("input").focus().selectRange(0,l.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),l=$(e.target).find("input").val().trim();l&&l!==i.get("name")&&(i.save({name:l}),n.find(".label").text(l)),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 l=s.indexOf(t.id)>=0,a=s.indexOf(i.id)>=0;if(l===a){var o=n._lastUsedTags.indexOf(t.id),r=n._lastUsedTags.indexOf(i.id);return o!==r?-1===r?-1:-1===o?1:o<r?-1:1:e.Util.naturalSortCompare(t.name,i.name)}return l&&!a?-1:1})),t},formatNoMatches:function(){return t("core","No tags found")}}).on("select2-selecting",this._onSelectTag).on("select2-removing",this._onDeselectTag);var s=this.$tagsField.select2("dropdown");s.on("mouseup",".rename",this._onClickRenameTag),s.on("mouseup",".delete",this._onClickDeleteTag),s.on("mouseup",".select2-result-selectable.has-form",this._preventDefault),s.on("submit",".systemtags-rename-form",this._onSubmitRenameTag),this.delegateEvents()},remove:function(){this.$tagsField&&this.$tagsField.select2("destroy")},getValues:function(){this.$tagsField.select2("val")},setValues:function(e){this.$tagsField.select2("val",e)},setData:function(e){this.$tagsField.select2("data",e)}});e.SystemTags=e.SystemTags||{},e.SystemTags.SystemTagsInputField=n}(OC)},function(e,t,n){var s=n(8);"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,n(10).default)("bdf318e0",s,!0,{})},function(e,t,n){(t=n(9)(!1)).push([e.i,".systemtags-select2-dropdown .select2-result-label .checkmark{visibility:hidden;margin-left:-5px;margin-right:5px;padding:4px}.systemtags-select2-dropdown .select2-result-label .new-item .systemtags-actions{display:none}.systemtags-select2-dropdown .select2-selected .select2-result-label .checkmark{visibility:visible}.systemtags-select2-dropdown .select2-result-label .icon{display:inline-block;opacity:.5}.systemtags-select2-dropdown .select2-result-label .icon.rename{padding:4px}.systemtags-select2-dropdown .systemtags-actions{position:absolute;right:5px}.systemtags-select2-dropdown .systemtags-rename-form{display:inline-block;width:calc(100% - 20px);top:-6px;position:relative}.systemtags-select2-dropdown .systemtags-rename-form input{display:inline-block;height:30px;width:calc(100% - 40px)}.systemtags-select2-dropdown .label{width:85%;display:inline-block;overflow:hidden;text-overflow:ellipsis}.systemtags-select2-dropdown .label.hidden{display:none}.systemtags-select2-dropdown span{line-height:25px}.systemtags-select2-dropdown .systemtags-item{display:inline-block;height:25px;width:100%}.systemtags-select2-dropdown .select2-result-label{height:25px}.systemTagsInfoView,.systemtags-select2-container{width:100%}.systemTagsInfoView .select2-choices,.systemtags-select2-container .select2-choices{flex-wrap:nowrap !important;max-height:44px}.systemTagsInfoView .select2-choices .select2-search-choice.select2-locked .label,.systemtags-select2-container .select2-choices .select2-search-choice.select2-locked .label{opacity:0.5}#select2-drop.systemtags-select2-dropdown .select2-results li.select2-result{padding:5px}\n",""]),e.exports=t},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=(a=s,o=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(o),"/*# ".concat(r," */")),l=s.sources.map((function(e){return"/*# sourceURL=".concat(s.sourceRoot||"").concat(e," */")}));return[n].concat(l).concat([i]).join("\n")}var a,o,r;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,s){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(s)for(var l=0;l<this.length;l++){var a=this[l][0];null!=a&&(i[a]=!0)}for(var o=0;o<e.length;o++){var r=[].concat(e[o]);s&&i[r[0]]||(n&&(r[2]?r[2]="".concat(n," and ").concat(r[2]):r[2]=n),t.push(r))}},t}},function(e,t,n){"use strict";function s(e,t){for(var n=[],s={},i=0;i<t.length;i++){var l=t[i],a=l[0],o={id:e+":"+i,css:l[1],media:l[2],sourceMap:l[3]};s[a]?s[a].parts.push(o):n.push(s[a]={id:a,parts:[o]})}return n}n.r(t),n.d(t,"default",(function(){return p}));var i="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!i)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var l={},a=i&&(document.head||document.getElementsByTagName("head")[0]),o=null,r=0,c=!1,u=function(){},d=null,m="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function p(e,t,n,i){c=n,d=i||{};var a=s(e,t);return f(a),function(t){for(var n=[],i=0;i<a.length;i++){var o=a[i];(r=l[o.id]).refs--,n.push(r)}t?f(a=s(e,t)):a=[];for(i=0;i<n.length;i++){var r;if(0===(r=n[i]).refs){for(var c=0;c<r.parts.length;c++)r.parts[c]();delete l[r.id]}}}}function f(e){for(var t=0;t<e.length;t++){var n=e[t],s=l[n.id];if(s){s.refs++;for(var i=0;i<s.parts.length;i++)s.parts[i](n.parts[i]);for(;i<n.parts.length;i++)s.parts.push(h(n.parts[i]));s.parts.length>n.parts.length&&(s.parts.length=n.parts.length)}else{var a=[];for(i=0;i<n.parts.length;i++)a.push(h(n.parts[i]));l[n.id]={id:n.id,refs:1,parts:a}}}}function g(){var e=document.createElement("style");return e.type="text/css",a.appendChild(e),e}function h(e){var t,n,s=document.querySelector('style[data-vue-ssr-id~="'+e.id+'"]');if(s){if(c)return u;s.parentNode.removeChild(s)}if(m){var i=r++;s=o||(o=g()),t=v.bind(null,s,i,!1),n=v.bind(null,s,i,!0)}else s=g(),t=_.bind(null,s),n=function(){s.parentNode.removeChild(s)};return t(e),function(s){if(s){if(s.css===e.css&&s.media===e.media&&s.sourceMap===e.sourceMap)return;t(e=s)}else n()}}var y,b=(y=[],function(e,t){return y[e]=t,y.filter(Boolean).join("\n")});function v(e,t,n,s){var i=n?"":s.css;if(e.styleSheet)e.styleSheet.cssText=b(t,i);else{var l=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(l,a[t]):e.appendChild(l)}}function _(e,t){var n=t.css,s=t.media,i=t.sourceMap;if(s&&e.setAttribute("media",s),d.ssrId&&e.setAttribute("data-vue-ssr-id",t.id),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}}]);
+!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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=33)}([function(e,t,n){"use strict";t.__esModule=!0,t.extend=i,t.indexOf=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},t.escapeExpression=function(e){if("string"!=typeof e){if(e&&e.toHTML)return e.toHTML();if(null==e)return"";if(!e)return e+"";e=""+e}if(!a.test(e))return e;return e.replace(o,s)},t.isEmpty=function(e){return!e&&0!==e||!(!u(e)||0!==e.length)},t.createFrame=function(e){var t=i({},e);return t._parent=e,t},t.blockParams=function(e,t){return e.path=t,e},t.appendContextPath=function(e,t){return(e?e+".":"")+t};var r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},o=/[&<>"'`=]/g,a=/[&<>"'`=]/;function s(e){return r[e]}function i(e){for(var t=1;t<arguments.length;t++)for(var n in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],n)&&(e[n]=arguments[t][n]);return e}var l=Object.prototype.toString;t.toString=l;var c=function(e){return"function"==typeof e};c(/x/)&&(t.isFunction=c=function(e){return"function"==typeof e&&"[object Function]"===l.call(e)}),t.isFunction=c;var u=Array.isArray||function(e){return!(!e||"object"!=typeof e)&&"[object Array]"===l.call(e)};t.isArray=u},function(e,t,n){"use strict";t.__esModule=!0;var r=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function o(e,t){var n=t&&t.loc,a=void 0,s=void 0,i=void 0,l=void 0;n&&(a=n.start.line,s=n.end.line,i=n.start.column,l=n.end.column,e+=" - "+a+":"+i);for(var c=Error.prototype.constructor.call(this,e),u=0;u<r.length;u++)this[r[u]]=c[r[u]];Error.captureStackTrace&&Error.captureStackTrace(this,o);try{n&&(this.lineNumber=a,this.endLineNumber=s,Object.defineProperty?(Object.defineProperty(this,"column",{value:i,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:l,enumerable:!0})):(this.column=i,this.endColumn=l))}catch(e){}}o.prototype=new Error,t.default=o,e.exports=t.default},function(e,t,n){e.exports=n(15).default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.HandlebarsEnvironment=u;var o=n(0),a=r(n(1)),s=n(4),i=n(23),l=r(n(6)),c=n(7);t.VERSION="4.7.6";t.COMPILER_REVISION=8;t.LAST_COMPATIBLE_COMPILER_REVISION=7;t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};function u(e,t,n){this.helpers=e||{},this.partials=t||{},this.decorators=n||{},s.registerDefaultHelpers(this),i.registerDefaultDecorators(this)}u.prototype={constructor:u,logger:l.default,log:l.default.log,registerHelper:function(e,t){if("[object Object]"===o.toString.call(e)){if(t)throw new a.default("Arg not supported with multiple helpers");o.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if("[object Object]"===o.toString.call(e))o.extend(this.partials,e);else{if(void 0===t)throw new a.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if("[object Object]"===o.toString.call(e)){if(t)throw new a.default("Arg not supported with multiple decorators");o.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){c.resetLoggedProperties()}};var d=l.default.log;t.log=d,t.createFrame=o.createFrame,t.logger=l.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.registerDefaultHelpers=function(e){o.default(e),a.default(e),s.default(e),i.default(e),l.default(e),c.default(e),u.default(e)},t.moveHelperToHooks=function(e,t,n){e.helpers[t]&&(e.hooks[t]=e.helpers[t],n||delete e.helpers[t])};var o=r(n(16)),a=r(n(17)),s=r(n(18)),i=r(n(19)),l=r(n(20)),c=r(n(21)),u=r(n(22))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";t.__esModule=!0;var r=n(0),o={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if("string"==typeof e){var t=r.indexOf(o.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=o.lookupLevel(e),"undefined"!=typeof console&&o.lookupLevel(o.level)<=e){var t=o.methodMap[e];console[t]||(t="log");for(var n=arguments.length,r=Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];console[t].apply(console,r)}}};t.default=o,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.createProtoAccessControl=function(e){var t=Object.create(null);t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1;var n=Object.create(null);return n.__proto__=!1,{properties:{whitelist:r.createNewLookupObject(n,e.allowedProtoProperties),defaultValue:e.allowProtoPropertiesByDefault},methods:{whitelist:r.createNewLookupObject(t,e.allowedProtoMethods),defaultValue:e.allowProtoMethodsByDefault}}},t.resultIsAllowed=function(e,t,n){return s("function"==typeof e?t.methods:t.properties,n)},t.resetLoggedProperties=function(){Object.keys(a).forEach((function(e){delete a[e]}))};var r=n(25),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(6)),a=Object.create(null);function s(e,t){return void 0!==e.whitelist[t]?!0===e.whitelist[t]:void 0!==e.defaultValue?e.defaultValue:(function(e){!0!==a[e]&&(a[e]=!0,o.log("error",'Handlebars: Access has been denied to resolve the property "'+e+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}(t),!1)}},function(e,t,n){"use strict";
+/*!
+ * escape-html
+ * Copyright(c) 2012-2013 TJ Holowaychuk
+ * Copyright(c) 2015 Andreas Lubbe
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
+ * MIT Licensed
+ */var r=/["'&<>]/;e.exports=function(e){var t,n=""+e,o=r.exec(n);if(!o)return n;var a="",s=0,i=0;for(s=o.index;s<n.length;s++){switch(n.charCodeAt(s)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#39;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}i!==s&&(a+=n.substring(i,s)),i=s+1,a+=t}return i!==s?a+n.substring(i,s):a}},function(e,t,n){var r=n(2);e.exports=(r.default||r).template({1:function(e,t,n,r,o){return" new-item"},3:function(e,t,n,r,o){var a,s,i=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t\t<span class="label">'+(null!=(a="function"==typeof(s=null!=(s=i(n,"tagMarkup")||(null!=t?i(t,"tagMarkup"):t))?s:e.hooks.helperMissing)?s.call(null!=t?t:e.nullContext||{},{name:"tagMarkup",hash:{},data:o,loc:{start:{line:4,column:22},end:{line:4,column:37}}}):s)?a:"")+"</span>\n"},5:function(e,t,n,r,o){var a,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t\t<span class="label">'+e.escapeExpression("function"==typeof(a=null!=(a=s(n,"name")||(null!=t?s(t,"name"):t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"name",hash:{},data:o,loc:{start:{line:6,column:22},end:{line:6,column:30}}}):a)+"</span>\n"},7:function(e,t,n,r,o){var a,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t\t<span class="systemtags-actions">\n\t\t\t<a href="#" class="rename icon icon-rename" title="'+e.escapeExpression("function"==typeof(a=null!=(a=s(n,"renameTooltip")||(null!=t?s(t,"renameTooltip"):t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"renameTooltip",hash:{},data:o,loc:{start:{line:10,column:54},end:{line:10,column:71}}}):a)+'"></a>\n\t\t</span>\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){var a,s,i,l=null!=t?t:e.nullContext||{},c=e.hooks.helperMissing,u=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]},d='<span class="systemtags-item'+(null!=(a=u(n,"if").call(l,null!=t?u(t,"isNew"):t,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o,loc:{start:{line:1,column:28},end:{line:1,column:57}}}))?a:"")+'" data-id="'+e.escapeExpression("function"==typeof(s=null!=(s=u(n,"id")||(null!=t?u(t,"id"):t))?s:c)?s.call(l,{name:"id",hash:{},data:o,loc:{start:{line:1,column:68},end:{line:1,column:74}}}):s)+'">\n<span class="checkmark icon icon-checkmark"></span>\n'+(null!=(a=u(n,"if").call(l,null!=t?u(t,"isAdmin"):t,{name:"if",hash:{},fn:e.program(3,o,0),inverse:e.program(5,o,0),data:o,loc:{start:{line:3,column:1},end:{line:7,column:8}}}))?a:"");return s=null!=(s=u(n,"allowActions")||(null!=t?u(t,"allowActions"):t))?s:c,i={name:"allowActions",hash:{},fn:e.program(7,o,0),inverse:e.noop,data:o,loc:{start:{line:8,column:1},end:{line:12,column:18}}},a="function"==typeof s?s.call(l,i):s,u(n,"allowActions")||(a=e.hooks.blockHelperMissing.call(t,a,i)),null!=a&&(d+=a),d+"</span>\n"},useData:!0})},function(e,t,n){var r=n(2);e.exports=(r.default||r).template({1:function(e,t,n,r,o){var a,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t\t<a href="#" class="delete icon icon-delete" title="'+e.escapeExpression("function"==typeof(a=null!=(a=s(n,"deleteTooltip")||(null!=t?s(t,"deleteTooltip"):t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"deleteTooltip",hash:{},data:o,loc:{start:{line:5,column:53},end:{line:5,column:70}}}):a)+'"></a>\n'},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){var a,s,i=null!=t?t:e.nullContext||{},l=e.hooks.helperMissing,c=e.escapeExpression,u=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'<form class="systemtags-rename-form">\n\t <label class="hidden-visually" for="'+c("function"==typeof(s=null!=(s=u(n,"cid")||(null!=t?u(t,"cid"):t))?s:l)?s.call(i,{name:"cid",hash:{},data:o,loc:{start:{line:2,column:38},end:{line:2,column:45}}}):s)+'-rename-input">'+c("function"==typeof(s=null!=(s=u(n,"renameLabel")||(null!=t?u(t,"renameLabel"):t))?s:l)?s.call(i,{name:"renameLabel",hash:{},data:o,loc:{start:{line:2,column:60},end:{line:2,column:75}}}):s)+'</label>\n\t<input id="'+c("function"==typeof(s=null!=(s=u(n,"cid")||(null!=t?u(t,"cid"):t))?s:l)?s.call(i,{name:"cid",hash:{},data:o,loc:{start:{line:3,column:12},end:{line:3,column:19}}}):s)+'-rename-input" type="text" value="'+c("function"==typeof(s=null!=(s=u(n,"name")||(null!=t?u(t,"name"):t))?s:l)?s.call(i,{name:"name",hash:{},data:o,loc:{start:{line:3,column:53},end:{line:3,column:61}}}):s)+'">\n'+(null!=(a=u(n,"if").call(i,null!=t?u(t,"isAdmin"):t,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.noop,data:o,loc:{start:{line:4,column:1},end:{line:6,column:8}}}))?a:"")+"</form>\n"},useData:!0})},function(e,t,n){var r=n(2);e.exports=(r.default||r).template({1:function(e,t,n,r,o){var a,s,i=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t<span class="label">'+(null!=(a="function"==typeof(s=null!=(s=i(n,"tagMarkup")||(null!=t?i(t,"tagMarkup"):t))?s:e.hooks.helperMissing)?s.call(null!=t?t:e.nullContext||{},{name:"tagMarkup",hash:{},data:o,loc:{start:{line:2,column:21},end:{line:2,column:36}}}):s)?a:"")+"</span>\n"},3:function(e,t,n,r,o){var a,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'\t<span class="label">'+e.escapeExpression("function"==typeof(a=null!=(a=s(n,"name")||(null!=t?s(t,"name"):t))?a:e.hooks.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"name",hash:{},data:o,loc:{start:{line:4,column:21},end:{line:4,column:29}}}):a)+"</span>\n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,r,o){var a,s=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(a=s(n,"if").call(null!=t?t:e.nullContext||{},null!=t?s(t,"isAdmin"):t,{name:"if",hash:{},fn:e.program(1,o,0),inverse:e.program(3,o,0),data:o,loc:{start:{line:1,column:0},end:{line:5,column:7}}}))?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 r=t.success;return(t=_.extend({},t)).success=function(){if(n.fetched=!0,r)return r.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,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}t.__esModule=!0;var a=o(n(3)),s=r(n(26)),i=r(n(1)),l=o(n(0)),c=o(n(27)),u=r(n(29));function d(){var e=new a.HandlebarsEnvironment;return l.extend(e,a),e.SafeString=s.default,e.Exception=i.default,e.Utils=l,e.escapeExpression=l.escapeExpression,e.VM=c,e.template=function(t){return c.template(t,e)},e}var f=d();f.create=d,u.default(f),f.default=f,t.default=f,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r=n(0);t.default=function(e){e.registerHelper("blockHelperMissing",(function(t,n){var o=n.inverse,a=n.fn;if(!0===t)return a(this);if(!1===t||null==t)return o(this);if(r.isArray(t))return t.length>0?(n.ids&&(n.ids=[n.name]),e.helpers.each(t,n)):o(this);if(n.data&&n.ids){var s=r.createFrame(n.data);s.contextPath=r.appendContextPath(n.data.contextPath,n.name),n={data:s}}return a(t,n)}))},e.exports=t.default},function(e,t,n){"use strict";(function(r){t.__esModule=!0;var o,a=n(0),s=n(1),i=(o=s)&&o.__esModule?o:{default:o};t.default=function(e){e.registerHelper("each",(function(e,t){if(!t)throw new i.default("Must pass iterator to #each");var n,o=t.fn,s=t.inverse,l=0,c="",u=void 0,d=void 0;function f(t,n,r){u&&(u.key=t,u.index=n,u.first=0===n,u.last=!!r,d&&(u.contextPath=d+t)),c+=o(e[t],{data:u,blockParams:a.blockParams([e[t],t],[d+t,null])})}if(t.data&&t.ids&&(d=a.appendContextPath(t.data.contextPath,t.ids[0])+"."),a.isFunction(e)&&(e=e.call(this)),t.data&&(u=a.createFrame(t.data)),e&&"object"==typeof e)if(a.isArray(e))for(var p=e.length;l<p;l++)l in e&&f(l,l,l===e.length-1);else if(r.Symbol&&e[r.Symbol.iterator]){for(var h=[],m=e[r.Symbol.iterator](),g=m.next();!g.done;g=m.next())h.push(g.value);for(p=(e=h).length;l<p;l++)f(l,l,l===e.length-1)}else n=void 0,Object.keys(e).forEach((function(e){void 0!==n&&f(n,l-1),n=e,l++})),void 0!==n&&f(n,l-1,!0);return 0===l&&(c=s(this)),c}))},e.exports=t.default}).call(this,n(5))},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(1),a=(r=o)&&r.__esModule?r:{default:r};t.default=function(e){e.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new a.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(0),a=n(1),s=(r=a)&&r.__esModule?r:{default:r};t.default=function(e){e.registerHelper("if",(function(e,t){if(2!=arguments.length)throw new s.default("#if requires exactly one argument");return o.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||o.isEmpty(e)?t.inverse(this):t.fn(this)})),e.registerHelper("unless",(function(t,n){if(2!=arguments.length)throw new s.default("#unless requires exactly one argument");return e.helpers.if.call(this,t,{fn:n.inverse,inverse:n.fn,hash:n.hash})}))},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("log",(function(){for(var t=[void 0],n=arguments[arguments.length-1],r=0;r<arguments.length-1;r++)t.push(arguments[r]);var o=1;null!=n.hash.level?o=n.hash.level:n.data&&null!=n.data.level&&(o=n.data.level),t[0]=o,e.log.apply(e,t)}))},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("lookup",(function(e,t,n){return e?n.lookupProperty(e,t):e}))},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(0),a=n(1),s=(r=a)&&r.__esModule?r:{default:r};t.default=function(e){e.registerHelper("with",(function(e,t){if(2!=arguments.length)throw new s.default("#with requires exactly one argument");o.isFunction(e)&&(e=e.call(this));var n=t.fn;if(o.isEmpty(e))return t.inverse(this);var r=t.data;return t.data&&t.ids&&((r=o.createFrame(t.data)).contextPath=o.appendContextPath(t.data.contextPath,t.ids[0])),n(e,{data:r,blockParams:o.blockParams([e],[r&&r.contextPath])})}))},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.registerDefaultDecorators=function(e){a.default(e)};var r,o=n(24),a=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(0);t.default=function(e){e.registerDecorator("inline",(function(e,t,n,o){var a=e;return t.partials||(t.partials={},a=function(o,a){var s=n.partials;n.partials=r.extend({},s,t.partials);var i=e(o,a);return n.partials=s,i}),t.partials[o.args[0]]=o.fn,a}))},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.createNewLookupObject=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.extend.apply(void 0,[Object.create(null)].concat(t))};var r=n(0)},function(e,t,n){"use strict";function r(e){this.string=e}t.__esModule=!0,r.prototype.toString=r.prototype.toHTML=function(){return""+this.string},t.default=r,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.checkRevision=function(e){var t=e&&e[0]||1,n=i.COMPILER_REVISION;if(t>=i.LAST_COMPATIBLE_COMPILER_REVISION&&t<=i.COMPILER_REVISION)return;if(t<i.LAST_COMPATIBLE_COMPILER_REVISION){var r=i.REVISION_CHANGES[n],o=i.REVISION_CHANGES[t];throw new s.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+r+") or downgrade your runtime to an older version ("+o+").")}throw new s.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+e[1]+").")},t.template=function(e,t){if(!t)throw new s.default("No environment passed to template");if(!e||!e.main)throw new s.default("Unknown template object: "+typeof e);e.main.decorator=e.main_d,t.VM.checkRevision(e.compiler);var n=e.compiler&&7===e.compiler[0];var r={strict:function(e,t,n){if(!e||!(t in e))throw new s.default('"'+t+'" not defined in '+e,{loc:n});return e[t]},lookupProperty:function(e,t){var n=e[t];return null==n||Object.prototype.hasOwnProperty.call(e,t)||u.resultIsAllowed(n,r.protoAccessControl,t)?n:void 0},lookup:function(e,t){for(var n=e.length,o=0;o<n;o++){if(null!=(e[o]&&r.lookupProperty(e[o],t)))return e[o][t]}},lambda:function(e,t){return"function"==typeof e?e.call(t):e},escapeExpression:o.escapeExpression,invokePartial:function(n,r,a){a.hash&&(r=o.extend({},r,a.hash),a.ids&&(a.ids[0]=!0)),n=t.VM.resolvePartial.call(this,n,r,a);var i=o.extend({},a,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),l=t.VM.invokePartial.call(this,n,r,i);if(null==l&&t.compile&&(a.partials[a.name]=t.compile(n,e.compilerOptions,t),l=a.partials[a.name](r,i)),null!=l){if(a.indent){for(var c=l.split("\n"),u=0,d=c.length;u<d&&(c[u]||u+1!==d);u++)c[u]=a.indent+c[u];l=c.join("\n")}return l}throw new s.default("The partial "+a.name+" could not be compiled when running in runtime-only mode")},fn:function(t){var n=e[t];return n.decorator=e[t+"_d"],n},programs:[],program:function(e,t,n,r,o){var a=this.programs[e],s=this.fn(e);return t||o||r||n?a=d(this,e,s,t,n,r,o):a||(a=this.programs[e]=d(this,e,s)),a},data:function(e,t){for(;e&&t--;)e=e._parent;return e},mergeIfNeeded:function(e,t){var n=e||t;return e&&t&&e!==t&&(n=o.extend({},t,e)),n},nullContext:Object.seal({}),noop:t.VM.noop,compilerInfo:e.compiler};function a(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=n.data;a._setup(n),!n.partial&&e.useData&&(o=p(t,o));var s=void 0,i=e.useBlockParams?[]:void 0;function l(t){return""+e.main(r,t,r.helpers,r.partials,o,i,s)}return e.useDepths&&(s=n.depths?t!=n.depths[0]?[t].concat(n.depths):n.depths:[t]),(l=h(e.main,l,r,n.depths||[],o,i))(t,n)}return a.isTop=!0,a._setup=function(a){if(a.partial)r.protoAccessControl=a.protoAccessControl,r.helpers=a.helpers,r.partials=a.partials,r.decorators=a.decorators,r.hooks=a.hooks;else{var s=o.extend({},t.helpers,a.helpers);!function(e,t){Object.keys(e).forEach((function(n){var r=e[n];e[n]=function(e,t){var n=t.lookupProperty;return c.wrapHelper(e,(function(e){return o.extend({lookupProperty:n},e)}))}(r,t)}))}(s,r),r.helpers=s,e.usePartial&&(r.partials=r.mergeIfNeeded(a.partials,t.partials)),(e.usePartial||e.useDecorators)&&(r.decorators=o.extend({},t.decorators,a.decorators)),r.hooks={},r.protoAccessControl=u.createProtoAccessControl(a);var i=a.allowCallsToHelperMissing||n;l.moveHelperToHooks(r,"helperMissing",i),l.moveHelperToHooks(r,"blockHelperMissing",i)}},a._child=function(t,n,o,a){if(e.useBlockParams&&!o)throw new s.default("must pass block params");if(e.useDepths&&!a)throw new s.default("must pass parent depths");return d(r,t,e[t],n,0,o,a)},a},t.wrapProgram=d,t.resolvePartial=function(e,t,n){e?e.call||n.name||(n.name=e,e=n.partials[e]):e="@partial-block"===n.name?n.data["partial-block"]:n.partials[n.name];return e},t.invokePartial=function(e,t,n){var r=n.data&&n.data["partial-block"];n.partial=!0,n.ids&&(n.data.contextPath=n.ids[0]||n.data.contextPath);var a=void 0;n.fn&&n.fn!==f&&function(){n.data=i.createFrame(n.data);var e=n.fn;a=n.data["partial-block"]=function(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return n.data=i.createFrame(n.data),n.data["partial-block"]=r,e(t,n)},e.partials&&(n.partials=o.extend({},n.partials,e.partials))}();void 0===e&&a&&(e=a);if(void 0===e)throw new s.default("The partial "+n.name+" could not be found");if(e instanceof Function)return e(t,n)},t.noop=f;var r,o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(0)),a=n(1),s=(r=a)&&r.__esModule?r:{default:r},i=n(3),l=n(4),c=n(28),u=n(7);function d(e,t,n,r,o,a,s){function i(t){var o=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=s;return!s||t==s[0]||t===e.nullContext&&null===s[0]||(i=[t].concat(s)),n(e,t,e.helpers,e.partials,o.data||r,a&&[o.blockParams].concat(a),i)}return(i=h(n,i,e,s,r,a)).program=t,i.depth=s?s.length:0,i.blockParams=o||0,i}function f(){return""}function p(e,t){return t&&"root"in t||((t=t?i.createFrame(t):{}).root=e),t}function h(e,t,n,r,a,s){if(e.decorator){var i={};t=e.decorator(t,i,n,r&&r[0],a,s,r),o.extend(t,i)}return t}},function(e,t,n){"use strict";t.__esModule=!0,t.wrapHelper=function(e,t){if("function"!=typeof e)return e;return function(){var n=arguments[arguments.length-1];return arguments[arguments.length-1]=t(n),e.apply(this,arguments)}}},function(e,t,n){"use strict";(function(n){t.__esModule=!0,t.default=function(e){var t=void 0!==n?n:window,r=t.Handlebars;e.noConflict=function(){return t.Handlebars===e&&(t.Handlebars=r),e}},e.exports=t.default}).call(this,n(5))},function(e,t,n){var r=n(31);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n(34).default)("bdf318e0",r,!0,{})},function(e,t,n){(t=n(32)(!1)).push([e.i,".systemtags-select2-dropdown .select2-result-label .checkmark{visibility:hidden;margin-left:-5px;margin-right:5px;padding:4px}.systemtags-select2-dropdown .select2-result-label .new-item .systemtags-actions{display:none}.systemtags-select2-dropdown .select2-selected .select2-result-label .checkmark{visibility:visible}.systemtags-select2-dropdown .select2-result-label .icon{display:inline-block;opacity:.5}.systemtags-select2-dropdown .select2-result-label .icon.rename{padding:4px}.systemtags-select2-dropdown .systemtags-actions{position:absolute;right:5px}.systemtags-select2-dropdown .systemtags-rename-form{display:inline-block;width:calc(100% - 20px);top:-6px;position:relative}.systemtags-select2-dropdown .systemtags-rename-form input{display:inline-block;height:30px;width:calc(100% - 40px)}.systemtags-select2-dropdown .label{width:85%;display:inline-block;overflow:hidden;text-overflow:ellipsis}.systemtags-select2-dropdown .label.hidden{display:none}.systemtags-select2-dropdown span{line-height:25px}.systemtags-select2-dropdown .systemtags-item{display:inline-block;height:25px;width:100%}.systemtags-select2-dropdown .select2-result-label{height:25px}.systemTagsInfoView,.systemtags-select2-container{width:100%}.systemTagsInfoView .select2-choices,.systemtags-select2-container .select2-choices{flex-wrap:nowrap !important;max-height:44px}.systemTagsInfoView .select2-choices .select2-search-choice.select2-locked .label,.systemtags-select2-container .select2-choices .select2-search-choice.select2-locked .label{opacity:0.5}#select2-drop.systemtags-select2-dropdown .select2-results li.select2-result{padding:5px}\n",""]),e.exports=t},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]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(s=r,i=btoa(unescape(encodeURIComponent(JSON.stringify(s)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(i),"/*# ".concat(l," */")),a=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return[n].concat(a).concat([o]).join("\n")}var s,i,l;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var a=0;a<this.length;a++){var s=this[a][0];null!=s&&(o[s]=!0)}for(var i=0;i<e.length;i++){var l=[].concat(e[i]);r&&o[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}},function(e,n,r){"use strict";r.r(n);var o=r(8),a=r.n(o);!function(e){e.SystemTags={getDescriptiveTag:function(e){if(_.isUndefined(e.name)&&!_.isUndefined(e.toJSON)&&(e=e.toJSON()),_.isUndefined(e.name))return $("<span>").addClass("non-existing-tag").text(t("core","Non-existing tag #{tag}",{tag:e}));var n,r=$("<span>");return r.append(a()(e.name)),e.userAssignable||(n=t("core","restricted")),e.userVisible||(n=t("core","invisible")),n&&r.append($("<em>").text(" ("+n+")")),r}}}(OC);r(12),r(13),r(14);var s=r(9),i=r.n(s),l=r(10),c=r.n(l),u=r(11),d=r.n(u);!function(e){var n=e.Backbone.View.extend({_rendered:!1,_newTag:null,_lastUsedTags:[],className:"systemTagsInputFieldContainer",template:function(e){return'<input class="systemTagsInputField" type="hidden" name="tags" value=""/>'},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(e){var n=$(e.target).closest(".systemtags-item"),r=n.attr("data-id"),o=this.collection.get(r).get("name"),a=$(c()({cid:this.cid,name:o,deleteTooltip:t("core","Delete"),renameLabel:t("core","Rename"),isAdmin:this._isAdmin}));return n.find(".label").after(a),n.find(".label, .systemtags-actions").addClass("hidden"),n.closest(".select2-result").addClass("has-form"),a.find("[title]").tooltip({placement:"bottom",container:"body"}),a.find("input").focus().selectRange(0,o.length),!1},_onSubmitRenameTag:function(e){e.preventDefault();var t=$(e.target),n=t.closest(".systemtags-item"),r=n.attr("data-id"),o=this.collection.get(r),a=$(e.target).find("input").val().trim();a&&a!==o.get("name")&&(o.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,r){409===r.status&&(n.collection.reset(),n.collection.fetch({success:function(t){var r=t.where({name:e.object.name.trim(),userVisible:!0,userAssignable:!0});r.length&&(r=r[0],n._addToSelect2Selection(r.toJSON()),n.trigger("select",r))}}))}}),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 r=n.filterByName(e.term.trim());t._isAdmin||(r=_.filter(r,(function(e){return e.get("canAssign")}))),e.callback({results:_.invoke(r,"toJSON")})}})},_preventDefault:function(e){e.stopPropagation()},_formatDropDownResult:function(n){return i()(_.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 d()(_.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,r=$(e).val().split(",");function o(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,o)}(r))}})},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 r=_.pluck(n.$tagsField.select2("data"),"id");return t.sort((function(t,o){var a=r.indexOf(t.id)>=0,s=r.indexOf(o.id)>=0;if(a===s){var i=n._lastUsedTags.indexOf(t.id),l=n._lastUsedTags.indexOf(o.id);return i!==l?-1===l?-1:-1===i?1:i<l?-1:1:e.Util.naturalSortCompare(t.name,o.name)}return a&&!s?-1:1})),t},formatNoMatches:function(){return t("core","No tags found")}}).on("select2-selecting",this._onSelectTag).on("select2-removing",this._onDeselectTag);var r=this.$tagsField.select2("dropdown");r.on("mouseup",".rename",this._onClickRenameTag),r.on("mouseup",".delete",this._onClickDeleteTag),r.on("mouseup",".select2-result-selectable.has-form",this._preventDefault),r.on("submit",".systemtags-rename-form",this._onSubmitRenameTag),this.delegateEvents()},remove:function(){this.$tagsField&&this.$tagsField.select2("destroy")},getValues:function(){this.$tagsField.select2("val")},setValues:function(e){this.$tagsField.select2("val",e)},setData:function(e){this.$tagsField.select2("data",e)}});e.SystemTags=e.SystemTags||{},e.SystemTags.SystemTagsInputField=n}(OC);r(30)},function(e,t,n){"use strict";function r(e,t){for(var n=[],r={},o=0;o<t.length;o++){var a=t[o],s=a[0],i={id:e+":"+o,css:a[1],media:a[2],sourceMap:a[3]};r[s]?r[s].parts.push(i):n.push(r[s]={id:s,parts:[i]})}return n}n.r(t),n.d(t,"default",(function(){return p}));var o="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!o)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var a={},s=o&&(document.head||document.getElementsByTagName("head")[0]),i=null,l=0,c=!1,u=function(){},d=null,f="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function p(e,t,n,o){c=n,d=o||{};var s=r(e,t);return h(s),function(t){for(var n=[],o=0;o<s.length;o++){var i=s[o];(l=a[i.id]).refs--,n.push(l)}t?h(s=r(e,t)):s=[];for(o=0;o<n.length;o++){var l;if(0===(l=n[o]).refs){for(var c=0;c<l.parts.length;c++)l.parts[c]();delete a[l.id]}}}}function h(e){for(var t=0;t<e.length;t++){var n=e[t],r=a[n.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](n.parts[o]);for(;o<n.parts.length;o++)r.parts.push(g(n.parts[o]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var s=[];for(o=0;o<n.parts.length;o++)s.push(g(n.parts[o]));a[n.id]={id:n.id,refs:1,parts:s}}}}function m(){var e=document.createElement("style");return e.type="text/css",s.appendChild(e),e}function g(e){var t,n,r=document.querySelector('style[data-vue-ssr-id~="'+e.id+'"]');if(r){if(c)return u;r.parentNode.removeChild(r)}if(f){var o=l++;r=i||(i=m()),t=_.bind(null,r,o,!1),n=_.bind(null,r,o,!0)}else r=m(),t=b.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}var v,y=(v=[],function(e,t){return v[e]=t,v.filter(Boolean).join("\n")});function _(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=y(t,o);else{var a=document.createTextNode(o),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(a,s[t]):e.appendChild(a)}}function b(e,t){var n=t.css,r=t.media,o=t.sourceMap;if(r&&e.setAttribute("media",r),d.ssrId&&e.setAttribute("data-vue-ssr-id",t.id),o&&(n+="\n/*# sourceURL="+o.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}}]);
 //# sourceMappingURL=systemtags.js.map
\ No newline at end of file
index a63e0d251eba642962540fcc9b45922def3d416c..01d7cb6de3dcb2be5e1071227007cbda78830896 100644 (file)
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./core/js/systemtags/merged-systemtags.js","webpack:///./core/js/systemtags/systemtags.js","webpack:///./core/js/systemtags/templates.js","webpack:///./core/js/systemtags/systemtagmodel.js","webpack:///./core/js/systemtags/systemtagsmappingcollection.js","webpack:///./core/js/systemtags/systemtagscollection.js","webpack:///./core/js/systemtags/systemtagsinputfield.js","webpack:///./core/css/systemtags.scss?456a","webpack:///./core/css/systemtags.scss","webpack:///./node_modules/css-loader/dist/runtime/api.js","webpack:///./node_modules/vue-style-loader/lib/listToStyles.js","webpack:///./node_modules/vue-style-loader/lib/addStylesClient.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","OC","SystemTags","getDescriptiveTag","tag","_","isUndefined","toJSON","$","addClass","text","scope","$span","append","escapeHTML","userAssignable","userVisible","template","templates","Handlebars","Templates","container","depth0","helpers","partials","data","stack1","helper","lookupProperty","parent","propertyName","hooks","helperMissing","nullContext","escapeExpression","options","alias1","alias2","buffer","program","noop","blockHelperMissing","alias4","extend","Files","Client","PROPERTY_FILEID","NS_OWNCLOUD","PROPERTY_CAN_ASSIGN","PROPERTY_DISPLAYNAME","PROPERTY_USERVISIBLE","PROPERTY_USERASSIGNABLE","SystemTagModel","Backbone","Model","sync","davSync","defaults","canAssign","davProperties","parse","id","SystemTagsMappingCollection","Collection","usePUT","_objectId","_objectType","model","url","linkToRemote","this","setObjectId","objectId","setObjectType","objectType","initialize","models","getTagIds","map","SystemTagsCollection","filterByName","filter","term","substr","length","toLowerCase","filterFunction","reset","fetched","apply","arguments","fetch","self","force","success","trigger","Promise","resolve","collection","SystemTagsInputField","View","_rendered","_newTag","_lastUsedTags","className","_multiple","multiple","_allowActions","allowActions","_allowCreate","allowCreate","_isAdmin","isAdmin","isFunction","initSelection","_initSelection","on","defer","_refreshSelection","_getLastUsedTags","bindAll","ajax","type","generateUrl","response","$tagsField","select2","val","_onClickRenameTag","ev","$item","target","closest","tagId","attr","oldName","$renameForm","cid","deleteTooltip","renameLabel","find","after","tooltip","placement","focus","selectRange","_onSubmitRenameTag","preventDefault","$form","tagModel","newName","trim","save","removeClass","remove","_onClickDeleteTag","destroy","_addToSelect2Selection","selection","push","_onSelectTag","e","isNew","unshift","error","xhr","status","where","_onDeselectTag","choice","_queryTagsAutocomplete","query","tagModels","callback","results","invoke","_preventDefault","stopPropagation","_formatDropDownResult","renameTooltip","tagMarkup","innerHTML","_formatSelection","_createSearchChoice","entry","element","ids","split","modelToSelection","locked","selectedModels","indexOf","findSelectedObjects","render","$el","html","placeholder","containerCssClass","dropdownCssClass","closeOnSelect","allowClear","toggleSelect","formatResult","formatSelection","createSearchChoice","undefined","sortResults","selectedItems","pluck","sort","a","b","aSelected","bSelected","aLastUsed","bLastUsed","Util","naturalSortCompare","formatNoMatches","$dropDown","delegateEvents","getValues","setValues","values","setData","content","locals","add","default","___CSS_LOADER_API_IMPORT___","useSourceMap","list","toString","item","cssMapping","btoa","sourceMapping","sourceMap","base64","unescape","encodeURIComponent","JSON","stringify","concat","sourceURLs","sources","source","sourceRoot","join","cssWithMappingToString","mediaQuery","dedupe","alreadyImportedModules","_i","listToStyles","parentId","styles","newStyles","part","css","media","parts","hasDocument","document","DEBUG","Error","stylesInDom","head","getElementsByTagName","singletonElement","singletonCounter","isProduction","isOldIE","navigator","test","userAgent","addStylesClient","_isProduction","_options","addStylesToDom","newList","mayRemove","domStyle","refs","j","addStyle","createStyleElement","styleElement","createElement","appendChild","obj","update","querySelector","parentNode","removeChild","styleIndex","applyToSingletonTag","applyToTag","newObj","textStore","replaceText","index","replacement","Boolean","styleSheet","cssText","cssNode","createTextNode","childNodes","insertBefore","setAttribute","ssrId","firstChild"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAG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AAU8B,EAAI9B,OACrBsC,EAAO7D,YAAcqD,EAAIrD,UAC3B,OAEFsD,EAAOD,EAAMQ,QAEbhJ,KAKN,IACMiJ,EADFC,GACED,EAAY,GAET,SAAUE,EAAOC,GAEtB,OADAH,EAAUE,GAASC,EACZH,EAAU1N,OAAO8N,SAASvD,KAAK,QAI1C,SAASgD,EAAqBT,EAAcc,EAAOnJ,EAAQwI,GACzD,IAAI/B,EAAMzG,EAAS,GAAKwI,EAAI/B,IAE5B,GAAI4B,EAAaiB,WACfjB,EAAaiB,WAAWC,QAAUL,EAAYC,EAAO1C,OAChD,CACL,IAAI+C,EAAU3C,SAAS4C,eAAehD,GAClCiD,EAAarB,EAAaqB,WAC1BA,EAAWP,IAAQd,EAAaO,YAAYc,EAAWP,IACvDO,EAAWhO,OACb2M,EAAasB,aAAaH,EAASE,EAAWP,IAE9Cd,EAAaE,YAAYiB,IAK/B,SAAST,EAAYV,EAAcG,GACjC,IAAI/B,EAAM+B,EAAI/B,IACVC,EAAQ8B,EAAI9B,MACZvB,EAAYqD,EAAIrD,UAiBpB,GAfIuB,GACF2B,EAAauB,aAAa,QAASlD,GAEjCjO,EAAQoR,OACVxB,EAAauB,aA7JF,kBA6JyBpB,EAAIrO,IAGtCgL,IAGFsB,GAAO,mBAAqBtB,EAAUQ,QAAQ,GAAK,MAEnDc,GAAO,uDAAyDxB,KAAKI,SAASC,mBAAmBC,KAAKC,UAAUL,MAAgB,OAG9HkD,EAAaiB,WACfjB,EAAaiB,WAAWC,QAAU9C,MAC7B,CACL,KAAO4B,EAAayB,YAClBzB,EAAaO,YAAYP,EAAayB,YAExCzB,EAAaE,YAAY1B,SAAS4C,eAAehD","file":"systemtags.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","import './systemtags.js'\nimport './templates.js'\nimport './systemtagmodel.js'\nimport './systemtagsmappingcollection.js'\nimport './systemtagscollection.js'\nimport './systemtagsinputfield.js'\n\nimport '../../css/systemtags.scss'\n","/* eslint-disable */\n/*\n * Copyright (c) 2016\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\n(function(OC) {\n\t/**\n\t * @namespace\n\t */\n\tOC.SystemTags = {\n\t\t/**\n\t\t *\n\t\t * @param {OC.SystemTags.SystemTagModel|Object|String} tag\n\t\t * @returns {jQuery}\n\t\t */\n\t\tgetDescriptiveTag: function(tag) {\n\t\t\tif (_.isUndefined(tag.name) && !_.isUndefined(tag.toJSON)) {\n\t\t\t\ttag = tag.toJSON()\n\t\t\t}\n\n\t\t\tif (_.isUndefined(tag.name)) {\n\t\t\t\treturn $('<span>').addClass('non-existing-tag').text(\n\t\t\t\t\tt('core', 'Non-existing tag #{tag}', {\n\t\t\t\t\t\ttag: tag\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tvar $span = $('<span>')\n\t\t\t$span.append(escapeHTML(tag.name))\n\n\t\t\tvar scope\n\t\t\tif (!tag.userAssignable) {\n\t\t\t\tscope = t('core', 'restricted')\n\t\t\t}\n\t\t\tif (!tag.userVisible) {\n\t\t\t\t// invisible also implicitly means not assignable\n\t\t\t\tscope = t('core', 'invisible')\n\t\t\t}\n\t\t\tif (scope) {\n\t\t\t\t$span.append($('<em>').text(' (' + scope + ')'))\n\t\t\t}\n\t\t\treturn $span\n\t\t}\n\t}\n})(OC)\n","(function() {\n  var template = Handlebars.template, templates = OC.SystemTags.Templates = OC.SystemTags.Templates || {};\ntemplates['result'] = template({\"1\":function(container,depth0,helpers,partials,data) {\n    return \" new-item\";\n},\"3\":function(container,depth0,helpers,partials,data) {\n    var stack1, helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    };\n\n  return \"\t\t<span class=\\\"label\\\">\"\n    + ((stack1 = ((helper = (helper = lookupProperty(helpers,\"tagMarkup\") || (depth0 != null ? lookupProperty(depth0,\"tagMarkup\") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"tagMarkup\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":4,\"column\":22},\"end\":{\"line\":4,\"column\":37}}}) : helper))) != null ? stack1 : \"\")\n    + \"</span>\\n\";\n},\"5\":function(container,depth0,helpers,partials,data) {\n    var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    };\n\n  return \"\t\t<span class=\\\"label\\\">\"\n    + container.escapeExpression(((helper = (helper = lookupProperty(helpers,\"name\") || (depth0 != null ? lookupProperty(depth0,\"name\") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"name\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":6,\"column\":22},\"end\":{\"line\":6,\"column\":30}}}) : helper)))\n    + \"</span>\\n\";\n},\"7\":function(container,depth0,helpers,partials,data) {\n    var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    };\n\n  return \"\t\t<span class=\\\"systemtags-actions\\\">\\n\t\t\t<a href=\\\"#\\\" class=\\\"rename icon icon-rename\\\" title=\\\"\"\n    + container.escapeExpression(((helper = (helper = lookupProperty(helpers,\"renameTooltip\") || (depth0 != null ? lookupProperty(depth0,\"renameTooltip\") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"renameTooltip\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":10,\"column\":54},\"end\":{\"line\":10,\"column\":71}}}) : helper)))\n    + \"\\\"></a>\\n\t\t</span>\\n\";\n},\"compiler\":[8,\">= 4.3.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n    var stack1, helper, options, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=\"function\", lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    }, buffer = \n  \"<span class=\\\"systemtags-item\"\n    + ((stack1 = lookupProperty(helpers,\"if\").call(alias1,(depth0 != null ? lookupProperty(depth0,\"isNew\") : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(1, data, 0),\"inverse\":container.noop,\"data\":data,\"loc\":{\"start\":{\"line\":1,\"column\":28},\"end\":{\"line\":1,\"column\":57}}})) != null ? stack1 : \"\")\n    + \"\\\" data-id=\\\"\"\n    + container.escapeExpression(((helper = (helper = lookupProperty(helpers,\"id\") || (depth0 != null ? lookupProperty(depth0,\"id\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"id\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":1,\"column\":68},\"end\":{\"line\":1,\"column\":74}}}) : helper)))\n    + \"\\\">\\n<span class=\\\"checkmark icon icon-checkmark\\\"></span>\\n\"\n    + ((stack1 = lookupProperty(helpers,\"if\").call(alias1,(depth0 != null ? lookupProperty(depth0,\"isAdmin\") : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(3, data, 0),\"inverse\":container.program(5, data, 0),\"data\":data,\"loc\":{\"start\":{\"line\":3,\"column\":1},\"end\":{\"line\":7,\"column\":8}}})) != null ? stack1 : \"\");\n  stack1 = ((helper = (helper = lookupProperty(helpers,\"allowActions\") || (depth0 != null ? lookupProperty(depth0,\"allowActions\") : depth0)) != null ? helper : alias2),(options={\"name\":\"allowActions\",\"hash\":{},\"fn\":container.program(7, data, 0),\"inverse\":container.noop,\"data\":data,\"loc\":{\"start\":{\"line\":8,\"column\":1},\"end\":{\"line\":12,\"column\":18}}}),(typeof helper === alias3 ? helper.call(alias1,options) : helper));\n  if (!lookupProperty(helpers,\"allowActions\")) { stack1 = container.hooks.blockHelperMissing.call(depth0,stack1,options)}\n  if (stack1 != null) { buffer += stack1; }\n  return buffer + \"</span>\\n\";\n},\"useData\":true});\ntemplates['result_form'] = template({\"1\":function(container,depth0,helpers,partials,data) {\n    var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    };\n\n  return \"\t\t<a href=\\\"#\\\" class=\\\"delete icon icon-delete\\\" title=\\\"\"\n    + container.escapeExpression(((helper = (helper = lookupProperty(helpers,\"deleteTooltip\") || (depth0 != null ? lookupProperty(depth0,\"deleteTooltip\") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"deleteTooltip\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":5,\"column\":53},\"end\":{\"line\":5,\"column\":70}}}) : helper)))\n    + \"\\\"></a>\\n\";\n},\"compiler\":[8,\">= 4.3.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=\"function\", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    };\n\n  return \"<form class=\\\"systemtags-rename-form\\\">\\n\t <label class=\\\"hidden-visually\\\" for=\\\"\"\n    + alias4(((helper = (helper = lookupProperty(helpers,\"cid\") || (depth0 != null ? lookupProperty(depth0,\"cid\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"cid\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":2,\"column\":38},\"end\":{\"line\":2,\"column\":45}}}) : helper)))\n    + \"-rename-input\\\">\"\n    + alias4(((helper = (helper = lookupProperty(helpers,\"renameLabel\") || (depth0 != null ? lookupProperty(depth0,\"renameLabel\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"renameLabel\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":2,\"column\":60},\"end\":{\"line\":2,\"column\":75}}}) : helper)))\n    + \"</label>\\n\t<input id=\\\"\"\n    + alias4(((helper = (helper = lookupProperty(helpers,\"cid\") || (depth0 != null ? lookupProperty(depth0,\"cid\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"cid\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":3,\"column\":12},\"end\":{\"line\":3,\"column\":19}}}) : helper)))\n    + \"-rename-input\\\" type=\\\"text\\\" value=\\\"\"\n    + alias4(((helper = (helper = lookupProperty(helpers,\"name\") || (depth0 != null ? lookupProperty(depth0,\"name\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"name\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":3,\"column\":53},\"end\":{\"line\":3,\"column\":61}}}) : helper)))\n    + \"\\\">\\n\"\n    + ((stack1 = lookupProperty(helpers,\"if\").call(alias1,(depth0 != null ? lookupProperty(depth0,\"isAdmin\") : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(1, data, 0),\"inverse\":container.noop,\"data\":data,\"loc\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":6,\"column\":8}}})) != null ? stack1 : \"\")\n    + \"</form>\\n\";\n},\"useData\":true});\ntemplates['selection'] = template({\"1\":function(container,depth0,helpers,partials,data) {\n    var stack1, helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    };\n\n  return \"\t<span class=\\\"label\\\">\"\n    + ((stack1 = ((helper = (helper = lookupProperty(helpers,\"tagMarkup\") || (depth0 != null ? lookupProperty(depth0,\"tagMarkup\") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"tagMarkup\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":2,\"column\":21},\"end\":{\"line\":2,\"column\":36}}}) : helper))) != null ? stack1 : \"\")\n    + \"</span>\\n\";\n},\"3\":function(container,depth0,helpers,partials,data) {\n    var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    };\n\n  return \"\t<span class=\\\"label\\\">\"\n    + container.escapeExpression(((helper = (helper = lookupProperty(helpers,\"name\") || (depth0 != null ? lookupProperty(depth0,\"name\") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"name\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":4,\"column\":21},\"end\":{\"line\":4,\"column\":29}}}) : helper)))\n    + \"</span>\\n\";\n},\"compiler\":[8,\">= 4.3.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n    var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    };\n\n  return ((stack1 = lookupProperty(helpers,\"if\").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,\"isAdmin\") : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(1, data, 0),\"inverse\":container.program(3, data, 0),\"data\":data,\"loc\":{\"start\":{\"line\":1,\"column\":0},\"end\":{\"line\":5,\"column\":7}}})) != null ? stack1 : \"\");\n},\"useData\":true});\n})();","/*\n * Copyright (c) 2015\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\n(function(OC) {\n\n\t_.extend(OC.Files.Client, {\n\t\tPROPERTY_FILEID:\t'{' + OC.Files.Client.NS_OWNCLOUD + '}id',\n\t\tPROPERTY_CAN_ASSIGN: '{' + OC.Files.Client.NS_OWNCLOUD + '}can-assign',\n\t\tPROPERTY_DISPLAYNAME:\t'{' + OC.Files.Client.NS_OWNCLOUD + '}display-name',\n\t\tPROPERTY_USERVISIBLE:\t'{' + OC.Files.Client.NS_OWNCLOUD + '}user-visible',\n\t\tPROPERTY_USERASSIGNABLE: '{' + OC.Files.Client.NS_OWNCLOUD + '}user-assignable',\n\t})\n\n\t/**\n\t * @class OCA.SystemTags.SystemTagsCollection\n\t * @classdesc\n\t *\n\t * System tag\n\t *\n\t */\n\tconst SystemTagModel = OC.Backbone.Model.extend(\n\t\t/** @lends OCA.SystemTags.SystemTagModel.prototype */ {\n\t\t\tsync: OC.Backbone.davSync,\n\n\t\t\tdefaults: {\n\t\t\t\tuserVisible: true,\n\t\t\t\tuserAssignable: true,\n\t\t\t\tcanAssign: true,\n\t\t\t},\n\n\t\t\tdavProperties: {\n\t\t\t\t'id':\tOC.Files.Client.PROPERTY_FILEID,\n\t\t\t\t'name': OC.Files.Client.PROPERTY_DISPLAYNAME,\n\t\t\t\t'userVisible': OC.Files.Client.PROPERTY_USERVISIBLE,\n\t\t\t\t'userAssignable': OC.Files.Client.PROPERTY_USERASSIGNABLE,\n\t\t\t\t// read-only, effective permissions computed by the server,\n\t\t\t\t'canAssign': OC.Files.Client.PROPERTY_CAN_ASSIGN,\n\t\t\t},\n\n\t\t\tparse: function(data) {\n\t\t\t\treturn {\n\t\t\t\t\tid: data.id,\n\t\t\t\t\tname: data.name,\n\t\t\t\t\tuserVisible: data.userVisible === true || data.userVisible === 'true',\n\t\t\t\t\tuserAssignable: data.userAssignable === true || data.userAssignable === 'true',\n\t\t\t\t\tcanAssign: data.canAssign === true || data.canAssign === 'true',\n\t\t\t\t}\n\t\t\t},\n\t\t})\n\n\tOC.SystemTags = OC.SystemTags || {}\n\tOC.SystemTags.SystemTagModel = SystemTagModel\n})(OC)\n","/*\n * Copyright (c) 2015\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\n(function(OC) {\n\t/**\n\t * @class OC.SystemTags.SystemTagsMappingCollection\n\t * @classdesc\n\t *\n\t * Collection of tags assigned to a an object\n\t *\n\t */\n\tconst SystemTagsMappingCollection = OC.Backbone.Collection.extend(\n\t\t/** @lends OC.SystemTags.SystemTagsMappingCollection.prototype */ {\n\n\t\t\tsync: OC.Backbone.davSync,\n\n\t\t\t/**\n\t\t * Use PUT instead of PROPPATCH\n\t\t */\n\t\t\tusePUT: true,\n\n\t\t\t/**\n\t\t * Id of the file for which to filter activities by\n\t\t *\n\t\t * @var int\n\t\t */\n\t\t\t_objectId: null,\n\n\t\t\t/**\n\t\t * Type of the object to filter by\n\t\t *\n\t\t * @var string\n\t\t */\n\t\t\t_objectType: 'files',\n\n\t\t\tmodel: OC.SystemTags.SystemTagModel,\n\n\t\t\turl: function() {\n\t\t\t\treturn OC.linkToRemote('dav') + '/systemtags-relations/' + this._objectType + '/' + this._objectId\n\t\t\t},\n\n\t\t\t/**\n\t\t * Sets the object id to filter by or null for all.\n\t\t *\n\t\t * @param {int} objectId file id or null\n\t\t */\n\t\t\tsetObjectId: function(objectId) {\n\t\t\t\tthis._objectId = objectId\n\t\t\t},\n\n\t\t\t/**\n\t\t * Sets the object type to filter by or null for all.\n\t\t *\n\t\t * @param {int} objectType file id or null\n\t\t */\n\t\t\tsetObjectType: function(objectType) {\n\t\t\t\tthis._objectType = objectType\n\t\t\t},\n\n\t\t\tinitialize: function(models, options) {\n\t\t\t\toptions = options || {}\n\t\t\t\tif (!_.isUndefined(options.objectId)) {\n\t\t\t\t\tthis._objectId = options.objectId\n\t\t\t\t}\n\t\t\t\tif (!_.isUndefined(options.objectType)) {\n\t\t\t\t\tthis._objectType = options.objectType\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tgetTagIds: function() {\n\t\t\t\treturn this.map(function(model) {\n\t\t\t\t\treturn model.id\n\t\t\t\t})\n\t\t\t},\n\t\t})\n\n\tOC.SystemTags = OC.SystemTags || {}\n\tOC.SystemTags.SystemTagsMappingCollection = SystemTagsMappingCollection\n})(OC)\n","/* eslint-disable */\n/*\n * Copyright (c) 2015\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\n(function(OC) {\n\n\tfunction filterFunction(model, term) {\n\t\treturn model.get('name').substr(0, term.length).toLowerCase() === term.toLowerCase()\n\t}\n\n\t/**\n\t * @class OCA.SystemTags.SystemTagsCollection\n\t * @classdesc\n\t *\n\t * Collection of tags assigned to a file\n\t *\n\t */\n\tvar SystemTagsCollection = OC.Backbone.Collection.extend(\n\t\t/** @lends OC.SystemTags.SystemTagsCollection.prototype */ {\n\n\t\t\tsync: OC.Backbone.davSync,\n\n\t\t\tmodel: OC.SystemTags.SystemTagModel,\n\n\t\t\turl: function() {\n\t\t\t\treturn OC.linkToRemote('dav') + '/systemtags/'\n\t\t\t},\n\n\t\t\tfilterByName: function(name) {\n\t\t\t\treturn this.filter(function(model) {\n\t\t\t\t\treturn filterFunction(model, name)\n\t\t\t\t})\n\t\t\t},\n\n\t\t\treset: function() {\n\t\t\t\tthis.fetched = false\n\t\t\t\treturn OC.Backbone.Collection.prototype.reset.apply(this, arguments)\n\t\t\t},\n\n\t\t\t/**\n\t\t * Lazy fetch.\n\t\t * Only fetches once, subsequent calls will directly call the success handler.\n\t\t *\n\t\t * @param options\n\t\t * @param [options.force] true to force fetch even if cached entries exist\n\t\t *\n\t\t * @see Backbone.Collection#fetch\n\t\t */\n\t\t\tfetch: function(options) {\n\t\t\t\tvar self = this\n\t\t\t\toptions = options || {}\n\t\t\t\tif (this.fetched || options.force) {\n\t\t\t\t// directly call handler\n\t\t\t\t\tif (options.success) {\n\t\t\t\t\t\toptions.success(this, null, options)\n\t\t\t\t\t}\n\t\t\t\t\t// trigger sync event\n\t\t\t\t\tthis.trigger('sync', this, null, options)\n\t\t\t\t\treturn Promise.resolve()\n\t\t\t\t}\n\n\t\t\t\tvar success = options.success\n\t\t\t\toptions = _.extend({}, options)\n\t\t\t\toptions.success = function() {\n\t\t\t\t\tself.fetched = true\n\t\t\t\t\tif (success) {\n\t\t\t\t\t\treturn success.apply(this, arguments)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn OC.Backbone.Collection.prototype.fetch.call(this, options)\n\t\t\t}\n\t\t})\n\n\tOC.SystemTags = OC.SystemTags || {}\n\tOC.SystemTags.SystemTagsCollection = SystemTagsCollection\n\n\t/**\n\t * @type OC.SystemTags.SystemTagsCollection\n\t */\n\tOC.SystemTags.collection = new OC.SystemTags.SystemTagsCollection()\n})(OC)\n","/* eslint-disable */\n/*\n * Copyright (c) 2015\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\n/* global Handlebars */\n\n(function(OC) {\n\n\t/**\n\t * @class OC.SystemTags.SystemTagsInputField\n\t * @classdesc\n\t *\n\t * Displays a file's system tags\n\t *\n\t */\n\tvar SystemTagsInputField = OC.Backbone.View.extend(\n\t\t/** @lends OC.SystemTags.SystemTagsInputField.prototype */ {\n\n\t\t\t_rendered: false,\n\n\t\t\t_newTag: null,\n\n\t\t\t_lastUsedTags: [],\n\n\t\t\tclassName: 'systemTagsInputFieldContainer',\n\n\t\t\ttemplate: function(data) {\n\t\t\t\treturn '<input class=\"systemTagsInputField\" type=\"hidden\" name=\"tags\" value=\"\"/>'\n\t\t\t},\n\n\t\t\t/**\n\t\t * Creates a new SystemTagsInputField\n\t\t *\n\t\t * @param {Object} [options]\n\t\t * @param {string} [options.objectType=files] object type for which tags are assigned to\n\t\t * @param {bool} [options.multiple=false] whether to allow selecting multiple tags\n\t\t * @param {bool} [options.allowActions=true] whether tags can be renamed/delete within the dropdown\n\t\t * @param {bool} [options.allowCreate=true] whether new tags can be created\n\t\t * @param {bool} [options.isAdmin=true] whether the user is an administrator\n\t\t * @param {Function} options.initSelection function to convert selection to data\n\t\t */\n\t\t\tinitialize: function(options) {\n\t\t\t\toptions = options || {}\n\n\t\t\t\tthis._multiple = !!options.multiple\n\t\t\t\tthis._allowActions = _.isUndefined(options.allowActions) || !!options.allowActions\n\t\t\t\tthis._allowCreate = _.isUndefined(options.allowCreate) || !!options.allowCreate\n\t\t\t\tthis._isAdmin = !!options.isAdmin\n\n\t\t\t\tif (_.isFunction(options.initSelection)) {\n\t\t\t\t\tthis._initSelection = options.initSelection\n\t\t\t\t}\n\n\t\t\t\tthis.collection = options.collection || OC.SystemTags.collection\n\n\t\t\t\tvar self = this\n\t\t\t\tthis.collection.on('change:name remove', function() {\n\t\t\t\t// refresh selection\n\t\t\t\t\t_.defer(self._refreshSelection)\n\t\t\t\t})\n\n\t\t\t\t_.defer(_.bind(this._getLastUsedTags, this))\n\n\t\t\t\t_.bindAll(\n\t\t\t\t\tthis,\n\t\t\t\t\t'_refreshSelection',\n\t\t\t\t\t'_onClickRenameTag',\n\t\t\t\t\t'_onClickDeleteTag',\n\t\t\t\t\t'_onSelectTag',\n\t\t\t\t\t'_onDeselectTag',\n\t\t\t\t\t'_onSubmitRenameTag'\n\t\t\t\t)\n\t\t\t},\n\n\t\t\t_getLastUsedTags: function() {\n\t\t\t\tvar self = this\n\t\t\t\t$.ajax({\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\turl: OC.generateUrl('/apps/systemtags/lastused'),\n\t\t\t\t\tsuccess: function(response) {\n\t\t\t\t\t\tself._lastUsedTags = response\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\n\t\t\t/**\n\t\t * Refreshes the selection, triggering a call to\n\t\t * select2's initSelection\n\t\t */\n\t\t\t_refreshSelection: function() {\n\t\t\t\tthis.$tagsField.select2('val', this.$tagsField.val())\n\t\t\t},\n\n\t\t\t/**\n\t\t * Event handler whenever the user clicked the \"rename\" action.\n\t\t * This will display the rename field.\n\t\t */\n\t\t\t_onClickRenameTag: function(ev) {\n\t\t\t\tvar $item = $(ev.target).closest('.systemtags-item')\n\t\t\t\tvar tagId = $item.attr('data-id')\n\t\t\t\tvar tagModel = this.collection.get(tagId)\n\n\t\t\t\tvar oldName = tagModel.get('name')\n\t\t\t\tvar $renameForm = $(OC.SystemTags.Templates['result_form']({\n\t\t\t\t\tcid: this.cid,\n\t\t\t\t\tname: oldName,\n\t\t\t\t\tdeleteTooltip: t('core', 'Delete'),\n\t\t\t\t\trenameLabel: t('core', 'Rename'),\n\t\t\t\t\tisAdmin: this._isAdmin\n\t\t\t\t}))\n\t\t\t\t$item.find('.label').after($renameForm)\n\t\t\t\t$item.find('.label, .systemtags-actions').addClass('hidden')\n\t\t\t\t$item.closest('.select2-result').addClass('has-form')\n\n\t\t\t\t$renameForm.find('[title]').tooltip({\n\t\t\t\t\tplacement: 'bottom',\n\t\t\t\t\tcontainer: 'body'\n\t\t\t\t})\n\t\t\t\t$renameForm.find('input').focus().selectRange(0, oldName.length)\n\t\t\t\treturn false\n\t\t\t},\n\n\t\t\t/**\n\t\t * Event handler whenever the rename form has been submitted after\n\t\t * the user entered a new tag name.\n\t\t * This will submit the change to the server.\n\t\t *\n\t\t * @param {Object} ev event\n\t\t */\n\t\t\t_onSubmitRenameTag: function(ev) {\n\t\t\t\tev.preventDefault()\n\t\t\t\tvar $form = $(ev.target)\n\t\t\t\tvar $item = $form.closest('.systemtags-item')\n\t\t\t\tvar tagId = $item.attr('data-id')\n\t\t\t\tvar tagModel = this.collection.get(tagId)\n\t\t\t\tvar newName = $(ev.target).find('input').val().trim()\n\t\t\t\tif (newName && newName !== tagModel.get('name')) {\n\t\t\t\t\ttagModel.save({ 'name': newName })\n\t\t\t\t\t// TODO: spinner, and only change text after finished saving\n\t\t\t\t\t$item.find('.label').text(newName)\n\t\t\t\t}\n\t\t\t\t$item.find('.label, .systemtags-actions').removeClass('hidden')\n\t\t\t\t$form.remove()\n\t\t\t\t$item.closest('.select2-result').removeClass('has-form')\n\t\t\t},\n\n\t\t\t/**\n\t\t * Event handler whenever a tag must be deleted\n\t\t *\n\t\t * @param {Object} ev event\n\t\t */\n\t\t\t_onClickDeleteTag: function(ev) {\n\t\t\t\tvar $item = $(ev.target).closest('.systemtags-item')\n\t\t\t\tvar tagId = $item.attr('data-id')\n\t\t\t\tthis.collection.get(tagId).destroy()\n\t\t\t\t$(ev.target).tooltip('hide')\n\t\t\t\t$item.closest('.select2-result').remove()\n\t\t\t\t// TODO: spinner\n\t\t\t\treturn false\n\t\t\t},\n\n\t\t\t_addToSelect2Selection: function(selection) {\n\t\t\t\tvar data = this.$tagsField.select2('data')\n\t\t\t\tdata.push(selection)\n\t\t\t\tthis.$tagsField.select2('data', data)\n\t\t\t},\n\n\t\t\t/**\n\t\t * Event handler whenever a tag is selected.\n\t\t * Also called whenever tag creation is requested through the dummy tag object.\n\t\t *\n\t\t * @param {Object} e event\n\t\t */\n\t\t\t_onSelectTag: function(e) {\n\t\t\t\tvar self = this\n\t\t\t\tvar tag\n\t\t\t\tif (e.object && e.object.isNew) {\n\t\t\t\t// newly created tag, check if existing\n\t\t\t\t// create a new tag\n\t\t\t\t\ttag = this.collection.create({\n\t\t\t\t\t\tname: e.object.name.trim(),\n\t\t\t\t\t\tuserVisible: true,\n\t\t\t\t\t\tuserAssignable: true,\n\t\t\t\t\t\tcanAssign: true\n\t\t\t\t\t}, {\n\t\t\t\t\t\tsuccess: function(model) {\n\t\t\t\t\t\t\tself._addToSelect2Selection(model.toJSON())\n\t\t\t\t\t\t\tself._lastUsedTags.unshift(model.id)\n\t\t\t\t\t\t\tself.trigger('select', model)\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror: function(model, xhr) {\n\t\t\t\t\t\t\tif (xhr.status === 409) {\n\t\t\t\t\t\t\t// re-fetch collection to get the missing tag\n\t\t\t\t\t\t\t\tself.collection.reset()\n\t\t\t\t\t\t\t\tself.collection.fetch({\n\t\t\t\t\t\t\t\t\tsuccess: function(collection) {\n\t\t\t\t\t\t\t\t\t// find the tag in the collection\n\t\t\t\t\t\t\t\t\t\tvar model = collection.where({\n\t\t\t\t\t\t\t\t\t\t\tname: e.object.name.trim(),\n\t\t\t\t\t\t\t\t\t\t\tuserVisible: true,\n\t\t\t\t\t\t\t\t\t\t\tuserAssignable: true\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\tif (model.length) {\n\t\t\t\t\t\t\t\t\t\t\tmodel = model[0]\n\t\t\t\t\t\t\t\t\t\t\t// the tag already exists or was already assigned,\n\t\t\t\t\t\t\t\t\t\t\t// add it to the list anyway\n\t\t\t\t\t\t\t\t\t\t\tself._addToSelect2Selection(model.toJSON())\n\t\t\t\t\t\t\t\t\t\t\tself.trigger('select', model)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\tthis.$tagsField.select2('close')\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\treturn false\n\t\t\t\t} else {\n\t\t\t\t\ttag = this.collection.get(e.object.id)\n\t\t\t\t\tthis._lastUsedTags.unshift(tag.id)\n\t\t\t\t}\n\t\t\t\tthis._newTag = null\n\t\t\t\tthis.trigger('select', tag)\n\t\t\t},\n\n\t\t\t/**\n\t\t * Event handler whenever a tag gets deselected.\n\t\t *\n\t\t * @param {Object} e event\n\t\t */\n\t\t\t_onDeselectTag: function(e) {\n\t\t\t\tthis.trigger('deselect', e.choice.id)\n\t\t\t},\n\n\t\t\t/**\n\t\t * Autocomplete function for dropdown results\n\t\t *\n\t\t * @param {Object} query select2 query object\n\t\t */\n\t\t\t_queryTagsAutocomplete: function(query) {\n\t\t\t\tvar self = this\n\t\t\t\tthis.collection.fetch({\n\t\t\t\t\tsuccess: function(collection) {\n\t\t\t\t\t\tvar tagModels = collection.filterByName(query.term.trim())\n\t\t\t\t\t\tif (!self._isAdmin) {\n\t\t\t\t\t\t\ttagModels = _.filter(tagModels, function(tagModel) {\n\t\t\t\t\t\t\t\treturn tagModel.get('canAssign')\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t\tquery.callback({\n\t\t\t\t\t\t\tresults: _.invoke(tagModels, 'toJSON')\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\n\t\t\t_preventDefault: function(e) {\n\t\t\t\te.stopPropagation()\n\t\t\t},\n\n\t\t\t/**\n\t\t * Formats a single dropdown result\n\t\t *\n\t\t * @param {Object} data data to format\n\t\t * @returns {string} HTML markup\n\t\t */\n\t\t\t_formatDropDownResult: function(data) {\n\t\t\t\treturn OC.SystemTags.Templates['result'](_.extend({\n\t\t\t\t\trenameTooltip: t('core', 'Rename'),\n\t\t\t\t\tallowActions: this._allowActions,\n\t\t\t\t\ttagMarkup: this._isAdmin ? OC.SystemTags.getDescriptiveTag(data)[0].innerHTML : null,\n\t\t\t\t\tisAdmin: this._isAdmin\n\t\t\t\t}, data))\n\t\t\t},\n\n\t\t\t/**\n\t\t * Formats a single selection item\n\t\t *\n\t\t * @param {Object} data data to format\n\t\t * @returns {string} HTML markup\n\t\t */\n\t\t\t_formatSelection: function(data) {\n\t\t\t\treturn OC.SystemTags.Templates['selection'](_.extend({\n\t\t\t\t\ttagMarkup: this._isAdmin ? OC.SystemTags.getDescriptiveTag(data)[0].innerHTML : null,\n\t\t\t\t\tisAdmin: this._isAdmin\n\t\t\t\t}, data))\n\t\t\t},\n\n\t\t\t/**\n\t\t * Create new dummy choice for select2 when the user\n\t\t * types an arbitrary string\n\t\t *\n\t\t * @param {string} term entered term\n\t\t * @returns {Object} dummy tag\n\t\t */\n\t\t\t_createSearchChoice: function(term) {\n\t\t\t\tterm = term.trim()\n\t\t\t\tif (this.collection.filter(function(entry) {\n\t\t\t\t\treturn entry.get('name') === term\n\t\t\t\t}).length) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif (!this._newTag) {\n\t\t\t\t\tthis._newTag = {\n\t\t\t\t\t\tid: -1,\n\t\t\t\t\t\tname: term,\n\t\t\t\t\t\tuserAssignable: true,\n\t\t\t\t\t\tuserVisible: true,\n\t\t\t\t\t\tcanAssign: true,\n\t\t\t\t\t\tisNew: true\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis._newTag.name = term\n\t\t\t\t}\n\n\t\t\t\treturn this._newTag\n\t\t\t},\n\n\t\t\t_initSelection: function(element, callback) {\n\t\t\t\tvar self = this\n\t\t\t\tvar ids = $(element).val().split(',')\n\n\t\t\t\tfunction modelToSelection(model) {\n\t\t\t\t\tvar data = model.toJSON()\n\t\t\t\t\tif (!self._isAdmin && !data.canAssign) {\n\t\t\t\t\t// lock static tags for non-admins\n\t\t\t\t\t\tdata.locked = true\n\t\t\t\t\t}\n\t\t\t\t\treturn data\n\t\t\t\t}\n\n\t\t\t\tfunction findSelectedObjects(ids) {\n\t\t\t\t\tvar selectedModels = self.collection.filter(function(model) {\n\t\t\t\t\t\treturn ids.indexOf(model.id) >= 0 && (self._isAdmin || model.get('userVisible'))\n\t\t\t\t\t})\n\t\t\t\t\treturn _.map(selectedModels, modelToSelection)\n\t\t\t\t}\n\n\t\t\t\tthis.collection.fetch({\n\t\t\t\t\tsuccess: function() {\n\t\t\t\t\t\tcallback(findSelectedObjects(ids))\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\n\t\t\t/**\n\t\t * Renders this details view\n\t\t */\n\t\t\trender: function() {\n\t\t\t\tvar self = this\n\t\t\t\tthis.$el.html(this.template())\n\n\t\t\t\tthis.$el.find('[title]').tooltip({ placement: 'bottom' })\n\t\t\t\tthis.$tagsField = this.$el.find('[name=tags]')\n\t\t\t\tthis.$tagsField.select2({\n\t\t\t\t\tplaceholder: t('core', 'Collaborative tags'),\n\t\t\t\t\tcontainerCssClass: 'systemtags-select2-container',\n\t\t\t\t\tdropdownCssClass: 'systemtags-select2-dropdown',\n\t\t\t\t\tcloseOnSelect: false,\n\t\t\t\t\tallowClear: false,\n\t\t\t\t\tmultiple: this._multiple,\n\t\t\t\t\ttoggleSelect: this._multiple,\n\t\t\t\t\tquery: _.bind(this._queryTagsAutocomplete, this),\n\t\t\t\t\tid: function(tag) {\n\t\t\t\t\t\treturn tag.id\n\t\t\t\t\t},\n\t\t\t\t\tinitSelection: _.bind(this._initSelection, this),\n\t\t\t\t\tformatResult: _.bind(this._formatDropDownResult, this),\n\t\t\t\t\tformatSelection: _.bind(this._formatSelection, this),\n\t\t\t\t\tcreateSearchChoice: this._allowCreate ? _.bind(this._createSearchChoice, this) : undefined,\n\t\t\t\t\tsortResults: function(results) {\n\t\t\t\t\t\tvar selectedItems = _.pluck(self.$tagsField.select2('data'), 'id')\n\t\t\t\t\t\tresults.sort(function(a, b) {\n\t\t\t\t\t\t\tvar aSelected = selectedItems.indexOf(a.id) >= 0\n\t\t\t\t\t\t\tvar bSelected = selectedItems.indexOf(b.id) >= 0\n\t\t\t\t\t\t\tif (aSelected === bSelected) {\n\t\t\t\t\t\t\t\tvar aLastUsed = self._lastUsedTags.indexOf(a.id)\n\t\t\t\t\t\t\t\tvar bLastUsed = self._lastUsedTags.indexOf(b.id)\n\n\t\t\t\t\t\t\t\tif (aLastUsed !== bLastUsed) {\n\t\t\t\t\t\t\t\t\tif (bLastUsed === -1) {\n\t\t\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (aLastUsed === -1) {\n\t\t\t\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn aLastUsed < bLastUsed ? -1 : 1\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Both not found\n\t\t\t\t\t\t\t\treturn OC.Util.naturalSortCompare(a.name, b.name)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (aSelected && !bSelected) {\n\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t})\n\t\t\t\t\t\treturn results\n\t\t\t\t\t},\n\t\t\t\t\tformatNoMatches: function() {\n\t\t\t\t\t\treturn t('core', 'No tags found')\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t\t.on('select2-selecting', this._onSelectTag)\n\t\t\t\t\t.on('select2-removing', this._onDeselectTag)\n\n\t\t\t\tvar $dropDown = this.$tagsField.select2('dropdown')\n\t\t\t\t// register events for inside the dropdown\n\t\t\t\t$dropDown.on('mouseup', '.rename', this._onClickRenameTag)\n\t\t\t\t$dropDown.on('mouseup', '.delete', this._onClickDeleteTag)\n\t\t\t\t$dropDown.on('mouseup', '.select2-result-selectable.has-form', this._preventDefault)\n\t\t\t\t$dropDown.on('submit', '.systemtags-rename-form', this._onSubmitRenameTag)\n\n\t\t\t\tthis.delegateEvents()\n\t\t\t},\n\n\t\t\tremove: function() {\n\t\t\t\tif (this.$tagsField) {\n\t\t\t\t\tthis.$tagsField.select2('destroy')\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tgetValues: function() {\n\t\t\t\tthis.$tagsField.select2('val')\n\t\t\t},\n\n\t\t\tsetValues: function(values) {\n\t\t\t\tthis.$tagsField.select2('val', values)\n\t\t\t},\n\n\t\t\tsetData: function(data) {\n\t\t\t\tthis.$tagsField.select2('data', data)\n\t\t\t}\n\t\t})\n\n\tOC.SystemTags = OC.SystemTags || {}\n\tOC.SystemTags.SystemTagsInputField = SystemTagsInputField\n\n})(OC)\n","// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = require(\"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./systemtags.scss\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar add = require(\"!../../node_modules/vue-style-loader/lib/addStylesClient.js\").default\nvar update = add(\"bdf318e0\", content, true, {});","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".systemtags-select2-dropdown .select2-result-label .checkmark{visibility:hidden;margin-left:-5px;margin-right:5px;padding:4px}.systemtags-select2-dropdown .select2-result-label .new-item .systemtags-actions{display:none}.systemtags-select2-dropdown .select2-selected .select2-result-label .checkmark{visibility:visible}.systemtags-select2-dropdown .select2-result-label .icon{display:inline-block;opacity:.5}.systemtags-select2-dropdown .select2-result-label .icon.rename{padding:4px}.systemtags-select2-dropdown .systemtags-actions{position:absolute;right:5px}.systemtags-select2-dropdown .systemtags-rename-form{display:inline-block;width:calc(100% - 20px);top:-6px;position:relative}.systemtags-select2-dropdown .systemtags-rename-form input{display:inline-block;height:30px;width:calc(100% - 40px)}.systemtags-select2-dropdown .label{width:85%;display:inline-block;overflow:hidden;text-overflow:ellipsis}.systemtags-select2-dropdown .label.hidden{display:none}.systemtags-select2-dropdown span{line-height:25px}.systemtags-select2-dropdown .systemtags-item{display:inline-block;height:25px;width:100%}.systemtags-select2-dropdown .select2-result-label{height:25px}.systemTagsInfoView,.systemtags-select2-container{width:100%}.systemTagsInfoView .select2-choices,.systemtags-select2-container .select2-choices{flex-wrap:nowrap !important;max-height:44px}.systemTagsInfoView .select2-choices .select2-search-choice.select2-locked .label,.systemtags-select2-container .select2-choices .select2-search-choice.select2-locked .label{opacity:0.5}#select2-drop.systemtags-select2-dropdown .select2-results li.select2-result{padding:5px}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","\"use strict\";\n\n/*\n  MIT License http://www.opensource.org/licenses/mit-license.php\n  Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n  var list = []; // return the list of modules as css string\n\n  list.toString = function toString() {\n    return this.map(function (item) {\n      var content = cssWithMappingToString(item, useSourceMap);\n\n      if (item[2]) {\n        return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n      }\n\n      return content;\n    }).join('');\n  }; // import a list of modules into the list\n  // eslint-disable-next-line func-names\n\n\n  list.i = function (modules, mediaQuery, dedupe) {\n    if (typeof modules === 'string') {\n      // eslint-disable-next-line no-param-reassign\n      modules = [[null, modules, '']];\n    }\n\n    var alreadyImportedModules = {};\n\n    if (dedupe) {\n      for (var i = 0; i < this.length; i++) {\n        // eslint-disable-next-line prefer-destructuring\n        var id = this[i][0];\n\n        if (id != null) {\n          alreadyImportedModules[id] = true;\n        }\n      }\n    }\n\n    for (var _i = 0; _i < modules.length; _i++) {\n      var item = [].concat(modules[_i]);\n\n      if (dedupe && alreadyImportedModules[item[0]]) {\n        // eslint-disable-next-line no-continue\n        continue;\n      }\n\n      if (mediaQuery) {\n        if (!item[2]) {\n          item[2] = mediaQuery;\n        } else {\n          item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n        }\n      }\n\n      list.push(item);\n    }\n  };\n\n  return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n  var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n  var cssMapping = item[3];\n\n  if (!cssMapping) {\n    return content;\n  }\n\n  if (useSourceMap && typeof btoa === 'function') {\n    var sourceMapping = toComment(cssMapping);\n    var sourceURLs = cssMapping.sources.map(function (source) {\n      return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || '').concat(source, \" */\");\n    });\n    return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n  }\n\n  return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n  // eslint-disable-next-line no-undef\n  var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n  var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n  return \"/*# \".concat(data, \" */\");\n}","/**\n * Translates the list format produced by css-loader into something\n * easier to manipulate.\n */\nexport default function listToStyles (parentId, list) {\n  var styles = []\n  var newStyles = {}\n  for (var i = 0; i < list.length; i++) {\n    var item = list[i]\n    var id = item[0]\n    var css = item[1]\n    var media = item[2]\n    var sourceMap = item[3]\n    var part = {\n      id: parentId + ':' + i,\n      css: css,\n      media: media,\n      sourceMap: sourceMap\n    }\n    if (!newStyles[id]) {\n      styles.push(newStyles[id] = { id: id, parts: [part] })\n    } else {\n      newStyles[id].parts.push(part)\n    }\n  }\n  return styles\n}\n","/*\n  MIT License http://www.opensource.org/licenses/mit-license.php\n  Author Tobias Koppers @sokra\n  Modified by Evan You @yyx990803\n*/\n\nimport listToStyles from './listToStyles'\n\nvar hasDocument = typeof document !== 'undefined'\n\nif (typeof DEBUG !== 'undefined' && DEBUG) {\n  if (!hasDocument) {\n    throw new Error(\n    'vue-style-loader cannot be used in a non-browser environment. ' +\n    \"Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.\"\n  ) }\n}\n\n/*\ntype StyleObject = {\n  id: number;\n  parts: Array<StyleObjectPart>\n}\n\ntype StyleObjectPart = {\n  css: string;\n  media: string;\n  sourceMap: ?string\n}\n*/\n\nvar stylesInDom = {/*\n  [id: number]: {\n    id: number,\n    refs: number,\n    parts: Array<(obj?: StyleObjectPart) => void>\n  }\n*/}\n\nvar head = hasDocument && (document.head || document.getElementsByTagName('head')[0])\nvar singletonElement = null\nvar singletonCounter = 0\nvar isProduction = false\nvar noop = function () {}\nvar options = null\nvar ssrIdKey = 'data-vue-ssr-id'\n\n// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n// tags it will allow on a page\nvar isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase())\n\nexport default function addStylesClient (parentId, list, _isProduction, _options) {\n  isProduction = _isProduction\n\n  options = _options || {}\n\n  var styles = listToStyles(parentId, list)\n  addStylesToDom(styles)\n\n  return function update (newList) {\n    var mayRemove = []\n    for (var i = 0; i < styles.length; i++) {\n      var item = styles[i]\n      var domStyle = stylesInDom[item.id]\n      domStyle.refs--\n      mayRemove.push(domStyle)\n    }\n    if (newList) {\n      styles = listToStyles(parentId, newList)\n      addStylesToDom(styles)\n    } else {\n      styles = []\n    }\n    for (var i = 0; i < mayRemove.length; i++) {\n      var domStyle = mayRemove[i]\n      if (domStyle.refs === 0) {\n        for (var j = 0; j < domStyle.parts.length; j++) {\n          domStyle.parts[j]()\n        }\n        delete stylesInDom[domStyle.id]\n      }\n    }\n  }\n}\n\nfunction addStylesToDom (styles /* Array<StyleObject> */) {\n  for (var i = 0; i < styles.length; i++) {\n    var item = styles[i]\n    var domStyle = stylesInDom[item.id]\n    if (domStyle) {\n      domStyle.refs++\n      for (var j = 0; j < domStyle.parts.length; j++) {\n        domStyle.parts[j](item.parts[j])\n      }\n      for (; j < item.parts.length; j++) {\n        domStyle.parts.push(addStyle(item.parts[j]))\n      }\n      if (domStyle.parts.length > item.parts.length) {\n        domStyle.parts.length = item.parts.length\n      }\n    } else {\n      var parts = []\n      for (var j = 0; j < item.parts.length; j++) {\n        parts.push(addStyle(item.parts[j]))\n      }\n      stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }\n    }\n  }\n}\n\nfunction createStyleElement () {\n  var styleElement = document.createElement('style')\n  styleElement.type = 'text/css'\n  head.appendChild(styleElement)\n  return styleElement\n}\n\nfunction addStyle (obj /* StyleObjectPart */) {\n  var update, remove\n  var styleElement = document.querySelector('style[' + ssrIdKey + '~=\"' + obj.id + '\"]')\n\n  if (styleElement) {\n    if (isProduction) {\n      // has SSR styles and in production mode.\n      // simply do nothing.\n      return noop\n    } else {\n      // has SSR styles but in dev mode.\n      // for some reason Chrome can't handle source map in server-rendered\n      // style tags - source maps in <style> only works if the style tag is\n      // created and inserted dynamically. So we remove the server rendered\n      // styles and inject new ones.\n      styleElement.parentNode.removeChild(styleElement)\n    }\n  }\n\n  if (isOldIE) {\n    // use singleton mode for IE9.\n    var styleIndex = singletonCounter++\n    styleElement = singletonElement || (singletonElement = createStyleElement())\n    update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)\n    remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)\n  } else {\n    // use multi-style-tag mode in all other cases\n    styleElement = createStyleElement()\n    update = applyToTag.bind(null, styleElement)\n    remove = function () {\n      styleElement.parentNode.removeChild(styleElement)\n    }\n  }\n\n  update(obj)\n\n  return function updateStyle (newObj /* StyleObjectPart */) {\n    if (newObj) {\n      if (newObj.css === obj.css &&\n          newObj.media === obj.media &&\n          newObj.sourceMap === obj.sourceMap) {\n        return\n      }\n      update(obj = newObj)\n    } else {\n      remove()\n    }\n  }\n}\n\nvar replaceText = (function () {\n  var textStore = []\n\n  return function (index, replacement) {\n    textStore[index] = replacement\n    return textStore.filter(Boolean).join('\\n')\n  }\n})()\n\nfunction applyToSingletonTag (styleElement, index, remove, obj) {\n  var css = remove ? '' : obj.css\n\n  if (styleElement.styleSheet) {\n    styleElement.styleSheet.cssText = replaceText(index, css)\n  } else {\n    var cssNode = document.createTextNode(css)\n    var childNodes = styleElement.childNodes\n    if (childNodes[index]) styleElement.removeChild(childNodes[index])\n    if (childNodes.length) {\n      styleElement.insertBefore(cssNode, childNodes[index])\n    } else {\n      styleElement.appendChild(cssNode)\n    }\n  }\n}\n\nfunction applyToTag (styleElement, obj) {\n  var css = obj.css\n  var media = obj.media\n  var sourceMap = obj.sourceMap\n\n  if (media) {\n    styleElement.setAttribute('media', media)\n  }\n  if (options.ssrId) {\n    styleElement.setAttribute(ssrIdKey, obj.id)\n  }\n\n  if (sourceMap) {\n    // https://developer.chrome.com/devtools/docs/javascript-debugging\n    // this makes source maps inside style tags work properly in Chrome\n    css += '\\n/*# sourceURL=' + sourceMap.sources[0] + ' */'\n    // http://stackoverflow.com/a/26603875\n    css += '\\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'\n  }\n\n  if (styleElement.styleSheet) {\n    styleElement.styleSheet.cssText = css\n  } else {\n    while (styleElement.firstChild) {\n      styleElement.removeChild(styleElement.firstChild)\n    }\n    styleElement.appendChild(document.createTextNode(css))\n  }\n}\n"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/handlebars/dist/cjs/handlebars/utils.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/exception.js","webpack:///./node_modules/handlebars/runtime.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/base.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/helpers.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/logger.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js","webpack:///./node_modules/escape-html/index.js","webpack:///./core/src/systemtags/templates/result.handlebars","webpack:///./core/src/systemtags/templates/result_form.handlebars","webpack:///./core/src/systemtags/templates/selection.handlebars","webpack:///./core/src/systemtags/systemtagmodel.js","webpack:///./core/src/systemtags/systemtagsmappingcollection.js","webpack:///./core/src/systemtags/systemtagscollection.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars.runtime.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/helpers/each.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/helpers/if.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/helpers/log.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/helpers/with.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/decorators.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/safe-string.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/runtime.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js","webpack:///./node_modules/handlebars/dist/cjs/handlebars/no-conflict.js","webpack:///./core/css/systemtags.scss?456a","webpack:///./core/css/systemtags.scss","webpack:///./node_modules/css-loader/dist/runtime/api.js","webpack:///./core/src/systemtags/systemtags.js","webpack:///./core/src/systemtags/systemtagsinputfield.js","webpack:///./node_modules/vue-style-loader/lib/listToStyles.js","webpack:///./node_modules/vue-style-loader/lib/addStylesClient.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","extend","indexOf","array","len","length","escapeExpression","string","toHTML","possible","test","replace","badChars","escapeChar","isEmpty","isArray","createFrame","frame","_parent","blockParams","params","ids","path","appendContextPath","contextPath","id","escape","chr","obj","arguments","toString","isFunction","Array","errorProps","Exception","message","node","loc","line","undefined","endLineNumber","column","endColumn","start","end","tmp","Error","constructor","this","idx","captureStackTrace","lineNumber","nop","_interopRequireDefault","HandlebarsEnvironment","_utils","_exception2","_helpers","_decorators","_logger2","_internalProtoAccess","VERSION","COMPILER_REVISION","LAST_COMPATIBLE_COMPILER_REVISION","REVISION_CHANGES","1","2","3","4","5","6","7","8","helpers","partials","decorators","registerDefaultHelpers","registerDefaultDecorators","logger","log","registerHelper","fn","unregisterHelper","registerPartial","partial","unregisterPartial","registerDecorator","unregisterDecorator","resetLoggedPropertyAccesses","resetLoggedProperties","instance","_helpersBlockHelperMissing2","_helpersEach2","_helpersHelperMissing2","_helpersIf2","_helpersLog2","_helpersLookup2","_helpersWith2","moveHelperToHooks","helperName","keepHelper","hooks","g","Function","e","window","methodMap","level","lookupLevel","levelMap","toLowerCase","parseInt","console","method","_len","_key","apply","createProtoAccessControl","runtimeOptions","defaultMethodWhiteList","defaultPropertyWhiteList","properties","whitelist","_createNewLookupObject","createNewLookupObject","allowedProtoProperties","defaultValue","allowProtoPropertiesByDefault","methods","allowedProtoMethods","allowProtoMethodsByDefault","resultIsAllowed","result","protoAccessControl","propertyName","checkWhiteList","keys","loggedProperties","forEach","newObj","_interopRequireWildcard","protoAccessControlForType","logUnexpecedPropertyAccessOnce","matchHtmlRegExp","str","match","exec","html","index","lastIndex","charCodeAt","substring","Handlebars","template","container","depth0","data","stack1","helper","lookupProperty","parent","helperMissing","nullContext","options","alias1","alias2","buffer","program","noop","blockHelperMissing","alias4","OC","_","Files","Client","PROPERTY_FILEID","NS_OWNCLOUD","PROPERTY_CAN_ASSIGN","PROPERTY_DISPLAYNAME","PROPERTY_USERVISIBLE","PROPERTY_USERASSIGNABLE","SystemTagModel","Backbone","Model","sync","davSync","defaults","userVisible","userAssignable","canAssign","davProperties","parse","SystemTags","SystemTagsMappingCollection","Collection","usePUT","_objectId","_objectType","model","url","linkToRemote","setObjectId","objectId","setObjectType","objectType","initialize","models","isUndefined","getTagIds","map","SystemTagsCollection","filterByName","filter","term","substr","filterFunction","reset","fetched","fetch","self","force","success","trigger","Promise","resolve","collection","base","_handlebarsSafeString2","_handlebarsException2","Utils","runtime","_handlebarsNoConflict2","hb","SafeString","VM","spec","inst","context","inverse","each","_exception","priorKey","ret","execIteration","field","last","first","j","global","iterator","newContext","it","next","done","push","conditional","hash","includeZero","args","_decoratorsInline2","_decoratorsInline","props","original","sources","concat","checkRevision","compilerInfo","compilerRevision","currentRevision","_base","runtimeVersions","compilerVersions","templateSpec","env","main","decorator","main_d","compiler","templateWasPrecompiledWithCompilerV7","strict","lookup","depths","lambda","current","invokePartial","resolvePartial","extendedOptions","compile","compilerOptions","indent","lines","split","join","programs","declaredBlockParams","programWrapper","wrapProgram","depth","mergeIfNeeded","param","common","seal","_setup","useData","initData","useBlockParams","useDepths","executeDecorators","isTop","mergedHelpers","_internalWrapHelper","wrapHelper","passLookupPropertyOption","wrapHelpersToPassLookupProperty","usePartial","useDecorators","keepHelperInHelpers","allowCallsToHelperMissing","_child","currentPartialBlock","partialBlock","prog","currentDepths","root","transformOptionsFn","$Handlebars","noConflict","content","locals","add","default","___CSS_LOADER_API_IMPORT___","useSourceMap","list","item","cssMapping","btoa","sourceMapping","sourceMap","base64","unescape","encodeURIComponent","JSON","stringify","sourceURLs","source","sourceRoot","cssWithMappingToString","mediaQuery","dedupe","alreadyImportedModules","_i","getDescriptiveTag","tag","toJSON","$","addClass","text","scope","$span","append","escapeHTML","SystemTagsInputField","View","_rendered","_newTag","_lastUsedTags","className","_multiple","multiple","_allowActions","allowActions","_allowCreate","allowCreate","_isAdmin","isAdmin","initSelection","_initSelection","on","defer","_refreshSelection","_getLastUsedTags","bindAll","ajax","type","generateUrl","response","$tagsField","select2","val","_onClickRenameTag","ev","$item","target","closest","tagId","attr","oldName","$renameForm","templateResultForm","cid","deleteTooltip","renameLabel","find","after","tooltip","placement","focus","selectRange","_onSubmitRenameTag","preventDefault","$form","tagModel","newName","trim","save","removeClass","remove","_onClickDeleteTag","destroy","_addToSelect2Selection","selection","_onSelectTag","isNew","unshift","error","xhr","status","where","_onDeselectTag","choice","_queryTagsAutocomplete","query","tagModels","callback","results","invoke","_preventDefault","stopPropagation","_formatDropDownResult","templateResult","renameTooltip","tagMarkup","innerHTML","_formatSelection","templateSelection","_createSearchChoice","entry","element","modelToSelection","locked","selectedModels","findSelectedObjects","render","$el","placeholder","containerCssClass","dropdownCssClass","closeOnSelect","allowClear","toggleSelect","formatResult","formatSelection","createSearchChoice","sortResults","selectedItems","pluck","sort","a","b","aSelected","bSelected","aLastUsed","bLastUsed","Util","naturalSortCompare","formatNoMatches","$dropDown","delegateEvents","getValues","setValues","values","setData","listToStyles","parentId","styles","newStyles","part","css","media","parts","hasDocument","document","DEBUG","stylesInDom","head","getElementsByTagName","singletonElement","singletonCounter","isProduction","isOldIE","navigator","userAgent","addStylesClient","_isProduction","_options","addStylesToDom","newList","mayRemove","domStyle","refs","addStyle","createStyleElement","styleElement","createElement","appendChild","update","querySelector","parentNode","removeChild","styleIndex","applyToSingletonTag","applyToTag","textStore","replaceText","replacement","Boolean","styleSheet","cssText","cssNode","createTextNode","childNodes","insertBefore","setAttribute","ssrId","firstChild"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG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,EAAQ,CACV,GAAIA,EAAO6V,MAAQ5c,EAAI4c,KACnB7V,EAAO8V,QAAU7c,EAAI6c,OACrB9V,EAAOuM,YAActT,EAAIsT,UAC3B,OAEFkL,EAAOxe,EAAM+G,QAEbsR,KAKN,IACM0G,EADFC,GACED,EAAY,GAET,SAAUvX,EAAOyX,GAEtB,OADAF,EAAUvX,GAASyX,EACZF,EAAUvT,OAAO0T,SAAS1O,KAAK,QAI1C,SAASqO,EAAqBR,EAAc7W,EAAO6Q,EAAQrY,GACzD,IAAI4c,EAAMvE,EAAS,GAAKrY,EAAI4c,IAE5B,GAAIyB,EAAac,WACfd,EAAac,WAAWC,QAAUJ,EAAYxX,EAAOoV,OAChD,CACL,IAAIyC,EAAUrC,SAASsC,eAAe1C,GAClC2C,EAAalB,EAAakB,WAC1BA,EAAW/X,IAAQ6W,EAAaM,YAAYY,EAAW/X,IACvD+X,EAAW9gB,OACb4f,EAAamB,aAAaH,EAASE,EAAW/X,IAE9C6W,EAAaE,YAAYc,IAK/B,SAASP,EAAYT,EAAcre,GACjC,IAAI4c,EAAM5c,EAAI4c,IACVC,EAAQ7c,EAAI6c,MACZvJ,EAAYtT,EAAIsT,UAiBpB,GAfIuJ,GACFwB,EAAaoB,aAAa,QAAS5C,GAEjCtU,EAAQmX,OACVrB,EAAaoB,aA7JF,kBA6JyBzf,EAAIH,IAGtCyT,IAGFsJ,GAAO,mBAAqBtJ,EAAU3E,QAAQ,GAAK,MAEnDiO,GAAO,uDAAyDxJ,KAAKI,SAASC,mBAAmBC,KAAKC,UAAUL,MAAgB,OAG9H+K,EAAac,WACfd,EAAac,WAAWC,QAAUxC,MAC7B,CACL,KAAOyB,EAAasB,YAClBtB,EAAaM,YAAYN,EAAasB,YAExCtB,EAAaE,YAAYvB,SAASsC,eAAe1C","file":"systemtags.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 33);\n","'use strict';\n\nexports.__esModule = true;\nexports.extend = extend;\nexports.indexOf = indexOf;\nexports.escapeExpression = escapeExpression;\nexports.isEmpty = isEmpty;\nexports.createFrame = createFrame;\nexports.blockParams = blockParams;\nexports.appendContextPath = appendContextPath;\nvar escape = {\n  '&': '&amp;',\n  '<': '&lt;',\n  '>': '&gt;',\n  '\"': '&quot;',\n  \"'\": '&#x27;',\n  '`': '&#x60;',\n  '=': '&#x3D;'\n};\n\nvar badChars = /[&<>\"'`=]/g,\n    possible = /[&<>\"'`=]/;\n\nfunction escapeChar(chr) {\n  return escape[chr];\n}\n\nfunction extend(obj /* , ...source */) {\n  for (var i = 1; i < arguments.length; i++) {\n    for (var key in arguments[i]) {\n      if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {\n        obj[key] = arguments[i][key];\n      }\n    }\n  }\n\n  return obj;\n}\n\nvar toString = Object.prototype.toString;\n\nexports.toString = toString;\n// Sourced from lodash\n// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt\n/* eslint-disable func-style */\nvar isFunction = function isFunction(value) {\n  return typeof value === 'function';\n};\n// fallback for older versions of Chrome and Safari\n/* istanbul ignore next */\nif (isFunction(/x/)) {\n  exports.isFunction = isFunction = function (value) {\n    return typeof value === 'function' && toString.call(value) === '[object Function]';\n  };\n}\nexports.isFunction = isFunction;\n\n/* eslint-enable func-style */\n\n/* istanbul ignore next */\nvar isArray = Array.isArray || function (value) {\n  return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;\n};\n\nexports.isArray = isArray;\n// Older IE versions do not directly support indexOf so we must implement our own, sadly.\n\nfunction indexOf(array, value) {\n  for (var i = 0, len = array.length; i < len; i++) {\n    if (array[i] === value) {\n      return i;\n    }\n  }\n  return -1;\n}\n\nfunction escapeExpression(string) {\n  if (typeof string !== 'string') {\n    // don't escape SafeStrings, since they're already safe\n    if (string && string.toHTML) {\n      return string.toHTML();\n    } else if (string == null) {\n      return '';\n    } else if (!string) {\n      return string + '';\n    }\n\n    // Force a string conversion as this will be done by the append regardless and\n    // the regex test will do this transparently behind the scenes, causing issues if\n    // an object's to string has escaped characters in it.\n    string = '' + string;\n  }\n\n  if (!possible.test(string)) {\n    return string;\n  }\n  return string.replace(badChars, escapeChar);\n}\n\nfunction isEmpty(value) {\n  if (!value && value !== 0) {\n    return true;\n  } else if (isArray(value) && value.length === 0) {\n    return true;\n  } else {\n    return false;\n  }\n}\n\nfunction createFrame(object) {\n  var frame = extend({}, object);\n  frame._parent = object;\n  return frame;\n}\n\nfunction blockParams(params, ids) {\n  params.path = ids;\n  return params;\n}\n\nfunction appendContextPath(contextPath, id) {\n  return (contextPath ? contextPath + '.' : '') + id;\n}\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL3V0aWxzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSxJQUFNLE1BQU0sR0FBRztBQUNiLEtBQUcsRUFBRSxPQUFPO0FBQ1osS0FBRyxFQUFFLE1BQU07QUFDWCxLQUFHLEVBQUUsTUFBTTtBQUNYLEtBQUcsRUFBRSxRQUFRO0FBQ2IsS0FBRyxFQUFFLFFBQVE7QUFDYixLQUFHLEVBQUUsUUFBUTtBQUNiLEtBQUcsRUFBRSxRQUFRO0NBQ2QsQ0FBQzs7QUFFRixJQUFNLFFBQVEsR0FBRyxZQUFZO0lBQzNCLFFBQVEsR0FBRyxXQUFXLENBQUM7O0FBRXpCLFN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ICAgIHJldHVybiBmYWxzZTtcbiAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gY3JlYXRlRnJhbWUob2JqZWN0KSB7XG4gIGxldCBmcmFtZSA9IGV4dGVuZCh7fSwgb2JqZWN0KTtcbiAgZnJhbWUuX3BhcmVudCA9IG9iamVjdDtcbiAgcmV0dXJuIGZyYW1lO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gYmxvY2tQYXJhbXMocGFyYW1zLCBpZHMpIHtcbiAgcGFyYW1zLnBhdGggPSBpZHM7XG4gIHJldHVybiBwYXJhbXM7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBhcHBlbmRDb250ZXh0UGF0aChjb250ZXh0UGF0aCwgaWQpIHtcbiAgcmV0dXJuIChjb250ZXh0UGF0aCA/IGNvbnRleHRQYXRoICsgJy4nIDogJycpICsgaWQ7XG59XG4iXX0=\n","'use strict';\n\nexports.__esModule = true;\nvar errorProps = ['description', 'fileName', 'lineNumber', 'endLineNumber', 'message', 'name', 'number', 'stack'];\n\nfunction Exception(message, node) {\n  var loc = node && node.loc,\n      line = undefined,\n      endLineNumber = undefined,\n      column = undefined,\n      endColumn = undefined;\n\n  if (loc) {\n    line = loc.start.line;\n    endLineNumber = loc.end.line;\n    column = loc.start.column;\n    endColumn = loc.end.column;\n\n    message += ' - ' + line + ':' + column;\n  }\n\n  var tmp = Error.prototype.constructor.call(this, message);\n\n  // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.\n  for (var idx = 0; idx < errorProps.length; idx++) {\n    this[errorProps[idx]] = tmp[errorProps[idx]];\n  }\n\n  /* istanbul ignore else */\n  if (Error.captureStackTrace) {\n    Error.captureStackTrace(this, Exception);\n  }\n\n  try {\n    if (loc) {\n      this.lineNumber = line;\n      this.endLineNumber = endLineNumber;\n\n      // Work around issue under safari where we can't directly set the column value\n      /* istanbul ignore next */\n      if (Object.defineProperty) {\n        Object.defineProperty(this, 'column', {\n          value: column,\n          enumerable: true\n        });\n        Object.defineProperty(this, 'endColumn', {\n          value: endColumn,\n          enumerable: true\n        });\n      } else {\n        this.column = column;\n        this.endColumn = endColumn;\n      }\n    }\n  } catch (nop) {\n    /* Ignore if the browser is very particular */\n  }\n}\n\nException.prototype = new Error();\n\nexports['default'] = Exception;\nmodule.exports = exports['default'];\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2V4Y2VwdGlvbi5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxJQUFNLFVBQVUsR0FBRyxDQUNqQixhQUFhLEVBQ2IsVUFBVSxFQUNWLFlBQVksRUFDWixlQUFlLEVBQ2YsU0FBUyxFQUNULE1BQU0sRUFDTixRQUFRLEVBQ1IsT0FBTyxDQUNSLENBQUM7O0FBRUYsU0FBUyxTQUFTLENBQUMsT0FBTyxFQUFFLElBQUksRUFBRTtBQUNoQyxNQUFJLEdBQUcsR0FBRyxJQUFJLElBQUksSUFBSSxDQUFDLEdBQUc7TUFDeEIsSUFBSSxZQUFBO01BQ0osYUFBYSxZQUFBO01BQ2IsTUFBTSxZQUFBO01BQ04sU0FBUyxZQUFBLENBQUM7O0FBRVosTUFBSSxHQUFHLEVBQUU7QUFDUCxRQUFJLEdBQUcsR0FBRyxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUM7QUFDdEIsaUJBQWEsR0FBRyxHQUFHLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQztBQUM3QixVQUFNLEdBQUcsR0FBRyxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUM7QUFDMUIsYUFBUyxHQUFHLEdBQUcsQ0FBQyxHQUFHLENBQUMsTUFBTSxDQUFDOztBQUUzQixXQUFPLElBQUksS0FBSyxHQUFHLElBQUksR0FBRyxHQUFHLEdBQUcsTUFBTSxDQUFDO0dBQ3hDOztBQUVELE1BQUksR0FBRyxHQUFHLEtBQ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1bGFyICovXG4gIH1cbn1cblxuRXhjZXB0aW9uLnByb3RvdHlwZSA9IG5ldyBFcnJvcigpO1xuXG5leHBvcnQgZGVmYXVsdCBFeGNlcHRpb247XG4iXX0=\n","// Create a simple path alias to allow browserify to resolve\n// the runtime on a supported path.\nmodule.exports = require('./dist/cjs/handlebars.runtime')['default'];\n","'use strict';\n\nexports.__esModule = true;\nexports.HandlebarsEnvironment = HandlebarsEnvironment;\n// istanbul ignore next\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _utils = require('./utils');\n\nvar _exception = require('./exception');\n\nvar _exception2 = _interopRequireDefault(_exception);\n\nvar _helpers = require('./helpers');\n\nvar _decorators = require('./decorators');\n\nvar _logger = require('./logger');\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _internalProtoAccess = require('./internal/proto-access');\n\nvar VERSION = '4.7.6';\nexports.VERSION = VERSION;\nvar COMPILER_REVISION = 8;\nexports.COMPILER_REVISION = COMPILER_REVISION;\nvar LAST_COMPATIBLE_COMPILER_REVISION = 7;\n\nexports.LAST_COMPATIBLE_COMPILER_REVISION = LAST_COMPATIBLE_COMPILER_REVISION;\nvar REVISION_CHANGES = {\n  1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it\n  2: '== 1.0.0-rc.3',\n  3: '== 1.0.0-rc.4',\n  4: '== 1.x.x',\n  5: '== 2.0.0-alpha.x',\n  6: '>= 2.0.0-beta.1',\n  7: '>= 4.0.0 <4.3.0',\n  8: '>= 4.3.0'\n};\n\nexports.REVISION_CHANGES = REVISION_CHANGES;\nvar objectType = '[object Object]';\n\nfunction HandlebarsEnvironment(helpers, partials, decorators) {\n  this.helpers = helpers || {};\n  this.partials = partials || {};\n  this.decorators = decorators || {};\n\n  _helpers.registerDefaultHelpers(this);\n  _decorators.registerDefaultDecorators(this);\n}\n\nHandlebarsEnvironment.prototype = {\n  constructor: HandlebarsEnvironment,\n\n  logger: _logger2['default'],\n  log: _logger2['default'].log,\n\n  registerHelper: function registerHelper(name, fn) {\n    if (_utils.toString.call(name) === objectType) {\n      if (fn) {\n        throw new _exception2['default']('Arg not supported with multiple helpers');\n      }\n      _utils.extend(this.helpers, name);\n    } else {\n      this.helpers[name] = fn;\n    }\n  },\n  unregisterHelper: function unregisterHelper(name) {\n    delete this.helpers[name];\n  },\n\n  registerPartial: function registerPartial(name, partial) {\n    if (_utils.toString.call(name) === objectType) {\n      _utils.extend(this.partials, name);\n    } else {\n      if (typeof partial === 'undefined') {\n        throw new _exception2['default']('Attempting to register a partial called \"' + name + '\" as undefined');\n      }\n      this.partials[name] = partial;\n    }\n  },\n  unregisterPartial: function unregisterPartial(name) {\n    delete this.partials[name];\n  },\n\n  registerDecorator: function registerDecorator(name, fn) {\n    if (_utils.toString.call(name) === objectType) {\n      if (fn) {\n        throw new _exception2['default']('Arg not supported with multiple decorators');\n      }\n      _utils.extend(this.decorators, name);\n    } else {\n      this.decorators[name] = fn;\n    }\n  },\n  unregisterDecorator: function unregisterDecorator(name) {\n    delete this.decorators[name];\n  },\n  /**\n   * Reset the memory of illegal property accesses that have already been logged.\n   * @deprecated should only be used in handlebars test-cases\n   */\n  resetLoggedPropertyAccesses: function resetLoggedPropertyAccesses() {\n    _internalProtoAccess.resetLoggedProperties();\n  }\n};\n\nvar log = _logger2['default'].log;\n\nexports.log = log;\nexports.createFrame = _utils.createFrame;\nexports.logger = _logger2['default'];\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2Jhc2UuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7cUJBQThDLFNBQVM7O3lCQUNqQyxhQUFhOzs7O3VCQUNJLFdBQVc7OzBCQUNSLGNBQWM7O3NCQUNyQyxVQUFVOzs7O21DQUNTLHlCQUF5Qjs7QUFFeEQsSUFBTSxPQUFPLEdB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pb24oJ0FyZyBub3Qgc3VwcG9ydGVkIHdpdGggbXVsdGlwbGUgZGVjb3JhdG9ycycpO1xuICAgICAgfVxuICAgICAgZXh0ZW5kKHRoaXMuZGVjb3JhdG9ycywgbmFtZSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHRoaXMuZGVjb3JhdG9yc1tuYW1lXSA9IGZuO1xuICAgIH1cbiAgfSxcbiAgdW5yZWdpc3RlckRlY29yYXRvcjogZnVuY3Rpb24obmFtZSkge1xuICAgIGRlbGV0ZSB0aGlzLmRlY29yYXRvcnNbbmFtZV07XG4gIH0sXG4gIC8qKlxuICAgKiBSZXNldCB0aGUgbWVtb3J5IG9mIGlsbGVnYWwgcHJvcGVydHkgYWNjZXNzZXMgdGhhdCBoYXZlIGFscmVhZHkgYmVlbiBsb2dnZWQuXG4gICAqIEBkZXByZWNhdGVkIHNob3VsZCBvbmx5IGJlIHVzZWQgaW4gaGFuZGxlYmFycyB0ZXN0LWNhc2VzXG4gICAqL1xuICByZXNldExvZ2dlZFByb3BlcnR5QWNjZXNzZXMoKSB7XG4gICAgcmVzZXRMb2dnZWRQcm9wZXJ0aWVzKCk7XG4gIH1cbn07XG5cbmV4cG9ydCBsZXQgbG9nID0gbG9nZ2VyLmxvZztcblxuZXhwb3J0IHsgY3JlYXRlRnJhbWUsIGxvZ2dlciB9O1xuIl19\n","'use strict';\n\nexports.__esModule = true;\nexports.registerDefaultHelpers = registerDefaultHelpers;\nexports.moveHelperToHooks = moveHelperToHooks;\n// istanbul ignore next\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _helpersBlockHelperMissing = require('./helpers/block-helper-missing');\n\nvar _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);\n\nvar _helpersEach = require('./helpers/each');\n\nvar _helpersEach2 = _interopRequireDefault(_helpersEach);\n\nvar _helpersHelperMissing = require('./helpers/helper-missing');\n\nvar _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);\n\nvar _helpersIf = require('./helpers/if');\n\nvar _helpersIf2 = _interopRequireDefault(_helpersIf);\n\nvar _helpersLog = require('./helpers/log');\n\nvar _helpersLog2 = _interopRequireDefault(_helpersLog);\n\nvar _helpersLookup = require('./helpers/lookup');\n\nvar _helpersLookup2 = _interopRequireDefault(_helpersLookup);\n\nvar _helpersWith = require('./helpers/with');\n\nvar _helpersWith2 = _interopRequireDefault(_helpersWith);\n\nfunction registerDefaultHelpers(instance) {\n  _helpersBlockHelperMissing2['default'](instance);\n  _helpersEach2['default'](instance);\n  _helpersHelperMissing2['default'](instance);\n  _helpersIf2['default'](instance);\n  _helpersLog2['default'](instance);\n  _helpersLookup2['default'](instance);\n  _helpersWith2['default'](instance);\n}\n\nfunction moveHelperToHooks(instance, helperName, keepHelper) {\n  if (instance.helpers[helperName]) {\n    instance.hooks[helperName] = instance.helpers[helperName];\n    if (!keepHelper) {\n      delete instance.helpers[helperName];\n    }\n  }\n}\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O3lDQUF1QyxnQ0FBZ0M7Ozs7MkJBQzlDLGdCQUFnQjs7OztvQ0FDUCwwQkFBMEI7Ozs7eUJBQ3JDLGNBQWM7Ozs7MEJBQ2IsZUFBZTs7Ozs2QkFDWixrQkFBa0I7Ozs7MkJBQ3BCLGdCQUFnQjs7OztBQUVsQyxTQUFTLHNCQUFzQixDQUFDLFFBQVEsRUFBRTtBQUMvQyx5Q0FBMkIsUUFBUSxDQUFDLENBQUM7QUFDckMsMkJBQWEsUUFBUSxDQUFDLENBQUM7QUFDdkIsb0NBQXNCLFFBQVEsQ0FBQyxDQUFDO0FBQ2hDLHlCQUFXLFFBQVEsQ0FBQyxDQUFDO0FBQ3JCLDBCQUFZLFF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tcbiAgcmVnaXN0ZXJCbG9ja0hlbHBlck1pc3NpbmcoaW5zdGFuY2UpO1xuICByZWdpc3RlckVhY2goaW5zdGFuY2UpO1xuICByZWdpc3RlckhlbHBlck1pc3NpbmcoaW5zdGFuY2UpO1xuICByZWdpc3RlcklmKGluc3RhbmNlKTtcbiAgcmVnaXN0ZXJMb2coaW5zdGFuY2UpO1xuICByZWdpc3Rlckxvb2t1cChpbnN0YW5jZSk7XG4gIHJlZ2lzdGVyV2l0aChpbnN0YW5jZSk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBtb3ZlSGVscGVyVG9Ib29rcyhpbnN0YW5jZSwgaGVscGVyTmFtZSwga2VlcEhlbHBlcikge1xuICBpZiAoaW5zdGFuY2UuaGVscGVyc1toZWxwZXJOYW1lXSkge1xuICAgIGluc3RhbmNlLmhvb2tzW2hlbHBlck5hbWVdID0gaW5zdGFuY2UuaGVscGVyc1toZWxwZXJOYW1lXTtcbiAgICBpZiAoIWtlZXBIZWxwZXIpIHtcbiAgICAgIGRlbGV0ZSBpbnN0YW5jZS5oZWxwZXJzW2hlbHBlck5hbWVdO1xuICAgIH1cbiAgfVxufVxuIl19\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","'use strict';\n\nexports.__esModule = true;\n\nvar _utils = require('./utils');\n\nvar logger = {\n  methodMap: ['debug', 'info', 'warn', 'error'],\n  level: 'info',\n\n  // Maps a given level value to the `methodMap` indexes above.\n  lookupLevel: function lookupLevel(level) {\n    if (typeof level === 'string') {\n      var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());\n      if (levelMap >= 0) {\n        level = levelMap;\n      } else {\n        level = parseInt(level, 10);\n      }\n    }\n\n    return level;\n  },\n\n  // Can be overridden in the host environment\n  log: function log(level) {\n    level = logger.lookupLevel(level);\n\n    if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {\n      var method = logger.methodMap[level];\n      // eslint-disable-next-line no-console\n      if (!console[method]) {\n        method = 'log';\n      }\n\n      for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n        message[_key - 1] = arguments[_key];\n      }\n\n      console[method].apply(console, message); // eslint-disable-line no-console\n    }\n  }\n};\n\nexports['default'] = logger;\nmodule.exports = exports['default'];\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2xvZ2dlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O3FCQUF3QixTQUFTOztBQUVqQyxJQUFJLE1BQU0sR0FBRztBQUNYLFdBQVMsRUFBRSxDQUFDLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxFQUFFLE9BQU8sQ0FBQztBQUM3QyxPQUFLLEVBQUUsTUFBTTs7O0FBR2IsYUFBVyxFQUFFLHFCQUFTLEtBQUssRUFBRTtBQUMzQixRQUFJLE9BQU8sS0FBSyxLQUFLLFFBQVEsRUFBRTtBQUM3QixVQUFJLFFBQVEsR0FBRyxlQUFRLE1BQU0sQ0FBQyxTQUFTLEVBQUUsS0FBSyxDQUFDLFdBQVcsRUFBRSxDQUFDLENBQUM7QUFDOUQsVUFBSSxRQUFRLElBQUksQ0FBQyxFQUFFO0FBQ2pCLGFBQUssR0FBRyxRQUFRLENBQUM7T0FDbEIsTUFBTTtBQUNMLGFBQUssR0FBRyxRQUFRLENBQUMsS0FBSyxFQUFFLEVBQUUsQ0FBQyxDQUFDO09BQzdCO0tBQ0Y7O0FBRUQsV0FBTyxLQUFLLENBQUM7R0FDZDs7O0FBR0Qs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KGxldmVsTWFwID49IDApIHtcbiAgICAgICAgbGV2ZWwgPSBsZXZlbE1hcDtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGxldmVsID0gcGFyc2VJbnQobGV2ZWwsIDEwKTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gbGV2ZWw7XG4gIH0sXG5cbiAgLy8gQ2FuIGJlIG92ZXJyaWRkZW4gaW4gdGhlIGhvc3QgZW52aXJvbm1lbnRcbiAgbG9nOiBmdW5jdGlvbihsZXZlbCwgLi4ubWVzc2FnZSkge1xuICAgIGxldmVsID0gbG9nZ2VyLmxvb2t1cExldmVsKGxldmVsKTtcblxuICAgIGlmIChcbiAgICAgIHR5cGVvZiBjb25zb2xlICE9PSAndW5kZWZpbmVkJyAmJlxuICAgICAgbG9nZ2VyLmxvb2t1cExldmVsKGxvZ2dlci5sZXZlbCkgPD0gbGV2ZWxcbiAgICApIHtcbiAgICAgIGxldCBtZXRob2QgPSBsb2dnZXIubWV0aG9kTWFwW2xldmVsXTtcbiAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1jb25zb2xlXG4gICAgICBpZiAoIWNvbnNvbGVbbWV0aG9kXSkge1xuICAgICAgICBtZXRob2QgPSAnbG9nJztcbiAgICAgIH1cbiAgICAgIGNvbnNvbGVbbWV0aG9kXSguLi5tZXNzYWdlKTsgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby1jb25zb2xlXG4gICAgfVxuICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBsb2dnZXI7XG4iXX0=\n","'use strict';\n\nexports.__esModule = true;\nexports.createProtoAccessControl = createProtoAccessControl;\nexports.resultIsAllowed = resultIsAllowed;\nexports.resetLoggedProperties = resetLoggedProperties;\n// istanbul ignore next\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }\n\nvar _createNewLookupObject = require('./create-new-lookup-object');\n\nvar _logger = require('../logger');\n\nvar logger = _interopRequireWildcard(_logger);\n\nvar loggedProperties = Object.create(null);\n\nfunction createProtoAccessControl(runtimeOptions) {\n  var defaultMethodWhiteList = Object.create(null);\n  defaultMethodWhiteList['constructor'] = false;\n  defaultMethodWhiteList['__defineGetter__'] = false;\n  defaultMethodWhiteList['__defineSetter__'] = false;\n  defaultMethodWhiteList['__lookupGetter__'] = false;\n\n  var defaultPropertyWhiteList = Object.create(null);\n  // eslint-disable-next-line no-proto\n  defaultPropertyWhiteList['__proto__'] = false;\n\n  return {\n    properties: {\n      whitelist: _createNewLookupObject.createNewLookupObject(defaultPropertyWhiteList, runtimeOptions.allowedProtoProperties),\n      defaultValue: runtimeOptions.allowProtoPropertiesByDefault\n    },\n    methods: {\n      whitelist: _createNewLookupObject.createNewLookupObject(defaultMethodWhiteList, runtimeOptions.allowedProtoMethods),\n      defaultValue: runtimeOptions.allowProtoMethodsByDefault\n    }\n  };\n}\n\nfunction resultIsAllowed(result, protoAccessControl, propertyName) {\n  if (typeof result === 'function') {\n    return checkWhiteList(protoAccessControl.methods, propertyName);\n  } else {\n    return checkWhiteList(protoAccessControl.properties, propertyName);\n  }\n}\n\nfunction checkWhiteList(protoAccessControlForType, propertyName) {\n  if (protoAccessControlForType.whitelist[propertyName] !== undefined) {\n    return protoAccessControlForType.whitelist[propertyName] === true;\n  }\n  if (protoAccessControlForType.defaultValue !== undefined) {\n    return protoAccessControlForType.defaultValue;\n  }\n  logUnexpecedPropertyAccessOnce(propertyName);\n  return false;\n}\n\nfunction logUnexpecedPropertyAccessOnce(propertyName) {\n  if (loggedProperties[propertyName] !== true) {\n    loggedProperties[propertyName] = true;\n    logger.log('error', 'Handlebars: Access has been denied to resolve the property \"' + propertyName + '\" because it is not an \"own property\" of its parent.\\n' + 'You can add a runtime option to disable the check or this warning:\\n' + 'See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details');\n  }\n}\n\nfunction resetLoggedProperties() {\n  Object.keys(loggedProperties).forEach(function (propertyName) {\n    delete loggedProperties[propertyName];\n  });\n}\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2ludGVybmFsL3Byb3RvLWFjY2Vzcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O3FDQUFzQyw0QkFBNEI7O3NCQUMxQyxXQUFXOztJQUF2QixNQUFNOztBQUVsQixJQUFNLGdCQUFnQixHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLENBQUM7O0FBRXRDLFNBQVMsd0JBQXdCLENBQUMsY0FBYyxFQUFFO0FBQ3ZELE1BQUksc0JBQXNCLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUNqRCx3QkFBc0IsQ0FBQyxhQUFhLENBQUMsR0FBRyxLQUFLLENBQUM7QUFDOUMsd0JBQXNCLENBQUMsa0JBQWtCLENBQUMsR0FBRyxLQUFLLENBQUM7QUFDbkQsd0JBQXNCLENBQUMsa0JBQWtCLENBQUMsR0FBRyxLQUFLLENBQUM7QUFDbkQsd0JBQXNCLENBQUMsa0JBQWtCLENBQUMsR0FBRyxLQUFLLENBQUM7O0FBRW5ELE1BQUksd0JBQXdCLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQzs7QUFFbkQsMEJBQXdCLENBQUMsV0FBVyxDQUFDLEdBQUcsS0FBSyxDQUFDOztBQUU5QyxTQUFPO0FBQ0wsY0FBVSxFQUFFO0FBQ1YsZUFBUyxFQUFFLDZDQUNULHdCQUF3QixFQUN4QixjQUFjLENBQUMsc0JBQXNCLENBQ3RDO0FBQ0Qsa0JBQVksRUFBRSxjQUFjLENBQUM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LlxcbmAgK1xuICAgICAgICBgWW91IGNhbiBhZGQgYSBydW50aW1lIG9wdGlvbiB0byBkaXNhYmxlIHRoZSBjaGVjayBvciB0aGlzIHdhcm5pbmc6XFxuYCArXG4gICAgICAgIGBTZWUgaHR0cHM6Ly9oYW5kbGViYXJzanMuY29tL2FwaS1yZWZlcmVuY2UvcnVudGltZS1vcHRpb25zLmh0bWwjb3B0aW9ucy10by1jb250cm9sLXByb3RvdHlwZS1hY2Nlc3MgZm9yIGRldGFpbHNgXG4gICAgKTtcbiAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gcmVzZXRMb2dnZWRQcm9wZXJ0aWVzKCkge1xuICBPYmplY3Qua2V5cyhsb2dnZWRQcm9wZXJ0aWVzKS5mb3JFYWNoKHByb3BlcnR5TmFtZSA9PiB7XG4gICAgZGVsZXRlIGxvZ2dlZFByb3BlcnRpZXNbcHJvcGVydHlOYW1lXTtcbiAgfSk7XG59XG4iXX0=\n","/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param  {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n  var str = '' + string;\n  var match = matchHtmlRegExp.exec(str);\n\n  if (!match) {\n    return str;\n  }\n\n  var escape;\n  var html = '';\n  var index = 0;\n  var lastIndex = 0;\n\n  for (index = match.index; index < str.length; index++) {\n    switch (str.charCodeAt(index)) {\n      case 34: // \"\n        escape = '&quot;';\n        break;\n      case 38: // &\n        escape = '&amp;';\n        break;\n      case 39: // '\n        escape = '&#39;';\n        break;\n      case 60: // <\n        escape = '&lt;';\n        break;\n      case 62: // >\n        escape = '&gt;';\n        break;\n      default:\n        continue;\n    }\n\n    if (lastIndex !== index) {\n      html += str.substring(lastIndex, index);\n    }\n\n    lastIndex = index + 1;\n    html += escape;\n  }\n\n  return lastIndex !== index\n    ? html + str.substring(lastIndex, index)\n    : html;\n}\n","var Handlebars = require(\"../../../../node_modules/handlebars/runtime.js\");\nfunction __default(obj) { return obj && (obj.__esModule ? obj[\"default\"] : obj); }\nmodule.exports = (Handlebars[\"default\"] || Handlebars).template({\"1\":function(container,depth0,helpers,partials,data) {\n    return \" new-item\";\n},\"3\":function(container,depth0,helpers,partials,data) {\n    var stack1, helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    };\n\n  return \"\t\t<span class=\\\"label\\\">\"\n    + ((stack1 = ((helper = (helper = lookupProperty(helpers,\"tagMarkup\") || (depth0 != null ? lookupProperty(depth0,\"tagMarkup\") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"tagMarkup\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":4,\"column\":22},\"end\":{\"line\":4,\"column\":37}}}) : helper))) != null ? stack1 : \"\")\n    + \"</span>\\n\";\n},\"5\":function(container,depth0,helpers,partials,data) {\n    var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    };\n\n  return \"\t\t<span class=\\\"label\\\">\"\n    + container.escapeExpression(((helper = (helper = lookupProperty(helpers,\"name\") || (depth0 != null ? lookupProperty(depth0,\"name\") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"name\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":6,\"column\":22},\"end\":{\"line\":6,\"column\":30}}}) : helper)))\n    + \"</span>\\n\";\n},\"7\":function(container,depth0,helpers,partials,data) {\n    var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    };\n\n  return \"\t\t<span class=\\\"systemtags-actions\\\">\\n\t\t\t<a href=\\\"#\\\" class=\\\"rename icon icon-rename\\\" title=\\\"\"\n    + container.escapeExpression(((helper = (helper = lookupProperty(helpers,\"renameTooltip\") || (depth0 != null ? lookupProperty(depth0,\"renameTooltip\") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"renameTooltip\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":10,\"column\":54},\"end\":{\"line\":10,\"column\":71}}}) : helper)))\n    + \"\\\"></a>\\n\t\t</span>\\n\";\n},\"compiler\":[8,\">= 4.3.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n    var stack1, helper, options, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=\"function\", lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    }, buffer = \n  \"<span class=\\\"systemtags-item\"\n    + ((stack1 = lookupProperty(helpers,\"if\").call(alias1,(depth0 != null ? lookupProperty(depth0,\"isNew\") : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(1, data, 0),\"inverse\":container.noop,\"data\":data,\"loc\":{\"start\":{\"line\":1,\"column\":28},\"end\":{\"line\":1,\"column\":57}}})) != null ? stack1 : \"\")\n    + \"\\\" data-id=\\\"\"\n    + container.escapeExpression(((helper = (helper = lookupProperty(helpers,\"id\") || (depth0 != null ? lookupProperty(depth0,\"id\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"id\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":1,\"column\":68},\"end\":{\"line\":1,\"column\":74}}}) : helper)))\n    + \"\\\">\\n<span class=\\\"checkmark icon icon-checkmark\\\"></span>\\n\"\n    + ((stack1 = lookupProperty(helpers,\"if\").call(alias1,(depth0 != null ? lookupProperty(depth0,\"isAdmin\") : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(3, data, 0),\"inverse\":container.program(5, data, 0),\"data\":data,\"loc\":{\"start\":{\"line\":3,\"column\":1},\"end\":{\"line\":7,\"column\":8}}})) != null ? stack1 : \"\");\n  stack1 = ((helper = (helper = lookupProperty(helpers,\"allowActions\") || (depth0 != null ? lookupProperty(depth0,\"allowActions\") : depth0)) != null ? helper : alias2),(options={\"name\":\"allowActions\",\"hash\":{},\"fn\":container.program(7, data, 0),\"inverse\":container.noop,\"data\":data,\"loc\":{\"start\":{\"line\":8,\"column\":1},\"end\":{\"line\":12,\"column\":18}}}),(typeof helper === alias3 ? helper.call(alias1,options) : helper));\n  if (!lookupProperty(helpers,\"allowActions\")) { stack1 = container.hooks.blockHelperMissing.call(depth0,stack1,options)}\n  if (stack1 != null) { buffer += stack1; }\n  return buffer + \"</span>\\n\";\n},\"useData\":true});","var Handlebars = require(\"../../../../node_modules/handlebars/runtime.js\");\nfunction __default(obj) { return obj && (obj.__esModule ? obj[\"default\"] : obj); }\nmodule.exports = (Handlebars[\"default\"] || Handlebars).template({\"1\":function(container,depth0,helpers,partials,data) {\n    var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    };\n\n  return \"\t\t<a href=\\\"#\\\" class=\\\"delete icon icon-delete\\\" title=\\\"\"\n    + container.escapeExpression(((helper = (helper = lookupProperty(helpers,\"deleteTooltip\") || (depth0 != null ? lookupProperty(depth0,\"deleteTooltip\") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"deleteTooltip\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":5,\"column\":53},\"end\":{\"line\":5,\"column\":70}}}) : helper)))\n    + \"\\\"></a>\\n\";\n},\"compiler\":[8,\">= 4.3.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=\"function\", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    };\n\n  return \"<form class=\\\"systemtags-rename-form\\\">\\n\t <label class=\\\"hidden-visually\\\" for=\\\"\"\n    + alias4(((helper = (helper = lookupProperty(helpers,\"cid\") || (depth0 != null ? lookupProperty(depth0,\"cid\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"cid\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":2,\"column\":38},\"end\":{\"line\":2,\"column\":45}}}) : helper)))\n    + \"-rename-input\\\">\"\n    + alias4(((helper = (helper = lookupProperty(helpers,\"renameLabel\") || (depth0 != null ? lookupProperty(depth0,\"renameLabel\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"renameLabel\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":2,\"column\":60},\"end\":{\"line\":2,\"column\":75}}}) : helper)))\n    + \"</label>\\n\t<input id=\\\"\"\n    + alias4(((helper = (helper = lookupProperty(helpers,\"cid\") || (depth0 != null ? lookupProperty(depth0,\"cid\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"cid\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":3,\"column\":12},\"end\":{\"line\":3,\"column\":19}}}) : helper)))\n    + \"-rename-input\\\" type=\\\"text\\\" value=\\\"\"\n    + alias4(((helper = (helper = lookupProperty(helpers,\"name\") || (depth0 != null ? lookupProperty(depth0,\"name\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"name\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":3,\"column\":53},\"end\":{\"line\":3,\"column\":61}}}) : helper)))\n    + \"\\\">\\n\"\n    + ((stack1 = lookupProperty(helpers,\"if\").call(alias1,(depth0 != null ? lookupProperty(depth0,\"isAdmin\") : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(1, data, 0),\"inverse\":container.noop,\"data\":data,\"loc\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":6,\"column\":8}}})) != null ? stack1 : \"\")\n    + \"</form>\\n\";\n},\"useData\":true});","var Handlebars = require(\"../../../../node_modules/handlebars/runtime.js\");\nfunction __default(obj) { return obj && (obj.__esModule ? obj[\"default\"] : obj); }\nmodule.exports = (Handlebars[\"default\"] || Handlebars).template({\"1\":function(container,depth0,helpers,partials,data) {\n    var stack1, helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    };\n\n  return \"\t<span class=\\\"label\\\">\"\n    + ((stack1 = ((helper = (helper = lookupProperty(helpers,\"tagMarkup\") || (depth0 != null ? lookupProperty(depth0,\"tagMarkup\") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"tagMarkup\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":2,\"column\":21},\"end\":{\"line\":2,\"column\":36}}}) : helper))) != null ? stack1 : \"\")\n    + \"</span>\\n\";\n},\"3\":function(container,depth0,helpers,partials,data) {\n    var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    };\n\n  return \"\t<span class=\\\"label\\\">\"\n    + container.escapeExpression(((helper = (helper = lookupProperty(helpers,\"name\") || (depth0 != null ? lookupProperty(depth0,\"name\") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"name\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":4,\"column\":21},\"end\":{\"line\":4,\"column\":29}}}) : helper)))\n    + \"</span>\\n\";\n},\"compiler\":[8,\">= 4.3.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n    var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    };\n\n  return ((stack1 = lookupProperty(helpers,\"if\").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,\"isAdmin\") : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(1, data, 0),\"inverse\":container.program(3, data, 0),\"data\":data,\"loc\":{\"start\":{\"line\":1,\"column\":0},\"end\":{\"line\":5,\"column\":7}}})) != null ? stack1 : \"\");\n},\"useData\":true});","/*\n * Copyright (c) 2015\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\n(function(OC) {\n\n\t_.extend(OC.Files.Client, {\n\t\tPROPERTY_FILEID:\t'{' + OC.Files.Client.NS_OWNCLOUD + '}id',\n\t\tPROPERTY_CAN_ASSIGN: '{' + OC.Files.Client.NS_OWNCLOUD + '}can-assign',\n\t\tPROPERTY_DISPLAYNAME:\t'{' + OC.Files.Client.NS_OWNCLOUD + '}display-name',\n\t\tPROPERTY_USERVISIBLE:\t'{' + OC.Files.Client.NS_OWNCLOUD + '}user-visible',\n\t\tPROPERTY_USERASSIGNABLE: '{' + OC.Files.Client.NS_OWNCLOUD + '}user-assignable',\n\t})\n\n\t/**\n\t * @class OCA.SystemTags.SystemTagsCollection\n\t * @classdesc\n\t *\n\t * System tag\n\t *\n\t */\n\tconst SystemTagModel = OC.Backbone.Model.extend(\n\t\t/** @lends OCA.SystemTags.SystemTagModel.prototype */ {\n\t\t\tsync: OC.Backbone.davSync,\n\n\t\t\tdefaults: {\n\t\t\t\tuserVisible: true,\n\t\t\t\tuserAssignable: true,\n\t\t\t\tcanAssign: true,\n\t\t\t},\n\n\t\t\tdavProperties: {\n\t\t\t\t'id':\tOC.Files.Client.PROPERTY_FILEID,\n\t\t\t\t'name': OC.Files.Client.PROPERTY_DISPLAYNAME,\n\t\t\t\t'userVisible': OC.Files.Client.PROPERTY_USERVISIBLE,\n\t\t\t\t'userAssignable': OC.Files.Client.PROPERTY_USERASSIGNABLE,\n\t\t\t\t// read-only, effective permissions computed by the server,\n\t\t\t\t'canAssign': OC.Files.Client.PROPERTY_CAN_ASSIGN,\n\t\t\t},\n\n\t\t\tparse: function(data) {\n\t\t\t\treturn {\n\t\t\t\t\tid: data.id,\n\t\t\t\t\tname: data.name,\n\t\t\t\t\tuserVisible: data.userVisible === true || data.userVisible === 'true',\n\t\t\t\t\tuserAssignable: data.userAssignable === true || data.userAssignable === 'true',\n\t\t\t\t\tcanAssign: data.canAssign === true || data.canAssign === 'true',\n\t\t\t\t}\n\t\t\t},\n\t\t})\n\n\tOC.SystemTags = OC.SystemTags || {}\n\tOC.SystemTags.SystemTagModel = SystemTagModel\n})(OC)\n","/*\n * Copyright (c) 2015\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\n(function(OC) {\n\t/**\n\t * @class OC.SystemTags.SystemTagsMappingCollection\n\t * @classdesc\n\t *\n\t * Collection of tags assigned to a an object\n\t *\n\t */\n\tconst SystemTagsMappingCollection = OC.Backbone.Collection.extend(\n\t\t/** @lends OC.SystemTags.SystemTagsMappingCollection.prototype */ {\n\n\t\t\tsync: OC.Backbone.davSync,\n\n\t\t\t/**\n\t\t * Use PUT instead of PROPPATCH\n\t\t */\n\t\t\tusePUT: true,\n\n\t\t\t/**\n\t\t * Id of the file for which to filter activities by\n\t\t *\n\t\t * @var int\n\t\t */\n\t\t\t_objectId: null,\n\n\t\t\t/**\n\t\t * Type of the object to filter by\n\t\t *\n\t\t * @var string\n\t\t */\n\t\t\t_objectType: 'files',\n\n\t\t\tmodel: OC.SystemTags.SystemTagModel,\n\n\t\t\turl: function() {\n\t\t\t\treturn OC.linkToRemote('dav') + '/systemtags-relations/' + this._objectType + '/' + this._objectId\n\t\t\t},\n\n\t\t\t/**\n\t\t * Sets the object id to filter by or null for all.\n\t\t *\n\t\t * @param {int} objectId file id or null\n\t\t */\n\t\t\tsetObjectId: function(objectId) {\n\t\t\t\tthis._objectId = objectId\n\t\t\t},\n\n\t\t\t/**\n\t\t * Sets the object type to filter by or null for all.\n\t\t *\n\t\t * @param {int} objectType file id or null\n\t\t */\n\t\t\tsetObjectType: function(objectType) {\n\t\t\t\tthis._objectType = objectType\n\t\t\t},\n\n\t\t\tinitialize: function(models, options) {\n\t\t\t\toptions = options || {}\n\t\t\t\tif (!_.isUndefined(options.objectId)) {\n\t\t\t\t\tthis._objectId = options.objectId\n\t\t\t\t}\n\t\t\t\tif (!_.isUndefined(options.objectType)) {\n\t\t\t\t\tthis._objectType = options.objectType\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tgetTagIds: function() {\n\t\t\t\treturn this.map(function(model) {\n\t\t\t\t\treturn model.id\n\t\t\t\t})\n\t\t\t},\n\t\t})\n\n\tOC.SystemTags = OC.SystemTags || {}\n\tOC.SystemTags.SystemTagsMappingCollection = SystemTagsMappingCollection\n})(OC)\n","/* eslint-disable */\n/*\n * Copyright (c) 2015\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\n(function(OC) {\n\n\tfunction filterFunction(model, term) {\n\t\treturn model.get('name').substr(0, term.length).toLowerCase() === term.toLowerCase()\n\t}\n\n\t/**\n\t * @class OCA.SystemTags.SystemTagsCollection\n\t * @classdesc\n\t *\n\t * Collection of tags assigned to a file\n\t *\n\t */\n\tvar SystemTagsCollection = OC.Backbone.Collection.extend(\n\t\t/** @lends OC.SystemTags.SystemTagsCollection.prototype */ {\n\n\t\t\tsync: OC.Backbone.davSync,\n\n\t\t\tmodel: OC.SystemTags.SystemTagModel,\n\n\t\t\turl: function() {\n\t\t\t\treturn OC.linkToRemote('dav') + '/systemtags/'\n\t\t\t},\n\n\t\t\tfilterByName: function(name) {\n\t\t\t\treturn this.filter(function(model) {\n\t\t\t\t\treturn filterFunction(model, name)\n\t\t\t\t})\n\t\t\t},\n\n\t\t\treset: function() {\n\t\t\t\tthis.fetched = false\n\t\t\t\treturn OC.Backbone.Collection.prototype.reset.apply(this, arguments)\n\t\t\t},\n\n\t\t\t/**\n\t\t * Lazy fetch.\n\t\t * Only fetches once, subsequent calls will directly call the success handler.\n\t\t *\n\t\t * @param options\n\t\t * @param [options.force] true to force fetch even if cached entries exist\n\t\t *\n\t\t * @see Backbone.Collection#fetch\n\t\t */\n\t\t\tfetch: function(options) {\n\t\t\t\tvar self = this\n\t\t\t\toptions = options || {}\n\t\t\t\tif (this.fetched || options.force) {\n\t\t\t\t// directly call handler\n\t\t\t\t\tif (options.success) {\n\t\t\t\t\t\toptions.success(this, null, options)\n\t\t\t\t\t}\n\t\t\t\t\t// trigger sync event\n\t\t\t\t\tthis.trigger('sync', this, null, options)\n\t\t\t\t\treturn Promise.resolve()\n\t\t\t\t}\n\n\t\t\t\tvar success = options.success\n\t\t\t\toptions = _.extend({}, options)\n\t\t\t\toptions.success = function() {\n\t\t\t\t\tself.fetched = true\n\t\t\t\t\tif (success) {\n\t\t\t\t\t\treturn success.apply(this, arguments)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn OC.Backbone.Collection.prototype.fetch.call(this, options)\n\t\t\t}\n\t\t})\n\n\tOC.SystemTags = OC.SystemTags || {}\n\tOC.SystemTags.SystemTagsCollection = SystemTagsCollection\n\n\t/**\n\t * @type OC.SystemTags.SystemTagsCollection\n\t */\n\tOC.SystemTags.collection = new OC.SystemTags.SystemTagsCollection()\n})(OC)\n","'use strict';\n\nexports.__esModule = true;\n// istanbul ignore next\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\n// istanbul ignore next\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }\n\nvar _handlebarsBase = require('./handlebars/base');\n\nvar base = _interopRequireWildcard(_handlebarsBase);\n\n// Each of these augment the Handlebars object. No need to setup here.\n// (This is done to easily share code between commonjs and browse envs)\n\nvar _handlebarsSafeString = require('./handlebars/safe-string');\n\nvar _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);\n\nvar _handlebarsException = require('./handlebars/exception');\n\nvar _handlebarsException2 = _interopRequireDefault(_handlebarsException);\n\nvar _handlebarsUtils = require('./handlebars/utils');\n\nvar Utils = _interopRequireWildcard(_handlebarsUtils);\n\nvar _handlebarsRuntime = require('./handlebars/runtime');\n\nvar runtime = _interopRequireWildcard(_handlebarsRuntime);\n\nvar _handlebarsNoConflict = require('./handlebars/no-conflict');\n\nvar _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);\n\n// For compatibility and usage outside of module systems, make the Handlebars object a namespace\nfunction create() {\n  var hb = new base.HandlebarsEnvironment();\n\n  Utils.extend(hb, base);\n  hb.SafeString = _handlebarsSafeString2['default'];\n  hb.Exception = _handlebarsException2['default'];\n  hb.Utils = Utils;\n  hb.escapeExpression = Utils.escapeExpression;\n\n  hb.VM = runtime;\n  hb.template = function (spec) {\n    return runtime.template(spec, hb);\n  };\n\n  return hb;\n}\n\nvar inst = create();\ninst.create = create;\n\n_handlebarsNoConflict2['default'](inst);\n\ninst['default']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mluZyA9IFNhZmVTdHJpbmc7XG4gIGhiLkV4Y2VwdGlvbiA9IEV4Y2VwdGlvbjtcbiAgaGIuVXRpbHMgPSBVdGlscztcbiAgaGIuZXNjYXBlRXhwcmVzc2lvbiA9IFV0aWxzLmVzY2FwZUV4cHJlc3Npb247XG5cbiAgaGIuVk0gPSBydW50aW1lO1xuICBoYi50ZW1wbGF0ZSA9IGZ1bmN0aW9uKHNwZWMpIHtcbiAgICByZXR1cm4gcnVudGltZS50ZW1wbGF0ZShzcGVjLCBoYik7XG4gIH07XG5cbiAgcmV0dXJuIGhiO1xufVxuXG5sZXQgaW5zdCA9IGNyZWF0ZSgpO1xuaW5zdC5jcmVhdGUgPSBjcmVhdGU7XG5cbm5vQ29uZmxpY3QoaW5zdCk7XG5cbmluc3RbJ2RlZmF1bHQnXSA9IGluc3Q7XG5cbmV4cG9ydCBkZWZhdWx0IGluc3Q7XG4iXX0=\n","'use strict';\n\nexports.__esModule = true;\n\nvar _utils = require('../utils');\n\nexports['default'] = function (instance) {\n  instance.registerHelper('blockHelperMissing', function (context, options) {\n    var inverse = options.inverse,\n        fn = options.fn;\n\n    if (context === true) {\n      return fn(this);\n    } else if (context === false || context == null) {\n      return inverse(this);\n    } else if (_utils.isArray(context)) {\n      if (context.length > 0) {\n        if (options.ids) {\n          options.ids = [options.name];\n        }\n\n        return instance.helpers.each(context, options);\n      } else {\n        return inverse(this);\n      }\n    } else {\n      if (options.data && options.ids) {\n        var data = _utils.createFrame(options.data);\n        data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);\n        options = { data: data };\n      }\n\n      return fn(context, options);\n    }\n  });\n};\n\nmodule.exports = exports['default'];\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvYmxvY2staGVscGVyLW1pc3NpbmcuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6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7XG4gICAgICAgIHJldHVybiBpbnZlcnNlKHRoaXMpO1xuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBpZiAob3B0aW9ucy5kYXRhICYmIG9wdGlvbnMuaWRzKSB7XG4gICAgICAgIGxldCBkYXRhID0gY3JlYXRlRnJhbWUob3B0aW9ucy5kYXRhKTtcbiAgICAgICAgZGF0YS5jb250ZXh0UGF0aCA9IGFwcGVuZENvbnRleHRQYXRoKFxuICAgICAgICAgIG9wdGlvbnMuZGF0YS5jb250ZXh0UGF0aCxcbiAgICAgICAgICBvcHRpb25zLm5hbWVcbiAgICAgICAgKTtcbiAgICAgICAgb3B0aW9ucyA9IHsgZGF0YTogZGF0YSB9O1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gZm4oY29udGV4dCwgb3B0aW9ucyk7XG4gICAgfVxuICB9KTtcbn1cbiJdfQ==\n","'use strict';\n\nexports.__esModule = true;\n// istanbul ignore next\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _utils = require('../utils');\n\nvar _exception = require('../exception');\n\nvar _exception2 = _interopRequireDefault(_exception);\n\nexports['default'] = function (instance) {\n  instance.registerHelper('each', function (context, options) {\n    if (!options) {\n      throw new _exception2['default']('Must pass iterator to #each');\n    }\n\n    var fn = options.fn,\n        inverse = options.inverse,\n        i = 0,\n        ret = '',\n        data = undefined,\n        contextPath = undefined;\n\n    if (options.data && options.ids) {\n      contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';\n    }\n\n    if (_utils.isFunction(context)) {\n      context = context.call(this);\n    }\n\n    if (options.data) {\n      data = _utils.createFrame(options.data);\n    }\n\n    function execIteration(field, index, last) {\n      if (data) {\n        data.key = field;\n        data.index = index;\n        data.first = index === 0;\n        data.last = !!last;\n\n        if (contextPath) {\n          data.contextPath = contextPath + field;\n        }\n      }\n\n      ret = ret + fn(context[field], {\n        data: data,\n        blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])\n      });\n    }\n\n    if (context && typeof context === 'object') {\n      if (_utils.isArray(context)) {\n        for (var j = context.length; i < j; i++) {\n          if (i in context) {\n            execIteration(i, i, i === context.length - 1);\n          }\n        }\n      } else if (global.Symbol && context[global.Symbol.iterator]) {\n        var newContext = [];\n        var iterator = context[global.Symbol.iterator]();\n        for (var it = iterator.next(); !it.done; it = iterator.next()) {\n          newContext.push(it.value);\n        }\n        context = newContext;\n        for (var j = context.length; i < j; i++) {\n          execIteration(i, i, i === context.length - 1);\n        }\n      } else {\n        (function () {\n          var priorKey = undefined;\n\n          Object.keys(context).forEach(function (key) {\n            // We're running the iterations one step out of sync so we can detect\n            // the last iteration without have to scan the object twice and create\n            // an itermediate keys array.\n            if (priorKey !== undefined) {\n              execIteration(priorKey, i - 1);\n            }\n            priorKey = key;\n            i++;\n          });\n          if (priorKey !== undefined) {\n            execIteration(priorKey, i - 1, true);\n          }\n        })();\n      }\n    }\n\n    if (i === 0) {\n      ret = inverse(this);\n    }\n\n    return ret;\n  });\n};\n\nmodule.exports = exports['default'];\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvZWFjaC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O3FCQU1PLFVBQVU7O3lCQUNLLGNBQWM7Ozs7cUJBRXJCLFVBQVMsUUFBUSxFQUFFO0FBQ2hDLFVBQVEsQ0FBQyxjQUFjLENBQUMsTUFBTSxFQUFFLFVBQVMsT0FBTyxFQUFFLE9BQU8sRUFBRTtBQUN6RCxRQUFJLENBQUMsT0FBTyxFQUFFO0FBQ1osWUFBTSwyQkFBYyw2QkFBNkIsQ0FBQyxDQUFDO0tBQ3BEOztBQUVELFFBQUksRUFBRSxHQUFHLE9BQU8sQ0FBQyxFQUFFO1FBQ2pCLE9BQU8sR0FBRyxPQUFPLENBQUMsT0FBTzt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1xuICAgICAgcmV0ID0gaW52ZXJzZSh0aGlzKTtcbiAgICB9XG5cbiAgICByZXR1cm4gcmV0O1xuICB9KTtcbn1cbiJdfQ==\n","'use strict';\n\nexports.__esModule = true;\n// istanbul ignore next\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _exception = require('../exception');\n\nvar _exception2 = _interopRequireDefault(_exception);\n\nexports['default'] = function (instance) {\n  instance.registerHelper('helperMissing', function () /* [args, ]options */{\n    if (arguments.length === 1) {\n      // A missing field in a {{foo}} construct.\n      return undefined;\n    } else {\n      // Someone is actually trying to call something, blow up.\n      throw new _exception2['default']('Missing helper: \"' + arguments[arguments.length - 1].name + '\"');\n    }\n  });\n};\n\nmodule.exports = exports['default'];\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvaGVscGVyLW1pc3NpbmcuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozt5QkFBc0IsY0FBYzs7OztxQkFFckIsVUFBUyxRQUFRLEVBQUU7QUFDaEMsVUFBUSxDQUFDLGNBQWMsQ0FBQyxlQUFlLEVBQUUsaUNBQWdDO0FBQ3ZFLFFBQUksU0FBUyxDQUFDLE1BQU0sS0FBSyxDQUFDLEVBQUU7O0FBRTFCLGFBQU8sU0FBUyxDQUFDO0tBQ2xCLE1BQU07O0FBRUwsWUFBTSwyQkFDSixtQkFBbUIsR0FBRyxTQUFTLENBQUMsU0FBUyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQyxJQUFJLEdBQUcsR0FBRyxDQUNqRSxDQUFDO0tBQ0g7R0FDRixDQUFDLENBQUM7Q0FDSiIsImZpbGUiOiJoZWxwZXItbWlzc2luZy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBFeGNlcHRpb24gZnJvbSAnLi4vZXhjZXB0aW9uJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oaW5zdGFuY2UpIHtcbiAgaW5zdGFuY2UucmVnaXN0ZXJIZWxwZXIoJ2hlbHBlck1pc3NpbmcnLCBmdW5jdGlvbigvKiBbYXJncywgXW9wdGlvbnMgKi8pIHtcbiAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgLy8gQSBtaXNzaW5nIGZpZWxkIGluIGEge3tmb299fSBjb25zdHJ1Y3QuXG4gICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH0gZWxzZSB7XG4gICAgICAvLyBTb21lb25lIGlzIGFjdHVhbGx5IHRyeWluZyB0byBjYWxsIHNvbWV0aGluZywgYmxvdyB1cC5cbiAgICAgIHRocm93IG5ldyBFeGNlcHRpb24oXG4gICAgICAgICdNaXNzaW5nIGhlbHBlcjogXCInICsgYXJndW1lbnRzW2FyZ3VtZW50cy5sZW5ndGggLSAxXS5uYW1lICsgJ1wiJ1xuICAgICAgKTtcbiAgICB9XG4gIH0pO1xufVxuIl19\n","'use strict';\n\nexports.__esModule = true;\n// istanbul ignore next\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _utils = require('../utils');\n\nvar _exception = require('../exception');\n\nvar _exception2 = _interopRequireDefault(_exception);\n\nexports['default'] = function (instance) {\n  instance.registerHelper('if', function (conditional, options) {\n    if (arguments.length != 2) {\n      throw new _exception2['default']('#if requires exactly one argument');\n    }\n    if (_utils.isFunction(conditional)) {\n      conditional = conditional.call(this);\n    }\n\n    // Default behavior is to render the positive path if the value is truthy and not empty.\n    // The `includeZero` option may be set to treat the condtional as purely not empty based on the\n    // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.\n    if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {\n      return options.inverse(this);\n    } else {\n      return options.fn(this);\n    }\n  });\n\n  instance.registerHelper('unless', function (conditional, options) {\n    if (arguments.length != 2) {\n      throw new _exception2['default']('#unless requires exactly one argument');\n    }\n    return instance.helpers['if'].call(this, conditional, {\n      fn: options.inverse,\n      inverse: options.fn,\n      hash: options.hash\n    });\n  });\n};\n\nmodule.exports = exports['default'];\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvaWYuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7OztxQkFBb0MsVUFBVTs7eUJBQ3hCLGNBQWM7Ozs7cUJBRXJCLFVBQVMsUUFBUSxFQUFFO0FBQ2hDLFVBQVEsQ0FBQyxjQUFjLENBQUMsSUFBSSxFQUFFLFVBQVMsV0FBVyxFQUFFLE9BQU8sRUFBRTtBQUMzRCxRQUFJLFNBQVMsQ0FBQyxNQUFNLElBQUksQ0FBQyxFQUFFO0FBQ3pCLFlBQU0sMkJBQWMsbUNBQW1DLENBQUMsQ0FBQztLQUMxRDtBQUNELFFBQUksa0JBQVcsV0FBVyxDQUFDLEVBQUU7QUFDM0IsaUJBQVcsR0FBRyxXQUFXLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO0tBQ3RDOzs7OztBQUtELFFBQUksQUFBQyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsV0FBVyxJQUFJLENBQUMsV0FBVyxJQUFLLGVBQVEsV0FBVyxDQUFDLEVBQUU7QUFDdkUsYUFBTyxPQUFPLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0tBQzlCLE1BQU07QUFDTCxhQUFPLE9BQU8sQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLENBQUM7S0FDekI7R0FDRixDQUFDLENBQUM7O0FBRUgsVUFBUSxDQUFDLGNBQWMsQ0FBQyxRQUFRLEVBQUUsVUFBUyxXQUFXLEVBQUUsT0FBTyxFQUFFO0F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HR5LlxuICAgIC8vIFRoZSBgaW5jbHVkZVplcm9gIG9wdGlvbiBtYXkgYmUgc2V0IHRvIHRyZWF0IHRoZSBjb25kdGlvbmFsIGFzIHB1cmVseSBub3QgZW1wdHkgYmFzZWQgb24gdGhlXG4gICAgLy8gYmVoYXZpb3Igb2YgaXNFbXB0eS4gRWZmZWN0aXZlbHkgdGhpcyBkZXRlcm1pbmVzIGlmIDAgaXMgaGFuZGxlZCBieSB0aGUgcG9zaXRpdmUgcGF0aCBvciBuZWdhdGl2ZS5cbiAgICBpZiAoKCFvcHRpb25zLmhhc2guaW5jbHVkZVplcm8gJiYgIWNvbmRpdGlvbmFsKSB8fCBpc0VtcHR5KGNvbmRpdGlvbmFsKSkge1xuICAgICAgcmV0dXJuIG9wdGlvbnMuaW52ZXJzZSh0aGlzKTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIG9wdGlvbnMuZm4odGhpcyk7XG4gICAgfVxuICB9KTtcblxuICBpbnN0YW5jZS5yZWdpc3RlckhlbHBlcigndW5sZXNzJywgZnVuY3Rpb24oY29uZGl0aW9uYWwsIG9wdGlvbnMpIHtcbiAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCAhPSAyKSB7XG4gICAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKCcjdW5sZXNzIHJlcXVpcmVzIGV4YWN0bHkgb25lIGFyZ3VtZW50Jyk7XG4gICAgfVxuICAgIHJldHVybiBpbnN0YW5jZS5oZWxwZXJzWydpZiddLmNhbGwodGhpcywgY29uZGl0aW9uYWwsIHtcbiAgICAgIGZuOiBvcHRpb25zLmludmVyc2UsXG4gICAgICBpbnZlcnNlOiBvcHRpb25zLmZuLFxuICAgICAgaGFzaDogb3B0aW9ucy5oYXNoXG4gICAgfSk7XG4gIH0pO1xufVxuIl19\n","'use strict';\n\nexports.__esModule = true;\n\nexports['default'] = function (instance) {\n  instance.registerHelper('log', function () /* message, options */{\n    var args = [undefined],\n        options = arguments[arguments.length - 1];\n    for (var i = 0; i < arguments.length - 1; i++) {\n      args.push(arguments[i]);\n    }\n\n    var level = 1;\n    if (options.hash.level != null) {\n      level = options.hash.level;\n    } else if (options.data && options.data.level != null) {\n      level = options.data.level;\n    }\n    args[0] = level;\n\n    instance.log.apply(instance, args);\n  });\n};\n\nmodule.exports = exports['default'];\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvbG9nLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7cUJBQWUsVUFBUyxRQUFRLEVBQUU7QUFDaEMsVUFBUSxDQUFDLGNBQWMsQ0FBQyxLQUFLLEVBQUUsa0NBQWlDO0FBQzlELFFBQUksSUFBSSxHQUFHLENBQUMsU0FBUyxDQUFDO1FBQ3BCLE9BQU8sR0FBRyxTQUFTLENBQUMsU0FBUyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQztBQUM1QyxTQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsU0FBUyxDQUFDLE1BQU0sR0FBRyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUU7QUFDN0MsVUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztLQUN6Qjs7QUFFRCxRQUFJLEtBQUssR0FBRyxDQUFDLENBQUM7QUFDZCxRQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsS0FBSyxJQUFJLElBQUksRUFBRTtBQUM5QixXQUFLLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUM7S0FDNUIsTUFBTSxJQUFJLE9BQU8sQ0FBQyxJQUFJLElBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLElBQUksSUFBSSxFQUFFO0FBQ3JELFdBQUssR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQztLQUM1QjtBQUNELFFBQUksQ0FBQyxDQUFDLENBQUMsR0FBRyxLQUFLLENBQUM7O0FBRWhCLFlBQVEsQ0FBQyxHQUFHLE1BQUEsQ0FBWixRQUFRLEVBQVEsSUFBSSxDQUFDLENBQUM7R0FDdkIsQ0FBQyxDQUFDO0NBQ0oiLCJmaWxlIjoibG9nLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oaW5zdGFuY2UpIHtcbiAgaW5zdGFuY2UucmVnaXN0ZXJIZWxwZXIoJ2xvZycsIGZ1bmN0aW9uKC8qIG1lc3NhZ2UsIG9wdGlvbnMgKi8pIHtcbiAgICBsZXQgYXJncyA9IFt1bmRlZmluZWRdLFxuICAgICAgb3B0aW9ucyA9IGFyZ3VtZW50c1thcmd1bWVudHMubGVuZ3RoIC0gMV07XG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcmd1bWVudHMubGVuZ3RoIC0gMTsgaSsrKSB7XG4gICAgICBhcmdzLnB1c2goYXJndW1lbnRzW2ldKTtcbiAgICB9XG5cbiAgICBsZXQgbGV2ZWwgPSAxO1xuICAgIGlmIChvcHRpb25zLmhhc2gubGV2ZWwgIT0gbnVsbCkge1xuICAgICAgbGV2ZWwgPSBvcHRpb25zLmhhc2gubGV2ZWw7XG4gICAgfSBlbHNlIGlmIChvcHRpb25zLmRhdGEgJiYgb3B0aW9ucy5kYXRhLmxldmVsICE9IG51bGwpIHtcbiAgICAgIGxldmVsID0gb3B0aW9ucy5kYXRhLmxldmVsO1xuICAgIH1cbiAgICBhcmdzWzBdID0gbGV2ZWw7XG5cbiAgICBpbnN0YW5jZS5sb2coLi4uYXJncyk7XG4gIH0pO1xufVxuIl19\n","'use strict';\n\nexports.__esModule = true;\n\nexports['default'] = function (instance) {\n  instance.registerHelper('lookup', function (obj, field, options) {\n    if (!obj) {\n      // Note for 5.0: Change to \"obj == null\" in 5.0\n      return obj;\n    }\n    return options.lookupProperty(obj, field);\n  });\n};\n\nmodule.exports = exports['default'];\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvbG9va3VwLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7cUJBQWUsVUFBUyxRQUFRLEVBQUU7QUFDaEMsVUFBUSxDQUFDLGNBQWMsQ0FBQyxRQUFRLEVBQUUsVUFBUyxHQUFHLEVBQUUsS0FBSyxFQUFFLE9BQU8sRUFBRTtBQUM5RCxRQUFJLENBQUMsR0FBRyxFQUFFOztBQUVSLGFBQU8sR0FBRyxDQUFDO0tBQ1o7QUFDRCxXQUFPLE9BQU8sQ0FBQyxjQUFjLENBQUMsR0FBRyxFQUFFLEtBQUssQ0FBQyxDQUFDO0dBQzNDLENBQUMsQ0FBQztDQUNKIiwiZmlsZSI6Imxvb2t1cC5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uKGluc3RhbmNlKSB7XG4gIGluc3RhbmNlLnJlZ2lzdGVySGVscGVyKCdsb29rdXAnLCBmdW5jdGlvbihvYmosIGZpZWxkLCBvcHRpb25zKSB7XG4gICAgaWYgKCFvYmopIHtcbiAgICAgIC8vIE5vdGUgZm9yIDUuMDogQ2hhbmdlIHRvIFwib2JqID09IG51bGxcIiBpbiA1LjBcbiAgICAgIHJldHVybiBvYmo7XG4gICAgfVxuICAgIHJldHVybiBvcHRpb25zLmxvb2t1cFByb3BlcnR5KG9iaiwgZmllbGQpO1xuICB9KTtcbn1cbiJdfQ==\n","'use strict';\n\nexports.__esModule = true;\n// istanbul ignore next\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _utils = require('../utils');\n\nvar _exception = require('../exception');\n\nvar _exception2 = _interopRequireDefault(_exception);\n\nexports['default'] = function (instance) {\n  instance.registerHelper('with', function (context, options) {\n    if (arguments.length != 2) {\n      throw new _exception2['default']('#with requires exactly one argument');\n    }\n    if (_utils.isFunction(context)) {\n      context = context.call(this);\n    }\n\n    var fn = options.fn;\n\n    if (!_utils.isEmpty(context)) {\n      var data = options.data;\n      if (options.data && options.ids) {\n        data = _utils.createFrame(options.data);\n        data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);\n      }\n\n      return fn(context, {\n        data: data,\n        blockParams: _utils.blockParams([context], [data && data.contextPath])\n      });\n    } else {\n      return options.inverse(this);\n    }\n  });\n};\n\nmodule.exports = exports['default'];\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvd2l0aC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O3FCQU1PLFVBQVU7O3lCQUNLLGNBQWM7Ozs7cUJBRXJCLFVBQVMsUUFBUSxFQUFFO0FBQ2hDLFVBQVEsQ0FBQyxjQUFjLENBQUMsTUFBTSxFQUFFLFVBQVMsT0FBTyxFQUFFLE9BQU8sRUFBRTtBQUN6RCxRQUFJLFNBQVMsQ0FBQyxNQUFNLElBQUksQ0FBQyxFQUFFO0FBQ3pCLFlBQU0sMkJBQWMscUNBQXFDLENBQUMsQ0FBQztLQUM1RDtBQUNELFFBQUksa0JBQVcsT0FBTyxDQUFDLEVBQUU7QUFDdkIsYUFBTyxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7S0FDOUI7O0FBRUQsUUFBSSxFQUFFLEdBQUcsT0FBTyxDQUFDLEVBQUUsQ0FBQzs7QUFFcEIsUUFBSSxDQUFDLGVBQVEsT0FBTyxDQUFDLEVBQUU7QUFDckIsVUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLElBQUks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IHJlcXVpcmVzIGV4YWN0bHkgb25lIGFyZ3VtZW50Jyk7XG4gICAgfVxuICAgIGlmIChpc0Z1bmN0aW9uKGNvbnRleHQpKSB7XG4gICAgICBjb250ZXh0ID0gY29udGV4dC5jYWxsKHRoaXMpO1xuICAgIH1cblxuICAgIGxldCBmbiA9IG9wdGlvbnMuZm47XG5cbiAgICBpZiAoIWlzRW1wdHkoY29udGV4dCkpIHtcbiAgICAgIGxldCBkYXRhID0gb3B0aW9ucy5kYXRhO1xuICAgICAgaWYgKG9wdGlvbnMuZGF0YSAmJiBvcHRpb25zLmlkcykge1xuICAgICAgICBkYXRhID0gY3JlYXRlRnJhbWUob3B0aW9ucy5kYXRhKTtcbiAgICAgICAgZGF0YS5jb250ZXh0UGF0aCA9IGFwcGVuZENvbnRleHRQYXRoKFxuICAgICAgICAgIG9wdGlvbnMuZGF0YS5jb250ZXh0UGF0aCxcbiAgICAgICAgICBvcHRpb25zLmlkc1swXVxuICAgICAgICApO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gZm4oY29udGV4dCwge1xuICAgICAgICBkYXRhOiBkYXRhLFxuICAgICAgICBibG9ja1BhcmFtczogYmxvY2tQYXJhbXMoW2NvbnRleHRdLCBbZGF0YSAmJiBkYXRhLmNvbnRleHRQYXRoXSlcbiAgICAgIH0pO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gb3B0aW9ucy5pbnZlcnNlKHRoaXMpO1xuICAgIH1cbiAgfSk7XG59XG4iXX0=\n","'use strict';\n\nexports.__esModule = true;\nexports.registerDefaultDecorators = registerDefaultDecorators;\n// istanbul ignore next\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _decoratorsInline = require('./decorators/inline');\n\nvar _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);\n\nfunction registerDefaultDecorators(instance) {\n  _decoratorsInline2['default'](instance);\n}\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2RlY29yYXRvcnMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Z0NBQTJCLHFCQUFxQjs7OztBQUV6QyxTQUFTLHlCQUF5QixDQUFDLFFBQVEsRUFBRTtBQUNsRCxnQ0FBZSxRQUFRLENBQUMsQ0FBQztDQUMxQiIsImZpbGUiOiJkZWNvcmF0b3JzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHJlZ2lzdGVySW5saW5lIGZyb20gJy4vZGVjb3JhdG9ycy9pbmxpbmUnO1xuXG5leHBvcnQgZnVuY3Rpb24gcmVnaXN0ZXJEZWZhdWx0RGVjb3JhdG9ycyhpbnN0YW5jZSkge1xuICByZWdpc3RlcklubGluZShpbnN0YW5jZSk7XG59XG4iXX0=\n","'use strict';\n\nexports.__esModule = true;\n\nvar _utils = require('../utils');\n\nexports['default'] = function (instance) {\n  instance.registerDecorator('inline', function (fn, props, container, options) {\n    var ret = fn;\n    if (!props.partials) {\n      props.partials = {};\n      ret = function (context, options) {\n        // Create a new partials stack frame prior to exec.\n        var original = container.partials;\n        container.partials = _utils.extend({}, original, props.partials);\n        var ret = fn(context, options);\n        container.partials = original;\n        return ret;\n      };\n    }\n\n    props.partials[options.args[0]] = options.fn;\n\n    return ret;\n  });\n};\n\nmodule.exports = exports['default'];\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2RlY29yYXRvcnMvaW5saW5lLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7cUJBQXVCLFVBQVU7O3FCQUVsQixVQUFTLFFBQVEsRUFBRTtBQUNoQyxVQUFRLENBQUMsaUJBQWlCLENBQUMsUUFBUSxFQUFFLFVBQVMsRUFBRSxFQUFFLEtBQUssR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HByb3BzLnBhcnRpYWxzID0ge307XG4gICAgICByZXQgPSBmdW5jdGlvbihjb250ZXh0LCBvcHRpb25zKSB7XG4gICAgICAgIC8vIENyZWF0ZSBhIG5ldyBwYXJ0aWFscyBzdGFjayBmcmFtZSBwcmlvciB0byBleGVjLlxuICAgICAgICBsZXQgb3JpZ2luYWwgPSBjb250YWluZXIucGFydGlhbHM7XG4gICAgICAgIGNvbnRhaW5lci5wYXJ0aWFscyA9IGV4dGVuZCh7fSwgb3JpZ2luYWwsIHByb3BzLnBhcnRpYWxzKTtcbiAgICAgICAgbGV0IHJldCA9IGZuKGNvbnRleHQsIG9wdGlvbnMpO1xuICAgICAgICBjb250YWluZXIucGFydGlhbHMgPSBvcmlnaW5hbDtcbiAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgIH07XG4gICAgfVxuXG4gICAgcHJvcHMucGFydGlhbHNbb3B0aW9ucy5hcmdzWzBdXSA9IG9wdGlvbnMuZm47XG5cbiAgICByZXR1cm4gcmV0O1xuICB9KTtcbn1cbiJdfQ==\n","'use strict';\n\nexports.__esModule = true;\nexports.createNewLookupObject = createNewLookupObject;\n\nvar _utils = require('../utils');\n\n/**\n * Create a new object with \"null\"-prototype to avoid truthy results on prototype properties.\n * The resulting object can be used with \"object[property]\" to check if a property exists\n * @param {...object} sources a varargs parameter of source objects that will be merged\n * @returns {object}\n */\n\nfunction createNewLookupObject() {\n  for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {\n    sources[_key] = arguments[_key];\n  }\n\n  return _utils.extend.apply(undefined, [Object.create(null)].concat(sources));\n}\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2ludGVybmFsL2NyZWF0ZS1uZXctbG9va3VwLW9iamVjdC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztxQkFBdUIsVUFBVTs7Ozs7Ozs7O0FBUTFCLFNBQVMscUJBQXFCLEdBQWE7b0NBQVQsT0FBTztBQUFQLFdBQU87OztBQUM5QyxTQUFPLGdDQUFPLE1BQU0sQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLFNBQUssT0FBTyxFQUFDLENBQUM7Q0FDaEQiLCJmaWxlIjoiY3JlYXRlLW5ldy1sb29rdXAtb2JqZWN0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgZXh0ZW5kIH0gZnJvbSAnLi4vdXRpbHMnO1xuXG4vKipcbiAqIENyZWF0ZSBhIG5ldyBvYmplY3Qgd2l0aCBcIm51bGxcIi1wcm90b3R5cGUgdG8gYXZvaWQgdHJ1dGh5IHJlc3VsdHMgb24gcHJvdG90eXBlIHByb3BlcnRpZXMuXG4gKiBUaGUgcmVzdWx0aW5nIG9iamVjdCBjYW4gYmUgdXNlZCB3aXRoIFwib2JqZWN0W3Byb3BlcnR5XVwiIHRvIGNoZWNrIGlmIGEgcHJvcGVydHkgZXhpc3RzXG4gKiBAcGFyYW0gey4uLm9iamVjdH0gc291cmNlcyBhIHZhcmFyZ3MgcGFyYW1ldGVyIG9mIHNvdXJjZSBvYmplY3RzIHRoYXQgd2lsbCBiZSBtZXJnZWRcbiAqIEByZXR1cm5zIHtvYmplY3R9XG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBjcmVhdGVOZXdMb29rdXBPYmplY3QoLi4uc291cmNlcykge1xuICByZXR1cm4gZXh0ZW5kKE9iamVjdC5jcmVhdGUobnVsbCksIC4uLnNvdXJjZXMpO1xufVxuIl19\n","// Build out our basic SafeString type\n'use strict';\n\nexports.__esModule = true;\nfunction SafeString(string) {\n  this.string = string;\n}\n\nSafeString.prototype.toString = SafeString.prototype.toHTML = function () {\n  return '' + this.string;\n};\n\nexports['default'] = SafeString;\nmodule.exports = exports['default'];\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL3NhZmUtc3RyaW5nLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFDQSxTQUFTLFVBQVUsQ0FBQyxNQUFNLEVBQUU7QUFDMUIsTUFBSSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUM7Q0FDdEI7O0FBRUQsVUFBVSxDQUFDLFNBQVMsQ0FBQyxRQUFRLEdBQUcsVUFBVSxDQUFDLFNBQVMsQ0FBQyxNQUFNLEdBQUcsWUFBVztBQUN2RSxTQUFPLEVBQUUsR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDO0NBQ3pCLENBQUM7O3FCQUVhLFVBQVUiLCJmaWxlIjoic2FmZS1zdHJpbmcuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBCdWlsZCBvdXQgb3VyIGJhc2ljIFNhZmVTdHJpbmcgdHlwZVxuZnVuY3Rpb24gU2FmZVN0cmluZyhzdHJpbmcpIHtcbiAgdGhpcy5zdHJpbmcgPSBzdHJpbmc7XG59XG5cblNhZmVTdHJpbmcucHJvdG90eXBlLnRvU3RyaW5nID0gU2FmZVN0cmluZy5wcm90b3R5cGUudG9IVE1MID0gZnVuY3Rpb24oKSB7XG4gIHJldHVybiAnJyArIHRoaXMuc3RyaW5nO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgU2FmZVN0cmluZztcbiJdfQ==\n","'use strict';\n\nexports.__esModule = true;\nexports.checkRevision = checkRevision;\nexports.template = template;\nexports.wrapProgram = wrapProgram;\nexports.resolvePartial = resolvePartial;\nexports.invokePartial = invokePartial;\nexports.noop = noop;\n// istanbul ignore next\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\n// istanbul ignore next\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }\n\nvar _utils = require('./utils');\n\nvar Utils = _interopRequireWildcard(_utils);\n\nvar _exception = require('./exception');\n\nvar _exception2 = _interopRequireDefault(_exception);\n\nvar _base = require('./base');\n\nvar _helpers = require('./helpers');\n\nvar _internalWrapHelper = require('./internal/wrapHelper');\n\nvar _internalProtoAccess = require('./internal/proto-access');\n\nfunction checkRevision(compilerInfo) {\n  var compilerRevision = compilerInfo && compilerInfo[0] || 1,\n      currentRevision = _base.COMPILER_REVISION;\n\n  if (compilerRevision >= _base.LAST_COMPATIBLE_COMPILER_REVISION && compilerRevision <= _base.COMPILER_REVISION) {\n    return;\n  }\n\n  if (compilerRevision < _base.LAST_COMPATIBLE_COMPILER_REVISION) {\n    var runtimeVersions = _base.REVISION_CHANGES[currentRevision],\n        compilerVersions = _base.REVISION_CHANGES[compilerRevision];\n    throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').');\n  } else {\n    // Use the embedded version info since the runtime doesn't know about this revision yet\n    throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').');\n  }\n}\n\nfunction template(templateSpec, env) {\n  /* istanbul ignore next */\n  if (!env) {\n    throw new _exception2['default']('No environment passed to template');\n  }\n  if (!templateSpec || !templateSpec.main) {\n    throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);\n  }\n\n  templateSpec.main.decorator = templateSpec.main_d;\n\n  // Note: Using env.VM references rather than local var references throughout this section to allow\n  // for external users to override these as pseudo-supported APIs.\n  env.VM.checkRevision(templateSpec.compiler);\n\n  // backwards compatibility for precompiled templates with compiler-version 7 (<4.3.0)\n  var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7;\n\n  function invokePartialWrapper(partial, context, options) {\n    if (options.hash) {\n      context = Utils.extend({}, context, options.hash);\n      if (options.ids) {\n        options.ids[0] = true;\n      }\n    }\n    partial = env.VM.resolvePartial.call(this, partial, context, options);\n\n    var extendedOptions = Utils.extend({}, options, {\n      hooks: this.hooks,\n      protoAccessControl: this.protoAccessControl\n    });\n\n    var result = env.VM.invokePartial.call(this, partial, context, extendedOptions);\n\n    if (result == null && env.compile) {\n      options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);\n      result = options.partials[options.name](context, extendedOptions);\n    }\n    if (result != null) {\n      if (options.indent) {\n        var lines = result.split('\\n');\n        for (var i = 0, l = lines.length; i < l; i++) {\n          if (!lines[i] && i + 1 === l) {\n            break;\n          }\n\n          lines[i] = options.indent + lines[i];\n        }\n        result = lines.join('\\n');\n      }\n      return result;\n    } else {\n      throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');\n    }\n  }\n\n  // Just add water\n  var container = {\n    strict: function strict(obj, name, loc) {\n      if (!obj || !(name in obj)) {\n        throw new _exception2['default']('\"' + name + '\" not defined in ' + obj, {\n          loc: loc\n        });\n      }\n      return obj[name];\n    },\n    lookupProperty: function lookupProperty(parent, propertyName) {\n      var result = parent[propertyName];\n      if (result == null) {\n        return result;\n      }\n      if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n        return result;\n      }\n\n      if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) {\n        return result;\n      }\n      return undefined;\n    },\n    lookup: function lookup(depths, name) {\n      var len = depths.length;\n      for (var i = 0; i < len; i++) {\n        var result = depths[i] && container.lookupProperty(depths[i], name);\n        if (result != null) {\n          return depths[i][name];\n        }\n      }\n    },\n    lambda: function lambda(current, context) {\n      return typeof current === 'function' ? current.call(context) : current;\n    },\n\n    escapeExpression: Utils.escapeExpression,\n    invokePartial: invokePartialWrapper,\n\n    fn: function fn(i) {\n      var ret = templateSpec[i];\n      ret.decorator = templateSpec[i + '_d'];\n      return ret;\n    },\n\n    programs: [],\n    program: function program(i, data, declaredBlockParams, blockParams, depths) {\n      var programWrapper = this.programs[i],\n          fn = this.fn(i);\n      if (data || depths || blockParams || declaredBlockParams) {\n        programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);\n      } else if (!programWrapper) {\n        programWrapper = this.programs[i] = wrapProgram(this, i, fn);\n      }\n      return programWrapper;\n    },\n\n    data: function data(value, depth) {\n      while (value && depth--) {\n        value = value._parent;\n      }\n      return value;\n    },\n    mergeIfNeeded: function mergeIfNeeded(param, common) {\n      var obj = param || common;\n\n      if (param && common && param !== common) {\n        obj = Utils.extend({}, common, param);\n      }\n\n      return obj;\n    },\n    // An empty object to use as replacement for null-contexts\n    nullContext: Object.seal({}),\n\n    noop: env.VM.noop,\n    compilerInfo: templateSpec.compiler\n  };\n\n  function ret(context) {\n    var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n    var data = options.data;\n\n    ret._setup(options);\n    if (!options.partial && templateSpec.useData) {\n      data = initData(context, data);\n    }\n    var depths = undefined,\n        blockParams = templateSpec.useBlockParams ? [] : undefined;\n    if (templateSpec.useDepths) {\n      if (options.depths) {\n        depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths;\n      } else {\n        depths = [context];\n      }\n    }\n\n    function main(context /*, options*/) {\n      return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);\n    }\n\n    main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);\n    return main(context, options);\n  }\n\n  ret.isTop = true;\n\n  ret._setup = function (options) {\n    if (!options.partial) {\n      var mergedHelpers = Utils.extend({}, env.helpers, options.helpers);\n      wrapHelpersToPassLookupProperty(mergedHelpers, container);\n      container.helpers = mergedHelpers;\n\n      if (templateSpec.usePartial) {\n        // Use mergeIfNeeded here to prevent compiling global partials multiple times\n        container.partials = container.mergeIfNeeded(options.partials, env.partials);\n      }\n      if (templateSpec.usePartial || templateSpec.useDecorators) {\n        container.decorators = Utils.extend({}, env.decorators, options.decorators);\n      }\n\n      container.hooks = {};\n      container.protoAccessControl = _internalProtoAccess.createProtoAccessControl(options);\n\n      var keepHelperInHelpers = options.allowCallsToHelperMissing || templateWasPrecompiledWithCompilerV7;\n      _helpers.moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers);\n      _helpers.moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers);\n    } else {\n      container.protoAccessControl = options.protoAccessControl; // internal option\n      container.helpers = options.helpers;\n      container.partials = options.partials;\n      container.decorators = options.decorators;\n      container.hooks = options.hooks;\n    }\n  };\n\n  ret._child = function (i, data, blockParams, depths) {\n    if (templateSpec.useBlockParams && !blockParams) {\n      throw new _exception2['default']('must pass block params');\n    }\n    if (templateSpec.useDepths && !depths) {\n      throw new _exception2['default']('must pass parent depths');\n    }\n\n    return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);\n  };\n  return ret;\n}\n\nfunction wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {\n  function prog(context) {\n    var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n    var currentDepths = depths;\n    if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) {\n      currentDepths = [context].concat(depths);\n    }\n\n    return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);\n  }\n\n  prog = executeDecorators(fn, prog, container, depths, data, blockParams);\n\n  prog.program = i;\n  prog.depth = depths ? depths.length : 0;\n  prog.blockParams = declaredBlockParams || 0;\n  return prog;\n}\n\n/**\n * This is currently part of the official API, therefore implementation details should not be changed.\n */\n\nfunction resolvePartial(partial, context, options) {\n  if (!partial) {\n    if (options.name === '@partial-block') {\n      partial = options.data['partial-block'];\n    } else {\n      partial = options.partials[options.name];\n    }\n  } else if (!partial.call && !options.name) {\n    // This is a dynamic partial that returned a string\n    options.name = partial;\n    partial = options.partials[partial];\n  }\n  return partial;\n}\n\nfunction invokePartial(partial, context, options) {\n  // Use the current closure context to save the partial-block if this partial\n  var currentPartialBlock = options.data && options.data['partial-block'];\n  options.partial = true;\n  if (options.ids) {\n    options.data.contextPath = options.ids[0] || options.data.contextPath;\n  }\n\n  var partialBlock = undefined;\n  if (options.fn && options.fn !== noop) {\n    (function () {\n      options.data = _base.createFrame(options.data);\n      // Wrapper function to get access to currentPartialBlock from the closure\n      var fn = options.fn;\n      partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) {\n        var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n        // Restore the partial-block from the closure for the execution of the block\n        // i.e. the part inside the block of the partial call.\n        options.data = _base.createFrame(options.data);\n        options.data['partial-block'] = currentPartialBlock;\n        return fn(context, options);\n      };\n      if (fn.partials) {\n        options.partials = Utils.extend({}, options.partials, fn.partials);\n      }\n    })();\n  }\n\n  if (partial === undefined && partialBlock) {\n    partial = partialBlock;\n  }\n\n  if (partial === undefined) {\n    throw new _exception2['default']('The partial ' + options.name + ' could not be found');\n  } else if (partial instanceof Function) {\n    return partial(context, options);\n  }\n}\n\nfunction noop() {\n  return '';\n}\n\nfunction initData(context, data) {\n  if (!data || !('root' in data)) {\n    data = data ? _base.createFrame(data) : {};\n    data.root = context;\n  }\n  return data;\n}\n\nfunction executeDecorators(fn, prog, container, depths, data, blockParams) {\n  if (fn.decorator) {\n    var props = {};\n    prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);\n    Utils.extend(prog, props);\n  }\n  return prog;\n}\n\nfunction wrapHelpersToPassLookupProperty(mergedHelpers, container) {\n  Object.keys(mergedHelpers).forEach(function (helperName) {\n    var helper = mergedHelpers[helperName];\n    mergedHelpers[helperName] = passLookupPropertyOption(helper, container);\n  });\n}\n\nfunction passLookupPropertyOption(helper, container) {\n  var lookupProperty = container.lookupProperty;\n  return _internalWrapHelper.wrapHelper(helper, function (options) {\n    return Utils.extend({ lookupProperty: lookupProperty }, options);\n  });\n}\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9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7XG4gICAgICAgICAgaWYgKCFsaW5lc1tpXSAmJiBpICsgMSA9PT0gbCkge1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgbGluZXNbaV0gPSBvcHRpb25zLmluZGVudCArIGxpbmVzW2ldO1xuICAgICAgICB9XG4gICAgICAgIHJlc3VsdCA9IGxpbmVzLmpvaW4oJ1xcbicpO1xuICAgICAgfVxuICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9IGVsc2Uge1xuICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbihcbiAgICAgICAgJ1RoZSBwYXJ0aWFsICcgK1xuICAgICAgICAgIG9wdGlvbnMubmFtZSArXG4gICAgICAgICAgJyBjb3VsZCBub3QgYmUgY29tcGlsZWQgd2hlbiBydW5uaW5nIGluIHJ1bnRpbWUtb25seSBtb2RlJ1xuICAgICAgKTtcbiAgICB9XG4gIH1cblxuICAvLyBKdXN0IGFkZCB3YXRlclxuICBsZXQgY29udGFpbmVyID0ge1xuICAgIHN0cmljdDogZnVuY3Rpb24ob2JqLCBuYW1lLCBsb2MpIHtcbiAgICAgIGlmICghb2JqIHx8ICEobmFtZSBpbiBvYmopKSB7XG4gICAgICAgIHRocm93IG5ldyBFeGNlcHRpb24oJ1wiJyArIG5hbWUgKyAnXCIgbm90IGRlZmluZWQgaW4gJyArIG9iaiwge1xuICAgICAgICAgIGxvYzogbG9jXG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgcmV0dXJuIG9ialtuYW1lXTtcbiAgICB9LFxuICAgIGxvb2t1cFByb3BlcnR5OiBmdW5jdGlvbihwYXJlbnQsIHByb3BlcnR5TmFtZSkge1xuICAgICAgbGV0IHJlc3VsdCA9IHBhcmVudFtwcm9wZXJ0eU5hbWVdO1xuICAgICAgaWYgKHJlc3VsdCA9PSBudWxsKSB7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICB9XG4gICAgICBpZiAoT2JqZWN0LnByb3RvdH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gICAgICAgLy8gVXNlIG1lcmdlSWZOZWVkZWQgaGVyZSB0byBwcmV2ZW50IGNvbXBpbGluZyBnbG9iYWwgcGFydGlhbHMgbXVsdGlwbGUgdGltZXNcbiAgICAgICAgY29udGFpbmVyLnBhcnRpYWxzID0gY29udGFpbmVyLm1lcmdlSWZOZWVkZWQoXG4gICAgICAgICAgb3B0aW9ucy5wYXJ0aWFscyxcbiAgICAgICAgICBlbnYucGFydGlhbHNcbiAgICAgICAgKTtcbiAgICAgIH1cbiAgICAgIGlmICh0ZW1wbGF0ZVNwZWMudXNlUGFydGlhbCB8fCB0ZW1wbGF0ZVNwZWMudXNlRGVjb3JhdG9ycykge1xuICAgICAgICBjb250YWluZXIuZGVjb3JhdG9ycyA9IFV0aWxzLmV4dGVuZChcbiAgICAgICAgICB7fSxcbiAgICAgICAgICBlbnYuZGVjb3JhdG9ycyxcbiAgICAgICAgICBvcHRpb25zLmRlY29yYXRvcnNcbiAgICAgICAgKTtcbiAgICAgIH1cblxuICAgICAgY29udGFpbmVyLmhvb2tzID0ge307XG4gICAgICBjb250YWluZXIucHJvdG9BY2Nlc3NDb250cm9sID0gY3JlYXRlUHJvdG9BY2Nlc3NDb250cm9sKG9wdGlvbnMpO1xuXG4gICAgICBsZXQga2VlcEhlbHBlckluSGVscGVycyA9XG4gICAgICAgIG9wdGlvbnMuYWxsb3dDYWxsc1RvSGVscGVyTWlzc2luZyB8fFxuICAgICAgICB0ZW1wbGF0ZVdhc1ByZWNvbXBpbGVkV2l0aENvbXBpbGVyVjc7XG4gICAgICBtb3ZlSGVscGVyVG9Ib29rcyhjb250YWluZXIsICdoZWxwZXJNaXNzaW5nJywga2VlcEhlbHBlckluSGVscGVycyk7XG4gICAgICBtb3ZlSGVscGVyVG9Ib29rcyhjb250YWluZXIsICdibG9ja0hlbHBlck1pc3NpbmcnLCBrZWVwSGVscGVySW5IZWxwZXJzKTtcbiAgICB9IGVsc2Uge1xuICAgICAgY29udGFpbmVyLnByb3RvQWNjZ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VyKSB7XG4gIE9iamVjdC5rZXlzKG1lcmdlZEhlbHBlcnMpLmZvckVhY2goaGVscGVyTmFtZSA9PiB7XG4gICAgbGV0IGhlbHBlciA9IG1lcmdlZEhlbHBlcnNbaGVscGVyTmFtZV07XG4gICAgbWVyZ2VkSGVscGVyc1toZWxwZXJOYW1lXSA9IHBhc3NMb29rdXBQcm9wZXJ0eU9wdGlvbihoZWxwZXIsIGNvbnRhaW5lcik7XG4gIH0pO1xufVxuXG5mdW5jdGlvbiBwYXNzTG9va3VwUHJvcGVydHlPcHRpb24oaGVscGVyLCBjb250YWluZXIpIHtcbiAgY29uc3QgbG9va3VwUHJvcGVydHkgPSBjb250YWluZXIubG9va3VwUHJvcGVydHk7XG4gIHJldHVybiB3cmFwSGVscGVyKGhlbHBlciwgb3B0aW9ucyA9PiB7XG4gICAgcmV0dXJuIFV0aWxzLmV4dGVuZCh7IGxvb2t1cFByb3BlcnR5IH0sIG9wdGlvbnMpO1xuICB9KTtcbn1cbiJdfQ==\n","'use strict';\n\nexports.__esModule = true;\nexports.wrapHelper = wrapHelper;\n\nfunction wrapHelper(helper, transformOptionsFn) {\n  if (typeof helper !== 'function') {\n    // This should not happen, but apparently it does in https://github.com/wycats/handlebars.js/issues/1639\n    // We try to make the wrapper least-invasive by not wrapping it, if the helper is not a function.\n    return helper;\n  }\n  var wrapper = function wrapper() /* dynamic arguments */{\n    var options = arguments[arguments.length - 1];\n    arguments[arguments.length - 1] = transformOptionsFn(options);\n    return helper.apply(this, arguments);\n  };\n  return wrapper;\n}\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2ludGVybmFsL3dyYXBIZWxwZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBTyxTQUFTLFVBQVUsQ0FBQyxNQUFNLEVBQUUsa0JBQWtCLEVBQUU7QUFDckQs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VtZW50cy5sZW5ndGggLSAxXTtcbiAgICBhcmd1bWVudHNbYXJndW1lbnRzLmxlbmd0aCAtIDFdID0gdHJhbnNmb3JtT3B0aW9uc0ZuKG9wdGlvbnMpO1xuICAgIHJldHVybiBoZWxwZXIuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgfTtcbiAgcmV0dXJuIHdyYXBwZXI7XG59XG4iXX0=\n","'use strict';\n\nexports.__esModule = true;\n\nexports['default'] = function (Handlebars) {\n  /* istanbul ignore next */\n  var root = typeof global !== 'undefined' ? global : window,\n      $Handlebars = root.Handlebars;\n  /* istanbul ignore next */\n  Handlebars.noConflict = function () {\n    if (root.Handlebars === Handlebars) {\n      root.Handlebars = $Handlebars;\n    }\n    return Handlebars;\n  };\n};\n\nmodule.exports = exports['default'];\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL25vLWNvbmZsaWN0LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7cUJBQWUsVUFBUyxVQUFVLEVBQUU7O0FBRWxDLE1BQUksSUFBSSxHQUFHLE9BQU8sTUFBTSxLQUFLLFdBQVcsR0FBRyxNQUFNLEdBQUcsTUFBTTtNQUN4RCxXQUFXLEdBQUcsSUFBSSxDQUFDLFVBQVUsQ0FBQzs7QUFFaEMsWUFBVSxDQUFDLFVBQVUsR0FBRyxZQUFXO0FBQ2pDLFFBQUksSUFBSSxDQUFDLFVBQVUsS0FBSyxVQUFVLEVBQUU7QUFDbEMsVUFBSSxDQUFDLFVBQVUsR0FBRyxXQUFXLENBQUM7S0FDL0I7QUFDRCxXQUFPLFVBQVUsQ0FBQztHQUNuQixDQUFDO0NBQ0giLCJmaWxlIjoibm8tY29uZmxpY3QuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbihIYW5kbGViYXJzKSB7XG4gIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gIGxldCByb290ID0gdHlwZW9mIGdsb2JhbCAhPT0gJ3VuZGVmaW5lZCcgPyBnbG9iYWwgOiB3aW5kb3csXG4gICAgJEhhbmRsZWJhcnMgPSByb290LkhhbmRsZWJhcnM7XG4gIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gIEhhbmRsZWJhcnMubm9Db25mbGljdCA9IGZ1bmN0aW9uKCkge1xuICAgIGlmIChyb290LkhhbmRsZWJhcnMgPT09IEhhbmRsZWJhcnMpIHtcbiAgICAgIHJvb3QuSGFuZGxlYmFycyA9ICRIYW5kbGViYXJzO1xuICAgIH1cbiAgICByZXR1cm4gSGFuZGxlYmFycztcbiAgfTtcbn1cbiJdfQ==\n","// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = require(\"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./systemtags.scss\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar add = require(\"!../../node_modules/vue-style-loader/lib/addStylesClient.js\").default\nvar update = add(\"bdf318e0\", content, true, {});","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".systemtags-select2-dropdown .select2-result-label .checkmark{visibility:hidden;margin-left:-5px;margin-right:5px;padding:4px}.systemtags-select2-dropdown .select2-result-label .new-item .systemtags-actions{display:none}.systemtags-select2-dropdown .select2-selected .select2-result-label .checkmark{visibility:visible}.systemtags-select2-dropdown .select2-result-label .icon{display:inline-block;opacity:.5}.systemtags-select2-dropdown .select2-result-label .icon.rename{padding:4px}.systemtags-select2-dropdown .systemtags-actions{position:absolute;right:5px}.systemtags-select2-dropdown .systemtags-rename-form{display:inline-block;width:calc(100% - 20px);top:-6px;position:relative}.systemtags-select2-dropdown .systemtags-rename-form input{display:inline-block;height:30px;width:calc(100% - 40px)}.systemtags-select2-dropdown .label{width:85%;display:inline-block;overflow:hidden;text-overflow:ellipsis}.systemtags-select2-dropdown .label.hidden{display:none}.systemtags-select2-dropdown span{line-height:25px}.systemtags-select2-dropdown .systemtags-item{display:inline-block;height:25px;width:100%}.systemtags-select2-dropdown .select2-result-label{height:25px}.systemTagsInfoView,.systemtags-select2-container{width:100%}.systemTagsInfoView .select2-choices,.systemtags-select2-container .select2-choices{flex-wrap:nowrap !important;max-height:44px}.systemTagsInfoView .select2-choices .select2-search-choice.select2-locked .label,.systemtags-select2-container .select2-choices .select2-search-choice.select2-locked .label{opacity:0.5}#select2-drop.systemtags-select2-dropdown .select2-results li.select2-result{padding:5px}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","\"use strict\";\n\n/*\n  MIT License http://www.opensource.org/licenses/mit-license.php\n  Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n  var list = []; // return the list of modules as css string\n\n  list.toString = function toString() {\n    return this.map(function (item) {\n      var content = cssWithMappingToString(item, useSourceMap);\n\n      if (item[2]) {\n        return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n      }\n\n      return content;\n    }).join('');\n  }; // import a list of modules into the list\n  // eslint-disable-next-line func-names\n\n\n  list.i = function (modules, mediaQuery, dedupe) {\n    if (typeof modules === 'string') {\n      // eslint-disable-next-line no-param-reassign\n      modules = [[null, modules, '']];\n    }\n\n    var alreadyImportedModules = {};\n\n    if (dedupe) {\n      for (var i = 0; i < this.length; i++) {\n        // eslint-disable-next-line prefer-destructuring\n        var id = this[i][0];\n\n        if (id != null) {\n          alreadyImportedModules[id] = true;\n        }\n      }\n    }\n\n    for (var _i = 0; _i < modules.length; _i++) {\n      var item = [].concat(modules[_i]);\n\n      if (dedupe && alreadyImportedModules[item[0]]) {\n        // eslint-disable-next-line no-continue\n        continue;\n      }\n\n      if (mediaQuery) {\n        if (!item[2]) {\n          item[2] = mediaQuery;\n        } else {\n          item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n        }\n      }\n\n      list.push(item);\n    }\n  };\n\n  return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n  var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n  var cssMapping = item[3];\n\n  if (!cssMapping) {\n    return content;\n  }\n\n  if (useSourceMap && typeof btoa === 'function') {\n    var sourceMapping = toComment(cssMapping);\n    var sourceURLs = cssMapping.sources.map(function (source) {\n      return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || '').concat(source, \" */\");\n    });\n    return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n  }\n\n  return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n  // eslint-disable-next-line no-undef\n  var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n  var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n  return \"/*# \".concat(data, \" */\");\n}","/* eslint-disable */\n/*\n * Copyright (c) 2016\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\nimport escapeHTML from 'escape-html'\n\n(function(OC) {\n\t/**\n\t * @namespace\n\t */\n\tOC.SystemTags = {\n\t\t/**\n\t\t *\n\t\t * @param {OC.SystemTags.SystemTagModel|Object|String} tag\n\t\t * @returns {jQuery}\n\t\t */\n\t\tgetDescriptiveTag: function(tag) {\n\t\t\tif (_.isUndefined(tag.name) && !_.isUndefined(tag.toJSON)) {\n\t\t\t\ttag = tag.toJSON()\n\t\t\t}\n\n\t\t\tif (_.isUndefined(tag.name)) {\n\t\t\t\treturn $('<span>').addClass('non-existing-tag').text(\n\t\t\t\t\tt('core', 'Non-existing tag #{tag}', {\n\t\t\t\t\t\ttag: tag\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tvar $span = $('<span>')\n\t\t\t$span.append(escapeHTML(tag.name))\n\n\t\t\tvar scope\n\t\t\tif (!tag.userAssignable) {\n\t\t\t\tscope = t('core', 'restricted')\n\t\t\t}\n\t\t\tif (!tag.userVisible) {\n\t\t\t\t// invisible also implicitly means not assignable\n\t\t\t\tscope = t('core', 'invisible')\n\t\t\t}\n\t\t\tif (scope) {\n\t\t\t\t$span.append($('<em>').text(' (' + scope + ')'))\n\t\t\t}\n\t\t\treturn $span\n\t\t}\n\t}\n})(OC)\n","/* eslint-disable */\n/*\n * Copyright (c) 2015\n *\n * This file is licensed under the Affero General Public License version 3\n * or later.\n *\n * See the COPYING-README file.\n *\n */\n\nimport templateResult from './templates/result.handlebars'\nimport templateResultForm from './templates/result_form.handlebars'\nimport templateSelection from './templates/selection.handlebars'\n\n(function(OC) {\n\n\t/**\n\t * @class OC.SystemTags.SystemTagsInputField\n\t * @classdesc\n\t *\n\t * Displays a file's system tags\n\t *\n\t */\n\tvar SystemTagsInputField = OC.Backbone.View.extend(\n\t\t/** @lends OC.SystemTags.SystemTagsInputField.prototype */ {\n\n\t\t\t_rendered: false,\n\n\t\t\t_newTag: null,\n\n\t\t\t_lastUsedTags: [],\n\n\t\t\tclassName: 'systemTagsInputFieldContainer',\n\n\t\t\ttemplate: function(data) {\n\t\t\t\treturn '<input class=\"systemTagsInputField\" type=\"hidden\" name=\"tags\" value=\"\"/>'\n\t\t\t},\n\n\t\t\t/**\n\t\t * Creates a new SystemTagsInputField\n\t\t *\n\t\t * @param {Object} [options]\n\t\t * @param {string} [options.objectType=files] object type for which tags are assigned to\n\t\t * @param {bool} [options.multiple=false] whether to allow selecting multiple tags\n\t\t * @param {bool} [options.allowActions=true] whether tags can be renamed/delete within the dropdown\n\t\t * @param {bool} [options.allowCreate=true] whether new tags can be created\n\t\t * @param {bool} [options.isAdmin=true] whether the user is an administrator\n\t\t * @param {Function} options.initSelection function to convert selection to data\n\t\t */\n\t\t\tinitialize: function(options) {\n\t\t\t\toptions = options || {}\n\n\t\t\t\tthis._multiple = !!options.multiple\n\t\t\t\tthis._allowActions = _.isUndefined(options.allowActions) || !!options.allowActions\n\t\t\t\tthis._allowCreate = _.isUndefined(options.allowCreate) || !!options.allowCreate\n\t\t\t\tthis._isAdmin = !!options.isAdmin\n\n\t\t\t\tif (_.isFunction(options.initSelection)) {\n\t\t\t\t\tthis._initSelection = options.initSelection\n\t\t\t\t}\n\n\t\t\t\tthis.collection = options.collection || OC.SystemTags.collection\n\n\t\t\t\tvar self = this\n\t\t\t\tthis.collection.on('change:name remove', function() {\n\t\t\t\t// refresh selection\n\t\t\t\t\t_.defer(self._refreshSelection)\n\t\t\t\t})\n\n\t\t\t\t_.defer(_.bind(this._getLastUsedTags, this))\n\n\t\t\t\t_.bindAll(\n\t\t\t\t\tthis,\n\t\t\t\t\t'_refreshSelection',\n\t\t\t\t\t'_onClickRenameTag',\n\t\t\t\t\t'_onClickDeleteTag',\n\t\t\t\t\t'_onSelectTag',\n\t\t\t\t\t'_onDeselectTag',\n\t\t\t\t\t'_onSubmitRenameTag'\n\t\t\t\t)\n\t\t\t},\n\n\t\t\t_getLastUsedTags: function() {\n\t\t\t\tvar self = this\n\t\t\t\t$.ajax({\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\turl: OC.generateUrl('/apps/systemtags/lastused'),\n\t\t\t\t\tsuccess: function(response) {\n\t\t\t\t\t\tself._lastUsedTags = response\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\n\t\t\t/**\n\t\t * Refreshes the selection, triggering a call to\n\t\t * select2's initSelection\n\t\t */\n\t\t\t_refreshSelection: function() {\n\t\t\t\tthis.$tagsField.select2('val', this.$tagsField.val())\n\t\t\t},\n\n\t\t\t/**\n\t\t * Event handler whenever the user clicked the \"rename\" action.\n\t\t * This will display the rename field.\n\t\t */\n\t\t\t_onClickRenameTag: function(ev) {\n\t\t\t\tvar $item = $(ev.target).closest('.systemtags-item')\n\t\t\t\tvar tagId = $item.attr('data-id')\n\t\t\t\tvar tagModel = this.collection.get(tagId)\n\n\t\t\t\tvar oldName = tagModel.get('name')\n\t\t\t\tvar $renameForm = $(templateResultForm({\n\t\t\t\t\tcid: this.cid,\n\t\t\t\t\tname: oldName,\n\t\t\t\t\tdeleteTooltip: t('core', 'Delete'),\n\t\t\t\t\trenameLabel: t('core', 'Rename'),\n\t\t\t\t\tisAdmin: this._isAdmin\n\t\t\t\t}))\n\t\t\t\t$item.find('.label').after($renameForm)\n\t\t\t\t$item.find('.label, .systemtags-actions').addClass('hidden')\n\t\t\t\t$item.closest('.select2-result').addClass('has-form')\n\n\t\t\t\t$renameForm.find('[title]').tooltip({\n\t\t\t\t\tplacement: 'bottom',\n\t\t\t\t\tcontainer: 'body'\n\t\t\t\t})\n\t\t\t\t$renameForm.find('input').focus().selectRange(0, oldName.length)\n\t\t\t\treturn false\n\t\t\t},\n\n\t\t\t/**\n\t\t * Event handler whenever the rename form has been submitted after\n\t\t * the user entered a new tag name.\n\t\t * This will submit the change to the server.\n\t\t *\n\t\t * @param {Object} ev event\n\t\t */\n\t\t\t_onSubmitRenameTag: function(ev) {\n\t\t\t\tev.preventDefault()\n\t\t\t\tvar $form = $(ev.target)\n\t\t\t\tvar $item = $form.closest('.systemtags-item')\n\t\t\t\tvar tagId = $item.attr('data-id')\n\t\t\t\tvar tagModel = this.collection.get(tagId)\n\t\t\t\tvar newName = $(ev.target).find('input').val().trim()\n\t\t\t\tif (newName && newName !== tagModel.get('name')) {\n\t\t\t\t\ttagModel.save({ 'name': newName })\n\t\t\t\t\t// TODO: spinner, and only change text after finished saving\n\t\t\t\t\t$item.find('.label').text(newName)\n\t\t\t\t}\n\t\t\t\t$item.find('.label, .systemtags-actions').removeClass('hidden')\n\t\t\t\t$form.remove()\n\t\t\t\t$item.closest('.select2-result').removeClass('has-form')\n\t\t\t},\n\n\t\t\t/**\n\t\t * Event handler whenever a tag must be deleted\n\t\t *\n\t\t * @param {Object} ev event\n\t\t */\n\t\t\t_onClickDeleteTag: function(ev) {\n\t\t\t\tvar $item = $(ev.target).closest('.systemtags-item')\n\t\t\t\tvar tagId = $item.attr('data-id')\n\t\t\t\tthis.collection.get(tagId).destroy()\n\t\t\t\t$(ev.target).tooltip('hide')\n\t\t\t\t$item.closest('.select2-result').remove()\n\t\t\t\t// TODO: spinner\n\t\t\t\treturn false\n\t\t\t},\n\n\t\t\t_addToSelect2Selection: function(selection) {\n\t\t\t\tvar data = this.$tagsField.select2('data')\n\t\t\t\tdata.push(selection)\n\t\t\t\tthis.$tagsField.select2('data', data)\n\t\t\t},\n\n\t\t\t/**\n\t\t * Event handler whenever a tag is selected.\n\t\t * Also called whenever tag creation is requested through the dummy tag object.\n\t\t *\n\t\t * @param {Object} e event\n\t\t */\n\t\t\t_onSelectTag: function(e) {\n\t\t\t\tvar self = this\n\t\t\t\tvar tag\n\t\t\t\tif (e.object && e.object.isNew) {\n\t\t\t\t// newly created tag, check if existing\n\t\t\t\t// create a new tag\n\t\t\t\t\ttag = this.collection.create({\n\t\t\t\t\t\tname: e.object.name.trim(),\n\t\t\t\t\t\tuserVisible: true,\n\t\t\t\t\t\tuserAssignable: true,\n\t\t\t\t\t\tcanAssign: true\n\t\t\t\t\t}, {\n\t\t\t\t\t\tsuccess: function(model) {\n\t\t\t\t\t\t\tself._addToSelect2Selection(model.toJSON())\n\t\t\t\t\t\t\tself._lastUsedTags.unshift(model.id)\n\t\t\t\t\t\t\tself.trigger('select', model)\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror: function(model, xhr) {\n\t\t\t\t\t\t\tif (xhr.status === 409) {\n\t\t\t\t\t\t\t// re-fetch collection to get the missing tag\n\t\t\t\t\t\t\t\tself.collection.reset()\n\t\t\t\t\t\t\t\tself.collection.fetch({\n\t\t\t\t\t\t\t\t\tsuccess: function(collection) {\n\t\t\t\t\t\t\t\t\t// find the tag in the collection\n\t\t\t\t\t\t\t\t\t\tvar model = collection.where({\n\t\t\t\t\t\t\t\t\t\t\tname: e.object.name.trim(),\n\t\t\t\t\t\t\t\t\t\t\tuserVisible: true,\n\t\t\t\t\t\t\t\t\t\t\tuserAssignable: true\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\tif (model.length) {\n\t\t\t\t\t\t\t\t\t\t\tmodel = model[0]\n\t\t\t\t\t\t\t\t\t\t\t// the tag already exists or was already assigned,\n\t\t\t\t\t\t\t\t\t\t\t// add it to the list anyway\n\t\t\t\t\t\t\t\t\t\t\tself._addToSelect2Selection(model.toJSON())\n\t\t\t\t\t\t\t\t\t\t\tself.trigger('select', model)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\tthis.$tagsField.select2('close')\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\treturn false\n\t\t\t\t} else {\n\t\t\t\t\ttag = this.collection.get(e.object.id)\n\t\t\t\t\tthis._lastUsedTags.unshift(tag.id)\n\t\t\t\t}\n\t\t\t\tthis._newTag = null\n\t\t\t\tthis.trigger('select', tag)\n\t\t\t},\n\n\t\t\t/**\n\t\t * Event handler whenever a tag gets deselected.\n\t\t *\n\t\t * @param {Object} e event\n\t\t */\n\t\t\t_onDeselectTag: function(e) {\n\t\t\t\tthis.trigger('deselect', e.choice.id)\n\t\t\t},\n\n\t\t\t/**\n\t\t * Autocomplete function for dropdown results\n\t\t *\n\t\t * @param {Object} query select2 query object\n\t\t */\n\t\t\t_queryTagsAutocomplete: function(query) {\n\t\t\t\tvar self = this\n\t\t\t\tthis.collection.fetch({\n\t\t\t\t\tsuccess: function(collection) {\n\t\t\t\t\t\tvar tagModels = collection.filterByName(query.term.trim())\n\t\t\t\t\t\tif (!self._isAdmin) {\n\t\t\t\t\t\t\ttagModels = _.filter(tagModels, function(tagModel) {\n\t\t\t\t\t\t\t\treturn tagModel.get('canAssign')\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t\tquery.callback({\n\t\t\t\t\t\t\tresults: _.invoke(tagModels, 'toJSON')\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\n\t\t\t_preventDefault: function(e) {\n\t\t\t\te.stopPropagation()\n\t\t\t},\n\n\t\t\t/**\n\t\t * Formats a single dropdown result\n\t\t *\n\t\t * @param {Object} data data to format\n\t\t * @returns {string} HTML markup\n\t\t */\n\t\t\t_formatDropDownResult: function(data) {\n\t\t\t\treturn templateResult(_.extend({\n\t\t\t\t\trenameTooltip: t('core', 'Rename'),\n\t\t\t\t\tallowActions: this._allowActions,\n\t\t\t\t\ttagMarkup: this._isAdmin ? OC.SystemTags.getDescriptiveTag(data)[0].innerHTML : null,\n\t\t\t\t\tisAdmin: this._isAdmin\n\t\t\t\t}, data))\n\t\t\t},\n\n\t\t\t/**\n\t\t * Formats a single selection item\n\t\t *\n\t\t * @param {Object} data data to format\n\t\t * @returns {string} HTML markup\n\t\t */\n\t\t\t_formatSelection: function(data) {\n\t\t\t\treturn templateSelection(_.extend({\n\t\t\t\t\ttagMarkup: this._isAdmin ? OC.SystemTags.getDescriptiveTag(data)[0].innerHTML : null,\n\t\t\t\t\tisAdmin: this._isAdmin\n\t\t\t\t}, data))\n\t\t\t},\n\n\t\t\t/**\n\t\t * Create new dummy choice for select2 when the user\n\t\t * types an arbitrary string\n\t\t *\n\t\t * @param {string} term entered term\n\t\t * @returns {Object} dummy tag\n\t\t */\n\t\t\t_createSearchChoice: function(term) {\n\t\t\t\tterm = term.trim()\n\t\t\t\tif (this.collection.filter(function(entry) {\n\t\t\t\t\treturn entry.get('name') === term\n\t\t\t\t}).length) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif (!this._newTag) {\n\t\t\t\t\tthis._newTag = {\n\t\t\t\t\t\tid: -1,\n\t\t\t\t\t\tname: term,\n\t\t\t\t\t\tuserAssignable: true,\n\t\t\t\t\t\tuserVisible: true,\n\t\t\t\t\t\tcanAssign: true,\n\t\t\t\t\t\tisNew: true\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis._newTag.name = term\n\t\t\t\t}\n\n\t\t\t\treturn this._newTag\n\t\t\t},\n\n\t\t\t_initSelection: function(element, callback) {\n\t\t\t\tvar self = this\n\t\t\t\tvar ids = $(element).val().split(',')\n\n\t\t\t\tfunction modelToSelection(model) {\n\t\t\t\t\tvar data = model.toJSON()\n\t\t\t\t\tif (!self._isAdmin && !data.canAssign) {\n\t\t\t\t\t// lock static tags for non-admins\n\t\t\t\t\t\tdata.locked = true\n\t\t\t\t\t}\n\t\t\t\t\treturn data\n\t\t\t\t}\n\n\t\t\t\tfunction findSelectedObjects(ids) {\n\t\t\t\t\tvar selectedModels = self.collection.filter(function(model) {\n\t\t\t\t\t\treturn ids.indexOf(model.id) >= 0 && (self._isAdmin || model.get('userVisible'))\n\t\t\t\t\t})\n\t\t\t\t\treturn _.map(selectedModels, modelToSelection)\n\t\t\t\t}\n\n\t\t\t\tthis.collection.fetch({\n\t\t\t\t\tsuccess: function() {\n\t\t\t\t\t\tcallback(findSelectedObjects(ids))\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\n\t\t\t/**\n\t\t * Renders this details view\n\t\t */\n\t\t\trender: function() {\n\t\t\t\tvar self = this\n\t\t\t\tthis.$el.html(this.template())\n\n\t\t\t\tthis.$el.find('[title]').tooltip({ placement: 'bottom' })\n\t\t\t\tthis.$tagsField = this.$el.find('[name=tags]')\n\t\t\t\tthis.$tagsField.select2({\n\t\t\t\t\tplaceholder: t('core', 'Collaborative tags'),\n\t\t\t\t\tcontainerCssClass: 'systemtags-select2-container',\n\t\t\t\t\tdropdownCssClass: 'systemtags-select2-dropdown',\n\t\t\t\t\tcloseOnSelect: false,\n\t\t\t\t\tallowClear: false,\n\t\t\t\t\tmultiple: this._multiple,\n\t\t\t\t\ttoggleSelect: this._multiple,\n\t\t\t\t\tquery: _.bind(this._queryTagsAutocomplete, this),\n\t\t\t\t\tid: function(tag) {\n\t\t\t\t\t\treturn tag.id\n\t\t\t\t\t},\n\t\t\t\t\tinitSelection: _.bind(this._initSelection, this),\n\t\t\t\t\tformatResult: _.bind(this._formatDropDownResult, this),\n\t\t\t\t\tformatSelection: _.bind(this._formatSelection, this),\n\t\t\t\t\tcreateSearchChoice: this._allowCreate ? _.bind(this._createSearchChoice, this) : undefined,\n\t\t\t\t\tsortResults: function(results) {\n\t\t\t\t\t\tvar selectedItems = _.pluck(self.$tagsField.select2('data'), 'id')\n\t\t\t\t\t\tresults.sort(function(a, b) {\n\t\t\t\t\t\t\tvar aSelected = selectedItems.indexOf(a.id) >= 0\n\t\t\t\t\t\t\tvar bSelected = selectedItems.indexOf(b.id) >= 0\n\t\t\t\t\t\t\tif (aSelected === bSelected) {\n\t\t\t\t\t\t\t\tvar aLastUsed = self._lastUsedTags.indexOf(a.id)\n\t\t\t\t\t\t\t\tvar bLastUsed = self._lastUsedTags.indexOf(b.id)\n\n\t\t\t\t\t\t\t\tif (aLastUsed !== bLastUsed) {\n\t\t\t\t\t\t\t\t\tif (bLastUsed === -1) {\n\t\t\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (aLastUsed === -1) {\n\t\t\t\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn aLastUsed < bLastUsed ? -1 : 1\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Both not found\n\t\t\t\t\t\t\t\treturn OC.Util.naturalSortCompare(a.name, b.name)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (aSelected && !bSelected) {\n\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t})\n\t\t\t\t\t\treturn results\n\t\t\t\t\t},\n\t\t\t\t\tformatNoMatches: function() {\n\t\t\t\t\t\treturn t('core', 'No tags found')\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t\t.on('select2-selecting', this._onSelectTag)\n\t\t\t\t\t.on('select2-removing', this._onDeselectTag)\n\n\t\t\t\tvar $dropDown = this.$tagsField.select2('dropdown')\n\t\t\t\t// register events for inside the dropdown\n\t\t\t\t$dropDown.on('mouseup', '.rename', this._onClickRenameTag)\n\t\t\t\t$dropDown.on('mouseup', '.delete', this._onClickDeleteTag)\n\t\t\t\t$dropDown.on('mouseup', '.select2-result-selectable.has-form', this._preventDefault)\n\t\t\t\t$dropDown.on('submit', '.systemtags-rename-form', this._onSubmitRenameTag)\n\n\t\t\t\tthis.delegateEvents()\n\t\t\t},\n\n\t\t\tremove: function() {\n\t\t\t\tif (this.$tagsField) {\n\t\t\t\t\tthis.$tagsField.select2('destroy')\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tgetValues: function() {\n\t\t\t\tthis.$tagsField.select2('val')\n\t\t\t},\n\n\t\t\tsetValues: function(values) {\n\t\t\t\tthis.$tagsField.select2('val', values)\n\t\t\t},\n\n\t\t\tsetData: function(data) {\n\t\t\t\tthis.$tagsField.select2('data', data)\n\t\t\t}\n\t\t})\n\n\tOC.SystemTags = OC.SystemTags || {}\n\tOC.SystemTags.SystemTagsInputField = SystemTagsInputField\n\n})(OC)\n","/**\n * Translates the list format produced by css-loader into something\n * easier to manipulate.\n */\nexport default function listToStyles (parentId, list) {\n  var styles = []\n  var newStyles = {}\n  for (var i = 0; i < list.length; i++) {\n    var item = list[i]\n    var id = item[0]\n    var css = item[1]\n    var media = item[2]\n    var sourceMap = item[3]\n    var part = {\n      id: parentId + ':' + i,\n      css: css,\n      media: media,\n      sourceMap: sourceMap\n    }\n    if (!newStyles[id]) {\n      styles.push(newStyles[id] = { id: id, parts: [part] })\n    } else {\n      newStyles[id].parts.push(part)\n    }\n  }\n  return styles\n}\n","/*\n  MIT License http://www.opensource.org/licenses/mit-license.php\n  Author Tobias Koppers @sokra\n  Modified by Evan You @yyx990803\n*/\n\nimport listToStyles from './listToStyles'\n\nvar hasDocument = typeof document !== 'undefined'\n\nif (typeof DEBUG !== 'undefined' && DEBUG) {\n  if (!hasDocument) {\n    throw new Error(\n    'vue-style-loader cannot be used in a non-browser environment. ' +\n    \"Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.\"\n  ) }\n}\n\n/*\ntype StyleObject = {\n  id: number;\n  parts: Array<StyleObjectPart>\n}\n\ntype StyleObjectPart = {\n  css: string;\n  media: string;\n  sourceMap: ?string\n}\n*/\n\nvar stylesInDom = {/*\n  [id: number]: {\n    id: number,\n    refs: number,\n    parts: Array<(obj?: StyleObjectPart) => void>\n  }\n*/}\n\nvar head = hasDocument && (document.head || document.getElementsByTagName('head')[0])\nvar singletonElement = null\nvar singletonCounter = 0\nvar isProduction = false\nvar noop = function () {}\nvar options = null\nvar ssrIdKey = 'data-vue-ssr-id'\n\n// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n// tags it will allow on a page\nvar isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase())\n\nexport default function addStylesClient (parentId, list, _isProduction, _options) {\n  isProduction = _isProduction\n\n  options = _options || {}\n\n  var styles = listToStyles(parentId, list)\n  addStylesToDom(styles)\n\n  return function update (newList) {\n    var mayRemove = []\n    for (var i = 0; i < styles.length; i++) {\n      var item = styles[i]\n      var domStyle = stylesInDom[item.id]\n      domStyle.refs--\n      mayRemove.push(domStyle)\n    }\n    if (newList) {\n      styles = listToStyles(parentId, newList)\n      addStylesToDom(styles)\n    } else {\n      styles = []\n    }\n    for (var i = 0; i < mayRemove.length; i++) {\n      var domStyle = mayRemove[i]\n      if (domStyle.refs === 0) {\n        for (var j = 0; j < domStyle.parts.length; j++) {\n          domStyle.parts[j]()\n        }\n        delete stylesInDom[domStyle.id]\n      }\n    }\n  }\n}\n\nfunction addStylesToDom (styles /* Array<StyleObject> */) {\n  for (var i = 0; i < styles.length; i++) {\n    var item = styles[i]\n    var domStyle = stylesInDom[item.id]\n    if (domStyle) {\n      domStyle.refs++\n      for (var j = 0; j < domStyle.parts.length; j++) {\n        domStyle.parts[j](item.parts[j])\n      }\n      for (; j < item.parts.length; j++) {\n        domStyle.parts.push(addStyle(item.parts[j]))\n      }\n      if (domStyle.parts.length > item.parts.length) {\n        domStyle.parts.length = item.parts.length\n      }\n    } else {\n      var parts = []\n      for (var j = 0; j < item.parts.length; j++) {\n        parts.push(addStyle(item.parts[j]))\n      }\n      stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }\n    }\n  }\n}\n\nfunction createStyleElement () {\n  var styleElement = document.createElement('style')\n  styleElement.type = 'text/css'\n  head.appendChild(styleElement)\n  return styleElement\n}\n\nfunction addStyle (obj /* StyleObjectPart */) {\n  var update, remove\n  var styleElement = document.querySelector('style[' + ssrIdKey + '~=\"' + obj.id + '\"]')\n\n  if (styleElement) {\n    if (isProduction) {\n      // has SSR styles and in production mode.\n      // simply do nothing.\n      return noop\n    } else {\n      // has SSR styles but in dev mode.\n      // for some reason Chrome can't handle source map in server-rendered\n      // style tags - source maps in <style> only works if the style tag is\n      // created and inserted dynamically. So we remove the server rendered\n      // styles and inject new ones.\n      styleElement.parentNode.removeChild(styleElement)\n    }\n  }\n\n  if (isOldIE) {\n    // use singleton mode for IE9.\n    var styleIndex = singletonCounter++\n    styleElement = singletonElement || (singletonElement = createStyleElement())\n    update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)\n    remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)\n  } else {\n    // use multi-style-tag mode in all other cases\n    styleElement = createStyleElement()\n    update = applyToTag.bind(null, styleElement)\n    remove = function () {\n      styleElement.parentNode.removeChild(styleElement)\n    }\n  }\n\n  update(obj)\n\n  return function updateStyle (newObj /* StyleObjectPart */) {\n    if (newObj) {\n      if (newObj.css === obj.css &&\n          newObj.media === obj.media &&\n          newObj.sourceMap === obj.sourceMap) {\n        return\n      }\n      update(obj = newObj)\n    } else {\n      remove()\n    }\n  }\n}\n\nvar replaceText = (function () {\n  var textStore = []\n\n  return function (index, replacement) {\n    textStore[index] = replacement\n    return textStore.filter(Boolean).join('\\n')\n  }\n})()\n\nfunction applyToSingletonTag (styleElement, index, remove, obj) {\n  var css = remove ? '' : obj.css\n\n  if (styleElement.styleSheet) {\n    styleElement.styleSheet.cssText = replaceText(index, css)\n  } else {\n    var cssNode = document.createTextNode(css)\n    var childNodes = styleElement.childNodes\n    if (childNodes[index]) styleElement.removeChild(childNodes[index])\n    if (childNodes.length) {\n      styleElement.insertBefore(cssNode, childNodes[index])\n    } else {\n      styleElement.appendChild(cssNode)\n    }\n  }\n}\n\nfunction applyToTag (styleElement, obj) {\n  var css = obj.css\n  var media = obj.media\n  var sourceMap = obj.sourceMap\n\n  if (media) {\n    styleElement.setAttribute('media', media)\n  }\n  if (options.ssrId) {\n    styleElement.setAttribute(ssrIdKey, obj.id)\n  }\n\n  if (sourceMap) {\n    // https://developer.chrome.com/devtools/docs/javascript-debugging\n    // this makes source maps inside style tags work properly in Chrome\n    css += '\\n/*# sourceURL=' + sourceMap.sources[0] + ' */'\n    // http://stackoverflow.com/a/26603875\n    css += '\\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'\n  }\n\n  if (styleElement.styleSheet) {\n    styleElement.styleSheet.cssText = css\n  } else {\n    while (styleElement.firstChild) {\n      styleElement.removeChild(styleElement.firstChild)\n    }\n    styleElement.appendChild(document.createTextNode(css))\n  }\n}\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/core/js/systemtags/merged-systemtags.js b/core/js/systemtags/merged-systemtags.js
deleted file mode 100644 (file)
index e17f55e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-import './systemtags.js'
-import './templates.js'
-import './systemtagmodel.js'
-import './systemtagsmappingcollection.js'
-import './systemtagscollection.js'
-import './systemtagsinputfield.js'
-
-import '../../css/systemtags.scss'
diff --git a/core/js/systemtags/systemtagmodel.js b/core/js/systemtags/systemtagmodel.js
deleted file mode 100644 (file)
index b3490c0..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2015
- *
- * This file is licensed under the Affero General Public License version 3
- * or later.
- *
- * See the COPYING-README file.
- *
- */
-
-(function(OC) {
-
-       _.extend(OC.Files.Client, {
-               PROPERTY_FILEID:        '{' + OC.Files.Client.NS_OWNCLOUD + '}id',
-               PROPERTY_CAN_ASSIGN: '{' + OC.Files.Client.NS_OWNCLOUD + '}can-assign',
-               PROPERTY_DISPLAYNAME:   '{' + OC.Files.Client.NS_OWNCLOUD + '}display-name',
-               PROPERTY_USERVISIBLE:   '{' + OC.Files.Client.NS_OWNCLOUD + '}user-visible',
-               PROPERTY_USERASSIGNABLE: '{' + OC.Files.Client.NS_OWNCLOUD + '}user-assignable',
-       })
-
-       /**
-        * @class OCA.SystemTags.SystemTagsCollection
-        * @classdesc
-        *
-        * System tag
-        *
-        */
-       const SystemTagModel = OC.Backbone.Model.extend(
-               /** @lends OCA.SystemTags.SystemTagModel.prototype */ {
-                       sync: OC.Backbone.davSync,
-
-                       defaults: {
-                               userVisible: true,
-                               userAssignable: true,
-                               canAssign: true,
-                       },
-
-                       davProperties: {
-                               'id':   OC.Files.Client.PROPERTY_FILEID,
-                               'name': OC.Files.Client.PROPERTY_DISPLAYNAME,
-                               'userVisible': OC.Files.Client.PROPERTY_USERVISIBLE,
-                               'userAssignable': OC.Files.Client.PROPERTY_USERASSIGNABLE,
-                               // read-only, effective permissions computed by the server,
-                               'canAssign': OC.Files.Client.PROPERTY_CAN_ASSIGN,
-                       },
-
-                       parse: function(data) {
-                               return {
-                                       id: data.id,
-                                       name: data.name,
-                                       userVisible: data.userVisible === true || data.userVisible === 'true',
-                                       userAssignable: data.userAssignable === true || data.userAssignable === 'true',
-                                       canAssign: data.canAssign === true || data.canAssign === 'true',
-                               }
-                       },
-               })
-
-       OC.SystemTags = OC.SystemTags || {}
-       OC.SystemTags.SystemTagModel = SystemTagModel
-})(OC)
diff --git a/core/js/systemtags/systemtags.js b/core/js/systemtags/systemtags.js
deleted file mode 100644 (file)
index 6e2f2e6..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/* eslint-disable */
-/*
- * Copyright (c) 2016
- *
- * This file is licensed under the Affero General Public License version 3
- * or later.
- *
- * See the COPYING-README file.
- *
- */
-
-(function(OC) {
-       /**
-        * @namespace
-        */
-       OC.SystemTags = {
-               /**
-                *
-                * @param {OC.SystemTags.SystemTagModel|Object|String} tag
-                * @returns {jQuery}
-                */
-               getDescriptiveTag: function(tag) {
-                       if (_.isUndefined(tag.name) && !_.isUndefined(tag.toJSON)) {
-                               tag = tag.toJSON()
-                       }
-
-                       if (_.isUndefined(tag.name)) {
-                               return $('<span>').addClass('non-existing-tag').text(
-                                       t('core', 'Non-existing tag #{tag}', {
-                                               tag: tag
-                                       })
-                               )
-                       }
-
-                       var $span = $('<span>')
-                       $span.append(escapeHTML(tag.name))
-
-                       var scope
-                       if (!tag.userAssignable) {
-                               scope = t('core', 'restricted')
-                       }
-                       if (!tag.userVisible) {
-                               // invisible also implicitly means not assignable
-                               scope = t('core', 'invisible')
-                       }
-                       if (scope) {
-                               $span.append($('<em>').text(' (' + scope + ')'))
-                       }
-                       return $span
-               }
-       }
-})(OC)
diff --git a/core/js/systemtags/systemtagscollection.js b/core/js/systemtags/systemtagscollection.js
deleted file mode 100644 (file)
index fe3f286..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/* eslint-disable */
-/*
- * Copyright (c) 2015
- *
- * This file is licensed under the Affero General Public License version 3
- * or later.
- *
- * See the COPYING-README file.
- *
- */
-
-(function(OC) {
-
-       function filterFunction(model, term) {
-               return model.get('name').substr(0, term.length).toLowerCase() === term.toLowerCase()
-       }
-
-       /**
-        * @class OCA.SystemTags.SystemTagsCollection
-        * @classdesc
-        *
-        * Collection of tags assigned to a file
-        *
-        */
-       var SystemTagsCollection = OC.Backbone.Collection.extend(
-               /** @lends OC.SystemTags.SystemTagsCollection.prototype */ {
-
-                       sync: OC.Backbone.davSync,
-
-                       model: OC.SystemTags.SystemTagModel,
-
-                       url: function() {
-                               return OC.linkToRemote('dav') + '/systemtags/'
-                       },
-
-                       filterByName: function(name) {
-                               return this.filter(function(model) {
-                                       return filterFunction(model, name)
-                               })
-                       },
-
-                       reset: function() {
-                               this.fetched = false
-                               return OC.Backbone.Collection.prototype.reset.apply(this, arguments)
-                       },
-
-                       /**
-                * Lazy fetch.
-                * Only fetches once, subsequent calls will directly call the success handler.
-                *
-                * @param options
-                * @param [options.force] true to force fetch even if cached entries exist
-                *
-                * @see Backbone.Collection#fetch
-                */
-                       fetch: function(options) {
-                               var self = this
-                               options = options || {}
-                               if (this.fetched || options.force) {
-                               // directly call handler
-                                       if (options.success) {
-                                               options.success(this, null, options)
-                                       }
-                                       // trigger sync event
-                                       this.trigger('sync', this, null, options)
-                                       return Promise.resolve()
-                               }
-
-                               var success = options.success
-                               options = _.extend({}, options)
-                               options.success = function() {
-                                       self.fetched = true
-                                       if (success) {
-                                               return success.apply(this, arguments)
-                                       }
-                               }
-
-                               return OC.Backbone.Collection.prototype.fetch.call(this, options)
-                       }
-               })
-
-       OC.SystemTags = OC.SystemTags || {}
-       OC.SystemTags.SystemTagsCollection = SystemTagsCollection
-
-       /**
-        * @type OC.SystemTags.SystemTagsCollection
-        */
-       OC.SystemTags.collection = new OC.SystemTags.SystemTagsCollection()
-})(OC)
diff --git a/core/js/systemtags/systemtagsinputfield.js b/core/js/systemtags/systemtagsinputfield.js
deleted file mode 100644 (file)
index 6065b0e..0000000
+++ /dev/null
@@ -1,446 +0,0 @@
-/* eslint-disable */
-/*
- * Copyright (c) 2015
- *
- * This file is licensed under the Affero General Public License version 3
- * or later.
- *
- * See the COPYING-README file.
- *
- */
-
-/* global Handlebars */
-
-(function(OC) {
-
-       /**
-        * @class OC.SystemTags.SystemTagsInputField
-        * @classdesc
-        *
-        * Displays a file's system tags
-        *
-        */
-       var SystemTagsInputField = OC.Backbone.View.extend(
-               /** @lends OC.SystemTags.SystemTagsInputField.prototype */ {
-
-                       _rendered: false,
-
-                       _newTag: null,
-
-                       _lastUsedTags: [],
-
-                       className: 'systemTagsInputFieldContainer',
-
-                       template: function(data) {
-                               return '<input class="systemTagsInputField" type="hidden" name="tags" value=""/>'
-                       },
-
-                       /**
-                * Creates a new SystemTagsInputField
-                *
-                * @param {Object} [options]
-                * @param {string} [options.objectType=files] object type for which tags are assigned to
-                * @param {bool} [options.multiple=false] whether to allow selecting multiple tags
-                * @param {bool} [options.allowActions=true] whether tags can be renamed/delete within the dropdown
-                * @param {bool} [options.allowCreate=true] whether new tags can be created
-                * @param {bool} [options.isAdmin=true] whether the user is an administrator
-                * @param {Function} options.initSelection function to convert selection to data
-                */
-                       initialize: function(options) {
-                               options = options || {}
-
-                               this._multiple = !!options.multiple
-                               this._allowActions = _.isUndefined(options.allowActions) || !!options.allowActions
-                               this._allowCreate = _.isUndefined(options.allowCreate) || !!options.allowCreate
-                               this._isAdmin = !!options.isAdmin
-
-                               if (_.isFunction(options.initSelection)) {
-                                       this._initSelection = options.initSelection
-                               }
-
-                               this.collection = options.collection || OC.SystemTags.collection
-
-                               var self = this
-                               this.collection.on('change:name remove', function() {
-                               // refresh selection
-                                       _.defer(self._refreshSelection)
-                               })
-
-                               _.defer(_.bind(this._getLastUsedTags, this))
-
-                               _.bindAll(
-                                       this,
-                                       '_refreshSelection',
-                                       '_onClickRenameTag',
-                                       '_onClickDeleteTag',
-                                       '_onSelectTag',
-                                       '_onDeselectTag',
-                                       '_onSubmitRenameTag'
-                               )
-                       },
-
-                       _getLastUsedTags: function() {
-                               var self = this
-                               $.ajax({
-                                       type: 'GET',
-                                       url: OC.generateUrl('/apps/systemtags/lastused'),
-                                       success: function(response) {
-                                               self._lastUsedTags = response
-                                       }
-                               })
-                       },
-
-                       /**
-                * Refreshes the selection, triggering a call to
-                * select2's initSelection
-                */
-                       _refreshSelection: function() {
-                               this.$tagsField.select2('val', this.$tagsField.val())
-                       },
-
-                       /**
-                * Event handler whenever the user clicked the "rename" action.
-                * This will display the rename field.
-                */
-                       _onClickRenameTag: function(ev) {
-                               var $item = $(ev.target).closest('.systemtags-item')
-                               var tagId = $item.attr('data-id')
-                               var tagModel = this.collection.get(tagId)
-
-                               var oldName = tagModel.get('name')
-                               var $renameForm = $(OC.SystemTags.Templates['result_form']({
-                                       cid: this.cid,
-                                       name: oldName,
-                                       deleteTooltip: t('core', 'Delete'),
-                                       renameLabel: t('core', 'Rename'),
-                                       isAdmin: this._isAdmin
-                               }))
-                               $item.find('.label').after($renameForm)
-                               $item.find('.label, .systemtags-actions').addClass('hidden')
-                               $item.closest('.select2-result').addClass('has-form')
-
-                               $renameForm.find('[title]').tooltip({
-                                       placement: 'bottom',
-                                       container: 'body'
-                               })
-                               $renameForm.find('input').focus().selectRange(0, oldName.length)
-                               return false
-                       },
-
-                       /**
-                * Event handler whenever the rename form has been submitted after
-                * the user entered a new tag name.
-                * This will submit the change to the server.
-                *
-                * @param {Object} ev event
-                */
-                       _onSubmitRenameTag: function(ev) {
-                               ev.preventDefault()
-                               var $form = $(ev.target)
-                               var $item = $form.closest('.systemtags-item')
-                               var tagId = $item.attr('data-id')
-                               var tagModel = this.collection.get(tagId)
-                               var newName = $(ev.target).find('input').val().trim()
-                               if (newName && newName !== tagModel.get('name')) {
-                                       tagModel.save({ 'name': newName })
-                                       // TODO: spinner, and only change text after finished saving
-                                       $item.find('.label').text(newName)
-                               }
-                               $item.find('.label, .systemtags-actions').removeClass('hidden')
-                               $form.remove()
-                               $item.closest('.select2-result').removeClass('has-form')
-                       },
-
-                       /**
-                * Event handler whenever a tag must be deleted
-                *
-                * @param {Object} ev event
-                */
-                       _onClickDeleteTag: function(ev) {
-                               var $item = $(ev.target).closest('.systemtags-item')
-                               var tagId = $item.attr('data-id')
-                               this.collection.get(tagId).destroy()
-                               $(ev.target).tooltip('hide')
-                               $item.closest('.select2-result').remove()
-                               // TODO: spinner
-                               return false
-                       },
-
-                       _addToSelect2Selection: function(selection) {
-                               var data = this.$tagsField.select2('data')
-                               data.push(selection)
-                               this.$tagsField.select2('data', data)
-                       },
-
-                       /**
-                * Event handler whenever a tag is selected.
-                * Also called whenever tag creation is requested through the dummy tag object.
-                *
-                * @param {Object} e event
-                */
-                       _onSelectTag: function(e) {
-                               var self = this
-                               var tag
-                               if (e.object && e.object.isNew) {
-                               // newly created tag, check if existing
-                               // create a new tag
-                                       tag = this.collection.create({
-                                               name: e.object.name.trim(),
-                                               userVisible: true,
-                                               userAssignable: true,
-                                               canAssign: true
-                                       }, {
-                                               success: function(model) {
-                                                       self._addToSelect2Selection(model.toJSON())
-                                                       self._lastUsedTags.unshift(model.id)
-                                                       self.trigger('select', model)
-                                               },
-                                               error: function(model, xhr) {
-                                                       if (xhr.status === 409) {
-                                                       // re-fetch collection to get the missing tag
-                                                               self.collection.reset()
-                                                               self.collection.fetch({
-                                                                       success: function(collection) {
-                                                                       // find the tag in the collection
-                                                                               var model = collection.where({
-                                                                                       name: e.object.name.trim(),
-                                                                                       userVisible: true,
-                                                                                       userAssignable: true
-                                                                               })
-                                                                               if (model.length) {
-                                                                                       model = model[0]
-                                                                                       // the tag already exists or was already assigned,
-                                                                                       // add it to the list anyway
-                                                                                       self._addToSelect2Selection(model.toJSON())
-                                                                                       self.trigger('select', model)
-                                                                               }
-                                                                       }
-                                                               })
-                                                       }
-                                               }
-                                       })
-                                       this.$tagsField.select2('close')
-                                       e.preventDefault()
-                                       return false
-                               } else {
-                                       tag = this.collection.get(e.object.id)
-                                       this._lastUsedTags.unshift(tag.id)
-                               }
-                               this._newTag = null
-                               this.trigger('select', tag)
-                       },
-
-                       /**
-                * Event handler whenever a tag gets deselected.
-                *
-                * @param {Object} e event
-                */
-                       _onDeselectTag: function(e) {
-                               this.trigger('deselect', e.choice.id)
-                       },
-
-                       /**
-                * Autocomplete function for dropdown results
-                *
-                * @param {Object} query select2 query object
-                */
-                       _queryTagsAutocomplete: function(query) {
-                               var self = this
-                               this.collection.fetch({
-                                       success: function(collection) {
-                                               var tagModels = collection.filterByName(query.term.trim())
-                                               if (!self._isAdmin) {
-                                                       tagModels = _.filter(tagModels, function(tagModel) {
-                                                               return tagModel.get('canAssign')
-                                                       })
-                                               }
-                                               query.callback({
-                                                       results: _.invoke(tagModels, 'toJSON')
-                                               })
-                                       }
-                               })
-                       },
-
-                       _preventDefault: function(e) {
-                               e.stopPropagation()
-                       },
-
-                       /**
-                * Formats a single dropdown result
-                *
-                * @param {Object} data data to format
-                * @returns {string} HTML markup
-                */
-                       _formatDropDownResult: function(data) {
-                               return OC.SystemTags.Templates['result'](_.extend({
-                                       renameTooltip: t('core', 'Rename'),
-                                       allowActions: this._allowActions,
-                                       tagMarkup: this._isAdmin ? OC.SystemTags.getDescriptiveTag(data)[0].innerHTML : null,
-                                       isAdmin: this._isAdmin
-                               }, data))
-                       },
-
-                       /**
-                * Formats a single selection item
-                *
-                * @param {Object} data data to format
-                * @returns {string} HTML markup
-                */
-                       _formatSelection: function(data) {
-                               return OC.SystemTags.Templates['selection'](_.extend({
-                                       tagMarkup: this._isAdmin ? OC.SystemTags.getDescriptiveTag(data)[0].innerHTML : null,
-                                       isAdmin: this._isAdmin
-                               }, data))
-                       },
-
-                       /**
-                * Create new dummy choice for select2 when the user
-                * types an arbitrary string
-                *
-                * @param {string} term entered term
-                * @returns {Object} dummy tag
-                */
-                       _createSearchChoice: function(term) {
-                               term = term.trim()
-                               if (this.collection.filter(function(entry) {
-                                       return entry.get('name') === term
-                               }).length) {
-                                       return
-                               }
-                               if (!this._newTag) {
-                                       this._newTag = {
-                                               id: -1,
-                                               name: term,
-                                               userAssignable: true,
-                                               userVisible: true,
-                                               canAssign: true,
-                                               isNew: true
-                                       }
-                               } else {
-                                       this._newTag.name = term
-                               }
-
-                               return this._newTag
-                       },
-
-                       _initSelection: function(element, callback) {
-                               var self = this
-                               var ids = $(element).val().split(',')
-
-                               function modelToSelection(model) {
-                                       var data = model.toJSON()
-                                       if (!self._isAdmin && !data.canAssign) {
-                                       // lock static tags for non-admins
-                                               data.locked = true
-                                       }
-                                       return data
-                               }
-
-                               function findSelectedObjects(ids) {
-                                       var selectedModels = self.collection.filter(function(model) {
-                                               return ids.indexOf(model.id) >= 0 && (self._isAdmin || model.get('userVisible'))
-                                       })
-                                       return _.map(selectedModels, modelToSelection)
-                               }
-
-                               this.collection.fetch({
-                                       success: function() {
-                                               callback(findSelectedObjects(ids))
-                                       }
-                               })
-                       },
-
-                       /**
-                * Renders this details view
-                */
-                       render: function() {
-                               var self = 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: false,
-                                       allowClear: false,
-                                       multiple: this._multiple,
-                                       toggleSelect: this._multiple,
-                                       query: _.bind(this._queryTagsAutocomplete, this),
-                                       id: function(tag) {
-                                               return tag.id
-                                       },
-                                       initSelection: _.bind(this._initSelection, this),
-                                       formatResult: _.bind(this._formatDropDownResult, this),
-                                       formatSelection: _.bind(this._formatSelection, this),
-                                       createSearchChoice: this._allowCreate ? _.bind(this._createSearchChoice, this) : undefined,
-                                       sortResults: function(results) {
-                                               var selectedItems = _.pluck(self.$tagsField.select2('data'), 'id')
-                                               results.sort(function(a, b) {
-                                                       var aSelected = selectedItems.indexOf(a.id) >= 0
-                                                       var bSelected = selectedItems.indexOf(b.id) >= 0
-                                                       if (aSelected === bSelected) {
-                                                               var aLastUsed = self._lastUsedTags.indexOf(a.id)
-                                                               var bLastUsed = self._lastUsedTags.indexOf(b.id)
-
-                                                               if (aLastUsed !== bLastUsed) {
-                                                                       if (bLastUsed === -1) {
-                                                                               return -1
-                                                                       }
-                                                                       if (aLastUsed === -1) {
-                                                                               return 1
-                                                                       }
-                                                                       return aLastUsed < bLastUsed ? -1 : 1
-                                                               }
-
-                                                               // Both not found
-                                                               return OC.Util.naturalSortCompare(a.name, b.name)
-                                                       }
-                                                       if (aSelected && !bSelected) {
-                                                               return -1
-                                                       }
-                                                       return 1
-                                               })
-                                               return results
-                                       },
-                                       formatNoMatches: function() {
-                                               return t('core', 'No tags found')
-                                       }
-                               })
-                                       .on('select2-selecting', this._onSelectTag)
-                                       .on('select2-removing', this._onDeselectTag)
-
-                               var $dropDown = this.$tagsField.select2('dropdown')
-                               // register events for inside the dropdown
-                               $dropDown.on('mouseup', '.rename', this._onClickRenameTag)
-                               $dropDown.on('mouseup', '.delete', this._onClickDeleteTag)
-                               $dropDown.on('mouseup', '.select2-result-selectable.has-form', this._preventDefault)
-                               $dropDown.on('submit', '.systemtags-rename-form', this._onSubmitRenameTag)
-
-                               this.delegateEvents()
-                       },
-
-                       remove: function() {
-                               if (this.$tagsField) {
-                                       this.$tagsField.select2('destroy')
-                               }
-                       },
-
-                       getValues: function() {
-                               this.$tagsField.select2('val')
-                       },
-
-                       setValues: function(values) {
-                               this.$tagsField.select2('val', values)
-                       },
-
-                       setData: function(data) {
-                               this.$tagsField.select2('data', data)
-                       }
-               })
-
-       OC.SystemTags = OC.SystemTags || {}
-       OC.SystemTags.SystemTagsInputField = SystemTagsInputField
-
-})(OC)
diff --git a/core/js/systemtags/systemtagsmappingcollection.js b/core/js/systemtags/systemtagsmappingcollection.js
deleted file mode 100644 (file)
index 834ba57..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2015
- *
- * This file is licensed under the Affero General Public License version 3
- * or later.
- *
- * See the COPYING-README file.
- *
- */
-
-(function(OC) {
-       /**
-        * @class OC.SystemTags.SystemTagsMappingCollection
-        * @classdesc
-        *
-        * Collection of tags assigned to a an object
-        *
-        */
-       const SystemTagsMappingCollection = OC.Backbone.Collection.extend(
-               /** @lends OC.SystemTags.SystemTagsMappingCollection.prototype */ {
-
-                       sync: OC.Backbone.davSync,
-
-                       /**
-                * Use PUT instead of PROPPATCH
-                */
-                       usePUT: true,
-
-                       /**
-                * Id of the file for which to filter activities by
-                *
-                * @var int
-                */
-                       _objectId: null,
-
-                       /**
-                * Type of the object to filter by
-                *
-                * @var string
-                */
-                       _objectType: 'files',
-
-                       model: OC.SystemTags.SystemTagModel,
-
-                       url: function() {
-                               return OC.linkToRemote('dav') + '/systemtags-relations/' + this._objectType + '/' + this._objectId
-                       },
-
-                       /**
-                * Sets the object id to filter by or null for all.
-                *
-                * @param {int} objectId file id or null
-                */
-                       setObjectId: function(objectId) {
-                               this._objectId = objectId
-                       },
-
-                       /**
-                * Sets the object type to filter by or null for all.
-                *
-                * @param {int} objectType file id or null
-                */
-                       setObjectType: function(objectType) {
-                               this._objectType = objectType
-                       },
-
-                       initialize: function(models, options) {
-                               options = options || {}
-                               if (!_.isUndefined(options.objectId)) {
-                                       this._objectId = options.objectId
-                               }
-                               if (!_.isUndefined(options.objectType)) {
-                                       this._objectType = options.objectType
-                               }
-                       },
-
-                       getTagIds: function() {
-                               return this.map(function(model) {
-                                       return model.id
-                               })
-                       },
-               })
-
-       OC.SystemTags = OC.SystemTags || {}
-       OC.SystemTags.SystemTagsMappingCollection = SystemTagsMappingCollection
-})(OC)
diff --git a/core/js/systemtags/templates.js b/core/js/systemtags/templates.js
deleted file mode 100644 (file)
index 1915f7e..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-(function() {
-  var template = Handlebars.template, templates = OC.SystemTags.Templates = OC.SystemTags.Templates || {};
-templates['result'] = template({"1":function(container,depth0,helpers,partials,data) {
-    return " new-item";
-},"3":function(container,depth0,helpers,partials,data) {
-    var stack1, helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
-        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
-          return parent[propertyName];
-        }
-        return undefined
-    };
-
-  return "             <span class=\"label\">"
-    + ((stack1 = ((helper = (helper = lookupProperty(helpers,"tagMarkup") || (depth0 != null ? lookupProperty(depth0,"tagMarkup") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"tagMarkup","hash":{},"data":data,"loc":{"start":{"line":4,"column":22},"end":{"line":4,"column":37}}}) : helper))) != null ? stack1 : "")
-    + "</span>\n";
-},"5":function(container,depth0,helpers,partials,data) {
-    var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
-        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
-          return parent[propertyName];
-        }
-        return undefined
-    };
-
-  return "             <span class=\"label\">"
-    + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"name","hash":{},"data":data,"loc":{"start":{"line":6,"column":22},"end":{"line":6,"column":30}}}) : helper)))
-    + "</span>\n";
-},"7":function(container,depth0,helpers,partials,data) {
-    var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
-        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
-          return parent[propertyName];
-        }
-        return undefined
-    };
-
-  return "             <span class=\"systemtags-actions\">\n                   <a href=\"#\" class=\"rename icon icon-rename\" title=\""
-    + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"renameTooltip") || (depth0 != null ? lookupProperty(depth0,"renameTooltip") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"renameTooltip","hash":{},"data":data,"loc":{"start":{"line":10,"column":54},"end":{"line":10,"column":71}}}) : helper)))
-    + "\"></a>\n               </span>\n";
-},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
-    var stack1, helper, options, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
-        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
-          return parent[propertyName];
-        }
-        return undefined
-    }, buffer = 
-  "<span class=\"systemtags-item"
-    + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isNew") : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":57}}})) != null ? stack1 : "")
-    + "\" data-id=\""
-    + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"id") || (depth0 != null ? lookupProperty(depth0,"id") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"id","hash":{},"data":data,"loc":{"start":{"line":1,"column":68},"end":{"line":1,"column":74}}}) : helper)))
-    + "\">\n<span class=\"checkmark icon icon-checkmark\"></span>\n"
-    + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isAdmin") : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.program(5, data, 0),"data":data,"loc":{"start":{"line":3,"column":1},"end":{"line":7,"column":8}}})) != null ? stack1 : "");
-  stack1 = ((helper = (helper = lookupProperty(helpers,"allowActions") || (depth0 != null ? lookupProperty(depth0,"allowActions") : depth0)) != null ? helper : alias2),(options={"name":"allowActions","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":8,"column":1},"end":{"line":12,"column":18}}}),(typeof helper === alias3 ? helper.call(alias1,options) : helper));
-  if (!lookupProperty(helpers,"allowActions")) { stack1 = container.hooks.blockHelperMissing.call(depth0,stack1,options)}
-  if (stack1 != null) { buffer += stack1; }
-  return buffer + "</span>\n";
-},"useData":true});
-templates['result_form'] = template({"1":function(container,depth0,helpers,partials,data) {
-    var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
-        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
-          return parent[propertyName];
-        }
-        return undefined
-    };
-
-  return "             <a href=\"#\" class=\"delete icon icon-delete\" title=\""
-    + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"deleteTooltip") || (depth0 != null ? lookupProperty(depth0,"deleteTooltip") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"deleteTooltip","hash":{},"data":data,"loc":{"start":{"line":5,"column":53},"end":{"line":5,"column":70}}}) : helper)))
-    + "\"></a>\n";
-},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
-    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
-        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
-          return parent[propertyName];
-        }
-        return undefined
-    };
-
-  return "<form class=\"systemtags-rename-form\">\n     <label class=\"hidden-visually\" for=\""
-    + alias4(((helper = (helper = lookupProperty(helpers,"cid") || (depth0 != null ? lookupProperty(depth0,"cid") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":45}}}) : helper)))
-    + "-rename-input\">"
-    + alias4(((helper = (helper = lookupProperty(helpers,"renameLabel") || (depth0 != null ? lookupProperty(depth0,"renameLabel") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"renameLabel","hash":{},"data":data,"loc":{"start":{"line":2,"column":60},"end":{"line":2,"column":75}}}) : helper)))
-    + "</label>\n      <input id=\""
-    + alias4(((helper = (helper = lookupProperty(helpers,"cid") || (depth0 != null ? lookupProperty(depth0,"cid") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"cid","hash":{},"data":data,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":19}}}) : helper)))
-    + "-rename-input\" type=\"text\" value=\""
-    + alias4(((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":3,"column":53},"end":{"line":3,"column":61}}}) : helper)))
-    + "\">\n"
-    + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isAdmin") : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":4,"column":1},"end":{"line":6,"column":8}}})) != null ? stack1 : "")
-    + "</form>\n";
-},"useData":true});
-templates['selection'] = template({"1":function(container,depth0,helpers,partials,data) {
-    var stack1, helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
-        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
-          return parent[propertyName];
-        }
-        return undefined
-    };
-
-  return "     <span class=\"label\">"
-    + ((stack1 = ((helper = (helper = lookupProperty(helpers,"tagMarkup") || (depth0 != null ? lookupProperty(depth0,"tagMarkup") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"tagMarkup","hash":{},"data":data,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":36}}}) : helper))) != null ? stack1 : "")
-    + "</span>\n";
-},"3":function(container,depth0,helpers,partials,data) {
-    var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
-        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
-          return parent[propertyName];
-        }
-        return undefined
-    };
-
-  return "     <span class=\"label\">"
-    + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"name","hash":{},"data":data,"loc":{"start":{"line":4,"column":21},"end":{"line":4,"column":29}}}) : helper)))
-    + "</span>\n";
-},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
-    var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
-        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
-          return parent[propertyName];
-        }
-        return undefined
-    };
-
-  return ((stack1 = lookupProperty(helpers,"if").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"isAdmin") : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":7}}})) != null ? stack1 : "");
-},"useData":true});
-})();
\ No newline at end of file
diff --git a/core/js/systemtags/templates/result.handlebars b/core/js/systemtags/templates/result.handlebars
deleted file mode 100644 (file)
index faa7cc4..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<span class="systemtags-item{{#if isNew}} new-item{{/if}}" data-id="{{id}}">
-<span class="checkmark icon icon-checkmark"></span>
-       {{#if isAdmin}}
-               <span class="label">{{{tagMarkup}}}</span>
-       {{else}}
-               <span class="label">{{name}}</span>
-       {{/if}}
-       {{#allowActions}}
-               <span class="systemtags-actions">
-                       <a href="#" class="rename icon icon-rename" title="{{renameTooltip}}"></a>
-               </span>
-       {{/allowActions}}
-</span>
diff --git a/core/js/systemtags/templates/result_form.handlebars b/core/js/systemtags/templates/result_form.handlebars
deleted file mode 100644 (file)
index 28fe8c5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<form class="systemtags-rename-form">
-        <label class="hidden-visually" for="{{cid}}-rename-input">{{renameLabel}}</label>
-       <input id="{{cid}}-rename-input" type="text" value="{{name}}">
-       {{#if isAdmin}}
-               <a href="#" class="delete icon icon-delete" title="{{deleteTooltip}}"></a>
-       {{/if}}
-</form>
diff --git a/core/js/systemtags/templates/selection.handlebars b/core/js/systemtags/templates/selection.handlebars
deleted file mode 100644 (file)
index b006b12..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-{{#if isAdmin}}
-       <span class="label">{{{tagMarkup}}}</span>
-{{else}}
-       <span class="label">{{name}}</span>
-{{/if}}
diff --git a/core/src/systemtags/merged-systemtags.js b/core/src/systemtags/merged-systemtags.js
new file mode 100644 (file)
index 0000000..011544b
--- /dev/null
@@ -0,0 +1,7 @@
+import './systemtags.js'
+import './systemtagmodel.js'
+import './systemtagsmappingcollection.js'
+import './systemtagscollection.js'
+import './systemtagsinputfield.js'
+
+import '../../css/systemtags.scss'
diff --git a/core/src/systemtags/systemtagmodel.js b/core/src/systemtags/systemtagmodel.js
new file mode 100644 (file)
index 0000000..b3490c0
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2015
+ *
+ * This file is licensed under the Affero General Public License version 3
+ * or later.
+ *
+ * See the COPYING-README file.
+ *
+ */
+
+(function(OC) {
+
+       _.extend(OC.Files.Client, {
+               PROPERTY_FILEID:        '{' + OC.Files.Client.NS_OWNCLOUD + '}id',
+               PROPERTY_CAN_ASSIGN: '{' + OC.Files.Client.NS_OWNCLOUD + '}can-assign',
+               PROPERTY_DISPLAYNAME:   '{' + OC.Files.Client.NS_OWNCLOUD + '}display-name',
+               PROPERTY_USERVISIBLE:   '{' + OC.Files.Client.NS_OWNCLOUD + '}user-visible',
+               PROPERTY_USERASSIGNABLE: '{' + OC.Files.Client.NS_OWNCLOUD + '}user-assignable',
+       })
+
+       /**
+        * @class OCA.SystemTags.SystemTagsCollection
+        * @classdesc
+        *
+        * System tag
+        *
+        */
+       const SystemTagModel = OC.Backbone.Model.extend(
+               /** @lends OCA.SystemTags.SystemTagModel.prototype */ {
+                       sync: OC.Backbone.davSync,
+
+                       defaults: {
+                               userVisible: true,
+                               userAssignable: true,
+                               canAssign: true,
+                       },
+
+                       davProperties: {
+                               'id':   OC.Files.Client.PROPERTY_FILEID,
+                               'name': OC.Files.Client.PROPERTY_DISPLAYNAME,
+                               'userVisible': OC.Files.Client.PROPERTY_USERVISIBLE,
+                               'userAssignable': OC.Files.Client.PROPERTY_USERASSIGNABLE,
+                               // read-only, effective permissions computed by the server,
+                               'canAssign': OC.Files.Client.PROPERTY_CAN_ASSIGN,
+                       },
+
+                       parse: function(data) {
+                               return {
+                                       id: data.id,
+                                       name: data.name,
+                                       userVisible: data.userVisible === true || data.userVisible === 'true',
+                                       userAssignable: data.userAssignable === true || data.userAssignable === 'true',
+                                       canAssign: data.canAssign === true || data.canAssign === 'true',
+                               }
+                       },
+               })
+
+       OC.SystemTags = OC.SystemTags || {}
+       OC.SystemTags.SystemTagModel = SystemTagModel
+})(OC)
diff --git a/core/src/systemtags/systemtags.js b/core/src/systemtags/systemtags.js
new file mode 100644 (file)
index 0000000..676f1b8
--- /dev/null
@@ -0,0 +1,54 @@
+/* eslint-disable */
+/*
+ * Copyright (c) 2016
+ *
+ * This file is licensed under the Affero General Public License version 3
+ * or later.
+ *
+ * See the COPYING-README file.
+ *
+ */
+
+import escapeHTML from 'escape-html'
+
+(function(OC) {
+       /**
+        * @namespace
+        */
+       OC.SystemTags = {
+               /**
+                *
+                * @param {OC.SystemTags.SystemTagModel|Object|String} tag
+                * @returns {jQuery}
+                */
+               getDescriptiveTag: function(tag) {
+                       if (_.isUndefined(tag.name) && !_.isUndefined(tag.toJSON)) {
+                               tag = tag.toJSON()
+                       }
+
+                       if (_.isUndefined(tag.name)) {
+                               return $('<span>').addClass('non-existing-tag').text(
+                                       t('core', 'Non-existing tag #{tag}', {
+                                               tag: tag
+                                       })
+                               )
+                       }
+
+                       var $span = $('<span>')
+                       $span.append(escapeHTML(tag.name))
+
+                       var scope
+                       if (!tag.userAssignable) {
+                               scope = t('core', 'restricted')
+                       }
+                       if (!tag.userVisible) {
+                               // invisible also implicitly means not assignable
+                               scope = t('core', 'invisible')
+                       }
+                       if (scope) {
+                               $span.append($('<em>').text(' (' + scope + ')'))
+                       }
+                       return $span
+               }
+       }
+})(OC)
diff --git a/core/src/systemtags/systemtagscollection.js b/core/src/systemtags/systemtagscollection.js
new file mode 100644 (file)
index 0000000..fe3f286
--- /dev/null
@@ -0,0 +1,89 @@
+/* eslint-disable */
+/*
+ * Copyright (c) 2015
+ *
+ * This file is licensed under the Affero General Public License version 3
+ * or later.
+ *
+ * See the COPYING-README file.
+ *
+ */
+
+(function(OC) {
+
+       function filterFunction(model, term) {
+               return model.get('name').substr(0, term.length).toLowerCase() === term.toLowerCase()
+       }
+
+       /**
+        * @class OCA.SystemTags.SystemTagsCollection
+        * @classdesc
+        *
+        * Collection of tags assigned to a file
+        *
+        */
+       var SystemTagsCollection = OC.Backbone.Collection.extend(
+               /** @lends OC.SystemTags.SystemTagsCollection.prototype */ {
+
+                       sync: OC.Backbone.davSync,
+
+                       model: OC.SystemTags.SystemTagModel,
+
+                       url: function() {
+                               return OC.linkToRemote('dav') + '/systemtags/'
+                       },
+
+                       filterByName: function(name) {
+                               return this.filter(function(model) {
+                                       return filterFunction(model, name)
+                               })
+                       },
+
+                       reset: function() {
+                               this.fetched = false
+                               return OC.Backbone.Collection.prototype.reset.apply(this, arguments)
+                       },
+
+                       /**
+                * Lazy fetch.
+                * Only fetches once, subsequent calls will directly call the success handler.
+                *
+                * @param options
+                * @param [options.force] true to force fetch even if cached entries exist
+                *
+                * @see Backbone.Collection#fetch
+                */
+                       fetch: function(options) {
+                               var self = this
+                               options = options || {}
+                               if (this.fetched || options.force) {
+                               // directly call handler
+                                       if (options.success) {
+                                               options.success(this, null, options)
+                                       }
+                                       // trigger sync event
+                                       this.trigger('sync', this, null, options)
+                                       return Promise.resolve()
+                               }
+
+                               var success = options.success
+                               options = _.extend({}, options)
+                               options.success = function() {
+                                       self.fetched = true
+                                       if (success) {
+                                               return success.apply(this, arguments)
+                                       }
+                               }
+
+                               return OC.Backbone.Collection.prototype.fetch.call(this, options)
+                       }
+               })
+
+       OC.SystemTags = OC.SystemTags || {}
+       OC.SystemTags.SystemTagsCollection = SystemTagsCollection
+
+       /**
+        * @type OC.SystemTags.SystemTagsCollection
+        */
+       OC.SystemTags.collection = new OC.SystemTags.SystemTagsCollection()
+})(OC)
diff --git a/core/src/systemtags/systemtagsinputfield.js b/core/src/systemtags/systemtagsinputfield.js
new file mode 100644 (file)
index 0000000..d05ac58
--- /dev/null
@@ -0,0 +1,448 @@
+/* eslint-disable */
+/*
+ * Copyright (c) 2015
+ *
+ * This file is licensed under the Affero General Public License version 3
+ * or later.
+ *
+ * See the COPYING-README file.
+ *
+ */
+
+import templateResult from './templates/result.handlebars'
+import templateResultForm from './templates/result_form.handlebars'
+import templateSelection from './templates/selection.handlebars'
+
+(function(OC) {
+
+       /**
+        * @class OC.SystemTags.SystemTagsInputField
+        * @classdesc
+        *
+        * Displays a file's system tags
+        *
+        */
+       var SystemTagsInputField = OC.Backbone.View.extend(
+               /** @lends OC.SystemTags.SystemTagsInputField.prototype */ {
+
+                       _rendered: false,
+
+                       _newTag: null,
+
+                       _lastUsedTags: [],
+
+                       className: 'systemTagsInputFieldContainer',
+
+                       template: function(data) {
+                               return '<input class="systemTagsInputField" type="hidden" name="tags" value=""/>'
+                       },
+
+                       /**
+                * Creates a new SystemTagsInputField
+                *
+                * @param {Object} [options]
+                * @param {string} [options.objectType=files] object type for which tags are assigned to
+                * @param {bool} [options.multiple=false] whether to allow selecting multiple tags
+                * @param {bool} [options.allowActions=true] whether tags can be renamed/delete within the dropdown
+                * @param {bool} [options.allowCreate=true] whether new tags can be created
+                * @param {bool} [options.isAdmin=true] whether the user is an administrator
+                * @param {Function} options.initSelection function to convert selection to data
+                */
+                       initialize: function(options) {
+                               options = options || {}
+
+                               this._multiple = !!options.multiple
+                               this._allowActions = _.isUndefined(options.allowActions) || !!options.allowActions
+                               this._allowCreate = _.isUndefined(options.allowCreate) || !!options.allowCreate
+                               this._isAdmin = !!options.isAdmin
+
+                               if (_.isFunction(options.initSelection)) {
+                                       this._initSelection = options.initSelection
+                               }
+
+                               this.collection = options.collection || OC.SystemTags.collection
+
+                               var self = this
+                               this.collection.on('change:name remove', function() {
+                               // refresh selection
+                                       _.defer(self._refreshSelection)
+                               })
+
+                               _.defer(_.bind(this._getLastUsedTags, this))
+
+                               _.bindAll(
+                                       this,
+                                       '_refreshSelection',
+                                       '_onClickRenameTag',
+                                       '_onClickDeleteTag',
+                                       '_onSelectTag',
+                                       '_onDeselectTag',
+                                       '_onSubmitRenameTag'
+                               )
+                       },
+
+                       _getLastUsedTags: function() {
+                               var self = this
+                               $.ajax({
+                                       type: 'GET',
+                                       url: OC.generateUrl('/apps/systemtags/lastused'),
+                                       success: function(response) {
+                                               self._lastUsedTags = response
+                                       }
+                               })
+                       },
+
+                       /**
+                * Refreshes the selection, triggering a call to
+                * select2's initSelection
+                */
+                       _refreshSelection: function() {
+                               this.$tagsField.select2('val', this.$tagsField.val())
+                       },
+
+                       /**
+                * Event handler whenever the user clicked the "rename" action.
+                * This will display the rename field.
+                */
+                       _onClickRenameTag: function(ev) {
+                               var $item = $(ev.target).closest('.systemtags-item')
+                               var tagId = $item.attr('data-id')
+                               var tagModel = this.collection.get(tagId)
+
+                               var oldName = tagModel.get('name')
+                               var $renameForm = $(templateResultForm({
+                                       cid: this.cid,
+                                       name: oldName,
+                                       deleteTooltip: t('core', 'Delete'),
+                                       renameLabel: t('core', 'Rename'),
+                                       isAdmin: this._isAdmin
+                               }))
+                               $item.find('.label').after($renameForm)
+                               $item.find('.label, .systemtags-actions').addClass('hidden')
+                               $item.closest('.select2-result').addClass('has-form')
+
+                               $renameForm.find('[title]').tooltip({
+                                       placement: 'bottom',
+                                       container: 'body'
+                               })
+                               $renameForm.find('input').focus().selectRange(0, oldName.length)
+                               return false
+                       },
+
+                       /**
+                * Event handler whenever the rename form has been submitted after
+                * the user entered a new tag name.
+                * This will submit the change to the server.
+                *
+                * @param {Object} ev event
+                */
+                       _onSubmitRenameTag: function(ev) {
+                               ev.preventDefault()
+                               var $form = $(ev.target)
+                               var $item = $form.closest('.systemtags-item')
+                               var tagId = $item.attr('data-id')
+                               var tagModel = this.collection.get(tagId)
+                               var newName = $(ev.target).find('input').val().trim()
+                               if (newName && newName !== tagModel.get('name')) {
+                                       tagModel.save({ 'name': newName })
+                                       // TODO: spinner, and only change text after finished saving
+                                       $item.find('.label').text(newName)
+                               }
+                               $item.find('.label, .systemtags-actions').removeClass('hidden')
+                               $form.remove()
+                               $item.closest('.select2-result').removeClass('has-form')
+                       },
+
+                       /**
+                * Event handler whenever a tag must be deleted
+                *
+                * @param {Object} ev event
+                */
+                       _onClickDeleteTag: function(ev) {
+                               var $item = $(ev.target).closest('.systemtags-item')
+                               var tagId = $item.attr('data-id')
+                               this.collection.get(tagId).destroy()
+                               $(ev.target).tooltip('hide')
+                               $item.closest('.select2-result').remove()
+                               // TODO: spinner
+                               return false
+                       },
+
+                       _addToSelect2Selection: function(selection) {
+                               var data = this.$tagsField.select2('data')
+                               data.push(selection)
+                               this.$tagsField.select2('data', data)
+                       },
+
+                       /**
+                * Event handler whenever a tag is selected.
+                * Also called whenever tag creation is requested through the dummy tag object.
+                *
+                * @param {Object} e event
+                */
+                       _onSelectTag: function(e) {
+                               var self = this
+                               var tag
+                               if (e.object && e.object.isNew) {
+                               // newly created tag, check if existing
+                               // create a new tag
+                                       tag = this.collection.create({
+                                               name: e.object.name.trim(),
+                                               userVisible: true,
+                                               userAssignable: true,
+                                               canAssign: true
+                                       }, {
+                                               success: function(model) {
+                                                       self._addToSelect2Selection(model.toJSON())
+                                                       self._lastUsedTags.unshift(model.id)
+                                                       self.trigger('select', model)
+                                               },
+                                               error: function(model, xhr) {
+                                                       if (xhr.status === 409) {
+                                                       // re-fetch collection to get the missing tag
+                                                               self.collection.reset()
+                                                               self.collection.fetch({
+                                                                       success: function(collection) {
+                                                                       // find the tag in the collection
+                                                                               var model = collection.where({
+                                                                                       name: e.object.name.trim(),
+                                                                                       userVisible: true,
+                                                                                       userAssignable: true
+                                                                               })
+                                                                               if (model.length) {
+                                                                                       model = model[0]
+                                                                                       // the tag already exists or was already assigned,
+                                                                                       // add it to the list anyway
+                                                                                       self._addToSelect2Selection(model.toJSON())
+                                                                                       self.trigger('select', model)
+                                                                               }
+                                                                       }
+                                                               })
+                                                       }
+                                               }
+                                       })
+                                       this.$tagsField.select2('close')
+                                       e.preventDefault()
+                                       return false
+                               } else {
+                                       tag = this.collection.get(e.object.id)
+                                       this._lastUsedTags.unshift(tag.id)
+                               }
+                               this._newTag = null
+                               this.trigger('select', tag)
+                       },
+
+                       /**
+                * Event handler whenever a tag gets deselected.
+                *
+                * @param {Object} e event
+                */
+                       _onDeselectTag: function(e) {
+                               this.trigger('deselect', e.choice.id)
+                       },
+
+                       /**
+                * Autocomplete function for dropdown results
+                *
+                * @param {Object} query select2 query object
+                */
+                       _queryTagsAutocomplete: function(query) {
+                               var self = this
+                               this.collection.fetch({
+                                       success: function(collection) {
+                                               var tagModels = collection.filterByName(query.term.trim())
+                                               if (!self._isAdmin) {
+                                                       tagModels = _.filter(tagModels, function(tagModel) {
+                                                               return tagModel.get('canAssign')
+                                                       })
+                                               }
+                                               query.callback({
+                                                       results: _.invoke(tagModels, 'toJSON')
+                                               })
+                                       }
+                               })
+                       },
+
+                       _preventDefault: function(e) {
+                               e.stopPropagation()
+                       },
+
+                       /**
+                * Formats a single dropdown result
+                *
+                * @param {Object} data data to format
+                * @returns {string} HTML markup
+                */
+                       _formatDropDownResult: function(data) {
+                               return templateResult(_.extend({
+                                       renameTooltip: t('core', 'Rename'),
+                                       allowActions: this._allowActions,
+                                       tagMarkup: this._isAdmin ? OC.SystemTags.getDescriptiveTag(data)[0].innerHTML : null,
+                                       isAdmin: this._isAdmin
+                               }, data))
+                       },
+
+                       /**
+                * Formats a single selection item
+                *
+                * @param {Object} data data to format
+                * @returns {string} HTML markup
+                */
+                       _formatSelection: function(data) {
+                               return templateSelection(_.extend({
+                                       tagMarkup: this._isAdmin ? OC.SystemTags.getDescriptiveTag(data)[0].innerHTML : null,
+                                       isAdmin: this._isAdmin
+                               }, data))
+                       },
+
+                       /**
+                * Create new dummy choice for select2 when the user
+                * types an arbitrary string
+                *
+                * @param {string} term entered term
+                * @returns {Object} dummy tag
+                */
+                       _createSearchChoice: function(term) {
+                               term = term.trim()
+                               if (this.collection.filter(function(entry) {
+                                       return entry.get('name') === term
+                               }).length) {
+                                       return
+                               }
+                               if (!this._newTag) {
+                                       this._newTag = {
+                                               id: -1,
+                                               name: term,
+                                               userAssignable: true,
+                                               userVisible: true,
+                                               canAssign: true,
+                                               isNew: true
+                                       }
+                               } else {
+                                       this._newTag.name = term
+                               }
+
+                               return this._newTag
+                       },
+
+                       _initSelection: function(element, callback) {
+                               var self = this
+                               var ids = $(element).val().split(',')
+
+                               function modelToSelection(model) {
+                                       var data = model.toJSON()
+                                       if (!self._isAdmin && !data.canAssign) {
+                                       // lock static tags for non-admins
+                                               data.locked = true
+                                       }
+                                       return data
+                               }
+
+                               function findSelectedObjects(ids) {
+                                       var selectedModels = self.collection.filter(function(model) {
+                                               return ids.indexOf(model.id) >= 0 && (self._isAdmin || model.get('userVisible'))
+                                       })
+                                       return _.map(selectedModels, modelToSelection)
+                               }
+
+                               this.collection.fetch({
+                                       success: function() {
+                                               callback(findSelectedObjects(ids))
+                                       }
+                               })
+                       },
+
+                       /**
+                * Renders this details view
+                */
+                       render: function() {
+                               var self = 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: false,
+                                       allowClear: false,
+                                       multiple: this._multiple,
+                                       toggleSelect: this._multiple,
+                                       query: _.bind(this._queryTagsAutocomplete, this),
+                                       id: function(tag) {
+                                               return tag.id
+                                       },
+                                       initSelection: _.bind(this._initSelection, this),
+                                       formatResult: _.bind(this._formatDropDownResult, this),
+                                       formatSelection: _.bind(this._formatSelection, this),
+                                       createSearchChoice: this._allowCreate ? _.bind(this._createSearchChoice, this) : undefined,
+                                       sortResults: function(results) {
+                                               var selectedItems = _.pluck(self.$tagsField.select2('data'), 'id')
+                                               results.sort(function(a, b) {
+                                                       var aSelected = selectedItems.indexOf(a.id) >= 0
+                                                       var bSelected = selectedItems.indexOf(b.id) >= 0
+                                                       if (aSelected === bSelected) {
+                                                               var aLastUsed = self._lastUsedTags.indexOf(a.id)
+                                                               var bLastUsed = self._lastUsedTags.indexOf(b.id)
+
+                                                               if (aLastUsed !== bLastUsed) {
+                                                                       if (bLastUsed === -1) {
+                                                                               return -1
+                                                                       }
+                                                                       if (aLastUsed === -1) {
+                                                                               return 1
+                                                                       }
+                                                                       return aLastUsed < bLastUsed ? -1 : 1
+                                                               }
+
+                                                               // Both not found
+                                                               return OC.Util.naturalSortCompare(a.name, b.name)
+                                                       }
+                                                       if (aSelected && !bSelected) {
+                                                               return -1
+                                                       }
+                                                       return 1
+                                               })
+                                               return results
+                                       },
+                                       formatNoMatches: function() {
+                                               return t('core', 'No tags found')
+                                       }
+                               })
+                                       .on('select2-selecting', this._onSelectTag)
+                                       .on('select2-removing', this._onDeselectTag)
+
+                               var $dropDown = this.$tagsField.select2('dropdown')
+                               // register events for inside the dropdown
+                               $dropDown.on('mouseup', '.rename', this._onClickRenameTag)
+                               $dropDown.on('mouseup', '.delete', this._onClickDeleteTag)
+                               $dropDown.on('mouseup', '.select2-result-selectable.has-form', this._preventDefault)
+                               $dropDown.on('submit', '.systemtags-rename-form', this._onSubmitRenameTag)
+
+                               this.delegateEvents()
+                       },
+
+                       remove: function() {
+                               if (this.$tagsField) {
+                                       this.$tagsField.select2('destroy')
+                               }
+                       },
+
+                       getValues: function() {
+                               this.$tagsField.select2('val')
+                       },
+
+                       setValues: function(values) {
+                               this.$tagsField.select2('val', values)
+                       },
+
+                       setData: function(data) {
+                               this.$tagsField.select2('data', data)
+                       }
+               })
+
+       OC.SystemTags = OC.SystemTags || {}
+       OC.SystemTags.SystemTagsInputField = SystemTagsInputField
+
+})(OC)
diff --git a/core/src/systemtags/systemtagsmappingcollection.js b/core/src/systemtags/systemtagsmappingcollection.js
new file mode 100644 (file)
index 0000000..834ba57
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2015
+ *
+ * This file is licensed under the Affero General Public License version 3
+ * or later.
+ *
+ * See the COPYING-README file.
+ *
+ */
+
+(function(OC) {
+       /**
+        * @class OC.SystemTags.SystemTagsMappingCollection
+        * @classdesc
+        *
+        * Collection of tags assigned to a an object
+        *
+        */
+       const SystemTagsMappingCollection = OC.Backbone.Collection.extend(
+               /** @lends OC.SystemTags.SystemTagsMappingCollection.prototype */ {
+
+                       sync: OC.Backbone.davSync,
+
+                       /**
+                * Use PUT instead of PROPPATCH
+                */
+                       usePUT: true,
+
+                       /**
+                * Id of the file for which to filter activities by
+                *
+                * @var int
+                */
+                       _objectId: null,
+
+                       /**
+                * Type of the object to filter by
+                *
+                * @var string
+                */
+                       _objectType: 'files',
+
+                       model: OC.SystemTags.SystemTagModel,
+
+                       url: function() {
+                               return OC.linkToRemote('dav') + '/systemtags-relations/' + this._objectType + '/' + this._objectId
+                       },
+
+                       /**
+                * Sets the object id to filter by or null for all.
+                *
+                * @param {int} objectId file id or null
+                */
+                       setObjectId: function(objectId) {
+                               this._objectId = objectId
+                       },
+
+                       /**
+                * Sets the object type to filter by or null for all.
+                *
+                * @param {int} objectType file id or null
+                */
+                       setObjectType: function(objectType) {
+                               this._objectType = objectType
+                       },
+
+                       initialize: function(models, options) {
+                               options = options || {}
+                               if (!_.isUndefined(options.objectId)) {
+                                       this._objectId = options.objectId
+                               }
+                               if (!_.isUndefined(options.objectType)) {
+                                       this._objectType = options.objectType
+                               }
+                       },
+
+                       getTagIds: function() {
+                               return this.map(function(model) {
+                                       return model.id
+                               })
+                       },
+               })
+
+       OC.SystemTags = OC.SystemTags || {}
+       OC.SystemTags.SystemTagsMappingCollection = SystemTagsMappingCollection
+})(OC)
diff --git a/core/src/systemtags/templates/result.handlebars b/core/src/systemtags/templates/result.handlebars
new file mode 100644 (file)
index 0000000..faa7cc4
--- /dev/null
@@ -0,0 +1,13 @@
+<span class="systemtags-item{{#if isNew}} new-item{{/if}}" data-id="{{id}}">
+<span class="checkmark icon icon-checkmark"></span>
+       {{#if isAdmin}}
+               <span class="label">{{{tagMarkup}}}</span>
+       {{else}}
+               <span class="label">{{name}}</span>
+       {{/if}}
+       {{#allowActions}}
+               <span class="systemtags-actions">
+                       <a href="#" class="rename icon icon-rename" title="{{renameTooltip}}"></a>
+               </span>
+       {{/allowActions}}
+</span>
diff --git a/core/src/systemtags/templates/result_form.handlebars b/core/src/systemtags/templates/result_form.handlebars
new file mode 100644 (file)
index 0000000..28fe8c5
--- /dev/null
@@ -0,0 +1,7 @@
+<form class="systemtags-rename-form">
+        <label class="hidden-visually" for="{{cid}}-rename-input">{{renameLabel}}</label>
+       <input id="{{cid}}-rename-input" type="text" value="{{name}}">
+       {{#if isAdmin}}
+               <a href="#" class="delete icon icon-delete" title="{{deleteTooltip}}"></a>
+       {{/if}}
+</form>
diff --git a/core/src/systemtags/templates/selection.handlebars b/core/src/systemtags/templates/selection.handlebars
new file mode 100644 (file)
index 0000000..b006b12
--- /dev/null
@@ -0,0 +1,5 @@
+{{#if isAdmin}}
+       <span class="label">{{{tagMarkup}}}</span>
+{{else}}
+       <span class="label">{{name}}</span>
+{{/if}}
index 7cb6e19396fede26272d501376700f07dc6f1555..303d6f67dfc93eddcbd0d70bb4d2bb9792c95ae7 100644 (file)
@@ -36,7 +36,7 @@ module.exports = [
        },
        {
                entry: {
-                       systemtags: path.resolve(__dirname, 'js/systemtags/merged-systemtags.js')
+                       systemtags: path.resolve(__dirname, 'src/systemtags/merged-systemtags.js')
                },
                output: {
                        filename: '[name].js',
index 0dca3bc8a583df881c33c08efca74a6758c0a47b..18c18f0b7b91bd0bb4a67e1c3b927567e658cbd9 100644 (file)
@@ -129,6 +129,7 @@ module.exports = function(config) {
        files.push('core/js/dist/main.js');
        files.push('core/js/dist/files_fileinfo.js');
        files.push('core/js/dist/files_client.js');
+       files.push('core/js/dist/systemtags.js');
        // core mocks
        files.push(corePath + 'tests/specHelper.js');