Welcome to mirror list, hosted at ThFree Co, Russian Federation.

photos-src_views_Faces_vue.js.map « js - github.com/nextcloud/photos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8f98770ae747a549885a869c88999396ba820506 (plain)
1
{"version":3,"file":"photos-src_views_Faces_vue.js?v=ed62556e5ba7c7da3a86","mappings":";mIAsBA,SACCA,KAAM,uBAENC,KAHc,WAIb,MAAO,CACNC,gBAAiB,IAAIC,gBAEtB,EAEDC,cATc,WAUbC,KAAKH,gBAAgBI,OACrB,EAEDC,iBAbc,SAaGC,EAAMC,EAAIC,GAC1BL,KAAKH,gBAAgBI,QACrBD,KAAKH,gBAAkB,IAAIC,gBAC3BO,GACA,+vBCdF,SACCV,KAAM,iBAENW,SAAU,EAAF,IACJC,EAAAA,EAAAA,IAAW,CACb,QACA,aACA,WAIFC,QAAS,CACRC,aADQ,SACKC,GAAU,WAEhBC,EAAoB,SAACC,GAC1B,OAAOC,KAAKC,IAAI,GAAI,GAAKF,EAAcG,EAA0B,GAAtBH,EAAcI,QACvDH,KAAKC,IAAI,GAAI,GAAKF,EAAcK,EAA2B,GAAvBL,EAAcM,SAClDL,KAAKC,IAAI,GAAI,GAAK,GAAKF,EAAcG,EAAIH,EAAcI,OAA+B,GAAtBJ,EAAcI,QAC9EH,KAAKC,IAAI,GAAI,GAAK,GAAKF,EAAcK,EAAIL,EAAcM,QAAiC,GAAvBN,EAAcM,QACjF,EAED,OAAQlB,KAAKmB,WAAWT,IAAa,IACnCU,MAAM,EAAG,IACTC,KAAI,SAAAC,GAAM,OAAI,EAAKC,MAAMD,EAAf,IACVD,KAAI,SAAAG,GAAI,cAAUA,GAAV,IAAgBC,eAAgBC,KAAKC,MAAMC,IAAAA,OAAUJ,EAAKC,kBAA1D,IAERI,MAAK,SAACC,EAAGC,GAAJ,OACLA,EAAEN,eAAeO,MAAK,SAAAC,GAAC,OAAIA,EAAEC,QAAUxB,CAAhB,IAA0BM,MAC/Cc,EAAEL,e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a,IAAIC,EAAI3F,KAAS4F,EAAGD,EAAIE,eAAmBC,EAAGH,EAAII,MAAMD,IAAIF,EAAG,OAAQD,EAAsB,mBAAEG,EAAG,iBAAiB,CAACH,EAAIW,GAAG,OAAOX,EAAIc,GAAGd,EAAI1B,EAAE,SAAU,sBAAsB,QAAQ6B,EAAG,MAAM,CAACE,YAAY,SAAS,CAAEL,EAAgB,aAAEG,EAAG,iBAAiBH,EAAIa,KAAKb,EAAIW,GAAG,KAAMX,EAAIgB,UAAYhB,EAAI9C,aAAciD,EAAG,MAAM,CAACE,YAAY,gBAAgB,CAACF,EAAG,iBAAiB,CAACE,YAAY,kCAAkCY,YAAYjB,EAAIkB,GAAG,CAAC,CAACC,IAAI,OAAOC,GAAG,WAAW,MAAO,CAACjB,EAAG,6BAA6B,EAAEkB,OAAM,GAAM,CAACF,IAAI,OAAOC,GAAG,WAAW,MAAO,CAACpB,EAAIW,GAAG,aAAaX,EAAIc,GAAGd,EAAI1B,EAAE,SAAU,2EAA2E,YAAY,EAAE+C,OAAM,IAAO,MAAK,EAAM,aAAa,CAACrB,EAAIW,GAAG,KAAKX,EAAIW,GAAG,WAAWX,EAAIc,GAAGd,EAAI1B,EAAE,SAAU,wCAAwC,aAAa,GAAK0B,EAAIgB,QAAyKhB,EAAIa,KAApKV,EAAG,MAAM,CAACE,YAAY,eAAeL,EAAIsB,GAAItB,EAAgB,cAAE,SAASuB,GAAM,OAAOpB,EAAG,YAAY,CAACgB,IAAII,EAAKC,SAASlB,MAAM,CAAC,YAAYiB,EAAKC,WAAW,IAAG,IAAa,EAAE,GAC5/B,ISWpB,EACA,KACA,WACA,MAI8B","sources":["webpack:///photos/src/mixins/AbortControllerMixin.js","webpack:///photos/src/mixins/FaceCoverMixin.js","webpack:///photos/src/mixins/FetchFacesMixin.js","webpack:///photos/src/components/FaceCover.vue?vue&type=style&index=0&id=1f2ce110&lang=scss&scoped=true&","webpack:///photos/src/views/Faces.vue?vue&type=style&index=0&id=41711a97&lang=scss&scoped=true&","webpack:///photos/src/views/Faces.vue?vue&type=template&id=41711a97&scoped=true&","webpack:///photos/src/components/FaceCover.vue","webpack:///photos/src/components/FaceCover.vue?vue&type=script&lang=js&","webpack://photos/./src/components/FaceCover.vue?b0a3","webpack:///photos/src/views/Faces.vue","webpack:///photos/src/views/Faces.vue?vue&type=script&lang=js&","webpack://photos/./src/components/FaceCover.vue?d6a7","webpack:///photos/src/components/FaceCover.vue?vue&type=template&id=1f2ce110&scoped=true&","webpack://photos/./src/views/Faces.vue?5888","webpack://photos/./src/views/Faces.vue?a265"],"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\nexport default {\n\tname: 'AbortControllerMixin',\n\n\tdata() {\n\t\treturn {\n\t\t\tabortController: new AbortController(),\n\t\t}\n\t},\n\n\tbeforeDestroy() {\n\t\tthis.abortController.abort()\n\t},\n\n\tbeforeRouteLeave(from, to, next) {\n\t\tthis.abortController.abort()\n\t\tthis.abortController = new AbortController()\n\t\tnext()\n\t},\n}\n","/**\n * @copyright Copyright (c) 2022 Marcel Klehr <mklehr@gmx.net>\n *\n * @author Marcel Klehr <mklehr@gmx.net>\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 { mapGetters } from 'vuex'\nimport he from 'he'\n\nexport default {\n\tname: 'FaceCoverMixin',\n\n\tcomputed: {\n\t\t...mapGetters([\n\t\t\t'faces',\n\t\t\t'facesFiles',\n\t\t\t'files',\n\t\t]),\n\t},\n\n\tmethods: {\n\t\tgetFaceCover(faceName) {\n\t\t\t// Give high scores for faces that intersect with the edge of the picture (with a margin of half the face size)\n\t\t\tconst scoreFacePosition = (faceDetection) => {\n\t\t\t\treturn Math.max(0, -1 * (faceDetection.x - faceDetection.width * 0.5))\n\t\t\t\t+ Math.max(0, -1 * (faceDetection.y - faceDetection.height * 0.5))\n\t\t\t\t+ Math.max(0, -1 * (1 - (faceDetection.x + faceDetection.width) - faceDetection.width * 0.5))\n\t\t\t\t+ Math.max(0, -1 * (1 - (faceDetection.y + faceDetection.height) - faceDetection.height * 0.5))\n\t\t\t}\n\n\t\t\treturn (this.facesFiles[faceName] || [])\n\t\t\t\t.slice(0, 25)\n\t\t\t\t.map(fileId => this.files[fileId])\n\t\t\t\t.map(file => ({ ...file, faceDetections: JSON.parse(he.decode(file.faceDetections)) }))\n\t\t\t\t// sort larges face first\n\t\t\t\t.sort((a, b) =>\n\t\t\t\t\tb.faceDetections.find(d => d.title === faceName).width\n\t\t\t\t\t- a.faceDetections.find(d => d.title === faceName).width\n\t\t\t\t)\n\t\t\t\t// sort fewest face detections first\n\t\t\t\t.sort((a, b) =>\n\t\t\t\t\ta.faceDetections.length\n\t\t\t\t\t- b.faceDetections.length\n\t\t\t\t)\n\t\t\t\t// Sort faces that are at the edge last\n\t\t\t\t.sort((a, b) =>\n\t\t\t\t\tscoreFacePosition(a.faceDetections.find(d => d.title === faceName))\n\t\t\t\t\t- scoreFacePosition(b.faceDetections.find(d => d.title === faceName))\n\t\t\t\t)[0]\n\t\t},\n\n\t\t/**\n\t\t * This will produce an inline style to apply to images\n\t\t * to zoom toward the detected face\n\t\t *\n\t\t * @param faceName\n\t\t * @return {{}|{transform: string, width: string, transformOrigin: string}}\n\t\t */\n\t\tgetCoverStyle(faceName) {\n\t\t\tconst cover = this.getFaceCover(faceName)\n\t\t\tif (!cover) {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t\tconst detections = cover.faceDetections\n\n\t\t\tconst detection = detections.find(detection => detection.title === faceName)\n\n\t\t\t// Zoom into the picture so that the face fills the --photos-face-width box nicely\n\t\t\t// if the face is larger than the image, we don't zoom out (reason for the Math.max)\n\t\t\tconst zoom = Math.max(1, (1 / detection.width) * 0.4)\n\n\t\t\tconst horizontalCenterOfFace = (detection.x + detection.width / 2) * 100\n\t\t\tconst verticalCenterOfFace = (detection.y + detection.height / 2) * 100\n\n\t\t\treturn {\n\t\t\t\t// We assume that the image is inside a div with width: var(--photos-face-width)\n\t\t\t\twidth: '100%',\n\t\t\t\t// we translate the image so that the center of the detected face is in the center of the --photos-face-width box\n\t\t\t\t// and add the zoom\n\t\t\t\ttransform: `translate(calc( var(--photos-face-width)/2 - ${horizontalCenterOfFace}% ), calc( var(--photos-face-width)/2 - ${verticalCenterOfFace}% )) scale(${zoom})`,\n\t\t\t\t// this is necessary for the zoom to zoom toward the center of the face\n\t\t\t\ttransformOrigin: `${horizontalCenterOfFace}% ${verticalCenterOfFace}%`,\n\t\t\t}\n\t\t},\n\t},\n}\n","/**\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 { mapActions, mapGetters } from 'vuex'\n\nimport { showError } from '@nextcloud/dialogs'\nimport { getCurrentUser } from '@nextcloud/auth'\n\nimport client from '../services/DavClient.js'\nimport logger from '../services/logger.js'\nimport DavRequest from '../services/DavRequest'\nimport { genFileInfo } from '../utils/fileUtils'\nimport AbortControllerMixin from './AbortControllerMixin'\n\nexport default {\n\tname: 'FetchFacesMixin',\n\n\tdata() {\n\t\treturn {\n\t\t\terrorFetchingFaces: null,\n\t\t\tloadingFaces: false,\n\t\t\terrorFetchingFiles: null,\n\t\t\tloadingFiles: false,\n\t\t}\n\t},\n\n\tmixins: [\n\t\tAbortControllerMixin,\n\t],\n\n\tasync beforeMount() {\n\t\tthis.fetchFaces()\n\t},\n\n\tcomputed: {\n\t\t...mapGetters([\n\t\t\t'faces',\n\t\t]),\n\t},\n\n\tmethods: {\n\t\t...mapActions([\n\t\t\t'appendFiles',\n\t\t]),\n\n\t\tasync fetchFaces() {\n\t\t\tif (this.loadingFaces) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (Object.keys(this.faces).length) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tthis.loadingFaces = true\n\t\t\t\tthis.errorFetchingFaces = null\n\n\t\t\t\tconst faces = await client.getDirectoryContents(`/recognize/${getCurrentUser()?.uid}/faces/`, {\n\t\t\t\t\tsignal: this.abortController.signal,\n\t\t\t\t})\n\t\t\t\tthis.$store.dispatch('addFaces', { faces })\n\t\t\t\tlogger.debug(`[FetchFacesMixin] Fetched ${faces.length} new faces: `, faces)\n\t\t\t} catch (error) {\n\t\t\t\tif (error.response && error.response.status) {\n\t\t\t\t\tif (error.response.status === 404) {\n\t\t\t\t\t\tthis.errorFetchingFaces = 404\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.errorFetchingFaces = error\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlogger.error(t('photos', 'Failed to fetch faces list.'), error)\n\t\t\t\tshowError(t('photos', 'Failed to fetch faces list.'))\n\t\t\t} finally {\n\t\t\t\tthis.loadingFaces = false\n\t\t\t}\n\t\t},\n\n\t\tasync fetchFaceContent(faceName, force) {\n\t\t\tif (this.loadingFiles) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (!force && this.facesFiles[faceName] && this.facesFiles[faceName].length) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tthis.errorFetchingFiles = null\n\t\t\t\tthis.loadingFiles = true\n\n\t\t\t\tlet { data: fetchedFiles } = await client.getDirectoryContents(\n\t\t\t\t\t`/recognize/${getCurrentUser()?.uid}/faces/${faceName}`,\n\t\t\t\t\t{\n\t\t\t\t\t\tdata: DavRequest,\n\t\t\t\t\t\tdetails: true,\n\t\t\t\t\t\tsignal: this.abortController.signal,\n\t\t\t\t\t}\n\t\t\t\t)\n\n\t\t\t\tfetchedFiles = fetchedFiles\n\t\t\t\t\t.map(file => genFileInfo(file))\n\t\t\t\t\t.map(file => ({ ...file, filename: file.realpath.replace(`/${getCurrentUser().uid}/files`, '') }))\n\n\t\t\t\tconst fileIds = fetchedFiles.map(file => '' + file.fileid)\n\n\t\t\t\tthis.appendFiles(fetchedFiles)\n\n\t\t\t\tif (fetchedFiles.length > 0) {\n\t\t\t\t\tawait this.$store.commit('addFilesToFace', { faceName, fileIdsToAdd: fileIds })\n\t\t\t\t}\n\n\t\t\t\tlogger.debug(`[FetchFacesMixin] Fetched ${fileIds.length} new files: `, fileIds)\n\t\t\t} catch (error) {\n\t\t\t\tif (error.response && error.response.status) {\n\t\t\t\t\tif (error.response.status === 404) {\n\t\t\t\t\t\tthis.errorFetchingFiles = 404\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.errorFetchingFiles = error\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// cancelled request, moving on...\n\t\t\t\tlogger.error('Error fetching face files', error)\n\t\t\t} finally {\n\t\t\t\tthis.loadingFiles = false\n\t\t\t}\n\t\t},\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, \".face-cover[data-v-1f2ce110]{display:flex;flex-direction:column;padding:10px;border-radius:var(--border-radius-large)}.face-cover__crop-container[data-v-1f2ce110]{overflow:hidden;width:250px;height:250px;border-radius:250px;position:relative;background:var(--color-background-darker);--photos-face-width: 250px}@media only screen and (max-width: 1020px){.face-cover__crop-container[data-v-1f2ce110]{width:95px;height:95px;--photos-face-width: 95px}}.face-cover[data-v-1f2ce110]:hover,.face-cover[data-v-1f2ce110]:focus{background:var(--color-background-hover)}.face-cover__details[data-v-1f2ce110]{display:flex;flex-direction:column;width:250px;margin-top:4px;text-align:center}@media only screen and (max-width: 1020px){.face-cover__details[data-v-1f2ce110]{width:95px}}.face-cover__details__first-line[data-v-1f2ce110]{display:flex;height:2em;overflow:hidden;text-overflow:ellipsis}.face-cover__details__second-line[data-v-1f2ce110]{margin-top:6px;color:var(--color-text-maxcontrast)}.face-cover__details__name[data-v-1f2ce110]{flex-grow:1;margin:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/FaceCover.vue\"],\"names\":[],\"mappings\":\"AAmHA,6BACC,YAAA,CACA,qBAAA,CACA,YAAA,CACA,wCAAA,CAEA,6CACC,eAAA,CACA,WAAA,CACA,YAAA,CACA,mBAAA,CACA,iBAAA,CACA,yCAAA,CACA,0BAAA,CAEA,2CATD,6CAUE,UAAA,CACA,WAAA,CACA,yBAAA,CAAA,CAIF,sEACC,wCAAA,CAGD,sCACC,YAAA,CACA,qBAAA,CACA,WAAA,CACA,cAAA,CACA,iBAAA,CAEA,2CAPD,sCAQE,UAAA,CAAA,CAGD,kDACC,YAAA,CACA,UAAA,CACA,eAAA,CACA,sBAAA,CAGD,mDACC,cAAA,CACA,mCAAA,CAGD,4CACC,WAAA,CACA,QAAA\",\"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\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n.face-cover {\\n\\tdisplay: flex;\\n\\tflex-direction: column;\\n\\tpadding: 10px;\\n\\tborder-radius: var(--border-radius-large);\\n\\n\\t&__crop-container {\\n\\t\\toverflow: hidden;\\n\\t\\twidth: 250px;\\n\\t\\theight: 250px;\\n\\t\\tborder-radius: 250px;\\n\\t\\tposition: relative;\\n\\t\\tbackground: var(--color-background-darker);\\n\\t\\t--photos-face-width: 250px;\\n\\n\\t\\t@media only screen and (max-width: 1020px) {\\n\\t\\t\\twidth: 95px;\\n\\t\\t\\theight: 95px;\\n\\t\\t\\t--photos-face-width: 95px;\\n\\t\\t}\\n\\t}\\n\\n\\t&:hover, &:focus {\\n\\t\\tbackground: var(--color-background-hover);\\n\\t}\\n\\n\\t&__details {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\t\\twidth: 250px;\\n\\t\\tmargin-top: 4px;\\n\\t\\ttext-align: center;\\n\\n\\t\\t@media only screen and (max-width: 1020px) {\\n\\t\\t\\twidth: 95px;\\n\\t\\t}\\n\\n\\t\\t&__first-line {\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\theight: 2em;\\n\\t\\t\\toverflow: hidden;\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\t\\t}\\n\\n\\t\\t&__second-line {\\n\\t\\t\\tmargin-top: 6px;\\n\\t\\t\\tcolor: var(--color-text-maxcontrast);\\n\\t\\t}\\n\\n\\t\\t&__name {\\n\\t\\t\\tflex-grow: 1;\\n\\t\\t\\tmargin: 0;\\n\\t\\t}\\n\\t}\\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, \".faces[data-v-41711a97]{display:flex;flex-direction:column;height:calc(100vh - var(--header-height));padding-left:64px}@media only screen and (max-width: 1020px){.faces[data-v-41711a97]{padding:0}}.faces__header[data-v-41711a97]{display:flex;min-height:60px;align-items:center}.faces__header button[data-v-41711a97]{margin-right:32px}.faces__list[data-v-41711a97]{padding-top:24px;padding-bottom:32px;flex-grow:1;display:flex;flex-wrap:wrap;gap:32px;align-content:flex-start}.faces__empty[data-v-41711a97]{display:flex;flex-direction:column;align-items:center}.faces__empty__button[data-v-41711a97]{margin-top:32px}.empty-content-with-illustration[data-v-41711a97]  .empty-content__icon{width:200px;height:200px}.empty-content-with-illustration[data-v-41711a97]  .empty-content__icon svg{width:200px;height:200px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/views/Faces.vue\"],\"names\":[],\"mappings\":\"AAqGA,wBACC,YAAA,CACA,qBAAA,CACA,yCAAA,CACA,iBAAA,CAEA,2CAND,wBAOE,SAAA,CAAA,CAGD,gCACC,YAAA,CACA,eAAA,CACA,kBAAA,CAEA,uCACC,iBAAA,CAIF,8BACC,gBAAA,CACA,mBAAA,CACA,WAAA,CACA,YAAA,CACA,cAAA,CACA,QAAA,CACA,wBAAA,CAGD,+BACC,YAAA,CACA,qBAAA,CACA,kBAAA,CAEA,uCACC,eAAA,CAKH,wEACC,WAAA,CACA,YAAA,CAEA,4EACC,WAAA,CACA,YAAA\",\"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\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n.faces {\\n\\tdisplay: flex;\\n\\tflex-direction: column;\\n\\theight: calc(100vh - var(--header-height));\\n\\tpadding-left: 64px;\\n\\n\\t@media only screen and (max-width: 1020px) {\\n\\t\\tpadding: 0;\\n\\t}\\n\\n\\t&__header {\\n\\t\\tdisplay: flex;\\n\\t\\tmin-height: 60px;\\n\\t\\talign-items: center;\\n\\n\\t\\tbutton {\\n\\t\\t\\tmargin-right: 32px;\\n\\t\\t}\\n\\t}\\n\\n\\t&__list {\\n\\t\\tpadding-top: 24px;\\n\\t\\tpadding-bottom: 32px;\\n\\t\\tflex-grow: 1;\\n\\t\\tdisplay: flex;\\n\\t\\tflex-wrap: wrap;\\n\\t\\tgap: 32px;\\n\\t\\talign-content: flex-start;\\n\\t}\\n\\n\\t&__empty {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\t\\talign-items: center;\\n\\n\\t\\t&__button {\\n\\t\\t\\tmargin-top: 32px;\\n\\t\\t}\\n\\t}\\n}\\n\\n.empty-content-with-illustration ::v-deep .empty-content__icon {\\n\\twidth: 200px;\\n\\theight: 200px;\\n\\n\\tsvg {\\n\\t\\twidth: 200px;\\n\\t\\theight: 200px;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.errorFetchingFaces)?_c('NcEmptyContent',[_vm._v(\"\\n\\t\"+_vm._s(_vm.t('photos', 'An error occurred'))+\"\\n\")]):_c('div',{staticClass:\"faces\"},[(_vm.loadingFaces)?_c('NcLoadingIcon'):_vm._e(),_vm._v(\" \"),(_vm.noFaces && !_vm.loadingFaces)?_c('div',{staticClass:\"faces__empty\"},[_c('NcEmptyContent',{staticClass:\"empty-content-with-illustration\",scopedSlots:_vm._u([{key:\"icon\",fn:function(){return [_c('AccountBoxMultipleOutline')]},proxy:true},{key:\"desc\",fn:function(){return [_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('photos', 'This might take some time depending on the size of your photo library.'))+\"\\n\\t\\t\\t\")]},proxy:true}],null,false,3796275108)},[_vm._v(\" \"),_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.t('photos', 'Recognized people will show up here'))+\"\\n\\t\\t\")])],1):(!_vm.noFaces)?_c('div',{staticClass:\"faces__list\"},_vm._l((_vm.orderedFaces),function(face){return _c('FaceCover',{key:face.basename,attrs:{\"base-name\":face.basename}})}),1):_vm._e()],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<!--\n - @copyright Copyright (c) 2022 Louis Chemineau <louis@chmn.me>\n - @copyright Copyright (c) 2022 Marcel Klehr <mklehr@gmx.net>\n -\n - @author Louis Chemineau <louis@chmn.me>\n - @author Marcel Klehr <mklehr@gmx.net>\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<router-link class=\"face-cover\" :to=\"`/faces/${baseName}`\">\n\t\t<div class=\"face-cover__crop-container\">\n\t\t\t<img ref=\"image\"\n\t\t\t\tclass=\"face-cover__image\"\n\t\t\t\t:src=\"coverUrl\"\n\t\t\t\t:style=\"coverDimensions\">\n\t\t</div>\n\t\t<div class=\"face-cover__details\">\n\t\t\t<div v-if=\"!baseName.match(/^[0-9]+$/)\" class=\"face-cover__details__first-line\">\n\t\t\t\t<h2 class=\"face-cover__details__name\">\n\t\t\t\t\t{{ baseName }}\n\t\t\t\t</h2>\n\t\t\t</div>\n\t\t\t<div v-if=\"facesFiles[baseName]\" class=\"face-cover__details__second-line\">\n\t\t\t\t{{ n('photos', '%n photos', '%n photos', facesFiles[baseName].length,) }}\n\t\t\t</div>\n\t\t</div>\n\t</router-link>\n</template>\n\n<script>\nimport { mapGetters } from 'vuex'\nimport { generateUrl } from '@nextcloud/router'\nimport FetchFacesMixin from '../mixins/FetchFacesMixin.js'\nimport FaceCoverMixin from '../mixins/FaceCoverMixin.js'\n\nexport default {\n\tname: 'FaceCover',\n\n\tmixins: [\n\t\tFetchFacesMixin,\n\t\tFaceCoverMixin,\n\t],\n\n\tprops: {\n\t\tbaseName: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t},\n\n\tcomputed: {\n\t\t...mapGetters([\n\t\t\t'files',\n\t\t\t'faces',\n\t\t\t'facesFiles',\n\t\t]),\n\n\t\t/**\n\t\t * @return {Face}\n\t\t */\n\t\tface() {\n\t\t\treturn this.faces[this.baseName]\n\t\t},\n\n\t\t/**\n\t\t * @return {string}\n\t\t */\n\t\tcoverUrl() {\n\t\t\tif (!this.cover) {\n\t\t\t\treturn ''\n\t\t\t}\n\n\t\t\treturn generateUrl(`/apps/photos/api/v1/preview/${this.cover.fileid}?x=${512}&y=${512}`)\n\t\t},\n\n\t\tcover() {\n\t\t\treturn this.getFaceCover(this.face.basename)\n\t\t},\n\n\t\tcoverDimensions() {\n\t\t\tif (!this.cover) return {}\n\t\t\treturn this.getCoverStyle(this.face.basename)\n\t\t},\n\t},\n\n\tasync beforeMount() {\n\t\tawait this.fetchFiles()\n\t},\n\n\tmethods: {\n\t\tasync fetchFiles() {\n\t\t\tawait this.fetchFaceContent(this.face.basename)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.face-cover {\n\tdisplay: flex;\n\tflex-direction: column;\n\tpadding: 10px;\n\tborder-radius: var(--border-radius-large);\n\n\t&__crop-container {\n\t\toverflow: hidden;\n\t\twidth: 250px;\n\t\theight: 250px;\n\t\tborder-radius: 250px;\n\t\tposition: relative;\n\t\tbackground: var(--color-background-darker);\n\t\t--photos-face-width: 250px;\n\n\t\t@media only screen and (max-width: 1020px) {\n\t\t\twidth: 95px;\n\t\t\theight: 95px;\n\t\t\t--photos-face-width: 95px;\n\t\t}\n\t}\n\n\t&:hover, &:focus {\n\t\tbackground: var(--color-background-hover);\n\t}\n\n\t&__details {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\twidth: 250px;\n\t\tmargin-top: 4px;\n\t\ttext-align: center;\n\n\t\t@media only screen and (max-width: 1020px) {\n\t\t\twidth: 95px;\n\t\t}\n\n\t\t&__first-line {\n\t\t\tdisplay: flex;\n\t\t\theight: 2em;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t&__second-line {\n\t\t\tmargin-top: 6px;\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t}\n\n\t\t&__name {\n\t\t\tflex-grow: 1;\n\t\t\tmargin: 0;\n\t\t}\n\t}\n}\n</style>\n","import mod from \"-!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FaceCover.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!./FaceCover.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[0].rules[0].use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FaceCover.vue?vue&type=style&index=0&id=1f2ce110&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[0].rules[0].use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FaceCover.vue?vue&type=style&index=0&id=1f2ce110&lang=scss&scoped=true&\";\n       export default content && content.locals ? content.locals : undefined;\n","<!--\n - @copyright Copyright (c) 2022 Louis Chemineau <louis@chmn.me>\n - @copyright Copyright (c) 2022 Marcel Klehr <mklehr@gmx.net>\n -\n - @author Louis Chemineau <louis@chmn.me>\n - @author Marcel Klehr <mklehr@gmx.net>\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<template>\n\t<!-- Errors handlers-->\n\t<NcEmptyContent v-if=\"errorFetchingFaces\">\n\t\t{{ t('photos', 'An error occurred') }}\n\t</NcEmptyContent>\n\n\t<!-- Face list -->\n\t<div v-else class=\"faces\">\n\t\t<NcLoadingIcon v-if=\"loadingFaces\" />\n\n\t\t<!-- No faces -->\n\t\t<div v-if=\"noFaces && !loadingFaces\" class=\"faces__empty\">\n\t\t\t<NcEmptyContent class=\"empty-content-with-illustration\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<AccountBoxMultipleOutline />\n\t\t\t\t</template>\n\t\t\t\t<template #desc>\n\t\t\t\t\t{{ t('photos', 'This might take some time depending on the size of your photo library.') }}\n\t\t\t\t</template>\n\t\t\t\t{{ t('photos', 'Recognized people will show up here') }}\n\t\t\t</NcEmptyContent>\n\t\t</div>\n\n\t\t<div v-else-if=\"!noFaces\" class=\"faces__list\">\n\t\t\t<FaceCover v-for=\"face in orderedFaces\"\n\t\t\t\t:key=\"face.basename\"\n\t\t\t\t:base-name=\"face.basename\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport AccountBoxMultipleOutline from 'vue-material-design-icons/AccountBoxMultipleOutline'\n\nimport { NcEmptyContent, NcLoadingIcon } from '@nextcloud/vue'\n\nimport FetchFacesMixin from '../mixins/FetchFacesMixin.js'\nimport FaceCover from '../components/FaceCover.vue'\nimport { mapGetters } from 'vuex'\n\nexport default {\n\tname: 'Faces',\n\tcomponents: {\n\t\tFaceCover,\n\t\tNcEmptyContent,\n\t\tNcLoadingIcon,\n\t\tAccountBoxMultipleOutline,\n\t},\n\n\tmixins: [\n\t\tFetchFacesMixin,\n\t],\n\n\tcomputed: {\n\t\t...mapGetters([\n\t\t\t'facesFiles',\n\t\t]),\n\n\t\t/**\n\t\t * @return {boolean} Whether the list of face is empty or not.\n\t\t */\n\t\tnoFaces() {\n\t\t\treturn Object.keys(this.faces).length === 0\n\t\t},\n\n\t\torderedFaces() {\n\t\t\treturn Object.values(this.faces).sort((a, b) => {\n\t\t\t\tif (!this.facesFiles[b.basename] || !this.facesFiles[a.basename]) {\n\t\t\t\t\treturn 0\n\t\t\t\t}\n\t\t\t\treturn this.facesFiles[b.basename].length - this.facesFiles[a.basename].length\n\t\t\t})\n\t\t},\n\t},\n}\n</script>\n<style lang=\"scss\" scoped>\n.faces {\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: calc(100vh - var(--header-height));\n\tpadding-left: 64px;\n\n\t@media only screen and (max-width: 1020px) {\n\t\tpadding: 0;\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tmin-height: 60px;\n\t\talign-items: center;\n\n\t\tbutton {\n\t\t\tmargin-right: 32px;\n\t\t}\n\t}\n\n\t&__list {\n\t\tpadding-top: 24px;\n\t\tpadding-bottom: 32px;\n\t\tflex-grow: 1;\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 32px;\n\t\talign-content: flex-start;\n\t}\n\n\t&__empty {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\n\t\t&__button {\n\t\t\tmargin-top: 32px;\n\t\t}\n\t}\n}\n\n.empty-content-with-illustration ::v-deep .empty-content__icon {\n\twidth: 200px;\n\theight: 200px;\n\n\tsvg {\n\t\twidth: 200px;\n\t\theight: 200px;\n\t}\n}\n</style>\n","import mod from \"-!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Faces.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!./Faces.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./FaceCover.vue?vue&type=template&id=1f2ce110&scoped=true&\"\nimport script from \"./FaceCover.vue?vue&type=script&lang=js&\"\nexport * from \"./FaceCover.vue?vue&type=script&lang=js&\"\nimport style0 from \"./FaceCover.vue?vue&type=style&index=0&id=1f2ce110&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  \"1f2ce110\",\n  null\n  \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('router-link',{staticClass:\"face-cover\",attrs:{\"to\":(\"/faces/\" + _vm.baseName)}},[_c('div',{staticClass:\"face-cover__crop-container\"},[_c('img',{ref:\"image\",staticClass:\"face-cover__image\",style:(_vm.coverDimensions),attrs:{\"src\":_vm.coverUrl}})]),_vm._v(\" \"),_c('div',{staticClass:\"face-cover__details\"},[(!_vm.baseName.match(/^[0-9]+$/))?_c('div',{staticClass:\"face-cover__details__first-line\"},[_c('h2',{staticClass:\"face-cover__details__name\"},[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.baseName)+\"\\n\\t\\t\\t\")])]):_vm._e(),_vm._v(\" \"),(_vm.facesFiles[_vm.baseName])?_c('div',{staticClass:\"face-cover__details__second-line\"},[_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.n('photos', '%n photos', '%n photos', _vm.facesFiles[_vm.baseName].length))+\"\\n\\t\\t\")]):_vm._e()])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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[0].rules[0].use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Faces.vue?vue&type=style&index=0&id=41711a97&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[0].rules[0].use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Faces.vue?vue&type=style&index=0&id=41711a97&lang=scss&scoped=true&\";\n       export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./Faces.vue?vue&type=template&id=41711a97&scoped=true&\"\nimport script from \"./Faces.vue?vue&type=script&lang=js&\"\nexport * from \"./Faces.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Faces.vue?vue&type=style&index=0&id=41711a97&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  \"41711a97\",\n  null\n  \n)\n\nexport default component.exports"],"names":["name","data","abortController","AbortController","beforeDestroy","this","abort","beforeRouteLeave","from","to","next","computed","mapGetters","methods","getFaceCover","faceName","scoreFacePosition","faceDetection","Math","max","x","width","y","height","facesFiles","slice","map","fileId","files","file","faceDetections","JSON","parse","he","sort","a","b","find","d","title","length","getCoverStyle","cover","detection","zoom","horizontalCenterOfFace","verticalCenterOfFace","transform","transformOrigin","errorFetchingFaces","loadingFaces","errorFetchingFiles","loadingFiles","mixins","AbortControllerMixin","beforeMount","fetchFaces","mapActions","Object","keys","faces","client","getCurrentUser","uid","signal","$store","dispatch","logger","response","status","t","showError","fetchFaceContent","force","DavRequest","details","fetchedFiles","genFileInfo","filename","realpath","replace","fileIds","fileid","appendFiles","commit","fileIdsToAdd","___CSS_LOADER_EXPORT___","push","module","id","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","_vm","_h","$createElement","_c","_self","staticClass","attrs","baseName","ref","style","coverUrl","_v","match","_e","_s","n","noFaces","scopedSlots","_u","key","fn","proxy","_l","face","basename"],"sourceRoot":""}