Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

idcrop

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

idcrop - npm Package Compare versions

Comparing version 2.1.2 to 2.1.3

22

dist/js/bundle.min.js

@@ -1,2 +0,2 @@

!function(n){function g(c){if(I[c])return I[c].exports;var t=I[c]={i:c,l:!1,exports:{}};return n[c].call(t.exports,t,t.exports,g),t.l=!0,t.exports}var I={};g.m=n,g.c=I,g.d=function(n,I,c){g.o(n,I)||Object.defineProperty(n,I,{configurable:!1,enumerable:!0,get:c})},g.n=function(n){var I=n&&n.__esModule?function(){return n.default}:function(){return n};return g.d(I,"a",I),I},g.o=function(n,g){return Object.prototype.hasOwnProperty.call(n,g)},g.p="",g(g.s=3)}([/*!********************************!*\
var IdCrop=function(n){function g(t){if(I[t])return I[t].exports;var c=I[t]={i:t,l:!1,exports:{}};return n[t].call(c.exports,c,c.exports,g),c.l=!0,c.exports}var I={};return g.m=n,g.c=I,g.d=function(n,I,t){g.o(n,I)||Object.defineProperty(n,I,{configurable:!1,enumerable:!0,get:t})},g.n=function(n){var I=n&&n.__esModule?function(){return n.default}:function(){return n};return g.d(I,"a",I),I},g.o=function(n,g){return Object.prototype.hasOwnProperty.call(n,g)},g.p="",g(g.s=3)}([/*!********************************!*\
!*** ./lib/js/idcrop/Point.js ***!

@@ -16,16 +16,8 @@ \********************************/

/*! all exports used */
function(module,exports){eval('function loadImage(src) {\n var img = new Image();\n /* eslint-disable */\n img.src = src.substring(0, 1) === "\\"" ? src.substring(1, src.length - 1) : src;\n /* eslint-enable */\n return new Promise(function(resolve, reject) {\n img.onload = () => resolve(img);\n img.onerror = error => reject(error);\n });\n}\n\nfunction dataURIFromSrc(src) {\n var canvas = document.createElement("canvas");\n var context = canvas.getContext("2d");\n return loadImage(src).then(function(img) {\n canvas.width = img.width;\n canvas.height = img.height;\n context.drawImage(img, 0, 0, canvas.width, canvas.height);\n return canvas.toDataURL();\n });\n}\n\nfunction getBgSource(element) {\n const style = element.currentStyle || window.getComputedStyle(element, false);\n return style.backgroundImage.slice(4, -1);\n}\n\nfunction fakeInput(input, fakeInput) {\n input.style.display = "none";\n fakeInput.addEventListener("click", function(event) {\n event = event || window.event;\n event.preventDefault();\n input.click();\n });\n}\n\nfunction dragDropInput(input, dragArea, filenameArea, self) {\n dragArea.addEventListener("dragenter", function() {\n dragArea.classList.add("hovered");\n });\n dragArea.addEventListener("dragleave", function() {\n dragArea.classList.remove("hovered");\n });\n dragArea.addEventListener("dragover", function(event) {\n event.stopPropagation();\n event.preventDefault();\n event.dataTransfer.dropEffect = "copy";\n });\n dragArea.addEventListener("drop", function(event) {\n event.preventDefault();\n dragArea.classList.remove("hovered");\n getFile(event).then(data => {\n filenameArea.innerHTML = data.filename;\n self.startCroppingArea(data.base64, self);\n });\n });\n input.addEventListener("change", function(event) {\n getFile(event).then(data => {\n filenameArea.innerHTML = data.filename;\n self.startCroppingArea(data.base64, self);\n });\n });\n}\n\nfunction getFile(event) {\n event.preventDefault();\n const file =\n typeof event.target.files !== "undefined"\n ? event.target.files[0]\n : event.dataTransfer.files[0];\n const reader = new FileReader();\n reader.readAsDataURL(file);\n return new Promise(function(resolve, reject) {\n reader.onload = event =>\n resolve({\n filename: file.name,\n base64: event.target.result\n });\n reader.onerror = error => reject(error);\n });\n}\n\nmodule.exports = exports = {\n loadImage,\n dataURIFromSrc,\n getBgSource,\n fakeInput,\n dragDropInput,\n getFile\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2xpYi9qcy9pZGNyb3AvaGVscGVycy5qcz9kOTlhIl0sInNvdXJjZXNDb250ZW50IjpbImZ1bmN0aW9uIGxvYWRJbWFnZShzcmMpIHtcbiAgdmFyIGltZyA9IG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=webpack-internal:///2\n')},/*!************************!*\
!*** ./lib/js/prod.js ***!
\************************/
/*! no exports provided */
/*! all exports used */
function(module,__webpack_exports__,__webpack_require__){"use strict";eval('Object.defineProperty(__webpack_exports__, "__esModule", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scss_main_scss__ = __webpack_require__(/*! ../scss/main.scss */ 4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scss_main_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__scss_main_scss__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__idcrop_IdCrop_js__ = __webpack_require__(/*! ./idcrop/IdCrop.js */ 5);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__idcrop_IdCrop_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__idcrop_IdCrop_js__);\n// Import SCSS files.\n\n\n// Import JS.\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2xpYi9qcy9wcm9kLmpzPzdhMjAiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gSW1wb3J0IFNDU1MgZmlsZXMuXG5pbXBvcnQgXCIuLi9zY3NzL21haW4uc2Nzc1wiO1xuXG4vLyBJbXBvcnQgSlMuXG5pbXBvcnQgXCIuL2lkY3JvcC9JZENyb3AuanNcIjtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbGliL2pzL3Byb2QuanNcbi8vIG1vZHVsZSBpZCA9IDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///3\n')},/*!****************************!*\
!*** ./lib/scss/main.scss ***!
\****************************/
/*! dynamic exports provided */
function(module,exports){eval("// removed by extract-text-webpack-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2xpYi9zY3NzL21haW4uc2Nzcz8yODI1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIHJlbW92ZWQgYnkgZXh0cmFjdC10ZXh0LXdlYnBhY2stcGx1Z2luXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9saWIvc2Nzcy9tYWluLnNjc3Ncbi8vIG1vZHVsZSBpZCA9IDRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///4\n")},/*!*********************************!*\
function(module,exports){eval('function loadImage(src) {\n var img = new Image();\n /* eslint-disable */\n img.src = src.substring(0, 1) === "\\"" ? src.substring(1, src.length - 1) : src;\n /* eslint-enable */\n return new Promise(function(resolve, reject) {\n img.onload = () => resolve(img);\n img.onerror = error => reject(error);\n });\n}\n\nfunction dataURIFromSrc(src) {\n var canvas = document.createElement("canvas");\n var context = canvas.getContext("2d");\n return loadImage(src).then(function(img) {\n canvas.width = img.width;\n canvas.height = img.height;\n context.drawImage(img, 0, 0, canvas.width, canvas.height);\n return canvas.toDataURL();\n });\n}\n\nfunction getBgSource(element) {\n const style = element.currentStyle || window.getComputedStyle(element, false);\n return style.backgroundImage.slice(4, -1);\n}\n\nfunction fakeInput(input, fakeInput) {\n input.style.display = "none";\n fakeInput.addEventListener("click", function(event) {\n event = event || window.event;\n event.preventDefault();\n input.click();\n });\n}\n\nfunction dragDropInput(input, dragArea, filenameArea, self) {\n dragArea.addEventListener("dragenter", function() {\n dragArea.classList.add("hovered");\n });\n dragArea.addEventListener("dragleave", function() {\n dragArea.classList.remove("hovered");\n });\n dragArea.addEventListener("dragover", function(event) {\n event.stopPropagation();\n event.preventDefault();\n event.dataTransfer.dropEffect = "copy";\n });\n dragArea.addEventListener("drop", function(event) {\n event.preventDefault();\n dragArea.classList.remove("hovered");\n getFile(event).then(data => {\n filenameArea.innerHTML = data.filename;\n self.startCroppingArea(data.base64, self);\n });\n });\n input.addEventListener("change", function(event) {\n getFile(event).then(data => {\n filenameArea.innerHTML = data.filename;\n self.startCroppingArea(data.base64, self);\n });\n });\n}\n\nfunction getFile(event) {\n event.preventDefault();\n const file =\n typeof event.target.files !== "undefined"\n ? event.target.files[0]\n : event.dataTransfer.files[0];\n const reader = new FileReader();\n reader.readAsDataURL(file);\n return new Promise(function(resolve, reject) {\n reader.onload = event =>\n resolve({\n filename: file.name,\n base64: event.target.result\n });\n reader.onerror = error => reject(error);\n });\n}\n\nmodule.exports = exports = {\n loadImage,\n dataURIFromSrc,\n getBgSource,\n fakeInput,\n dragDropInput,\n getFile\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2xpYi9qcy9pZGNyb3AvaGVscGVycy5qcz9kOTlhIl0sInNvdXJjZXNDb250ZW50IjpbImZ1bmN0aW9uIGxvYWRJbWFnZShzcmMpIHtcbiAgdmFyIGltZyA9IG5ldyBJbWFnZSgpO1xuICAvKiBlc2xpbnQtZGlzYWJsZSAqL1xuICBpbWcuc3JjID0gc3JjLnN1YnN0cmluZygwLCAxKSA9PT0gXCJcXFwiXCIgPyBzcmMuc3Vic3RyaW5nKDEsIHNyYy5sZW5ndGggLSAxKSA6IHNyYztcbiAgLyogZXNsaW50LWVuYWJsZSAqL1xuICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICA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4vbGliL2pzL2lkY3JvcC9oZWxwZXJzLmpzXG4vLyBtb2R1bGUgaWQgPSAyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///2\n')},/*!*********************************!*\
!*** ./lib/js/idcrop/IdCrop.js ***!
\*********************************/
/*! dynamic exports provided */
function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Point = __webpack_require__(/*! ./Point.js */ 0);\nconst Handle = __webpack_require__(/*! ./Handle.js */ 6);\nconst Polygon = __webpack_require__(/*! ./Polygon.js */ 1);\nconst CropArea = __webpack_require__(/*! ./CropArea.js */ 7);\n\nconst helpers = __webpack_require__(/*! ./helpers.js */ 2);\n\nclass IdCrop {\n constructor(config) {\n this.config = {\n numPoints: typeof config.numPoints !== "undefined" ? config.numPoints : 4,\n allowUpload:\n typeof config.allowUpload !== "undefined" ? config.allowUpload : true,\n closeButtonSelector:\n typeof config.closeButtonSelector !== "undefined" \n ? config.closeButtonSelector \n : false,\n containers: {\n displayArea: document.querySelector(config.displaySelector),\n toolbarArea: config.toolbarSelector\n ? document.querySelector(config.toolbarSelector)\n : "",\n previewArea: config.previewSelector\n ? document.querySelector(config.previewSelector)\n : ""\n },\n croppingArea: {\n overlayColor:\n typeof config.croppingArea !== "undefined" &&\n typeof config.croppingArea.overlayColor !== "undefined"\n ? config.croppingArea.overlayColor\n : "rgba(0, 0, 0, 0.7)",\n stroke:\n typeof config.croppingArea !== "undefined" &&\n typeof config.croppingArea.stroke !== "undefined"\n ? config.croppingArea.stroke\n : true,\n strokeColor:\n typeof config.croppingArea !== "undefined" &&\n typeof config.croppingArea.strokeColor !== "undefined"\n ? config.croppingArea.strokeColor\n : "white",\n strokeDashed:\n typeof config.croppingArea !== "undefined" &&\n typeof config.croppingArea.strokeDashed !== "undefined"\n ? config.croppingArea.strokeDashed\n : true,\n strokeWeight:\n typeof config.croppingArea !== "undefined" &&\n typeof config.croppingArea.strokeWeight !== "undefined"\n ? config.croppingArea.strokeWeight\n : 2\n },\n crop: {\n overlayColor:\n typeof config.crop !== "undefined" &&\n typeof config.crop.overlayColor !== "undefined"\n ? config.crop.overlayColor\n : "rgba(0, 0, 0, 0)",\n fillColor:\n typeof config.crop !== "undefined" &&\n typeof config.crop.fillColor !== "undefined"\n ? config.crop.fillColor\n : false,\n showImage:\n typeof config.crop !== "undefined" &&\n typeof config.crop.showImage !== "undefined"\n ? config.crop.showImage\n : true,\n stroke:\n typeof config.crop !== "undefined" &&\n typeof config.crop.stroke !== "undefined"\n ? config.crop.stroke\n : true,\n strokeColor:\n typeof config.crop !== "undefined" &&\n typeof config.crop.strokeColor !== "undefined"\n ? config.crop.strokeColor\n : false,\n strokeDashed:\n typeof config.crop !== "undefined" &&\n typeof config.crop.strokeDashed !== "undefined"\n ? config.crop.strokeDashed\n : false,\n strokeWeight:\n typeof config.crop !== "undefined" &&\n typeof config.crop.strokeWeight !== "undefined"\n ? config.crop.strokeWeight\n : 0\n },\n handles: {\n class:\n typeof config.handles !== "undefined" &&\n typeof config.handles.class !== "undefined"\n ? config.handles.class\n : "",\n defaultStyles:\n typeof config.handles !== "undefined" &&\n typeof config.handles.defaultStyles !== "undefined"\n ? config.handles.defaultStyles\n : true\n }\n };\n\n this.handles = [];\n this.points = [];\n }\n\n init() {\n const self = this;\n const c = this.config.containers;\n\n c.displayArea.classList.add("idwall-display");\n\n if (c.previewArea) c.previewArea.classList.add("idwall-preview");\n\n if (c.toolbarArea) {\n if (this.config.numPoints === Infinity) {\n var closeButton = "";\n if (this.config.closeButtonSelector) {\n closeButton = document.querySelector(this.config.closeButtonSelector)\n } else {\n closeButton = document.createElement("button");\n var closeButtonText = document.createTextNode("Close path");\n closeButton.appendChild(closeButtonText);\n c.toolbarArea.appendChild(closeButton);\n }\n closeButton.addEventListener("click", function() {\n self.startCroppingPolygon();\n });\n }\n }\n\n if (c.toolbarArea && this.config.allowUpload) {\n var hint = document.createElement("p");\n var hintText = document.createTextNode("Drop files here or ");\n var fakeInput = document.createElement("a");\n var fakeInputText = document.createTextNode("Browse...");\n fakeInput.title = "Browse";\n fakeInput.href = "";\n fakeInput.appendChild(fakeInputText);\n hint.appendChild(hintText);\n hint.appendChild(fakeInput);\n c.displayArea.appendChild(hint);\n\n var filenameArea = document.createElement("p");\n filenameArea.appendChild(document.createTextNode("No file selected."));\n c.toolbarArea.appendChild(filenameArea);\n\n var input = document.createElement("input");\n input.type = "file";\n c.toolbarArea.appendChild(input);\n helpers.fakeInput(input, fakeInput);\n helpers.dragDropInput(input, c.displayArea, filenameArea, this);\n }\n\n if (!c.toolbarArea || !this.config.allowUpload) {\n var src = helpers.getBgSource(c.displayArea);\n helpers.dataURIFromSrc(src).then(function(base64) {\n self.startCroppingArea(base64, self);\n });\n }\n\n window.addEventListener("mouseup", function() {\n if (self.config.containers.previewArea) self.drawPreview(self);\n document.onmousemove = function() {};\n });\n\n var created = new CustomEvent("created", { detail: self.config });\n document.dispatchEvent(created);\n }\n\n startCroppingArea(base64, self) {\n const displayArea = self.config.containers.displayArea;\n\n self.cropArea = new CropArea(displayArea, base64);\n self.cropArea.create().then(function(img) {\n self.image = img;\n displayArea.style.backgroundImage = "url(\'" + base64 + "\')";\n });\n\n for (const handle of self.handles) {\n handle.deleteNode();\n }\n\n self.handles = [];\n self.cropArea.canvas.addEventListener("mousedown", function(event) {\n self.createHandles(event, self);\n });\n }\n\n createHandles(event, self) {\n if (self.cropArea.isDrawing) {\n const cbounds = self.cropArea.canvas.getBoundingClientRect();\n const x = event.clientX - cbounds.left,\n y = event.clientY - cbounds.top;\n\n let point = new Point(x, y),\n handle = new Handle(\n self.config.containers.displayArea,\n self.image.left,\n self.image.top,\n point\n );\n\n handle.init(self.config.handles.defaultStyles, self.config.handles.class);\n self.handles.push(handle);\n self.points.push(point);\n\n if (self.handles.length == self.config.numPoints) {\n self.startCroppingPolygon(self);\n }\n }\n }\n\n startCroppingPolygon(self = this) {\n const c = self.config.croppingArea;\n\n self.points = Point.sort(self.points);\n self.cropArea.isDrawing = false;\n\n self.cropPolygon = new Polygon(\n self.config.containers.displayArea,\n self.cropArea.canvas\n );\n self.cropPolygon.drawWithOverlay(\n self.points,\n c.overlayColor,\n c.stroke,\n c.strokeColor,\n c.strokeDashed,\n c.strokeWeight\n );\n\n for (const handle of self.handles) {\n const config = self.config.croppingArea;\n handle.direction = handle.setDirection(self.points);\n handle.node.addEventListener("mousedown", function(event) {\n self.cropPolygon.startResizing(event, self.points, config);\n });\n }\n\n self.drawPreview(self);\n }\n\n drawPreview(self) {\n if (\n typeof this.cropArea !== "undefined" &&\n this.cropArea.isDrawing == false\n ) {\n const base64 = this.cropArea.crop(\n this.image.img,\n this.config.containers.previewArea,\n this.points,\n this.config.crop\n );\n self.config.containers.previewArea.style.backgroundImage =\n "url(\'" + base64 + "\')";\n }\n }\n\n reset() {\n this.cropArea = undefined;\n this.cropPolygon = undefined;\n \n this.handles = [];\n this.points = [];\n this.image = "data:image/jpeg;base64,";\n\n if (this.previewArea) this.previewArea.style.backgroundImage = "";\n\n this.init();\n }\n\n getPoints() {\n let realPoints = [];\n for (const point of this.points) {\n realPoints.push(\n new Point(point.x * this.image.ratio, point.y * this.image.ratio)\n );\n }\n return realPoints;\n }\n}\n\nmodule.exports = exports = IdCrop;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2xpYi9qcy9pZGNyb3AvSWRDcm9wLmpzP2FlMWIiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmNvbnN0IFBvaW50ID0gcmVxdWlyZShcIi4vUG9pbnQuanNcIik7XG5jb25zdCBIYW5kbGUgPSByZXF1aXJlKFwiLi9IYW5kbGUuanNcIik7XG5jb25zdCBQb2x5Z29uID0gcmVxdWlyZShcIi4vUG9seWdvbi5qc1wiKTtcbmNvbnN0IENyb3BBcmVhID0gcmVxdWlyZShcIi4vQ3JvcEFyZWEuanNcIik7XG5cbmNvbnN0IGhlbHBlcnMgPSByZXF1aXJlKFwiLi9oZWxwZXJzLmpzXCIpO1xuXG5jbGFzcyBJZENyb3Age1xuICBjb25zdHJ1Y3Rvcihjb25maWcpIHtcbiAgICB0aGlzLmNvbmZpZyA9IHtcbiAgICAgIG51bVBvaW50czogdHlwZW9mIGNvbmZpZy5udW1Qb2ludHMgIT09IFwidW5kZWZpbmVkXCIgPyBjb25maWcubnVtUG9pbnRzIDogNCxcbiAgICAgIGFsbG93VXBsb2FkOlxuICAgICAgICB0eXBlb2YgY29uZmlnLmFsbG93VXBsb2FkICE9PSBcInVuZGVmaW5lZFwiID8gY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lcmxheUNvbG9yOlxuICAgICAgICAgIHR5cGVvZiBjb25maWcuY3JvcCAhPT0gXCJ1bmRlZmluZWRcIiAmJlxuICAgICAgICAgIHR5cGVvZiBjb25maWcuY3JvcC5vdmVybGF5Q29sb3IgIT09IFwidW5kZWZpbmVkXCJcbiAgICAgICAgICAgID8gY29uZmlnLmNyb3Aub3ZlcmxheUNvbG9yXG4gICAgICAgICAgICA6IFwicmdiYSgwLCAwLCAwLCAwKVwiLFxuICAgICAgICBmaWxsQ29sb3I6XG4gICAgICAgICAgdHlwZW9mIGNvbmZpZy5jcm9wICE9PSBcInVuZGVmaW5lZFwiICYmXG4gICAgICAgICAgdHlwZW9mIGNvbmZpZy5jcm9wLmZpbGxDb2xvciAhPT0gXCJ1bmRlZmluZWRcIlxuICAgICAgICAgICAgPyBjb25maWcuY3JvcC5maWxsQ29sb3JcbiAgICAgICAgICAgIDogZmFsc2UsXG4gICAgICAgIHNob3dJbWFnZTpcbiAgICAgICAgICB0eXBlb2YgY29uZmlnLmNyb3AgIT09IFwidW5kZWZpbmVkXCIgJiZcbiAgICAgICAgICB0eXBlb2YgY29uZmlnLmNyb3Auc2hvd0ltYWdlICE9PSBcInVuZGVmaW5lZFwiXG4gICAgICAgICAgICA/IGNvbmZpZy5jcm9wLnNob3dJbWFnZVxuICAgICAgICAgICAgOiB0cnVlLFxuICAgICAgICBzdHJva2U6XG4gICAgICAgICAgdHlwZW9mIGNvbmZpZy5jcm9wICE9PSBcInVuZGVmaW5lZFwiICYmXG4gICAgICAgICAgdHlwZW9mIGNvbmZpZy5jcm9wLnN0cm9rZSAhPT0gXCJ1bmRlZmluZWRcIlxuICAgICAgICAgICAgPyBjb25maWcuY3JvcC5zdHJva2VcbiAgICAgICAgICAgIDogdHJ1ZSxcbiAgICAgICAgc3Ryb2tlQ29sb3I6XG4gICAgICAgICAgdHlwZW9mIGNvbmZpZy5jcm9wICE9PSBcInVuZGVmaW5lZFwiICYmXG4gICAgICAgICAgdHlwZW9mIGN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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///5\n')},/*!*********************************!*\
/*! all exports used */
function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Point = __webpack_require__(/*! ./Point.js */ 0);\nconst Handle = __webpack_require__(/*! ./Handle.js */ 4);\nconst Polygon = __webpack_require__(/*! ./Polygon.js */ 1);\nconst CropArea = __webpack_require__(/*! ./CropArea.js */ 5);\n\nconst helpers = __webpack_require__(/*! ./helpers.js */ 2);\n\nclass IdCrop {\n constructor(config) {\n this.config = {\n numPoints: typeof config.numPoints !== "undefined" ? config.numPoints : 4,\n allowUpload:\n typeof config.allowUpload !== "undefined" ? config.allowUpload : true,\n closeButtonSelector:\n typeof config.closeButtonSelector !== "undefined" \n ? config.closeButtonSelector \n : false,\n containers: {\n displayArea: document.querySelector(config.displaySelector),\n toolbarArea: config.toolbarSelector\n ? document.querySelector(config.toolbarSelector)\n : "",\n previewArea: config.previewSelector\n ? document.querySelector(config.previewSelector)\n : ""\n },\n croppingArea: {\n overlayColor:\n typeof config.croppingArea !== "undefined" &&\n typeof config.croppingArea.overlayColor !== "undefined"\n ? config.croppingArea.overlayColor\n : "rgba(0, 0, 0, 0.7)",\n stroke:\n typeof config.croppingArea !== "undefined" &&\n typeof config.croppingArea.stroke !== "undefined"\n ? config.croppingArea.stroke\n : true,\n strokeColor:\n typeof config.croppingArea !== "undefined" &&\n typeof config.croppingArea.strokeColor !== "undefined"\n ? config.croppingArea.strokeColor\n : "white",\n strokeDashed:\n typeof config.croppingArea !== "undefined" &&\n typeof config.croppingArea.strokeDashed !== "undefined"\n ? config.croppingArea.strokeDashed\n : true,\n strokeWeight:\n typeof config.croppingArea !== "undefined" &&\n typeof config.croppingArea.strokeWeight !== "undefined"\n ? config.croppingArea.strokeWeight\n : 2\n },\n crop: {\n overlayColor:\n typeof config.crop !== "undefined" &&\n typeof config.crop.overlayColor !== "undefined"\n ? config.crop.overlayColor\n : "rgba(0, 0, 0, 0)",\n fillColor:\n typeof config.crop !== "undefined" &&\n typeof config.crop.fillColor !== "undefined"\n ? config.crop.fillColor\n : false,\n showImage:\n typeof config.crop !== "undefined" &&\n typeof config.crop.showImage !== "undefined"\n ? config.crop.showImage\n : true,\n stroke:\n typeof config.crop !== "undefined" &&\n typeof config.crop.stroke !== "undefined"\n ? config.crop.stroke\n : true,\n strokeColor:\n typeof config.crop !== "undefined" &&\n typeof config.crop.strokeColor !== "undefined"\n ? config.crop.strokeColor\n : false,\n strokeDashed:\n typeof config.crop !== "undefined" &&\n typeof config.crop.strokeDashed !== "undefined"\n ? config.crop.strokeDashed\n : false,\n strokeWeight:\n typeof config.crop !== "undefined" &&\n typeof config.crop.strokeWeight !== "undefined"\n ? config.crop.strokeWeight\n : 0\n },\n handles: {\n class:\n typeof config.handles !== "undefined" &&\n typeof config.handles.class !== "undefined"\n ? config.handles.class\n : "",\n defaultStyles:\n typeof config.handles !== "undefined" &&\n typeof config.handles.defaultStyles !== "undefined"\n ? config.handles.defaultStyles\n : true\n }\n };\n\n this.handles = [];\n this.points = [];\n }\n\n init() {\n const self = this;\n const c = this.config.containers;\n\n c.displayArea.classList.add("idwall-display");\n\n if (c.previewArea) c.previewArea.classList.add("idwall-preview");\n\n if (c.toolbarArea) {\n if (this.config.numPoints === Infinity) {\n var closeButton = "";\n if (this.config.closeButtonSelector) {\n closeButton = document.querySelector(this.config.closeButtonSelector)\n } else {\n closeButton = document.createElement("button");\n var closeButtonText = document.createTextNode("Close path");\n closeButton.appendChild(closeButtonText);\n c.toolbarArea.appendChild(closeButton);\n }\n closeButton.addEventListener("click", function() {\n self.startCroppingPolygon();\n });\n }\n }\n\n if (c.toolbarArea && this.config.allowUpload) {\n var hint = document.createElement("p");\n var hintText = document.createTextNode("Drop files here or ");\n var fakeInput = document.createElement("a");\n var fakeInputText = document.createTextNode("Browse...");\n fakeInput.title = "Browse";\n fakeInput.href = "";\n fakeInput.appendChild(fakeInputText);\n hint.appendChild(hintText);\n hint.appendChild(fakeInput);\n c.displayArea.appendChild(hint);\n\n var filenameArea = document.createElement("p");\n filenameArea.appendChild(document.createTextNode("No file selected."));\n c.toolbarArea.appendChild(filenameArea);\n\n var input = document.createElement("input");\n input.type = "file";\n c.toolbarArea.appendChild(input);\n helpers.fakeInput(input, fakeInput);\n helpers.dragDropInput(input, c.displayArea, filenameArea, this);\n }\n\n if (!c.toolbarArea || !this.config.allowUpload) {\n var src = helpers.getBgSource(c.displayArea);\n helpers.dataURIFromSrc(src).then(function(base64) {\n self.startCroppingArea(base64, self);\n });\n }\n\n window.addEventListener("mouseup", function() {\n if (self.config.containers.previewArea) self.drawPreview(self);\n document.onmousemove = function() {};\n });\n\n var created = new CustomEvent("created", { detail: self.config });\n document.dispatchEvent(created);\n }\n\n startCroppingArea(base64, self) {\n const displayArea = self.config.containers.displayArea;\n\n self.cropArea = new CropArea(displayArea, base64);\n self.cropArea.create().then(function(img) {\n self.image = img;\n displayArea.style.backgroundImage = "url(\'" + base64 + "\')";\n });\n\n for (const handle of self.handles) {\n handle.deleteNode();\n }\n\n self.handles = [];\n self.cropArea.canvas.addEventListener("mousedown", function(event) {\n self.createHandles(event, self);\n });\n }\n\n createHandles(event, self) {\n if (self.cropArea.isDrawing) {\n const cbounds = self.cropArea.canvas.getBoundingClientRect();\n const x = event.clientX - cbounds.left,\n y = event.clientY - cbounds.top;\n\n let point = new Point(x, y),\n handle = new Handle(\n self.config.containers.displayArea,\n self.image.left,\n self.image.top,\n point\n );\n\n handle.init(self.config.handles.defaultStyles, self.config.handles.class);\n self.handles.push(handle);\n self.points.push(point);\n\n if (self.handles.length == self.config.numPoints) {\n self.startCroppingPolygon(self);\n }\n }\n }\n\n startCroppingPolygon(self = this) {\n const c = self.config.croppingArea;\n\n self.points = Point.sort(self.points);\n self.cropArea.isDrawing = false;\n\n self.cropPolygon = new Polygon(\n self.config.containers.displayArea,\n self.cropArea.canvas\n );\n self.cropPolygon.drawWithOverlay(\n self.points,\n c.overlayColor,\n c.stroke,\n c.strokeColor,\n c.strokeDashed,\n c.strokeWeight\n );\n\n for (const handle of self.handles) {\n const config = self.config.croppingArea;\n handle.direction = handle.setDirection(self.points);\n handle.node.addEventListener("mousedown", function(event) {\n self.cropPolygon.startResizing(event, self.points, config);\n });\n }\n\n self.drawPreview(self);\n }\n\n drawPreview(self) {\n if (\n typeof this.cropArea !== "undefined" &&\n this.cropArea.isDrawing == false\n ) {\n const base64 = this.cropArea.crop(\n this.image.img,\n this.config.containers.previewArea,\n this.points,\n this.config.crop\n );\n self.config.containers.previewArea.style.backgroundImage =\n "url(\'" + base64 + "\')";\n }\n }\n\n reset() {\n this.cropArea = undefined;\n this.cropPolygon = undefined;\n \n this.handles = [];\n this.points = [];\n this.image = "data:image/jpeg;base64,";\n\n if (this.previewArea) this.previewArea.style.backgroundImage = "";\n\n this.init();\n }\n\n getPoints() {\n let realPoints = [];\n for (const point of this.points) {\n realPoints.push(\n new Point(point.x * this.image.ratio, point.y * this.image.ratio)\n );\n }\n return realPoints;\n }\n}\n\nmodule.exports = exports = IdCrop;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2xpYi9qcy9pZGNyb3AvSWRDcm9wLmpzP2FlMWIiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmNvbnN0IFBvaW50ID0gcmVxdWlyZShcIi4vUG9pbnQuanNcIik7XG5jb25zdCBIYW5kbGUgPSByZXF1aXJlKFwiLi9IYW5kbGUuanNcIik7XG5jb25zdCBQb2x5Z29uID0gcmVxdWlyZShcIi4vUG9seWdvbi5qc1wiKTtcbmNvbnN0IENyb3BBcmVhID0gcmVxdWlyZShcIi4vQ3JvcEFyZWEuanNcIik7XG5cbmNvbnN0IGhlbHBlcnMgPSByZXF1aXJlKFwiLi9oZWxwZXJzLmpzXCIpO1xuXG5jbGFzcyBJZENyb3Age1xuICBjb25zdHJ1Y3Rvcihjb25maWcpIHtcbiAgICB0aGlzLmNvbmZpZyA9IHtcbiAgICAgIG51bVBvaW50czogdHlwZW9mIGNvbmZpZy5udW1Qb2ludHMgIT09IFwidW5kZWZpbmVkXCIgPyBjb25maWcubnVtUG9pbnRzIDogNCxcbiAgICAgIGFsbG93VXBsb2FkOlxu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RcbiAgICAgICAgICAgIDogMlxuICAgICAgfSxcbiAgICAgIGNyb3A6IHtcbiAgICAgICAgb3ZlcmxheUNvbG9yOlxuICAgICAgICAgIHR5cGVvZiBjb25maWcuY3JvcCAhPT0gXCJ1bmRlZmluZWRcIiAmJlxuICAgICAgICAgIHR5cGVvZiBjb25maWcuY3JvcC5vdmVybGF5Q29sb3IgIT09IFwidW5kZWZpbmVkXCJcbiAgICAgICAgICAgID8gY29uZmlnLmNyb3Aub3ZlcmxheUNvbG9yXG4gICAgICAgICAgICA6IFwicmdiYSgwLCAwLCAwLCAwKVwiLFxuICAgICAgICBmaWxsQ29sb3I6XG4gICAgICAgICAgdHlwZW9mIGNvbmZpZy5jcm9wICE9PSBcInVuZGVmaW5lZFwiICYmXG4gICAgICAgICAgdHlwZW9mIGNvbmZpZy5jcm9wLmZpbGxDb2xvciAhPT0gXCJ1bmRlZmluZWRcIlxuICAgICAgICAgICAgPyBjb25maWcuY3JvcC5maWxsQ29sb3JcbiAgICAgICAgICAgIDogZmFsc2UsXG4gICAgICAgIHNob3dJbWFnZTpcbiAgICAgICAgICB0eXBlb2YgY29uZmlnLmNyb3AgIT09IFwidW5kZWZpbmVkXCIgJiZcbiAgICAgICAgICB0eXBlb2YgY29uZmlnLmNyb3Auc2hvd0ltYWdlICE9PSBcInVuZGVmaW5lZFwiXG4gICAgICAgICAgICA/IGNvbmZpZy5jcm9wLnNob3dJbWFnZVxuICAgICAgICAgICAgOiB0cnVlLFxuICAgICAgICBzdHJva2U6XG4gICAgICAgICAgdHlwZW9mIGNvbmZpZy5jcm9wICE9PSBcInVuZGVmaW5lZFwiICYmXG4gICAgICAgICAgdHlwZW9mIGNvbmZpZy5jcm9wLnN0cm9rZSAhPT0gXCJ1bmRlZmluZWRcIlxuICAgICAgICAgICAgPyBjb25maWcuY3JvcC5zdHJva2VcbiAgICAgICAgICAgIDogdHJ1ZSxcbiAgICAgICAgc3Ryb2tlQ29sb3I6XG4gICAgICAgICAgdHlwZW9mIGNvbmZpZy5jcm9wICE9PSBcInVuZGVmaW5lZFwiICYmXG4gICAgICAgICAgdHlwZW9mIGNvbmZpZy5jcm9wLnN0cm9rZUNvbG9yICE9PSBcInVuZGVmaW5lZFwiXG4gICAgICAgICAgICA/IGNvbmZpZy5jcm9wLnN0cm9rZUNvbG9yXG4gICAgICAgICAgICA6IGZhbHNlLFxuICAgICAgICBzdHJva2VEYXNoZWQ6XG4gICAgICAgICAgdHlwZW9mIGNvbmZpZy5jcm9wICE9PSBcInVuZGVmaW5lZFwiICYmXG4gICAgICAgICAgdHlwZW9mIGNvbmZpZy5jcm9wLnN0cm9rZURhc2hlZCAhPT0gXCJ1bmRlZmluZWRcIlxuICAgICAgICAgICAgPyBjb25maWcuY3JvcC5zdHJva2VEYXNoZWRcbiAgICAgICAgICAgIDogZmFsc2UsXG4gICAgICAgIHN0cm9rZVdlaWdodDpcbiAgICAgICAgICB0eXBlb2YgY29uZmlnLmNyb3AgIT09IFwidW5kZWZpbmVkXCIgJiZcbiAgICAgICAgICB0eXBlb2YgY29uZmlnLmNyb3Auc3Ryb2tlV2VpZ2h0ICE9PSBcInVuZGVmaW5lZFwiXG4gICAgICAgICAgICA/IGNvbmZpZy5jcm9wLnN0cm9rZVdlaWdodFxuICAgICAgICAgICAgOiAwXG4gICAgICB9LFxuICAgICAgaGFuZGxlczoge1xuICAgICAgICBjbGFzczpcbiAgICAgICAgICB0eXBlb2YgY29uZmlnLmhhbmRsZXMgIT09IFwidW5kZWZpbmVkXCIgJiZcbiAgICAgICAgICB0eXBlb2YgY29uZmlnLmhhbmRsZXMuY2xhc3MgIT09IFwidW5kZWZpbmVkXCJcbiAgICAgICAgICAgID8gY29uZmlnLmhhbmRsZXMuY2xhc3NcbiAgICAgICAgICAgIDogXCJcIixcbiAgICAgICAgZGVmYXVsdFN0eWxlczpcbiAgICAgICAgICB0eXBlb2YgY29uZmlnLmhhbmRsZXMgIT09IFwidW5kZWZpbmVkXCIgJiZcbiAgICAgICAgICB0e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webpack_require__){"use strict";eval('\n\nconst Point = __webpack_require__(/*! ./Point.js */ 0);\n\n/*\n * TODO: Change this class to extend HTMLElement when it\'s stabilized and\n * available in most browsers. Right now it only works in Chrome.\n * https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements\n */\n\nclass Handle {\n constructor(parent, offsetX, offsetY, point) {\n this.parent = parent;\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n this.point = new Point(point.x + offsetX, point.y + offsetY);\n\n this.node = document.createElement("div");\n }\n\n init(defaultStyles, additionalClasses) {\n if (defaultStyles) this.node.className = "idwall-handle";\n if (additionalClasses) this.node.classList.add(additionalClasses);\n this.parent.appendChild(this.node);\n this.node.style.left = this.point.x - this.node.offsetWidth / 2 + "px";\n this.node.style.top = this.point.y - this.node.offsetWidth / 2 + "px";\n\n var handleCreated = new CustomEvent("handleCreated", {\n detail: [this.point.x, this.point.y]\n });\n document.dispatchEvent(handleCreated);\n }\n\n setDirection(points) {\n for (const [index, point] of points.entries()) {\n if (\n point.x === this.point.x - this.offsetX &&\n point.y === this.point.y - this.offsetY &&\n this.node.id === ""\n ) {\n this.node.id = "direction-" + index;\n }\n }\n }\n\n delete() {\n this.parent.removeChild(this.node);\n this.node = document.createElement("div");\n }\n}\n\nmodule.exports = exports = Handle;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2xpYi9qcy9pZGNyb3AvSGFuZGxlLmpzPzhmNjQiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmNvbnN0IFBvaW50ID0gcmVxdWlyZShcIi4vUG9pbnQuanNcIik7XG5cbi8qXG4gKiBUT0RPOiBDaGFuZ2UgdGhpcyBjbGFzcyB0byBleHRlbmQgSFRNTEVsZW1lbnQgd2hlbiBpdCdzIHN0YWJpbGl6ZWQgYW5kXG4gKiBhdmF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FDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///6\n')},/*!***********************************!*\
function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Point = __webpack_require__(/*! ./Point.js */ 0);\n\n/*\n * TODO: Change this class to extend HTMLElement when it\'s stabilized and\n * available in most browsers. Right now it only works in Chrome.\n * https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements\n */\n\nclass Handle {\n constructor(parent, offsetX, offsetY, point) {\n this.parent = parent;\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n this.point = new Point(point.x + offsetX, point.y + offsetY);\n\n this.node = document.createElement("div");\n }\n\n init(defaultStyles, additionalClasses) {\n if (defaultStyles) this.node.className = "idwall-handle";\n if (additionalClasses) this.node.classList.add(additionalClasses);\n this.parent.appendChild(this.node);\n this.node.style.left = this.point.x - this.node.offsetWidth / 2 + "px";\n this.node.style.top = this.point.y - this.node.offsetWidth / 2 + "px";\n\n var handleCreated = new CustomEvent("handleCreated", {\n detail: [this.point.x, this.point.y]\n });\n document.dispatchEvent(handleCreated);\n }\n\n setDirection(points) {\n for (const [index, point] of points.entries()) {\n if (\n point.x === this.point.x - this.offsetX &&\n point.y === this.point.y - this.offsetY &&\n this.node.id === ""\n ) {\n this.node.id = "direction-" + index;\n }\n }\n }\n\n delete() {\n this.parent.removeChild(this.node);\n this.node = document.createElement("div");\n }\n}\n\nmodule.exports = exports = Handle;\n//# sourceURL=[module]\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ZSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoXCJkaXZcIik7XG4gIH1cbn1cblxubW9kdWxlLmV4cG9ydHMgPSBleHBvcnRzID0gSGFuZGxlO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9saWIvanMvaWRjcm9wL0hhbmRsZS5qc1xuLy8gbW9kdWxlIGlkID0gNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///4\n')},/*!***********************************!*\
!*** ./lib/js/idcrop/CropArea.js ***!

