1
0
Fork 0
forked from mirror/pixelfed
pixelfed/public/js/story-compose.js
2020-01-07 00:21:44 -07:00

1 line
No EOL
68 KiB
JavaScript
Vendored

(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{20:function(t,e,n){t.exports=n("spWN")},"3VoG":function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"/*!\n * Cropper.js v1.5.6\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2019-10-04T04:33:44.164Z\n */\n\n.cropper-container {\n direction: ltr;\n font-size: 0;\n line-height: 0;\n position: relative;\n -ms-touch-action: none;\n touch-action: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.cropper-container img {\n display: block;\n height: 100%;\n image-orientation: 0deg;\n max-height: none !important;\n max-width: none !important;\n min-height: 0 !important;\n min-width: 0 !important;\n width: 100%;\n}\n\n.cropper-wrap-box,\n.cropper-canvas,\n.cropper-drag-box,\n.cropper-crop-box,\n.cropper-modal {\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.cropper-wrap-box,\n.cropper-canvas {\n overflow: hidden;\n}\n\n.cropper-drag-box {\n background-color: #fff;\n opacity: 0;\n}\n\n.cropper-modal {\n background-color: #000;\n opacity: 0.5;\n}\n\n.cropper-view-box {\n display: block;\n height: 100%;\n outline: 1px solid #39f;\n outline-color: rgba(51, 153, 255, 0.75);\n overflow: hidden;\n width: 100%;\n}\n\n.cropper-dashed {\n border: 0 dashed #eee;\n display: block;\n opacity: 0.5;\n position: absolute;\n}\n\n.cropper-dashed.dashed-h {\n border-bottom-width: 1px;\n border-top-width: 1px;\n height: calc(100% / 3);\n left: 0;\n top: calc(100% / 3);\n width: 100%;\n}\n\n.cropper-dashed.dashed-v {\n border-left-width: 1px;\n border-right-width: 1px;\n height: 100%;\n left: calc(100% / 3);\n top: 0;\n width: calc(100% / 3);\n}\n\n.cropper-center {\n display: block;\n height: 0;\n left: 50%;\n opacity: 0.75;\n position: absolute;\n top: 50%;\n width: 0;\n}\n\n.cropper-center::before,\n.cropper-center::after {\n background-color: #eee;\n content: ' ';\n display: block;\n position: absolute;\n}\n\n.cropper-center::before {\n height: 1px;\n left: -3px;\n top: 0;\n width: 7px;\n}\n\n.cropper-center::after {\n height: 7px;\n left: 0;\n top: -3px;\n width: 1px;\n}\n\n.cropper-face,\n.cropper-line,\n.cropper-point {\n display: block;\n height: 100%;\n opacity: 0.1;\n position: absolute;\n width: 100%;\n}\n\n.cropper-face {\n background-color: #fff;\n left: 0;\n top: 0;\n}\n\n.cropper-line {\n background-color: #39f;\n}\n\n.cropper-line.line-e {\n cursor: ew-resize;\n right: -3px;\n top: 0;\n width: 5px;\n}\n\n.cropper-line.line-n {\n cursor: ns-resize;\n height: 5px;\n left: 0;\n top: -3px;\n}\n\n.cropper-line.line-w {\n cursor: ew-resize;\n left: -3px;\n top: 0;\n width: 5px;\n}\n\n.cropper-line.line-s {\n bottom: -3px;\n cursor: ns-resize;\n height: 5px;\n left: 0;\n}\n\n.cropper-point {\n background-color: #39f;\n height: 5px;\n opacity: 0.75;\n width: 5px;\n}\n\n.cropper-point.point-e {\n cursor: ew-resize;\n margin-top: -3px;\n right: -3px;\n top: 50%;\n}\n\n.cropper-point.point-n {\n cursor: ns-resize;\n left: 50%;\n margin-left: -3px;\n top: -3px;\n}\n\n.cropper-point.point-w {\n cursor: ew-resize;\n left: -3px;\n margin-top: -3px;\n top: 50%;\n}\n\n.cropper-point.point-s {\n bottom: -3px;\n cursor: s-resize;\n left: 50%;\n margin-left: -3px;\n}\n\n.cropper-point.point-ne {\n cursor: nesw-resize;\n right: -3px;\n top: -3px;\n}\n\n.cropper-point.point-nw {\n cursor: nwse-resize;\n left: -3px;\n top: -3px;\n}\n\n.cropper-point.point-sw {\n bottom: -3px;\n cursor: nesw-resize;\n left: -3px;\n}\n\n.cropper-point.point-se {\n bottom: -3px;\n cursor: nwse-resize;\n height: 20px;\n opacity: 1;\n right: -3px;\n width: 20px;\n}\n\n@media (min-width: 768px) {\n .cropper-point.point-se {\n height: 15px;\n width: 15px;\n }\n}\n\n@media (min-width: 992px) {\n .cropper-point.point-se {\n height: 10px;\n width: 10px;\n }\n}\n\n@media (min-width: 1200px) {\n .cropper-point.point-se {\n height: 5px;\n opacity: 0.75;\n width: 5px;\n }\n}\n\n.cropper-point.point-se::before {\n background-color: #39f;\n bottom: -50%;\n content: ' ';\n display: block;\n height: 200%;\n opacity: 0;\n position: absolute;\n right: -50%;\n width: 200%;\n}\n\n.cropper-invisible {\n opacity: 0;\n}\n\n.cropper-bg {\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');\n}\n\n.cropper-hide {\n display: block;\n height: 0;\n position: absolute;\n width: 0;\n}\n\n.cropper-hidden {\n display: none !important;\n}\n\n.cropper-move {\n cursor: move;\n}\n\n.cropper-crop {\n cursor: crosshair;\n}\n\n.cropper-disabled .cropper-drag-box,\n.cropper-disabled .cropper-face,\n.cropper-disabled .cropper-line,\n.cropper-disabled .cropper-point {\n cursor: not-allowed;\n}\n",""])},"4Toj":function(t,e,n){var i=n("54Wo");t.exports=function(t,e){var n=i(t,e)/1e3;return n>0?Math.floor(n):Math.ceil(n)}},"54Wo":function(t,e,n){var i=n("yNUO");t.exports=function(t,e){var n=i(t),r=i(e);return n.getTime()-r.getTime()}},"6DAA":function(t,e,n){var i=n("kOWh");t.exports=function(){var t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],e=["January","February","March","April","May","June","July","August","September","October","November","December"],n=["Su","Mo","Tu","We","Th","Fr","Sa"],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],a=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=["AM","PM"],s=["am","pm"],h=["a.m.","p.m."],c={MMM:function(e){return t[e.getMonth()]},MMMM:function(t){return e[t.getMonth()]},dd:function(t){return n[t.getDay()]},ddd:function(t){return r[t.getDay()]},dddd:function(t){return a[t.getDay()]},A:function(t){return t.getHours()/12>=1?o[1]:o[0]},a:function(t){return t.getHours()/12>=1?s[1]:s[0]},aa:function(t){return t.getHours()/12>=1?h[1]:h[0]}};return["M","D","DDD","d","Q","W"].forEach((function(t){c[t+"o"]=function(e,n){return function(t){var e=t%100;if(e>20||e<10)switch(e%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"}(n[t](e))}})),{formatters:c,formattingTokensRegExp:i(c)}}},"9tPo":function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,i=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var r,a=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?t:(r=0===a.indexOf("//")?a:0===a.indexOf("/")?n+a:i+a.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")}))}},DT56:function(t,e,n){var i=n("yNUO");t.exports=function(t,e){var n=i(t).getTime(),r=i(e).getTime();return n<r?-1:n>r?1:0}},F809:function(t,e,n){var i=n("yNUO"),r=n("sunR"),a=n("DT56");t.exports=function(t,e){var n=i(t),o=i(e),s=a(n,o),h=Math.abs(r(n,o));return n.setMonth(n.getMonth()-s*h),s*(h-(a(n,o)===-s))}},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var r=(o=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),a=i.sources.map((function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"}));return[n].concat(a).concat([r]).join("\n")}var o;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},r=0;r<this.length;r++){var a=this[r][0];"number"==typeof a&&(i[a]=!0)}for(r=0;r<t.length;r++){var o=t[r];"number"==typeof o[0]&&i[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),e.push(o))}},e}},"KHd+":function(t,e,n){"use strict";function i(t,e,n,i,r,a,o,s){var h,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),a&&(c._scopeId="data-v-"+a),o?(h=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=h):r&&(h=s?function(){r.call(this,this.$root.$options.shadowRoot)}:r),h)if(c.functional){c._injectStyles=h;var p=c.render;c.render=function(t,e){return h.call(e),p(t,e)}}else{var l=c.beforeCreate;c.beforeCreate=l?[].concat(l,h):[h]}return{exports:t,options:c}}n.d(e,"a",(function(){return i}))},LZbM:function(t,e){t.exports=function(){var t={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};return{localize:function(e,n,i){var r;return i=i||{},r="string"==typeof t[e]?t[e]:1===n?t[e].one:t[e].other.replace("{{count}}",n),i.addSuffix?i.comparison>0?"in "+r:r+" ago":r}}}},NmtT:function(t,e,n){var i=n("yHON"),r=n("yNUO"),a=n("4Toj"),o=n("F809"),s=n("Us+F"),h=1440,c=2520,p=43200,l=86400;t.exports=function(t,e,n){var d=n||{},u=i(t,e),f=d.locale,m=s.distanceInWords.localize;f&&f.distanceInWords&&f.distanceInWords.localize&&(m=f.distanceInWords.localize);var g,v,b={addSuffix:Boolean(d.addSuffix),comparison:u};u>0?(g=r(t),v=r(e)):(g=r(e),v=r(t));var w,x=a(v,g),y=v.getTimezoneOffset()-g.getTimezoneOffset(),C=Math.round(x/60)-y;if(C<2)return d.includeSeconds?x<5?m("lessThanXSeconds",5,b):x<10?m("lessThanXSeconds",10,b):x<20?m("lessThanXSeconds",20,b):x<40?m("halfAMinute",null,b):m(x<60?"lessThanXMinutes":"xMinutes",1,b):0===C?m("lessThanXMinutes",1,b):m("xMinutes",C,b);if(C<45)return m("xMinutes",C,b);if(C<90)return m("aboutXHours",1,b);if(C<h)return m("aboutXHours",Math.round(C/60),b);if(C<c)return m("xDays",1,b);if(C<p)return m("xDays",Math.round(C/h),b);if(C<l)return m("aboutXMonths",w=Math.round(C/p),b);if((w=o(v,g))<12)return m("xMonths",Math.round(C/p),b);var M=w%12,D=Math.floor(w/12);return M<3?m("aboutXYears",D,b):M<9?m("overXYears",D,b):m("almostXYears",D+1,b)}},TP5S:function(t,e,n){"use strict";n.r(e);var i=n("hoI+"),r=n("lcPr"),a=n.n(r),o=(n("YQfW"),{components:{VueCropper:a.a,VueTimeago:i.a},props:["profile-id"],data:function(){return{config:window.App.config,mimes:["image/jpeg","image/png"],page:"landing",pages:["landing","crop","edit","confirm","error"],uploading:!1,uploadProgress:100,cropper:{aspectRatio:9/16,viewMode:1,zoomable:!0,zoom:null},mediaUrl:null,stories:[],lightboxMedia:!1}},mounted:function(){var t=this;this.mediaWatcher(),axios.get("/api/stories/v1/fetch/"+this.profileId).then((function(e){return t.stories=e.data}))},methods:{upload:function(){$('.file-input[name="media"]').trigger("click")},mediaWatcher:function(){var t=this;$(document).on("change","#pf-dz",(function(e){t.triggerUpload()}))},triggerUpload:function(){var t=this;t.uploading=!0;var e=document.querySelector("#pf-dz");Array.prototype.forEach.call(e.files,(function(e,n){if(t.media&&t.media.length+n>=t.config.uploader.album_limit)return swal("Error","You can only upload "+t.config.uploader.album_limit+" photos per album","error"),t.uploading=!1,void(t.page=2);var i=e.type;if(-1==$.inArray(i,t.mimes))return swal("Invalid File Type","The file you are trying to add is not a valid mime type. Please upload a "+t.mimes+" only.","error"),t.uploading=!1,void(t.page="error");var r=new FormData;r.append("file",e);var a={onUploadProgress:function(e){var n=Math.round(100*e.loaded/e.total);t.uploadProgress=n}};axios.post("/api/stories/v1/add",r,a).then((function(e){t.uploadProgress=100,t.uploading=!1,window.location.href="/i/my/story",t.mediaUrl=e.data.media_url})).catch((function(n){t.uploading=!1,e.value=null,swal("Oops!",n.response.data.message,"warning")})),e.value=null,t.uploadProgress=0}))},expiresTimestamp:function(t){return(t=new Date(1e3*t)).toDateString()+" "+t.toLocaleTimeString()},edit:function(){this.page="edit"},showLightbox:function(t){this.lightboxMedia={url:t.src},this.$refs.lightboxModal.show()},deleteStory:function(t,e){var n=this;1==window.confirm("Are you sure you want to delete this Story?")&&axios.delete("/api/stories/v1/delete/"+t.id).then((function(t){n.stories.splice(e,1),0==n.stories.length&&(window.location.href="/i/stories/new")}))}}}),s=n("KHd+"),h=Object(s.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"container mt-2 mt-md-5"},[n("input",{staticClass:"w-100 h-100 d-none file-input",attrs:{type:"file",id:"pf-dz",name:"media",draggable:"true",accept:t.config.mimes}}),t._v(" "),n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-md-6 offset-md-3"},["landing"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center",staticStyle:{height:"90vh"}},[t._m(0),t._v(" "),n("div",{staticClass:"flex-fill"},[n("div",{staticClass:"card w-100 shadow-none"},[n("div",{staticClass:"list-group"},[n("a",{staticClass:"list-group-item text-center lead text-decoration-none text-dark",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.upload()}}},[t._v("Add Photo")]),t._v(" "),t.stories.length?n("a",{staticClass:"list-group-item text-center lead text-decoration-none text-dark",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.edit()}}},[t._v("Edit Story")]):t._e()])])]),t._v(" "),t._m(1)]):t._e(),t._v(" "),"crop"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center",staticStyle:{height:"95vh"}},[t._m(2),t._v(" "),n("div",{staticClass:"flex-fill"},[n("div",{staticClass:"card w-100 mt-3"},[n("div",{staticClass:"card-body p-0"},[n("vue-cropper",{ref:"cropper",attrs:{relativeZoom:t.cropper.zoom,aspectRatio:t.cropper.aspectRatio,viewMode:t.cropper.viewMode,zoomable:t.cropper.zoomable,rotatable:!0,src:t.mediaUrl}})],1)])]),t._v(" "),t._m(3)]):t._e(),t._v(" "),"error"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center align-items-center",staticStyle:{height:"90vh"}},[n("p",{staticClass:"h3 mb-0"},[t._v("Oops!")]),t._v(" "),n("p",{staticClass:"text-muted lead"},[t._v("An error occurred, please try again later.")]),t._v(" "),t._m(4)]):t._e(),t._v(" "),"edit"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center",staticStyle:{height:"90vh"}},[t._m(5),t._v(" "),n("div",{staticClass:"flex-fill py-5"},[n("div",{staticClass:"card w-100 shadow-none",staticStyle:{"max-height":"500px","overflow-y":"auto"}},[n("div",{staticClass:"list-group"},t._l(t.stories,(function(e,i){return n("div",{staticClass:"list-group-item text-center text-dark",attrs:{href:"#"}},[n("div",{staticClass:"media align-items-center"},[n("img",{staticClass:"img-fluid mr-3 cursor-pointer",attrs:{src:e.src,width:"70px",height:"70px"},on:{click:function(n){return t.showLightbox(e)}}}),t._v(" "),n("div",{staticClass:"media-body"},[n("p",{staticClass:"mb-0"},[t._v("Expires")]),t._v(" "),n("p",{staticClass:"mb-0 text-muted small"},[n("span",[t._v(t._s(t.expiresTimestamp(e.expires_at)))])])]),t._v(" "),n("div",{staticClass:"float-right"},[n("button",{staticClass:"btn btn-danger btn-sm font-weight-bold text-uppercase",on:{click:function(n){return t.deleteStory(e,i)}}},[t._v("Delete")])])])])})),0)])]),t._v(" "),t._m(6)]):t._e()])]),t._v(" "),n("b-modal",{ref:"lightboxModal",attrs:{id:"lightbox","hide-header":"","hide-footer":"",centered:"",size:"lg","body-class":"p-0"}},[t.lightboxMedia?n("div",{staticClass:"w-100 h-100"},[n("img",{staticStyle:{"max-height":"100%","max-width":"100%"},attrs:{src:t.lightboxMedia.url}})]):t._e()])],1)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center flex-fill mt-5 pt-5"},[e("img",{attrs:{src:"/img/pixelfed-icon-grey.svg",width:"60px",height:"60px"}}),this._v(" "),e("p",{staticClass:"font-weight-bold lead text-lighter mt-1"},[this._v("Stories")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"text-center flex-fill"},[n("p",{staticClass:"text-lighter small text-uppercase"},[n("a",{staticClass:"text-muted font-weight-bold",attrs:{href:"/"}},[t._v("Home")]),t._v(" "),n("span",{staticClass:"px-2 text-lighter"},[t._v("|")]),t._v(" "),n("a",{staticClass:"text-muted font-weight-bold",attrs:{href:"/i/my/story"}},[t._v("View My Story")]),t._v(" "),n("span",{staticClass:"px-2 text-lighter"},[t._v("|")]),t._v(" "),n("a",{staticClass:"text-muted font-weight-bold",attrs:{href:"/site/help"}},[t._v("Help")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center pt-5 mb-3 d-flex justify-content-between align-items-center"},[e("div",[e("button",{staticClass:"btn btn-outline-lighter btn-sm py-0 px-md-3"},[e("i",{staticClass:"pr-2 fas fa-chevron-left fa-sm"}),this._v(" Delete")])]),this._v(" "),e("div",{staticClass:"d-flex align-items-center"},[e("img",{staticClass:"d-inline-block mr-2",attrs:{src:"/img/pixelfed-icon-grey.svg",width:"30px",height:"30px"}}),this._v(" "),e("span",{staticClass:"font-weight-bold lead text-lighter"},[this._v("Stories")])]),this._v(" "),e("div",[e("button",{staticClass:"btn btn-outline-success btn-sm py-0 px-md-3"},[this._v("Crop "),e("i",{staticClass:"pl-2 fas fa-chevron-right fa-sm"})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center flex-fill"},[e("p",{staticClass:"text-lighter small text-uppercase pt-2"},[e("a",{staticClass:"text-muted font-weight-bold mb-0",attrs:{href:"/site/help"}},[this._v("Help")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",{staticClass:"text-muted mb-0"},[e("a",{staticClass:"btn btn-outline-secondary py-0 px-5 font-weight-bold",attrs:{href:"/"}},[this._v("Go back")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center flex-fill mt-5 pt-5"},[e("img",{attrs:{src:"/img/pixelfed-icon-grey.svg",width:"60px",height:"60px"}}),this._v(" "),e("p",{staticClass:"font-weight-bold lead text-lighter mt-1"},[this._v("Stories")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"flex-fill text-center"},[e("a",{staticClass:"btn btn-outline-secondary py-0 px-5 font-weight-bold",attrs:{href:"/i/stories/new"}},[this._v("Go back")])])}],!1,null,"4df48d23",null);e.default=h.exports},"Us+F":function(t,e,n){var i=n("LZbM"),r=n("6DAA");t.exports={distanceInWords:i(),format:r()}},VGX7:function(t,e){t.exports=function(t){var e=new Date(t.getTime()),n=e.getTimezoneOffset();return e.setSeconds(0,0),6e4*n+e.getTime()%6e4}},YQfW:function(t,e,n){var i=n("3VoG");"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(i,r);i.locals&&(t.exports=i.locals)},YlT8:function(t,e,n){var i=n("NmtT");t.exports=function(t,e){return i(Date.now(),t,e)}},"aET+":function(t,e,n){var i,r,a={},o=(i=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=i.apply(this,arguments)),r}),s=function(t,e){return e?e.querySelector(t):document.querySelector(t)},h=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var i=s.call(this,t,n);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}e[t]=i}return e[t]}}(),c=null,p=0,l=[],d=n("9tPo");function u(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=a[i.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](i.parts[o]);for(;o<i.parts.length;o++)r.parts.push(w(i.parts[o],e))}else{var s=[];for(o=0;o<i.parts.length;o++)s.push(w(i.parts[o],e));a[i.id]={id:i.id,refs:1,parts:s}}}}function f(t,e){for(var n=[],i={},r=0;r<t.length;r++){var a=t[r],o=e.base?a[0]+e.base:a[0],s={css:a[1],media:a[2],sourceMap:a[3]};i[o]?i[o].parts.push(s):n.push(i[o]={id:o,parts:[s]})}return n}function m(t,e){var n=h(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var i=l[l.length-1];if("top"===t.insertAt)i?i.nextSibling?n.insertBefore(e,i.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),l.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=h(t.insertAt.before,n);n.insertBefore(e,r)}}function g(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=l.indexOf(t);e>=0&&l.splice(e,1)}function v(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var i=function(){0;return n.nc}();i&&(t.attrs.nonce=i)}return b(e,t.attrs),m(t,e),e}function b(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function w(t,e){var n,i,r,a;if(e.transform&&t.css){if(!(a="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=a}if(e.singleton){var o=p++;n=c||(c=v(e)),i=C.bind(null,n,o,!1),r=C.bind(null,n,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",b(e,t.attrs),m(t,e),e}(e),i=D.bind(null,n,e),r=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(e),i=M.bind(null,n),r=function(){g(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=o()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=f(t,e);return u(n,e),function(t){for(var i=[],r=0;r<n.length;r++){var o=n[r];(s=a[o.id]).refs--,i.push(s)}t&&u(f(t,e),e);for(r=0;r<i.length;r++){var s;if(0===(s=i[r]).refs){for(var h=0;h<s.parts.length;h++)s.parts[h]();delete a[s.id]}}}};var x,y=(x=[],function(t,e){return x[t]=e,x.filter(Boolean).join("\n")});function C(t,e,n,i){var r=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=y(e,r);else{var a=document.createTextNode(r),o=t.childNodes;o[e]&&t.removeChild(o[e]),o.length?t.insertBefore(a,o[e]):t.appendChild(a)}}function M(t,e){var n=e.css,i=e.media;if(i&&t.setAttribute("media",i),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function D(t,e,n){var i=n.css,r=n.sourceMap,a=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||a)&&(i=d(i)),r&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var o=new Blob([i],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}},"hoI+":function(t,e,n){"use strict";var i=n("YlT8"),r=n.n(i),a=function(t,e,n){var i=n.includeSeconds,a=n.addSuffix;return void 0===a&&(a=!0),r()(t,{locale:e,includeSeconds:i,addSuffix:a})};e.a=function(t,e){if(!t.prototype.$timeago){0;var n={locale:e.locale};t.prototype.$timeago=t.observable?t.observable(n):new t({data:n});var i=function(t){void 0===t&&(t={});var e=t.locales||{};return{name:t.name||"Timeago",props:{datetime:{required:!0},title:{type:[String,Boolean]},locale:{type:String},autoUpdate:{type:[Number,Boolean]},converter:{type:Function},converterOptions:{type:Object}},data:function(){return{timeago:this.getTimeago()}},computed:{localeName:function(){return this.locale||this.$timeago.locale}},mounted:function(){this.startUpdater()},beforeDestroy:function(){this.stopUpdater()},render:function(t){return t("time",{attrs:{datetime:new Date(this.datetime),title:"string"==typeof this.title?this.title:!1===this.title?null:this.timeago}},[this.timeago])},methods:{getTimeago:function(n){return(this.converter||t.converter||a)(n||this.datetime,e[this.locale||this.$timeago.locale],this.converterOptions||{})},convert:function(t){this.timeago=this.getTimeago(t)},startUpdater:function(){var t=this;if(this.autoUpdate){var e=!0===this.autoUpdate?60:this.autoUpdate;this.updater=setInterval((function(){t.convert()}),1e3*e)}},stopUpdater:function(){this.updater&&(clearInterval(this.updater),this.updater=null)}},watch:{autoUpdate:function(t){this.stopUpdater(),t&&this.startUpdater()},datetime:function(){this.convert()},localeName:function(){this.convert()},converter:function(){this.convert()},converterOptions:{handler:function(){this.convert()},deep:!0}}}}(e);t.component(i.name,i)}}},kOWh:function(t,e){var n=["M","MM","Q","D","DD","DDD","DDDD","d","E","W","WW","YY","YYYY","GG","GGGG","H","HH","h","hh","m","mm","s","ss","S","SS","SSS","Z","ZZ","X","x"];t.exports=function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(i);var r=n.concat(e).sort().reverse();return new RegExp("(\\[[^\\[]*\\])|(\\\\)?("+r.join("|")+"|.)","g")}},lcPr:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n("urRO"),a=(i=r)&&i.__esModule?i:{default:i};var o="undefined"==typeof window?[String,Array]:[String,Array,Element,NodeList];e.default={render:function(t){return t("div",{style:this.containerStyle},[t("img",{ref:"img",attrs:{src:this.src,alt:this.alt||"image",style:"max-width: 100%"},style:this.imgStyle})])},props:{containerStyle:Object,src:{type:String,default:""},alt:String,imgStyle:Object,viewMode:Number,dragMode:String,aspectRatio:Number,data:Object,preview:o,responsive:{type:Boolean,default:!0},restore:{type:Boolean,default:!0},checkCrossOrigin:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},guides:{type:Boolean,default:!0},center:{type:Boolean,default:!0},highlight:{type:Boolean,default:!0},background:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!0},autoCropArea:Number,movable:{type:Boolean,default:!0},rotatable:{type:Boolean,default:!0},scalable:{type:Boolean,default:!0},zoomable:{type:Boolean,default:!0},zoomOnTouch:{type:Boolean,default:!0},zoomOnWheel:{type:Boolean,default:!0},wheelZoomRatio:Number,cropBoxMovable:{type:Boolean,default:!0},cropBoxResizable:{type:Boolean,default:!0},toggleDragModeOnDblclick:{type:Boolean,default:!0},minCanvasWidth:Number,minCanvasHeight:Number,minCropBoxWidth:Number,minCropBoxHeight:Number,minContainerWidth:Number,minContainerHeight:Number,ready:Function,cropstart:Function,cropmove:Function,cropend:Function,crop:Function,zoom:Function},mounted:function(){var t=this.$options.props,e=(t.containerStyle,t.src,t.alt,t.imgStyle,function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(t,["containerStyle","src","alt","imgStyle"])),n={};for(var i in e)void 0!==this[i]&&(n[i]=this[i]);this.cropper=new a.default(this.$refs.img,n)},methods:{reset:function(){return this.cropper.reset()},clear:function(){return this.cropper.clear()},initCrop:function(){return this.cropper.crop()},replace:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.cropper.replace(t,e)},enable:function(){return this.cropper.enable()},disable:function(){return this.cropper.disable()},destroy:function(){return this.cropper.destroy()},move:function(t,e){return this.cropper.move(t,e)},moveTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.cropper.moveTo(t,e)},relativeZoom:function(t,e){return this.cropper.zoom(t,e)},zoomTo:function(t,e){return this.cropper.zoomTo(t,e)},rotate:function(t){return this.cropper.rotate(t)},rotateTo:function(t){return this.cropper.rotateTo(t)},scaleX:function(t){return this.cropper.scaleX(t)},scaleY:function(t){return this.cropper.scaleY(t)},scale:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.cropper.scale(t,e)},getData:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.cropper.getData(t)},setData:function(t){return this.cropper.setData(t)},getContainerData:function(){return this.cropper.getContainerData()},getImageData:function(){return this.cropper.getImageData()},getCanvasData:function(){return this.cropper.getCanvasData()},setCanvasData:function(t){return this.cropper.setCanvasData(t)},getCropBoxData:function(){return this.cropper.getCropBoxData()},setCropBoxData:function(t){return this.cropper.setCropBoxData(t)},getCroppedCanvas:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.cropper.getCroppedCanvas(t)},setAspectRatio:function(t){return this.cropper.setAspectRatio(t)},setDragMode:function(t){return this.cropper.setDragMode(t)}}}},pzWd:function(t,e){t.exports=function(t){return t instanceof Date}},spWN:function(t,e,n){Vue.component("story-compose",n("TP5S").default)},sunR:function(t,e,n){var i=n("yNUO");t.exports=function(t,e){var n=i(t),r=i(e);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}},urRO:function(t,e,n){t.exports=function(){"use strict";function t(e){return(t="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})(e)}function e(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function n(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function r(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(r,!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var o="undefined"!=typeof window&&void 0!==window.document,s=o?window:{},h=!!o&&"ontouchstart"in s.document.documentElement,c=!!o&&"PointerEvent"in s,p="".concat("cropper","-crop"),l="".concat("cropper","-disabled"),d="".concat("cropper","-hidden"),u="".concat("cropper","-hide"),f="".concat("cropper","-invisible"),m="".concat("cropper","-modal"),g="".concat("cropper","-move"),v="".concat("cropper","Action"),b="".concat("cropper","Preview"),w=h?"touchstart":"mousedown",x=h?"touchmove":"mousemove",y=h?"touchend touchcancel":"mouseup",C=c?"pointerdown":w,M=c?"pointermove":x,D=c?"pointerup pointercancel":y,T=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,B=/^data:/,A=/^data:image\/jpeg;base64,/,S=/^img|canvas$/i,O={viewMode:0,dragMode:"crop",initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},k=Number.isNaN||s.isNaN;function _(t){return"number"==typeof t&&!k(t)}var E=function(t){return t>0&&t<1/0};function N(t){return void 0===t}function z(e){return"object"===t(e)&&null!==e}var W=Object.prototype.hasOwnProperty;function R(t){if(!z(t))return!1;try{var e=t.constructor,n=e.prototype;return e&&n&&W.call(n,"isPrototypeOf")}catch(t){return!1}}function U(t){return"function"==typeof t}var H=Array.prototype.slice;function L(t){return Array.from?Array.from(t):H.call(t)}function X(t,e){return t&&U(e)&&(Array.isArray(t)||_(t.length)?L(t).forEach((function(n,i){e.call(t,n,i,t)})):z(t)&&Object.keys(t).forEach((function(n){e.call(t,t[n],n,t)}))),t}var Y=Object.assign||function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return z(t)&&n.length>0&&n.forEach((function(e){z(e)&&Object.keys(e).forEach((function(n){t[n]=e[n]}))})),t},j=/\.\d*(?:0|9){12}\d*$/;function I(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return j.test(t)?Math.round(t*e)/e:t}var $=/^width|height|left|top|marginLeft|marginTop$/;function P(t,e){var n=t.style;X(e,(function(t,e){$.test(e)&&_(t)&&(t="".concat(t,"px")),n[e]=t}))}function F(t,e){if(e)if(_(t.length))X(t,(function(t){F(t,e)}));else if(t.classList)t.classList.add(e);else{var n=t.className.trim();n?n.indexOf(e)<0&&(t.className="".concat(n," ").concat(e)):t.className=e}}function G(t,e){e&&(_(t.length)?X(t,(function(t){G(t,e)})):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function Z(t,e,n){e&&(_(t.length)?X(t,(function(t){Z(t,e,n)})):n?F(t,e):G(t,e))}var q=/([a-z\d])([A-Z])/g;function V(t){return t.replace(q,"$1-$2").toLowerCase()}function J(t,e){return z(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(V(e)))}function Q(t,e,n){z(n)?t[e]=n:t.dataset?t.dataset[e]=n:t.setAttribute("data-".concat(V(e)),n)}var K=/\s\s*/,tt=function(){var t=!1;if(o){var e=!1,n=function(){},i=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});s.addEventListener("test",n,i),s.removeEventListener("test",n,i)}return t}();function et(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n;e.trim().split(K).forEach((function(e){if(!tt){var a=t.listeners;a&&a[e]&&a[e][n]&&(r=a[e][n],delete a[e][n],0===Object.keys(a[e]).length&&delete a[e],0===Object.keys(a).length&&delete t.listeners)}t.removeEventListener(e,r,i)}))}function nt(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n;e.trim().split(K).forEach((function(e){if(i.once&&!tt){var a=t.listeners,o=void 0===a?{}:a;r=function(){delete o[e][n],t.removeEventListener(e,r,i);for(var a=arguments.length,s=new Array(a),h=0;h<a;h++)s[h]=arguments[h];n.apply(t,s)},o[e]||(o[e]={}),o[e][n]&&t.removeEventListener(e,o[e][n],i),o[e][n]=r,t.listeners=o}t.addEventListener(e,r,i)}))}function it(t,e,n){var i;return U(Event)&&U(CustomEvent)?i=new CustomEvent(e,{detail:n,bubbles:!0,cancelable:!0}):(i=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,n),t.dispatchEvent(i)}function rt(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var at=s.location,ot=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function st(t){var e=t.match(ot);return null!==e&&(e[1]!==at.protocol||e[2]!==at.hostname||e[3]!==at.port)}function ht(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function ct(t){var e=t.rotate,n=t.scaleX,i=t.scaleY,r=t.translateX,a=t.translateY,o=[];_(r)&&0!==r&&o.push("translateX(".concat(r,"px)")),_(a)&&0!==a&&o.push("translateY(".concat(a,"px)")),_(e)&&0!==e&&o.push("rotate(".concat(e,"deg)")),_(n)&&1!==n&&o.push("scaleX(".concat(n,")")),_(i)&&1!==i&&o.push("scaleY(".concat(i,")"));var s=o.length?o.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function pt(t,e){var n=t.pageX,i=t.pageY,a={endX:n,endY:i};return e?a:r({startX:n,startY:i},a)}function lt(t){var e=t.aspectRatio,n=t.height,i=t.width,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",a=E(i),o=E(n);if(a&&o){var s=n*e;"contain"===r&&s>i||"cover"===r&&s<i?n=i/e:i=n*e}else a?n=i/e:o&&(i=n*e);return{width:i,height:n}}function dt(t,e,n,i){var r=e.aspectRatio,o=e.naturalWidth,s=e.naturalHeight,h=e.rotate,c=void 0===h?0:h,p=e.scaleX,l=void 0===p?1:p,d=e.scaleY,u=void 0===d?1:d,f=n.aspectRatio,m=n.naturalWidth,g=n.naturalHeight,v=i.fillColor,b=void 0===v?"transparent":v,w=i.imageSmoothingEnabled,x=void 0===w||w,y=i.imageSmoothingQuality,C=void 0===y?"low":y,M=i.maxWidth,D=void 0===M?1/0:M,T=i.maxHeight,B=void 0===T?1/0:T,A=i.minWidth,S=void 0===A?0:A,O=i.minHeight,k=void 0===O?0:O,_=document.createElement("canvas"),E=_.getContext("2d"),N=lt({aspectRatio:f,width:D,height:B}),z=lt({aspectRatio:f,width:S,height:k},"cover"),W=Math.min(N.width,Math.max(z.width,m)),R=Math.min(N.height,Math.max(z.height,g)),U=lt({aspectRatio:r,width:D,height:B}),H=lt({aspectRatio:r,width:S,height:k},"cover"),L=Math.min(U.width,Math.max(H.width,o)),X=Math.min(U.height,Math.max(H.height,s)),Y=[-L/2,-X/2,L,X];return _.width=I(W),_.height=I(R),E.fillStyle=b,E.fillRect(0,0,W,R),E.save(),E.translate(W/2,R/2),E.rotate(c*Math.PI/180),E.scale(l,u),E.imageSmoothingEnabled=x,E.imageSmoothingQuality=C,E.drawImage.apply(E,[t].concat(a(Y.map((function(t){return Math.floor(I(t))}))))),E.restore(),_}var ut=String.fromCharCode,ft=/^data:.*,/;function mt(t){var e,n=new DataView(t);try{var i,r,a;if(255===n.getUint8(0)&&216===n.getUint8(1))for(var o=n.byteLength,s=2;s+1<o;){if(255===n.getUint8(s)&&225===n.getUint8(s+1)){r=s;break}s+=1}if(r){var h=r+10;if("Exif"===function(t,e,n){var i="";n+=e;for(var r=e;r<n;r+=1)i+=ut(t.getUint8(r));return i}(n,r+4,4)){var c=n.getUint16(h);if(((i=18761===c)||19789===c)&&42===n.getUint16(h+2,i)){var p=n.getUint32(h+4,i);p>=8&&(a=h+p)}}}if(a){var l,d,u=n.getUint16(a,i);for(d=0;d<u;d+=1)if(l=a+12*d+2,274===n.getUint16(l,i)){l+=8,e=n.getUint16(l,i),n.setUint16(l,1,i);break}}}catch(t){e=1}return e}var gt={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,e=this.options,n=this.container,i=this.cropper;F(i,d),G(t,d);var r={width:Math.max(n.offsetWidth,Number(e.minContainerWidth)||200),height:Math.max(n.offsetHeight,Number(e.minContainerHeight)||100)};this.containerData=r,P(i,{width:r.width,height:r.height}),F(t,d),G(i,d)},initCanvas:function(){var t=this.containerData,e=this.imageData,n=this.options.viewMode,i=Math.abs(e.rotate)%180==90,r=i?e.naturalHeight:e.naturalWidth,a=i?e.naturalWidth:e.naturalHeight,o=r/a,s=t.width,h=t.height;t.height*o>t.width?3===n?s=t.height*o:h=t.width/o:3===n?h=t.width/o:s=t.height*o;var c={aspectRatio:o,naturalWidth:r,naturalHeight:a,width:s,height:h};c.left=(t.width-s)/2,c.top=(t.height-h)/2,c.oldLeft=c.left,c.oldTop=c.top,this.canvasData=c,this.limited=1===n||2===n,this.limitCanvas(!0,!0),this.initialImageData=Y({},e),this.initialCanvasData=Y({},c)},limitCanvas:function(t,e){var n=this.options,i=this.containerData,r=this.canvasData,a=this.cropBoxData,o=n.viewMode,s=r.aspectRatio,h=this.cropped&&a;if(t){var c=Number(n.minCanvasWidth)||0,p=Number(n.minCanvasHeight)||0;o>1?(c=Math.max(c,i.width),p=Math.max(p,i.height),3===o&&(p*s>c?c=p*s:p=c/s)):o>0&&(c?c=Math.max(c,h?a.width:0):p?p=Math.max(p,h?a.height:0):h&&(c=a.width,(p=a.height)*s>c?c=p*s:p=c/s));var l=lt({aspectRatio:s,width:c,height:p});c=l.width,p=l.height,r.minWidth=c,r.minHeight=p,r.maxWidth=1/0,r.maxHeight=1/0}if(e)if(o>(h?0:1)){var d=i.width-r.width,u=i.height-r.height;r.minLeft=Math.min(0,d),r.minTop=Math.min(0,u),r.maxLeft=Math.max(0,d),r.maxTop=Math.max(0,u),h&&this.limited&&(r.minLeft=Math.min(a.left,a.left+(a.width-r.width)),r.minTop=Math.min(a.top,a.top+(a.height-r.height)),r.maxLeft=a.left,r.maxTop=a.top,2===o&&(r.width>=i.width&&(r.minLeft=Math.min(0,d),r.maxLeft=Math.max(0,d)),r.height>=i.height&&(r.minTop=Math.min(0,u),r.maxTop=Math.max(0,u))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=i.width,r.maxTop=i.height},renderCanvas:function(t,e){var n=this.canvasData,i=this.imageData;if(e){var r=function(t){var e=t.width,n=t.height,i=t.degree;if(90==(i=Math.abs(i)%180))return{width:n,height:e};var r=i%90*Math.PI/180,a=Math.sin(r),o=Math.cos(r),s=e*o+n*a,h=e*a+n*o;return i>90?{width:h,height:s}:{width:s,height:h}}({width:i.naturalWidth*Math.abs(i.scaleX||1),height:i.naturalHeight*Math.abs(i.scaleY||1),degree:i.rotate||0}),a=r.width,o=r.height,s=n.width*(a/n.naturalWidth),h=n.height*(o/n.naturalHeight);n.left-=(s-n.width)/2,n.top-=(h-n.height)/2,n.width=s,n.height=h,n.aspectRatio=a/o,n.naturalWidth=a,n.naturalHeight=o,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCanvas(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,P(this.canvas,Y({width:n.width,height:n.height},ct({translateX:n.left,translateY:n.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var e=this.canvasData,n=this.imageData,i=n.naturalWidth*(e.width/e.naturalWidth),r=n.naturalHeight*(e.height/e.naturalHeight);Y(n,{width:i,height:r,left:(e.width-i)/2,top:(e.height-r)/2}),P(this.image,Y({width:n.width,height:n.height},ct(Y({translateX:n.left,translateY:n.top},n)))),t&&this.output()},initCropBox:function(){var t=this.options,e=this.canvasData,n=t.aspectRatio||t.initialAspectRatio,i=Number(t.autoCropArea)||.8,r={width:e.width,height:e.height};n&&(e.height*n>e.width?r.height=r.width/n:r.width=r.height*n),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*i),r.height=Math.max(r.minHeight,r.height*i),r.left=e.left+(e.width-r.width)/2,r.top=e.top+(e.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=Y({},r)},limitCropBox:function(t,e){var n=this.options,i=this.containerData,r=this.canvasData,a=this.cropBoxData,o=this.limited,s=n.aspectRatio;if(t){var h=Number(n.minCropBoxWidth)||0,c=Number(n.minCropBoxHeight)||0,p=o?Math.min(i.width,r.width,r.width+r.left,i.width-r.left):i.width,l=o?Math.min(i.height,r.height,r.height+r.top,i.height-r.top):i.height;h=Math.min(h,i.width),c=Math.min(c,i.height),s&&(h&&c?c*s>h?c=h/s:h=c*s:h?c=h/s:c&&(h=c*s),l*s>p?l=p/s:p=l*s),a.minWidth=Math.min(h,p),a.minHeight=Math.min(c,l),a.maxWidth=p,a.maxHeight=l}e&&(o?(a.minLeft=Math.max(0,r.left),a.minTop=Math.max(0,r.top),a.maxLeft=Math.min(i.width,r.left+r.width)-a.width,a.maxTop=Math.min(i.height,r.top+r.height)-a.height):(a.minLeft=0,a.minTop=0,a.maxLeft=i.width-a.width,a.maxTop=i.height-a.height))},renderCropBox:function(){var t=this.options,e=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCropBox(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,t.movable&&t.cropBoxMovable&&Q(this.face,v,n.width>=e.width&&n.height>=e.height?"move":"all"),P(this.cropBox,Y({width:n.width,height:n.height},ct({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),it(this.element,"crop",this.getData())}},vt={initPreview:function(){var t=this.element,e=this.crossOrigin,n=this.options.preview,i=e?this.crossOriginUrl:this.url,r=t.alt||"The image to preview",a=document.createElement("img");if(e&&(a.crossOrigin=e),a.src=i,a.alt=r,this.viewBox.appendChild(a),this.viewBoxImage=a,n){var o=n;"string"==typeof n?o=t.ownerDocument.querySelectorAll(n):n.querySelector&&(o=[n]),this.previews=o,X(o,(function(t){var n=document.createElement("img");Q(t,b,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),e&&(n.crossOrigin=e),n.src=i,n.alt=r,n.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',t.innerHTML="",t.appendChild(n)}))}},resetPreview:function(){X(this.previews,(function(t){var e=J(t,b);P(t,{width:e.width,height:e.height}),t.innerHTML=e.html,function(t,e){if(z(t[e]))try{delete t[e]}catch(n){t[e]=void 0}else if(t.dataset)try{delete t.dataset[e]}catch(n){t.dataset[e]=void 0}else t.removeAttribute("data-".concat(V(e)))}(t,b)}))},preview:function(){var t=this.imageData,e=this.canvasData,n=this.cropBoxData,i=n.width,r=n.height,a=t.width,o=t.height,s=n.left-e.left-t.left,h=n.top-e.top-t.top;this.cropped&&!this.disabled&&(P(this.viewBoxImage,Y({width:a,height:o},ct(Y({translateX:-s,translateY:-h},t)))),X(this.previews,(function(e){var n=J(e,b),c=n.width,p=n.height,l=c,d=p,u=1;i&&(d=r*(u=c/i)),r&&d>p&&(l=i*(u=p/r),d=p),P(e,{width:l,height:d}),P(e.getElementsByTagName("img")[0],Y({width:a*u,height:o*u},ct(Y({translateX:-s*u,translateY:-h*u},t))))})))}},bt={bind:function(){var t=this.element,e=this.options,n=this.cropper;U(e.cropstart)&&nt(t,"cropstart",e.cropstart),U(e.cropmove)&&nt(t,"cropmove",e.cropmove),U(e.cropend)&&nt(t,"cropend",e.cropend),U(e.crop)&&nt(t,"crop",e.crop),U(e.zoom)&&nt(t,"zoom",e.zoom),nt(n,C,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&nt(n,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&nt(n,"dblclick",this.onDblclick=this.dblclick.bind(this)),nt(t.ownerDocument,M,this.onCropMove=this.cropMove.bind(this)),nt(t.ownerDocument,D,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&nt(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,n=this.cropper;U(e.cropstart)&&et(t,"cropstart",e.cropstart),U(e.cropmove)&&et(t,"cropmove",e.cropmove),U(e.cropend)&&et(t,"cropend",e.cropend),U(e.crop)&&et(t,"crop",e.crop),U(e.zoom)&&et(t,"zoom",e.zoom),et(n,C,this.onCropStart),e.zoomable&&e.zoomOnWheel&&et(n,"wheel",this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&et(n,"dblclick",this.onDblclick),et(t.ownerDocument,M,this.onCropMove),et(t.ownerDocument,D,this.onCropEnd),e.responsive&&et(window,"resize",this.onResize)}},wt={resize:function(){var t=this.options,e=this.container,n=this.containerData,i=Number(t.minContainerWidth)||200,r=Number(t.minContainerHeight)||100;if(!(this.disabled||n.width<=i||n.height<=r)){var a,o,s=e.offsetWidth/n.width;1===s&&e.offsetHeight===n.height||(t.restore&&(a=this.getCanvasData(),o=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(X(a,(function(t,e){a[e]=t*s}))),this.setCropBoxData(X(o,(function(t,e){o[e]=t*s})))))}},dblclick:function(){var t,e;this.disabled||"none"===this.options.dragMode||this.setDragMode((t=this.dragBox,e=p,(t.classList?t.classList.contains(e):t.className.indexOf(e)>-1)?"move":"crop"))},wheel:function(t){var e=this,n=Number(this.options.wheelZoomRatio)||.1,i=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){e.wheeling=!1}),50),t.deltaY?i=t.deltaY>0?1:-1:t.wheelDelta?i=-t.wheelDelta/120:t.detail&&(i=t.detail>0?1:-1),this.zoom(-i*n,t)))},cropStart:function(t){var e=t.buttons,n=t.button;if(!(this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(_(e)&&1!==e||_(n)&&0!==n||t.ctrlKey))){var i,r=this.options,a=this.pointers;t.changedTouches?X(t.changedTouches,(function(t){a[t.identifier]=pt(t)})):a[t.pointerId||0]=pt(t),i=Object.keys(a).length>1&&r.zoomable&&r.zoomOnTouch?"zoom":J(t.target,v),T.test(i)&&!1!==it(this.element,"cropstart",{originalEvent:t,action:i})&&(t.preventDefault(),this.action=i,this.cropping=!1,"crop"===i&&(this.cropping=!0,F(this.dragBox,m)))}},cropMove:function(t){var e=this.action;if(!this.disabled&&e){var n=this.pointers;t.preventDefault(),!1!==it(this.element,"cropmove",{originalEvent:t,action:e})&&(t.changedTouches?X(t.changedTouches,(function(t){Y(n[t.identifier]||{},pt(t,!0))})):Y(n[t.pointerId||0]||{},pt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,n=this.pointers;t.changedTouches?X(t.changedTouches,(function(t){delete n[t.identifier]})):delete n[t.pointerId||0],e&&(t.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,Z(this.dragBox,m,this.cropped&&this.options.modal)),it(this.element,"cropend",{originalEvent:t,action:e}))}}},xt={change:function(t){var e,n=this.options,i=this.canvasData,a=this.containerData,o=this.cropBoxData,s=this.pointers,h=this.action,c=n.aspectRatio,p=o.left,l=o.top,u=o.width,f=o.height,m=p+u,g=l+f,v=0,b=0,w=a.width,x=a.height,y=!0;!c&&t.shiftKey&&(c=u&&f?u/f:1),this.limited&&(v=o.minLeft,b=o.minTop,w=v+Math.min(a.width,i.width,i.left+i.width),x=b+Math.min(a.height,i.height,i.top+i.height));var C=s[Object.keys(s)[0]],M={x:C.endX-C.startX,y:C.endY-C.startY},D=function(t){switch(t){case"e":m+M.x>w&&(M.x=w-m);break;case"w":p+M.x<v&&(M.x=v-p);break;case"n":l+M.y<b&&(M.y=b-l);break;case"s":g+M.y>x&&(M.y=x-g)}};switch(h){case"all":p+=M.x,l+=M.y;break;case"e":if(M.x>=0&&(m>=w||c&&(l<=b||g>=x))){y=!1;break}D("e"),(u+=M.x)<0&&(h="w",p-=u=-u),c&&(f=u/c,l+=(o.height-f)/2);break;case"n":if(M.y<=0&&(l<=b||c&&(p<=v||m>=w))){y=!1;break}D("n"),f-=M.y,l+=M.y,f<0&&(h="s",l-=f=-f),c&&(u=f*c,p+=(o.width-u)/2);break;case"w":if(M.x<=0&&(p<=v||c&&(l<=b||g>=x))){y=!1;break}D("w"),u-=M.x,p+=M.x,u<0&&(h="e",p-=u=-u),c&&(f=u/c,l+=(o.height-f)/2);break;case"s":if(M.y>=0&&(g>=x||c&&(p<=v||m>=w))){y=!1;break}D("s"),(f+=M.y)<0&&(h="n",l-=f=-f),c&&(u=f*c,p+=(o.width-u)/2);break;case"ne":if(c){if(M.y<=0&&(l<=b||m>=w)){y=!1;break}D("n"),f-=M.y,l+=M.y,u=f*c}else D("n"),D("e"),M.x>=0?m<w?u+=M.x:M.y<=0&&l<=b&&(y=!1):u+=M.x,M.y<=0?l>b&&(f-=M.y,l+=M.y):(f-=M.y,l+=M.y);u<0&&f<0?(h="sw",l-=f=-f,p-=u=-u):u<0?(h="nw",p-=u=-u):f<0&&(h="se",l-=f=-f);break;case"nw":if(c){if(M.y<=0&&(l<=b||p<=v)){y=!1;break}D("n"),f-=M.y,l+=M.y,u=f*c,p+=o.width-u}else D("n"),D("w"),M.x<=0?p>v?(u-=M.x,p+=M.x):M.y<=0&&l<=b&&(y=!1):(u-=M.x,p+=M.x),M.y<=0?l>b&&(f-=M.y,l+=M.y):(f-=M.y,l+=M.y);u<0&&f<0?(h="se",l-=f=-f,p-=u=-u):u<0?(h="ne",p-=u=-u):f<0&&(h="sw",l-=f=-f);break;case"sw":if(c){if(M.x<=0&&(p<=v||g>=x)){y=!1;break}D("w"),u-=M.x,p+=M.x,f=u/c}else D("s"),D("w"),M.x<=0?p>v?(u-=M.x,p+=M.x):M.y>=0&&g>=x&&(y=!1):(u-=M.x,p+=M.x),M.y>=0?g<x&&(f+=M.y):f+=M.y;u<0&&f<0?(h="ne",l-=f=-f,p-=u=-u):u<0?(h="se",p-=u=-u):f<0&&(h="nw",l-=f=-f);break;case"se":if(c){if(M.x>=0&&(m>=w||g>=x)){y=!1;break}D("e"),f=(u+=M.x)/c}else D("s"),D("e"),M.x>=0?m<w?u+=M.x:M.y>=0&&g>=x&&(y=!1):u+=M.x,M.y>=0?g<x&&(f+=M.y):f+=M.y;u<0&&f<0?(h="nw",l-=f=-f,p-=u=-u):u<0?(h="sw",p-=u=-u):f<0&&(h="ne",l-=f=-f);break;case"move":this.move(M.x,M.y),y=!1;break;case"zoom":this.zoom(function(t){var e=r({},t),n=[];return X(t,(function(t,i){delete e[i],X(e,(function(e){var i=Math.abs(t.startX-e.startX),r=Math.abs(t.startY-e.startY),a=Math.abs(t.endX-e.endX),o=Math.abs(t.endY-e.endY),s=Math.sqrt(i*i+r*r),h=(Math.sqrt(a*a+o*o)-s)/s;n.push(h)}))})),n.sort((function(t,e){return Math.abs(t)<Math.abs(e)})),n[0]}(s),t),y=!1;break;case"crop":if(!M.x||!M.y){y=!1;break}e=rt(this.cropper),p=C.startX-e.left,l=C.startY-e.top,u=o.minWidth,f=o.minHeight,M.x>0?h=M.y>0?"se":"ne":M.x<0&&(p-=u,h=M.y>0?"sw":"nw"),M.y<0&&(l-=f),this.cropped||(G(this.cropBox,d),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}y&&(o.width=u,o.height=f,o.left=p,o.top=l,this.action=h,this.renderCropBox()),X(s,(function(t){t.startX=t.endX,t.startY=t.endY}))}},yt={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&F(this.dragBox,m),G(this.cropBox,d),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Y({},this.initialImageData),this.canvasData=Y({},this.initialCanvasData),this.cropBoxData=Y({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Y(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),G(this.dragBox,m),F(this.cropBox,d)),this},replace:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&t&&(this.isImg&&(this.element.src=t),e?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,X(this.previews,(function(e){e.getElementsByTagName("img")[0].src=t})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,G(this.cropper,l)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,F(this.cropper,l)),this},destroy:function(){var t=this.element;return t.cropper?(t.cropper=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.canvasData,i=n.left,r=n.top;return this.moveTo(N(t)?t:i+Number(t),N(e)?e:r+Number(e))},moveTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.canvasData,i=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(_(t)&&(n.left=t,i=!0),_(e)&&(n.top=e,i=!0),i&&this.renderCanvas(!0)),this},zoom:function(t,e){var n=this.canvasData;return t=(t=Number(t))<0?1/(1-t):1+t,this.zoomTo(n.width*t/n.naturalWidth,null,e)},zoomTo:function(t,e,n){var i=this.options,r=this.canvasData,a=r.width,o=r.height,s=r.naturalWidth,h=r.naturalHeight;if((t=Number(t))>=0&&this.ready&&!this.disabled&&i.zoomable){var c=s*t,p=h*t;if(!1===it(this.element,"zoom",{ratio:t,oldRatio:a/s,originalEvent:n}))return this;if(n){var l=this.pointers,d=rt(this.cropper),u=l&&Object.keys(l).length?function(t){var e=0,n=0,i=0;return X(t,(function(t){var r=t.startX,a=t.startY;e+=r,n+=a,i+=1})),{pageX:e/=i,pageY:n/=i}}(l):{pageX:n.pageX,pageY:n.pageY};r.left-=(c-a)*((u.pageX-d.left-r.left)/a),r.top-=(p-o)*((u.pageY-d.top-r.top)/o)}else R(e)&&_(e.x)&&_(e.y)?(r.left-=(c-a)*((e.x-r.left)/a),r.top-=(p-o)*((e.y-r.top)/o)):(r.left-=(c-a)/2,r.top-=(p-o)/2);r.width=c,r.height=p,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return _(t=Number(t))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,_(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(_(e)?e:1,t)},scale:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.imageData,i=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(_(t)&&(n.scaleX=t,i=!0),_(e)&&(n.scaleY=e,i=!0),i&&this.renderCanvas(!0,!0)),this},getData:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.options,i=this.imageData,r=this.canvasData,a=this.cropBoxData;if(this.ready&&this.cropped){t={x:a.left-r.left,y:a.top-r.top,width:a.width,height:a.height};var o=i.width/i.naturalWidth;if(X(t,(function(e,n){t[n]=e/o})),e){var s=Math.round(t.y+t.height),h=Math.round(t.x+t.width);t.x=Math.round(t.x),t.y=Math.round(t.y),t.width=h-t.x,t.height=s-t.y}}else t={x:0,y:0,width:0,height:0};return n.rotatable&&(t.rotate=i.rotate||0),n.scalable&&(t.scaleX=i.scaleX||1,t.scaleY=i.scaleY||1),t},setData:function(t){var e=this.options,n=this.imageData,i=this.canvasData,r={};if(this.ready&&!this.disabled&&R(t)){var a=!1;e.rotatable&&_(t.rotate)&&t.rotate!==n.rotate&&(n.rotate=t.rotate,a=!0),e.scalable&&(_(t.scaleX)&&t.scaleX!==n.scaleX&&(n.scaleX=t.scaleX,a=!0),_(t.scaleY)&&t.scaleY!==n.scaleY&&(n.scaleY=t.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var o=n.width/n.naturalWidth;_(t.x)&&(r.left=t.x*o+i.left),_(t.y)&&(r.top=t.y*o+i.top),_(t.width)&&(r.width=t.width*o),_(t.height)&&(r.height=t.height*o),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?Y({},this.containerData):{}},getImageData:function(){return this.sized?Y({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&X(["left","top","width","height","naturalWidth","naturalHeight"],(function(n){e[n]=t[n]})),e},setCanvasData:function(t){var e=this.canvasData,n=e.aspectRatio;return this.ready&&!this.disabled&&R(t)&&(_(t.left)&&(e.left=t.left),_(t.top)&&(e.top=t.top),_(t.width)?(e.width=t.width,e.height=t.width/n):_(t.height)&&(e.height=t.height,e.width=t.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var t,e=this.cropBoxData;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(t){var e,n,i=this.cropBoxData,r=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&R(t)&&(_(t.left)&&(i.left=t.left),_(t.top)&&(i.top=t.top),_(t.width)&&t.width!==i.width&&(e=!0,i.width=t.width),_(t.height)&&t.height!==i.height&&(n=!0,i.height=t.height),r&&(e?i.height=i.width/r:n&&(i.width=i.height*r)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var e=this.canvasData,n=dt(this.image,this.imageData,e,t);if(!this.cropped)return n;var i=this.getData(),r=i.x,o=i.y,s=i.width,h=i.height,c=n.width/Math.floor(e.naturalWidth);1!==c&&(r*=c,o*=c,s*=c,h*=c);var p=s/h,l=lt({aspectRatio:p,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),d=lt({aspectRatio:p,width:t.minWidth||0,height:t.minHeight||0},"cover"),u=lt({aspectRatio:p,width:t.width||(1!==c?n.width:s),height:t.height||(1!==c?n.height:h)}),f=u.width,m=u.height;f=Math.min(l.width,Math.max(d.width,f)),m=Math.min(l.height,Math.max(d.height,m));var g=document.createElement("canvas"),v=g.getContext("2d");g.width=I(f),g.height=I(m),v.fillStyle=t.fillColor||"transparent",v.fillRect(0,0,f,m);var b=t.imageSmoothingEnabled,w=void 0===b||b,x=t.imageSmoothingQuality;v.imageSmoothingEnabled=w,x&&(v.imageSmoothingQuality=x);var y,C,M,D,T,B,A=n.width,S=n.height,O=r,k=o;O<=-s||O>A?(O=0,y=0,M=0,T=0):O<=0?(M=-O,O=0,T=y=Math.min(A,s+O)):O<=A&&(M=0,T=y=Math.min(s,A-O)),y<=0||k<=-h||k>S?(k=0,C=0,D=0,B=0):k<=0?(D=-k,k=0,B=C=Math.min(S,h+k)):k<=S&&(D=0,B=C=Math.min(h,S-k));var _=[O,k,y,C];if(T>0&&B>0){var E=f/s;_.push(M*E,D*E,T*E,B*E)}return v.drawImage.apply(v,[n].concat(a(_.map((function(t){return Math.floor(I(t))}))))),g},setAspectRatio:function(t){var e=this.options;return this.disabled||N(t)||(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var e=this.options,n=this.dragBox,i=this.face;if(this.ready&&!this.disabled){var r="crop"===t,a=e.movable&&"move"===t;t=r||a?t:"none",e.dragMode=t,Q(n,v,t),Z(n,p,r),Z(n,g,a),e.cropBoxMovable||(Q(i,v,t),Z(i,p,r),Z(i,g,a))}return this}},Ct=s.Cropper,Mt=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e||!S.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=Y({},O,R(n)&&n),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}var n,i,r;return n=t,r=[{key:"noConflict",value:function(){return window.Cropper=Ct,t}},{key:"setDefaults",value:function(t){Y(O,R(t)&&t)}}],(i=[{key:"init",value:function(){var t,e=this.element,n=e.tagName.toLowerCase();if(!e.cropper){if(e.cropper=this,"img"===n){if(this.isImg=!0,t=e.getAttribute("src")||"",this.originalUrl=t,!t)return;t=e.src}else"canvas"===n&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e=this;if(t){this.url=t,this.imageData={};var n=this.element,i=this.options;if(i.rotatable||i.scalable||(i.checkOrientation=!1),i.checkOrientation&&window.ArrayBuffer)if(B.test(t))A.test(t)?this.read((r=t.replace(ft,""),a=atob(r),o=new ArrayBuffer(a.length),X(s=new Uint8Array(o),(function(t,e){s[e]=a.charCodeAt(e)})),o)):this.clone();else{var r,a,o,s,h=new XMLHttpRequest,c=this.clone.bind(this);this.reloading=!0,this.xhr=h,h.onabort=c,h.onerror=c,h.ontimeout=c,h.onprogress=function(){"image/jpeg"!==h.getResponseHeader("content-type")&&h.abort()},h.onload=function(){e.read(h.response)},h.onloadend=function(){e.reloading=!1,e.xhr=null},i.checkCrossOrigin&&st(t)&&n.crossOrigin&&(t=ht(t)),h.open("GET",t),h.responseType="arraybuffer",h.withCredentials="use-credentials"===n.crossOrigin,h.send()}else this.clone()}}},{key:"read",value:function(t){var e=this.options,n=this.imageData,i=mt(t),r=0,a=1,o=1;if(i>1){this.url=function(t,e){for(var n=[],i=new Uint8Array(t);i.length>0;)n.push(ut.apply(null,L(i.subarray(0,8192)))),i=i.subarray(8192);return"data:".concat(e,";base64,").concat(btoa(n.join("")))}(t,"image/jpeg");var s=function(t){var e=0,n=1,i=1;switch(t){case 2:n=-1;break;case 3:e=-180;break;case 4:i=-1;break;case 5:e=90,i=-1;break;case 6:e=90;break;case 7:e=90,n=-1;break;case 8:e=-90}return{rotate:e,scaleX:n,scaleY:i}}(i);r=s.rotate,a=s.scaleX,o=s.scaleY}e.rotatable&&(n.rotate=r),e.scalable&&(n.scaleX=a,n.scaleY=o),this.clone()}},{key:"clone",value:function(){var t=this.element,e=this.url,n=t.crossOrigin,i=e;this.options.checkCrossOrigin&&st(e)&&(n||(n="anonymous"),i=ht(e)),this.crossOrigin=n,this.crossOriginUrl=i;var r=document.createElement("img");n&&(r.crossOrigin=n),r.src=i||e,r.alt=t.alt||"The image to crop",this.image=r,r.onload=this.start.bind(this),r.onerror=this.stop.bind(this),F(r,u),t.parentNode.insertBefore(r,t.nextSibling)}},{key:"start",value:function(){var t=this,e=this.image;e.onload=null,e.onerror=null,this.sizing=!0;var n=s.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(s.navigator.userAgent),i=function(e,n){Y(t.imageData,{naturalWidth:e,naturalHeight:n,aspectRatio:e/n}),t.sizing=!1,t.sized=!0,t.build()};if(!e.naturalWidth||n){var r=document.createElement("img"),a=document.body||document.documentElement;this.sizingImage=r,r.onload=function(){i(r.width,r.height),n||a.removeChild(r)},r.src=e.src,n||(r.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",a.appendChild(r))}else i(e.naturalWidth,e.naturalHeight)}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var t=this.element,e=this.options,n=this.image,i=t.parentNode,r=document.createElement("div");r.innerHTML='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>';var a=r.querySelector(".".concat("cropper","-container")),o=a.querySelector(".".concat("cropper","-canvas")),s=a.querySelector(".".concat("cropper","-drag-box")),h=a.querySelector(".".concat("cropper","-crop-box")),c=h.querySelector(".".concat("cropper","-face"));this.container=i,this.cropper=a,this.canvas=o,this.dragBox=s,this.cropBox=h,this.viewBox=a.querySelector(".".concat("cropper","-view-box")),this.face=c,o.appendChild(n),F(t,d),i.insertBefore(a,t.nextSibling),this.isImg||G(n,u),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,F(h,d),e.guides||F(h.getElementsByClassName("".concat("cropper","-dashed")),d),e.center||F(h.getElementsByClassName("".concat("cropper","-center")),d),e.background&&F(a,"".concat("cropper","-bg")),e.highlight||F(c,f),e.cropBoxMovable&&(F(c,g),Q(c,v,"all")),e.cropBoxResizable||(F(h.getElementsByClassName("".concat("cropper","-line")),d),F(h.getElementsByClassName("".concat("cropper","-point")),d)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),U(e.ready)&&nt(t,"ready",e.ready,{once:!0}),it(t,"ready")}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),G(this.element,d))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&e(n.prototype,i),r&&e(n,r),t}();return Y(Mt.prototype,gt,vt,bt,wt,xt,yt),Mt}()},yHON:function(t,e,n){var i=n("yNUO");t.exports=function(t,e){var n=i(t).getTime(),r=i(e).getTime();return n>r?-1:n<r?1:0}},yNUO:function(t,e,n){var i=n("VGX7"),r=n("pzWd"),a=36e5,o=6e4,s=2,h=/[T ]/,c=/:/,p=/^(\d{2})$/,l=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],d=/^(\d{4})/,u=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],f=/^-(\d{2})$/,m=/^-?(\d{3})$/,g=/^-?(\d{2})-?(\d{2})$/,v=/^-?W(\d{2})$/,b=/^-?W(\d{2})-?(\d{1})$/,w=/^(\d{2}([.,]\d*)?)$/,x=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,y=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,C=/([Z+-].*)$/,M=/^(Z)$/,D=/^([+-])(\d{2})$/,T=/^([+-])(\d{2}):?(\d{2})$/;function B(t,e,n){e=e||0,n=n||0;var i=new Date(0);i.setUTCFullYear(t,0,4);var r=7*e+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}t.exports=function(t,e){if(r(t))return new Date(t.getTime());if("string"!=typeof t)return new Date(t);var n=(e||{}).additionalDigits;n=null==n?s:Number(n);var A=function(t){var e,n={},i=t.split(h);c.test(i[0])?(n.date=null,e=i[0]):(n.date=i[0],e=i[1]);if(e){var r=C.exec(e);r?(n.time=e.replace(r[1],""),n.timezone=r[1]):n.time=e}return n}(t),S=function(t,e){var n,i=l[e],r=u[e];if(n=d.exec(t)||r.exec(t)){var a=n[1];return{year:parseInt(a,10),restDateString:t.slice(a.length)}}if(n=p.exec(t)||i.exec(t)){var o=n[1];return{year:100*parseInt(o,10),restDateString:t.slice(o.length)}}return{year:null}}(A.date,n),O=S.year,k=function(t,e){if(null===e)return null;var n,i,r,a;if(0===t.length)return(i=new Date(0)).setUTCFullYear(e),i;if(n=f.exec(t))return i=new Date(0),r=parseInt(n[1],10)-1,i.setUTCFullYear(e,r),i;if(n=m.exec(t)){i=new Date(0);var o=parseInt(n[1],10);return i.setUTCFullYear(e,0,o),i}if(n=g.exec(t)){i=new Date(0),r=parseInt(n[1],10)-1;var s=parseInt(n[2],10);return i.setUTCFullYear(e,r,s),i}if(n=v.exec(t))return a=parseInt(n[1],10)-1,B(e,a);if(n=b.exec(t)){a=parseInt(n[1],10)-1;var h=parseInt(n[2],10)-1;return B(e,a,h)}return null}(S.restDateString,O);if(k){var _,E=k.getTime(),N=0;if(A.time&&(N=function(t){var e,n,i;if(e=w.exec(t))return(n=parseFloat(e[1].replace(",",".")))%24*a;if(e=x.exec(t))return n=parseInt(e[1],10),i=parseFloat(e[2].replace(",",".")),n%24*a+i*o;if(e=y.exec(t)){n=parseInt(e[1],10),i=parseInt(e[2],10);var r=parseFloat(e[3].replace(",","."));return n%24*a+i*o+1e3*r}return null}(A.time)),A.timezone)_=function(t){var e,n;if(e=M.exec(t))return 0;if(e=D.exec(t))return n=60*parseInt(e[2],10),"+"===e[1]?-n:n;if(e=T.exec(t))return n=60*parseInt(e[2],10)+parseInt(e[3],10),"+"===e[1]?-n:n;return 0}(A.timezone)*o;else{var z=E+N,W=new Date(z);_=i(W);var R=new Date(z);R.setDate(W.getDate()+1);var U=i(R)-i(W);U>0&&(_+=U)}return new Date(E+N+_)}return new Date(t)}}},[[20,0]]]);