{"version":3,"sources":["webpack:///./src/components/Forms/FieldTypes/FormVideoUploadField.vue?bc9f","webpack:///./node_modules/client-website-ts-library/components/MultiSelect.vue?2f5e","webpack:///./node_modules/client-website-ts-library/components/MultiSelect.vue?a3ca","webpack:///./node_modules/client-website-ts-library/components/MultiSelect.vue?2d48","webpack:///./node_modules/client-website-ts-library/components/MultiSelect.vue?7bcf","webpack:///./node_modules/client-website-ts-library/components/MultiSelect.vue","webpack:///./src/components/Forms/FieldTypes/FormVideoUploadField.vue?82e3","webpack:///./src/components/Forms/FieldTypes/FormVideoUploadField.vue","webpack:///./src/components/Forms/FieldTypes/FormVideoUploadField.vue?8f35","webpack:///./src/components/Forms/FieldTypes/FormVideoUploadField.vue?0867"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","class","focused","style","background","focusBg","itemBorderRad","on","defocus","_l","item","key","Value","_v","_s","Label","attrs","$event","removeItem","selectedValue","length","previewCount","_e","directives","name","rawName","value","expression","searchPlaceholder","domProps","updateSearch","gotFocus","target","composing","search","searchResults","result","Option","Selected","select","noResults","staticRenderFns","MultiSelect","Vue","constructor","requestAnimationFrame","results","options","loweredSearch","toLowerCase","filter","itm","indexOf","map","r","some","s","enableCustom","push","customLabelPrefix","customValuePrefix","option","v","$emit","idx","findIndex","splice","setValues","opt","slice","__decorate","Prop","required","default","Component","component","hasErrors","def","TypeName","videoBlob","ref","handleDone","deleteVideo","Labels","Delete","recordNewVideo","Replace","FormVideoUploadField","videoBlobUrl","errors","_this$videoBlobUrl","URL","revokeObjectURL","createObjectURL","$refs","preview","src","recorder","requestRecording","getValue","Key","setValue","Blob","components","VideoRecorder"],"mappings":"2IAAA,W,yDCAA,W,kCCAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,eAAeC,MAAM,CAAC,wBAAyBP,EAAIQ,SAASC,MAAM,CACtL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UAAYA,EAES,OAAtBpF,KAAK6F,eACPG,IAAIC,gBAAgBjG,KAAK6F,cACzB7F,KAAK6F,aAAe,MAGC,OAAnB7F,KAAKoF,YACPpF,KAAK6F,aAAeG,IAAIE,gBAAgBlG,KAAKoF,YAG9CpF,KAAKmG,MAAMC,QAA6BC,IAAuB,QAApBN,EAAG/F,KAAK6F,oBAAY,IAAAE,IAAI,GAG9DL,iBACL1F,KAAKmG,MAAMG,SAAsCC,mBAG5ChB,cACNvF,KAAKsF,WAAW,MAGlBkB,WACE,MAAO,CACLC,IAAKzG,KAAKkF,IAAIuB,IACdxF,MAAOjB,KAAKoF,WAIhBsB,SAAS3E,IACHA,EAAMd,iBAAiB0F,MAAwB,OAAhB5E,EAAMd,SACvCjB,KAAKoF,UAAYrD,EAAMd,SA7C3B0D,wBAAA,CADCC,kB,0BAIDD,wBAAA,CADCC,kB,6BAJkBgB,EAAoBjB,wBAAA,CALxCI,eAAU,CACT6B,WAAY,CACVC,yBAGiBjB,WC9B8Z,I,wBCQ/aZ,EAAY,eACd,EACAlF,EACAgD,GACA,EACA,KACA,WACA,MAIa,aAAAkC,E","file":"js/chunk-52405ff6.44f17953.js","sourcesContent":["export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FormVideoUploadField.vue?vue&type=style&index=0&id=6832a9d6&scoped=true&lang=css&\"","export * from \"-!../../mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../vue-loader/lib/loaders/stylePostLoader.js!../../postcss-loader/src/index.js??ref--6-oneOf-1-2!../../cache-loader/dist/cjs.js??ref--0-0!../../vue-loader/lib/index.js??vue-loader-options!./MultiSelect.vue?vue&type=style&index=0&id=396af627&scoped=true&lang=css&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"multi-select\",class:{'multi-select--focused': _vm.focused},style:({\n '--ms-bg': _vm.background,\n '--focus-bg': _vm.focusBg,\n '--item-border-rad': _vm.itemBorderRad,\n})},[_c('div',{staticClass:\"multi-select__abyss\",on:{\"click\":_vm.defocus}}),_c('div',{staticClass:\"multi-select__input-wrapper\"},[_c('div',{staticClass:\"multi-select__values\"},[_vm._l((_vm.previewItems),function(item){return _c('div',{key:item.Value,staticClass:\"multi-select__value\"},[_c('span',{staticClass:\"multi-select__value__label\"},[_vm._v(_vm._s(item.Label))]),_c('button',{staticClass:\"multi-select__value__remove\",attrs:{\"type\":\"button\"},on:{\"click\":function($event){return _vm.removeItem(item.Value)}}},[_c('Icon',{attrs:{\"icon\":\"close-button\",\"colour\":\"white\"}})],1)])}),(_vm.selectedValue.length + 1 > _vm.previewCount)?_c('div',{staticClass:\"multi-select__value\"},[_c('span',{staticClass:\"multi-select__value__label\"},[_vm._v(_vm._s(_vm.selectedValue.length + 1 - _vm.previewCount)+\" more\")])]):_vm._e()],2),_c('div',{staticClass:\"multi-select__input-wrap\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.search),expression:\"search\"}],staticClass:\"multi-select__input\",attrs:{\"type\":\"text\",\"placeholder\":_vm.searchPlaceholder},domProps:{\"value\":(_vm.search)},on:{\"keyup\":_vm.updateSearch,\"focus\":_vm.gotFocus,\"input\":function($event){if($event.target.composing){ return; }_vm.search=$event.target.value}}})])]),_c('div',{staticClass:\"multi-select__dropdown\"},[(_vm.searchResults.length)?_c('ul',{staticClass:\"multi-select__dropdown__results\"},_vm._l((_vm.searchResults),function(result){return _c('li',{key:result.Option.Value,staticClass:\"multi-select__dropdown__result\",class:{'multi-select__dropdown__result--selected': result.Selected},on:{\"click\":function($event){return _vm.select(result)}}},[_vm._v(\" \"+_vm._s(result.Option.Label)+\" \")])}),0):_c('div',{staticClass:\"multi-select__dropdown__no-results\"},[_vm._v(\" \"+_vm._s(_vm.noResults)+\" \")])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue, Prop } from \"vue-property-decorator\";\r\n\r\ninterface MultiSelectOption {\r\n Value: string;\r\n Label: string;\r\n}\r\n\r\ninterface MultiSelectResult {\r\n Option: MultiSelectOption;\r\n Selected: boolean;\r\n}\r\n\r\nexport {\r\n MultiSelectOption\r\n}\r\n\r\n@Component\r\nexport default class MultiSelect extends Vue {\r\n @Prop({ required: true })\r\n private readonly options!: MultiSelectOption[];\r\n\r\n @Prop({ default: false })\r\n private readonly enableCustom!: boolean;\r\n\r\n @Prop({ default: 'Search for ' })\r\n private readonly customLabelPrefix!: string;\r\n\r\n @Prop({ default: 'search:' })\r\n private readonly customValuePrefix!: string;\r\n\r\n @Prop({ default: 5 })\r\n private readonly previewCount!: number;\r\n\r\n @Prop({ default: 'Search' })\r\n private readonly searchPlaceholder!: string;\r\n\r\n @Prop({ default: 'No results found' })\r\n private readonly noResults!: string;\r\n\r\n @Prop({ default: 'transparent' })\r\n private readonly background!: string;\r\n\r\n @Prop({ default: '#fff' })\r\n private readonly focusBg!: string;\r\n\r\n @Prop({ default: '0.25em' })\r\n private readonly itemBorderRad!: string;\r\n\r\n private focused = false;\r\n\r\n private selectedValue: MultiSelectOption[] = [];\r\n\r\n private search = '';\r\n\r\n private searchResults: MultiSelectResult[] = [];\r\n\r\n gotFocus() {\r\n this.focused = true;\r\n this.updateSearch();\r\n }\r\n\r\n defocus() {\r\n requestAnimationFrame(() => {\r\n this.focused = false;\r\n });\r\n }\r\n\r\n updateSearch() {\r\n let results: MultiSelectOption[];\r\n\r\n if (this.search.length === 0) {\r\n results = this.options;\r\n } else {\r\n const loweredSearch = this.search.toLowerCase();\r\n\r\n results = this.options.filter((itm) => itm.Label.toLowerCase().indexOf(loweredSearch) !== -1);\r\n }\r\n\r\n this.searchResults = results\r\n .map((r) => ({ Option: r, Selected: this.selectedValue.some((s) => s.Value === r.Value) }));\r\n\r\n if (this.enableCustom) {\r\n this.searchResults.push({\r\n Option: {\r\n Label: `${this.customLabelPrefix}${this.search}`,\r\n Value: `${this.customValuePrefix}${this.search}`,\r\n },\r\n Selected: false,\r\n });\r\n }\r\n }\r\n\r\n select(option: MultiSelectResult) {\r\n if (!this.selectedValue.some((v) => v.Value === option.Option.Value)) {\r\n this.selectedValue.push(option.Option);\r\n\r\n this.search = '';\r\n\r\n this.updateSearch();\r\n\r\n this.$emit('updated', this.selectedValue);\r\n } else {\r\n this.removeItem(option.Option.Value);\r\n }\r\n }\r\n\r\n removeItem(value: string) {\r\n const idx = this.selectedValue.findIndex((itm) => itm.Value === value);\r\n\r\n if(idx !== -1) {\r\n this.selectedValue.splice(idx, 1);\r\n\r\n this.updateSearch();\r\n\r\n this.$emit('updated', this.selectedValue);\r\n }\r\n }\r\n\r\n public setValues(value: string[]): void {\r\n this.selectedValue = this.options.filter((opt) => value.indexOf(opt.Value) !== -1);\r\n }\r\n\r\n get previewItems(): MultiSelectOption[] {\r\n return this.selectedValue.slice(0, this.previewCount - 1);\r\n }\r\n}\r\n","import mod from \"-!../../cache-loader/dist/cjs.js??ref--14-0!../../thread-loader/dist/cjs.js!../../babel-loader/lib/index.js!../../ts-loader/index.js??ref--14-3!../../cache-loader/dist/cjs.js??ref--0-0!../../vue-loader/lib/index.js??vue-loader-options!./MultiSelect.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../cache-loader/dist/cjs.js??ref--14-0!../../thread-loader/dist/cjs.js!../../babel-loader/lib/index.js!../../ts-loader/index.js??ref--14-3!../../cache-loader/dist/cjs.js??ref--0-0!../../vue-loader/lib/index.js??vue-loader-options!./MultiSelect.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./MultiSelect.vue?vue&type=template&id=396af627&scoped=true&\"\nimport script from \"./MultiSelect.vue?vue&type=script&lang=ts&\"\nexport * from \"./MultiSelect.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./MultiSelect.vue?vue&type=style&index=0&id=396af627&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"396af627\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"form-field\",class:[{'has-errors': _vm.hasErrors}, 'form-field--' + _vm.def.TypeName]},[_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.videoBlob === null),expression:\"videoBlob === null\"}],staticClass:\"form-field__panel\"},[_c('VideoRecorder',{ref:\"recorder\",attrs:{\"def\":_vm.def},on:{\"done\":_vm.handleDone}})],1),_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.videoBlob !== null),expression:\"videoBlob !== null\"}],staticClass:\"form-field__panel\"},[_c('div',{staticClass:\"video-preview\"},[_c('video',{ref:\"preview\",staticClass:\"video-preview__video\",attrs:{\"autoplay\":\"\",\"controls\":\"\"}})]),_c('div',{staticClass:\"center-text\"},[_c('Button',{staticClass:\"video-field__swap-buttons\",on:{\"click\":_vm.deleteVideo}},[_vm._v(_vm._s(_vm.def.Labels.Delete))]),_c('Button',{staticClass:\"video-field__swap-buttons\",on:{\"click\":_vm.recordNewVideo}},[_vm._v(_vm._s(_vm.def.Labels.Replace))])],1)])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue, Prop } from 'vue-property-decorator';\r\nimport { VideoRecorderField, IFormField } from 'client-website-ts-library/types/Forms/FieldTypes';\r\nimport { FormSubmissionValidationError, FormValue } from 'client-website-ts-library/types/Forms';\r\n\r\nimport { VideoRecorder } from 'client-website-ts-library/components';\r\n\r\n@Component({\r\n components: {\r\n VideoRecorder,\r\n },\r\n})\r\nexport default class FormVideoUploadField extends Vue implements IFormField {\r\n @Prop()\r\n private readonly def!: VideoRecorderField;\r\n\r\n @Prop()\r\n private readonly errors!: FormSubmissionValidationError[];\r\n\r\n private videoBlob: Blob | null = null;\r\n\r\n private videoBlobUrl: string | null = null;\r\n\r\n get hasErrors(): boolean {\r\n return this.errors.length > 0;\r\n }\r\n\r\n private handleDone(videoBlob: Blob | null) {\r\n this.videoBlob = videoBlob;\r\n\r\n if (this.videoBlobUrl !== null) {\r\n URL.revokeObjectURL(this.videoBlobUrl!);\r\n this.videoBlobUrl = null;\r\n }\r\n\r\n if (this.videoBlob !== null) {\r\n this.videoBlobUrl = URL.createObjectURL(this.videoBlob);\r\n }\r\n\r\n (this.$refs.preview as HTMLVideoElement).src = this.videoBlobUrl ?? '';\r\n }\r\n\r\n private recordNewVideo() {\r\n (this.$refs.recorder as unknown as VideoRecorder).requestRecording();\r\n }\r\n\r\n private deleteVideo(): void {\r\n this.handleDone(null);\r\n }\r\n\r\n getValue(): FormValue {\r\n return {\r\n Key: this.def.Key,\r\n Value: this.videoBlob,\r\n };\r\n }\r\n\r\n setValue(value: FormValue) {\r\n if (value.Value instanceof Blob || value.Value === null) {\r\n this.videoBlob = value.Value;\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FormVideoUploadField.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FormVideoUploadField.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FormVideoUploadField.vue?vue&type=template&id=6832a9d6&scoped=true&\"\nimport script from \"./FormVideoUploadField.vue?vue&type=script&lang=ts&\"\nexport * from \"./FormVideoUploadField.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./FormVideoUploadField.vue?vue&type=style&index=0&id=6832a9d6&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"6832a9d6\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}