Backups Created:
/home/teltatz/public_html/wp-admin/admin-wolf.php
/home/teltatz/public_html/wp-content/edit-wolf.php
/home/teltatz/public_html/wp-includes/widgets/class-wp-wolf-widget.php
Savvy
W
olf -
MANAGER
Edit File: profile.min.js
(()=>{var e={2796:(e,t,r)=>{e.exports=r(643)},3264:e=>{"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=r},4518:e=>{var t,r,o,n,a,i,s,c,l,p,d,u,h,m,v,g=!1;function f(){if(!g){g=!0;var e=navigator.userAgent,f=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),w=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(u=/\b(iPhone|iP[ao]d)/.exec(e),h=/\b(iP[ao]d)/.exec(e),p=/Android/i.exec(e),m=/FBAN\/\w+;/i.exec(e),v=/Mobile/i.exec(e),d=!!/Win64/.exec(e),f){(t=f[1]?parseFloat(f[1]):f[5]?parseFloat(f[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var y=/(?:Trident\/(\d+.\d+))/.exec(e);i=y?parseFloat(y[1])+4:t,r=f[2]?parseFloat(f[2]):NaN,o=f[3]?parseFloat(f[3]):NaN,(n=f[4]?parseFloat(f[4]):NaN)?(f=/(?:Chrome\/(\d+\.\d+))/.exec(e),a=f&&f[1]?parseFloat(f[1]):NaN):a=NaN}else t=r=o=a=n=NaN;if(w){if(w[1]){var S=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);s=!S||parseFloat(S[1].replace("_","."))}else s=!1;c=!!w[2],l=!!w[3]}else s=c=l=!1}}var w={ie:function(){return f()||t},ieCompatibilityMode:function(){return f()||i>t},ie64:function(){return w.ie()&&d},firefox:function(){return f()||r},opera:function(){return f()||o},webkit:function(){return f()||n},safari:function(){return w.webkit()},chrome:function(){return f()||a},windows:function(){return f()||c},osx:function(){return f()||s},linux:function(){return f()||l},iphone:function(){return f()||u},mobile:function(){return f()||u||h||p||v},nativeApp:function(){return f()||m},android:function(){return f()||p},ipad:function(){return f()||h}};e.exports=w},6534:(e,t,r)=>{"use strict";var o,n=r(3264);n.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){if(!n.canUseDOM||t&&!("addEventListener"in document))return!1;var r="on"+e,a=r in document;if(!a){var i=document.createElement("div");i.setAttribute(r,"return;"),a="function"==typeof i[r]}return!a&&o&&"wheel"===e&&(a=document.implementation.hasFeature("Events.wheel","3.0")),a}},643:(e,t,r)=>{"use strict";var o=r(4518),n=r(6534);function a(e){var t=0,r=0,o=0,n=0;return"detail"in e&&(r=e.detail),"wheelDelta"in e&&(r=-e.wheelDelta/120),"wheelDeltaY"in e&&(r=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=r,r=0),o=10*t,n=10*r,"deltaY"in e&&(n=e.deltaY),"deltaX"in e&&(o=e.deltaX),(o||n)&&e.deltaMode&&(1==e.deltaMode?(o*=40,n*=40):(o*=800,n*=800)),o&&!t&&(t=o<1?-1:1),n&&!r&&(r=n<1?-1:1),{spinX:t,spinY:r,pixelX:o,pixelY:n}}a.getEventType=function(){return o.firefox()?"DOMMouseScroll":n("wheel")?"wheel":"mousewheel"},e.exports=a}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.React;var t=r.n(e);const o=window.wp.url,n=window.jQuery,a=window.wp.element,i=window.wp.apiFetch;var s=r.n(i);const c=window.wp.i18n;var l=function(e,t){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},l(e,t)},p=function(){return p=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},p.apply(this,arguments)};Object.create,Object.create;var d=r(2796),u=r.n(d);function h(e,t,r,o,n){void 0===n&&(n=0);var a=S(t.width,t.height,n),i=a.width,s=a.height;return{x:m(e.x,i,r.width,o),y:m(e.y,s,r.height,o)}}function m(e,t,r,o){var n=t*o/2-r/2;return C(e,-n,n)}function v(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function g(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function f(e,t){return Math.min(e,Math.max(0,t))}function w(e,t){return t}function y(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function S(e,t,r){var o=r*Math.PI/180;return{width:Math.abs(Math.cos(o)*e)+Math.abs(Math.sin(o)*t),height:Math.abs(Math.sin(o)*e)+Math.abs(Math.cos(o)*t)}}function C(e,t,r){return Math.min(Math.max(e,t),r)}function b(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var _=function(e){function r(){var o=null!==e&&e.apply(this,arguments)||this;return o.imageRef=t().createRef(),o.videoRef=t().createRef(),o.containerRef=null,o.styleRef=null,o.containerRect=null,o.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},o.dragStartPosition={x:0,y:0},o.dragStartCrop={x:0,y:0},o.gestureZoomStart=0,o.gestureRotationStart=0,o.isTouching=!1,o.lastPinchDistance=0,o.lastPinchRotation=0,o.rafDragTimeout=null,o.rafPinchTimeout=null,o.wheelTimer=null,o.currentDoc="undefined"!=typeof document?document:null,o.currentWindow="undefined"!=typeof window?window:null,o.resizeObserver=null,o.state={cropSize:null,hasWheelJustStarted:!1},o.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&o.containerRef){var e=!0;o.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:o.computeSizes()})),o.resizeObserver.observe(o.containerRef)}},o.preventZoomSafari=function(e){return e.preventDefault()},o.cleanEvents=function(){o.currentDoc&&(o.currentDoc.removeEventListener("mousemove",o.onMouseMove),o.currentDoc.removeEventListener("mouseup",o.onDragStopped),o.currentDoc.removeEventListener("touchmove",o.onTouchMove),o.currentDoc.removeEventListener("touchend",o.onDragStopped),o.currentDoc.removeEventListener("gesturemove",o.onGestureMove),o.currentDoc.removeEventListener("gestureend",o.onGestureEnd))},o.clearScrollEvent=function(){o.containerRef&&o.containerRef.removeEventListener("wheel",o.onWheel),o.wheelTimer&&clearTimeout(o.wheelTimer)},o.onMediaLoad=function(){var e=o.computeSizes();e&&(o.emitCropData(),o.setInitialCrop(e)),o.props.onMediaLoaded&&o.props.onMediaLoaded(o.mediaSize)},o.setInitialCrop=function(e){if(o.props.initialCroppedAreaPercentages){var t=function(e,t,r,o,n,a){var i=S(t.width,t.height,r),s=C(o.width/i.width*(100/e.width),n,a);return{crop:{x:s*i.width/2-o.width/2-i.width*s*(e.x/100),y:s*i.height/2-o.height/2-i.height*s*(e.y/100)},zoom:s}}(o.props.initialCroppedAreaPercentages,o.mediaSize,o.props.rotation,e,o.props.minZoom,o.props.maxZoom),r=t.crop,n=t.zoom;o.props.onCropChange(r),o.props.onZoomChange&&o.props.onZoomChange(n)}else if(o.props.initialCroppedAreaPixels){var a=function(e,t,r,o,n,a){void 0===r&&(r=0);var i=S(t.naturalWidth,t.naturalHeight,r),s=C(function(e,t,r){var o=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return r.height>r.width?r.height/(e.height*o):r.width/(e.width*o)}(e,t,o),n,a),c=o.height>o.width?o.height/e.height:o.width/e.width;return{crop:{x:((i.width-e.width)/2-e.x)*c,y:((i.height-e.height)/2-e.y)*c},zoom:s}}(o.props.initialCroppedAreaPixels,o.mediaSize,o.props.rotation,e,o.props.minZoom,o.props.maxZoom);r=a.crop,n=a.zoom,o.props.onCropChange(r),o.props.onZoomChange&&o.props.onZoomChange(n)}},o.computeSizes=function(){var e,t,r,n,a,i,s=o.imageRef.current||o.videoRef.current;if(s&&o.containerRef){o.containerRect=o.containerRef.getBoundingClientRect();var c=o.containerRect.width/o.containerRect.height,l=(null===(e=o.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=o.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,d=(null===(r=o.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(n=o.videoRef.current)||void 0===n?void 0:n.videoHeight)||0,u=l/d,h=void 0;if(s.offsetWidth<l||s.offsetHeight<d)switch(o.props.objectFit){default:case"contain":h=c>u?{width:o.containerRect.height*u,height:o.containerRect.height}:{width:o.containerRect.width,height:o.containerRect.width/u};break;case"horizontal-cover":h={width:o.containerRect.width,height:o.containerRect.width/u};break;case"vertical-cover":h={width:o.containerRect.height*u,height:o.containerRect.height};break;case"auto-cover":h=l>d?{width:o.containerRect.width,height:o.containerRect.width/u}:{width:o.containerRect.height*u,height:o.containerRect.height}}else h={width:s.offsetWidth,height:s.offsetHeight};o.mediaSize=p(p({},h),{naturalWidth:l,naturalHeight:d}),o.props.setMediaSize&&o.props.setMediaSize(o.mediaSize);var m=o.props.cropSize?o.props.cropSize:function(e,t,r,o,n,a){void 0===a&&(a=0);var i=S(e,t,a),s=i.width,c=i.height,l=Math.min(s,r),p=Math.min(c,o);return l>p*n?{width:p*n,height:p}:{width:l,height:l/n}}(o.mediaSize.width,o.mediaSize.height,o.containerRect.width,o.containerRect.height,o.props.aspect,o.props.rotation);return(null===(a=o.state.cropSize)||void 0===a?void 0:a.height)===m.height&&(null===(i=o.state.cropSize)||void 0===i?void 0:i.width)===m.width||o.props.onCropSizeChange&&o.props.onCropSizeChange(m),o.setState({cropSize:m},o.recomputeCropPosition),o.props.setCropSize&&o.props.setCropSize(m),m}},o.onMouseDown=function(e){o.currentDoc&&(e.preventDefault(),o.currentDoc.addEventListener("mousemove",o.onMouseMove),o.currentDoc.addEventListener("mouseup",o.onDragStopped),o.onDragStart(r.getMousePoint(e)))},o.onMouseMove=function(e){return o.onDrag(r.getMousePoint(e))},o.onTouchStart=function(e){o.currentDoc&&(o.isTouching=!0,o.props.onTouchRequest&&!o.props.onTouchRequest(e)||(o.currentDoc.addEventListener("touchmove",o.onTouchMove,{passive:!1}),o.currentDoc.addEventListener("touchend",o.onDragStopped),2===e.touches.length?o.onPinchStart(e):1===e.touches.length&&o.onDragStart(r.getTouchPoint(e.touches[0]))))},o.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?o.onPinchMove(e):1===e.touches.length&&o.onDrag(r.getTouchPoint(e.touches[0]))},o.onGestureStart=function(e){o.currentDoc&&(e.preventDefault(),o.currentDoc.addEventListener("gesturechange",o.onGestureMove),o.currentDoc.addEventListener("gestureend",o.onGestureEnd),o.gestureZoomStart=o.props.zoom,o.gestureRotationStart=o.props.rotation)},o.onGestureMove=function(e){if(e.preventDefault(),!o.isTouching){var t=r.getMousePoint(e),n=o.gestureZoomStart-1+e.scale;if(o.setNewZoom(n,t,{shouldUpdatePosition:!0}),o.props.onRotationChange){var a=o.gestureRotationStart+e.rotation;o.props.onRotationChange(a)}}},o.onGestureEnd=function(e){o.cleanEvents()},o.onDragStart=function(e){var t,r,n=e.x,a=e.y;o.dragStartPosition={x:n,y:a},o.dragStartCrop=p({},o.props.crop),null===(r=(t=o.props).onInteractionStart)||void 0===r||r.call(t)},o.onDrag=function(e){var t=e.x,r=e.y;o.currentWindow&&(o.rafDragTimeout&&o.currentWindow.cancelAnimationFrame(o.rafDragTimeout),o.rafDragTimeout=o.currentWindow.requestAnimationFrame((function(){if(o.state.cropSize&&void 0!==t&&void 0!==r){var e=t-o.dragStartPosition.x,n=r-o.dragStartPosition.y,a={x:o.dragStartCrop.x+e,y:o.dragStartCrop.y+n},i=o.props.restrictPosition?h(a,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):a;o.props.onCropChange(i)}})))},o.onDragStopped=function(){var e,t;o.isTouching=!1,o.cleanEvents(),o.emitCropData(),null===(t=(e=o.props).onInteractionEnd)||void 0===t||t.call(e)},o.onWheel=function(e){if(o.currentWindow&&(!o.props.onWheelRequest||o.props.onWheelRequest(e))){e.preventDefault();var t=r.getMousePoint(e),n=u()(e).pixelY,a=o.props.zoom-n*o.props.zoomSpeed/200;o.setNewZoom(a,t,{shouldUpdatePosition:!0}),o.state.hasWheelJustStarted||o.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=o.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),o.wheelTimer&&clearTimeout(o.wheelTimer),o.wheelTimer=o.currentWindow.setTimeout((function(){return o.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=o.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},o.getPointOnContainer=function(e){var t=e.x,r=e.y;if(!o.containerRect)throw new Error("The Cropper is not mounted");return{x:o.containerRect.width/2-(t-o.containerRect.left),y:o.containerRect.height/2-(r-o.containerRect.top)}},o.getPointOnMedia=function(e){var t=e.x,r=e.y,n=o.props,a=n.crop,i=n.zoom;return{x:(t+a.x)/i,y:(r+a.y)/i}},o.setNewZoom=function(e,t,r){var n=(void 0===r?{}:r).shouldUpdatePosition,a=void 0===n||n;if(o.state.cropSize&&o.props.onZoomChange){var i=C(e,o.props.minZoom,o.props.maxZoom);if(a){var s=o.getPointOnContainer(t),c=o.getPointOnMedia(s),l={x:c.x*i-s.x,y:c.y*i-s.y},p=o.props.restrictPosition?h(l,o.mediaSize,o.state.cropSize,i,o.props.rotation):l;o.props.onCropChange(p)}o.props.onZoomChange(i)}},o.getCropData=function(){return o.state.cropSize?function(e,t,r,o,n,a,i){void 0===a&&(a=0),void 0===i&&(i=!0);var s=i?f:w,c=S(t.width,t.height,a),l=S(t.naturalWidth,t.naturalHeight,a),d={x:s(100,((c.width-r.width/n)/2-e.x/n)/c.width*100),y:s(100,((c.height-r.height/n)/2-e.y/n)/c.height*100),width:s(100,r.width/c.width*100/n),height:s(100,r.height/c.height*100/n)},u=Math.round(s(l.width,d.width*l.width/100)),h=Math.round(s(l.height,d.height*l.height/100)),m=l.width>=l.height*o?{width:Math.round(h*o),height:h}:{width:u,height:Math.round(u/o)};return{croppedAreaPercentages:d,croppedAreaPixels:p(p({},m),{x:Math.round(s(l.width-m.width,d.x*l.width/100)),y:Math.round(s(l.height-m.height,d.y*l.height/100))})}}(o.props.restrictPosition?h(o.props.crop,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):o.props.crop,o.mediaSize,o.state.cropSize,o.getAspect(),o.props.zoom,o.props.rotation,o.props.restrictPosition):null},o.emitCropData=function(){var e=o.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;o.props.onCropComplete&&o.props.onCropComplete(t,r),o.props.onCropAreaChange&&o.props.onCropAreaChange(t,r)}},o.emitCropAreaChange=function(){var e=o.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;o.props.onCropAreaChange&&o.props.onCropAreaChange(t,r)}},o.recomputeCropPosition=function(){if(o.state.cropSize){var e=o.props.restrictPosition?h(o.props.crop,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):o.props.crop;o.props.onCropChange(e),o.emitCropData()}},o}return function(e,t){function __(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(r,e),r.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},r.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},r.prototype.componentDidUpdate=function(e){var t,r,o,n,a,i,s,c,l;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(r=this.props.cropSize)||void 0===r?void 0:r.height)||(null===(o=e.cropSize)||void 0===o?void 0:o.width)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.width)?this.computeSizes():(null===(a=e.crop)||void 0===a?void 0:a.x)===(null===(i=this.props.crop)||void 0===i?void 0:i.x)&&(null===(s=e.crop)||void 0===s?void 0:s.y)===(null===(c=this.props.crop)||void 0===c?void 0:c.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(l=this.videoRef.current)||void 0===l||l.load())},r.prototype.getAspect=function(){var e=this.props,t=e.cropSize,r=e.aspect;return t?t.width/t.height:r},r.prototype.onPinchStart=function(e){var t=r.getTouchPoint(e.touches[0]),o=r.getTouchPoint(e.touches[1]);this.lastPinchDistance=v(t,o),this.lastPinchRotation=g(t,o),this.onDragStart(y(t,o))},r.prototype.onPinchMove=function(e){var t=this;if(this.currentDoc&&this.currentWindow){var o=r.getTouchPoint(e.touches[0]),n=r.getTouchPoint(e.touches[1]),a=y(o,n);this.onDrag(a),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=v(o,n),r=t.props.zoom*(e/t.lastPinchDistance);t.setNewZoom(r,a,{shouldUpdatePosition:!1}),t.lastPinchDistance=e;var i=g(o,n),s=t.props.rotation+(i-t.lastPinchRotation);t.props.onRotationChange&&t.props.onRotationChange(s),t.lastPinchRotation=i}))}},r.prototype.render=function(){var e=this,r=this.props,o=r.image,n=r.video,a=r.mediaProps,i=r.transform,s=r.crop,c=s.x,l=s.y,d=r.rotation,u=r.zoom,h=r.cropShape,m=r.showGrid,v=r.style,g=v.containerStyle,f=v.cropAreaStyle,w=v.mediaStyle,y=r.classes,S=y.containerClassName,C=y.cropAreaClassName,_=y.mediaClassName,E=r.objectFit;return t().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:g,className:b("reactEasyCrop_Container",S)},o?t().createElement("img",p({alt:"",className:b("reactEasyCrop_Image","contain"===E&&"reactEasyCrop_Contain","horizontal-cover"===E&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===E&&"reactEasyCrop_Cover_Vertical","auto-cover"===E&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),_)},a,{src:o,ref:this.imageRef,style:p(p({},w),{transform:i||"translate(".concat(c,"px, ").concat(l,"px) rotate(").concat(d,"deg) scale(").concat(u,")")}),onLoad:this.onMediaLoad})):n&&t().createElement("video",p({autoPlay:!0,loop:!0,muted:!0,className:b("reactEasyCrop_Video","contain"===E&&"reactEasyCrop_Contain","horizontal-cover"===E&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===E&&"reactEasyCrop_Cover_Vertical","auto-cover"===E&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),_)},a,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:p(p({},w),{transform:i||"translate(".concat(c,"px, ").concat(l,"px) rotate(").concat(d,"deg) scale(").concat(u,")")}),controls:!1}),(Array.isArray(n)?n:[{src:n}]).map((function(e){return t().createElement("source",p({key:e.src},e))}))),this.state.cropSize&&t().createElement("div",{style:p(p({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:b("reactEasyCrop_CropArea","round"===h&&"reactEasyCrop_CropAreaRound",m&&"reactEasyCrop_CropAreaGrid",C)}))},r.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},r.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},r.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},r}(t().Component);function E(e){return e*Math.PI/180}const x=document.querySelector(".lp-content-area");let z,M={};const R=e=>{z.style.opacity=.4,wp.apiFetch({path:(0,o.addQueryArgs)("lp/v1/courses/archive-course",e),method:"GET"}).then((e=>{if(void 0!==e.data.content&&(z.innerHTML=e.data.content),x){const t=document.querySelector(".learn-press-pagination");t&&t.remove(),void 0!==e.data.pagination&&x.insertAdjacentHTML("beforeend",e.data.pagination)}})).catch((e=>{console.log(e)})).finally((()=>{if(e.paged){const e={behavior:"smooth"};z.scrollIntoView(e)}z.style.opacity=1}))};document.addEventListener("DOMContentLoaded",(function(e){(()=>{const e=document.querySelectorAll(".learn-press-course-tab__filter__content"),t=(e,t,n=!1,a=!1)=>{wp.apiFetch({path:(0,o.addQueryArgs)("lp/v1/profile/course-tab",t),method:"GET"}).then((o=>{const i=e.querySelector(".lp-skeleton-animation");if(i&&i.remove(),"success"===o.status&&o.data?n?e.innerHTML+=o.data:e.innerHTML=o.data:n?e.innerHTML+=`<div class="lp-ajax-message" style="display:block">${o.message&&o.message}</div>`:e.innerHTML=`<div class="lp-ajax-message" style="display:block">${o.message&&o.message}</div>`,a){a.classList.remove("loading");const e=parseInt(a.dataset.paged);parseInt(a.dataset.number)<=e&&a.remove(),a.dataset.paged=e+1}r(e,t)})).catch((t=>{n?e.innerHTML+=`<div class="lp-ajax-message error" style="display:block">${t.message&&t.message}</div>`:e.innerHTML=`<div class="lp-ajax-message error" style="display:block">${t.message&&t.message}</div>`}))};if("IntersectionObserver"in window){const r=new IntersectionObserver(((e,o)=>{e.forEach((e=>{if(e.isIntersecting){const o=e.target,n=o.parentNode.querySelector(".lp_profile_tab_input_param"),a={...JSON.parse(n.value),status:o.dataset.tab||""};t(o,a),r.unobserve(o)}}))}));[...e].map((e=>{if("all"!==e.dataset.tab)r.observe(e);else{const r=e.parentNode.querySelector(".lp_profile_tab_input_param"),o={...JSON.parse(r.value),status:"all"===e.dataset.tab?"":e.dataset.tab||""};t(e,o)}}))}document.querySelectorAll(".learn-press-course-tab-filters").forEach((e=>{const t=e.querySelectorAll(".learn-press-filters a");t.forEach((r=>{r.addEventListener("click",(o=>{o.preventDefault();const n=r.dataset.tab;[...t].map((e=>{e.classList.remove("active")})),r.classList.add("active"),[...e.querySelectorAll(".learn-press-course-tab__filter__content")].map((e=>{e.style.display="none",e.dataset.tab===n&&(e.style.display="")}))}))}))}));const r=(e,r)=>{const o=e.querySelector("button[data-paged]");o&&o.addEventListener("click",(n=>{n.preventDefault();const a=o&&o.dataset.paged;o.classList.add("loading");const i="list"===r.layout?".lp_profile_course_progress":".learn-press-courses";t(e.querySelector(i),{...r,paged:a},!0,o)}))}})(),(()=>{const e=document.querySelector(".learn-press-profile-course__statistic");if(!e)return;const t=document.querySelector(".lp-profile-nav-tabs li.active");if(!t)return;let r="lp/v1/profile/student/statistic";t.classList.contains("courses")&&(r="lp/v1/profile/instructor/statistic");const n=document.querySelector('[name="args_query_user_courses_statistic"]');if(!n)return;const a=JSON.parse(n.value);var i,s;i=e,s=a,wp.apiFetch({path:(0,o.addQueryArgs)(r,s),method:"GET"}).then((e=>{"success"===e.status&&e.data?i.innerHTML=e.data:i.innerHTML=`<div class="lp-ajax-message error" style="display:block">${e.message&&e.message}</div>`})).catch((e=>{console.log(e)}))})(),function(){const e=n(".order-recover"),t=e.find(".button-recover-order");t.on("click",(()=>{e.find(".learn-press-message").remove(),n(".profile-recover-order").find(".learn-press-message").remove(),n.post({url:"",data:e.serializeJSON(),beforeSend(){t.addClass("loading").attr("disabled","disabled")},success(r){if((r=LP.parseJSON(r)).message){const t=n('<div class="learn-press-message icon"><i class="fa"></i> '+r.message+"</div>");"error"==r.result&&t.addClass("error"),e.before(t)}r.redirect&&(window.location.href=r.redirect),t.removeClass("loading").removeAttr("disabled","")},error(){t.removeClass("loading").removeAttr("disabled","")}})}))}(),function(){if(z=document.querySelector(".learnpress-course-container"),!z)return;const e=JSON.parse(z.querySelector(".lp_profile_data").value);M={...e,c_author:e?.userID,template:"user_not_publish"},R(M),document.addEventListener("click",(function(e){const t=e.target,r=t.closest(".learn-press-pagination");if(!r)return;let o;if("a"===t.tagName.toLowerCase())o=t;else{if(!t.closest("a.page-numbers"))return;o=t.closest("a.page-numbers")}e.preventDefault();const n=parseInt(r.querySelector(".current").innerHTML);let a;a=o.classList.contains("next")?n+1:o.classList.contains("prev")?n-1:o.innerHTML,M={...M,paged:a},R(M)}))}()})),document.getElementById("learnpress-avatar-upload")&&wp.element.render((0,e.createElement)((function(){const[t,r]=(0,a.useState)(),[o,n]=(0,a.useState)(0),[i,l]=(0,a.useState)(0),[p,d]=(0,a.useState)({x:0,y:0}),[u,h]=(0,a.useState)(0),[m,v]=(0,a.useState)(null),[g,f]=(0,a.useState)(0),[w,y]=(0,a.useState)(0),[S,C]=(0,a.useState)(!1),[b,x]=(0,a.useState)(!0),[z,M]=(0,a.useState)(""),[R,D]=(0,a.useState)({type:"",message:""}),P=(0,a.useRef)();(0,a.useEffect)((()=>{!async function(){x(!0);try{const e=await s()({method:"GET",path:"lp/v1/profile/get-avatar"});n(e?.data?.width?parseInt(e.data.width):0),l(e?.data?.height?parseInt(e.data.height):0),r(e?.data?.url?e.data.url:"")}catch(e){D({type:"error",message:e.message})}x(!1)}()}),[]);const L=(0,a.useCallback)(((e,t)=>{v(t)}),[]),T=(0,a.useCallback)((async()=>{C({save:!0});try{const e=await async function(e,t,r=0,o={horizontal:!1,vertical:!1}){const n=await(s=e,new Promise(((e,t)=>{const r=new Image;r.addEventListener("load",(()=>e(r))),r.addEventListener("error",(e=>t(e))),r.setAttribute("crossOrigin","anonymous"),r.src=s}))),a=document.createElement("canvas"),i=a.getContext("2d");var s;if(!i)return null;const c=E(r),{width:l,height:p}=function(e,t,r){const o=E(r);return{width:Math.abs(Math.cos(o)*e)+Math.abs(Math.sin(o)*t),height:Math.abs(Math.sin(o)*e)+Math.abs(Math.cos(o)*t)}}(n.width,n.height,r);a.width=l,a.height=p,i.translate(l/2,p/2),i.rotate(c),i.scale(o.horizontal?-1:1,o.vertical?-1:1),i.translate(-n.width/2,-n.height/2),i.drawImage(n,0,0);const d=i.getImageData(t.x,t.y,t.width,t.height);return a.width=t.width,a.height=t.height,i.putImageData(d,0,0),a.toDataURL("image/jpeg")}(t,m,u),r=await((e,t,r)=>new Promise(((o,n)=>{const a=document.createElement("canvas"),i=document.createElement("img");i.src=e,i.setAttribute("crossOrigin","anonymous"),i.onload=()=>{(i.naturalWidth>t||i.naturalHeight>r)&&(a.width=t,a.height=r,a.getContext("2d").drawImage(i,0,0,t,r),o(a.toDataURL("image/jpeg"))),o(e)},i.onerror=e=>n(e)})))(e,o,i),n=await s()({path:"lp/v1/profile/upload-avatar",method:"POST",data:{file:r||""}}),{data:a,status:c,message:l}=await n;"success"===c&&window.location.reload(),D({type:c,message:l})}catch(e){D({type:"error",message:e.message||""})}C({save:!1})}),[m,u]);return(0,e.createElement)("div",{className:"learnpress_avatar"},b?(0,e.createElement)("ul",{className:"lp-skeleton-animation"},(0,e.createElement)("li",{style:{width:200,height:200}}),(0,e.createElement)("li",{style:{width:200,height:20}}),(0,e.createElement)("li",{style:{width:200,height:20}})):(0,e.createElement)(e.Fragment,null,t&&!z&&(0,e.createElement)(e.Fragment,null,w&&g?(0,e.createElement)("div",{className:"learnpress_avatar__cropper"},(0,e.createElement)("div",{style:{position:"relative",width:g,height:w,zIndex:9999,maxWidth:"100%",maxHeight:"800px"}},(0,e.createElement)(_,{image:t,crop:p,zoom:"1",cropSize:{width:o,height:i},onCropChange:d,onCropComplete:L})),(0,e.createElement)("div",null,(0,e.createElement)("button",{className:"learnpress_avatar__button learnpress_avatar__button--save "+(S?.save?"learnpress_avatar__button--loading":""),onClick:T},lpProfileSettings.text_save))):(0,e.createElement)("div",{className:"learnpress_avatar__cropper"},(0,e.createElement)("img",{src:t,alt:""}),(0,e.createElement)("div",null,(0,e.createElement)("button",{className:"learnpress_avatar__button learnpress_avatar__button--replace",onClick:()=>P.current&&P.current.click()},lpProfileSettings.text_replace),(0,e.createElement)("button",{className:"learnpress_avatar__button learnpress_avatar__button--remove "+(S?.remove?"learnpress_avatar__button--loading":""),onClick:async function(){if(confirm((0,c.__)("Are you sure you want to remove your avatar?","learnpress"))){C({remove:!0});try{const e=await s()({path:"lp/v1/profile/remove-avatar",method:"POST"}),{data:t,status:o,message:n}=await e;D({type:o,message:n}),r("")}catch(e){D({type:"error",message:e.message||""})}C({remove:!1})}}},lpProfileSettings.text_remove)))),(0,e.createElement)("form",{style:{display:t?"none":""}},(0,e.createElement)("div",{className:"learnpress_avatar__form"},(0,e.createElement)("div",{className:"learnpress_avatar__form-group"},(0,e.createElement)("label",{htmlFor:"avatar-file"},(0,e.createElement)("div",{className:"learnpress_avatar__form__upload"},(0,e.createElement)("div",null,(0,e.createElement)("span",null,(0,e.createElement)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"plus",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},(0,e.createElement)("defs",null,(0,e.createElement)("style",null)),(0,e.createElement)("path",{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}),(0,e.createElement)("path",{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"}))),(0,e.createElement)("div",null,lpProfileSettings.text_upload))),(0,e.createElement)("input",{ref:P,type:"file",id:"avatar-file",accept:"image/*",onChange:e=>(async e=>{const t=await function(e){return new Promise((t=>{const r=new FileReader;r.addEventListener("load",(()=>t(r.result)),!1),r.readAsDataURL(e)}))}(e),n=new Image;n.src=await t,n.onload=await(function(){f(n.naturalWidth),y(n.naturalHeight);let a="";parseInt(e.size)>2097152?a=(0,c.__)("The file size is too large. You need to upload a file < 2MB.","learnpress"):(n.naturalWidth<o||n.naturalHeight<i)&&(a=(0,c.sprintf)((0,c.__)("The image size must be greater than or equal to %1$sx%2$spx","learnpress"),o,i)),a?M(a):(M(""),r(t))})})(e.target.files&&e.target.files.length>0?e.target.files[0]:"")}))))),z&&(0,e.createElement)("div",{className:"lp-ajax-message error",style:{display:"block"}},z),!z&&R&&R.type&&R.message&&(0,e.createElement)("div",{className:`lp-ajax-message ${R.type}`,style:{display:"block"}},R.message)))}),null),document.getElementById("learnpress-avatar-upload"))})()})();