text: /**
   * skylark-cropperjs - A version of cropperjs that ported to running on skylarkjs.
   * @author Hudaokeji, Inc.
   * @version v0.9.0
   * @link https://github.com/skylark-integration/skylark-cropperjs/
   * @license MIT
   */
  define(["./constants","./utilities"],function(t,e){"use strict";return{resize(){const{options:i,container:s,containerData:n}=this,o=Number(i.minContainerWidth)||t.MIN_CONTAINER_WIDTH,h=Number(i.minContainerHeight)||t.MIN_CONTAINER_HEIGHT;if(this.disabled||n.width<=o||n.height<=h)return;const a=s.offsetWidth/n.width;if(1!==a||s.offsetHeight!==n.height){let t,s;i.restore&&(t=this.getCanvasData(),s=this.getCropBoxData()),this.render(),i.restore&&(this.setCanvasData(e.forEach(t,(e,i)=>{t[i]=e*a})),this.setCropBoxData(e.forEach(s,(t,e)=>{s[e]=t*a})))}},dblclick(){this.disabled||this.options.dragMode===t.DRAG_MODE_NONE||this.setDragMode(e.hasClass(this.dragBox,t.CLASS_CROP)?t.DRAG_MODE_MOVE:t.DRAG_MODE_CROP)},wheel(t){const e=Number(this.options.wheelZoomRatio)||.1;let i=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout(()=>{this.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*e,t)))},cropStart(i){const{buttons:s,button:n}=i;if(this.disabled||("mousedown"===i.type||"pointerdown"===i.type&&"mouse"===i.pointerType)&&(e.isNumber(s)&&1!==s||e.isNumber(n)&&0!==n||i.ctrlKey))return;const{options:o,pointers:h}=this;let a;i.changedTouches?e.forEach(i.changedTouches,t=>{h[t.identifier]=e.getPointer(t)}):h[i.pointerId||0]=e.getPointer(i),a=Object.keys(h).length>1&&o.zoomable&&o.zoomOnTouch?t.ACTION_ZOOM:e.getData(i.target,t.DATA_ACTION),t.REGEXP_ACTIONS.test(a)&&!1!==e.dispatchEvent(this.element,t.EVENT_CROP_START,{originalEvent:i,action:a})&&(i.preventDefault(),this.action=a,this.cropping=!1,a===t.ACTION_CROP&&(this.cropping=!0,e.addClass(this.dragBox,t.CLASS_MODAL)))},cropMove(i){const{action:s}=this;if(this.disabled||!s)return;const{pointers:n}=this;i.preventDefault(),!1!==e.dispatchEvent(this.element,t.EVENT_CROP_MOVE,{originalEvent:i,action:s})&&(i.changedTouches?e.forEach(i.changedTouches,t=>{e.assign(n[t.identifier]||{},e.getPointer(t,!0))}):e.assign(n[i.pointerId||0]||{},e.getPointer(i,!0)),this.change(i))},cropEnd(i){if(this.disabled)return;const{action:s,pointers:n}=this;i.changedTouches?e.forEach(i.changedTouches,t=>{delete n[t.identifier]}):delete n[i.pointerId||0],s&&(i.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,e.toggleClass(this.dragBox,t.CLASS_MODAL,this.cropped&&this.options.modal)),e.dispatchEvent(this.element,t.EVENT_CROP_END,{originalEvent:i,action:s}))}}});
  //# sourceMappingURL=sourcemaps/handlers.js.map
  