{"version":3,"file":"stylesheets/2107.css?h=188523e8f7f22cd0c52e","mappings":"AA4BA,yCACA,0EACA,iBACA,CACA,6CACA,iBACA,cACA,eACA,CAEA,qBACA,cACA,YACA,eACA,UACA,CCqCA,sBACA,qDAEA,UADA,WAEA,CAEA,mCACA,8BACA,uCADA,iBACA,YACA,eACA,CAEA,kCACA,6BACA,uCADA,gBACA,WACA","sources":["webpack://@studip/core/./resources/vue/components/stock-images/Thumbnail.vue","webpack://@studip/core/./resources/vue/components/stock-images/EditDialog.vue"],"sourcesContent":["<template>\n    <div class=\"stock-images-thumbnail\" v-if=\"url\">\n        <div :style=\"{ width }\">\n            <img :src=\"url\" :style=\"{ 'object-fit': contain ? 'contain' : 'cover' }\" role=\"presentation\" />\n        </div>\n    </div>\n</template>\n\n<script>\nexport default {\n    props: {\n        url: {\n            type: String,\n            required: true,\n        },\n        width: {\n            type: String,\n            default: '6rem',\n        },\n        contain: {\n            type: Boolean,\n            default: false\n        }\n    },\n};\n</script>\n\n<style scoped>\n.stock-images-thumbnail {\n    display: inline-flex;\n    position: relative;\n}\n.stock-images-thumbnail > div {\n    aspect-ratio: 1/1;\n    display: block;\n    overflow: hidden;\n}\n\nimg {\n    display: block;\n    height: 100%;\n    max-width: 100%;\n    width: 100%;\n}\n</style>\n","<template>\n    <studip-dialog\n        v-if=\"stockImage\"\n        height=\"720\"\n        width=\"960\"\n        :title=\"$gettext('Bild bearbeiten')\"\n        @close=\"onCancel\"\n        closeClass=\"cancel\"\n        :closeText=\"$gettext('Schließen')\"\n    >\n        <template v-slot:dialogContent>\n            <form id=\"stock-images-edit-form\" class=\"default\" @submit.prevent=\"onSubmit\">\n                <div>\n                    <ThumbnailCard\n                        :chdate=\"new Date(stockImage.attributes.chdate)\"\n                        :height=\"stockImage.attributes.height\"\n                        :mime-type=\"stockImage.attributes['mime-type']\"\n                        :mkdate=\"new Date(stockImage.attributes.mkdate)\"\n                        :size=\"stockImage.attributes.size\"\n                        :url=\"stockImage.attributes['download-urls'].small\"\n                        :width=\"stockImage.attributes.width\"\n                    />\n                </div>\n\n                <div>\n                    <AttributesFieldset :metadata=\"metadata\" :suggested-tags=\"suggestedTags\" @change=\"onChange\" />\n                </div>\n            </form>\n        </template>\n\n        <template #dialogButtons>\n            <button form=\"stock-images-edit-form\" type=\"submit\" class=\"button accept\">\n                {{ $gettext('Speichern') }}\n            </button>\n        </template>\n    </studip-dialog>\n</template>\n<script>\nimport ThumbnailCard from './ThumbnailCard.vue';\nimport AttributesFieldset from './AttributesFieldset.vue';\n\nexport default {\n    props: ['stockImage', 'suggestedTags'],\n    components: { AttributesFieldset, ThumbnailCard },\n    data: () => ({\n        metadata: {},\n    }),\n    methods: {\n        onCancel() {\n            this.$emit('cancel');\n        },\n        onChange(metadata) {\n            this.metadata = metadata;\n        },\n        onSubmit() {\n            this.$emit('confirm', { ...this.metadata });\n        },\n        resetLocalCopy() {\n            const {\n                title = '',\n                description = '',\n                author = '',\n                license = '',\n                tags = [],\n            } = this.stockImage?.attributes ?? [];\n            this.metadata = { title, description, author, license, tags };\n        },\n    },\n    mounted() {\n        this.resetLocalCopy();\n    },\n    watch: {\n        stockImage() {\n            this.resetLocalCopy();\n        },\n    },\n};\n</script>\n\n<style scoped>\nform {\n    display: flex;\n    height: 100%;\n    gap: 1.5em;\n}\n\nform > *:first-child {\n    flex-basis: 200px;\n    flex-grow: 0;\n    overflow: hidden;\n}\n\nform > *:last-child {\n    flex-basis: 30em;\n    flex-grow: 1;\n}\n</style>\n"],"names":[],"sourceRoot":""}