landestreffen-webseite/plugins/form/assets/filepond/filepond-plugin-image-transform.min.js

10 lines
26 KiB
JavaScript
Raw Normal View History

/*!
* FilePondPluginImageTransform 3.8.7
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/
/* eslint-disable */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).FilePondPluginImageTransform=e()}(this,function(){"use strict";var t={jpeg:"jpg","svg+xml":"svg"},e={1:function(){return[1,0,0,1,0,0]},2:function(t){return[-1,0,0,1,t,0]},3:function(t,e){return[-1,0,0,-1,t,e]},4:function(t,e){return[1,0,0,-1,0,e]},5:function(){return[0,1,1,0,0,0]},6:function(t,e){return[0,1,-1,0,e,0]},7:function(t,e){return[0,-1,-1,0,e,t]},8:function(t){return[0,-1,1,0,0,t]}},n=function(t,e){return{x:t,y:e}},r=function(t,e){return n(t.x-e.x,t.y-e.y)},i=function(t,e){return Math.sqrt(function(t,e){return function(t,e){return t.x*e.x+t.y*e.y}(r(t,e),r(t,e))}(t,e))},a=function(t,e){var r=t,i=e,a=1.5707963267948966-e,o=Math.sin(1.5707963267948966),u=Math.sin(i),c=Math.sin(a),l=Math.cos(a),h=r/o;return n(l*(h*u),l*(h*c))},o=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{x:.5,y:.5},u=o.x>.5?1-o.x:o.x,c=o.y>.5?1-o.y:o.y,l=2*u*t.width,h=2*c*t.height,f=function(t,e){var r=t.width,o=t.height,u=a(r,e),c=a(o,e),l=n(t.x+Math.abs(u.x),t.y-Math.abs(u.y)),h=n(t.x+t.width+Math.abs(c.y),t.y+Math.abs(c.x)),f=n(t.x-Math.abs(c.y),t.y+t.height-Math.abs(c.x));return{width:i(l,h),height:i(l,f)}}(e,r);return Math.max(f.width/l,f.height/h)},u=function(t,e){var n=t.width,r=n*e;return r>t.height&&(n=(r=t.height)/e),{x:.5*(t.width-n),y:.5*(t.height-r),width:n,height:r}},c=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=t.height/t.width,i=e,a=1,o=r;o>i&&(a=(o=i)/r);var u=Math.max(1/a,i/o),c=t.width/(n*u*a);return{width:c,height:c*e}},l=function(t){t.width=1,t.height=1,t.getContext("2d").clearRect(0,0,1,1)},h=function(t){return t&&(t.horizontal||t.vertical)},f=function(t,n,r){if(n<=1&&!h(r))return t.width=t.naturalWidth,t.height=t.naturalHeight,t;var i=document.createElement("canvas"),a=t.naturalWidth,o=t.naturalHeight,u=n>=5&&n<=8;u?(i.width=o,i.height=a):(i.width=a,i.height=o);var c=i.getContext("2d");if(n&&c.transform.apply(c,function(t,n,r){return-1===r&&(r=1),e[r](t,n)}(a,o,n)),h(r)){var l=[1,0,0,1,0,0];(!u&&r.horizontal||u&r.vertical)&&(l[0]=-1,l[4]=a),(!u&&r.vertical||u&&r.horizontal)&&(l[3]=-1,l[5]=o),c.transform.apply(c,l)}return c.drawImage(t,0,0,a,o),i};"undefined"!=typeof window&&void 0!==window.document&&(HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(t,e,n){var r=this.toDataURL(e,n).split(",")[1];setTimeout(function(){for(var n=atob(r),i=n.length,a=new Uint8Array(i),o=0;o<i;o++)a[o]=n.charCodeAt(o);t(new Blob([a],{type:e||"image/png"}))})}}));var s=function(t,e){return y(t.x*e,t.y*e)},d=function(t,e){return y(t.x+e.x,t.y+e.y)},g=function(t){var e=Math.sqrt(t.x*t.x+t.y*t.y);return 0===e?{x:0,y:0}:y(t.x/e,t.y/e)},v=function(t,e,n){var r=Math.cos(e),i=Math.sin(e),a=y(t.x-n.x,t.y-n.y);return y(n.x+r*a.x-i*a.y,n.y+i*a.x+r*a.y)},y=function(){return{x:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,y:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0}},m=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0;return"string"==typeof t?parseFloat(t)*n:"number"==typeof t?t*(r?e[r]:Math.min(e.width,e.height)):void 0},p=function(t,e,n){var r=t.borderStyle||t.lineStyle||"solid",i=t.backgroundColor||t.fontColor||"transparent",a=t.borderColor||t.lineColor||"transparent",o=m(t.borderWidth||t.lineWidth,e,n);return{"stroke-linecap":t.lineCap||"round","stroke-linejoin":t.lineJoin||"round","stroke-width":o||0,"stroke-dasharray":"string"==typeof r?"":r.map(function(t){return m(t,e,n)}).join(","),stroke:a,fill:i,opacity:t.opacity||1}},w=function(t){return null!=t},x=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=m(t.x,e,n,"width")||m(t.left,e,n,"width"),i=m(t.y,e,n,"height")||m(t.top,e,n,"height"),a=m(t.width,e,n,"width"),o=m(t.height,e,n,"height"),u=m(t.right,e,n,"width"),c=m(t.bottom,e,n,"height");return w(i)