!(function (t) { 'object' == typeof exports && 'undefined' != typeof module ? (module.exports = t()) : 'function' == typeof define && define.amd ? define([], t) : (('undefined' != typeof window ? window : 'undefined' != typeof global ? global : 'undefined' != typeof self ? self : this ).Perspective = t()) })(function () { return (function o(n, r, i) { function s(e, t) { if (!r[e]) { if (!n[e]) { var a = 'function' == typeof require && require if (!t && a) return a(e, !0) if (c) return c(e, !0) throw ( (((a = new Error("Cannot find module '" + e + "'")).code = 'MODULE_NOT_FOUND'), a) ) } ;(a = r[e] = { exports: {} }), n[e][0].call( a.exports, function (t) { return s(n[e][1][t] || t) }, a, a.exports, o, n, r, i ) } return r[e].exports } for ( var c = 'function' == typeof require && require, t = 0; t < i.length; t++ ) s(i[t]) return s })( { 1: [ function (t, e, a) { var o = window.html5jp || {} !(function () { o.perspective = function (t, e) { var a, o t && t.strokeStyle && e && e.width && e.height && (((a = document.createElement('canvas')).width = parseInt( e.width )), (a.height = parseInt(e.height)), (o = a.getContext('2d')).drawImage(e, 0, 0, a.width, a.height), ((e = document.createElement('canvas')).width = t.canvas.width), (e.height = t.canvas.height), (e = e.getContext('2d')), (this.p = { ctxd: t, cvso: a, ctxo: o, ctxt: e })) } var t = o.perspective.prototype ;(t.draw = function (t) { for ( var e = t[0][0], a = t[0][1], o = t[1][0], n = t[1][1], r = t[2][0], i = t[2][1], s = t[3][0], c = t[3][1], h = [ Math.sqrt(Math.pow(e - o, 2) + Math.pow(a - n, 2)), Math.sqrt(Math.pow(o - r, 2) + Math.pow(n - i, 2)), Math.sqrt(Math.pow(r - s, 2) + Math.pow(i - c, 2)), Math.sqrt(Math.pow(s - e, 2) + Math.pow(c - a, 2)), ], p = this.p.cvso.width, f = this.p.cvso.height, d = 0, v = 0, w = 0, l = 0; l < 4; l++ ) { var u = 0 v < (u = l % 2 ? h[l] / p : h[l] / f) && ((d = l), (v = u)), 0 == h[l] && w++ } if (!(1 < w)) { var g, m = this.p.ctxo, x = this.p.ctxt if ( (x.clearRect(0, 0, x.canvas.width, x.canvas.height), d % 2 == 0) ) { ;(g = this.create_canvas_context( p, 10 )).globalCompositeOperation = 'copy' for (var M = g.canvas, y = 0; y < f; y += 2) { var q = e + (s - e) * (O = y / f), _ = a + (c - a) * O, C = o + (r - o) * O, I = n + (i - n) * O, T = Math.atan((I - _) / (C - q)), b = Math.sqrt(Math.pow(C - q, 2) + Math.pow(I - _, 2)) / p g.setTransform(1, 0, 0, 1, 0, -y), g.drawImage(m.canvas, 0, 0), x.translate(q, _), x.rotate(T), x.scale(b, b), x.drawImage(M, 0, 0), x.setTransform(1, 0, 0, 1, 0, 0) } } else if (d % 2 == 1) { ;(g = this.create_canvas_context( 10, f )).globalCompositeOperation = 'copy' for (var M = g.canvas, E = 0; E < p; E += 2) { var O, q = e + (o - e) * (O = E / p), _ = a + (n - a) * O, C = s + (r - s) * O, I = c + (i - c) * O, T = Math.atan((q - C) / (I - _)), b = Math.sqrt(Math.pow(C - q, 2) + Math.pow(I - _, 2)) / f g.setTransform(1, 0, 0, 1, -E, 0), g.drawImage(m.canvas, 0, 0), x.translate(q, _), x.rotate(T), x.scale(b, b), x.drawImage(M, 0, 0), x.setTransform(1, 0, 0, 1, 0, 0) } } this.p.ctxd.save(), this._applyClipPath(this.p.ctxd, [ [e, a], [o, n], [r, i], [s, c], ]), this.p.ctxd.drawImage(x.canvas, 0, 0), this.p.ctxd.restore() } }), (t.create_canvas_context = function (t, e) { var a = document.createElement('canvas') return (a.width = t), (a.height = e), a.getContext('2d') }), (t._applyClipPath = function (t, e) { t.beginPath(), t.moveTo(e[0][0], e[0][1]) for (var a = 1; a < e.length; a++) t.lineTo(e[a][0], e[a][1]) t.closePath(), t.clip() }) })(), (e.exports = o.perspective) }, {}, ], }, {}, [1] )(1) })