From 0357a30a58fd212ad5f0b4837d3f62bd1f57ddfc Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 13 Feb 2019 22:54:48 +0100 Subject: [PATCH] Move systemtags to common webpack Signed-off-by: Roeland Jago Douma --- .gitattributes | 2 + apps/systemtags/.l10nignore | 2 + apps/systemtags/appinfo/app.php | 3 +- apps/systemtags/js/merged.json | 7 ---- apps/systemtags/js/systemtags.js | 23 ++++++++++++ apps/systemtags/js/systemtags.js.map | 1 + apps/systemtags/{js => src}/app.js | 0 .../{ => src}/css/systemtagsfilelist.scss | 0 apps/systemtags/{js => src}/filesplugin.js | 0 apps/systemtags/src/systemtags.js | 8 ++++ .../{js => src}/systemtagsfilelist.js | 0 .../{js => src}/systemtagsinfoview.js | 0 .../systemtagsinfoviewtoggleview.js | 0 apps/systemtags/webpack.js | 37 +++++++++++++++++++ webpack.common.js | 5 ++- 15 files changed, 78 insertions(+), 10 deletions(-) create mode 100644 apps/systemtags/.l10nignore delete mode 100644 apps/systemtags/js/merged.json create mode 100644 apps/systemtags/js/systemtags.js create mode 100644 apps/systemtags/js/systemtags.js.map rename apps/systemtags/{js => src}/app.js (100%) rename apps/systemtags/{ => src}/css/systemtagsfilelist.scss (100%) rename apps/systemtags/{js => src}/filesplugin.js (100%) create mode 100644 apps/systemtags/src/systemtags.js rename apps/systemtags/{js => src}/systemtagsfilelist.js (100%) rename apps/systemtags/{js => src}/systemtagsinfoview.js (100%) rename apps/systemtags/{js => src}/systemtagsinfoviewtoggleview.js (100%) create mode 100644 apps/systemtags/webpack.js diff --git a/.gitattributes b/.gitattributes index 09c78fbd5b..aaa918cb2e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,6 +7,8 @@ /apps/files_versions/js/files_versions.js.map binary /apps/oauth2/js/oauth2.js binary /apps/oauth2/js/oauth2.js.map binary +/apps/systemtags/js/systemtags.js binary +/apps/systemtags/js/systemtags.js.map binary /apps/twofactor_backupcodes/js/*.js binary /apps/twofactor_backupcodes/js/*.js.map binary /apps/updatenotification/js/updatenotification.js binary diff --git a/apps/systemtags/.l10nignore b/apps/systemtags/.l10nignore new file mode 100644 index 0000000000..3fb1c8d4ad --- /dev/null +++ b/apps/systemtags/.l10nignore @@ -0,0 +1,2 @@ +#webpack bundled files +js/systemtags.js diff --git a/apps/systemtags/appinfo/app.php b/apps/systemtags/appinfo/app.php index 0fcf413486..82eb2a29f4 100644 --- a/apps/systemtags/appinfo/app.php +++ b/apps/systemtags/appinfo/app.php @@ -34,8 +34,7 @@ $eventDispatcher->addListener( function() { // FIXME: no public API for these ? \OCP\Util::addScript('dist/systemtags'); - \OCP\Util::addScript('systemtags', 'merged'); - \OCP\Util::addStyle('systemtags', 'systemtagsfilelist'); + \OCP\Util::addScript('systemtags', 'systemtags'); } ); diff --git a/apps/systemtags/js/merged.json b/apps/systemtags/js/merged.json deleted file mode 100644 index 632abf6777..0000000000 --- a/apps/systemtags/js/merged.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "app.js", - "systemtagsfilelist.js", - "filesplugin.js", - "systemtagsinfoview.js", - "systemtagsinfoviewtoggleview.js" -] diff --git a/apps/systemtags/js/systemtags.js b/apps/systemtags/js/systemtags.js new file mode 100644 index 0000000000..3b6c964837 --- /dev/null +++ b/apps/systemtags/js/systemtags.js @@ -0,0 +1,23 @@ +!function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/js/",i(i.s=0)}([function(e,t,i){"use strict";i.r(t);i(1),i(2),i(3),i(4),i(5),i(6);window.OCA.SystemTags=OCA.SystemTags},function(e,i){OCA.SystemTags||(OCA.SystemTags={}),OCA.SystemTags.App={initFileList:function(e){return this._fileList?this._fileList:(this._fileList=new OCA.SystemTags.FileList(e,{id:"systemtags",fileActions:this._createFileActions(),config:OCA.Files.App.getFilesConfig(),shown:!0}),this._fileList.appName=t("systemtags","Tags"),this._fileList)},removeFileList:function(){this._fileList&&this._fileList.$fileList.empty()},_createFileActions:function(){var e=new OCA.Files.FileActions;return e.registerDefaultActions(),e.merge(OCA.Files.fileActions),this._globalActionsInitialized||(this._onActionsUpdated=_.bind(this._onActionsUpdated,this),OCA.Files.fileActions.on("setDefault.app-systemtags",this._onActionsUpdated),OCA.Files.fileActions.on("registerAction.app-systemtags",this._onActionsUpdated),this._globalActionsInitialized=!0),e.register("dir","Open",OC.PERMISSION_READ,"",function(e,t){OCA.Files.App.setActiveView("files",{silent:!0}),OCA.Files.App.fileList.changeDirectory(OC.joinPaths(t.$file.attr("data-path"),e),!0,!0)}),e.setDefault("dir","Open"),e},_onActionsUpdated:function(e){this._fileList&&(e.action?this._fileList.fileActions.registerAction(e.action):e.defaultAction&&this._fileList.fileActions.setDefault(e.defaultAction.mime,e.defaultAction.name))},destroy:function(){OCA.Files.fileActions.off("setDefault.app-systemtags",this._onActionsUpdated),OCA.Files.fileActions.off("registerAction.app-systemtags",this._onActionsUpdated),this.removeFileList(),this._fileList=null,delete this._globalActionsInitialized}},$(document).ready(function(){$("#app-content-systemtagsfilter").on("show",function(e){OCA.SystemTags.App.initFileList($(e.target))}),$("#app-content-systemtagsfilter").on("hide",function(){OCA.SystemTags.App.removeFileList()})})},function(e,i){var n;(n=function(e,t){this.initialize(e,t)}).prototype=_.extend({},OCA.Files.FileList.prototype,{id:"systemtagsfilter",appName:t("systemtags","Tagged files"),_systemTagIds:[],_lastUsedTags:[],_clientSideSort:!0,_allowSelection:!1,_filterField:null,initialize:function(e,t){if(OCA.Files.FileList.prototype.initialize.apply(this,arguments),!this.initialized){t&&t.systemTagIds&&(this._systemTagIds=t.systemTagIds),OC.Plugins.attach("OCA.SystemTags.FileList",this);var i=this.$el.find("#controls").empty();_.defer(_.bind(this._getLastUsedTags,this)),this._initFilterField(i)}},destroy:function(){this.$filterField.remove(),OCA.Files.FileList.prototype.destroy.apply(this,arguments)},_getLastUsedTags:function(){var e=this;$.ajax({type:"GET",url:OC.generateUrl("/apps/systemtags/lastused"),success:function(t){e._lastUsedTags=t}})},_initFilterField:function(e){var i=this;return this.$filterField=$(''),e.append(this.$filterField),this.$filterField.select2({placeholder:t("systemtags","Select tags to filter by"),allowClear:!1,multiple:!0,toggleSelect:!0,separator:",",query:_.bind(this._queryTagsAutocomplete,this),id:function(e){return e.id},initSelection:function(e,t){var i=$(e).val().trim();if(i){var n=i.split(","),s=[];OC.SystemTags.collection.fetch({success:function(){_.each(n,function(e){var t=OC.SystemTags.collection.get(e);_.isUndefined(t)||s.push(t.toJSON())}),t(s)}})}else t([])},formatResult:function(e){return OC.SystemTags.getDescriptiveTag(e)},formatSelection:function(e){return OC.SystemTags.getDescriptiveTag(e)[0].outerHTML},sortResults:function(e){return e.sort(function(e,t){var n=i._lastUsedTags.indexOf(e.id),s=i._lastUsedTags.indexOf(t.id);return n!==s?-1===s?-1:-1===n?1:n

'+t("systemtags","No files found for the selected tags")+"

"):this.$el.find("#emptycontent").html('

'+t("systemtags","Please select tags to filter by")+"

"),this.$el.find("#emptycontent").toggleClass("hidden",!this.isEmpty),this.$el.find("#filestable thead th").toggleClass("hidden",this.isEmpty)):OCA.Files.FileList.prototype.updateEmptyContent.apply(this,arguments)},getDirectoryPermissions:function(){return OC.PERMISSION_READ|OC.PERMISSION_DELETE},updateStorageStatistics:function(){},reload:function(){if(this._setCurrentDir("/",!1),!this._systemTagIds.length)return this.updateEmptyContent(),this.setFiles([]),$.Deferred().resolve();this._selectedFiles={},this._selectionSummary.clear(),this._currentFileModel&&this._currentFileModel.off(),this._currentFileModel=null,this.$el.find(".select-all").prop("checked",!1),this.showMask(),this._reloadCall=this.filesClient.getFilteredFiles({systemTagIds:this._systemTagIds},{properties:this._getWebdavProperties()}),this._detailsView&&this._updateDetailsView(null);var e=this.reloadCallback.bind(this);return this._reloadCall.then(e,e)},reloadCallback:function(e,t){return t&&t.unshift({}),OCA.Files.FileList.prototype.reloadCallback.call(this,e,t)}}),OCA.SystemTags.FileList=n},function(e,t){OCA.SystemTags=_.extend({},OCA.SystemTags),OCA.SystemTags||(OCA.SystemTags={}),OCA.SystemTags.FilesPlugin={ignoreLists:["files_trashbin","files.public"],attach:function(e){if(!(this.ignoreLists.indexOf(e.id)>=0)){var t=new OCA.SystemTags.SystemTagsInfoView;e.registerDetailView(t),_.each(e.getRegisteredDetailViews(),function(e){if(e instanceof OCA.Files.MainFileInfoDetailView){var i=new OCA.SystemTags.SystemTagsInfoViewToggleView({systemTagsInfoView:t});return i.render(),i.listenTo(e,"pre-render",function(){i.$el.detach()}),void i.listenTo(e,"post-render",function(){e.$el.find(".file-details").append(i.$el)})}})}}},OC.Plugins.register("OCA.Files.FileList",OCA.SystemTags.FilesPlugin)},function(e,t){!function(e){function t(e){var t=e.toJSON();return OC.isUserAdmin()||t.canAssign||(t.locked=!0),t}var i=e.Files.DetailFileInfoView.extend({_rendered:!1,className:"systemTagsInfoView hidden",_inputView:null,initialize:function(e){var i=this;e=e||{},this._inputView=new OC.SystemTags.SystemTagsInputField({multiple:!0,allowActions:!0,allowCreate:!0,isAdmin:OC.isUserAdmin(),initSelection:function(e,n){n(i.selectedTagsCollection.map(t))}}),this.selectedTagsCollection=new OC.SystemTags.SystemTagsMappingCollection([],{objectType:"files"}),this._inputView.collection.on("change:name",this._onTagRenamedGlobally,this),this._inputView.collection.on("remove",this._onTagDeletedGlobally,this),this._inputView.on("select",this._onSelectTag,this),this._inputView.on("deselect",this._onDeselectTag,this)},_onSelectTag:function(e){this.selectedTagsCollection.create(e.toJSON())},_onDeselectTag:function(e){this.selectedTagsCollection.get(e).destroy()},_onTagRenamedGlobally:function(e){var t=this.selectedTagsCollection.get(e.id);t&&t.set(e.toJSON())},_onTagDeletedGlobally:function(e){this.selectedTagsCollection.remove(e)},setFileInfo:function(e){var i=this;this._rendered||this.render(),e&&(this.selectedTagsCollection.setObjectId(e.id),this.selectedTagsCollection.fetch({success:function(e){e.fetched=!0;var n=e.map(t);i._inputView.setData(n),0!==n.length?i.show():i.hide()}})),this.hide()},render:function(){this.$el.append(this._inputView.$el),this._inputView.render()},isVisible:function(){return!this.$el.hasClass("hidden")},show:function(){this.$el.removeClass("hidden")},hide:function(){this.$el.addClass("hidden")},openDropdown:function(){this.$el.find(".systemTagsInputField").select2("open")},remove:function(){this._inputView.remove()}});e.SystemTags.SystemTagsInfoView=i}(OCA)},function(e,i){ +/** + * + * @copyright Copyright (c) 2017, Daniel Calviño Sánchez (danxuliu@gmail.com) + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +!function(e){var i=OC.Backbone.View.extend({tagName:"span",className:"tag-label",events:{click:"click"},_systemTagsInfoView:null,template:function(e){return''+t("systemtags","Tags")},initialize:function(e){if(e=e||{},this._systemTagsInfoView=e.systemTagsInfoView,!this._systemTagsInfoView)throw'Missing required parameter "systemTagsInfoView"'},click:function(){this._systemTagsInfoView.isVisible()?this._systemTagsInfoView.hide():(this._systemTagsInfoView.show(),this._systemTagsInfoView.openDropdown())},render:function(){return this.$el.html(this.template()),this}});e.SystemTags.SystemTagsInfoViewToggleView=i}(OCA)},function(e,t,i){var n=i(7);"string"==typeof n&&(n=[[e.i,n,""]]);var s={hmr:!0,transform:void 0,insertInto:void 0};i(9)(n,s);n.locals&&(e.exports=n.locals)},function(e,t,i){(e.exports=i(8)(!1)).push([e.i,"/*\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#app-content-systemtagsfilter .select2-container {\n width: 30%;\n margin-left: 10px; }\n\n#app-sidebar .mainFileInfoView .tag-label {\n cursor: pointer;\n padding: 13px; }\n\n#app-sidebar .mainFileInfoView .icon-tag {\n opacity: .5;\n vertical-align: middle; }\n",""])},function(e,t,i){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var i=function(e,t){var i=e[1]||"",n=e[3];if(!n)return i;if(t&&"function"==typeof btoa){var s=(r=n,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),o=n.sources.map(function(e){return"/*# sourceURL="+n.sourceRoot+e+" */"});return[i].concat(o).concat([s]).join("\n")}var r;return[i].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+i+"}":i}).join("")},t.i=function(e,i){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},s=0;s=0&&f.splice(t,1)}function m(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var n=function(){0;return i.nc}();n&&(e.attrs.nonce=n)}return y(t,e.attrs),h(e,t),t}function y(e,t){Object.keys(t).forEach(function(i){e.setAttribute(i,t[i])})}function v(e,t){var i,n,s,o;if(t.transform&&e.css){if(!(o="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=o}if(t.singleton){var r=c++;i=l||(l=m(t)),n=C.bind(null,i,r,!1),s=C.bind(null,i,r,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(i=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",y(t,e.attrs),h(e,t),t}(t),n=function(e,t,i){var n=i.css,s=i.sourceMap,o=void 0===t.convertToAbsoluteUrls&&s;(t.convertToAbsoluteUrls||o)&&(n=u(n));s&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */");var r=new Blob([n],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(r),a&&URL.revokeObjectURL(a)}.bind(null,i,t),s=function(){g(i),i.href&&URL.revokeObjectURL(i.href)}):(i=m(t),n=function(e,t){var i=t.css,n=t.media;n&&e.setAttribute("media",n);if(e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}.bind(null,i),s=function(){g(i)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else s()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=r()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var i=p(e,t);return d(i,t),function(e){for(var n=[],s=0;s\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() {\n\tif (!OCA.SystemTags) {\n\t\t/**\n\t\t * @namespace\n\t\t */\n\t\tOCA.SystemTags = {};\n\t}\n\n\tOCA.SystemTags.App = {\n\n\t\tinitFileList: function($el) {\n\t\t\tif (this._fileList) {\n\t\t\t\treturn this._fileList;\n\t\t\t}\n\n\t\t\tthis._fileList = new OCA.SystemTags.FileList(\n\t\t\t\t$el,\n\t\t\t\t{\n\t\t\t\t\tid: 'systemtags',\n\t\t\t\t\tfileActions: this._createFileActions(),\n\t\t\t\t\tconfig: OCA.Files.App.getFilesConfig(),\n\t\t\t\t\t// The file list is created when a \"show\" event is handled,\n\t\t\t\t\t// so it should be marked as \"shown\" like it would have been\n\t\t\t\t\t// done if handling the event with the file list already\n\t\t\t\t\t// created.\n\t\t\t\t\tshown: true\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tthis._fileList.appName = t('systemtags', 'Tags');\n\t\t\treturn this._fileList;\n\t\t},\n\n\t\tremoveFileList: function() {\n\t\t\tif (this._fileList) {\n\t\t\t\tthis._fileList.$fileList.empty();\n\t\t\t}\n\t\t},\n\n\t\t_createFileActions: function() {\n\t\t\t// inherit file actions from the files app\n\t\t\tvar fileActions = new OCA.Files.FileActions();\n\t\t\t// note: not merging the legacy actions because legacy apps are not\n\t\t\t// compatible with the sharing overview and need to be adapted first\n\t\t\tfileActions.registerDefaultActions();\n\t\t\tfileActions.merge(OCA.Files.fileActions);\n\n\t\t\tif (!this._globalActionsInitialized) {\n\t\t\t\t// in case actions are registered later\n\t\t\t\tthis._onActionsUpdated = _.bind(this._onActionsUpdated, this);\n\t\t\t\tOCA.Files.fileActions.on('setDefault.app-systemtags', this._onActionsUpdated);\n\t\t\t\tOCA.Files.fileActions.on('registerAction.app-systemtags', this._onActionsUpdated);\n\t\t\t\tthis._globalActionsInitialized = true;\n\t\t\t}\n\n\t\t\t// when the user clicks on a folder, redirect to the corresponding\n\t\t\t// folder in the files app instead of opening it directly\n\t\t\tfileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) {\n\t\t\t\tOCA.Files.App.setActiveView('files', {silent: true});\n\t\t\t\tOCA.Files.App.fileList.changeDirectory(OC.joinPaths(context.$file.attr('data-path'), filename), true, true);\n\t\t\t});\n\t\t\tfileActions.setDefault('dir', 'Open');\n\t\t\treturn fileActions;\n\t\t},\n\n\t\t_onActionsUpdated: function(ev) {\n\t\t\tif (!this._fileList) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (ev.action) {\n\t\t\t\tthis._fileList.fileActions.registerAction(ev.action);\n\t\t\t} else if (ev.defaultAction) {\n\t\t\t\tthis._fileList.fileActions.setDefault(\n\t\t\t\t\tev.defaultAction.mime,\n\t\t\t\t\tev.defaultAction.name\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Destroy the app\n\t\t */\n\t\tdestroy: function() {\n\t\t\tOCA.Files.fileActions.off('setDefault.app-systemtags', this._onActionsUpdated);\n\t\t\tOCA.Files.fileActions.off('registerAction.app-systemtags', this._onActionsUpdated);\n\t\t\tthis.removeFileList();\n\t\t\tthis._fileList = null;\n\t\t\tdelete this._globalActionsInitialized;\n\t\t}\n\t};\n\n})();\n\n$(document).ready(function() {\n\t$('#app-content-systemtagsfilter').on('show', function(e) {\n\t\tOCA.SystemTags.App.initFileList($(e.target));\n\t});\n\t$('#app-content-systemtagsfilter').on('hide', function() {\n\t\tOCA.SystemTags.App.removeFileList();\n\t});\n});\n","/*\n * Copyright (c) 2016 Vincent Petry \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(function() {\n\t/**\n\t * @class OCA.SystemTags.FileList\n\t * @augments OCA.Files.FileList\n\t *\n\t * @classdesc SystemTags file list.\n\t * Contains a list of files filtered by system tags.\n\t *\n\t * @param $el container element with existing markup for the #controls\n\t * and a table\n\t * @param [options] map of options, see other parameters\n\t * @param {Array.} [options.systemTagIds] array of system tag ids to\n\t * filter by\n\t */\n\tvar FileList = function($el, options) {\n\t\tthis.initialize($el, options);\n\t};\n\tFileList.prototype = _.extend({}, OCA.Files.FileList.prototype,\n\t\t/** @lends OCA.SystemTags.FileList.prototype */ {\n\t\tid: 'systemtagsfilter',\n\t\tappName: t('systemtags', 'Tagged files'),\n\n\t\t/**\n\t\t * Array of system tag ids to filter by\n\t\t *\n\t\t * @type Array.\n\t\t */\n\t\t_systemTagIds: [],\n\t\t_lastUsedTags: [],\n\n\t\t_clientSideSort: true,\n\t\t_allowSelection: false,\n\n\t\t_filterField: null,\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tinitialize: function($el, options) {\n\t\t\tOCA.Files.FileList.prototype.initialize.apply(this, arguments);\n\t\t\tif (this.initialized) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (options && options.systemTagIds) {\n\t\t\t\tthis._systemTagIds = options.systemTagIds;\n\t\t\t}\n\n\t\t\tOC.Plugins.attach('OCA.SystemTags.FileList', this);\n\n\t\t\tvar $controls = this.$el.find('#controls').empty();\n\n\t\t\t_.defer(_.bind(this._getLastUsedTags, this));\n\t\t\tthis._initFilterField($controls);\n\t\t},\n\t\t\n\t\tdestroy: function() {\n\t\t\tthis.$filterField.remove();\n\n\t\t\tOCA.Files.FileList.prototype.destroy.apply(this, arguments);\n\t\t},\n\n\t\t_getLastUsedTags: function() {\n\t\t\tvar self = this;\n\t\t\t$.ajax({\n\t\t\t\ttype: 'GET',\n\t\t\t\turl: OC.generateUrl('/apps/systemtags/lastused'),\n\t\t\t\tsuccess: function (response) {\n\t\t\t\t\tself._lastUsedTags = response;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t_initFilterField: function($container) {\n\t\t\tvar self = this;\n\t\t\tthis.$filterField = $('');\n\t\t\t$container.append(this.$filterField);\n\t\t\tthis.$filterField.select2({\n\t\t\t\tplaceholder: t('systemtags', 'Select tags to filter by'),\n\t\t\t\tallowClear: false,\n\t\t\t\tmultiple: true,\n\t\t\t\ttoggleSelect: true,\n\t\t\t\tseparator: ',',\n\t\t\t\tquery: _.bind(this._queryTagsAutocomplete, this),\n\n\t\t\t\tid: function(tag) {\n\t\t\t\t\treturn tag.id;\n\t\t\t\t},\n\n\t\t\t\tinitSelection: function(element, callback) {\n\t\t\t\t\tvar val = $(element).val().trim();\n\t\t\t\t\tif (val) {\n\t\t\t\t\t\tvar tagIds = val.split(','),\n\t\t\t\t\t\t\ttags = [];\n\n\t\t\t\t\t\tOC.SystemTags.collection.fetch({\n\t\t\t\t\t\t\tsuccess: function() {\n\t\t\t\t\t\t\t\t_.each(tagIds, function(tagId) {\n\t\t\t\t\t\t\t\t\tvar tag = OC.SystemTags.collection.get(tagId);\n\t\t\t\t\t\t\t\t\tif (!_.isUndefined(tag)) {\n\t\t\t\t\t\t\t\t\t\ttags.push(tag.toJSON());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tcallback(tags);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcallback([]);\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\tformatResult: function (tag) {\n\t\t\t\t\treturn OC.SystemTags.getDescriptiveTag(tag);\n\t\t\t\t},\n\n\t\t\t\tformatSelection: function (tag) {\n\t\t\t\t\treturn OC.SystemTags.getDescriptiveTag(tag)[0].outerHTML;\n\t\t\t\t},\n\n\t\t\t\tsortResults: function(results) {\n\t\t\t\t\tresults.sort(function(a, b) {\n\t\t\t\t\t\tvar aLastUsed = self._lastUsedTags.indexOf(a.id);\n\t\t\t\t\t\tvar bLastUsed = self._lastUsedTags.indexOf(b.id);\n\n\t\t\t\t\t\tif (aLastUsed !== bLastUsed) {\n\t\t\t\t\t\t\tif (bLastUsed === -1) {\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\tif (aLastUsed === -1) {\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 aLastUsed < bLastUsed ? -1 : 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Both not found\n\t\t\t\t\t\treturn OC.Util.naturalSortCompare(a.name, b.name);\n\t\t\t\t\t});\n\t\t\t\t\treturn results;\n\t\t\t\t},\n\n\t\t\t\tescapeMarkup: function(m) {\n\t\t\t\t\t// prevent double markup escape\n\t\t\t\t\treturn m;\n\t\t\t\t},\n\t\t\t\tformatNoMatches: function() {\n\t\t\t\t\treturn t('systemtags', 'No tags found');\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.$filterField.on('change', _.bind(this._onTagsChanged, this));\n\t\t\treturn this.$filterField;\n\t\t},\n\n\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_queryTagsAutocomplete: function(query) {\n\t\t\tOC.SystemTags.collection.fetch({\n\t\t\t\tsuccess: function() {\n\t\t\t\t\tvar results = OC.SystemTags.collection.filterByName(query.term);\n\n\t\t\t\t\tquery.callback({\n\t\t\t\t\t\tresults: _.invoke(results, 'toJSON')\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t/**\n\t\t * Event handler for when the URL changed\n\t\t */\n\t\t_onUrlChanged: function(e) {\n\t\t\tif (e.dir) {\n\t\t\t\tvar tags = _.filter(e.dir.split('/'), function(val) { return val.trim() !== ''; });\n\t\t\t\tthis.$filterField.select2('val', tags || []);\n\t\t\t\tthis._systemTagIds = tags;\n\t\t\t\tthis.reload();\n\t\t\t}\n\t\t},\n\n\t\t_onTagsChanged: function(ev) {\n\t\t\tvar val = $(ev.target).val().trim();\n\t\t\tif (val !== '') {\n\t\t\t\tthis._systemTagIds = val.split(',');\n\t\t\t} else {\n\t\t\t\tthis._systemTagIds = [];\n\t\t\t}\n\n\t\t\tthis.$el.trigger(jQuery.Event('changeDirectory', {\n\t\t\t\tdir: this._systemTagIds.join('/')\n\t\t\t}));\n\t\t\tthis.reload();\n\t\t},\n\n\t\tupdateEmptyContent: function() {\n\t\t\tvar dir = this.getCurrentDirectory();\n\t\t\tif (dir === '/') {\n\t\t\t\t// root has special permissions\n\t\t\t\tif (!this._systemTagIds.length) {\n\t\t\t\t\t// no tags selected\n\t\t\t\t\tthis.$el.find('#emptycontent').html('
' +\n\t\t\t\t\t\t'

' + t('systemtags', 'Please select tags to filter by') + '

');\n\t\t\t\t} else {\n\t\t\t\t\t// tags selected but no results\n\t\t\t\t\tthis.$el.find('#emptycontent').html('
' +\n\t\t\t\t\t\t'

' + t('systemtags', 'No files found for the selected tags') + '

');\n\t\t\t\t}\n\t\t\t\tthis.$el.find('#emptycontent').toggleClass('hidden', !this.isEmpty);\n\t\t\t\tthis.$el.find('#filestable thead th').toggleClass('hidden', this.isEmpty);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tOCA.Files.FileList.prototype.updateEmptyContent.apply(this, arguments);\n\t\t\t}\n\t\t},\n\n\t\tgetDirectoryPermissions: function() {\n\t\t\treturn OC.PERMISSION_READ | OC.PERMISSION_DELETE;\n\t\t},\n\n\t\tupdateStorageStatistics: function() {\n\t\t\t// no op because it doesn't have\n\t\t\t// storage info like free space / used space\n\t\t},\n\n\t\treload: function() {\n\t\t\t// there is only root\n\t\t\tthis._setCurrentDir('/', false);\n\n\t\t\tif (!this._systemTagIds.length) {\n\t\t\t\t// don't reload\n\t\t\t\tthis.updateEmptyContent();\n\t\t\t\tthis.setFiles([]);\n\t\t\t\treturn $.Deferred().resolve();\n\t\t\t}\n\n\t\t\tthis._selectedFiles = {};\n\t\t\tthis._selectionSummary.clear();\n\t\t\tif (this._currentFileModel) {\n\t\t\t\tthis._currentFileModel.off();\n\t\t\t}\n\t\t\tthis._currentFileModel = null;\n\t\t\tthis.$el.find('.select-all').prop('checked', false);\n\t\t\tthis.showMask();\n\t\t\tthis._reloadCall = this.filesClient.getFilteredFiles(\n\t\t\t\t{\n\t\t\t\t\tsystemTagIds: this._systemTagIds\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tproperties: this._getWebdavProperties()\n\t\t\t\t}\n\t\t\t);\n\t\t\tif (this._detailsView) {\n\t\t\t\t// close sidebar\n\t\t\t\tthis._updateDetailsView(null);\n\t\t\t}\n\t\t\tvar callBack = this.reloadCallback.bind(this);\n\t\t\treturn this._reloadCall.then(callBack, callBack);\n\t\t},\n\n\t\treloadCallback: function(status, result) {\n\t\t\tif (result) {\n\t\t\t\t// prepend empty dir info because original handler\n\t\t\t\tresult.unshift({});\n\t\t\t}\n\n\t\t\treturn OCA.Files.FileList.prototype.reloadCallback.call(this, status, result);\n\t\t}\n\t});\n\n\tOCA.SystemTags.FileList = FileList;\n})();\n","/*\n * Copyright (c) 2015 Vincent Petry \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() {\n\tOCA.SystemTags = _.extend({}, OCA.SystemTags);\n\tif (!OCA.SystemTags) {\n\t\t/**\n\t\t * @namespace\n\t\t */\n\t\tOCA.SystemTags = {};\n\t}\n\n\t/**\n\t * @namespace\n\t */\n\tOCA.SystemTags.FilesPlugin = {\n\t\tignoreLists: [\n\t\t\t'files_trashbin',\n\t\t\t'files.public'\n\t\t],\n\n\t\tattach: function(fileList) {\n\t\t\tif (this.ignoreLists.indexOf(fileList.id) >= 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar systemTagsInfoView = new OCA.SystemTags.SystemTagsInfoView();\n\t\t\tfileList.registerDetailView(systemTagsInfoView);\n\n\t\t\t_.each(fileList.getRegisteredDetailViews(), function(detailView) {\n\t\t\t\tif (detailView instanceof OCA.Files.MainFileInfoDetailView) {\n\t\t\t\t\tvar systemTagsInfoViewToggleView =\n\t\t\t\t\t\tnew OCA.SystemTags.SystemTagsInfoViewToggleView({\n\t\t\t\t\t\t\tsystemTagsInfoView: systemTagsInfoView\n\t\t\t\t\t\t});\n\t\t\t\t\tsystemTagsInfoViewToggleView.render();\n\n\t\t\t\t\t// The toggle view element is detached before the\n\t\t\t\t\t// MainFileInfoDetailView is rendered to prevent its event\n\t\t\t\t\t// handlers from being removed.\n\t\t\t\t\tsystemTagsInfoViewToggleView.listenTo(detailView, 'pre-render', function() {\n\t\t\t\t\t\tsystemTagsInfoViewToggleView.$el.detach();\n\t\t\t\t\t});\n\t\t\t\t\tsystemTagsInfoViewToggleView.listenTo(detailView, 'post-render', function() {\n\t\t\t\t\t\tdetailView.$el.find('.file-details').append(systemTagsInfoViewToggleView.$el);\n\t\t\t\t\t});\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n\n})();\n\nOC.Plugins.register('OCA.Files.FileList', OCA.SystemTags.FilesPlugin);\n\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(OCA) {\n\n\tfunction modelToSelection(model) {\n\t\tvar data = model.toJSON();\n\t\tif (!OC.isUserAdmin() && !data.canAssign) {\n\t\t\tdata.locked = true;\n\t\t}\n\t\treturn data;\n\t}\n\n\t/**\n\t * @class OCA.SystemTags.SystemTagsInfoView\n\t * @classdesc\n\t *\n\t * Displays a file's system tags\n\t *\n\t */\n\tvar SystemTagsInfoView = OCA.Files.DetailFileInfoView.extend(\n\t\t/** @lends OCA.SystemTags.SystemTagsInfoView.prototype */ {\n\n\t\t_rendered: false,\n\n\t\tclassName: 'systemTagsInfoView hidden',\n\n\t\t/**\n\t\t * @type OC.SystemTags.SystemTagsInputField\n\t\t */\n\t\t_inputView: null,\n\n\t\tinitialize: function(options) {\n\t\t\tvar self = this;\n\t\t\toptions = options || {};\n\n\t\t\tthis._inputView = new OC.SystemTags.SystemTagsInputField({\n\t\t\t\tmultiple: true,\n\t\t\t\tallowActions: true,\n\t\t\t\tallowCreate: true,\n\t\t\t\tisAdmin: OC.isUserAdmin(),\n\t\t\t\tinitSelection: function(element, callback) {\n\t\t\t\t\tcallback(self.selectedTagsCollection.map(modelToSelection));\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.selectedTagsCollection = new OC.SystemTags.SystemTagsMappingCollection([], {objectType: 'files'});\n\n\t\t\tthis._inputView.collection.on('change:name', this._onTagRenamedGlobally, this);\n\t\t\tthis._inputView.collection.on('remove', this._onTagDeletedGlobally, this);\n\n\t\t\tthis._inputView.on('select', this._onSelectTag, this);\n\t\t\tthis._inputView.on('deselect', this._onDeselectTag, this);\n\t\t},\n\n\t\t/**\n\t\t * Event handler whenever a tag was selected\n\t\t */\n\t\t_onSelectTag: function(tag) {\n\t\t\t// create a mapping entry for this tag\n\t\t\tthis.selectedTagsCollection.create(tag.toJSON());\n\t\t},\n\n\t\t/**\n\t\t * Event handler whenever a tag gets deselected.\n\t\t * Removes the selected tag from the mapping collection.\n\t\t *\n\t\t * @param {string} tagId tag id\n\t\t */\n\t\t_onDeselectTag: function(tagId) {\n\t\t\tthis.selectedTagsCollection.get(tagId).destroy();\n\t\t},\n\n\t\t/**\n\t\t * Event handler whenever a tag was renamed globally.\n\t\t *\n\t\t * This will automatically adjust the tag mapping collection to\n\t\t * container the new name.\n\t\t *\n\t\t * @param {OC.Backbone.Model} changedTag tag model that has changed\n\t\t */\n\t\t_onTagRenamedGlobally: function(changedTag) {\n\t\t\t// also rename it in the selection, if applicable\n\t\t\tvar selectedTagMapping = this.selectedTagsCollection.get(changedTag.id);\n\t\t\tif (selectedTagMapping) {\n\t\t\t\tselectedTagMapping.set(changedTag.toJSON());\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Event handler whenever a tag was deleted globally.\n\t\t *\n\t\t * This will automatically adjust the tag mapping collection to\n\t\t * container the new name.\n\t\t *\n\t\t * @param {OC.Backbone.Model} tagId tag model that has changed\n\t\t */\n\t\t_onTagDeletedGlobally: function(tagId) {\n\t\t\t// also rename it in the selection, if applicable\n\t\t\tthis.selectedTagsCollection.remove(tagId);\n\t\t},\n\n\t\tsetFileInfo: function(fileInfo) {\n\t\t\tvar self = this;\n\t\t\tif (!this._rendered) {\n\t\t\t\tthis.render();\n\t\t\t}\n\n\t\t\tif (fileInfo) {\n\t\t\t\tthis.selectedTagsCollection.setObjectId(fileInfo.id);\n\t\t\t\tthis.selectedTagsCollection.fetch({\n\t\t\t\t\tsuccess: function(collection) {\n\t\t\t\t\t\tcollection.fetched = true;\n\n\t\t\t\t\t\tvar appliedTags = collection.map(modelToSelection);\n\t\t\t\t\t\tself._inputView.setData(appliedTags);\n\n\t\t\t\t\t\tif (appliedTags.length !== 0) {\n\t\t\t\t\t\t\tself.show();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tself.hide();\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\tthis.hide();\n\t\t},\n\n\t\t/**\n\t\t * Renders this details view\n\t\t */\n\t\trender: function() {\n\t\t\tvar self = this;\n\n\t\t\tthis.$el.append(this._inputView.$el);\n\t\t\tthis._inputView.render();\n\t\t},\n\n\t\tisVisible: function() {\n\t\t\treturn !this.$el.hasClass('hidden');\n\t\t},\n\n\t\tshow: function() {\n\t\t\tthis.$el.removeClass('hidden');\n\t\t},\n\n\t\thide: function() {\n\t\t\tthis.$el.addClass('hidden');\n\t\t},\n\n\t\topenDropdown: function() {\n\t\t\tthis.$el.find('.systemTagsInputField').select2('open');\n\t\t},\n\n\t\tremove: function() {\n\t\t\tthis._inputView.remove();\n\t\t}\n\t});\n\n\tOCA.SystemTags.SystemTagsInfoView = SystemTagsInfoView;\n\n})(OCA);\n\n","/**\n *\n * @copyright Copyright (c) 2017, Daniel Calviño Sánchez (danxuliu@gmail.com)\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\n(function(OCA) {\n\n\t/**\n\t * @class OCA.SystemTags.SystemTagsInfoViewToggleView\n\t * @classdesc\n\t *\n\t * View to toggle the visibility of a SystemTagsInfoView.\n\t *\n\t * This toggle view must be explicitly rendered before it is used.\n\t */\n\tvar SystemTagsInfoViewToggleView = OC.Backbone.View.extend(\n\t\t/** @lends OC.Backbone.View.prototype */ {\n\n\t\ttagName: 'span',\n\n\t\tclassName: 'tag-label',\n\n\t\tevents: {\n\t\t\t'click': 'click'\n\t\t},\n\n\t\t/**\n\t\t * @type OCA.SystemTags.SystemTagsInfoView\n\t\t */\n\t\t_systemTagsInfoView: null,\n\n\t\ttemplate: function(data) {\n\t\t\treturn '' + t('systemtags', 'Tags');\n\t\t},\n\n\t\t/**\n\t\t * Initialize this toggle view.\n\t\t *\n\t\t * The options must provide a systemTagsInfoView parameter that\n\t\t * references the SystemTagsInfoView to associate to this toggle view.\n\t\t */\n\t\tinitialize: function(options) {\n\t\t\tvar self = this;\n\t\t\toptions = options || {};\n\n\t\t\tthis._systemTagsInfoView = options.systemTagsInfoView;\n\t\t\tif (!this._systemTagsInfoView) {\n\t\t\t\tthrow 'Missing required parameter \"systemTagsInfoView\"';\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Toggles the visibility of the associated SystemTagsInfoView.\n\t\t *\n\t\t * When the systemTagsInfoView is shown its dropdown is also opened.\n\t\t */\n\t\tclick: function() {\n\t\t\tif (this._systemTagsInfoView.isVisible()) {\n\t\t\t\tthis._systemTagsInfoView.hide();\n\t\t\t} else {\n\t\t\t\tthis._systemTagsInfoView.show();\n\t\t\t\tthis._systemTagsInfoView.openDropdown();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Renders this toggle view.\n\t\t *\n\t\t * @return OCA.SystemTags.SystemTagsInfoViewToggleView this object.\n\t\t */\n\t\trender: function() {\n\t\t\tthis.$el.html(this.template());\n\n\t\t\treturn this;\n\t\t},\n\n\t});\n\n\tOCA.SystemTags.SystemTagsInfoViewToggleView = SystemTagsInfoViewToggleView;\n\n})(OCA);\n","\nvar content = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/lib/loader.js!./systemtagsfilelist.scss\");\n\nif(typeof content === 'string') content = [[module.id, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = require(\"!../../../../node_modules/style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(module.hot) {\n\tmodule.hot.accept(\"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/lib/loader.js!./systemtagsfilelist.scss\", function() {\n\t\tvar newContent = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/lib/loader.js!./systemtagsfilelist.scss\");\n\n\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\n\t\tvar locals = (function(a, b) {\n\t\t\tvar key, idx = 0;\n\n\t\t\tfor(key in a) {\n\t\t\t\tif(!b || a[key] !== b[key]) return false;\n\t\t\t\tidx++;\n\t\t\t}\n\n\t\t\tfor(key in b) idx--;\n\n\t\t\treturn idx === 0;\n\t\t}(content.locals, newContent.locals));\n\n\t\tif(!locals) throw new Error('Aborting CSS HMR due to changed css-modules locals.');\n\n\t\tupdate(newContent);\n\t});\n\n\tmodule.hot.dispose(function() { update(); });\n}","exports = module.exports = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.id, \"/*\\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#app-content-systemtagsfilter .select2-container {\\n width: 30%;\\n margin-left: 10px; }\\n\\n#app-sidebar .mainFileInfoView .tag-label {\\n cursor: pointer;\\n padding: 13px; }\\n\\n#app-sidebar .mainFileInfoView .icon-tag {\\n opacity: .5;\\n vertical-align: middle; }\\n\", \"\"]);\n\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\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 ' + item[2] + '{' + content + '}';\n } else {\n return content;\n }\n }).join('');\n }; // import a list of modules into the list\n\n\n list.i = function (modules, mediaQuery) {\n if (typeof modules === 'string') {\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n for (var i = 0; i < this.length; i++) {\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n\n for (i = 0; i < modules.length; i++) {\n var item = modules[i]; // skip already imported module\n // this implementation is not 100% perfect for weird media query combinations\n // when a module is imported multiple times with different media queries.\n // I hope this will never occur (Hey this way we have smaller bundles)\n\n if (item[0] == null || !alreadyImportedModules[item[0]]) {\n if (mediaQuery && !item[2]) {\n item[2] = mediaQuery;\n } else if (mediaQuery) {\n item[2] = '(' + item[2] + ') and (' + mediaQuery + ')';\n }\n\n list.push(item);\n }\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || '';\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=' + cssMapping.sourceRoot + 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,' + base64;\n return '/*# ' + data + ' */';\n}","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getTarget = function (target, parent) {\n if (parent){\n return parent.querySelector(target);\n }\n return document.querySelector(target);\n};\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(target, parent) {\n // If passing function in options, then use it for resolve \"head\" element.\n // Useful for Shadow Root style i.e\n // {\n // insertInto: function () { return document.querySelector(\"#foo\").shadowRoot }\n // }\n if (typeof target === 'function') {\n return target();\n }\n if (typeof memo[target] === \"undefined\") {\n\t\t\tvar styleTarget = getTarget.call(this, target, parent);\n\t\t\t// Special case to return head of iframe instead of iframe itself\n\t\t\tif (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n\t\t\t\ttry {\n\t\t\t\t\t// This will throw an exception if access to iframe is blocked\n\t\t\t\t\t// due to cross-origin restrictions\n\t\t\t\t\tstyleTarget = styleTarget.contentDocument.head;\n\t\t\t\t} catch(e) {\n\t\t\t\t\tstyleTarget = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmemo[target] = styleTarget;\n\t\t}\n\t\treturn memo[target]\n\t};\n})();\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = require(\"./urls\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of