From 8c14f975497d77ab752e6fff36376346b8fe805d Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Tue, 28 Jan 2025 13:02:34 +0100 Subject: [PATCH] fix: invalid keys Signed-off-by: skjnldsv Signed-off-by: nextcloud-command --- ...WeTm.chunk.css => main-BABkysn0.chunk.css} | 2 +- css/viewer-main.css | 2 +- js/viewer-main.mjs | 2 +- js/viewer-main.mjs.map | 2 +- src/views/Viewer.vue | 40 ++++++++++++------- 5 files changed, 29 insertions(+), 19 deletions(-) rename css/{main-Ck_4WeTm.chunk.css => main-BABkysn0.chunk.css} (85%) diff --git a/css/main-Ck_4WeTm.chunk.css b/css/main-BABkysn0.chunk.css similarity index 85% rename from css/main-Ck_4WeTm.chunk.css rename to css/main-BABkysn0.chunk.css index 3e5d22f37..01e08233c 100644 --- a/css/main-Ck_4WeTm.chunk.css +++ b/css/main-BABkysn0.chunk.css @@ -7,4 +7,4 @@ */._file-picker__file-icon_19mjt_9{width:32px;height:32px;min-width:32px;min-height:32px;background-repeat:no-repeat;background-size:contain;display:flex;justify-content:center}tr.file-picker__row[data-v-15187afc]{height:var(--row-height, 50px)}tr.file-picker__row td[data-v-15187afc]{cursor:pointer;overflow:hidden;text-overflow:ellipsis;border-bottom:none}tr.file-picker__row td.row-checkbox[data-v-15187afc]{padding:0 2px}tr.file-picker__row td[data-v-15187afc]:not(.row-checkbox){padding-inline:14px 0}tr.file-picker__row td.row-size[data-v-15187afc]{text-align:end;padding-inline:0 14px}tr.file-picker__row td.row-name[data-v-15187afc]{padding-inline:2px 0}@keyframes gradient-15187afc{0%{background-position:0% 50%}50%{background-position:100% 50%}to{background-position:0% 50%}}.loading-row .row-checkbox[data-v-15187afc]{text-align:center!important}.loading-row span[data-v-15187afc]{display:inline-block;height:24px;background:linear-gradient(to right,var(--color-background-darker),var(--color-text-maxcontrast),var(--color-background-darker));background-size:600px 100%;border-radius:var(--border-radius);animation:gradient-15187afc 12s ease infinite}.loading-row .row-wrapper[data-v-15187afc]{display:inline-flex;align-items:center}.loading-row .row-checkbox span[data-v-15187afc]{width:24px}.loading-row .row-name span[data-v-15187afc]:last-of-type{margin-inline-start:6px;width:130px}.loading-row .row-size span[data-v-15187afc]{width:80px}.loading-row .row-modified span[data-v-15187afc]{width:90px}/*! * SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later -*/tr.file-picker__row[data-v-cb12dccb]{height:var(--row-height, 50px)}tr.file-picker__row td[data-v-cb12dccb]{cursor:pointer;overflow:hidden;text-overflow:ellipsis;border-bottom:none}tr.file-picker__row td.row-checkbox[data-v-cb12dccb]{padding:0 2px}tr.file-picker__row td[data-v-cb12dccb]:not(.row-checkbox){padding-inline:14px 0}tr.file-picker__row td.row-size[data-v-cb12dccb]{text-align:end;padding-inline:0 14px}tr.file-picker__row td.row-name[data-v-cb12dccb]{padding-inline:2px 0}.file-picker__row--selected[data-v-cb12dccb]{background-color:var(--color-background-dark)}.file-picker__row[data-v-cb12dccb]:hover{background-color:var(--color-background-hover)}.file-picker__name-container[data-v-cb12dccb]{display:flex;justify-content:start;align-items:center;height:100%}.file-picker__file-name[data-v-cb12dccb]{padding-inline-start:6px;min-width:0;overflow:hidden;text-overflow:ellipsis}.file-picker__file-extension[data-v-cb12dccb]{color:var(--color-text-maxcontrast);min-width:fit-content}.file-picker__header-preview[data-v-006fdbd0]{width:22px;height:32px;flex:0 0 auto}.file-picker__files[data-v-006fdbd0]{margin:2px;margin-inline-start:12px;overflow:scroll auto}.file-picker__files table[data-v-006fdbd0]{width:100%;max-height:100%;table-layout:fixed}.file-picker__files th[data-v-006fdbd0]{position:-webkit-sticky;position:sticky;z-index:1;top:0;background-color:var(--color-main-background);padding:2px}.file-picker__files th .header-wrapper[data-v-006fdbd0]{display:flex}.file-picker__files th.row-checkbox[data-v-006fdbd0]{width:44px}.file-picker__files th.row-name[data-v-006fdbd0]{width:230px}.file-picker__files th.row-size[data-v-006fdbd0]{width:100px}.file-picker__files th.row-modified[data-v-006fdbd0]{width:120px}.file-picker__files th[data-v-006fdbd0]:not(.row-size) .button-vue__wrapper{justify-content:start;flex-direction:row-reverse}.file-picker__files th[data-v-006fdbd0]:not(.row-size) .button-vue{padding-inline:16px 4px}.file-picker__files th.row-size[data-v-006fdbd0] .button-vue__wrapper{justify-content:end}.file-picker__files th[data-v-006fdbd0] .button-vue__wrapper{color:var(--color-text-maxcontrast)}.file-picker__files th[data-v-006fdbd0] .button-vue__wrapper .button-vue__text{font-weight:400}.file-picker__breadcrumbs[data-v-b357227a]{flex-grow:0!important}.file-picker__side[data-v-b42054b8]{display:flex;flex-direction:column;align-items:stretch;gap:.5rem;min-width:200px;padding:2px;margin-block-start:7px;overflow:auto}.file-picker__side[data-v-b42054b8] .button-vue__wrapper{justify-content:start}.file-picker__filter-input[data-v-b42054b8]{margin-block:7px;max-width:260px}@media (max-width: 736px){.file-picker__side[data-v-b42054b8]{flex-direction:row;min-width:unset}}@media (max-width: 512px){.file-picker__side[data-v-b42054b8]{flex-direction:row;min-width:unset}.file-picker__filter-input[data-v-b42054b8]{max-width:unset}}.file-picker__navigation{padding-inline:8px 2px}.file-picker__navigation,.file-picker__navigation *{box-sizing:border-box}.file-picker__navigation .v-select.select{min-width:220px}@media (min-width: 513px) and (max-width: 736px){.file-picker__navigation{gap:11px}}@media (max-width: 512px){.file-picker__navigation{flex-direction:column-reverse!important}}.file-picker__view[data-v-20b719ba]{height:50px;display:flex;justify-content:start;align-items:center}.file-picker__view h3[data-v-20b719ba]{font-weight:700;height:fit-content;margin:0}.file-picker__main[data-v-20b719ba]{box-sizing:border-box;width:100%;display:flex;flex-direction:column;min-height:0;flex:1;padding-inline:2px}.file-picker__main *[data-v-20b719ba]{box-sizing:border-box}[data-v-20b719ba] .file-picker{height:min(80vh,800px)!important}@media (max-width: 512px){[data-v-20b719ba] .file-picker{height:calc(100% - 16px - var(--default-clickable-area))!important}}[data-v-20b719ba] .file-picker__content{display:flex;flex-direction:column;overflow:hidden}#emptycontent[data-v-6a8e09db]{margin:0;padding:10% 5%;background-color:var(--color-main-background)}.viewer.modal-mask[data-v-9cfc56d0]{transition:width ease .1s,background-color .3s ease}.viewer[data-v-9cfc56d0] .modal-container,.viewer__content[data-v-9cfc56d0]{overflow:visible!important;cursor:pointer}.viewer--split[data-v-9cfc56d0]{display:flex}.viewer--split .viewer__file--active[data-v-9cfc56d0]{width:50%;left:0;position:relative}.viewer[data-v-9cfc56d0] .modal-wrapper .modal-container{top:var(--header-height);bottom:var(--header-height);height:auto;background-color:transparent;box-shadow:none}.viewer__content[data-v-9cfc56d0]{width:100%;height:100%}.viewer__file-wrapper[data-v-9cfc56d0]{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.viewer__file-wrapper--hidden[data-v-9cfc56d0]{position:absolute;z-index:-1;left:-10000px}.viewer__file[data-v-9cfc56d0]{transition:height .1s ease,width .1s ease}.viewer.theme--dark[data-v-9cfc56d0] .button-vue--vue-tertiary:hover{background-color:#ffffff14!important}.viewer.theme--dark[data-v-9cfc56d0] .button-vue--vue-tertiary:focus,.viewer.theme--dark[data-v-9cfc56d0] .button-vue--vue-tertiary:focus-visible{background-color:#ffffff14!important;outline:2px solid var(--color-primary-element)!important}.viewer.theme--dark[data-v-9cfc56d0] .button-vue--vue-tertiary.action-item__menutoggle{background-color:transparent}.viewer.theme--undefined.modal-mask[data-v-9cfc56d0]{background-color:transparent!important}.viewer.theme--light.modal-mask[data-v-9cfc56d0]{background-color:#ffffffeb!important}.viewer.theme--light[data-v-9cfc56d0] .modal-header__name,.viewer.theme--light[data-v-9cfc56d0] .modal-header .icons-menu button svg{color:#000!important}.viewer.theme--default.modal-mask[data-v-9cfc56d0]{background-color:var(--color-main-background)!important}.viewer.theme--default[data-v-9cfc56d0] .modal-header__name,.viewer.theme--default[data-v-9cfc56d0] .modal-header .icons-menu{color:var(--color-main-text)!important}.viewer.theme--default[data-v-9cfc56d0] .modal-header__name button svg,.viewer.theme--default[data-v-9cfc56d0] .modal-header__name a,.viewer.theme--default[data-v-9cfc56d0] .modal-header .icons-menu button svg,.viewer.theme--default[data-v-9cfc56d0] .modal-header .icons-menu a{color:var(--color-main-text)!important}.viewer.image--fullscreen[data-v-9cfc56d0] .modal-header .modal-header__name{opacity:0}.viewer.image--fullscreen[data-v-9cfc56d0] .modal-header .icons-menu{background-color:#0003}.viewer.image--fullscreen[data-v-9cfc56d0] .modal-wrapper .modal-container{top:0;bottom:0;height:100%}.component-fade-enter-active,.component-fade-leave-active{transition:opacity .3s ease}.component-fade-enter,.component-fade-leave-to{opacity:0}#viewer.modal-mask--dark .action-item--single.icon-menu-sidebar{background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='16'%20width='16'%20version='1.1'%20viewbox='0%200%2016%2016'%3e%3cpath%20d='m2%202c-0.554%200-1%200.446-1%201s0.446%201%201%201h12c0.554%200%201-0.446%201-1s-0.446-1-1-1h-12zm9.717%204.0059c-1.247%200-2.1428%201.0199-2.1428%201.998%200%200.9995%200.0726%201.7127%200.5718%202.4981%200.16%200.207%200.347%200.251%200.5%200.43%200.097%200.357%200.171%200.713%200.071%201.07-0.311%200.109-0.607%200.237-0.9065%200.357-0.364-0.195-0.7863-0.357-1.1503-0.5-0.05-0.2-0.0129-0.347%200.0371-0.535%200.0856-0.089%200.163-0.129%200.2558-0.215%200.2642-0.321%200.2793-0.864%200.2793-1.2496%200-0.5712-0.5135-0.9981-1.0703-0.9981-0.6211%200-1.0723%200.5126-1.0723%200.9981h-0.0136c0%200.4996%200.0353%200.8576%200.2851%201.2496%200.0714%200.107%200.1729%200.126%200.25%200.215%200.0481%200.179%200.0859%200.357%200.0352%200.535-0.4569%200.16-0.8863%200.357-1.2832%200.571-0.2999%200.214-0.1668%200.131-0.3574%200.822-0.0886%200.357%200.928%200.521%201.6562%200.578-0.0357%200.196-0.0857%200.457-0.2285%200.957-0.2285%200.893%203.1074%201.213%204.2834%201.213%201.735%200%204.507-0.325%204.269-1.213-0.371-1.385-0.15-1.221-0.701-1.642-0.778-0.467-1.749-0.834-2.568-1.143-0.107-0.398-0.03-0.692%200.07-1.07%200.168-0.179%200.357-0.259%200.514-0.43%200.492-0.6312%200.556-1.7299%200.556-2.4981%200-1.1323-1.019-1.998-2.14-1.998zm-9.717%200.9941c-0.554%200-1%200.446-1%201s0.446%201%201%201h4.2852c0.0891-0.1855%200.2-0.3648%200.3515-0.5195%200.3721-0.3801%200.9171-0.5988%201.4883-0.6192h0.0098%200.0097c0.1729%200.017%200.3042%200.0597%200.4297%200.1426%200-0.3488%200.0747-0.6853%200.1953-1.0039h-6.7695zm0%205c-0.554%200-1%200.446-1%201s0.446%201%201%201h3.25c-0.0375-0.049-0.0777-0.09-0.1113-0.152-0.1221-0.228-0.1706-0.568-0.1035-0.838l0.0019-0.012%200.0039-0.012c0.0822-0.298%200.0556-0.322%200.1445-0.615%200.0313-0.103%200.1114-0.245%200.1993-0.371h-3.3848z'%20fill='%23fff'/%3e%3c/svg%3e")}#viewer.modal-mask--dark .action-item--single.icon-download{background-image:var(--icon-download-fff)}.ui-autocomplete{z-index:2050!important} +*/tr.file-picker__row[data-v-cb12dccb]{height:var(--row-height, 50px)}tr.file-picker__row td[data-v-cb12dccb]{cursor:pointer;overflow:hidden;text-overflow:ellipsis;border-bottom:none}tr.file-picker__row td.row-checkbox[data-v-cb12dccb]{padding:0 2px}tr.file-picker__row td[data-v-cb12dccb]:not(.row-checkbox){padding-inline:14px 0}tr.file-picker__row td.row-size[data-v-cb12dccb]{text-align:end;padding-inline:0 14px}tr.file-picker__row td.row-name[data-v-cb12dccb]{padding-inline:2px 0}.file-picker__row--selected[data-v-cb12dccb]{background-color:var(--color-background-dark)}.file-picker__row[data-v-cb12dccb]:hover{background-color:var(--color-background-hover)}.file-picker__name-container[data-v-cb12dccb]{display:flex;justify-content:start;align-items:center;height:100%}.file-picker__file-name[data-v-cb12dccb]{padding-inline-start:6px;min-width:0;overflow:hidden;text-overflow:ellipsis}.file-picker__file-extension[data-v-cb12dccb]{color:var(--color-text-maxcontrast);min-width:fit-content}.file-picker__header-preview[data-v-006fdbd0]{width:22px;height:32px;flex:0 0 auto}.file-picker__files[data-v-006fdbd0]{margin:2px;margin-inline-start:12px;overflow:scroll auto}.file-picker__files table[data-v-006fdbd0]{width:100%;max-height:100%;table-layout:fixed}.file-picker__files th[data-v-006fdbd0]{position:-webkit-sticky;position:sticky;z-index:1;top:0;background-color:var(--color-main-background);padding:2px}.file-picker__files th .header-wrapper[data-v-006fdbd0]{display:flex}.file-picker__files th.row-checkbox[data-v-006fdbd0]{width:44px}.file-picker__files th.row-name[data-v-006fdbd0]{width:230px}.file-picker__files th.row-size[data-v-006fdbd0]{width:100px}.file-picker__files th.row-modified[data-v-006fdbd0]{width:120px}.file-picker__files th[data-v-006fdbd0]:not(.row-size) .button-vue__wrapper{justify-content:start;flex-direction:row-reverse}.file-picker__files th[data-v-006fdbd0]:not(.row-size) .button-vue{padding-inline:16px 4px}.file-picker__files th.row-size[data-v-006fdbd0] .button-vue__wrapper{justify-content:end}.file-picker__files th[data-v-006fdbd0] .button-vue__wrapper{color:var(--color-text-maxcontrast)}.file-picker__files th[data-v-006fdbd0] .button-vue__wrapper .button-vue__text{font-weight:400}.file-picker__breadcrumbs[data-v-b357227a]{flex-grow:0!important}.file-picker__side[data-v-b42054b8]{display:flex;flex-direction:column;align-items:stretch;gap:.5rem;min-width:200px;padding:2px;margin-block-start:7px;overflow:auto}.file-picker__side[data-v-b42054b8] .button-vue__wrapper{justify-content:start}.file-picker__filter-input[data-v-b42054b8]{margin-block:7px;max-width:260px}@media (max-width: 736px){.file-picker__side[data-v-b42054b8]{flex-direction:row;min-width:unset}}@media (max-width: 512px){.file-picker__side[data-v-b42054b8]{flex-direction:row;min-width:unset}.file-picker__filter-input[data-v-b42054b8]{max-width:unset}}.file-picker__navigation{padding-inline:8px 2px}.file-picker__navigation,.file-picker__navigation *{box-sizing:border-box}.file-picker__navigation .v-select.select{min-width:220px}@media (min-width: 513px) and (max-width: 736px){.file-picker__navigation{gap:11px}}@media (max-width: 512px){.file-picker__navigation{flex-direction:column-reverse!important}}.file-picker__view[data-v-20b719ba]{height:50px;display:flex;justify-content:start;align-items:center}.file-picker__view h3[data-v-20b719ba]{font-weight:700;height:fit-content;margin:0}.file-picker__main[data-v-20b719ba]{box-sizing:border-box;width:100%;display:flex;flex-direction:column;min-height:0;flex:1;padding-inline:2px}.file-picker__main *[data-v-20b719ba]{box-sizing:border-box}[data-v-20b719ba] .file-picker{height:min(80vh,800px)!important}@media (max-width: 512px){[data-v-20b719ba] .file-picker{height:calc(100% - 16px - var(--default-clickable-area))!important}}[data-v-20b719ba] .file-picker__content{display:flex;flex-direction:column;overflow:hidden}#emptycontent[data-v-6a8e09db]{margin:0;padding:10% 5%;background-color:var(--color-main-background)}.viewer.modal-mask[data-v-61dd46e0]{transition:width ease .1s,background-color .3s ease}.viewer[data-v-61dd46e0] .modal-container,.viewer__content[data-v-61dd46e0]{overflow:visible!important;cursor:pointer}.viewer--split[data-v-61dd46e0]{display:flex}.viewer--split .viewer__file--active[data-v-61dd46e0]{width:50%;left:0;position:relative}.viewer[data-v-61dd46e0] .modal-wrapper .modal-container{top:var(--header-height);bottom:var(--header-height);height:auto;background-color:transparent;box-shadow:none}.viewer__content[data-v-61dd46e0]{width:100%;height:100%}.viewer__file-wrapper[data-v-61dd46e0]{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.viewer__file-wrapper--hidden[data-v-61dd46e0]{position:absolute;z-index:-1;left:-10000px}.viewer__file[data-v-61dd46e0]{transition:height .1s ease,width .1s ease}.viewer.theme--dark[data-v-61dd46e0] .button-vue--vue-tertiary:hover{background-color:#ffffff14!important}.viewer.theme--dark[data-v-61dd46e0] .button-vue--vue-tertiary:focus,.viewer.theme--dark[data-v-61dd46e0] .button-vue--vue-tertiary:focus-visible{background-color:#ffffff14!important;outline:2px solid var(--color-primary-element)!important}.viewer.theme--dark[data-v-61dd46e0] .button-vue--vue-tertiary.action-item__menutoggle{background-color:transparent}.viewer.theme--undefined.modal-mask[data-v-61dd46e0]{background-color:transparent!important}.viewer.theme--light.modal-mask[data-v-61dd46e0]{background-color:#ffffffeb!important}.viewer.theme--light[data-v-61dd46e0] .modal-header__name,.viewer.theme--light[data-v-61dd46e0] .modal-header .icons-menu button svg{color:#000!important}.viewer.theme--default.modal-mask[data-v-61dd46e0]{background-color:var(--color-main-background)!important}.viewer.theme--default[data-v-61dd46e0] .modal-header__name,.viewer.theme--default[data-v-61dd46e0] .modal-header .icons-menu{color:var(--color-main-text)!important}.viewer.theme--default[data-v-61dd46e0] .modal-header__name button svg,.viewer.theme--default[data-v-61dd46e0] .modal-header__name a,.viewer.theme--default[data-v-61dd46e0] .modal-header .icons-menu button svg,.viewer.theme--default[data-v-61dd46e0] .modal-header .icons-menu a{color:var(--color-main-text)!important}.viewer.image--fullscreen[data-v-61dd46e0] .modal-header .modal-header__name{opacity:0}.viewer.image--fullscreen[data-v-61dd46e0] .modal-header .icons-menu{background-color:#0003}.viewer.image--fullscreen[data-v-61dd46e0] .modal-wrapper .modal-container{top:0;bottom:0;height:100%}.component-fade-enter-active,.component-fade-leave-active{transition:opacity .3s ease}.component-fade-enter,.component-fade-leave-to{opacity:0}#viewer.modal-mask--dark .action-item--single.icon-menu-sidebar{background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='16'%20width='16'%20version='1.1'%20viewbox='0%200%2016%2016'%3e%3cpath%20d='m2%202c-0.554%200-1%200.446-1%201s0.446%201%201%201h12c0.554%200%201-0.446%201-1s-0.446-1-1-1h-12zm9.717%204.0059c-1.247%200-2.1428%201.0199-2.1428%201.998%200%200.9995%200.0726%201.7127%200.5718%202.4981%200.16%200.207%200.347%200.251%200.5%200.43%200.097%200.357%200.171%200.713%200.071%201.07-0.311%200.109-0.607%200.237-0.9065%200.357-0.364-0.195-0.7863-0.357-1.1503-0.5-0.05-0.2-0.0129-0.347%200.0371-0.535%200.0856-0.089%200.163-0.129%200.2558-0.215%200.2642-0.321%200.2793-0.864%200.2793-1.2496%200-0.5712-0.5135-0.9981-1.0703-0.9981-0.6211%200-1.0723%200.5126-1.0723%200.9981h-0.0136c0%200.4996%200.0353%200.8576%200.2851%201.2496%200.0714%200.107%200.1729%200.126%200.25%200.215%200.0481%200.179%200.0859%200.357%200.0352%200.535-0.4569%200.16-0.8863%200.357-1.2832%200.571-0.2999%200.214-0.1668%200.131-0.3574%200.822-0.0886%200.357%200.928%200.521%201.6562%200.578-0.0357%200.196-0.0857%200.457-0.2285%200.957-0.2285%200.893%203.1074%201.213%204.2834%201.213%201.735%200%204.507-0.325%204.269-1.213-0.371-1.385-0.15-1.221-0.701-1.642-0.778-0.467-1.749-0.834-2.568-1.143-0.107-0.398-0.03-0.692%200.07-1.07%200.168-0.179%200.357-0.259%200.514-0.43%200.492-0.6312%200.556-1.7299%200.556-2.4981%200-1.1323-1.019-1.998-2.14-1.998zm-9.717%200.9941c-0.554%200-1%200.446-1%201s0.446%201%201%201h4.2852c0.0891-0.1855%200.2-0.3648%200.3515-0.5195%200.3721-0.3801%200.9171-0.5988%201.4883-0.6192h0.0098%200.0097c0.1729%200.017%200.3042%200.0597%200.4297%200.1426%200-0.3488%200.0747-0.6853%200.1953-1.0039h-6.7695zm0%205c-0.554%200-1%200.446-1%201s0.446%201%201%201h3.25c-0.0375-0.049-0.0777-0.09-0.1113-0.152-0.1221-0.228-0.1706-0.568-0.1035-0.838l0.0019-0.012%200.0039-0.012c0.0822-0.298%200.0556-0.322%200.1445-0.615%200.0313-0.103%200.1114-0.245%200.1993-0.371h-3.3848z'%20fill='%23fff'/%3e%3c/svg%3e")}#viewer.modal-mask--dark .action-item--single.icon-download{background-image:var(--icon-download-fff)}.ui-autocomplete{z-index:2050!important} diff --git a/css/viewer-main.css b/css/viewer-main.css index 7b6010de1..e47ae9f8a 100644 --- a/css/viewer-main.css +++ b/css/viewer-main.css @@ -1,3 +1,3 @@ /* extracted by css-entry-points-plugin */ -@import './main-Ck_4WeTm.chunk.css'; +@import './main-BABkysn0.chunk.css'; @import './logger-BffjDTy3.chunk.css'; \ No newline at end of file diff --git a/js/viewer-main.mjs b/js/viewer-main.mjs index d7b50162c..f090c0466 100644 --- a/js/viewer-main.mjs +++ b/js/viewer-main.mjs @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('viewer', '', 'js/logger-CluH28Ci.chunk.mjs'),window.OC.filePath('viewer', '', 'css/logger-BffjDTy3.chunk.css'),window.OC.filePath('viewer', '', 'js/NcActionLink-D-MsG5Vp.chunk.mjs'),window.OC.filePath('viewer', '', 'js/actionText-fFcUPi2g-odnD-Ii8.chunk.mjs'),window.OC.filePath('viewer', '', 'css/NcActionLink-C3uWgqfV.chunk.css'),window.OC.filePath('viewer', '', 'js/NcActionButton-CxEwhUF1.chunk.mjs'),window.OC.filePath('viewer', '', 'css/NcActionButton-WAAyMq9-.chunk.css'),window.OC.filePath('viewer', '', 'css/index-C0wOrV_Y.chunk.css')])))=>i.map(i=>d[i]); -var N=Object.defineProperty,$=Object.defineProperties;var R=Object.getOwnPropertyDescriptors;var E=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var k=(e,i,n)=>i in e?N(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n,V=(e,i)=>{for(var n in i||(i={}))G.call(i,n)&&k(e,n,i[n]);if(E)for(var n of E(i))K.call(i,n)&&k(e,n,i[n]);return e},H=(e,i)=>$(e,R(i));import{i as W,a as j,b as U,_ as Z,c as O,d,g as _,e as J,f as Y,h as Q,j as X,k as ee,p as te,l as ie,m as ne,o as se,q as re,r as le,s as ae,t as l,u as v,v as g,w,x as M,y,z as oe,V as f,F as de,A as ce,B as he,C as ue,D as me}from"./logger-CluH28Ci.chunk.mjs";const pe={computed:{isFullscreen(){return W.value}}},fe={computed:{isMobile(){return j.value}}};function ve(e){const i=typeof(e==null?void 0:e.shareAttributes)=="string"?JSON.parse(e.shareAttributes||"[]"):e==null?void 0:e.shareAttributes;if(i&&i.length>0){const n=i.find(({scope:s,key:r})=>s==="permissions"&&r==="download");return(n==null?void 0:n.value)!==!1}return!0}async function we(){const e=await ge();if(!e)return{key:"basename",asc:!0};const i={mtime:"lastmod"}[e.sorting_mode]||e.sorting_mode||"basename",n=e.sorting_direction==="asc"||!e.sorting_direction;return{key:i,asc:n}}async function ge(){if(U())return null;const e=Z("apps/files/api/v1/views");return await O.get(e).then(i=>{var n;return(n=i.data.data)==null?void 0:n.files}).catch(()=>null)}const z=function(e){const i=new AbortController;return{request:async function(n,s){return e(n,H(V({},s),{signal:i.signal}))},cancel:()=>i.abort()}},ye={name:"Error",props:{name:{type:String,default:""}}};var be=function(){var e=this,i=e._self._c;return i("div",{attrs:{id:"emptycontent"}},[i("div",{staticClass:"icon-error"}),i("h2",[e._t("default",function(){return[e._v(e._s(e.t("viewer","Error loading {name}",{name:e.name})))]})],2)])},Fe=[],_e=d(ye,be,Fe,!1,null,"6a8e09db");const xe=_e.exports;function m(e,i,n){var r;const s={mime:i,modal:n,failed:!1,loaded:!1,davPath:_(e),source:(r=e.source)!=null?r:_(e)};return Object.assign({},e,s)}async function Ce(e,i={}){return(await J.getDirectoryContents(e,Object.assign({data:'\n \n \n \n ").concat(Q(),"\n \n "),details:!0},i))).data.map(X)}const Se={computed:{previewPath(){return this.getPreviewIfAny({fileid:this.fileid,filename:this.filename,previewUrl:this.previewUrl,hasPreview:this.hasPreview,davPath:this.davPath,etag:this.$attrs.etag})},davPath(){return _({filename:this.filename,basename:this.basename})}},methods:{getPreviewIfAny(e){return ee(e)}}};var p={exports:{}},Le=te.platform==="win32",Ee=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,x={};function ke(e){return Ee.exec(e).slice(1)}x.parse=function(e){if(typeof e!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var i=ke(e);if(!i||i.length!==5)throw new TypeError("Invalid path '"+e+"'");return{root:i[1],dir:i[0]===i[1]?i[0]:i[0].slice(0,-1),base:i[2],ext:i[4],name:i[3]}};var Ve=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,b={};function He(e){return Ve.exec(e).slice(1)}b.parse=function(e){if(typeof e!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var i=He(e);if(!i||i.length!==5)throw new TypeError("Invalid path '"+e+"'");return{root:i[1],dir:i[0].slice(0,-1),base:i[2],ext:i[4],name:i[3]}},Le?p.exports=x.parse:p.exports=b.parse,p.exports.posix=b.parse,p.exports.win32=x.parse;var Me=p.exports;const I=ie(Me),ze={inheritAttrs:!1,mixins:[Se],props:{active:{type:Boolean,default:!1},basename:{type:String,required:!0},filename:{type:String,required:!0},source:{type:String,default:void 0},previewUrl:{type:String,default:void 0},hasPreview:{type:Boolean,default:!1},fileid:{type:[Number,String],required:!1},fileList:{type:Array,default:()=>[]},mime:{type:String,required:!0},canSwipe:{type:Boolean,default:!0},canZoom:{type:Boolean,default:!1},loaded:{type:Boolean,default:!1},isSidebarShown:{type:Boolean,default:!1},isFullScreen:{type:Boolean,default:!1},metadataFilesLivePhoto:{type:Number,default:void 0}},data(){return{height:null,width:null,naturalHeight:null,naturalWidth:null,isLoaded:!1}},computed:{name(){return I(this.basename).name},ext(){return I(this.basename).ext},src(){var e;return(e=this.source)!=null?e:this.davPath}},watch:{active(e,i){e===!0&&i===!1&&this.isLoaded&&this.doneLoading()},isSidebarShown(){setTimeout(this.updateHeightWidth,200)}},mounted(){this.$el.addEventListener("error",e=>{console.error("Error loading",this.filename,e),this.$emit("error",e)}),window.addEventListener("resize",ne(()=>{this.updateHeightWidth()},100))},methods:{doneLoading(){this.$emit("update:loaded",!0),this.isLoaded=!0},updateHeightWidth(){const e=this.$parent.$el.querySelector(".modal-wrapper");if(e&&this.naturalHeight>0&&this.naturalWidth>0){const i=e.querySelector(".modal-container"),n=i.clientHeight,s=i.clientWidth,r=n/this.naturalHeight,a=s/this.naturalWidth;ra&&a<1?(this.width=s,this.height=Math.round(this.naturalHeight/this.naturalWidth*s)):(this.height=this.naturalHeight,this.width=this.naturalWidth)}else this.height=this.naturalHeight,this.width=this.naturalWidth},enableSwipe(){this.$emit("update:canSwipe",!0)},disableSwipe(){this.$emit("update:canSwipe",!1)},toggleFullScreen(){this.isFullScreen?document.exitFullscreen():this.$el.requestFullscreen()}}},Ie={name:"DeleteIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ae=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon delete-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Oe=[],Pe=d(Ie,Ae,Oe,!1,null,null);const Be=Pe.exports,De={name:"DownloadIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Te=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon download-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},qe=[],Ne=d(De,Te,qe,!1,null,null);const $e=Ne.exports,Re={name:"FullscreenIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ge=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon fullscreen-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Ke=[],We=d(Re,Ge,Ke,!1,null,null);const je=We.exports,Ue={name:"FullscreenExitIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ze=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon fullscreen-exit-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M14,14H19V16H16V19H14V14M5,14H10V19H8V16H5V14M8,5H10V10H5V8H8V5M19,8V10H14V5H16V8H19Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Je=[],Ye=d(Ue,Ze,Je,!1,null,null);const Qe=Ye.exports,Xe={name:"PencilIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var et=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon pencil-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},tt=[],it=d(Xe,et,tt,!1,null,null);const nt=it.exports,st=()=>w(()=>import("./logger-CluH28Ci.chunk.mjs").then(e=>e.bm),__vite__mapDeps([0,1]),import.meta.url),rt=()=>w(()=>import("./NcActionLink-D-MsG5Vp.chunk.mjs"),__vite__mapDeps([2,3,0,1,4]),import.meta.url),lt=()=>w(()=>import("./NcActionButton-CxEwhUF1.chunk.mjs").then(e=>e.a),__vite__mapDeps([5,0,1,3,6]),import.meta.url),at=se({name:"Viewer",components:{Delete:Be,Download:$e,Error:xe,Fullscreen:je,FullscreenExit:Qe,NcActionButton:lt,NcActionLink:rt,NcModal:st,Pencil:nt},filters:{uniqueKey(e){return""+e.fileid+e.source}},mixins:[pe,fe],data(){return{Viewer:OCA.Viewer,Sidebar:null,handlers:OCA.Viewer.availableHandlers,components:{},mimeGroups:{},registeredHandlers:{},currentIndex:0,previousFile:{},currentFile:{},comparisonFile:null,nextFile:{},fileList:[],sortingConfig:null,isLoaded:!1,initiated:!1,editing:!1,cancelRequestFile:()=>{},cancelRequestFolder:()=>{},sidebarPosition:0,isSidebarShown:!1,isFullscreenMode:!1,canSwipe:!0,isStandalone:!1,theme:null,lightBackdrop:null,root:re,handlerId:"",trapElements:[]}},computed:{downloadPath(){var e;return(e=this.currentFile.source)!=null?e:this.currentFile.davPath},hasPrevious(){return this.fileList.length>1&&(this.canLoop||!this.isStartOfList)},hasNext(){return this.fileList.length>1&&(this.canLoop||!this.isEndOfList)},file(){return this.Viewer.file},fileInfo(){return this.Viewer.fileInfo},comparisonFileInfo(){return this.Viewer.compareFileInfo},files(){return this.Viewer.files},enableSidebar(){return this.Viewer.enableSidebar},el(){return this.Viewer.el},loadMore(){return this.Viewer.loadMore},canLoop(){return this.Viewer.canLoop},isStartOfList(){return this.currentIndex===0},isEndOfList(){return this.currentIndex===this.fileList.length-1},isImage(){var e;return["image/jpeg","image/png","image/webp"].includes((e=this.currentFile)==null?void 0:e.mime)},sidebarFile(){return this.Sidebar&&this.Sidebar.file},sidebarOpenFilePath(){var e,i,n,s,r;try{return(r=(s=(n=(i=(e=this.currentFile)==null?void 0:e.davPath)==null?void 0:i.split(le)[1])==null?void 0:n.split("/"))==null?void 0:s.map(decodeURIComponent))==null?void 0:r.join("/")}catch(a){return!1}},canDelete(){var e,i;return(i=(e=this.currentFile)==null?void 0:e.permissions)==null?void 0:i.includes("D")},canDownload(){return this.comparisonFile?!1:this.currentFile&&ve(this.currentFile)},canEdit(){var e,i,n;return!this.isMobile&&this.canDownload&&((i=(e=this.currentFile)==null?void 0:e.permissions)==null?void 0:i.includes("W"))&&this.isImage&&!this.comparisonFile&&((n=ae("core","config",[])["enable_non-accessible_features"])!=null?n:!0)},modalClass(){return{"icon-loading":!this.currentFile.loaded&&!this.currentFile.failed,"theme--undefined":this.theme===null,"theme--dark":this.theme==="dark","theme--light":this.theme==="light","theme--default":this.theme==="default","image--fullscreen":this.isImage&&this.isFullscreenMode}},showComparison(){return!this.isMobile},contentClass(){return{"viewer--split":this.comparisonFile}},isSameFile(){return(e=null,i=null)=>!!(i&&i===this.currentFile.path&&!this.currentFile.source||e&&e.fileid===this.currentFile.fileid&&e.mtime&&e.mtime===this.currentFile.mtime&&e.source&&e.source===this.currentFile.source)}},watch:{el(e){l.info(e),this.$nextTick(()=>{const i=document.getElementById("viewer");if(e){const n=document.querySelector(e);n?n.appendChild(i):l.warn("Could not find element ",{element:e})}else document.body.appendChild(i)})},file(e){e&&e.trim()!==""?(l.info("Opening viewer for file ",{path:e}),this.openFile(e,OCA.Viewer.overrideHandlerId)):this.cleanup()},fileInfo(e){e?(l.info("Opening viewer for fileInfo ",{fileInfo:e}),this.openFileInfo(e,OCA.Viewer.overrideHandlerId)):this.cleanup()},comparisonFileInfo(e){e?(l.info("Opening viewer for comparisonFileInfo ",{fileInfo:e}),this.compareFile(e)):this.cleanup()},files(e){const i=e.findIndex(n=>n.filename===this.currentFile.filename);i>-1&&(this.currentIndex=i,l.debug("The files list changed, new current file index is "+i)),this.fileList=e},async isEndOfList(e){if(!(!e||this.el)&&this.loadMore&&typeof this.loadMore=="function"){l.debug("Fetching additional files...");const i=await this.loadMore();Array.isArray(i)&&i.length>0&&this.fileList.push(...i)}}},beforeMount(){var e;this.isStandalone=((e=window.OCP)==null?void 0:e.Files)===void 0,this.isStandalone&&l.info("No OCP.Files app found, viewer is now in standalone mode"),document.addEventListener("DOMContentLoaded",()=>{var i;this.handlers.forEach(n=>{this.registerHandler(n)}),this.handlers.forEach(n=>{this.registerHandlerAlias(n)}),this.isLoaded=!0,(i=OCA==null?void 0:OCA.Files)!=null&&i.Sidebar&&(this.Sidebar=OCA.Files.Sidebar.state),l.info("".concat(this.handlers.length," viewer handlers registered"),{handlers:this.handlers})}),window.addEventListener("resize",this.onResize)},mounted(){v("files:sidebar:opened",this.handleAppSidebarOpen),v("files:sidebar:closed",this.handleAppSidebarClose),v("files:node:updated",this.handleFileUpdated),v("viewer:trapElements:changed",this.handleTrapElementsChange),window.addEventListener("keydown",this.keyboardDeleteFile),window.addEventListener("keydown",this.keyboardDownloadFile),window.addEventListener("keydown",this.keyboardEditFile),this.addFullscreenEventListeners()},beforeDestroy(){window.removeEventListener("resize",this.onResize)},destroyed(){g("files:sidebar:opened",this.handleAppSidebarOpen),g("files:sidebar:closed",this.handleAppSidebarClose),g("viewer:trapElements:changed",this.handleTrapElementsChange),window.removeEventListener("keydown",this.keyboardDeleteFile),window.removeEventListener("keydown",this.keyboardDownloadFile),window.removeEventListener("keydown",this.keyboardEditFile),this.removeFullscreenEventListeners()},methods:{preventContextMenu(e){this.canDownload||e.preventDefault()},async beforeOpen(){var e,i;this.initiated=!0,(i=(e=OCA==null?void 0:OCA.Files)==null?void 0:e.Sidebar)!=null&&i.setFullScreenMode&&OCA.Files.Sidebar.setFullScreenMode(!0),this.sortingConfig=await we(),window.loadRoboto&&(l.debug("⚠️ Loading roboto font for visual regression tests"),w(()=>Promise.resolve({}),__vite__mapDeps([7]),import.meta.url),delete window.loadRoboto)},async openFile(e,i=null){var c;if(await this.beforeOpen(),this.cancelRequestFile(),this.isSameFile(null,e))return;const{request:n,cancel:s}=z(ue);this.cancelRequestFile=s;const[,r]=M(e);this.el||(document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden");const a=document.getElementsByTagName("head")[0].getElementsByTagName("title")[0];a&&!a.dataset.old&&(a.dataset.old=document.title,this.updateTitle(r));try{const o=await n(e);console.debug("File info for "+e+" fetched",o),await this.openFileInfo(o,i)}catch(o){((c=o==null?void 0:o.response)==null?void 0:c.status)===404?(l.error("The file no longer exists, error: ",{error:o}),y(t("viewer","This file no longer exists")),this.close()):console.error("Could not open file "+e,o)}},async openFileInfo(e,i=null){var o,C,S,L;if(this.beforeOpen(),this.cancelRequestFolder(),this.isSameFile(e))return;const n=e.mime,s=n.split("/")[0];let r;if(i!==null&&(r=(o=Object.values(this.registeredHandlers).find(u=>u.id===i))!=null?o:r),r||(r=(C=this.registeredHandlers[n])!=null?C:this.registeredHandlers[s]),!r){l.error("The following file could not be displayed",{fileInfo:e}),y(t("viewer","There is no plugin available to display this file type")),this.close();return}this.theme=(S=r.theme)!=null?S:"dark";const a=window.getComputedStyle(document.body).getPropertyValue("--background-invert-if-dark")!=="invert(100%)";this.lightBackdrop=r.theme==="light"||r.theme==="default"&&a,this.handlerId=r.id;const c=this.mimeGroups[n];if(this.files&&this.files.length>0)l.debug("A files list have been provided. No folder content will be fetched."),this.fileList=this.files,this.currentIndex=this.fileList.findIndex(u=>u.filename===e.filename);else if(c&&this.el===null){const u=this.mimeGroups[c]?this.mimeGroups[c]:[n],{request:P,cancel:B}=z(Ce);this.cancelRequestFolder=B;const[D]=M(e.filename),T=(await P(D)).filter(h=>h.mime&&u.indexOf(h.mime)!==-1);this.fileList=T.sort((h,q)=>oe(h,q,this.sortingConfig.key,this.sortingConfig.asc)),this.currentIndex=this.fileList.findIndex(h=>h.filename===e.filename)}else this.currentIndex=0,this.fileList=[e];e=(L=this.fileList[this.currentIndex])!=null?L:e,this.currentFile=new m(e,n,r.component),this.comparisonFile=null,this.updatePreviousNext(),this.changeSidebar()},openFileFromList(e){const i=e.mime;this.currentFile=new m(e,i,this.components[i]),this.changeSidebar(),this.updatePreviousNext()},async compareFile(e){this.comparisonFile=new m(e,e.mime,this.components[e.mime])},changeSidebar(){this.sidebarFile&&this.showSidebar()},updatePreviousNext(){const e=this.fileList[this.currentIndex-1],i=this.fileList[this.currentIndex+1];if(e){const n=e.mime;this.components[n]&&(this.previousFile=new m(e,n,this.components[n]))}else this.previousFile=null;if(i){const n=i.mime;this.components[n]&&(this.nextFile=new m(i,n,this.components[n]))}else this.nextFile=null},updateTitle(e){var i,n;document.title="".concat(e," - ").concat((n=(i=OCA.Theming)==null?void 0:i.name)!=null?n:oc_defaults.name)},registerHandler(e){var i,n;if(e.id&&Object.values(this.registeredHandlers).findIndex(s=>s.id===e.id)>-1){l.error("The following handler is already registered",{handler:e});return}if(!e.id||e.id.trim()===""||typeof e.id!="string"){l.error("The following handler doesn't have a valid id",{handler:e});return}if(!(!(e.mimes&&Array.isArray(e.mimes))&&e.mimesAliases)){if(!(e.mimes&&Array.isArray(e.mimes))&&!e.mimesAliases){l.error("The following handler doesn't have a valid mime array",{handler:e});return}if(!e.component||typeof e.component!="object"&&typeof e.component!="function"){l.error("The following handler doesn't have a valid component",{handler:e});return}e.component.mixins=[...(n=(i=e==null?void 0:e.component)==null?void 0:i.mixins)!=null?n:[],ze],e.mimes&&e.mimes.forEach(s=>{if(this.components[s]){l.error("The following mime is already registered",{mime:s,handler:e});return}this.registerGroups({mime:s,group:e.group}),this.components[s]=e.component,f.component(e.component.name,e.component),this.registeredHandlers[s]=e})}},registerHandlerAlias(e){e.mimesAliases&&Object.keys(e.mimesAliases).forEach(i=>{if(e.mimesAliases&&typeof e.mimesAliases!="object"){l.error("The following handler doesn't have a valid mimesAliases object",{handler:e});return}const n=e.mimesAliases[i];if(this.components[i]){l.error("The following mime is already registered",{mime:i,handler:e});return}if(!this.components[n]){l.error("The requested alias does not exists",{alias:n,mime:i,handler:e});return}this.registerGroups({mime:i,group:this.mimeGroups[n]}),this.components[i]=this.components[n],this.registeredHandlers[i]=e})},registerGroups({mime:e,group:i}){i&&(this.mimeGroups[e]=i,this.mimeGroups[i]||(this.mimeGroups[i]=[]),this.mimeGroups[i].push(e))},close(){var e;OCA.Viewer.close(),(e=OCA==null?void 0:OCA.Files)!=null&&e.Sidebar&&OCA.Files.Sidebar.setFullScreenMode(!1),this.isFullscreenMode&&this.exitFullscreen()},keyboardDeleteFile(e){this.canDelete&&e.key==="Delete"&&e.ctrlKey===!0&&this.onDelete()},keyboardDownloadFile(e){var i;if(e.key==="s"&&e.ctrlKey===!0&&(e.preventDefault(),this.canDownload)){const n=document.createElement("a");n.href=(i=this.currentFile.source)!=null?i:this.currentFile.davPath,n.download=this.currentFile.basename,document.body.appendChild(n),n.click(),document.body.removeChild(n)}},keyboardEditFile(e){e.key==="e"&&e.ctrlKey===!0&&(e.preventDefault(),this.canEdit&&this.onEdit())},cleanup(){this.currentFile={},this.comparisonFile=null,this.currentModal=null,this.fileList=[],this.initiated=!1,this.theme=null,this.cancelRequestFile(),this.cancelRequestFolder(),document.body.style.overflow=null,document.documentElement.style.overflow=null,this.Viewer.onClose();const e=document.getElementsByTagName("head")[0].getElementsByTagName("title")[0];e&&e.dataset.old&&(document.title=e.dataset.old,delete e.dataset.old)},previous(){this.currentIndex--,this.currentIndex<0&&(this.currentIndex=this.fileList.length-1);const e=this.fileList[this.currentIndex];this.openFileFromList(e),this.Viewer.onPrev(e),this.updateTitle(this.currentFile.basename)},next(){this.currentIndex++,this.currentIndex>this.fileList.length-1&&(this.currentIndex=0);const e=this.fileList[this.currentIndex];this.openFileFromList(e),this.Viewer.onNext(e),this.updateTitle(this.currentFile.basename)},comparisonFailed(){this.comparisonFile.failed=!0},previousFailed(){this.previousFile.failed=!0},currentFailed(){this.currentFile.failed=!0},nextFailed(){this.nextFile.failed=!0},async showSidebar(){var e;this.enableSidebar&&((e=OCA==null?void 0:OCA.Files)!=null&&e.Sidebar)&&await OCA.Files.Sidebar.open(this.sidebarOpenFilePath)},handleAppSidebarOpen(){this.isSidebarShown=!0;const e=document.querySelector("aside.app-sidebar");e&&(this.sidebarPosition=e.getBoundingClientRect().left,this.trapElements=[e])},handleAppSidebarClose(){this.isSidebarShown=!1,this.trapElements=[]},async handleFileUpdated(e){const i=this.fileList.findIndex(({fileid:n})=>n===e.fileid);e.etag=e.attributes.etag,this.fileList.splice(i,1,e),e.fileid===this.currentFile.fileid&&(this.currentFile.etag=e.attributes.etag)},onResize(){const e=document.querySelector("aside.app-sidebar");e&&(this.sidebarPosition=e.getBoundingClientRect().left)},async onDelete(){var e;try{const i=this.currentFile.fileid,n=(e=this.currentFile.source)!=null?e:this.currentFile.davPath,s=new de({source:n,fileid:i,mime:this.currentFile.mime,owner:this.currentFile.ownerId,root:n.includes("remote.php/dav")?ce():void 0});await O.delete(n),he("files:node:deleted",s);const r=this.fileList.findIndex(a=>a.filename===this.currentFile.filename);this.hasPrevious||this.hasNext?(this.hasNext?this.next():this.previous(),this.fileList.splice(r,1)):this.close()}catch(i){console.error(i),y(i)}},onEdit(){this.editing=!0},handleTrapElementsChange(e){this.trapElements.push(e)},toggleFullScreen(){this.isFullscreenMode?this.exitFullscreen():this.requestFullscreen()},requestFullscreen(){const e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()},exitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},addFullscreenEventListeners(){document.addEventListener("fullscreenchange",this.onFullscreenchange),document.addEventListener("webkitfullscreenchange",this.onFullscreenchange)},removeFullscreenEventListeners(){document.addEventListener("fullscreenchange",this.onFullscreenchange),document.addEventListener("webkitfullscreenchange",this.onFullscreenchange)},onFullscreenchange(){document.fullscreenElement===document.documentElement||document.webkitFullscreenElement===document.documentElement?this.isFullscreenMode=!0:this.isFullscreenMode=!1}}});var ot=function(){var e=this,i=e._self._c;return e._self._setupProxy,e.el?i("div",{attrs:{id:"viewer","data-handler":e.handlerId}},[e.currentFile.failed?i("Error",{attrs:{name:e.currentFile.basename}}):i(e.currentFile.modal,e._b({key:e._f("uniqueKey")(e.currentFile),ref:"content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":!1,"can-zoom":!1,"file-list":[e.currentFile],"is-full-screen":!1,loaded:e.currentFile.loaded,"is-sidebar-shown":!1},on:{"update:loaded":function(n){return e.$set(e.currentFile,"loaded",n)},error:e.currentFailed}},"component",e.currentFile,!1))],1):e.initiated||e.currentFile.modal?i("NcModal",{staticClass:"viewer",class:e.modalClass,style:{width:e.isSidebarShown?"".concat(e.sidebarPosition,"px"):null},attrs:{id:"viewer","additional-trap-elements":e.trapElements,"clear-view-delay":-1,"close-button-contained":!1,dark:!0,"light-backdrop":e.lightBackdrop,"data-handler":e.handlerId,"enable-slideshow":e.hasPrevious||e.hasNext,"slideshow-paused":e.editing,"enable-swipe":e.canSwipe&&!e.editing,"has-next":e.hasNext,"has-previous":e.hasPrevious,"inline-actions":e.canEdit?1:0,"spread-navigation":!0,name:e.currentFile.basename,size:"full"},on:{close:e.close,previous:e.previous,next:e.next},scopedSlots:e._u([{key:"actions",fn:function(){return[e.canEdit?i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.onEdit},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Pencil",{attrs:{size:20}})]},proxy:!0}],null,!1,580569589)},[e._v(" "+e._s(e.t("viewer","Edit"))+" ")]):e._e(),i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.toggleFullScreen},scopedSlots:e._u([{key:"icon",fn:function(){return[e.isFullscreenMode?i("FullscreenExit",{attrs:{size:20}}):i("Fullscreen",{attrs:{size:20}})]},proxy:!0}])},[e._v(" "+e._s(e.isFullscreenMode?e.t("viewer","Exit full screen"):e.t("viewer","Full screen"))+" ")]),e.enableSidebar&&e.Sidebar&&e.sidebarOpenFilePath&&!e.isSidebarShown?i("NcActionButton",{attrs:{"close-after-click":!0,icon:"icon-menu-sidebar"},on:{click:e.showSidebar}},[e._v(" "+e._s(e.t("viewer","Open sidebar"))+" ")]):e._e(),e.canDownload?i("NcActionLink",{attrs:{download:e.currentFile.basename,"close-after-click":!0,href:e.downloadPath},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Download",{attrs:{size:20}})]},proxy:!0}],null,!1,3312959228)},[e._v(" "+e._s(e.t("viewer","Download"))+" ")]):e._e(),e.canDelete?i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.onDelete},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Delete",{attrs:{size:20}})]},proxy:!0}],null,!1,2705356561)},[e._v(" "+e._s(e.t("viewer","Delete"))+" ")]):e._e()]},proxy:!0}])},[i("div",{staticClass:"viewer__content",class:e.contentClass,on:{click:function(n){return n.target!==n.currentTarget||n.ctrlKey||n.shiftKey||n.altKey||n.metaKey?null:e.close.apply(null,arguments)},contextmenu:e.preventContextMenu}},[e.comparisonFile&&!e.comparisonFile.failed&&e.showComparison?i("div",{staticClass:"viewer__file-wrapper"},[i(e.comparisonFile.modal,e._b({key:e._f("uniqueKey")(e.comparisonFile),ref:"comparison-content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":!1,"can-zoom":!1,editing:!1,"is-full-screen":e.isFullscreen,"is-sidebar-shown":e.isSidebarShown,loaded:e.comparisonFile.loaded},on:{"update:loaded":function(n){return e.$set(e.comparisonFile,"loaded",n)},error:e.comparisonFailed}},"component",e.comparisonFile,!1))],1):e._e(),e.previousFile?i("div",{key:e._f("uniqueKey")(e.previousFile),staticClass:"viewer__file-wrapper viewer__file-wrapper--hidden",attrs:{"aria-hidden":"true",inert:""}},[e.previousFile.failed?i("Error",{attrs:{name:e.previousFile.basename}}):i(e.previousFile.modal,e._b({ref:"previous-content",tag:"component",staticClass:"viewer__file",attrs:{"file-list":e.fileList},on:{error:e.previousFailed}},"component",e.previousFile,!1))],1):e._e(),i("div",{key:e._f("uniqueKey")(e.currentFile),staticClass:"viewer__file-wrapper"},[e.currentFile.failed?i("Error",{attrs:{name:e.currentFile.basename}}):i(e.currentFile.modal,e._b({ref:"content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":e.canSwipe,"can-zoom":!0,editing:e.editing,"file-list":e.fileList,"is-full-screen":e.isFullscreen,"is-sidebar-shown":e.isSidebarShown,loaded:e.currentFile.loaded},on:{"update:canSwipe":function(n){e.canSwipe=n},"update:can-swipe":function(n){e.canSwipe=n},"update:editing":function(n){e.editing=n},"update:loaded":function(n){return e.$set(e.currentFile,"loaded",n)},error:e.currentFailed}},"component",e.currentFile,!1))],1),e.nextFile?i("div",{key:e._f("uniqueKey")(e.nextFile),staticClass:"viewer__file-wrapper viewer__file-wrapper--hidden",attrs:{"aria-hidden":"true",inert:""}},[e.nextFile.failed?i("Error",{attrs:{name:e.nextFile.basename}}):i(e.nextFile.modal,e._b({ref:"next-content",tag:"component",staticClass:"viewer__file",attrs:{"file-list":e.fileList},on:{error:e.nextFailed}},"component",e.nextFile,!1))],1):e._e()])]):e._e()},dt=[],ct=d(at,ot,dt,!1,null,"9cfc56d0");const ht=ct.exports;f.mixin({methods:{t:me}}),f.prototype.OC=window.OC,f.prototype.OCA=window.OCA;const A=document.createElement("div");A.id="viewer",document.body.appendChild(A);const F=document.createElement("div");F.innerHTML='',F.style.display="none",document.body.appendChild(F),new f({el:"#viewer",name:"ViewerRoot",render:e=>e(ht)}); +var q=Object.defineProperty,$=Object.defineProperties;var R=Object.getOwnPropertyDescriptors;var E=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var k=(e,i,n)=>i in e?q(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n,V=(e,i)=>{for(var n in i||(i={}))G.call(i,n)&&k(e,n,i[n]);if(E)for(var n of E(i))j.call(i,n)&&k(e,n,i[n]);return e},H=(e,i)=>$(e,R(i));import{i as K,a as W,b as U,_ as Z,c as O,d,g as x,e as J,f as Y,h as Q,j as X,k as ee,p as te,l as ie,m as ne,o as se,q as re,r as le,s as oe,t as l,u as v,v as g,w,x as M,y,z as ae,V as f,F as de,A as ce,B as he,C as ue,D as me}from"./logger-CluH28Ci.chunk.mjs";const pe={computed:{isFullscreen(){return K.value}}},fe={computed:{isMobile(){return W.value}}};function ve(e){const i=typeof(e==null?void 0:e.shareAttributes)=="string"?JSON.parse(e.shareAttributes||"[]"):e==null?void 0:e.shareAttributes;if(i&&i.length>0){const n=i.find(({scope:s,key:r})=>s==="permissions"&&r==="download");return(n==null?void 0:n.value)!==!1}return!0}async function we(){const e=await ge();if(!e)return{key:"basename",asc:!0};const i={mtime:"lastmod"}[e.sorting_mode]||e.sorting_mode||"basename",n=e.sorting_direction==="asc"||!e.sorting_direction;return{key:i,asc:n}}async function ge(){if(U())return null;const e=Z("apps/files/api/v1/views");return await O.get(e).then(i=>{var n;return(n=i.data.data)==null?void 0:n.files}).catch(()=>null)}const z=function(e){const i=new AbortController;return{request:async function(n,s){return e(n,H(V({},s),{signal:i.signal}))},cancel:()=>i.abort()}},ye={name:"Error",props:{name:{type:String,default:""}}};var be=function(){var e=this,i=e._self._c;return i("div",{attrs:{id:"emptycontent"}},[i("div",{staticClass:"icon-error"}),i("h2",[e._t("default",function(){return[e._v(e._s(e.t("viewer","Error loading {name}",{name:e.name})))]})],2)])},Fe=[],xe=d(ye,be,Fe,!1,null,"6a8e09db");const _e=xe.exports;function m(e,i,n){var r;const s={mime:i,modal:n,failed:!1,loaded:!1,davPath:x(e),source:(r=e.source)!=null?r:x(e)};return Object.assign({},e,s)}async function Ce(e,i={}){return(await J.getDirectoryContents(e,Object.assign({data:'\n \n \n \n ").concat(Q(),"\n \n "),details:!0},i))).data.map(X)}const Se={computed:{previewPath(){return this.getPreviewIfAny({fileid:this.fileid,filename:this.filename,previewUrl:this.previewUrl,hasPreview:this.hasPreview,davPath:this.davPath,etag:this.$attrs.etag})},davPath(){return x({filename:this.filename,basename:this.basename})}},methods:{getPreviewIfAny(e){return ee(e)}}};var p={exports:{}},Le=te.platform==="win32",Ee=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,_={};function ke(e){return Ee.exec(e).slice(1)}_.parse=function(e){if(typeof e!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var i=ke(e);if(!i||i.length!==5)throw new TypeError("Invalid path '"+e+"'");return{root:i[1],dir:i[0]===i[1]?i[0]:i[0].slice(0,-1),base:i[2],ext:i[4],name:i[3]}};var Ve=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,b={};function He(e){return Ve.exec(e).slice(1)}b.parse=function(e){if(typeof e!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var i=He(e);if(!i||i.length!==5)throw new TypeError("Invalid path '"+e+"'");return{root:i[1],dir:i[0].slice(0,-1),base:i[2],ext:i[4],name:i[3]}},Le?p.exports=_.parse:p.exports=b.parse,p.exports.posix=b.parse,p.exports.win32=_.parse;var Me=p.exports;const I=ie(Me),ze={inheritAttrs:!1,mixins:[Se],props:{active:{type:Boolean,default:!1},basename:{type:String,required:!0},filename:{type:String,required:!0},source:{type:String,default:void 0},previewUrl:{type:String,default:void 0},hasPreview:{type:Boolean,default:!1},fileid:{type:[Number,String],required:!1},fileList:{type:Array,default:()=>[]},mime:{type:String,required:!0},canSwipe:{type:Boolean,default:!0},canZoom:{type:Boolean,default:!1},loaded:{type:Boolean,default:!1},isSidebarShown:{type:Boolean,default:!1},isFullScreen:{type:Boolean,default:!1},metadataFilesLivePhoto:{type:Number,default:void 0}},data(){return{height:null,width:null,naturalHeight:null,naturalWidth:null,isLoaded:!1}},computed:{name(){return I(this.basename).name},ext(){return I(this.basename).ext},src(){var e;return(e=this.source)!=null?e:this.davPath}},watch:{active(e,i){e===!0&&i===!1&&this.isLoaded&&this.doneLoading()},isSidebarShown(){setTimeout(this.updateHeightWidth,200)}},mounted(){this.$el.addEventListener("error",e=>{console.error("Error loading",this.filename,e),this.$emit("error",e)}),window.addEventListener("resize",ne(()=>{this.updateHeightWidth()},100))},methods:{doneLoading(){this.$emit("update:loaded",!0),this.isLoaded=!0},updateHeightWidth(){const e=this.$parent.$el.querySelector(".modal-wrapper");if(e&&this.naturalHeight>0&&this.naturalWidth>0){const i=e.querySelector(".modal-container"),n=i.clientHeight,s=i.clientWidth,r=n/this.naturalHeight,o=s/this.naturalWidth;ro&&o<1?(this.width=s,this.height=Math.round(this.naturalHeight/this.naturalWidth*s)):(this.height=this.naturalHeight,this.width=this.naturalWidth)}else this.height=this.naturalHeight,this.width=this.naturalWidth},enableSwipe(){this.$emit("update:canSwipe",!0)},disableSwipe(){this.$emit("update:canSwipe",!1)},toggleFullScreen(){this.isFullScreen?document.exitFullscreen():this.$el.requestFullscreen()}}},Ie={name:"DeleteIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ae=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon delete-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Oe=[],Pe=d(Ie,Ae,Oe,!1,null,null);const Be=Pe.exports,De={name:"DownloadIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Te=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon download-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Ne=[],qe=d(De,Te,Ne,!1,null,null);const $e=qe.exports,Re={name:"FullscreenIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ge=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon fullscreen-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},je=[],Ke=d(Re,Ge,je,!1,null,null);const We=Ke.exports,Ue={name:"FullscreenExitIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ze=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon fullscreen-exit-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M14,14H19V16H16V19H14V14M5,14H10V19H8V16H5V14M8,5H10V10H5V8H8V5M19,8V10H14V5H16V8H19Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Je=[],Ye=d(Ue,Ze,Je,!1,null,null);const Qe=Ye.exports,Xe={name:"PencilIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var et=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon pencil-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},tt=[],it=d(Xe,et,tt,!1,null,null);const nt=it.exports,st=()=>w(()=>import("./logger-CluH28Ci.chunk.mjs").then(e=>e.bm),__vite__mapDeps([0,1]),import.meta.url),rt=()=>w(()=>import("./NcActionLink-D-MsG5Vp.chunk.mjs"),__vite__mapDeps([2,3,0,1,4]),import.meta.url),lt=()=>w(()=>import("./NcActionButton-CxEwhUF1.chunk.mjs").then(e=>e.a),__vite__mapDeps([5,0,1,3,6]),import.meta.url),ot=se({name:"Viewer",components:{Delete:Be,Download:$e,Error:_e,Fullscreen:We,FullscreenExit:Qe,NcActionButton:lt,NcActionLink:rt,NcModal:st,Pencil:nt},mixins:[pe,fe],data(){return{Viewer:OCA.Viewer,Sidebar:null,handlers:OCA.Viewer.availableHandlers,components:{},mimeGroups:{},registeredHandlers:{},currentIndex:0,previousFile:{},currentFile:{},comparisonFile:null,nextFile:{},fileList:[],sortingConfig:null,isLoaded:!1,initiated:!1,editing:!1,cancelRequestFile:()=>{},cancelRequestFolder:()=>{},sidebarPosition:0,isSidebarShown:!1,isFullscreenMode:!1,canSwipe:!0,isStandalone:!1,theme:null,lightBackdrop:null,root:re,handlerId:"",trapElements:[]}},computed:{downloadPath(){var e;return(e=this.currentFile.source)!=null?e:this.currentFile.davPath},hasPrevious(){return this.fileList.length>1&&(this.canLoop||!this.isStartOfList)},hasNext(){return this.fileList.length>1&&(this.canLoop||!this.isEndOfList)},file(){return this.Viewer.file},fileInfo(){return this.Viewer.fileInfo},comparisonFileInfo(){return this.Viewer.compareFileInfo},files(){return this.Viewer.files},enableSidebar(){return this.Viewer.enableSidebar},el(){return this.Viewer.el},loadMore(){return this.Viewer.loadMore},canLoop(){return this.Viewer.canLoop},isStartOfList(){return this.currentIndex===0},isEndOfList(){return this.currentIndex===this.fileList.length-1},hasPreviousFile(){return Object.keys(this.previousFile).length>0},hasNextFile(){return Object.keys(this.nextFile).length>0},isImage(){var e;return["image/jpeg","image/png","image/webp"].includes((e=this.currentFile)==null?void 0:e.mime)},sidebarFile(){return this.Sidebar&&this.Sidebar.file},sidebarOpenFilePath(){var e,i,n,s,r;try{return(r=(s=(n=(i=(e=this.currentFile)==null?void 0:e.davPath)==null?void 0:i.split(le)[1])==null?void 0:n.split("/"))==null?void 0:s.map(decodeURIComponent))==null?void 0:r.join("/")}catch(o){return!1}},canDelete(){var e,i;return(i=(e=this.currentFile)==null?void 0:e.permissions)==null?void 0:i.includes("D")},canDownload(){return this.comparisonFile?!1:this.currentFile&&ve(this.currentFile)},canEdit(){var e,i,n;return!this.isMobile&&this.canDownload&&((i=(e=this.currentFile)==null?void 0:e.permissions)==null?void 0:i.includes("W"))&&this.isImage&&!this.comparisonFile&&((n=oe("core","config",[])["enable_non-accessible_features"])!=null?n:!0)},modalClass(){return{"icon-loading":!this.currentFile.loaded&&!this.currentFile.failed,"theme--undefined":this.theme===null,"theme--dark":this.theme==="dark","theme--light":this.theme==="light","theme--default":this.theme==="default","image--fullscreen":this.isImage&&this.isFullscreenMode}},showComparison(){return!this.isMobile},contentClass(){return{"viewer--split":this.comparisonFile}},isSameFile(){return(e=null,i=null)=>!!(i&&i===this.currentFile.path&&!this.currentFile.source||e&&e.fileid===this.currentFile.fileid&&e.mtime&&e.mtime===this.currentFile.mtime&&e.source&&e.source===this.currentFile.source)}},watch:{el(e){l.info(e),this.$nextTick(()=>{const i=document.getElementById("viewer");if(e){const n=document.querySelector(e);n?n.appendChild(i):l.warn("Could not find element ",{element:e})}else document.body.appendChild(i)})},file(e){e&&e.trim()!==""?(l.info("Opening viewer for file ",{path:e}),this.openFile(e,OCA.Viewer.overrideHandlerId)):this.cleanup()},fileInfo(e){e?(l.info("Opening viewer for fileInfo ",{fileInfo:e}),this.openFileInfo(e,OCA.Viewer.overrideHandlerId)):this.cleanup()},comparisonFileInfo(e){e?(l.info("Opening viewer for comparisonFileInfo ",{fileInfo:e}),this.compareFile(e)):this.cleanup()},files(e){const i=e.findIndex(n=>n.filename===this.currentFile.filename);i>-1&&(this.currentIndex=i,l.debug("The files list changed, new current file index is "+i)),this.fileList=e},async isEndOfList(e){if(!(!e||this.el)&&this.loadMore&&typeof this.loadMore=="function"){l.debug("Fetching additional files...");const i=await this.loadMore();Array.isArray(i)&&i.length>0&&this.fileList.push(...i)}}},beforeMount(){var e;this.isStandalone=((e=window.OCP)==null?void 0:e.Files)===void 0,this.isStandalone&&l.info("No OCP.Files app found, viewer is now in standalone mode"),document.addEventListener("DOMContentLoaded",()=>{var i;this.handlers.forEach(n=>{this.registerHandler(n)}),this.handlers.forEach(n=>{this.registerHandlerAlias(n)}),this.isLoaded=!0,(i=OCA==null?void 0:OCA.Files)!=null&&i.Sidebar&&(this.Sidebar=OCA.Files.Sidebar.state),l.info("".concat(this.handlers.length," viewer handlers registered"),{handlers:this.handlers})}),window.addEventListener("resize",this.onResize)},mounted(){v("files:sidebar:opened",this.handleAppSidebarOpen),v("files:sidebar:closed",this.handleAppSidebarClose),v("files:node:updated",this.handleFileUpdated),v("viewer:trapElements:changed",this.handleTrapElementsChange),window.addEventListener("keydown",this.keyboardDeleteFile),window.addEventListener("keydown",this.keyboardDownloadFile),window.addEventListener("keydown",this.keyboardEditFile),this.addFullscreenEventListeners()},beforeDestroy(){window.removeEventListener("resize",this.onResize)},destroyed(){g("files:sidebar:opened",this.handleAppSidebarOpen),g("files:sidebar:closed",this.handleAppSidebarClose),g("viewer:trapElements:changed",this.handleTrapElementsChange),window.removeEventListener("keydown",this.keyboardDeleteFile),window.removeEventListener("keydown",this.keyboardDownloadFile),window.removeEventListener("keydown",this.keyboardEditFile),this.removeFullscreenEventListeners()},methods:{uniqueKey(e,i){return e.fileid===void 0&&console.debug("No fileid found for file",e,i),""+e.fileid+e.source},preventContextMenu(e){this.canDownload||e.preventDefault()},async beforeOpen(){var e,i;this.initiated=!0,(i=(e=OCA==null?void 0:OCA.Files)==null?void 0:e.Sidebar)!=null&&i.setFullScreenMode&&OCA.Files.Sidebar.setFullScreenMode(!0),this.sortingConfig=await we(),window.loadRoboto&&(l.debug("⚠️ Loading roboto font for visual regression tests"),w(()=>Promise.resolve({}),__vite__mapDeps([7]),import.meta.url),delete window.loadRoboto)},async openFile(e,i=null){var c;if(await this.beforeOpen(),this.cancelRequestFile(),this.isSameFile(null,e))return;const{request:n,cancel:s}=z(ue);this.cancelRequestFile=s;const[,r]=M(e);this.el||(document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden");const o=document.getElementsByTagName("head")[0].getElementsByTagName("title")[0];o&&!o.dataset.old&&(o.dataset.old=document.title,this.updateTitle(r));try{const a=await n(e);console.debug("File info for "+e+" fetched",a),await this.openFileInfo(a,i)}catch(a){((c=a==null?void 0:a.response)==null?void 0:c.status)===404?(l.error("The file no longer exists, error: ",{error:a}),y(t("viewer","This file no longer exists")),this.close()):console.error("Could not open file "+e,a)}},async openFileInfo(e,i=null){var a,C,S,L;if(this.beforeOpen(),this.cancelRequestFolder(),this.isSameFile(e))return;const n=e.mime,s=n.split("/")[0];let r;if(i!==null&&(r=(a=Object.values(this.registeredHandlers).find(u=>u.id===i))!=null?a:r),r||(r=(C=this.registeredHandlers[n])!=null?C:this.registeredHandlers[s]),!r){l.error("The following file could not be displayed",{fileInfo:e}),y(t("viewer","There is no plugin available to display this file type")),this.close();return}this.theme=(S=r.theme)!=null?S:"dark";const o=window.getComputedStyle(document.body).getPropertyValue("--background-invert-if-dark")!=="invert(100%)";this.lightBackdrop=r.theme==="light"||r.theme==="default"&&o,this.handlerId=r.id;const c=this.mimeGroups[n];if(this.files&&this.files.length>0)l.debug("A files list have been provided. No folder content will be fetched."),this.fileList=this.files,this.currentIndex=this.fileList.findIndex(u=>u.filename===e.filename);else if(c&&this.el===null){const u=this.mimeGroups[c]?this.mimeGroups[c]:[n],{request:P,cancel:B}=z(Ce);this.cancelRequestFolder=B;const[D]=M(e.filename),T=(await P(D)).filter(h=>h.mime&&u.indexOf(h.mime)!==-1);this.fileList=T.sort((h,N)=>ae(h,N,this.sortingConfig.key,this.sortingConfig.asc)),this.currentIndex=this.fileList.findIndex(h=>h.filename===e.filename)}else this.currentIndex=0,this.fileList=[e];e=(L=this.fileList[this.currentIndex])!=null?L:e,this.currentFile=new m(e,n,r.component),this.comparisonFile=null,this.updatePreviousNext(),this.changeSidebar()},openFileFromList(e){const i=e.mime;this.currentFile=new m(e,i,this.components[i]),this.changeSidebar(),this.updatePreviousNext()},async compareFile(e){this.comparisonFile=new m(e,e.mime,this.components[e.mime])},changeSidebar(){this.sidebarFile&&this.showSidebar()},updatePreviousNext(){const e=this.fileList[this.currentIndex-1],i=this.fileList[this.currentIndex+1];if(e){const n=e.mime;this.components[n]&&(this.previousFile=new m(e,n,this.components[n]))}else this.previousFile={};if(i){const n=i.mime;this.components[n]&&(this.nextFile=new m(i,n,this.components[n]))}else this.nextFile={}},updateTitle(e){var i,n;document.title="".concat(e," - ").concat((n=(i=OCA.Theming)==null?void 0:i.name)!=null?n:oc_defaults.name)},registerHandler(e){var i,n;if(e.id&&Object.values(this.registeredHandlers).findIndex(s=>s.id===e.id)>-1){l.error("The following handler is already registered",{handler:e});return}if(!e.id||e.id.trim()===""||typeof e.id!="string"){l.error("The following handler doesn't have a valid id",{handler:e});return}if(!(!(e.mimes&&Array.isArray(e.mimes))&&e.mimesAliases)){if(!(e.mimes&&Array.isArray(e.mimes))&&!e.mimesAliases){l.error("The following handler doesn't have a valid mime array",{handler:e});return}if(!e.component||typeof e.component!="object"&&typeof e.component!="function"){l.error("The following handler doesn't have a valid component",{handler:e});return}e.component.mixins=[...(n=(i=e==null?void 0:e.component)==null?void 0:i.mixins)!=null?n:[],ze],e.mimes&&e.mimes.forEach(s=>{if(this.components[s]){l.error("The following mime is already registered",{mime:s,handler:e});return}this.registerGroups({mime:s,group:e.group}),this.components[s]=e.component,f.component(e.component.name,e.component),this.registeredHandlers[s]=e})}},registerHandlerAlias(e){e.mimesAliases&&Object.keys(e.mimesAliases).forEach(i=>{if(e.mimesAliases&&typeof e.mimesAliases!="object"){l.error("The following handler doesn't have a valid mimesAliases object",{handler:e});return}const n=e.mimesAliases[i];if(this.components[i]){l.error("The following mime is already registered",{mime:i,handler:e});return}if(!this.components[n]){l.error("The requested alias does not exists",{alias:n,mime:i,handler:e});return}this.registerGroups({mime:i,group:this.mimeGroups[n]}),this.components[i]=this.components[n],this.registeredHandlers[i]=e})},registerGroups({mime:e,group:i}){i&&(this.mimeGroups[e]=i,this.mimeGroups[i]||(this.mimeGroups[i]=[]),this.mimeGroups[i].push(e))},close(){var e;OCA.Viewer.close(),(e=OCA==null?void 0:OCA.Files)!=null&&e.Sidebar&&OCA.Files.Sidebar.setFullScreenMode(!1),this.isFullscreenMode&&this.exitFullscreen()},keyboardDeleteFile(e){this.canDelete&&e.key==="Delete"&&e.ctrlKey===!0&&this.onDelete()},keyboardDownloadFile(e){var i;if(e.key==="s"&&e.ctrlKey===!0&&(e.preventDefault(),this.canDownload)){const n=document.createElement("a");n.href=(i=this.currentFile.source)!=null?i:this.currentFile.davPath,n.download=this.currentFile.basename,document.body.appendChild(n),n.click(),document.body.removeChild(n)}},keyboardEditFile(e){e.key==="e"&&e.ctrlKey===!0&&(e.preventDefault(),this.canEdit&&this.onEdit())},cleanup(){this.currentFile={},this.comparisonFile=null,this.currentModal=null,this.fileList=[],this.initiated=!1,this.theme=null,this.cancelRequestFile(),this.cancelRequestFolder(),document.body.style.overflow=null,document.documentElement.style.overflow=null,this.Viewer.onClose();const e=document.getElementsByTagName("head")[0].getElementsByTagName("title")[0];e&&e.dataset.old&&(document.title=e.dataset.old,delete e.dataset.old)},previous(){this.currentIndex--,this.currentIndex<0&&(this.currentIndex=this.fileList.length-1);const e=this.fileList[this.currentIndex];this.openFileFromList(e),this.Viewer.onPrev(e),this.updateTitle(this.currentFile.basename)},next(){this.currentIndex++,this.currentIndex>this.fileList.length-1&&(this.currentIndex=0);const e=this.fileList[this.currentIndex];this.openFileFromList(e),this.Viewer.onNext(e),this.updateTitle(this.currentFile.basename)},comparisonFailed(){this.comparisonFile.failed=!0},previousFailed(){this.previousFile.failed=!0},currentFailed(){this.currentFile.failed=!0},nextFailed(){this.nextFile.failed=!0},async showSidebar(){var e;this.enableSidebar&&((e=OCA==null?void 0:OCA.Files)!=null&&e.Sidebar)&&await OCA.Files.Sidebar.open(this.sidebarOpenFilePath)},handleAppSidebarOpen(){this.isSidebarShown=!0;const e=document.querySelector("aside.app-sidebar");e&&(this.sidebarPosition=e.getBoundingClientRect().left,this.trapElements=[e])},handleAppSidebarClose(){this.isSidebarShown=!1,this.trapElements=[]},async handleFileUpdated(e){const i=this.fileList.findIndex(({fileid:n})=>n===e.fileid);e.etag=e.attributes.etag,this.fileList.splice(i,1,e),e.fileid===this.currentFile.fileid&&(this.currentFile.etag=e.attributes.etag)},onResize(){const e=document.querySelector("aside.app-sidebar");e&&(this.sidebarPosition=e.getBoundingClientRect().left)},async onDelete(){var e;try{const i=this.currentFile.fileid,n=(e=this.currentFile.source)!=null?e:this.currentFile.davPath,s=new de({source:n,fileid:i,mime:this.currentFile.mime,owner:this.currentFile.ownerId,root:n.includes("remote.php/dav")?ce():void 0});await O.delete(n),he("files:node:deleted",s);const r=this.fileList.findIndex(o=>o.filename===this.currentFile.filename);this.hasPrevious||this.hasNext?(this.hasNext?this.next():this.previous(),this.fileList.splice(r,1)):this.close()}catch(i){console.error(i),y(i)}},onEdit(){this.editing=!0},handleTrapElementsChange(e){this.trapElements.push(e)},toggleFullScreen(){this.isFullscreenMode?this.exitFullscreen():this.requestFullscreen()},requestFullscreen(){const e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()},exitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},addFullscreenEventListeners(){document.addEventListener("fullscreenchange",this.onFullscreenchange),document.addEventListener("webkitfullscreenchange",this.onFullscreenchange)},removeFullscreenEventListeners(){document.addEventListener("fullscreenchange",this.onFullscreenchange),document.addEventListener("webkitfullscreenchange",this.onFullscreenchange)},onFullscreenchange(){document.fullscreenElement===document.documentElement||document.webkitFullscreenElement===document.documentElement?this.isFullscreenMode=!0:this.isFullscreenMode=!1}}});var at=function(){var e=this,i=e._self._c;return e._self._setupProxy,e.el?i("div",{attrs:{id:"viewer","data-handler":e.handlerId}},[e.currentFile.failed?i("Error",{attrs:{name:e.currentFile.basename}}):i(e.currentFile.modal,e._b({key:e.uniqueKey(e.currentFile,"current-single"),ref:"content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":!1,"can-zoom":!1,"file-list":[e.currentFile],"is-full-screen":!1,loaded:e.currentFile.loaded,"is-sidebar-shown":!1},on:{"update:loaded":function(n){return e.$set(e.currentFile,"loaded",n)},error:e.currentFailed}},"component",e.currentFile,!1))],1):e.initiated||e.currentFile.modal?i("NcModal",{staticClass:"viewer",class:e.modalClass,style:{width:e.isSidebarShown?"".concat(e.sidebarPosition,"px"):null},attrs:{id:"viewer","additional-trap-elements":e.trapElements,"clear-view-delay":-1,"close-button-contained":!1,dark:!0,"light-backdrop":e.lightBackdrop,"data-handler":e.handlerId,"enable-slideshow":e.hasPrevious||e.hasNext,"slideshow-paused":e.editing,"enable-swipe":e.canSwipe&&!e.editing,"has-next":e.hasNext,"has-previous":e.hasPrevious,"inline-actions":e.canEdit?1:0,"spread-navigation":!0,name:e.currentFile.basename,size:"full"},on:{close:e.close,previous:e.previous,next:e.next},scopedSlots:e._u([{key:"actions",fn:function(){return[e.canEdit?i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.onEdit},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Pencil",{attrs:{size:20}})]},proxy:!0}],null,!1,580569589)},[e._v(" "+e._s(e.t("viewer","Edit"))+" ")]):e._e(),i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.toggleFullScreen},scopedSlots:e._u([{key:"icon",fn:function(){return[e.isFullscreenMode?i("FullscreenExit",{attrs:{size:20}}):i("Fullscreen",{attrs:{size:20}})]},proxy:!0}])},[e._v(" "+e._s(e.isFullscreenMode?e.t("viewer","Exit full screen"):e.t("viewer","Full screen"))+" ")]),e.enableSidebar&&e.Sidebar&&e.sidebarOpenFilePath&&!e.isSidebarShown?i("NcActionButton",{attrs:{"close-after-click":!0,icon:"icon-menu-sidebar"},on:{click:e.showSidebar}},[e._v(" "+e._s(e.t("viewer","Open sidebar"))+" ")]):e._e(),e.canDownload?i("NcActionLink",{attrs:{download:e.currentFile.basename,"close-after-click":!0,href:e.downloadPath},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Download",{attrs:{size:20}})]},proxy:!0}],null,!1,3312959228)},[e._v(" "+e._s(e.t("viewer","Download"))+" ")]):e._e(),e.canDelete?i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.onDelete},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Delete",{attrs:{size:20}})]},proxy:!0}],null,!1,2705356561)},[e._v(" "+e._s(e.t("viewer","Delete"))+" ")]):e._e()]},proxy:!0}])},[i("div",{staticClass:"viewer__content",class:e.contentClass,on:{click:function(n){return n.target!==n.currentTarget||n.ctrlKey||n.shiftKey||n.altKey||n.metaKey?null:e.close.apply(null,arguments)},contextmenu:e.preventContextMenu}},[e.comparisonFile&&!e.comparisonFile.failed&&e.showComparison?i("div",{staticClass:"viewer__file-wrapper"},[i(e.comparisonFile.modal,e._b({key:e.uniqueKey(e.comparisonFile,"comparison"),ref:"comparison-content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":!1,"can-zoom":!1,editing:!1,"is-full-screen":e.isFullscreen,"is-sidebar-shown":e.isSidebarShown,loaded:e.comparisonFile.loaded},on:{"update:loaded":function(n){return e.$set(e.comparisonFile,"loaded",n)},error:e.comparisonFailed}},"component",e.comparisonFile,!1))],1):e._e(),e.hasPreviousFile?i("div",{key:e.uniqueKey(e.previousFile,"previous"),staticClass:"viewer__file-wrapper viewer__file-wrapper--hidden",attrs:{"aria-hidden":"true",inert:""}},[e.previousFile.failed?i("Error",{attrs:{name:e.previousFile.basename}}):i(e.previousFile.modal,e._b({ref:"previous-content",tag:"component",staticClass:"viewer__file",attrs:{"file-list":e.fileList},on:{error:e.previousFailed}},"component",e.previousFile,!1))],1):e._e(),i("div",{key:e.uniqueKey(e.currentFile,"current"),staticClass:"viewer__file-wrapper"},[e.currentFile.failed?i("Error",{attrs:{name:e.currentFile.basename}}):i(e.currentFile.modal,e._b({ref:"content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":e.canSwipe,"can-zoom":!0,editing:e.editing,"file-list":e.fileList,"is-full-screen":e.isFullscreen,"is-sidebar-shown":e.isSidebarShown,loaded:e.currentFile.loaded},on:{"update:canSwipe":function(n){e.canSwipe=n},"update:can-swipe":function(n){e.canSwipe=n},"update:editing":function(n){e.editing=n},"update:loaded":function(n){return e.$set(e.currentFile,"loaded",n)},error:e.currentFailed}},"component",e.currentFile,!1))],1),e.hasNextFile?i("div",{key:e.uniqueKey(e.nextFile,"next"),staticClass:"viewer__file-wrapper viewer__file-wrapper--hidden",attrs:{"aria-hidden":"true",inert:""}},[e.nextFile.failed?i("Error",{attrs:{name:e.nextFile.basename}}):i(e.nextFile.modal,e._b({ref:"next-content",tag:"component",staticClass:"viewer__file",attrs:{"file-list":e.fileList},on:{error:e.nextFailed}},"component",e.nextFile,!1))],1):e._e()])]):e._e()},dt=[],ct=d(ot,at,dt,!1,null,"61dd46e0");const ht=ct.exports;f.mixin({methods:{t:me}}),f.prototype.OC=window.OC,f.prototype.OCA=window.OCA;const A=document.createElement("div");A.id="viewer",document.body.appendChild(A);const F=document.createElement("div");F.innerHTML='',F.style.display="none",document.body.appendChild(F),new f({el:"#viewer",name:"ViewerRoot",render:e=>e(ht)}); diff --git a/js/viewer-main.mjs.map b/js/viewer-main.mjs.map index 127285ef6..14683f6c8 100644 --- a/js/viewer-main.mjs.map +++ b/js/viewer-main.mjs.map @@ -1 +1 @@ -{"version":3,"mappings":";qrBACA,MAAMA,GAAQ,CACZ,SAAU,CAKR,cAAe,CACb,OAAOC,EAAkB,KAC/B,CACA,CACA,ECVMD,GAAQ,CACZ,SAAU,CAKR,UAAW,CACT,OAAOE,EAAc,KAC3B,CACA,CACA,ECAO,SAASC,GAAYC,EAAoB,CAGzC,MAAAC,EAAkB,OAAOD,iBAAU,kBAAoB,SAAW,KAAK,MAAMA,EAAS,iBAAmB,IAAI,EAAcA,iBAAA,gBAE7H,GAAAC,GAAmBA,EAAgB,OAAS,EAAG,CAC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KAAK,cACnB,KAAK,MAAQ,KAAK,aAEvB,MACI,KAAK,OAAS,KAAK,cACnB,KAAK,MAAQ,KAAK,YAEnB,EAKD,aAAc,CACb,KAAK,MAAM,kBAAmB,EAAI,CAClC,EAKD,cAAe,CACd,KAAK,MAAM,kBAAmB,EAAK,CACnC,EAKD,kBAAmB,CACd,KAAK,aACR,SAAS,eAAc,EAEvB,KAAK,IAAI,kBAAiB,CAE3B,CACD,CACF,ECrMAlC,GAAA,CACA,kBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,qlBChBAA,GAAA,CACA,oBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,+iBChBAA,GAAA,CACA,sBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,8lBChBAA,GAAA,CACA,0BACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,kmBChBAA,GAAA,CACA,kBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,upBC0KAqC,GAAA,IAAAC,EAAA,+CAAAC,KAAA,4CACAC,GAAA,IAAAF,EAAA,8FACAG,GAAA,IAAAH,EAAA,uDAAAC,KAAA,iDAEAvC,GAAA0C,GAAA,CACA,cAEA,YACA,OAAAC,GACA,SAAAC,GACA,MAAAC,GACA,WAAAC,GACA,eAAAC,GACA,eAAAN,GACA,aAAAD,GACA,QAAAH,GACA,OAAAW,EACA,EAEA,SACA,UAAAC,EAAA,CACA,SAAAA,EAAA,OAAAA,EAAA,MACA,CACA,EAEA,QAAAC,GAAAC,EAAA,EAEA,OACA,OAEA,kBACA,aACA,sCAGA,cACA,cACA,sBAGA,eACA,gBACA,eACA,oBACA,YACA,YACA,mBAGA,YACA,aACA,WAGA,yBACA,2BAGA,kBACA,kBACA,oBACA,YACA,gBACA,WACA,mBACA,KAAAC,GACA,aAEA,eACA,CACA,EAEA,UACA,qBACA,OAAA3D,EAAA,+BAAAA,EAAA,wBACA,EACA,cACA,gCACA,kCACA,EACA,UACA,gCACA,gCACA,EACA,OACA,uBACA,EACA,WACA,2BACA,EACA,qBACA,kCACA,EACA,QACA,wBACA,EACA,gBACA,gCACA,EACA,KACA,qBACA,EACA,WACA,2BACA,EACA,UACA,0BACA,EACA,gBACA,4BACA,EACA,cACA,iDACA,EAEA,gBACA,wDAAAA,EAAA,+BAAAA,EAAA,KACA,EAWA,cACA,sCACA,EACA,oCACA,IAEA,OADA4D,GAAAC,GAAAC,GAAAC,GAAA/D,EAAA,+BAAAA,EAAA,sBAAA+D,EAAA,MAAAC,IAAA,iBAAAF,EACA,aADA,YAAAD,EACA,0BADA,YAAAD,EACA,SACA,OAAAxB,EAAA,CACA,QACA,CACA,EAOA,oBACA,OAAA2B,GAAA/D,EAAA,+BAAAA,EAAA,0BAAA+D,EAAA,aACA,EAOA,cAEA,2BACA,GAEA,kBAAA9E,GAAA,iBACA,EAQA,oBACA,sBACA,oBACA8E,GAAA/D,EAAA,+BAAAA,EAAA,0BAAA+D,EAAA,gBACA,cACA,wBACAE,KAAA,wDAAAA,OAAA,GACA,EAEA,aACA,OACA,kEACA,qCACA,kCACA,oCACA,wCACA,uDACA,CACA,EAEA,iBACA,oBACA,EAEA,eACA,OACA,mCACA,CACA,EAEA,aACA,OAAA/E,EAAA,KAAA4B,EAAA,OAEA,CAAAA,SAAA,uBACA,0BAMA5B,KAAA,kCACAA,EAAA,OAAAA,EAAA,gCACAA,EAAA,QAAAA,EAAA,iCAOA,CACA,EAEA,OACA,GAAAgF,EAAA,CACAC,EAAA,KAAAD,CAAA,EACA,oBACA,MAAAE,EAAA,kCACA,GAAAF,EAAA,CACA,MAAAG,EAAA,uBAAAH,CAAA,EACAG,EACAA,EAAA,YAAAD,CAAA,EAEAD,EAAA,wCAAAD,CAAA,E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KAAA9G,EAAA,2BAAAgH,GAAA,QACA,GAEA,MAAA9G,EAAA,OAAAF,CAAA,EACAiH,GAAA,qBAAAL,CAAA,EAGA,MAAAjC,EAAA,wBAAAf,KAAA,sCACA,gCAEA,yCAEA,qBAAAe,EAAA,IAEA,YAEA,OAAAe,EAAA,CACA,cAAAA,CAAA,EACAC,EAAAD,CAAA,CACA,CACA,EAEA,SACA,eACA,EAEA,yBAAApB,EAAA,CACA,uBAAAA,CAAA,CACA,EAMA,mBACA,sBACA,sBAEA,wBAEA,EAEA,oBACA,MAAAG,EAAA,yBACAA,EAAA,kBACAA,EAAA,oBACAA,EAAA,yBACAA,EAAA,yBAEA,EAEA,iBACA,wBACA,0BACA,+BACA,+BAEA,EAEA,8BACA,sEACA,2EACA,EAEA,iCACA,sEACA,2EACA,EAEA,qBACA,uDACA,4DACA,yBAEA,wBAEA,CAEA,CACA,ogKC5oCAiC,EAAI,MAAM,CACT,QAAS,CACV,EAAEQ,EACA,CACF,CAAC,EAEDR,EAAI,UAAU,GAAK,OAAO,GAC1BA,EAAI,UAAU,IAAM,OAAO,IAG3B,MAAMS,EAAa,SAAS,cAAc,KAAK,EAC/CA,EAAW,GAAK,SAChB,SAAS,KAAK,YAAYA,CAAU,EAIpC,MAAMC,EAAgB,SAAS,cAAc,KAAK,EAClDA,EAAc,UAAY,4pLAC1BA,EAAc,MAAM,QAAU,OAC9B,SAAS,KAAK,YAAYA,CAAa,EAGxB,IAAIV,EAAI,CACtB,GAAI,UAKJ,KAAM,aACN,OAAQb,GAAKA,EAAEwB,EAAe,CAC/B,CAAC","names":["index","isFullscreenState","isMobileState","canDownload","fileInfo","shareAttributes","downloadAttribute","scope","key","getSortingConfig","viewConfigs","getViewConfigs","asc","isPublicShare","url","generateUrl","axios","response","_a","CancelableRequest","request","controller","options","__spreadProps","__spreadValues","_sfc_main","File","mime","component","data","getDavPath","getFileList","path","client","getDavNameSpaces","genFileInfo","PreviewUrl","getPreviewIfAny","isWindows","process","splitWindowsRe","win32","win32SplitPath","filename","pathString","allParts","splitPathRe","posix","posixSplitPath","pathParseModule","Mime","parsePath","val","old","e","debounce","modalWrapper","modalContainer","parentHeight","parentWidth","heightRatio","widthRatio","NcModal","__vitePreload","n","NcActionLink","NcActionButton","defineComponent","Delete","Download","Error","Fullscreen","FullscreenExit","Pencil","file","isFullscreen","isMobile","davRemoteURL","_e","_d","_c","_b","davRootPath","loadState","element","logger","viewerRoot","el","fileList","currentIndex","isEndOfList","list","handler","subscribe","unsubscribe","event","overrideHandlerId","fileRequest","cancelRequestFile","cancelableRequest","getFileInfo","fileName","extractFilePaths","title","error","showError","alias","h","defaultThemeIsLight","group","mimes","folderRequest","cancelRequestFolder","dirPath","filteredFiles","a","b","sortCompare","prev","next","Vue","sidebar","node","currentFileId","fileid","NcFile","davGetRootPath","emit","t","ViewerRoot","VideoControls","ViewerComponent"],"ignoreList":[0,1,9,11,12,13,14,15],"sources":["../node_modules/@nextcloud/vue/dist/Mixins/isFullscreen.mjs","../node_modules/@nextcloud/vue/dist/Mixins/isMobile.mjs","../src/utils/canDownload.ts","../src/services/FileSortingConfig.ts","../src/utils/CancelableRequest.js","../src/components/Error.vue","../src/models/file.js","../src/services/FileList.ts","../src/mixins/PreviewUrl.js","../node_modules/path-parse/index.js","../src/mixins/Mime.js","../node_modules/vue-material-design-icons/Delete.vue","../node_modules/vue-material-design-icons/Download.vue","../node_modules/vue-material-design-icons/Fullscreen.vue","../node_modules/vue-material-design-icons/FullscreenExit.vue","../node_modules/vue-material-design-icons/Pencil.vue","../src/views/Viewer.vue","../src/main.js"],"sourcesContent":["import { isFullscreenState } from \"../Composables/useIsFullscreen.mjs\";\nconst index = {\n computed: {\n /**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsFullscreen` instead.\n */\n isFullscreen() {\n return isFullscreenState.value;\n }\n }\n};\nexport {\n index as default\n};\n","import { isMobileState } from \"../Composables/useIsMobile.mjs\";\nconst index = {\n computed: {\n /**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsMobile` instead.\n */\n isMobile() {\n return isMobileState.value;\n }\n }\n};\nexport {\n index as default\n};\n","/*!\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { FileInfo } from './fileUtils'\n\n/**\n * Check if download permissions are granted for a file\n * @param fileInfo The file info to check\n */\nexport function canDownload(fileInfo: FileInfo) {\n\t// TODO: This should probably be part of `@nextcloud/sharing`\n\t// check share attributes\n\tconst shareAttributes = typeof fileInfo?.shareAttributes === 'string' ? JSON.parse(fileInfo.shareAttributes || '[]') : fileInfo?.shareAttributes\n\n\tif (shareAttributes && shareAttributes.length > 0) {\n\t\tconst downloadAttribute = shareAttributes.find(({ scope, key }) => scope === 'permissions' && key === 'download')\n\t\t// We only forbid download if the attribute is *explicitly* set to 'false'\n\t\treturn downloadAttribute?.value !== false\n\t}\n\t// otherwise return true (as the file needs read permission otherwise we would not have opened it)\n\treturn true\n}\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\nimport { isPublicShare } from '@nextcloud/sharing/public'\n\n/**\n * @return {object}\n */\nexport default async function getSortingConfig() {\n\tconst viewConfigs = await getViewConfigs()\n\n\tif (!viewConfigs) {\n\t\treturn { key: 'basename', asc: true }\n\t}\n\n\tconst keyMap = { mtime: 'lastmod' }\n\tconst key = keyMap[viewConfigs.sorting_mode] || viewConfigs.sorting_mode || 'basename'\n\tconst asc = viewConfigs.sorting_direction === 'asc' || !viewConfigs.sorting_direction\n\n\treturn { key, asc }\n}\n\n/**\n * @return {object}\n */\nasync function getViewConfigs() {\n\tif (isPublicShare()) {\n\t\treturn null\n\t}\n\tconst url = generateUrl('apps/files/api/v1/views')\n\treturn await axios.get(url)\n\t\t.then((response) => {\n\t\t\treturn response.data.data?.files\n\t\t})\n\t\t.catch(() => {\n\t\t\treturn null\n\t\t})\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/**\n * Creates a cancelable axios 'request object'.\n *\n * @param {Function} request the axios promise request\n * @return {object}\n */\nconst CancelableRequest = function(request) {\n\tconst controller = new AbortController()\n\n\t/**\n\t * Execute the request\n\t *\n\t * @param {string} url the url to send the request to\n\t * @param {object} [options] optional config for the request\n\t */\n\tconst fetch = async function(url, options) {\n\t\treturn request(\n\t\t\turl,\n\t\t\t{ ...options, signal: controller.signal },\n\t\t)\n\t}\n\treturn {\n\t\trequest: fetch,\n\t\tcancel: () => controller.abort(),\n\t}\n}\n\nexport default CancelableRequest\n","\n\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getDavPath } from '../utils/fileUtils.ts'\n\n/**\n * @param {object} fileInfo a FileInfo object\n * @param {string} mime the file mime type\n * @param {object} component the component to render\n */\nexport default function(fileInfo, mime, component) {\n\tconst data = {\n\t\tmime,\n\t\tmodal: component,\n\t\tfailed: false,\n\t\tloaded: false,\n\t\tdavPath: getDavPath(fileInfo),\n\t\tsource: fileInfo.source ?? getDavPath(fileInfo),\n\t}\n\n\treturn Object.assign({}, fileInfo, data)\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getDavNameSpaces, getDavProperties } from '@nextcloud/files'\nimport { client } from './WebdavClient'\nimport { genFileInfo, type FileInfo } from '../utils/fileUtils'\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\n/**\n * Retrieve the files list\n * @param path\n * @param options\n */\nexport default async function(path: string, options = {}): Promise {\n\tconst response = await client.getDirectoryContents(path, Object.assign({\n\t\tdata: `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${getDavProperties()}\n\t\t\t\t\n\t\t\t`,\n\t\tdetails: true,\n\t}, options)) as ResponseDataDetailed\n\n\treturn response.data.map(genFileInfo)\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getPreviewIfAny } from '../utils/previewUtils.ts'\nimport { getDavPath } from '../utils/fileUtils.ts'\n\nexport default {\n\tcomputed: {\n\t\t/**\n\t\t * Link to the preview path if the file have a preview\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tpreviewPath() {\n\t\t\treturn this.getPreviewIfAny({\n\t\t\t\tfileid: this.fileid,\n\t\t\t\tfilename: this.filename,\n\t\t\t\tpreviewUrl: this.previewUrl,\n\t\t\t\thasPreview: this.hasPreview,\n\t\t\t\tdavPath: this.davPath,\n\t\t\t\tetag: this.$attrs.etag,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Absolute dav remote path of the file\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tdavPath() {\n\t\t\treturn getDavPath({\n\t\t\t\tfilename: this.filename,\n\t\t\t\tbasename: this.basename,\n\t\t\t})\n\t\t},\n\t},\n\tmethods: {\n\t\t/**\n\t\t * Return the preview url if the file have an existing\n\t\t * preview or the absolute dav remote path if none.\n\t\t *\n\t\t * @param {object} data destructuring object\n\t\t * @param {string} data.fileid the file id\n\t\t * @param {string} [data.previewUrl] URL of the file preview\n\t\t * @param {boolean} data.hasPreview have the file an existing preview ?\n\t\t * @param {string} data.davPath the absolute dav path\n\t\t * @param {string} data.filename the file name\n\t\t * @param {string|null} data.etag the etag of the file\n\t\t * @return {string} the absolute url\n\t\t */\n\t\tgetPreviewIfAny(data) {\n\t\t\treturn getPreviewIfAny(data)\n\t\t},\n\t},\n}\n","'use strict';\n\nvar isWindows = process.platform === 'win32';\n\n// Regex to split a windows path into into [dir, root, basename, name, ext]\nvar splitWindowsRe =\n /^(((?:[a-zA-Z]:|[\\\\\\/]{2}[^\\\\\\/]+[\\\\\\/]+[^\\\\\\/]+)?[\\\\\\/]?)(?:[^\\\\\\/]*[\\\\\\/])*)((\\.{1,2}|[^\\\\\\/]+?|)(\\.[^.\\/\\\\]*|))[\\\\\\/]*$/;\n\nvar win32 = {};\n\nfunction win32SplitPath(filename) {\n return splitWindowsRe.exec(filename).slice(1);\n}\n\nwin32.parse = function(pathString) {\n if (typeof pathString !== 'string') {\n throw new TypeError(\n \"Parameter 'pathString' must be a string, not \" + typeof pathString\n );\n }\n var allParts = win32SplitPath(pathString);\n if (!allParts || allParts.length !== 5) {\n throw new TypeError(\"Invalid path '\" + pathString + \"'\");\n }\n return {\n root: allParts[1],\n dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),\n base: allParts[2],\n ext: allParts[4],\n name: allParts[3]\n };\n};\n\n\n\n// Split a filename into [dir, root, basename, name, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^((\\/?)(?:[^\\/]*\\/)*)((\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))[\\/]*$/;\nvar posix = {};\n\n\nfunction posixSplitPath(filename) {\n return splitPathRe.exec(filename).slice(1);\n}\n\n\nposix.parse = function(pathString) {\n if (typeof pathString !== 'string') {\n throw new TypeError(\n \"Parameter 'pathString' must be a string, not \" + typeof pathString\n );\n }\n var allParts = posixSplitPath(pathString);\n if (!allParts || allParts.length !== 5) {\n throw new TypeError(\"Invalid path '\" + pathString + \"'\");\n }\n \n return {\n root: allParts[1],\n dir: allParts[0].slice(0, -1),\n base: allParts[2],\n ext: allParts[4],\n name: allParts[3],\n };\n};\n\n\nif (isWindows)\n module.exports = win32.parse;\nelse /* posix */\n module.exports = posix.parse;\n\nmodule.exports.posix = posix.parse;\nmodule.exports.win32 = win32.parse;\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport debounce from 'debounce'\nimport PreviewUrl from '../mixins/PreviewUrl.js'\nimport parsePath from 'path-parse'\n\nexport default {\n\tinheritAttrs: false,\n\tmixins: [PreviewUrl],\n\tprops: {\n\t\t// Is the current component shown\n\t\tactive: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// file name\n\t\tbasename: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// file path relative to user folder\n\t\tfilename: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// file source to fetch contents from\n\t\tsource: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t// URL the file preview\n\t\tpreviewUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t// should the standard core preview be used?\n\t\thasPreview: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// unique file id\n\t\tfileid: {\n\t\t\ttype: [Number, String],\n\t\t\trequired: false,\n\t\t},\n\t\t// list of all the visible files\n\t\tfileList: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\t// file mime (aliased if specified in the model)\n\t\tmime: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// can the user swipe\n\t\tcanSwipe: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t\tcanZoom: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// is the content loaded?\n\t\t// synced with parent\n\t\tloaded: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// is the sidebar currently opened ?\n\t\tisSidebarShown: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// are we in fullscreen mode ?\n\t\tisFullScreen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// The file id of the peer live photo file\n\t\tmetadataFilesLivePhoto: {\n\t\t\ttype: Number,\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\theight: null,\n\t\t\twidth: null,\n\t\t\tnaturalHeight: null,\n\t\t\tnaturalWidth: null,\n\t\t\tisLoaded: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tname() {\n\t\t\treturn parsePath(this.basename).name\n\t\t},\n\t\text() {\n\t\t\treturn parsePath(this.basename).ext\n\t\t},\n\t\tsrc() {\n\t\t\treturn this.source ?? this.davPath\n\t\t},\n\t},\n\n\twatch: {\n\t\tactive(val, old) {\n\t\t\t// the item was hidden before and is now the current view\n\t\t\tif (val === true && old === false) {\n\t\t\t\t// just in case the file was preloaded, let's warn the viewer\n\t\t\t\tif (this.isLoaded) {\n\t\t\t\t\tthis.doneLoading()\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// update image size on sidebar toggle\n\t\tisSidebarShown() {\n\t\t\t// wait for transition to complete (100ms)\n\t\t\tsetTimeout(this.updateHeightWidth, 200)\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// detect error and let the viewer know\n\t\tthis.$el.addEventListener('error', e => {\n\t\t\tconsole.error('Error loading', this.filename, e)\n\t\t\tthis.$emit('error', e)\n\t\t})\n\n\t\t// update image size on window resize\n\t\twindow.addEventListener('resize', debounce(() => {\n\t\t\tthis.updateHeightWidth()\n\t\t}, 100))\n\t},\n\n\tmethods: {\n\n\t\t/**\n\t\t * This is used to make the viewer know this file is complete or ready\n\t\t * ! you NEED to use it to make the viewer aware of the current loading state\n\t\t */\n\t\tdoneLoading() {\n\t\t\t// send the current state\n\t\t\tthis.$emit('update:loaded', true)\n\t\t\t// save the current state\n\t\t\tthis.isLoaded = true\n\t\t},\n\n\t\t/**\n\t\t * Updates the current height and width data\n\t\t * based on the viewer maximum size\n\t\t */\n\t\tupdateHeightWidth() {\n\t\t\tconst modalWrapper = this.$parent.$el.querySelector('.modal-wrapper')\n\t\t\tif (modalWrapper && this.naturalHeight > 0 && this.naturalWidth > 0) {\n\t\t\t\tconst modalContainer = modalWrapper.querySelector('.modal-container')\n\n\t\t\t\tconst parentHeight = modalContainer.clientHeight\n\t\t\t\tconst parentWidth = modalContainer.clientWidth\n\n\t\t\t\tconst heightRatio = parentHeight / this.naturalHeight\n\t\t\t\tconst widthRatio = parentWidth / this.naturalWidth\n\n\t\t\t\t// if the video height is capped by the parent height\n\t\t\t\t// AND the video is bigger than the parent\n\t\t\t\tif (heightRatio < widthRatio && heightRatio < 1) {\n\t\t\t\t\tthis.height = parentHeight\n\t\t\t\t\tthis.width = Math.round(this.naturalWidth / this.naturalHeight * parentHeight)\n\n\t\t\t\t// if the video width is capped by the parent width\n\t\t\t\t// AND the video is bigger than the parent\n\t\t\t\t} else if (heightRatio > widthRatio && widthRatio < 1) {\n\t\t\t\t\tthis.width = parentWidth\n\t\t\t\t\tthis.height = Math.round(this.naturalHeight / this.naturalWidth * parentWidth)\n\n\t\t\t\t// RESET\n\t\t\t\t} else {\n\t\t\t\t\tthis.height = this.naturalHeight\n\t\t\t\t\tthis.width = this.naturalWidth\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.height = this.naturalHeight\n\t\t\t\tthis.width = this.naturalWidth\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Enable the viewer swiping previous/next capability\n\t\t */\n\t\tenableSwipe() {\n\t\t\tthis.$emit('update:canSwipe', true)\n\t\t},\n\n\t\t/**\n\t\t * Disable the viewer swiping previous/next capability\n\t\t */\n\t\tdisableSwipe() {\n\t\t\tthis.$emit('update:canSwipe', false)\n\t\t},\n\n\t\t/**\n\t\t * Toggle the fullscreen on the current visible element\n\t\t */\n\t\ttoggleFullScreen() {\n\t\t\tif (this.isFullScreen) {\n\t\t\t\tdocument.exitFullscreen()\n\t\t\t} else {\n\t\t\t\tthis.$el.requestFullscreen()\n\t\t\t}\n\t\t},\n\t},\n}\n","\n\n","\n\n","\n\n","\n\n","\n\n","\n\n\n\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { translate as t } from '@nextcloud/l10n'\nimport Vue from 'vue'\n\nimport ViewerComponent from './views/Viewer.vue'\n\nVue.mixin({\n\tmethods: {\n\t\tt,\n\t},\n})\n\nVue.prototype.OC = window.OC\nVue.prototype.OCA = window.OCA\n\n// Create document root\nconst ViewerRoot = document.createElement('div')\nViewerRoot.id = 'viewer'\ndocument.body.appendChild(ViewerRoot)\n\n// Put controls for video viewer\n// Needed as Firefox CSP blocks the loading of the svg through the normal plyr system\nconst VideoControls = document.createElement('div')\nVideoControls.innerHTML = PLYR_ICONS\nVideoControls.style.display = 'none'\ndocument.body.appendChild(VideoControls)\n\n// Init vue\nexport default new Vue({\n\tel: '#viewer',\n\t// When debugging the page, it's easier to find which app\n\t// is which. Especially when there is multiple apps\n\t// roots mounted o the same page!\n\t// eslint-disable-next-line vue/match-component-file-name\n\tname: 'ViewerRoot',\n\trender: h => h(ViewerComponent),\n})\n"],"file":"js/viewer-main.mjs"} \ No newline at end of file +{"version":3,"mappings":";qrBACA,MAAMA,GAAQ,CACZ,SAAU,CAKR,cAAe,CACb,OAAOC,EAAkB,KAC/B,CACA,CACA,ECVMD,GAAQ,CACZ,SAAU,CAKR,UAAW,CACT,OAAOE,EAAc,KAC3B,CACA,CACA,ECAO,SAASC,GAAYC,EAAoB,CAGzC,MAAAC,EAAkB,OAAOD,iBAAU,kBAAoB,SAAW,KAAK,MAAMA,EAAS,iBAAmB,IAAI,EAAcA,iBAAA,gBAE7H,GAAAC,GAAmBA,EAAgB,OAAS,EAAG,CAC5C,MAAAC,EAAoBD,EAAgB,KAAK,CAAC,CAAE,MAAAE,EAAO,IAAAC,CAAA,IAAUD,IAAU,eAAiBC,IAAQ,UAAU,EAEhH,wBAA0B,SAAU,GAG9B,QACR,CCXA,eAA8BC,IAAmB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KAAK,MAAM,kBAAmB,EAAK,CACnC,EAKD,kBAAmB,CACd,KAAK,aACR,SAAS,eAAc,EAEvB,KAAK,IAAI,kBAAiB,CAE3B,CACD,CACF,ECrMAlC,GAAA,CACA,kBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,qlBChBAA,GAAA,CACA,oBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,+iBChBAA,GAAA,CACA,sBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,8lBChBAA,GAAA,CACA,0BACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,kmBChBAA,GAAA,CACA,kBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,upBC0KAqC,GAAA,IAAAC,EAAA,+CAAAC,KAAA,4CACAC,GAAA,IAAAF,EAAA,8FACAG,GAAA,IAAAH,EAAA,uDAAAC,KAAA,iDAEAvC,GAAA0C,GAAA,CACA,cAEA,YACA,OAAAC,GACA,SAAAC,GACA,MAAAC,GACA,WAAAC,GACA,eAAAC,GACA,eAAAN,GACA,aAAAD,GACA,QAAAH,GACA,OAAAW,EACA,EAEA,QAAAC,GAAAC,EAAA,EAEA,OACA,OAEA,kBACA,aACA,sCAGA,cACA,cACA,sBAGA,eACA,gBACA,eACA,oBACA,YACA,YACA,mBAGA,YACA,aACA,WAGA,yBACA,2BAGA,kBACA,kBACA,oBACA,YACA,gBACA,WACA,mBACA,KAAAC,GACA,aAEA,eACA,CACA,EAEA,UACA,qBACA,OAAA1D,EAAA,+BAAAA,EAAA,wBACA,EACA,cACA,gCACA,kCACA,EACA,UACA,gCACA,gCACA,EACA,OACA,uBACA,EACA,WACA,2BACA,EACA,qBACA,kCACA,EACA,QACA,wBACA,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GAAA,qBAAAL,CAAA,EAGA,MAAAnC,EAAA,wBAAAC,KAAA,sCACA,gCAEA,yCAEA,qBAAAD,EAAA,IAEA,YAEA,OAAAiB,EAAA,CACA,cAAAA,CAAA,EACAC,EAAAD,CAAA,CACA,CACA,EAEA,SACA,eACA,EAEA,yBAAAtB,EAAA,CACA,uBAAAA,CAAA,CACA,EAMA,mBACA,sBACA,sBAEA,wBAEA,EAEA,oBACA,MAAAG,EAAA,yBACAA,EAAA,kBACAA,EAAA,oBACAA,EAAA,yBACAA,EAAA,yBAEA,EAEA,iBACA,wBACA,0BACA,+BACA,+BAEA,EAEA,8BACA,sEACA,2EACA,EAEA,iCACA,sEACA,2EACA,EAEA,qBACA,uDACA,4DACA,yBAEA,wBAEA,CAEA,CACA,siKCtpCAmC,EAAI,MAAM,CACT,QAAS,CACV,EAAEQ,EACA,CACF,CAAC,EAEDR,EAAI,UAAU,GAAK,OAAO,GAC1BA,EAAI,UAAU,IAAM,OAAO,IAG3B,MAAMS,EAAa,SAAS,cAAc,KAAK,EAC/CA,EAAW,GAAK,SAChB,SAAS,KAAK,YAAYA,CAAU,EAIpC,MAAMC,EAAgB,SAAS,cAAc,KAAK,EAClDA,EAAc,UAAY,4pLAC1BA,EAAc,MAAM,QAAU,OAC9B,SAAS,KAAK,YAAYA,CAAa,EAGxB,IAAIV,EAAI,CACtB,GAAI,UAKJ,KAAM,aACN,OAAQb,GAAKA,EAAEwB,EAAe,CAC/B,CAAC","names":["index","isFullscreenState","isMobileState","canDownload","fileInfo","shareAttributes","downloadAttribute","scope","key","getSortingConfig","viewConfigs","getViewConfigs","asc","isPublicShare","url","generateUrl","axios","response","_a","CancelableRequest","request","controller","options","__spreadProps","__spreadValues","_sfc_main","File","mime","component","data","getDavPath","getFileList","path","client","getDavNameSpaces","genFileInfo","PreviewUrl","getPreviewIfAny","isWindows","process","splitWindowsRe","win32","win32SplitPath","filename","pathString","allParts","splitPathRe","posix","posixSplitPath","pathParseModule","Mime","parsePath","val","old","e","debounce","modalWrapper","modalContainer","parentHeight","parentWidth","heightRatio","widthRatio","NcModal","__vitePreload","n","NcActionLink","NcActionButton","defineComponent","Delete","Download","Error","Fullscreen","FullscreenExit","Pencil","isFullscreen","isMobile","davRemoteURL","_e","_d","_c","_b","davRootPath","loadState","element","logger","viewerRoot","el","fileList","currentIndex","file","isEndOfList","list","handler","subscribe","unsubscribe","type","event","overrideHandlerId","fileRequest","cancelRequestFile","cancelableRequest","getFileInfo","fileName","extractFilePaths","title","error","showError","alias","h","defaultThemeIsLight","group","mimes","folderRequest","cancelRequestFolder","dirPath","filteredFiles","a","b","sortCompare","prev","next","Vue","sidebar","node","currentFileId","fileid","NcFile","davGetRootPath","emit","t","ViewerRoot","VideoControls","ViewerComponent"],"ignoreList":[0,1,9,11,12,13,14,15],"sources":["../node_modules/@nextcloud/vue/dist/Mixins/isFullscreen.mjs","../node_modules/@nextcloud/vue/dist/Mixins/isMobile.mjs","../src/utils/canDownload.ts","../src/services/FileSortingConfig.ts","../src/utils/CancelableRequest.js","../src/components/Error.vue","../src/models/file.js","../src/services/FileList.ts","../src/mixins/PreviewUrl.js","../node_modules/path-parse/index.js","../src/mixins/Mime.js","../node_modules/vue-material-design-icons/Delete.vue","../node_modules/vue-material-design-icons/Download.vue","../node_modules/vue-material-design-icons/Fullscreen.vue","../node_modules/vue-material-design-icons/FullscreenExit.vue","../node_modules/vue-material-design-icons/Pencil.vue","../src/views/Viewer.vue","../src/main.js"],"sourcesContent":["import { isFullscreenState } from \"../Composables/useIsFullscreen.mjs\";\nconst index = {\n computed: {\n /**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsFullscreen` instead.\n */\n isFullscreen() {\n return isFullscreenState.value;\n }\n }\n};\nexport {\n index as default\n};\n","import { isMobileState } from \"../Composables/useIsMobile.mjs\";\nconst index = {\n computed: {\n /**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsMobile` instead.\n */\n isMobile() {\n return isMobileState.value;\n }\n }\n};\nexport {\n index as default\n};\n","/*!\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { FileInfo } from './fileUtils'\n\n/**\n * Check if download permissions are granted for a file\n * @param fileInfo The file info to check\n */\nexport function canDownload(fileInfo: FileInfo) {\n\t// TODO: This should probably be part of `@nextcloud/sharing`\n\t// check share attributes\n\tconst shareAttributes = typeof fileInfo?.shareAttributes === 'string' ? JSON.parse(fileInfo.shareAttributes || '[]') : fileInfo?.shareAttributes\n\n\tif (shareAttributes && shareAttributes.length > 0) {\n\t\tconst downloadAttribute = shareAttributes.find(({ scope, key }) => scope === 'permissions' && key === 'download')\n\t\t// We only forbid download if the attribute is *explicitly* set to 'false'\n\t\treturn downloadAttribute?.value !== false\n\t}\n\t// otherwise return true (as the file needs read permission otherwise we would not have opened it)\n\treturn true\n}\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\nimport { isPublicShare } from '@nextcloud/sharing/public'\n\n/**\n * @return {object}\n */\nexport default async function getSortingConfig() {\n\tconst viewConfigs = await getViewConfigs()\n\n\tif (!viewConfigs) {\n\t\treturn { key: 'basename', asc: true }\n\t}\n\n\tconst keyMap = { mtime: 'lastmod' }\n\tconst key = keyMap[viewConfigs.sorting_mode] || viewConfigs.sorting_mode || 'basename'\n\tconst asc = viewConfigs.sorting_direction === 'asc' || !viewConfigs.sorting_direction\n\n\treturn { key, asc }\n}\n\n/**\n * @return {object}\n */\nasync function getViewConfigs() {\n\tif (isPublicShare()) {\n\t\treturn null\n\t}\n\tconst url = generateUrl('apps/files/api/v1/views')\n\treturn await axios.get(url)\n\t\t.then((response) => {\n\t\t\treturn response.data.data?.files\n\t\t})\n\t\t.catch(() => {\n\t\t\treturn null\n\t\t})\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/**\n * Creates a cancelable axios 'request object'.\n *\n * @param {Function} request the axios promise request\n * @return {object}\n */\nconst CancelableRequest = function(request) {\n\tconst controller = new AbortController()\n\n\t/**\n\t * Execute the request\n\t *\n\t * @param {string} url the url to send the request to\n\t * @param {object} [options] optional config for the request\n\t */\n\tconst fetch = async function(url, options) {\n\t\treturn request(\n\t\t\turl,\n\t\t\t{ ...options, signal: controller.signal },\n\t\t)\n\t}\n\treturn {\n\t\trequest: fetch,\n\t\tcancel: () => controller.abort(),\n\t}\n}\n\nexport default CancelableRequest\n","\n\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getDavPath } from '../utils/fileUtils.ts'\n\n/**\n * @param {object} fileInfo a FileInfo object\n * @param {string} mime the file mime type\n * @param {object} component the component to render\n */\nexport default function(fileInfo, mime, component) {\n\tconst data = {\n\t\tmime,\n\t\tmodal: component,\n\t\tfailed: false,\n\t\tloaded: false,\n\t\tdavPath: getDavPath(fileInfo),\n\t\tsource: fileInfo.source ?? getDavPath(fileInfo),\n\t}\n\n\treturn Object.assign({}, fileInfo, data)\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getDavNameSpaces, getDavProperties } from '@nextcloud/files'\nimport { client } from './WebdavClient'\nimport { genFileInfo, type FileInfo } from '../utils/fileUtils'\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\n/**\n * Retrieve the files list\n * @param path\n * @param options\n */\nexport default async function(path: string, options = {}): Promise {\n\tconst response = await client.getDirectoryContents(path, Object.assign({\n\t\tdata: `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${getDavProperties()}\n\t\t\t\t\n\t\t\t`,\n\t\tdetails: true,\n\t}, options)) as ResponseDataDetailed\n\n\treturn response.data.map(genFileInfo)\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getPreviewIfAny } from '../utils/previewUtils.ts'\nimport { getDavPath } from '../utils/fileUtils.ts'\n\nexport default {\n\tcomputed: {\n\t\t/**\n\t\t * Link to the preview path if the file have a preview\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tpreviewPath() {\n\t\t\treturn this.getPreviewIfAny({\n\t\t\t\tfileid: this.fileid,\n\t\t\t\tfilename: this.filename,\n\t\t\t\tpreviewUrl: this.previewUrl,\n\t\t\t\thasPreview: this.hasPreview,\n\t\t\t\tdavPath: this.davPath,\n\t\t\t\tetag: this.$attrs.etag,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Absolute dav remote path of the file\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tdavPath() {\n\t\t\treturn getDavPath({\n\t\t\t\tfilename: this.filename,\n\t\t\t\tbasename: this.basename,\n\t\t\t})\n\t\t},\n\t},\n\tmethods: {\n\t\t/**\n\t\t * Return the preview url if the file have an existing\n\t\t * preview or the absolute dav remote path if none.\n\t\t *\n\t\t * @param {object} data destructuring object\n\t\t * @param {string} data.fileid the file id\n\t\t * @param {string} [data.previewUrl] URL of the file preview\n\t\t * @param {boolean} data.hasPreview have the file an existing preview ?\n\t\t * @param {string} data.davPath the absolute dav path\n\t\t * @param {string} data.filename the file name\n\t\t * @param {string|null} data.etag the etag of the file\n\t\t * @return {string} the absolute url\n\t\t */\n\t\tgetPreviewIfAny(data) {\n\t\t\treturn getPreviewIfAny(data)\n\t\t},\n\t},\n}\n","'use strict';\n\nvar isWindows = process.platform === 'win32';\n\n// Regex to split a windows path into into [dir, root, basename, name, ext]\nvar splitWindowsRe =\n /^(((?:[a-zA-Z]:|[\\\\\\/]{2}[^\\\\\\/]+[\\\\\\/]+[^\\\\\\/]+)?[\\\\\\/]?)(?:[^\\\\\\/]*[\\\\\\/])*)((\\.{1,2}|[^\\\\\\/]+?|)(\\.[^.\\/\\\\]*|))[\\\\\\/]*$/;\n\nvar win32 = {};\n\nfunction win32SplitPath(filename) {\n return splitWindowsRe.exec(filename).slice(1);\n}\n\nwin32.parse = function(pathString) {\n if (typeof pathString !== 'string') {\n throw new TypeError(\n \"Parameter 'pathString' must be a string, not \" + typeof pathString\n );\n }\n var allParts = win32SplitPath(pathString);\n if (!allParts || allParts.length !== 5) {\n throw new TypeError(\"Invalid path '\" + pathString + \"'\");\n }\n return {\n root: allParts[1],\n dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),\n base: allParts[2],\n ext: allParts[4],\n name: allParts[3]\n };\n};\n\n\n\n// Split a filename into [dir, root, basename, name, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^((\\/?)(?:[^\\/]*\\/)*)((\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))[\\/]*$/;\nvar posix = {};\n\n\nfunction posixSplitPath(filename) {\n return splitPathRe.exec(filename).slice(1);\n}\n\n\nposix.parse = function(pathString) {\n if (typeof pathString !== 'string') {\n throw new TypeError(\n \"Parameter 'pathString' must be a string, not \" + typeof pathString\n );\n }\n var allParts = posixSplitPath(pathString);\n if (!allParts || allParts.length !== 5) {\n throw new TypeError(\"Invalid path '\" + pathString + \"'\");\n }\n \n return {\n root: allParts[1],\n dir: allParts[0].slice(0, -1),\n base: allParts[2],\n ext: allParts[4],\n name: allParts[3],\n };\n};\n\n\nif (isWindows)\n module.exports = win32.parse;\nelse /* posix */\n module.exports = posix.parse;\n\nmodule.exports.posix = posix.parse;\nmodule.exports.win32 = win32.parse;\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport debounce from 'debounce'\nimport PreviewUrl from '../mixins/PreviewUrl.js'\nimport parsePath from 'path-parse'\n\nexport default {\n\tinheritAttrs: false,\n\tmixins: [PreviewUrl],\n\tprops: {\n\t\t// Is the current component shown\n\t\tactive: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// file name\n\t\tbasename: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// file path relative to user folder\n\t\tfilename: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// file source to fetch contents from\n\t\tsource: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t// URL the file preview\n\t\tpreviewUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t// should the standard core preview be used?\n\t\thasPreview: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// unique file id\n\t\tfileid: {\n\t\t\ttype: [Number, String],\n\t\t\trequired: false,\n\t\t},\n\t\t// list of all the visible files\n\t\tfileList: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\t// file mime (aliased if specified in the model)\n\t\tmime: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// can the user swipe\n\t\tcanSwipe: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t\tcanZoom: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// is the content loaded?\n\t\t// synced with parent\n\t\tloaded: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// is the sidebar currently opened ?\n\t\tisSidebarShown: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// are we in fullscreen mode ?\n\t\tisFullScreen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// The file id of the peer live photo file\n\t\tmetadataFilesLivePhoto: {\n\t\t\ttype: Number,\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\theight: null,\n\t\t\twidth: null,\n\t\t\tnaturalHeight: null,\n\t\t\tnaturalWidth: null,\n\t\t\tisLoaded: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tname() {\n\t\t\treturn parsePath(this.basename).name\n\t\t},\n\t\text() {\n\t\t\treturn parsePath(this.basename).ext\n\t\t},\n\t\tsrc() {\n\t\t\treturn this.source ?? this.davPath\n\t\t},\n\t},\n\n\twatch: {\n\t\tactive(val, old) {\n\t\t\t// the item was hidden before and is now the current view\n\t\t\tif (val === true && old === false) {\n\t\t\t\t// just in case the file was preloaded, let's warn the viewer\n\t\t\t\tif (this.isLoaded) {\n\t\t\t\t\tthis.doneLoading()\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// update image size on sidebar toggle\n\t\tisSidebarShown() {\n\t\t\t// wait for transition to complete (100ms)\n\t\t\tsetTimeout(this.updateHeightWidth, 200)\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// detect error and let the viewer know\n\t\tthis.$el.addEventListener('error', e => {\n\t\t\tconsole.error('Error loading', this.filename, e)\n\t\t\tthis.$emit('error', e)\n\t\t})\n\n\t\t// update image size on window resize\n\t\twindow.addEventListener('resize', debounce(() => {\n\t\t\tthis.updateHeightWidth()\n\t\t}, 100))\n\t},\n\n\tmethods: {\n\n\t\t/**\n\t\t * This is used to make the viewer know this file is complete or ready\n\t\t * ! you NEED to use it to make the viewer aware of the current loading state\n\t\t */\n\t\tdoneLoading() {\n\t\t\t// send the current state\n\t\t\tthis.$emit('update:loaded', true)\n\t\t\t// save the current state\n\t\t\tthis.isLoaded = true\n\t\t},\n\n\t\t/**\n\t\t * Updates the current height and width data\n\t\t * based on the viewer maximum size\n\t\t */\n\t\tupdateHeightWidth() {\n\t\t\tconst modalWrapper = this.$parent.$el.querySelector('.modal-wrapper')\n\t\t\tif (modalWrapper && this.naturalHeight > 0 && this.naturalWidth > 0) {\n\t\t\t\tconst modalContainer = modalWrapper.querySelector('.modal-container')\n\n\t\t\t\tconst parentHeight = modalContainer.clientHeight\n\t\t\t\tconst parentWidth = modalContainer.clientWidth\n\n\t\t\t\tconst heightRatio = parentHeight / this.naturalHeight\n\t\t\t\tconst widthRatio = parentWidth / this.naturalWidth\n\n\t\t\t\t// if the video height is capped by the parent height\n\t\t\t\t// AND the video is bigger than the parent\n\t\t\t\tif (heightRatio < widthRatio && heightRatio < 1) {\n\t\t\t\t\tthis.height = parentHeight\n\t\t\t\t\tthis.width = Math.round(this.naturalWidth / this.naturalHeight * parentHeight)\n\n\t\t\t\t// if the video width is capped by the parent width\n\t\t\t\t// AND the video is bigger than the parent\n\t\t\t\t} else if (heightRatio > widthRatio && widthRatio < 1) {\n\t\t\t\t\tthis.width = parentWidth\n\t\t\t\t\tthis.height = Math.round(this.naturalHeight / this.naturalWidth * parentWidth)\n\n\t\t\t\t// RESET\n\t\t\t\t} else {\n\t\t\t\t\tthis.height = this.naturalHeight\n\t\t\t\t\tthis.width = this.naturalWidth\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.height = this.naturalHeight\n\t\t\t\tthis.width = this.naturalWidth\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Enable the viewer swiping previous/next capability\n\t\t */\n\t\tenableSwipe() {\n\t\t\tthis.$emit('update:canSwipe', true)\n\t\t},\n\n\t\t/**\n\t\t * Disable the viewer swiping previous/next capability\n\t\t */\n\t\tdisableSwipe() {\n\t\t\tthis.$emit('update:canSwipe', false)\n\t\t},\n\n\t\t/**\n\t\t * Toggle the fullscreen on the current visible element\n\t\t */\n\t\ttoggleFullScreen() {\n\t\t\tif (this.isFullScreen) {\n\t\t\t\tdocument.exitFullscreen()\n\t\t\t} else {\n\t\t\t\tthis.$el.requestFullscreen()\n\t\t\t}\n\t\t},\n\t},\n}\n","\n\n","\n\n","\n\n","\n\n","\n\n","\n\n\n\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { translate as t } from '@nextcloud/l10n'\nimport Vue from 'vue'\n\nimport ViewerComponent from './views/Viewer.vue'\n\nVue.mixin({\n\tmethods: {\n\t\tt,\n\t},\n})\n\nVue.prototype.OC = window.OC\nVue.prototype.OCA = window.OCA\n\n// Create document root\nconst ViewerRoot = document.createElement('div')\nViewerRoot.id = 'viewer'\ndocument.body.appendChild(ViewerRoot)\n\n// Put controls for video viewer\n// Needed as Firefox CSP blocks the loading of the svg through the normal plyr system\nconst VideoControls = document.createElement('div')\nVideoControls.innerHTML = PLYR_ICONS\nVideoControls.style.display = 'none'\ndocument.body.appendChild(VideoControls)\n\n// Init vue\nexport default new Vue({\n\tel: '#viewer',\n\t// When debugging the page, it's easier to find which app\n\t// is which. Especially when there is multiple apps\n\t// roots mounted o the same page!\n\t// eslint-disable-next-line vue/match-component-file-name\n\tname: 'ViewerRoot',\n\trender: h => h(ViewerComponent),\n})\n"],"file":"js/viewer-main.mjs"} \ No newline at end of file diff --git a/src/views/Viewer.vue b/src/views/Viewer.vue index 238601b7d..488e84a54 100644 --- a/src/views/Viewer.vue +++ b/src/views/Viewer.vue @@ -10,7 +10,7 @@ :data-handler="handlerId">
- -
+
-