Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 832

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
var ue=Object.defineProperty;var ce=(n,i,e)=>i in n?ue(n,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[i]=e;var N=(n,i,e)=>ce(n,typeof i!="symbol"?i+"":i,e);import{j as f}from"./client-wT6vtYO_.js";import{u as he,r as p,d as ne,i as fe}from"./index-BdTwX--g.js";import{c as ge,d as me,P as S}from"./short_number-w3W5phxu.js";import{l as ve,u as pe,Y as be,a as G,af as z,ac as _e,aX as ye,aY as xe,b as A,aN as Y,aO as Ie,aP as Ee,aZ as Ne,aQ as Me,aR as we,aS as Ce,a7 as ke,aT as Re,aU as Se,aV as Te,d as Ae,e as He,a_ as Le,a$ as De,h as je,p as Oe,q as Pe,I as X,aK as ze,V as Be}from"./useSelectableClick-DSv4aXzQ.js";import{c as V}from"./index-DizoKcfL.js";import{R as Ve}from"./index-D7QimMoW.js";import{S as Ze}from"./chevron_left-CnYIoVsW.js";import{S as Fe}from"./close-BsPe8EbX.js";import{m as Ke,x as Ue}from"./initial_state-CaZA8Ule.js";import{c as $e,d as qe,p as We}from"./use-gesture-react.esm-PiBFdzIE.js";import{L as Ge}from"./loading_indicator-CoYIRvVm.js";const T=ne({reply:{id:"status.reply",defaultMessage:"Reply"},replyAll:{id:"status.replyAll",defaultMessage:"Reply to thread"},reblog:{id:"status.reblog",defaultMessage:"Boost"},reblog_private:{id:"status.reblog_private",defaultMessage:"Boost with original visibility"},cancel_reblog_private:{id:"status.cancel_reblog_private",defaultMessage:"Unboost"},cannot_reblog:{id:"status.cannot_reblog",defaultMessage:"This post cannot be boosted"},favourite:{id:"status.favourite",defaultMessage:"Favorite"},removeFavourite:{id:"status.remove_favourite",defaultMessage:"Remove from favorites"},open:{id:"status.open",defaultMessage:"Expand this status"}}),Ye=({statusId:n,withOpenButton:i,onClose:e})=>{const{signedIn:s}=ve(),l=he(),r=ge(),d=pe(),I=p.useMemo(()=>be(),[]),o=G(C=>I(C,{id:n})),_=o==null?void 0:o.get("account"),w=G(C=>C.compose.get("text").trim().length!==0),m=p.useCallback(()=>{o&&(s?(e(!0),d(w?z({modalType:"CONFIRM_REPLY",modalProps:{status:o}}):_e(o))):d(z({modalType:"INTERACTION",modalProps:{type:"reply",accountId:o.getIn(["account","id"]),url:o.get("uri")}})))},[d,o,s,w,e]),a=p.useCallback(()=>{o&&d(s?ye(o.get("id")):z({modalType:"INTERACTION",modalProps:{type:"favourite",accountId:o.getIn(["account","id"]),url:o.get("uri")}}))},[d,o,s]),t=p.useCallback(C=>{o&&d(s?xe(o.get("id"),C.shiftKey):z({modalType:"INTERACTION",modalProps:{type:"reblog",accountId:o.getIn(["account","id"]),url:o.get("uri")}}))},[d,o,s]),c=p.useCallback(C=>{C.button!==0||!o||(e(),r.push(`/@${_==null?void 0:_.acct}/${o.get("id")}`))},[r,o,_,e]);if(!o)return null;const u=["public","unlisted"].includes(o.get("visibility")),g=o.getIn(["account","id"])===Ke&&o.get("visibility")==="private";let b,v,y;o.get("in_reply_to_id",null)===null?(b="reply",v=Y,y=l.formatMessage(T.reply)):(b="reply-all",v=Me,y=l.formatMessage(T.replyAll));let M,h;o.get("reblogged")?(M=l.formatMessage(T.cancel_reblog_private),h=u?we:Ce):u?(M=l.formatMessage(T.reblog),h=ke):g?(M=l.formatMessage(T.reblog_private),h=Re):(M=l.formatMessage(T.cannot_reblog),h=Se);const x=l.formatMessage(o.get("favourited")?T.removeFavourite:T.favourite);return f.jsxs("div",{className:"picture-in-picture__footer",children:[f.jsx(A,{className:"status__action-bar-button",title:y,icon:o.get("in_reply_to_account_id")===o.getIn(["account","id"])?"reply":b,iconComponent:o.get("in_reply_to_account_id")===o.getIn(["account","id"])?Y:v,onClick:m,counter:o.get("replies_count")}),f.jsx(A,{className:V("status__action-bar-button",{reblogPrivate:g}),disabled:!u&&!g,active:o.get("reblogged"),title:M,icon:"retweet",iconComponent:h,onClick:t,counter:o.get("reblogs_count")}),f.jsx(A,{className:"status__action-bar-button star-icon",animate:!0,active:o.get("favourited"),title:x,icon:"star",iconComponent:o.get("favourited")?Ie:Ee,onClick:a,counter:o.get("favourites_count")}),i&&f.jsx(A,{className:"status__action-bar-button",title:l.formatMessage(T.open),icon:"external-link",iconComponent:Ne,onClick:c,href:`/@${_==null?void 0:_.acct}/${o.get("id")}`})]})};var Q={},J;function Xe(){if(J)return Q;J=1;var n=function(){function e(s,l){for(var r=0;r"u"||typeof Element>"u")return;var e=Array.prototype.slice,s=Element.prototype.matches||Element.prototype.msMatchesSelector,l=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","video","[contenteditable]"].join(","),r=function(){function m(a,t){i(this,m),this._inertManager=t,this._rootElement=a,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}return n(m,[{key:"destructor",value:function(){this._observer.disconnect(),this._rootElement&&(this._savedAriaHidden!==null?this._rootElement.setAttribute("aria-hidden",this._savedAriaHidden):this._rootElement.removeAttribute("aria-hidden")),this._managedNodes.forEach(function(t){this._unmanageNode(t.node)},this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}},{key:"_makeSubtreeUnfocusable",value:function(t){var c=this;o(t,function(v){return c._visitNode(v)});var u=document.activeElement;if(!document.body.contains(t)){for(var g=t,b=void 0;g;){if(g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){b=g;break}g=g.parentNode}b&&(u=b.activeElement)}t.contains(u)&&(u.blur(),u===document.activeElement&&document.body.focus())}},{key:"_visitNode",value:function(t){if(t.nodeType===Node.ELEMENT_NODE){var c=t;c!==this._rootElement&&c.hasAttribute("inert")&&this._adoptInertRoot(c),(s.call(c,l)||c.hasAttribute("tabindex"))&&this._manageNode(c)}}},{key:"_manageNode",value:function(t){var c=this._inertManager.register(t,this);this._managedNodes.add(c)}},{key:"_unmanageNode",value:function(t){var c=this._inertManager.deregister(t,this);c&&this._managedNodes.delete(c)}},{key:"_unmanageSubtree",value:function(t){var c=this;o(t,function(u){return c._unmanageNode(u)})}},{key:"_adoptInertRoot",value:function(t){var c=this._inertManager.getInertRoot(t);c||(this._inertManager.setInert(t,!0),c=this._inertManager.getInertRoot(t)),c.managedNodes.forEach(function(u){this._manageNode(u.node)},this)}},{key:"_onMutation",value:function(t,c){t.forEach(function(u){var g=u.target;if(u.type==="childList")e.call(u.addedNodes).forEach(function(v){this._makeSubtreeUnfocusable(v)},this),e.call(u.removedNodes).forEach(function(v){this._unmanageSubtree(v)},this);else if(u.type==="attributes"){if(u.attributeName==="tabindex")this._manageNode(g);else if(g!==this._rootElement&&u.attributeName==="inert"&&g.hasAttribute("inert")){this._adoptInertRoot(g);var b=this._inertManager.getInertRoot(g);this._managedNodes.forEach(function(v){g.contains(v.node)&&b._manageNode(v.node)})}}},this)}},{key:"managedNodes",get:function(){return new Set(this._managedNodes)}},{key:"hasSavedAriaHidden",get:function(){return this._savedAriaHidden!==null}},{key:"savedAriaHidden",set:function(t){this._savedAriaHidden=t},get:function(){return this._savedAriaHidden}}]),m}(),d=function(){function m(a,t){i(this,m),this._node=a,this._overrodeFocusMethod=!1,this._inertRoots=new Set([t]),this._savedTabIndex=null,this._destroyed=!1,this.ensureUntabbable()}return n(m,[{key:"destructor",value:function(){if(this._throwIfDestroyed(),this._node&&this._node.nodeType===Node.ELEMENT_NODE){var t=this._node;this._savedTabIndex!==null?t.setAttribute("tabindex",this._savedTabIndex):t.removeAttribute("tabindex"),this._overrodeFocusMethod&&delete t.focus}this._node=null,this._inertRoots=null,this._destroyed=!0}},{key:"_throwIfDestroyed",value:function(){if(this.destroyed)throw new Error("Trying to access destroyed InertNode")}},{key:"ensureUntabbable",value:function(){if(this.node.nodeType===Node.ELEMENT_NODE){var t=this.node;if(s.call(t,l)){if(t.tabIndex===-1&&this.hasSavedTabIndex)return;t.hasAttribute("tabindex")&&(this._savedTabIndex=t.tabIndex),t.setAttribute("tabindex","-1"),t.nodeType===Node.ELEMENT_NODE&&(t.focus=function(){},this._overrodeFocusMethod=!0)}else t.hasAttribute("tabindex")&&(this._savedTabIndex=t.tabIndex,t.removeAttribute("tabindex"))}}},{key:"addInertRoot",value:function(t){this._throwIfDestroyed(),this._inertRoots.add(t)}},{key:"removeInertRoot",value:function(t){this._throwIfDestroyed(),this._inertRoots.delete(t),this._inertRoots.size===0&&this.destructor()}},{key:"destroyed",get:function(){return this._destroyed}},{key:"hasSavedTabIndex",get:function(){return this._savedTabIndex!==null}},{key:"node",get:function(){return this._throwIfDestroyed(),this._node}},{key:"savedTabIndex",set:function(t){this._throwIfDestroyed(),this._savedTabIndex=t},get:function(){return this._throwIfDestroyed(),this._savedTabIndex}}]),m}(),I=function(){function m(a){if(i(this,m),!a)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=a,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),_(a.head||a.body||a.documentElement),a.readyState==="loading"?a.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}return n(m,[{key:"setInert",value:function(t,c){if(c){if(this._inertRoots.has(t))return;var u=new r(t,this);if(t.setAttribute("inert",""),this._inertRoots.set(t,u),!this._document.body.contains(t))for(var g=t.parentNode;g;)g.nodeType===11&&_(g),g=g.parentNode}else{if(!this._inertRoots.has(t))return;var b=this._inertRoots.get(t);b.destructor(),this._inertRoots.delete(t),t.removeAttribute("inert")}}},{key:"getInertRoot",value:function(t){return this._inertRoots.get(t)}},{key:"register",value:function(t,c){var u=this._managedNodes.get(t);return u!==void 0?u.addInertRoot(c):u=new d(t,c),this._managedNodes.set(t,u),u}},{key:"deregister",value:function(t,c){var u=this._managedNodes.get(t);return u?(u.removeInertRoot(c),u.destroyed&&this._managedNodes.delete(t),u):null}},{key:"_onDocumentLoaded",value:function(){var t=e.call(this._document.querySelectorAll("[inert]"));t.forEach(function(c){this.setInert(c,!0)},this),this._observer.observe(this._document.body||this._document.documentElement,{attributes:!0,subtree:!0,childList:!0})}},{key:"_watchForInert",value:function(t,c){var u=this;t.forEach(function(g){switch(g.type){case"childList":e.call(g.addedNodes).forEach(function(y){if(y.nodeType===Node.ELEMENT_NODE){var M=e.call(y.querySelectorAll("[inert]"));s.call(y,"[inert]")&&M.unshift(y),M.forEach(function(h){this.setInert(h,!0)},u)}},u);break;case"attributes":if(g.attributeName!=="inert")return;var b=g.target,v=b.hasAttribute("inert");u.setInert(b,v);break}},this)}}]),m}();function o(m,a,t){if(m.nodeType==Node.ELEMENT_NODE){var c=m;a&&a(c);var u=c.shadowRoot;if(u){o(u,a);return}if(c.localName=="content"){for(var g=c,b=g.getDistributedNodes?g.getDistributedNodes():[],v=0;v{(e.key==="Escape"||e.key==="Esc"||e.keyCode===27)&&this.props.children&&this.props.onClose()});N(this,"handleKeyDown",e=>{if(e.key==="Tab"){const s=Array.from(this.node.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(d=>window.getComputedStyle(d).display!=="none"),l=s.indexOf(e.target);let r;e.shiftKey?r=s[l-1]||s[s.length-1]:r=s[l+1]||s[0],r&&(r.focus(),e.stopPropagation(),e.preventDefault())}});N(this,"getSiblings",()=>Array(...this.node.parentElement.childNodes).filter(e=>e!==this.node));N(this,"setRef",e=>{this.node=e})}componentDidMount(){window.addEventListener("keyup",this.handleKeyUp,!1),window.addEventListener("keydown",this.handleKeyDown,!1),this.history=this.props.history||me()}UNSAFE_componentWillReceiveProps(e){e.children&&!this.props.children&&(this.activeElement=document.activeElement,this.getSiblings().forEach(s=>s.setAttribute("inert",!0)))}componentDidUpdate(e){!this.props.children&&e.children&&(this.getSiblings().forEach(s=>s.removeAttribute("inert")),Promise.resolve().then(()=>{this.props.ignoreFocus||this.activeElement.focus({preventScroll:!0}),this.activeElement=null}).catch(console.error),this._handleModalClose()),this.props.children&&!e.children&&this._handleModalOpen(),this.props.children&&this._ensureHistoryBuffer()}componentWillUnmount(){window.removeEventListener("keyup",this.handleKeyUp),window.removeEventListener("keydown",this.handleKeyDown)}_handleModalOpen(){this._modalHistoryKey=Date.now(),this.unlistenHistory=this.history.listen((e,s)=>{s==="POP"&&this.props.onClose()})}_handleModalClose(){this.unlistenHistory&&this.unlistenHistory();const{state:e}=this.history.location;e&&e.mastodonModalKey===this._modalHistoryKey&&this.history.goBack()}_ensureHistoryBuffer(){const{pathname:e,search:s,hash:l,state:r}=this.history.location;(!r||r.mastodonModalKey!==this._modalHistoryKey)&&this.history.push({pathname:e,search:s,hash:l},{...r,mastodonModalKey:this._modalHistoryKey})}render(){const{children:e,onClose:s}=this.props,l=!!e;if(!l)return f.jsx("div",{className:"modal-root",ref:this.setRef,style:{opacity:0}});let r=null;if(this.props.backgroundColor&&typeof this.props.backgroundColor=="string")r=this.props.backgroundColor;else if(this.props.backgroundColor){const d=nt({...this.props.backgroundColor,a:1},{r:0,g:0,b:0,a:.7});r=`rgb(${d.r}, ${d.g}, ${d.b})`}return f.jsx("div",{className:"modal-root",ref:this.setRef,children:f.jsxs("div",{style:{pointerEvents:l?"auto":"none"},children:[f.jsx("div",{role:"presentation",className:"modal-root__overlay",onClick:s,style:{backgroundColor:r}}),f.jsx("div",{role:"dialog",className:"modal-root__container",children:e})]})})}}const kt=Te(it),ie=p.forwardRef(({src:n,alt:i,lang:e,width:s,height:l,onClick:r,onMouseDown:d,onTouchStart:I},o)=>{const[_,w]=p.useState(!0),m=p.useCallback(()=>{w(!1)},[w]),a=p.useCallback(t=>{t.stopPropagation(),r==null||r(t)},[r]);return f.jsxs("div",{className:"gifv",children:[_&&f.jsx("canvas",{role:"button",tabIndex:0,"aria-label":i,title:i,lang:e,onClick:a}),f.jsx("video",{ref:o,src:n,role:"button",tabIndex:0,"aria-label":i,title:i,lang:e,width:s,height:l,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,onClick:a,onLoadedData:m,onMouseDown:d,onTouchStart:I})]})});ie.displayName="GIFV";const st=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],at=n=>{let i=0,e;for(const s of n)e=st.indexOf(s),i=i*83+e;return i},ot=n=>({r:Math.max(0,n>>16),g:Math.max(0,n>>8&255),b:Math.max(0,n&255)}),rt=n=>n?ot(at(n.slice(2,6))):null,j=1,lt=4,dt=250,ut=(n,i,e,s)=>{const{clientWidth:l,clientHeight:r}=n,{offsetWidth:d,offsetHeight:I}=i,_=(e/s{if(!n||i===j)return{left:-1/0,right:1/0,top:-1/0,bottom:1/0};const{containerWidth:e,containerHeight:s,imageWidth:l,imageHeight:r}=n;return{left:-Math.max(l*i-e,0)/2,right:Math.max(l*i-e,0)/2,top:-Math.max(r*i-s,0)/2,bottom:Math.max(r*i-s,0)/2}},ft=({alt:n="",lang:i="",src:e,width:s,height:l,onClick:r,onDoubleClick:d,onClose:I,onZoomChange:o,zoomedIn:_,blurhash:w})=>{p.useEffect(()=>{const E=k=>{k.preventDefault()};return document.addEventListener("gesturestart",E),document.addEventListener("gesturechange",E),document.addEventListener("gestureend",E),()=>{document.removeEventListener("gesturestart",E),document.removeEventListener("gesturechange",E),document.removeEventListener("gestureend",E)}},[]);const[m,a]=p.useState(!1),[t,c]=p.useState(!1),[u,g]=p.useState(!1),b=p.useRef(null),v=p.useRef(null),y=p.useRef(),M=p.useRef(null),[h,x]=Ae(()=>({x:0,y:0,scale:1,onRest:{scale({value:E}){o&&o(E!==j)}}}));ct({onDrag({pinching:E,cancel:k,active:L,last:O,offset:[K,R],velocity:[,U],direction:[,P],tap:$}){if($){y.current?(clearTimeout(y.current),y.current=null,d==null||d()):y.current=setTimeout(()=>{r==null||r(),y.current=null},dt);return}if(!_){if(O){(U>.5&&P!==0||Math.abs(R)>150)&&(I==null||I()),x.start({y:0,config:He.wobbly});return}else if(P!==0){x.start({y:R,immediate:!0});return}k();return}if(E){k();return}a(!!L),x.start({x:K,y:R})},onPinch({origin:[E,k],first:L,movement:[O],offset:[K],memo:R}){if(!v.current)return;if(L){const{width:$,height:ae,x:oe,y:re}=v.current.getBoundingClientRect(),le=E-(oe+$/2),de=k-(re+ae/2);R=[h.x.get(),h.y.get(),le,de]}const U=R[0]-(O-1)*R[2],P=R[1]-(O-1)*R[3];return x.start({scale:K,x:U,y:P}),R}},{target:v,drag:{from:()=>[h.x.get(),h.y.get()],filterTaps:!0,bounds:()=>ht(M.current,h.scale.get()),rubberband:!0},pinch:{scaleBounds:{min:j,max:lt},rubberband:!0}}),p.useEffect(()=>{!t||!b.current||!v.current||(M.current=ut(b.current,v.current,s,l),_?h.scale.get()===j&&x.start({scale:M.current.initialScale,x:0,y:0}):x.start({scale:j,x:0,y:0}))},[x,h.scale,_,s,l,t]);const C=p.useCallback(E=>{E.preventDefault(),E.stopPropagation()},[]),Z=p.useCallback(()=>{c(!0)},[c]),H=p.useCallback(()=>{g(!0)},[g]),F=Le([h.scale,h.x,h.y],(E,k,L)=>`matrix(${E}, 0, 0, ${E}, ${k}, ${L})`);return f.jsxs("div",{className:V("zoomable-image",{"zoomable-image--zoomed-in":_,"zoomable-image--error":u,"zoomable-image--dragging":m}),ref:b,children:[!t&&w&&f.jsx("div",{className:"zoomable-image__preview",style:{aspectRatio:`${s}/${l}`,height:`min(${l}px, 100%)`},children:f.jsx(De,{hash:w})}),f.jsx(je.img,{style:{transform:F},role:"presentation",ref:v,alt:n,title:n,lang:i,src:e,width:s,height:l,draggable:!1,onLoad:Z,onError:H,onClickCapture:C}),!t&&!u&&f.jsx(Ge,{})]})},gt=n=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...n},p.createElement("path",{d:"M800-600v-120H680v-80h120q33 0 56.5 23.5T880-720v120h-80Zm-720 0v-120q0-33 23.5-56.5T160-800h120v80H160v120H80Zm600 440v-80h120v-120h80v120q0 33-23.5 56.5T800-160H680Zm-520 0q-33 0-56.5-23.5T80-240v-120h80v120h120v80H160Zm80-160v-320h480v320H240Zm80-80h320v-160H320v160Zm0 0v-160 160Z"})),mt=n=>p.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},p.createElement("path",{d:"M3.1002 20.2C2.46686 20.2 1.9252 19.9833 1.4752 19.55C1.04186 19.1 0.825195 18.5583 0.825195 17.925V6.07499C0.825195 5.44165 1.04186 4.90832 1.4752 4.47499C1.9252 4.02499 2.46686 3.79999 3.1002 3.79999H20.9002C21.5335 3.79999 22.0669 4.02499 22.5002 4.47499C22.9502 4.90832 23.1752 5.44165 23.1752 6.07499V17.925C23.1752 18.5583 22.9502 19.1 22.5002 19.55C22.0669 19.9833 21.5335 20.2 20.9002 20.2H3.1002ZM3.1002 17.925H20.9002V6.07499H3.1002V17.925Z",fill:"black"}),p.createElement("path",{d:"M8.12522 16V9.85782H6.25043V8H10V16H8.12522ZM11.1461 16V14.1422H13.0209V16H11.1461ZM15.1252 16V9.85782H13.2313V8H17V16H15.1252ZM11.1461 12.8578V11H13.0209V12.8578H11.1461Z",fill:"black"})),D=ne({close:{id:"lightbox.close",defaultMessage:"Close"},previous:{id:"lightbox.previous",defaultMessage:"Previous"},next:{id:"lightbox.next",defaultMessage:"Next"},zoomIn:{id:"lightbox.zoom_in",defaultMessage:"Zoom to actual size"},zoomOut:{id:"lightbox.zoom_out",defaultMessage:"Zoom to fit"}});class se extends Oe{constructor(){super(...arguments);N(this,"state",{index:null,navigationHidden:!1,zoomedIn:!1});N(this,"handleZoomClick",()=>{this.setState(e=>({zoomedIn:!e.zoomedIn}))});N(this,"handleZoomChange",e=>{this.setState({zoomedIn:e})});N(this,"handleSwipe",e=>{this.setState({index:e%this.props.media.size,zoomedIn:!1})});N(this,"handleTransitionEnd",()=>{this.setState({zoomedIn:!1})});N(this,"handleNextClick",()=>{this.setState({index:(this.getIndex()+1)%this.props.media.size,zoomedIn:!1})});N(this,"handlePrevClick",()=>{this.setState({index:(this.props.media.size+this.getIndex()-1)%this.props.media.size,zoomedIn:!1})});N(this,"handleChangeIndex",e=>{const s=Number(e.currentTarget.getAttribute("data-index"));this.setState({index:s%this.props.media.size,zoomedIn:!1})});N(this,"handleKeyDown",e=>{switch(e.key){case"ArrowLeft":this.handlePrevClick(),e.preventDefault(),e.stopPropagation();break;case"ArrowRight":this.handleNextClick(),e.preventDefault(),e.stopPropagation();break}});N(this,"handleToggleNavigation",()=>{this.setState(e=>({navigationHidden:!e.navigationHidden}))});N(this,"setRef",e=>{this.setState({viewportWidth:e==null?void 0:e.clientWidth,viewportHeight:e==null?void 0:e.clientHeight})})}componentDidMount(){window.addEventListener("keydown",this.handleKeyDown,!1),this._sendBackgroundColor()}componentDidUpdate(e,s){s.index!==this.state.index&&this._sendBackgroundColor()}_sendBackgroundColor(){const{media:e,onChangeBackgroundColor:s}=this.props,l=this.getIndex(),r=e.getIn([l,"blurhash"]);if(r){const d=rt(r);s(d)}}componentWillUnmount(){window.removeEventListener("keydown",this.handleKeyDown),this.props.onChangeBackgroundColor(null)}getIndex(){return this.state.index!==null?this.state.index:this.props.index}render(){const{media:e,statusId:s,lang:l,intl:r,onClose:d}=this.props,{navigationHidden:I,zoomedIn:o,viewportWidth:_,viewportHeight:w}=this.state,m=this.getIndex(),a=e.size>1&&f.jsx("button",{tabIndex:0,className:"media-modal__nav media-modal__nav--prev",onClick:this.handlePrevClick,"aria-label":r.formatMessage(D.previous),children:f.jsx(X,{id:"chevron-left",icon:Ze})}),t=e.size>1&&f.jsx("button",{tabIndex:0,className:"media-modal__nav media-modal__nav--next",onClick:this.handleNextClick,"aria-label":r.formatMessage(D.next),children:f.jsx(X,{id:"chevron-right",icon:ze})}),c=e.map((h,x)=>{const C=h.getIn(["meta","original","width"])||null,Z=h.getIn(["meta","original","height"])||null,H=h.getIn(["translation","description"])||h.get("description");if(h.get("type")==="image")return f.jsx(ft,{src:h.get("url"),blurhash:h.get("blurhash"),width:C,height:Z,alt:H,lang:l,onClick:this.handleToggleNavigation,onDoubleClick:this.handleZoomClick,onClose:d,onZoomChange:this.handleZoomChange,zoomedIn:o&&x===m},h.get("url"));if(h.get("type")==="video"){const{currentTime:F,autoPlay:E,volume:k}=this.props;return f.jsx(Be,{preview:h.get("preview_url"),blurhash:h.get("blurhash"),src:h.get("url"),frameRate:h.getIn(["meta","original","frame_rate"]),aspectRatio:`${h.getIn(["meta","original","width"])} / ${h.getIn(["meta","original","height"])}`,startTime:F||0,startPlaying:E||!1,startVolume:k||1,onCloseVideo:d,detailed:!0,alt:H,lang:l},h.get("url"))}else if(h.get("type")==="gifv")return f.jsx(ie,{src:h.get("url"),alt:H,lang:l,onClick:this.toggleNavigation},h.get("url"));return null}).toArray(),u={width:"100%",height:"100%"},g={alignItems:"center"},b=V("media-modal__navigation",{"media-modal__navigation--hidden":I});let v;e.size>1&&(v=e.map((h,x)=>f.jsx("button",{className:V("media-modal__page-dot",{active:x===m}),"data-index":x,onClick:this.handleChangeIndex,children:x+1},x)));const y=e.get(m),M=y.get("type")==="image"&&(y.getIn(["meta","original","width"])>_||y.getIn(["meta","original","height"])>w);return f.jsxs("div",{className:"modal-root__modal media-modal",ref:this.setRef,children:[f.jsx("div",{className:"media-modal__closer",role:"presentation",onClick:d,children:f.jsx(Ve,{style:u,containerStyle:g,onChangeIndex:this.handleSwipe,onTransitionEnd:this.handleTransitionEnd,index:m,disabled:Ue||o,children:c})}),f.jsxs("div",{className:b,children:[f.jsxs("div",{className:"media-modal__buttons",children:[M&&f.jsx(A,{title:r.formatMessage(o?D.zoomOut:D.zoomIn),iconComponent:o?gt:mt,onClick:this.handleZoomClick}),f.jsx(A,{title:r.formatMessage(D.close),icon:"times",iconComponent:Fe,onClick:d})]}),a,t,f.jsxs("div",{className:"media-modal__overlay",children:[v&&f.jsx("ul",{className:"media-modal__pagination",children:v}),s&&f.jsx(Ye,{statusId:s,withOpenButton:!0,onClose:d})]})]})]})}}N(se,"propTypes",{media:Pe.list.isRequired,statusId:S.string,lang:S.string,index:S.number.isRequired,onClose:S.func.isRequired,intl:S.object.isRequired,onChangeBackgroundColor:S.func.isRequired,currentTime:S.number,autoPlay:S.bool,volume:S.number});const Rt=fe(se);export{Ye as F,ie as G,kt as M,ft as Z,Rt as a,rt as g}; //# sourceMappingURL=media_modal-Bdm5cOSE.js.map