@@ -41,3 +33,3 @@ \***********************************/

/*! all exports used */
function(module,exports,__webpack_require__){"use strict";eval('\n\nconst BgImage = __webpack_require__(/*! ./BgImage.js */ 8);\nconst Polygon = __webpack_require__(/*! ./Polygon.js */ 1);\nconst Point = __webpack_require__(/*! ./Point.js */ 0);\n\nconst helpers = __webpack_require__(/*! ./helpers.js */ 2);\n\nclass CropArea {\n constructor(container, base64) {\n this.container = container;\n this.base64 = base64;\n\n this.canvas = document.createElement("canvas");\n this.isDrawing = false;\n this.img = "";\n }\n\n clearCanvas() {\n this.isDrawing = true;\n\n const context = this.canvas.getContext("2d");\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n\n create() {\n this.clearCanvas();\n\n this.container.innerHTML = "";\n this.container.style.backgroundImage = "url(" + this.base64 + ")";\n this.container.appendChild(this.canvas);\n\n let that = this;\n return helpers.loadImage(this.base64).then(function(img) {\n that.img = new BgImage(img, that.container);\n that.canvas.width = that.img.width;\n that.canvas.height = that.img.height;\n that.canvas.style.left = that.img.left + "px";\n that.canvas.style.top = that.img.top + "px";\n return that.img;\n });\n }\n\n crop(img, preview, points, config) {\n const auxCanvas = document.createElement("canvas");\n\n auxCanvas.width = this.img.realWidth;\n auxCanvas.height = this.img.realHeight;\n\n let realPoints = [];\n for (const point of points) {\n realPoints.push(\n new Point(point.x * this.img.ratio, point.y * this.img.ratio)\n );\n }\n\n const renderer = new Polygon(preview, auxCanvas);\n renderer.drawWithOverlay(\n realPoints,\n config.overlayColor,\n config.stroke,\n config.strokeColor,\n config.strokeDashed,\n config.strokeWeight,\n config.fillColor,\n config.showImage ? img : config.showImage\n );\n\n var base64 = auxCanvas.toDataURL();\n var crop = new CustomEvent("crop", { detail: base64 });\n document.dispatchEvent(crop);\n\n return base64;\n }\n}\n\nmodule.exports = exports = CropArea;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2xpYi9qcy9pZGNyb3AvQ3JvcEFyZWEuanM/YzJhNCJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuY29uc3QgQmdJbWFnZSA9IHJlcXVpcmUoXCIuL0JnSW1hZ2UuanNcIik7XG5jb25zdCBQb2x5Z29uID0gcmVxdWlyZShcIi4vUG9seWdvbi5qc1wiKTtcbmNvbnN0IFBvaW50ID0gcmVxdWlyZShcIi4vUG9pbnQuanNcIik7XG5cbmNvbnN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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///7\n')},/*!**********************************!*\
function(module,exports,__webpack_require__){"use strict";eval('\n\nconst BgImage = __webpack_require__(/*! ./BgImage.js */ 6);\nconst Polygon = __webpack_require__(/*! ./Polygon.js */ 1);\nconst Point = __webpack_require__(/*! ./Point.js */ 0);\n\nconst helpers = __webpack_require__(/*! ./helpers.js */ 2);\n\nclass CropArea {\n constructor(container, base64) {\n this.container = container;\n this.base64 = base64;\n\n this.canvas = document.createElement("canvas");\n this.isDrawing = false;\n this.img = "";\n }\n\n clearCanvas() {\n this.isDrawing = true;\n\n const context = this.canvas.getContext("2d");\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n\n create() {\n this.clearCanvas();\n\n this.container.innerHTML = "";\n this.container.style.backgroundImage = "url(" + this.base64 + ")";\n this.container.appendChild(this.canvas);\n\n let that = this;\n return helpers.loadImage(this.base64).then(function(img) {\n that.img = new BgImage(img, that.container);\n that.canvas.width = that.img.width;\n that.canvas.height = that.img.height;\n that.canvas.style.left = that.img.left + "px";\n that.canvas.style.top = that.img.top + "px";\n return that.img;\n });\n }\n\n crop(img, preview, points, config) {\n const auxCanvas = document.createElement("canvas");\n\n auxCanvas.width = this.img.realWidth;\n auxCanvas.height = this.img.realHeight;\n\n let realPoints = [];\n for (const point of points) {\n realPoints.push(\n new Point(point.x * this.img.ratio, point.y * this.img.ratio)\n );\n }\n\n const renderer = new Polygon(preview, auxCanvas);\n renderer.drawWithOverlay(\n realPoints,\n config.overlayColor,\n config.stroke,\n config.strokeColor,\n config.strokeDashed,\n config.strokeWeight,\n config.fillColor,\n config.showImage ? img : config.showImage\n );\n\n var base64 = auxCanvas.toDataURL();\n var crop = new CustomEvent("crop", { detail: base64 });\n document.dispatchEvent(crop);\n\n return base64;\n }\n}\n\nmodule.exports = exports = CropArea;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2xpYi9qcy9pZGNyb3AvQ3JvcEFyZWEuanM/YzJhNCJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuY29uc3QgQmdJbWFnZSA9IHJlcXVpcmUoXCIuL0JnSW1hZ2UuanNcIik7XG5jb25zdCBQb2x5Z29uID0gcmVxdWlyZShcIi4vUG9seWdvbi5qc1wiKTtcbmNvbnN0IFBvaW50ID0gcmVxdWlyZShcIi4vUG9pbnQuanNcIik7XG5cbmNvbnN0IGhlbHBlcnMgPSByZXF1aXJlKFwiLi9oZWxwZXJzLmpzXCIpO1xuXG5jbGFzcyBDcm9wQXJlYSB7XG4gIGNvbnN0cnVjdG9yKGNvbnRhaW5lciwgYmFzZTY0KSB7XG4gICAgdGhpcy5jb250YWluZXIgPSBjb250YWluZXI7XG4gICAgdGhpcy5iYXNlNjQgPSBiYXNlNjQ7XG5cbiAgICB0aGlzLmNhbnZhcyA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoXCJjYW52YXNcIik7XG4gICAgdGhpcy5pc0RyYXdpbmcgPSBmYWxzZTtcbiAgICB0aGlzLmltZyA9IFwiXCI7XG4gIH1cblxuICBjbGVhckNhbnZhcygpIHtcbiAgICB0aGlzLmlzRHJhd2luZyA9IHRydWU7XG5cbiAgICBjb25zdCBjb250ZXh0ID0gdGhpcy5jYW52YXMuZ2V0Q29udGV4dChcIjJkXCIpO1xuICAgIGNvbnRleHQuY2xlYXJSZWN0KDAsIDAsIHRoaXMuY2FudmFzLndpZHRoLCB0aGlzLmNhbnZhcy5oZWlnaHQpO1xuICAgIGNvbnRleHQuY2xlYXJSZWN0KD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BQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///5\n')},/*!**********************************!*\
!*** ./lib/js/idcrop/BgImage.js ***!

@@ -47,2 +39,2 @@ \**********************************/

/*! all exports used */
function(module,exports,__webpack_require__){"use strict";eval("\n\nclass BgImage {\n constructor(img, container) {\n this.container = container;\n this.img = img;\n }\n\n get realWidth() {\n return this.img.width;\n }\n\n get realHeight() {\n return this.img.height;\n }\n\n get left() {\n return this.calcDimensions().left;\n }\n\n get top() {\n return this.calcDimensions().top;\n }\n\n get width() {\n return this.calcDimensions().width;\n }\n\n get height() {\n return this.calcDimensions().height;\n }\n\n get ratio() {\n return this.realHeight / this.height;\n }\n\n calcDimensions() {\n const bounds = this.container.getBoundingClientRect();\n\n // Possible resized width and height.\n const height = this.realHeight * bounds.width / this.realWidth;\n const width = this.realWidth * bounds.height / this.realHeight;\n\n if (height <= bounds.height) {\n return {\n width: bounds.width,\n height: height,\n top: (bounds.height - height) / 2,\n left: 0\n };\n } else {\n return {\n height: bounds.height,\n width: width,\n top: 0,\n left: (bounds.width - width) / 2\n };\n }\n }\n}\n\nmodule.exports = exports = BgImage;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2xpYi9qcy9pZGNyb3AvQmdJbWFnZS5qcz9iNTk3Il0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5jbGFzcyBCZ0ltYWdlIHtcbiAgY29uc3RydWN0b3IoaW1nLCBjb250YWluZXIpIHtcbiAgICB0aGlzLmNvbnRhaW5lciA9IGNvbnRhaW5lcjtcbiAgICB0aGlzLmltZyA9IGltZztcbiAgfVxuXG4gIGdldCByZWFsV2lkdGgoKSB7XG4gICAgcmV0dXJuIHRoaXMuaW1nLndpZHRoO1xuICB9XG5cbiAgZ2V0IHJlYWxIZWlnaHQoKSB7XG4gICAgcmV0dXJuIHRoaXMuaW1nLmhlaWdodDtcbiAgfVxuXG4gIGdldCBsZWZ0KCkge1xuICAgIHJldHVybiB0aGlzLmNhbGNEaW1lbnNpb25zKCkubGVmdDtcbiAgfVxuXG4gIGdldCB0b3AoKSB7XG4gICAgcmV0dXJuIHRoaXMuY2FsY0RpbWVuc2lvbnMoKS50b3A7XG4gIH1cblxuICBnZXQgd2lkdGgoKSB7XG4gICAgcmV0dXJuIHRoaXMuY2FsY0RpbWVuc2lvbnMoKS53aWR0aDtcbiAgfVxuXG4gIGdldCBoZWlnaHQoKSB7XG4gICAgcmV0dXJuIHRoaXMuY2FsY0RpbWVuc2lvbnMoKS5oZWlnaHQ7XG4gIH1cblxuICBnZXQgcmF0aW8oKSB7XG4gICAgcmV0dXJuIHRoaXMucmVhbEhlaWdodCAvIHRoaXMuaGVpZ2h0O1xuICB9XG5cbiAgY2FsY0RpbWVuc2lvbn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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///8\n")}]);
function(module,exports,__webpack_require__){"use strict";eval("\n\nclass BgImage {\n constructor(img, container) {\n this.container = container;\n this.img = img;\n }\n\n get realWidth() {\n return this.img.width;\n }\n\n get realHeight() {\n return this.img.height;\n }\n\n get left() {\n return this.calcDimensions().left;\n }\n\n get top() {\n return this.calcDimensions().top;\n }\n\n get width() {\n return this.calcDimensions().width;\n }\n\n get height() {\n return this.calcDimensions().height;\n }\n\n get ratio() {\n return this.realHeight / this.height;\n }\n\n calcDimensions() {\n const bounds = this.container.getBoundingClientRect();\n\n // Possible resized width and height.\n const height = this.realHeight * bounds.width / this.realWidth;\n const width = this.realWidth * bounds.height / this.realHeight;\n\n if (height <= bounds.height) {\n return {\n width: bounds.width,\n height: height,\n top: (bounds.height - height) / 2,\n left: 0\n };\n } else {\n return {\n height: bounds.height,\n width: width,\n top: 0,\n left: (bounds.width - width) / 2\n };\n }\n }\n}\n\nmodule.exports = exports = BgImage;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2xpYi9qcy9pZGNyb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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///6\n")}]);

