1/*! For license information please see 1991.88295716.js.LICENSE.txt */ 2"use strict";(self.webpackChunkmintme=self.webpackChunkmintme||[]).push([[1991],{31991:function(t,e,i){i.r(e),i.d(e,{default:function(){return I}});i(97389),i(60228),i(73964),i(59749),i(86544),i(84254),i(752),i(21694),i(76265),i(58373),i(66793),i(7629),i(77509),i(88052),i(47522),i(34284),i(5399),i(89730);var n=i(50060),o=i(16093),r=(i(79288),i(57810)),a=i(78947),s=i(59417),l=i(4534),c=i(79454),u=i.n(c),h=i(67591),d=i(62248);a.vI.add(s.acZ,s.q9v,s.Wq6);var m={name:"ImageEditorModal",components:{FontAwesomeIcon:r.GN,vueSlider:u(),MButton:d.G5,Modal:h.Z},mixins:[n.SB],props:{isVisible:{type:Boolean,default:!1},uploading:{type:Boolean,default:!1},editingImage:File,isCover:{type:Boolean,default:!1}},data:function(){return{imageSrc:"",imageWidth:0,imageHeight:0,isImageValid:!1,zoomScale:1,maxZoom:2,zoomInterval:.1,imageMinWidth:this.isCover?o.MIN_IMAGE_DIMENSIONS_UPLOAD.cover.width:o.MIN_IMAGE_DIMENSIONS_UPLOAD.avatar.width,imageMinHeight:this.isCover?o.MIN_IMAGE_DIMENSIONS_UPLOAD.cover.height:o.MIN_IMAGE_DIMENSIONS_UPLOAD.avatar.height,panzoomInstance:void 0,wrapperElement:void 0}},methods:{saveImage:function(){if(!this.uploading){var t=this.panzoomInstance.getPan(),e=t.x,i=t.y,n=this.panzoomInstance.getScale(),o=this.imageWidth-this.imageWidth*n,r=this.imageHeight-this.imageHeight*n;o/=2*n,r/=2*n,this.$emit("save",{x:Math.abs(e+o)*n,y:Math.abs(i+r)*n,scale:n,width:this.wrapperElement.clientWidth})}},closeImageEditor:function(){this.cleanUp(),this.$emit("close")},loadFileToImageSrc:function(t){var e=this,i=new FileReader;i.onload=function(t){e.imageSrc=t.target.result},i.readAsDataURL(t)},validateImageToEdit:function(t){var e=this,i=new Image;i.onload=function(){e.imageWidth=i.width,e.imageHeight=i.height,i.width<e.imageMinWidth?e.onImageValidationError(e.$t("img.validation.min_width",e.translationsContext)):i.height<e.imageMinHeight?e.onImageValidationError(e.$t("img.validation.min_height",e.translationsContext)):e.isImageValid=!0},i.src=t},onImageValidationError:function(t){this.imageSrc="",this.isImageValid=!1,this.notifyError(t),this.$emit("error")},initPanZoomFeature:function(){var t=this.$refs.image;this.panzoomInstance=(0,l.Z)(t,{maxScale:this.maxZoom,contain:"outside"}),this.wrapperElement=this.$refs.wrapper},zoomUp:function(){this.canZoomUp&&(this.zoomScale=(Number(this.zoomScale)+this.zoomInterval).toFixed(1))},zoomDown:function(){this.canZoomDown&&(this.zoomScale=(Number(this.zoomScale)-this.zoomInterval).toFixed(1))},cleanUp:function(){this.imageSrc="",this.isImageValid=!1,this.zoomScale=1,this.panzoomInstance.destroy()}},computed:{canZoomUp:function(){return this.zoomScale<this.maxZoom},canZoomDown:function(){return this.zoomScale>this.minZoom},shouldDisplayModal:function(){return this.isVisible&&this.isImageValid},minZoom:function(){var t,e;if(this.imageSrc&&this.wrapperElement){for(var i=null===(t=this.wrapperElement)||void 0===t?void 0:t.clientWidth,n=null===(e=this.wrapperElement)||void 0===e?void 0:e.clientHeight,o=i/this.imageWidth,r=Math.ceil(10*o)/10;this.imageHeight*r<n;)r+=this.zoomInterval;return r}},translationsContext:function(){return{minWidth:this.imageMinWidth,minHeight:this.imageMinHeight,width:this.imageWidth,height:this.imageHeight}}},watch:{editingImage:function(t){t&&this.loadFileToImageSrc(t)},imageSrc:function(t){t&&this.validateImageToEdit(t)},zoomScale:function(t){if(this.wrapperElement&&this.panzoomInstance){var e=this.wrapperElement.getBoundingClientRect(),i={clientX:e.left+e.width/2,clientY:e.top+e.height/2};this.panzoomInstance.zoomToPoint(t,i,{animate:!0})}}},beforeDestroy:function(){var t;null===(t=this.panzoomInstance)||void 0===t||t.destroy()}},f=i(51900);function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function g(){g=function(){return e};var t,e={},i=Object.prototype,n=i.hasOwnProperty,o=Object.defineProperty||function(t,e,i){t[e]=i.value},r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function c(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}
vendor: 4,154 bytes, line 2
2catch(t){c=function(t,e,i){return t[e]=i}}function u(t,e,i,n){var r=e&&e.prototype instanceof w?e:w,a=Object.create(r.prototype),s=new F(n||[]);return o(a,"_invoke",{value:M(t,i,s)}),a}function h(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var d="suspendedStart",m="suspendedYield",f="executing",v="completed",y={};function w(){}function I(){}function E(){}var x={};c(x,a,(function(){return this}));var b=Object.getPrototypeOf,_=b&&b(b(O([])));_&&_!==i&&n.call(_,a)&&(x=_);var S=E.prototype=w.prototype=Object.create(x);function z(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function i(o,r,a,s){var l=h(t[o],t,r);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==p(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(u).then((function(t){c.value=t,a(c)}),(function(t){return i("throw",t,a,s)}))}s(l.arg)}var r;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){i(t,n,e,o)}))}return r=r?r.then(o,o):o()}})}function M(e,i,n){var o=d;return function(r,a){if(o===f)throw new Error("Generator is already running");if(o===v){if("throw"===r)throw a;return{value:t,done:!0}}for(n.method=r,n.arg=a;;){var s=n.delegate;if(s){var l=C(s,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var c=h(e,i,n);if("normal"===c.type){if(o=n.done?v:m,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function C(e,i){var n=i.method,o=e.iterator[n];if(o===t)return i.delegate=null,"throw"===n&&e.iterator.return&&(i.method="return",i.arg=t,C(e,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var r=h(o,e.iterator,i.arg);if("throw"===r.type)return i.method="throw",i.arg=r.arg,i.delegate=null,y;var a=r.arg;return a?a.done?(i[e.resultName]=a.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,y):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function D(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function O(e){if(e||""===e){var i=e[a];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,r=function i(){for(;++o<e.length;)if(n.call(e,o))return i.value=e[o],i.done=!1,i;return i.value=t,i.done=!0,i};return r.next=r}}throw new TypeError(p(e)+" is not iterable")}return I.prototype=E,o(S,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:I,configurable:!0}),I.displayName=c(E,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===I||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,c(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},z(L.prototype),c(L.prototype,s,(function(){return this})),e.AsyncIterator=L,e.async=function(t,i,n,o,r){void 0===r&&(r=Promise);var a=new L(u(t,i,n,o),r);return e.isGeneratorFunction(i)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},z(S),c(S,l,"Generator"),c(S,a,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=O,F.prototype={constructor:F,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEac
2h(k),!e)for(var i in this)"t"===i.charAt(0)&&n.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function o(n,o){return s.type="throw",s.arg=e,i.next=n,o&&(i.method="next",i.arg=t),!!o}for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var r=o;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=t,a.arg=e,r?(this.method="next",this.next=r.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),k(i),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var o=n.arg;k(i)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,i,n){return this.delegate={iterator:O(e),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function v(t,e,i,n,o,r,a){try{var s=t[r](a),l=s.value}catch(t){return void i(t)}s.done?e(l):Promise.resolve(l).then(n,o)}var y={name:"ImageUploader",components:{ImageEditorModal:(0,f.Z)(m,(function(){var t=this,e=t._self._c;return e("modal",{attrs:{visible:t.shouldDisplayModal,size:t.isCover?"xl":"lg","hide-footer":!1,"no-close":!0,"enable-close-btn":!1,"disable-arrow":!0,"header-class":"modal-edit-header","content-class":"modal-edit-content","footer-class":"modal-edit-footer"},on:{shown:t.initPanZoomFeature,close:t.closeImageEditor},scopedSlots:t._u([{key:"header",fn:function(){return[e("div",{staticClass:"w-100 d-flex align-items-center px-4 py-3"},[e("font-awesome-icon",{staticClass:"c-pointer text-white",attrs:{icon:"arrow-left"},on:{click:t.closeImageEditor}}),t._v(" "),e("div",{staticClass:"flex-grow-1"},[e("h3",{staticClass:"text-white m-0 pl-3",domProps:{innerHTML:t._s(t.$t("edit_image_modal.header"))}})]),t._v(" "),e("m-button",{attrs:{type:"primary",tabindex:"2",loading:t.uploading},on:{click:t.saveImage}},[t._v("\n "+t._s(t.$t("edit_image_modal.save"))+"\n ")])],1)]},proxy:!0},{key:"footer",fn:function(){return[e("div",{staticClass:"image-editor-control w-100 d-flex align-items-center justify-content-center"},[e("font-awesome-icon",{staticClass:"zoom-icon",attrs:{icon:"magnifying-glass-minus"},on:{click:t.zoomDown}}),t._v(" "),e("vue-slider",{staticClass:"px-3",attrs:{min:t.minZoom,max:t.maxZoom,interval:t.zoomInterval,width:"60%",lazy:""},model:{value:t.zoomScale,callback:function(e){t.zoomScale=e},expression:"zoomScale"}}),t._v(" "),e("font-awesome-icon",{staticClass:"zoom-icon",attrs:{icon:"magnifying-glass-plus"},on:{click:t.zoomUp}})],1)]},proxy:!0}])},[t._v(" "),e("template",{slot:"body"},[e("div",{staticClass:"pan-container"},[e("div",{ref:"wrapper",class:[t.isCover?"modal-edit-zone-cover":"modal-edit-zone-avatar"]},[e("img",{ref:"image",attrs:{src:t.imageSrc}})])])])],2)}),[],!1,null,null,null).exports},mixins:[n.SB],props:{type:{type:String,default:""},purpose:{type:String,default:""},token:{type:String,default:null},editMode:{type:Boolean,default:!1},isCover:{type:Boolean,default:!1}},data:function(){return{uploading:!1,isImageEditorVisible:!1,imageFile:void 0,editionData:{}}},methods:{chooseImage:function(){this.uploading||(this.$refs.fileInput.value="",this.$refs.fileInput.click())},openImageEditor:function(){this.isImageEditorVisible=!0},onCloseImageEditor:function(){this.isImageEditorVisible=!1},onImageEditingError:function(){this.onCloseImageEditor()},startUpload:function(){this.$refs.fileInput.files&&(this.imageFile=this.$refs.fileInput.files[0],this.validateFile(this.imageFile)&&(this.editMode?this.openImageEditor():this.upload()))},uploadEditedImage:function(t){this.editionData.translateX=t.x,this.editionData.translateY=t.y,this.editionData.scale=t.scale,this.editionData.width=t.width,this.upload()},upload:function(){var t,e=this;return(t=g().mark((function t(){var i,n,o,r;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.imageFile,(n=new FormData).append("file",i),n.append("type",e.type),n.append("purpose",e.purpose),n.append("token",e.token),e.editMode&&(n.append("edit",!0),n.append("translateX",e.editionData.translateX),n.append("translateY",e.editionData.translateY),n.append("scale",e.editionData.scale),n.append("width",e.editionData.width)),e.uploading=!0,t.prev=8,t.next=11,e.$axios.single.post(e.$routing.generate("media_upload"),n,{headers:{"Content-Type":"multipart/form-data"}});case 11:o=t.sent,e.isImageEditorVisible=!1,e.notifySuccess(e.$t("page.profile.cover_upload")),e.$emit("upload",o.data.image),t.next=20;break;case 17:t.prev=17,t.t0=t.catch(8),e.notifyError((null===(r=t.t0.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.message)||t.t0.message);case 20:return t.prev=20,e.uploading=!1,t.finish(20);case 23:case"end":return t.stop()}}),t,null,[[8,17,20,23]])})),function(){var e=this,i=arguments;return new Promise((function(n,o){var r=t.apply(e,i);function a(t){v(r,n,o,a,s,"next",t)}function s(t){v(r,n,o,a,s,"throw",t)}a(void 0)}))})()},convertToMib:function(t){return(t/o.MIB_BYTES).toFixed(2)},translationsContext:function(t){return{maxSize:this.convertToMib(o.MAX_FILE_BYTES_UPLOAD),currentSize:this.convertToMib(t)}},validateFile:function(t){return!(t.size>o.MAX_FILE_BYTES_UPLOAD)||(this.notifyError(this.$t("page.profile.max_size",this.translationsContext(t.size))),this.uploading=!1,this.$refs.fileInput.value="",this.imageFile=void 0,!1)}}},w=y,I=(0,f.Z)(w,(function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"image-uploader d-flex justify-content-center align-items-center",class:{"c-pointer":!t.uploading},on:{click:t.chooseImage}},[t.uploading?e("div",{staticClass:"spinner-border"}):e("img",{staticClass:"absolute-center edit-size",attrs:{src:i(81866),alt:"edit"}}),t._v(" "),e("input",{ref:"fileInput",staticClass:"d-none",attrs:{type:"file",name:"image[file]",accept:".jfif,.pjpeg,.jpeg,.pjp,.jpg,.png,.webp"},on:{change:t.startUpload}})]),t._v(" "),t.editMode?e("image-editor-modal",{attrs:{"is-visible":t.isImageEditorVisible,"editing-image":t.imageFile,"is-cover":t.isCover,uploading:t.uploading},on:{save:t.uploadEditedImage,error:t.onImageEditingError,close:t.onCloseImageEditor}}):t._e()],1)}),[],!1,null,null,null).exports}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.