photos/js/photos-src_services_collect...

1 line
32 KiB
XML

{"version":3,"file":"photos-src_services_collectionFetcher_js-src_components_HeaderNavigation_vue.js?v=3fe94552783a3efb6e25","mappings":";mSACA,ioPAoDA,SAASA,IACR,MAAO,sSAAP,OAD6C,UAAH,6CAAG,GAS7B,2CAGjB,CAMA,SAASC,IACR,MAAO,8hBAAP,OADkD,UAAH,6CAAG,GAiBlC,2CAGjB,CASO,SAAeC,EAAgB,EAAD,kCAoBrC,aAFC,OAED,cApBO,WAA+BC,EAAMC,GAAO,uFAAyC,OAAvCC,EAAa,EAAH,6BAAG,GAAIC,EAAS,EAAH,6BAAGC,EAAAA,GAAa,kBAEnED,EAAOE,KAAKL,EAAM,EAAF,CACtCM,KAAMT,EAAwBK,GAC9BK,SAAS,GACNN,IACF,OAE2E,OANvEO,EAAW,EAAH,KAMdC,EAAAA,EAAAA,MAAa,uCAAwC,CAAEH,KAAME,EAASF,OAAO,kBAEtEI,EAAiBF,EAASF,OAAK,qCAEnB,iBAAf,KAAMK,KAAuB,0CACzB,MAAI,6EAKb,wBAUM,SAAeC,EAAiB,EAAD,kCAsBtC,aAFC,OAED,cAtBO,WAAgCZ,EAAMC,GAAO,uFAAyC,OAAvCC,EAAa,EAAH,6BAAG,GAAIC,EAAS,EAAH,6BAAGC,EAAAA,GAAa,kBAEpED,EAAOU,qBAAqBb,EAAM,EAAF,CACtDM,KAAMT,EAAwBK,GAC9BK,SAAS,GACNN,IACF,OAEkG,OAN9FO,EAAW,EAAH,KAMdC,EAAAA,EAAAA,MAAa,yBAAD,OAA0BD,EAASF,KAAKQ,OAAM,kBAAkB,CAAER,KAAME,EAASF,OAAO,kBAE7FE,EAASF,KACdS,QAAO,SAAAC,GAAU,OAAIA,EAAWC,WAAajB,CAAI,IACjDkB,IAAIR,IAAiB,qCAEJ,iBAAf,KAAMC,KAAuB,0CACzB,IAAE,6EAKX,wBAOD,SAASD,EAAiBS,GAAe,aAEEC,IAAtCD,EAAcE,MAAMC,eAAqE,K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CAAC,MAAQR,EAAIR,UAAU,CAACQ,EAAIc,GAAG,WAAWd,EAAIe,GAAGf,EAAI9B,MAAM,YAAY8B,EAAIc,GAAG,KAAKZ,EAAG,MAAM,CAACE,YAAY,kCAAkCJ,EAAIc,GAAG,KAAKd,EAAIgB,GAAG,aAAa,GAAGhB,EAAIc,GAAG,KAAMd,EAAIiB,OAAOvC,QAASwB,EAAG,MAAM,CAACE,YAAY,8BAA8B,CAACJ,EAAIgB,GAAG,YAAY,GAAGhB,EAAIO,KAAKP,EAAIc,GAAG,KAAKZ,EAAG,gBAAgB,CAACgB,WAAW,CAAC,CAAChD,KAAK,OAAOiD,QAAQ,SAASC,MAAOpB,EAAIxB,QAAS6C,WAAW,YAAYjB,YAAY,8BAA8BJ,EAAIc,GAAG,KAAKZ,EAAG,MAAM,CAACE,YAAY,oCAAoC,CAACJ,EAAIgB,GAAG,UAAU,IAAI,EAC9kC,GACsB,IKWpB,EACA,KACA,WACA,MAI8B","sources":["webpack:///photos/src/services/collectionFetcher.js","webpack:///photos/src/components/HeaderNavigation.vue?vue&type=style&index=0&id=809e621a&prod&lang=scss&","webpack:///photos/src/components/HeaderNavigation.vue?vue&type=style&index=1&id=809e621a&prod&lang=scss&scoped=true&","webpack://photos/./src/components/HeaderNavigation.vue?6d2b","webpack:///photos/src/components/HeaderNavigation.vue","webpack:///photos/src/components/HeaderNavigation.vue?vue&type=script&lang=js&","webpack://photos/./src/components/HeaderNavigation.vue?b201","webpack://photos/./src/components/HeaderNavigation.vue?a579","webpack://photos/./src/components/HeaderNavigation.vue?6702"],"sourcesContent":["/**\n * @copyright Copyright (c) 2022 Louis Chemineau <louis@chmn.me>\n *\n * @author Louis Chemineau <louis@chmn.me>\n *\n * @license AGPL-3.0-or-later\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 <http://www.gnu.org/licenses/>.\n *\n */\n\nimport moment from '@nextcloud/moment'\nimport { translate } from '@nextcloud/l10n'\n\nimport defaultClient from './DavClient.js'\nimport logger from './logger.js'\nimport { genFileInfo } from '../utils/fileUtils.js'\n\n/**\n * @typedef {object} Collection\n * @property {string} basename - The name of the collection (ex: \"Athens\").\n * @property {string} filename - The filename of the collection (ex: \"/photos/admin/places/Athens\").\n * @property {string} source - The full source of the collection (ex: \"https://nextcloud_server1.test/remote.php/dav//photos/admin/places/Athens\").\n * @property {number} nbItems - The number of item in the collection.\n * @property {number} lastPhoto - The file id for the cover of the collection.\n */\n\n/**\n * @typedef {object} CollectionFile\n * @property {string} fileid - The id of the file.\n * @property {string} basename - The name of the file (ex: \"790-IMG_20180906_085724.jpg\").\n * @property {string} filename - The file name of the file (ex: \"/photos/admin/places/Athens/790-IMG_20180906_085724.jpg\").\n * @property {string} source - The full source of the collection (ex: \"https://nextcloud_server1.test/remote.php/dav//photos/admin/places/Athens/790-IMG_20180906_085724.jpg\").\n * @property {object} fileMetadataSizeParsed - The metadata of the file.\n * @property {number} fileMetadataSizeParsed.width - The width of the file.\n * @property {number} fileMetadataSizeParsed.height - The height of the file.\n */\n\n/**\n * @param {string} extraProps - Extra properties to add to the DAV request.\n * @return {string}\n */\nfunction getCollectionDavRequest(extraProps = '') {\n\treturn `<?xml version=\"1.0\"?>\n\t\t\t<d:propfind xmlns:d=\"DAV:\"\n\t\t\t\txmlns:oc=\"http://owncloud.org/ns\"\n\t\t\t\txmlns:nc=\"http://nextcloud.org/ns\"\n\t\t\t\txmlns:ocs=\"http://open-collaboration-services.org/ns\">\n\t\t\t\t<d:prop>\n\t\t\t\t\t<nc:last-photo />\n\t\t\t\t\t<nc:nbItems />\n\t\t\t\t\t${extraProps}\n\t\t\t\t</d:prop>\n\t\t\t</d:propfind>`\n}\n\n/**\n * @param {string} extraProps - Extra properties to add to the DAV request.\n * @return {string}\n */\nfunction getCollectionFilesDavRequest(extraProps = '') {\n\treturn `<?xml version=\"1.0\"?>\n\t\t\t<d:propfind xmlns:d=\"DAV:\"\n\t\t\t\txmlns:oc=\"http://owncloud.org/ns\"\n\t\t\t\txmlns:nc=\"http://nextcloud.org/ns\"\n\t\t\t\txmlns:ocs=\"http://open-collaboration-services.org/ns\">\n\t\t\t\t<d:prop>\n\t\t\t\t\t<d:getcontentlength />\n\t\t\t\t\t<d:getcontenttype />\n\t\t\t\t\t<d:getetag />\n\t\t\t\t\t<d:getlastmodified />\n\t\t\t\t\t<d:resourcetype />\n\t\t\t\t\t<nc:file-metadata-size />\n\t\t\t\t\t<nc:has-preview />\n\t\t\t\t\t<oc:favorite />\n\t\t\t\t\t<oc:fileid />\n\t\t\t\t\t<oc:permissions />\n\t\t\t\t\t${extraProps}\n\t\t\t\t</d:prop>\n\t\t\t</d:propfind>`\n}\n\n/**\n * @param {string} path - Collections' root path.\n * @param {import('webdav').StatOptions} options - Options to forward to the webdav client.\n * @param {string} extraProps - Extra properties to add to the DAV request.\n * @param {import('webdav').WebDAVClient} client - The DAV client to use.\n * @return {Promise<Collection|null>}\n */\nexport async function fetchCollection(path, options, extraProps = '', client = defaultClient) {\n\ttry {\n\t\tconst response = await client.stat(path, {\n\t\t\tdata: getCollectionDavRequest(extraProps),\n\t\t\tdetails: true,\n\t\t\t...options,\n\t\t})\n\n\t\tlogger.debug('[Collections] Fetched a collection: ', { data: response.data })\n\n\t\treturn formatCollection(response.data)\n\t} catch (error) {\n\t\tif (error.code === 'ERR_CANCELED') {\n\t\t\treturn null\n\t\t}\n\n\t\tthrow error\n\t}\n}\n\n/**\n *\n * @param {string} path - Collections' root path.\n * @param {import('webdav').StatOptions} options - Options to forward to the webdav client.\n * @param {string} extraProps - Extra properties to add to the DAV request.\n * @param {import('webdav').WebDAVClient} client - The DAV client to use.\n * @return {Promise<Collection[]>}\n */\nexport async function fetchCollections(path, options, extraProps = '', client = defaultClient) {\n\ttry {\n\t\tconst response = await client.getDirectoryContents(path, {\n\t\t\tdata: getCollectionDavRequest(extraProps),\n\t\t\tdetails: true,\n\t\t\t...options,\n\t\t})\n\n\t\tlogger.debug(`[Collections] Fetched ${response.data.length} collections: `, { data: response.data })\n\n\t\treturn response.data\n\t\t\t.filter(collection => collection.filename !== path)\n\t\t\t.map(formatCollection)\n\t} catch (error) {\n\t\tif (error.code === 'ERR_CANCELED') {\n\t\t\treturn []\n\t\t}\n\n\t\tthrow error\n\t}\n}\n\n/**\n *\n * @param {object} rawCollection - An collection received from a webdav request.\n * @return {Collection}\n */\nfunction formatCollection(rawCollection) {\n\t// Ensure that we have a proper collaborators array.\n\tif (rawCollection.props.collaborators === undefined || rawCollection.props.collaborators === '') {\n\t\trawCollection.props.collaborators = []\n\t} else if (typeof rawCollection.props.collaborators.collaborator === 'object') {\n\t\tif (Array.isArray(rawCollection.props.collaborators.collaborator)) {\n\t\t\trawCollection.props.collaborators = rawCollection.props.collaborators.collaborator\n\t\t} else {\n\t\t\trawCollection.props.collaborators = [rawCollection.props.collaborators.collaborator]\n\t\t}\n\t}\n\n\t// Extract custom props.\n\trawCollection = genFileInfo(rawCollection)\n\n\t// Compute date range label.\n\tconst dateRange = JSON.parse(rawCollection.dateRange?.replace(/&quot;/g, '\"') ?? '{}')\n\tif (dateRange.start === null) {\n\t\tdateRange.start = moment().unix()\n\t\tdateRange.end = moment().unix()\n\t}\n\tconst dateRangeFormatted = {\n\t\tstartDate: moment.unix(dateRange.start).format('MMMM YYYY'),\n\t\tendDate: moment.unix(dateRange.end).format('MMMM YYYY'),\n\t}\n\tif (dateRangeFormatted.startDate === dateRangeFormatted.endDate) {\n\t\trawCollection.date = dateRangeFormatted.startDate\n\t} else {\n\t\trawCollection.date = translate('photos', '{startDate} to {endDate}', dateRangeFormatted)\n\t}\n\n\treturn rawCollection\n}\n\n/**\n *\n * @param {string} path - Collections' root path.\n * @param {import('webdav').StatOptions} options - Options to forward to the webdav client.\n * @param {string} extraProps - Extra properties to add to the DAV request.\n * @param {import('webdav').WebDAVClient} client - The DAV client to use.\n * @return {Promise<CollectionFile[]>}\n */\nexport async function fetchCollectionFiles(path, options, extraProps = '', client = defaultClient) {\n\ttry {\n\t\tconst response = await client.getDirectoryContents(path, {\n\t\t\tdata: getCollectionFilesDavRequest(extraProps),\n\t\t\tdetails: true,\n\t\t\t...options,\n\t\t})\n\n\t\tconst fetchedFiles = response.data\n\t\t\t.map(file => genFileInfo(file))\n\t\t\t.filter(file => file.fileid)\n\n\t\tlogger.debug(`[Collections] Fetched ${fetchedFiles.length} new files: `, fetchedFiles)\n\n\t\treturn fetchedFiles\n\t} catch (error) {\n\t\tif (error.code === 'ERR_CANCELED') {\n\t\t\treturn []\n\t\t}\n\n\t\tlogger.error('Error fetching collection files', { error })\n\t\tconsole.error(error)\n\n\t\tthrow error\n\t}\n}\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--photos-navigation-height: 64px;--photos-navigation-spacing: calc((var(--photos-navigation-height) - 44px) / 2)}button.app-navigation-toggle{top:0 !important;right:calc(var(--photos-navigation-height)*-1) !important;margin:var(--photos-navigation-spacing) !important}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/HeaderNavigation.vue\"],\"names\":[],\"mappings\":\"AAEA,MACC,gCAAA,CAEA,+EAAA,CAID,6BAEC,gBAAA,CACA,yDAAA,CACA,kDAAA\",\"sourcesContent\":[\"$sizes: (\\\"400\\\": (\\\"count\\\": 3, \\\"marginTop\\\": 66, \\\"marginW\\\": 8), \\\"700\\\": (\\\"count\\\": 4, \\\"marginTop\\\": 66, \\\"marginW\\\": 8), \\\"1024\\\": (\\\"count\\\": 5, \\\"marginTop\\\": 66, \\\"marginW\\\": 44), \\\"1280\\\": (\\\"count\\\": 4, \\\"marginTop\\\": 66, \\\"marginW\\\": 44), \\\"1440\\\": (\\\"count\\\": 5, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"1600\\\": (\\\"count\\\": 6, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"2048\\\": (\\\"count\\\": 7, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"2560\\\": (\\\"count\\\": 8, \\\"marginTop\\\": 88, \\\"marginW\\\": 88), \\\"3440\\\": (\\\"count\\\": 9, \\\"marginTop\\\": 88, \\\"marginW\\\": 88), \\\"max\\\": (\\\"count\\\": 10, \\\"marginTop\\\": 88, \\\"marginW\\\": 88));\\n\\n:root {\\n\\t--photos-navigation-height: 64px;\\n\\t// header height - button size\\n\\t--photos-navigation-spacing: calc((var(--photos-navigation-height) - 44px) / 2);\\n}\\n\\n// Properly position the navigation toggle button\\nbutton.app-navigation-toggle {\\n\\t// App-navigation have a 4px margin top\\n\\ttop: 0 !important;\\n\\tright: calc(var(--photos-navigation-height) * -1) !important;\\n\\tmargin: var(--photos-navigation-spacing) !important;\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".photos-navigation[data-v-809e621a]{position:-webkit-sticky;position:sticky;z-index:20;top:0;display:flex;align-items:center;width:100%;min-height:var(--photos-navigation-height);padding:0 var(--photos-navigation-height);background:var(--color-main-background)}.photos-navigation__back[data-v-809e621a]{position:absolute !important;left:0;margin:var(--photos-navigation-spacing) !important}.photos-navigation__title[data-v-809e621a]{max-width:50%;margin-right:calc(2*var(--photos-navigation-spacing));display:flex;flex-direction:column}.photos-navigation__title__main[data-v-809e621a]{margin:0;cursor:pointer}.photos-navigation__title__main[data-v-809e621a],.photos-navigation__title__sub[data-v-809e621a]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.photos-navigation__loader[data-v-809e621a]{margin-left:32px}.photos-navigation__content-right[data-v-809e621a]{display:flex;align-items:center;justify-content:center;margin-left:auto}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/HeaderNavigation.vue\"],\"names\":[],\"mappings\":\"AAEA,oCACC,uBAAA,CAAA,eAAA,CACA,UAAA,CACA,KAAA,CACA,YAAA,CACA,kBAAA,CACA,UAAA,CACA,0CAAA,CACA,yCAAA,CACA,uCAAA,CAEA,0CAEC,4BAAA,CACA,MAAA,CACA,kDAAA,CAGD,2CACC,aAAA,CACA,qDAAA,CACA,YAAA,CACA,qBAAA,CAEA,iDACC,QAAA,CACA,cAAA,CAGD,iGACC,eAAA,CACA,kBAAA,CACA,sBAAA,CAIF,4CACC,gBAAA,CAGD,mDACC,YAAA,CACA,kBAAA,CACA,sBAAA,CACA,gBAAA\",\"sourcesContent\":[\"$sizes: (\\\"400\\\": (\\\"count\\\": 3, \\\"marginTop\\\": 66, \\\"marginW\\\": 8), \\\"700\\\": (\\\"count\\\": 4, \\\"marginTop\\\": 66, \\\"marginW\\\": 8), \\\"1024\\\": (\\\"count\\\": 5, \\\"marginTop\\\": 66, \\\"marginW\\\": 44), \\\"1280\\\": (\\\"count\\\": 4, \\\"marginTop\\\": 66, \\\"marginW\\\": 44), \\\"1440\\\": (\\\"count\\\": 5, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"1600\\\": (\\\"count\\\": 6, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"2048\\\": (\\\"count\\\": 7, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"2560\\\": (\\\"count\\\": 8, \\\"marginTop\\\": 88, \\\"marginW\\\": 88), \\\"3440\\\": (\\\"count\\\": 9, \\\"marginTop\\\": 88, \\\"marginW\\\": 88), \\\"max\\\": (\\\"count\\\": 10, \\\"marginTop\\\": 88, \\\"marginW\\\": 88));\\n\\n.photos-navigation {\\n\\tposition: sticky;\\n\\tz-index: 20;\\n\\ttop: 0;\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\twidth: 100%;\\n\\tmin-height: var(--photos-navigation-height);\\n\\tpadding: 0 var(--photos-navigation-height);\\n\\tbackground: var(--color-main-background);\\n\\n\\t&__back {\\n\\t\\t// Above the navigation menu\\n\\t\\tposition: absolute !important;\\n\\t\\tleft: 0;\\n\\t\\tmargin: var(--photos-navigation-spacing) !important;\\n\\t}\\n\\n\\t&__title {\\n\\t\\tmax-width: 50%;\\n\\t\\tmargin-right: calc(2 * var(--photos-navigation-spacing));\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\n\\t\\t&__main {\\n\\t\\t\\tmargin: 0;\\n\\t\\t\\tcursor: pointer;\\n\\t\\t}\\n\\n\\t\\t&__main, &__sub {\\n\\t\\t\\toverflow: hidden;\\n\\t\\t\\twhite-space: nowrap;\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\t\\t}\\n\\t}\\n\\n\\t&__loader {\\n\\t\\tmargin-left: 32px;\\n\\t}\\n\\n\\t&__content-right {\\n\\t\\tdisplay: flex;\\n\\t\\talign-items: center;\\n\\t\\tjustify-content: center;\\n\\t\\tmargin-left: auto;\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"photos-navigation\",class:{'photos-navigation--root': _vm.isRoot},attrs:{\"role\":\"toolbar\"}},[(!_vm.isRoot)?_c('NcButton',{staticClass:\"photos-navigation__back\",attrs:{\"type\":\"tertiary\"},on:{\"click\":_vm.folderUp},scopedSlots:_vm._u([{key:\"icon\",fn:function(){return [_c('ArrowLeft',{attrs:{\"size\":20}})]},proxy:true}],null,false,1821202730)}):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"photos-navigation__title\"},[_c('h2',{staticClass:\"photos-navigation__title__main\",on:{\"click\":_vm.refresh}},[_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.name)+\"\\n\\t\\t\")]),_vm._v(\" \"),_c('div',{staticClass:\"photos-navigation__title__sub\"}),_vm._v(\" \"),_vm._t(\"subtitle\")],2),_vm._v(\" \"),(_vm.$slots.default)?_c('div',{staticClass:\"photos-navigation__content\"},[_vm._t(\"default\")],2):_vm._e(),_vm._v(\" \"),_c('NcLoadingIcon',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.loading),expression:\"loading\"}],staticClass:\"photos-navigation__loader\"}),_vm._v(\" \"),_c('div',{staticClass:\"photos-navigation__content-right\"},[_vm._t(\"right\")],2)],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<!--\n - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @license AGPL-3.0-or-later\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 <http://www.gnu.org/licenses/>.\n -\n -->\n\n<template>\n\t<div :class=\"{'photos-navigation--root': isRoot}\" class=\"photos-navigation\" role=\"toolbar\">\n\t\t<!-- Back navigation button -->\n\t\t<NcButton v-if=\"!isRoot\"\n\t\t\tclass=\"photos-navigation__back\"\n\t\t\ttype=\"tertiary\"\n\t\t\t@click=\"folderUp\">\n\t\t\t<template #icon>\n\t\t\t\t<ArrowLeft :size=\"20\" />\n\t\t\t</template>\n\t\t</NcButton>\n\n\t\t<!-- Main Navigation title -->\n\t\t<div class=\"photos-navigation__title\">\n\t\t\t<h2 class=\"photos-navigation__title__main\" @click=\"refresh\">\n\t\t\t\t{{ name }}\n\t\t\t</h2>\n\t\t\t<div class=\"photos-navigation__title__sub\" />\n\t\t\t<slot name=\"subtitle\" />\n\t\t</div>\n\n\t\t<!-- Main slot -->\n\t\t<div v-if=\"$slots.default\" class=\"photos-navigation__content\">\n\t\t\t<slot />\n\t\t</div>\n\n\t\t<NcLoadingIcon v-show=\"loading\" class=\"photos-navigation__loader\" />\n\n\t\t<div class=\"photos-navigation__content-right\">\n\t\t\t<slot name=\"right\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport ArrowLeft from 'vue-material-design-icons/ArrowLeft.vue'\n\nimport { NcButton, NcLoadingIcon } from '@nextcloud/vue'\n\nexport default {\n\tname: 'HeaderNavigation',\n\n\tcomponents: {\n\t\tArrowLeft,\n\t\tNcButton,\n\t\tNcLoadingIcon,\n\t},\n\n\tinheritAttrs: false,\n\n\tprops: {\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tpath: {\n\t\t\ttype: String,\n\t\t\tdefault: '/',\n\t\t},\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\trootTitle: {\n\t\t\ttype: String,\n\t\t\tdefault: t('photos', 'Photos'),\n\t\t},\n\t\t// The route params\n\t\tparams: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tcomputed: {\n\t\tisRoot() {\n\t\t\tconst isRoot = this.path === '/'\n\t\t\tthis.toggleNavigationButton(!isRoot)\n\t\t\treturn isRoot\n\t\t},\n\n\t\tname() {\n\t\t\tif (this.isRoot) {\n\t\t\t\treturn this.rootTitle\n\t\t\t}\n\t\t\treturn this.title\n\t\t},\n\n\t\tparentPath() {\n\t\t\tconst path = this.path.split('/')\n\t\t\tpath.pop()\n\t\t\tconst parent = path.join('/')\n\t\t\treturn this.isRoot || parent.trim() === ''\n\t\t\t\t? '/'\n\t\t\t\t: path.join('/')\n\t\t},\n\n\t\tparentName() {\n\t\t\treturn this.parentPath && this.parentPath.split('/').pop()\n\t\t},\n\n\t\tbackToText() {\n\t\t\tif (this.parentPath === '/') {\n\t\t\t\treturn t('photos', 'Back to {folder}', { folder: this.rootTitle })\n\t\t\t}\n\t\t\treturn t('photos', 'Back to {folder}', { folder: this.parentName })\n\t\t},\n\n\t\t/**\n\t\t * We do not want encoded slashes when browsing by folder\n\t\t * so we generate a new valid route object, get the final url back\n\t\t * decode it and use it as a direct string, which vue-router\n\t\t * does not encode afterwards\n\t\t *\n\t\t * @return {string|object}\n\t\t */\n\t\tto() {\n\t\t\t// always remove first slash, the router\n\t\t\t// manage it automatically\n\t\t\tconst regex = /^\\/?(.*)/i\n\t\t\tconst path = regex.exec(this.parentPath)[1]\n\n\t\t\t// apply to current route\n\t\t\tconst { name, params } = Object.assign({}, this.$route, {\n\t\t\t\tparams: this.params || { path },\n\t\t\t})\n\n\t\t\t// return the full object as we don't care about\n\t\t\t// an empty path if this is route\n\t\t\tif (path === '') {\n\t\t\t\treturn { name }\n\t\t\t}\n\n\t\t\t// returning a string prevent vue-router to encode it again\n\t\t\treturn decodeURIComponent(this.$router.resolve({ name, params }).resolved.path)\n\t\t},\n\t},\n\n\tmethods: {\n\t\tfolderUp() {\n\t\t\tthis.$router.push(this.to)\n\t\t},\n\n\t\trefresh() {\n\t\t\tthis.$emit('refresh')\n\t\t},\n\n\t\ttoggleNavigationButton(hide) {\n\t\t\t// Hide the navigation toggle if the back button is shown\n\t\t\tconst navigationToggle = document.querySelector('button.app-navigation-toggle')\n\t\t\tif (navigationToggle !== null) {\n\t\t\t\tnavigationToggle.style.display = hide ? 'none' : null\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\">\n:root {\n\t--photos-navigation-height: 64px;\n\t// header height - button size\n\t--photos-navigation-spacing: calc((var(--photos-navigation-height) - 44px) / 2);\n}\n\n// Properly position the navigation toggle button\nbutton.app-navigation-toggle {\n\t// App-navigation have a 4px margin top\n\ttop: 0 !important;\n\tright: calc(var(--photos-navigation-height) * -1) !important;\n\tmargin: var(--photos-navigation-spacing) !important;\n}\n\n</style>\n\n<style lang=\"scss\" scoped>\n.photos-navigation {\n\tposition: sticky;\n\tz-index: 20;\n\ttop: 0;\n\tdisplay: flex;\n\talign-items: center;\n\twidth: 100%;\n\tmin-height: var(--photos-navigation-height);\n\tpadding: 0 var(--photos-navigation-height);\n\tbackground: var(--color-main-background);\n\n\t&__back {\n\t\t// Above the navigation menu\n\t\tposition: absolute !important;\n\t\tleft: 0;\n\t\tmargin: var(--photos-navigation-spacing) !important;\n\t}\n\n\t&__title {\n\t\tmax-width: 50%;\n\t\tmargin-right: calc(2 * var(--photos-navigation-spacing));\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\n\t\t&__main {\n\t\t\tmargin: 0;\n\t\t\tcursor: pointer;\n\t\t}\n\n\t\t&__main, &__sub {\n\t\t\toverflow: hidden;\n\t\t\twhite-space: nowrap;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t}\n\n\t&__loader {\n\t\tmargin-left: 32px;\n\t}\n\n\t&__content-right {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tmargin-left: auto;\n\t}\n}\n\n</style>\n","import mod from \"-!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HeaderNavigation.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HeaderNavigation.vue?vue&type=script&lang=js&\"","\n import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HeaderNavigation.vue?vue&type=style&index=0&id=809e621a&prod&lang=scss&\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HeaderNavigation.vue?vue&type=style&index=0&id=809e621a&prod&lang=scss&\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HeaderNavigation.vue?vue&type=style&index=1&id=809e621a&prod&lang=scss&scoped=true&\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HeaderNavigation.vue?vue&type=style&index=1&id=809e621a&prod&lang=scss&scoped=true&\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./HeaderNavigation.vue?vue&type=template&id=809e621a&scoped=true&\"\nimport script from \"./HeaderNavigation.vue?vue&type=script&lang=js&\"\nexport * from \"./HeaderNavigation.vue?vue&type=script&lang=js&\"\nimport style0 from \"./HeaderNavigation.vue?vue&type=style&index=0&id=809e621a&prod&lang=scss&\"\nimport style1 from \"./HeaderNavigation.vue?vue&type=style&index=1&id=809e621a&prod&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"809e621a\",\n null\n \n)\n\nexport default component.exports"],"names":["getCollectionDavRequest","getCollectionFilesDavRequest","fetchCollection","path","options","extraProps","client","defaultClient","stat","data","details","response","logger","formatCollection","code","fetchCollections","getDirectoryContents","length","filter","collection","filename","map","rawCollection","undefined","props","collaborators","collaborator","Array","isArray","genFileInfo","dateRange","JSON","parse","replace","start","moment","unix","end","dateRangeFormatted","startDate","format","endDate","date","translate","fetchCollectionFiles","fetchedFiles","file","fileid","error","console","___CSS_LOADER_EXPORT___","push","module","id","name","components","ArrowLeft","NcButton","NcLoadingIcon","inheritAttrs","loading","type","default","title","required","rootTitle","params","computed","isRoot","parentPath","parentName","backToText","folder","to","methods","folderUp","refresh","toggleNavigationButton","navigationToggle","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","_vm","this","_c","_self","staticClass","class","attrs","_e","on","scopedSlots","_u","key","fn","proxy","_v","_s","_t","$slots","directives","rawName","value","expression"],"sourceRoot":""}