PageSourceSearch

https://myroadid.com/_content/Cropper.Blazor/cropper.min.js

js myroadid.com collected 2026-09-27 05:49:57 UTC 33,336 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkCropper_Blazor=self.webpackChunkCropper_Blazor||[]).push([[802],{269(t,e,i){i.d(e,{A:()=>jt});const a="undefined"!=typeof window&&void 0!==window.document,s=a?window:{},n=!(!a||!s.document.documentElement)&&"ontouchstart"in s.document.documentElement,o=!!a&&"PointerEvent"in s,h="cropper",r="all",c="crop",d="move",l="zoom",p="e",m="w",g="s",u="n",f="ne",w="nw",x="se",b="sw",v=`${h}-crop`,y=`${h}-disabled`,M=`${h}-hidden`,C=`${h}-hide`,D=`${h}-invisible`,B=`${h}-modal`,k=`${h}-move`,T=`${h}Action`,W=`${h}Preview`,E="crop",H="move",N="none",L="crop",z="cropend",Y="cropmove",O="cropstart",X="dblclick",R=o?"pointerdown":n?"touchstart":"mousedown",$=o?"pointermove":n?"touchmove":"mousemove",A=o?"pointerup pointercancel":n?"touchend touchcancel":"mouseup",S="ready",I="resize",U="wheel",j="zoom",P="image/jpeg",q=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Q=/^data:/,K=/^data:image\/jpeg;base64,/,Z=/^img|canvas$/i,_={viewMode:0,dragMode:E,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},G=Number.isNaN||s.isNaN;function V(t){return"number"==typeof t&&!G(t)}const F=t=>t>0&&t<1/0;function J(t){return void 0===t}function tt(t){return"object"==typeof t&&null!==t}const{hasOwnProperty:et}=Object.prototype;function it(t){if(!tt(t))return!1;try{const{constructor:e}=t,{prototype:i}=e;return e&&i&&et.call(i,"isPrototypeOf")}catch(t){return!1}}function at(t){return"function"==typeof t}const{slice:st}=Array.prototype;function nt(t){return Array.from?Array.from(t):st.call(t)}function ot(t,e){return t&&at(e)&&(Array.isArray(t)||V(t.length)?nt(t).forEach((i,a)=>{e.call(t,i,a,t)}):tt(t)&&Object.keys(t).forEach(i=>{e.call(t,t[i],i,t)})),t}const ht=Object.assign||function(t,...e){return tt(t)&&e.length>0&&e.forEach(e=>{tt(e)&&Object.keys(e).forEach(i=>{t[i]=e[i]})}),t},rt=/\.\d*(?:0|9){12}\d*$/;function ct(t,e=1e11){return rt.test(t)?Math.round(t*e)/e:t}const dt=/^width|height|left|top|marginLeft|marginTop$/;function lt(t,e){const{style:i}=t;ot(e,(t,e)=>{dt.test(e)&&V(t)&&(t=`${t}px`),i[e]=t})}function pt(t,e){if(!e)return;if(V(t.length))return void ot(t,t=>{pt(t,e)});if(t.classList)return void t.classList.add(e);const i=t.className.trim();i?i.indexOf(e)<0&&(t.className=`${i} ${e}`):t.className=e}function mt(t,e){e&&(V(t.length)?ot(t,t=>{mt(t,e)}):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function gt(t,e,i){e&&(V(t.length)?ot(t,t=>{gt(t,e,i)}):i?pt(t,e):mt(t,e))}const ut=/([a-z\d])([A-Z])/g;function ft(t){return t.replace(ut,"$1-$2").toLowerCase()}function wt(t,e){return tt(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute(`data-${ft(e)}`)}function xt(t,e,i){tt(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute(`data-${ft(e)}`,i)}const bt=/\s\s*/,vt=(()=>{let t=!1;if(a){let e=!1;const i=()=>{},a=Object.defineProperty({},"once",{get:()=>(t=!0,e),set(t){e=t}});s.addEventListener("test",i,a),s.removeEventListener("test",i,a)}return t})();function yt(t,e,i,a={}){let s=i;e.trim().split(bt).forEach(e=>{if(!vt){const{listeners:a}=t;a&&a[e]&&a[e][i]&&(s=a[e][i],delete a[e][i],0===Object.keys(a[e]).length&&delete a[e],0===Object.keys(a).length&&delete t.listeners)}t.removeEventListener(e,s,a)})}function Mt(t,e,i,a={}){let s=i;e.trim().split(bt).forEach(e=>{if(a.once&&!vt){const{listeners:n={}}=t;s=(...o)=>{delete n[e][i],t.removeEventListener(e,s,a),i.apply(t,o)},n[e]||(n[e]={}),n[e][i]&&t.removeEventListener(e,n[e][i],a),n[e][i]=s,t.listeners=n}t.addEventListener(e,s,a)})}function Ct(t,e,i){let a;return at(Event)&&at(CustomEvent)?a=new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0}):(a=document.createEvent("CustomEvent"),a.initCustomEvent(e,!0,!0,i)),t.dis
1patchEvent(a)}function Dt(t){const e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}const{location:Bt}=s,kt=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Tt(t){const e=t.match(kt);return null!==e&&(e[1]!==Bt.protocol||e[2]!==Bt.hostname||e[3]!==Bt.port)}function Wt(t){const e=`timestamp=${(new Date).getTime()}`;return t+(-1===t.indexOf("?")?"?":"&")+e}function Et({rotate:t,scaleX:e,scaleY:i,translateX:a,translateY:s}){const n=[];V(a)&&0!==a&&n.push(`translateX(${a}px)`),V(s)&&0!==s&&n.push(`translateY(${s}px)`),V(t)&&0!==t&&n.push(`rotate(${t}deg)`),V(e)&&1!==e&&n.push(`scaleX(${e})`),V(i)&&1!==i&&n.push(`scaleY(${i})`);const o=n.length?n.join(" "):"none";return{WebkitTransform:o,msTransform:o,transform:o}}function Ht({pageX:t,pageY:e},i){const a={endX:t,endY:e};return i?a:{startX:t,startY:e,...a}}function Nt({aspectRatio:t,height:e,width:i},a="contain"){const s=F(i),n=F(e);if(s&&n){const s=e*t;"contain"===a&&s>i||"cover"===a&&s<i?e=i/t:i=e*t}else s?e=i/t:n&&(i=e*t);return{width:i,height:e}}const{fromCharCode:Lt}=String;const zt=/^data:.*,/;function Yt(t){const e=new DataView(t);let i;try{let t,a,s;if(255===e.getUint8(0)&&216===e.getUint8(1)){const t=e.byteLength;let i=2;for(;i+1<t;){if(255===e.getUint8(i)&&225===e.getUint8(i+1)){a=i;break}i+=1}}if(a){const i=a+10;if("Exif"===function(t,e,i){let a="";i+=e;for(let s=e;s<i;s+=1)a+=Lt(t.getUint8(s));return a}(e,a+4,4)){const a=e.getUint16(i);if(t=18761===a,(t||19789===a)&&42===e.getUint16(i+2,t)){const a=e.getUint32(i+4,t);a>=8&&(s=i+a)}}}if(s){const a=e.getUint16(s,t);let n,o;for(o=0;o<a;o+=1)if(n=s+12*o+2,274===e.getUint16(n,t)){n+=8,i=e.getUint16(n,t),e.setUint16(n,1,t);break}}}catch(t){i=1}return i}const Ot={render(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer(){const{element:t,options:e,container:i,cropper:a}=this,s=Number(e.minContainerWidth),n=Number(e.minContainerHeight);pt(a,M),mt(t,M);const o={width:Math.max(i.offsetWidth,s>=0?s:200),height:Math.max(i.offsetHeight,n>=0?n:100)};this.containerData=o,lt(a,{width:o.width,height:o.height}),pt(t,M),mt(a,M)},initCanvas(){const{containerData:t,imageData:e}=this,{viewMode:i}=this.options,a=Math.abs(e.rotate)%180==90,s=a?e.naturalHeight:e.naturalWidth,n=a?e.naturalWidth:e.naturalHeight,o=s/n;let h=t.width,r=t.height;t.height*o>t.width?3===i?h=t.height*o:r=t.width/o:3===i?r=t.width/o:h=t.height*o;const c={aspectRatio:o,naturalWidth:s,naturalHeight:n,width:h,height:r};this.canvasData=c,this.limited=1===i||2===i,this.limitCanvas(!0,!0),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),c.left=(t.width-c.width)/2,c.top=(t.height-c.height)/2,c.oldLeft=c.left,c.oldTop=c.top,this.initialCanvasData=ht({},c)},limitCanvas(t,e){const{options:i,containerData:a,canvasData:s,cropBoxData:n}=this,{viewMode:o}=i,{aspectRatio:h}=s,r=this.cropped&&n;if(t){let t=Number(i.minCanvasWidth)||0,e=Number(i.minCanvasHeight)||0;o>1?(t=Math.max(t,a.width),e=Math.max(e,a.height),3===o&&(e*h>
1t?t=e*h:e=t/h)):o>0&&(t?t=Math.max(t,r?n.width:0):e?e=Math.max(e,r?n.height:0):r&&(t=n.width,e=n.height,e*h>t?t=e*h:e=t/h)),({width:t,height:e}=Nt({aspectRatio:h,width:t,height:e})),s.minWidth=t,s.minHeight=e,s.maxWidth=1/0,s.maxHeight=1/0}if(e)if(o>(r?0:1)){const t=a.width-s.width,e=a.height-s.height;s.minLeft=Math.min(0,t),s.minTop=Math.min(0,e),s.maxLeft=Math.max(0,t),s.maxTop=Math.max(0,e),r&&this.limited&&(s.minLeft=Math.min(n.left,n.left+(n.width-s.width)),s.minTop=Math.min(n.top,n.top+(n.height-s.height)),s.maxLeft=n.left,s.maxTop=n.top,2===o&&(s.width>=a.width&&(s.minLeft=Math.min(0,t),s.maxLeft=Math.max(0,t)),s.height>=a.height&&(s.minTop=Math.min(0,e),s.maxTop=Math.max(0,e))))}else s.minLeft=-s.width,s.minTop=-s.height,s.maxLeft=a.width,s.maxTop=a.height},renderCanvas(t,e){const{canvasData:i,imageData:a}=this;if(e){const{width:t,height:e}=function({width:t,height:e,degree:i}){if(90==(i=Math.abs(i)%180))return{width:e,height:t};const a=i%90*Math.PI/180,s=Math.sin(a),n=Math.cos(a),o=t*n+e*s,h=t*s+e*n;return i>90?{width:h,height:o}:{width:o,height:h}}({width:a.naturalWidth*Math.abs(a.scaleX||1),height:a.naturalHeight*Math.abs(a.scaleY||1),degree:a.rotate||0}),s=i.width*(t/i.naturalWidth),n=i.height*(e/i.naturalHeight);i.left-=(s-i.width)/2,i.top-=(n-i.height)/2,i.width=s,i.height=n,i.aspectRatio=t/e,i.naturalWidth=t,i.naturalHeight=e,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCanvas(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,lt(this.canvas,ht({width:i.width,height:i.height},Et({translateX:i.left,translateY:i.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage(t){const{canvasData:e,imageData:i}=this,a=i.naturalWidth*(e.width/e.naturalWidth),s=i.naturalHeight*(e.height/e.naturalHeight);ht(i,{width:a,height:s,left:(e.width-a)/2,top:(e.height-s)/2}),lt(this.image,ht({width:i.width,height:i.height},Et(ht({translateX:i.left,translateY:i.top},i)))),t&&this.output()},initCropBox(){const{options:t,canvasData:e}=this,i=t.aspectRatio||t.initialAspectRatio,a=Number(t.autoCropArea)||.8,s={width:e.width,height:e.height};i&&(e.height*i>e.width?s.height=s.width/i:s.width=s.height*i),this.cropBoxData=s,this.limitCropBox(!0,!0),s.width=Math.min(Math.max(s.width,s.minWidth),s.maxWidth),s.height=Math.min(Math.max(s.height,s.minHeight),s.maxHeight),s.width=Math.max(s.minWidth,s.width*a),s.height=Math.max(s.minHeight,s.height*a),s.left=e.left+(e.width-s.width)/2,s.top=e.top+(e.height-s.height)/2,s.oldLeft=s.left,s.oldTop=s.top,this.initialCropBoxData=ht({},s)},limitCropBox(t,e){const{options:i,containerData:a,canvasData:s,cropBoxData:n,limited:o}=this,{aspectRatio:h}=i;if(t){let t=Number(i.minCropBoxWidth)||0,e=Number(i.minCropBoxHeight)||0,r=o?Math.min(a.width,s.width,s.width+s.left,a.width-s.left):a.width,c=o?Math.min(a.height,s.height,s.height+s.top,a.height-s.top):a.height;t=Math.min(t,a.width),e=Math.min(e,a.height),h&&(t&&e?e*h>t?e=t/h:t=e*h:t?e=t/h:e&&(t=e*h),c*h>r?c=r/h:r=c*h),n.minWidth=Math.min(t,r),n.minHeight=Math.min(e,c),n.maxWidth=r,n.maxHeight=c}e&&(o?(n.minLeft=Math.max(0,s.left),n.minTop=Math.max(0,s.top),n.maxLeft=Math.min(a.width,s.left+s.width)-n.width,n.maxTop=Math.min(a.height,s.top+s.height)-n.height):(n.minLeft=0,n.minTop=0,n.maxLeft=a.width-n.width,n.maxTop=a.height-n.height))},renderCropBox(){const{options:t,containerData:e,cropBoxData:i}=this;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,t.movable&&t.cropBoxMovable&&xt(this.face,T,i.width>=e.width&&i.height>=e.height?d:r),lt(this.cropBox,ht({width:i.width,height:i.height},Et({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output(){this.preview(),Ct(this.element,L,this.getData())}},Xt={initPreview(){const{element:t,crossOrigin:e}=this,{preview:i}=this.options,a=e?this.crossOriginUrl:this.url,s=t.alt||"The image to preview",n=document.createElement("img");if(e&&(n.crossOrigin=e),n.src=a,n.alt=s,this.viewBox.appendChild(n),this.viewBoxImage=n,!i)return;let o=i;"string"==typeof i?o=t.ownerDocument.querySelectorAll(i):i.querySelector&&(o=[i]),this.previews=o,ot(
1o,t=>{const i=document.createElement("img");xt(t,W,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),e&&(i.crossOrigin=e),i.src=a,i.alt=s,i.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(i)})},resetPreview(){ot(this.previews,t=>{const e=wt(t,W);lt(t,{width:e.width,height:e.height}),t.innerHTML=e.html,function(t,e){if(tt(t[e]))try{delete t[e]}catch(i){t[e]=void 0}else if(t.dataset)try{delete t.dataset[e]}catch(i){t.dataset[e]=void 0}else t.removeAttribute(`data-${ft(e)}`)}(t,W)})},preview(){const{imageData:t,canvasData:e,cropBoxData:i}=this,{width:a,height:s}=i,{width:n,height:o}=t,h=i.left-e.left-t.left,r=i.top-e.top-t.top;this.cropped&&!this.disabled&&(lt(this.viewBoxImage,ht({width:n,height:o},Et(ht({translateX:-h,translateY:-r},t)))),ot(this.previews,e=>{const i=wt(e,W),c=i.width,d=i.height;let l=c,p=d,m=1;a&&(m=c/a,p=s*m),s&&p>d&&(m=d/s,l=a*m,p=d),lt(e,{width:l,height:p}),lt(e.getElementsByTagName("img")[0],ht({width:n*m,height:o*m},Et(ht({translateX:-h*m,translateY:-r*m},t))))}))}},Rt={bind(){const{element:t,options:e,cropper:i}=this;at(e.cropstart)&&Mt(t,O,e.cropstart),at(e.cropmove)&&Mt(t,Y,e.cropmove),at(e.cropend)&&Mt(t,z,e.cropend),at(e.crop)&&Mt(t,L,e.crop),at(e.zoom)&&Mt(t,j,e.zoom),Mt(i,R,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&Mt(i,U,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Mt(i,X,this.onDblclick=this.dblclick.bind(this)),Mt(t.ownerDocument,$,this.onCropMove=this.cropMove.bind(this)),Mt(t.ownerDocument,A,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&Mt(window,I,this.onResize=this.resize.bind(this))},unbind(){const{element:t,options:e,cropper:i}=this;at(e.cropstart)&&yt(t,O,e.cropstart),at(e.cropmove)&&yt(t,Y,e.cropmove),at(e.cropend)&&yt(t,z,e.cropend),at(e.crop)&&yt(t,L,e.crop),at(e.zoom)&&yt(t,j,e.zoom),yt(i,R,this.onCropStart),e.zoomable&&e.zoomOnWheel&&yt(i,U,this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&yt(i,X,this.onDblclick),yt(t.ownerDocument,$,this.onCropMove),yt(t.ownerDocument,A,this.onCropEnd),e.responsive&&yt(window,I,this.onResize)}},$t={resize(){if(this.disabled)return;const{options:t,container:e,containerData:i}=this,a=e.offsetWidth/i.width,s=e.offsetHeight/i.height,n=Math.abs(a-1)>Math.abs(s-1)?a:s;if(1!==n){let e,i;t.restore&&(e=this.getCanvasData(),i=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(ot(e,(t,i)=>{e[i]=t*n})),this.setCropBoxData(ot(i,(t,e)=>{i[e]=t*n})))}},dblclick(){var t,e;this.disabled||this.options.dragMode===N||this.setDragMode((t=this.dragBox,e=v,(t.classList?t.classList.contains(e):t.className.indexOf(e)>-1)?H:E))},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(t){const{buttons:e,button:i}=t;if(this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(V(e)&&1!==e||V(i)&&0!==i||t.ctrlKey))return;const{options:a,pointers:s}=this;let n;t.changedTouches?ot(t.changedTouches,t=>{s[t.identifier]=Ht(t)}):s[t.pointerId||0]=Ht(t),n=Object.keys(s).length>1&&a.zoomable&&a.zoomOnTouch?l:wt(t.target,T),q.test(n)&&!1!==Ct(this.element,O,{originalEvent:t,action:n})&&(t.preventDefault(),this.action=n,this.cropping=!1,n===c&&(this.cropping=!0,pt(this.dragBox,B)))},cropMove(t){const{action:e}=this;if(this.disabled||!e)return;const{pointers:i}=this;t.preventDefault(),!1!==Ct(this.element,Y,{originalEvent:t,action:e})&&(t.changedTouches?ot(t.changedTouches,t=>{ht(i[t.identifier]||{},Ht(t,!0))}):ht(i[t.pointerId||0]||{},Ht(t,!0)),this.change(t))},cropEnd(t){if(this.disabled)return;const{action:e,pointers:i}=this;t.changedTouches?ot(t.changedTouches,t=>{delete i[t.identifier]}):delete i[t.pointerId||0],e&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,gt(this.dragBox,B,this.cropped&&this.options.modal)),Ct(this.element,z,{originalEvent:t,action:e}))}},At={change(t){const{options:e,canvasData:i,containerData:a,cropBoxData:s,pointers:n}=this;let{action:o}=this,{aspectRatio:h}=e,{left:v,top:y,width:C,height:D}=s;const B=v+C,k=y+D;let T,W=0,E=0,H=a.width,N=a.height,L=!0;!h&&t.shiftKey&&(h=C&&D?C/D:1),this.limited&&(({minLeft:W,minTop:E}=s),H=W+Math.min(a.width,i.width,i.left+i.width),N=E+Math.min(a.height,i.height,i.top+i.height));
1const z=n[Object.keys(n)[0]],Y={x:z.endX-z.startX,y:z.endY-z.startY},O=t=>{switch(t){case p:B+Y.x>H&&(Y.x=H-B);break;case m:v+Y.x<W&&(Y.x=W-v);break;case u:y+Y.y<E&&(Y.y=E-y);break;case g:k+Y.y>N&&(Y.y=N-k)}};switch(o){case r:v+=Y.x,y+=Y.y;break;case p:if(Y.x>=0&&(B>=H||h&&(y<=E||k>=N))){L=!1;break}O(p),C+=Y.x,C<0&&(o=m,C=-C,v-=C),h&&(D=C/h,y+=(s.height-D)/2);break;case u:if(Y.y<=0&&(y<=E||h&&(v<=W||B>=H))){L=!1;break}O(u),D-=Y.y,y+=Y.y,D<0&&(o=g,D=-D,y-=D),h&&(C=D*h,v+=(s.width-C)/2);break;case m:if(Y.x<=0&&(v<=W||h&&(y<=E||k>=N))){L=!1;break}O(m),C-=Y.x,v+=Y.x,C<0&&(o=p,C=-C,v-=C),h&&(D=C/h,y+=(s.height-D)/2);break;case g:if(Y.y>=0&&(k>=N||h&&(v<=W||B>=H))){L=!1;break}O(g),D+=Y.y,D<0&&(o=u,D=-D,y-=D),h&&(C=D*h,v+=(s.width-C)/2);break;case f:if(h){if(Y.y<=0&&(y<=E||B>=H)){L=!1;break}O(u),D-=Y.y,y+=Y.y,C=D*h}else O(u),O(p),Y.x>=0?B<H?C+=Y.x:Y.y<=0&&y<=E&&(L=!1):C+=Y.x,Y.y<=0?y>E&&(D-=Y.y,y+=Y.y):(D-=Y.y,y+=Y.y);C<0&&D<0?(o=b,D=-D,C=-C,y-=D,v-=C):C<0?(o=w,C=-C,v-=C):D<0&&(o=x,D=-D,y-=D);break;case w:if(h){if(Y.y<=0&&(y<=E||v<=W)){L=!1;break}O(u),D-=Y.y,y+=Y.y,C=D*h,v+=s.width-C}else O(u),O(m),Y.x<=0?v>W?(C-=Y.x,v+=Y.x):Y.y<=0&&y<=E&&(L=!1):(C-=Y.x,v+=Y.x),Y.y<=0?y>E&&(D-=Y.y,y+=Y.y):(D-=Y.y,y+=Y.y);C<0&&D<0?(o=x,D=-D,C=-C,y-=D,v-=C):C<0?(o=f,C=-C,v-=C):D<0&&(o=b,D=-D,y-=D);break;case b:if(h){if(Y.x<=0&&(v<=W||k>=N)){L=!1;break}O(m),C-=Y.x,v+=Y.x,D=C/h}else O(g),O(m),Y.x<=0?v>W?(C-=Y.x,v+=Y.x):Y.y>=0&&k>=N&&(L=!1):(C-=Y.x,v+=Y.x),Y.y>=0?k<N&&(D+=Y.y):D+=Y.y;C<0&&D<0?(o=f,D=-D,C=-C,y-=D,v-=C):C<0?(o=x,C=-C,v-=C):D<0&&(o=w,D=-D,y-=D);break;case x:if(h){if(Y.x>=0&&(B>=H||k>=N)){L=!1;break}O(p),C+=Y.x,D=C/h}else O(g),O(p),Y.x>=0?B<H?C+=Y.x:Y.y>=0&&k>=N&&(L=!1):C+=Y.x,Y.y>=0?k<N&&(D+=Y.y):D+=Y.y;C<0&&D<0?(o=w,D=-D,C=-C,y-=D,v-=C):C<0?(o=b,C=-C,v-=C):D<0&&(o=f,D=-D,y-=D);break;case d:this.move(Y.x,Y.y),L=!1;break;case l:this.zoom(function(t){const e={...t};let i=0;return ot(t,(t,a)=>{delete e[a],ot(e,e=>{const a=Math.abs(t.startX-e.startX),s=Math.abs(t.startY-e.startY),n=Math.abs(t.endX-e.endX),o=Math.abs(t.endY-e.endY),h=Math.sqrt(a*a+s*s),r=(Math.sqrt(n*n+o*o)-h)/h;Math.abs(r)>Math.abs(i)&&(i=r)})}),i}(n),t),L=!1;break;case c:if(!Y.x||!Y.y){L=!1;break}T=Dt(this.cropper),v=z.startX-T.left,y=z.startY-T.top,C=s.minWidth,D=s.minHeight,Y.x>0?o=Y.y>0?x:f:Y.x<0&&(v-=C,o=Y.y>0?b:w),Y.y<0&&(y-=D),this.cropped||(mt(this.cropBox,M),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}L&&(s.width=C,s.height=D,s.left=v,s.top=y,this.action=o,this.renderCropBox()),ot(n,t=>{t.startX=t.endX,t.startY=t.endY})}},St={crop(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&pt(this.dragBox,B),mt(this.cropBox,M),this.setCropBoxData(this.initialCropBoxData)),this},reset(){return this.ready&&!this.disabled&&(this.imageData=ht({},this.initialImageData),this.canvasData=ht({},this.initialCanvasData),this.cropBoxData=ht({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear(){return this.cropped&&!this.disabled&&(ht(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),mt(this.dragBox,B),pt(this.cropBox,M)),this},replace(t,e=!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,ot(this.previews,e=>{e.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable(){return this.ready&&this.disabled&&(this.disabled=!1,mt(this.cropper,y)),this},disable(){return this.ready&&!this.disabled&&(this.disabled=!0,pt(this.cropper,y)),this},destroy(){const{element:t}=this;return t[h]?(t[h]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move(t,e=t){const{left:i,top:a}=this.canvasData;return this.moveTo(J(t)?t:i+Number(t),J(e)?e:a+Number(e))},moveTo(t,e=t){const{canvasData:i}=this;let a=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(V(t)&&(i.left=t,a=!0),V(e)&&(i.top=e,a=!0),a&&this.renderCanvas(!0)),this},zoom(t,e){const{canvasData:i}=this;return t=(t=Number(t))<0?1/(1-t):1+t,this.zoomTo(i.width*t/i.naturalWi
1dth,null,e)},zoomTo(t,e,i){const{options:a,canvasData:s}=this,{width:n,height:o,naturalWidth:h,naturalHeight:r}=s;if((t=Number(t))>=0&&this.ready&&!this.disabled&&a.zoomable){const a=h*t,c=r*t;if(!1===Ct(this.element,j,{ratio:t,oldRatio:n/h,originalEvent:i}))return this;if(i){const{pointers:t}=this,e=Dt(this.cropper),h=t&&Object.keys(t).length?function(t){let e=0,i=0,a=0;return ot(t,({startX:t,startY:s})=>{e+=t,i+=s,a+=1}),e/=a,i/=a,{pageX:e,pageY:i}}(t):{pageX:i.pageX,pageY:i.pageY};s.left-=(a-n)*((h.pageX-e.left-s.left)/n),s.top-=(c-o)*((h.pageY-e.top-s.top)/o)}else it(e)&&V(e.x)&&V(e.y)?(s.left-=(a-n)*((e.x-s.left)/n),s.top-=(c-o)*((e.y-s.top)/o)):(s.left-=(a-n)/2,s.top-=(c-o)/2);s.width=a,s.height=c,this.renderCanvas(!0)}return this},rotate(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo(t){return V(t=Number(t))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX(t){const{scaleY:e}=this.imageData;return this.scale(t,V(e)?e:1)},scaleY(t){const{scaleX:e}=this.imageData;return this.scale(V(e)?e:1,t)},scale(t,e=t){const{imageData:i}=this;let a=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(V(t)&&(i.scaleX=t,a=!0),V(e)&&(i.scaleY=e,a=!0),a&&this.renderCanvas(!0,!0)),this},getData(t=!1){const{options:e,imageData:i,canvasData:a,cropBoxData:s}=this;let n;if(this.ready&&this.cropped){n={x:s.left-a.left,y:s.top-a.top,width:s.width,height:s.height};const e=i.width/i.naturalWidth;if(ot(n,(t,i)=>{n[i]=t/e}),t){const t=Math.round(n.y+n.height),e=Math.round(n.x+n.width);n.x=Math.round(n.x),n.y=Math.round(n.y),n.width=e-n.x,n.height=t-n.y}}else n={x:0,y:0,width:0,height:0};return e.rotatable&&(n.rotate=i.rotate||0),e.scalable&&(n.scaleX=i.scaleX||1,n.scaleY=i.scaleY||1),n},setData(t){const{options:e,imageData:i,canvasData:a}=this,s={};if(this.ready&&!this.disabled&&it(t)){let n=!1;e.rotatable&&V(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,n=!0),e.scalable&&(V(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,n=!0),V(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,n=!0)),n&&this.renderCanvas(!0,!0);const o=i.width/i.naturalWidth;V(t.x)&&(s.left=t.x*o+a.left),V(t.y)&&(s.top=t.y*o+a.top),V(t.width)&&(s.width=t.width*o),V(t.height)&&(s.height=t.height*o),this.setCropBoxData(s)}return this},getContainerData(){return this.ready?ht({},this.containerData):{}},getImageData(){return this.sized?ht({},this.imageData):{}},getCanvasData(){const{canvasData:t}=this,e={};return this.ready&&ot(["left","top","width","height","naturalWidth","naturalHeight"],i=>{e[i]=t[i]}),e},setCanvasData(t){const{canvasData:e}=this,{aspectRatio:i}=e;return this.ready&&!this.disabled&&it(t)&&(V(t.left)&&(e.left=t.left),V(t.top)&&(e.top=t.top),V(t.width)?(e.width=t.width,e.height=t.width/i):V(t.height)&&(e.height=t.height,e.width=t.height*i),this.renderCanvas(!0)),this},getCropBoxData(){const{cropBoxData:t}=this;let e;return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData(t){const{cropBoxData:e}=this,{aspectRatio:i}=this.options;let a,s;return this.ready&&this.cropped&&!this.disabled&&it(t)&&(V(t.left)&&(e.left=t.left),V(t.top)&&(e.top=t.top),V(t.width)&&t.width!==e.width&&(a=!0,e.width=t.width),V(t.height)&&t.height!==e.height&&(s=!0,e.height=t.height),i&&(a?e.height=e.width/i:s&&(e.width=e.height*i)),this.renderCropBox()),this},getCroppedCanvas(t={}){if(!this.ready||!window.HTMLCanvasElement)return null;const{canvasData:e}=this,i=function(t,{aspectRatio:e,naturalWidth:i,naturalHeight:a,rotate:s=0,scaleX:n=1,scaleY:o=1},{aspectRatio:h,naturalWidth:r,naturalHeight:c},{fillColor:d="transparent",imageSmoothingEnabled:l=!0,imageSmoothingQuality:p="low",maxWidth:m=1/0,maxHeight:g=1/0,minWidth:u=0,minHeight:f=0}){const w=document.createElement("canvas"),x=w.getContext("2d"),b=Nt({aspectRatio:h,width:m,height:g}),v=Nt({aspectRatio:h,width:u,height:f},"cover"),y=Math.min(b.width,Math.max(v.width,r)),M=Math.min(b.height,Math.max(v.height,c)),C=Nt({aspectRatio:e,width:m,height:g}),D=Nt({aspectRatio:e,width:u,height:f},"cover"),B=Math.min(C.width,Math.max(D.width,i)),k=Math.min(C.height,Math.max(D.height,a)),T=[-B/2,-k/2,B,k];return w.width=ct(y),w.height=ct(M),x.fillStyle=d,x.fillRect(0,0,y,M),x.save(),x.translate(y/2,M/2),x.rotate(s*Math.PI/180),x.scale(n,o),x.imageSmoothingEnabled=l,x.imageSmoothingQuality=p,x.drawImage(t,...T.map(t=>
1Math.floor(ct(t)))),x.restore(),w}(this.image,this.imageData,e,t);if(!this.cropped)return i;let{x:a,y:s,width:n,height:o}=this.getData(t.rounded);const h=i.width/Math.floor(e.naturalWidth);1!==h&&(a*=h,s*=h,n*=h,o*=h);const r=n/o,c=Nt({aspectRatio:r,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),d=Nt({aspectRatio:r,width:t.minWidth||0,height:t.minHeight||0},"cover");let{width:l,height:p}=Nt({aspectRatio:r,width:t.width||(1!==h?i.width:n),height:t.height||(1!==h?i.height:o)});l=Math.min(c.width,Math.max(d.width,l)),p=Math.min(c.height,Math.max(d.height,p));const m=document.createElement("canvas"),g=m.getContext("2d");m.width=ct(l),m.height=ct(p),g.fillStyle=t.fillColor||"transparent",g.fillRect(0,0,l,p);const{imageSmoothingEnabled:u=!0,imageSmoothingQuality:f}=t;g.imageSmoothingEnabled=u,f&&(g.imageSmoothingQuality=f);const w=i.width,x=i.height;let b,v,y,M,C,D,B=a,k=s;B<=-n||B>w?(B=0,b=0,y=0,C=0):B<=0?(y=-B,B=0,b=Math.min(w,n+B),C=b):B<=w&&(y=0,b=Math.min(n,w-B),C=b),b<=0||k<=-o||k>x?(k=0,v=0,M=0,D=0):k<=0?(M=-k,k=0,v=Math.min(x,o+k),D=v):k<=x&&(M=0,v=Math.min(o,x-k),D=v);const T=[B,k,b,v];if(C>0&&D>0){const t=l/n;T.push(y*t,M*t,C*t,D*t)}return g.drawImage(i,...T.map(t=>Math.floor(ct(t)))),m},setAspectRatio(t){const{options:e}=this;return this.disabled||J(t)||(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode(t){const{options:e,dragBox:i,face:a}=this;if(this.ready&&!this.disabled){const s=t===E,n=e.movable&&t===H;t=s||n?t:N,e.dragMode=t,xt(i,T,t),gt(i,v,s),gt(i,k,n),e.cropBoxMovable||(xt(a,T,t),gt(a,v,s),gt(a,k,n))}return this}},It=s.Cropper;class Ut{constructor(t,e={}){if(!t||!Z.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=ht({},_,it(e)&&e),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()}init(){const{element:t}=this,e=t.tagName.toLowerCase();let i;if(!t[h]){if(t[h]=this,"img"===e){if(this.isImg=!0,i=t.getAttribute("src")||"",this.originalUrl=i,!i)return;i=t.src}else"canvas"===e&&window.HTMLCanvasElement&&(i=t.toDataURL());this.load(i)}}load(t){if(!t)return;this.url=t,this.imageData={};const{element:e,options:i}=this;if(i.rotatable||i.scalable||(i.checkOrientation=!1),!i.checkOrientation||!window.ArrayBuffer)return void this.clone();if(Q.test(t))return void(K.test(t)?this.read(function(t){const e=t.replace(zt,""),i=atob(e),a=new ArrayBuffer(i.length),s=new Uint8Array(a);return ot(s,(t,e)=>{s[e]=i.charCodeAt(e)}),a}(t)):this.clone());const a=new XMLHttpRequest,s=this.clone.bind(this);this.reloading=!0,this.xhr=a,a.onabort=s,a.onerror=s,a.ontimeout=s,a.onprogress=()=>{a.getResponseHeader("content-type")!==P&&a.abort()},a.onload=()=>{this.read(a.response)},a.onloadend=()=>{this.reloading=!1,this.xhr=null},i.checkCrossOrigin&&Tt(t)&&e.crossOrigin&&(t=Wt(t)),a.open("GET",t,!0),a.responseType="arraybuffer",a.withCredentials="use-credentials"===e.crossOrigin,a.send()}read(t){const{options:e,imageData:i}=this,a=Yt(t);let s=0,n=1,o=1;a>1&&(this.url=function(t,e){const i=[];let a=new Uint8Array(t);for(;a.length>0;)i.push(Lt.apply(null,nt(a.subarray(0,8192)))),a=a.subarray(8192);return`data:${e};base64,${btoa(i.join(""))}`}(t,P),({rotate:s,scaleX:n,scaleY:o}=function(t){let e=0,i=1,a=1;switch(t){case 2:i=-1;break;case 3:e=-180;break;case 4:a=-1;break;case 5:e=90,a=-1;break;case 6:e=90;break;case 7:e=90,i=-1;break;case 8:e=-90}return{rotate:e,scaleX:i,scaleY:a}}(a))),e.rotatable&&(i.rotate=s),e.scalable&&(i.scaleX=n,i.scaleY=o),this.clone()}clone(){const{element:t,url:e}=this;let{crossOrigin:i}=t,a=e;this.options.checkCrossOrigin&&Tt(e)&&(i||(i="anonymous"),a=Wt(e)),this.crossOrigin=i,this.crossOriginUrl=a;const s=document.createElement("img");i&&(s.crossOrigin=i),s.src=a||e,s.alt=t.alt||"The image to crop",this.image=s,s.onload=this.start.bind(this),s.onerror=this.stop.bind(this),pt(s,C),t.parentNode.insertBefore(s,t.nextSibling)}start(){const{image:t}=this;t.onload=null,t.onerror=null,this.sizing=!0;const e=s.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(s.navigator.userAgent),i=(t,e)=>
1{ht(this.imageData,{naturalWidth:t,naturalHeight:e,aspectRatio:t/e}),this.initialImageData=ht({},this.imageData),this.sizing=!1,this.sized=!0,this.build()};if(t.naturalWidth&&!e)return void i(t.naturalWidth,t.naturalHeight);const a=document.createElement("img"),n=document.body||document.documentElement;this.sizingImage=a,a.onload=()=>{i(a.width,a.height),e||n.removeChild(a)},a.src=t.src,e||(a.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;",n.appendChild(a))}stop(){const{image:t}=this;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}build(){if(!this.sized||this.ready)return;const{element:t,options:e,image:i}=this,a=t.parentNode,s=document.createElement("div");s.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>';const n=s.querySelector(`.${h}-container`),o=n.querySelector(`.${h}-canvas`),c=n.querySelector(`.${h}-drag-box`),d=n.querySelector(`.${h}-crop-box`),l=d.querySelector(`.${h}-face`);this.container=a,this.cropper=n,this.canvas=o,this.dragBox=c,this.cropBox=d,this.viewBox=n.querySelector(`.${h}-view-box`),this.face=l,o.appendChild(i),pt(t,M),a.insertBefore(n,t.nextSibling),mt(i,C),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,pt(d,M),e.guides||pt(d.getElementsByClassName(`${h}-dashed`),M),e.center||pt(d.getElementsByClassName(`${h}-center`),M),e.background&&pt(n,`${h}-bg`),e.highlight||pt(l,D),e.cropBoxMovable&&(pt(l,k),xt(l,T,r)),e.cropBoxResizable||(pt(d.getElementsByClassName(`${h}-line`),M),pt(d.getElementsByClassName(`${h}-point`),M)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),at(e.ready)&&Mt(t,S,e.ready,{once:!0}),Ct(t,S)}unbuild(){if(!this.ready)return;this.ready=!1,this.unbind(),this.resetPreview();const{parentNode:t}=this.cropper;t&&t.removeChild(this.cropper),mt(this.element,M)}uncreate(){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()}static noConflict(){return window.Cropper=It,Ut}static setDefaults(t){ht(_,it(t)&&t)}}ht(Ut.prototype,Ot,Xt,Rt,$t,At,St);const jt=Ut}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.