@@ -5,2 +5,2 @@ // Import SCSS files.

// Import JS.
import "./idcrop/IdCrop.js";
import IdCrop from "./idcrop/IdCrop.js";
{
"name": "idcrop",
"version": "2.1.2",
"version": "2.1.3",
"description": "Image cropper utility that crops an image in any polygonal shape chosen and returns a base64 of the cropped area.",

@@ -33,16 +33,16 @@ "main": "index.js",

"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.6.1",
"css-loader": "^0.28.7",
"eslint": "^4.12.1",
"css-loader": "^0.28.11",
"eslint": "^4.19.1",
"eslint-plugin-json": "^1.2.0",
"eslint-plugin-prettier": "^2.3.1",
"eslint-plugin-prettier": "^2.6.0",
"extract-text-webpack-plugin": "^3.0.2",
"node-sass": "^4.6.1",
"prettier": "^1.8.2",
"sass-loader": "^6.0.6",
"node-sass": "^4.8.3",
"prettier": "^1.11.1",
"sass-loader": "^6.0.7",
"style-loader": "^0.19.0",
"webpack": "^3.8.1",
"webpack-dev-server": "^2.9.4"
"webpack": "^3.11.0",
"webpack-dev-server": "^2.11.2"
}
}

@@ -7,2 +7,4 @@ # IdCrop

> Demo: https://idwall.github.io/idcrop/
### Usage

@@ -9,0 +11,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc