1var ue=Object.defineProperty;var he=(n,i,e)=>i in n?ue(n,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[i]=e;var E=(n,i,e)=>he(n,typeof i!="symbol"?i+"":i,e);import{j as f}from"./client-By3tlFYA.js";import{u as ce,r as p,a as ne,ab as fe,i as ge}from"./index-TEHZzOO_.js";import{c as me,d as ve,P as R}from"./short_number-C9zm8Jg6.js";import{h as pe,u as be,_ as _e,a as G,am as $,ai as ye,b2 as xe,I as D,aD as X,aE as Ie,aF as Ee,aG as we,bv as Ne,aI as Me,aN as ke,c as Ce,d as Re,bw as Se,bx as Te,e as Ae,L as He,p as Le,q as De,a5 as Y,ax as je,V as Oe,S as ze}from"./useSelectableClick-CnnB_wkC.js";import{c as W}from"./index-DkCxcZFY.js";import{R as Pe}from"./index-D1zjHkWk.js";import{S as Be}from"./chevron_left-tY77j9LU.js";import{c as Fe,d as Ve,p as Ze}from"./use-gesture-react.esm-DRqc-06E.js";const A=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:"Share again with your followers"},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"}}),Ue=({statusId:n,withOpenButton:i,onClose:e})=>{const{signedIn:a}=pe(),d=ce(),o=me(),u=be(),y=p.useMemo(()=>_e(),[]),r=G(v=>y(v,{id:n})),b=r==null?void 0:r.get("account"),N=G(v=>v.compose.get("text").trim().length!==0),m=p.useCallback(()=>{r&&(a?(e(!0),u(N?$({modalType:"CONFIRM_REPLY",modalProps:{status:r}}):ye(r))):u($({modalType:"INTERACTION",modalProps:{accountId:r.getIn(["account","id"]),url:r.get("uri")}})))},[u,r,a,N,e]),s=p.useCallback(()=>{r&&u(a?xe(r.get("id")):$({modalType:"INTERACTION",modalProps:{accountId:r.getIn(["account","id"]),url:r.get("uri")}}))},[u,r,a]),t=p.useCallback(v=>{v.button!==0||!r||(e(),o.push("/@".concat(b==null?void 0:b.acct,"/").concat(r.get("id"))))},[o,r,b,e]);if(!r)return null;let l,h,g;r.get("in_reply_to_id",null)===null?(l="reply",h=X,g=d.formatMessage(A.reply)):(l="reply-all",h=Me,g=d.formatMessage(A.replyAll));const _=d.formatMessage(r.get("favourited")?A.removeFavourite:A.favourite);return f.jsxs("div",{className:"picture-in-picture__footer",children:[f.jsx(D,{className:"status__action-bar-button",title:g,icon:r.get("in_reply_to_account_id")===r.getIn(["account","id"])?"reply":l,iconComponent:r.get("in_reply_to_account_id")===r.getIn(["account","id"])?X:h,onClick:m,counter:r.get("replies_count")}),f.jsx(Ie,{counters:!0,status:r}),f.jsx(D,{className:"status__action-bar-button star-icon",animate:!0,active:r.get("favourited"),title:_,icon:"star",iconComponent:r.get("favourited")?Ee:we,onClick:s,counter:r.get("favourites_count")}),i&&f.jsx(D,{className:"status__action-bar-button",title:d.formatMessage(A.open),icon:"external-link",iconComponent:Ne,onClick:t,href:"/@".concat(b==null?void 0:b.acct,"/").concat(r.get("id"))})]})};var J={},Q;function $e(){if(Q)return J;Q=1;var n=function(){function e(a,d){for(var o=0;o<d.length;o++){var u=d[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(a,u.key,u)}}return function(a,d,o){return d&&e(a.prototype,d),o&&e(a,o),a}}();function i(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}return function(){if(typeof window>"u"||typeof Element>"u")return;var e=Array.prototype.slice,a=Element.prototype.matches||Element.prototype.msMatchesSelector,d=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","video","[contenteditable]"].join(","),o=function(){function m(s,t){i(this,m),this._inertManager=t,this._rootElement=s,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.forEac
vendor: 5,394 bytes, line 1
1h(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 l=this;r(t,function(v){return l._visitNode(v)});var h=document.activeElement;if(!document.body.contains(t)){for(var g=t,_=void 0;g;){if(g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){_=g;break}g=g.parentNode}_&&(h=_.activeElement)}t.contains(h)&&(h.blur(),h===document.activeElement&&document.body.focus())}},{key:"_visitNode",value:function(t){if(t.nodeType===Node.ELEMENT_NODE){var l=t;l!==this._rootElement&&l.hasAttribute("inert")&&this._adoptInertRoot(l),(a.call(l,d)||l.hasAttribute("tabindex"))&&this._manageNode(l)}}},{key:"_manageNode",value:function(t){var l=this._inertManager.register(t,this);this._managedNodes.add(l)}},{key:"_unmanageNode",value:function(t){var l=this._inertManager.deregister(t,this);l&&this._managedNodes.delete(l)}},{key:"_unmanageSubtree",value:function(t){var l=this;r(t,function(h){return l._unmanageNode(h)})}},{key:"_adoptInertRoot",value:function(t){var l=this._inertManager.getInertRoot(t);l||(this._inertManager.setInert(t,!0),l=this._inertManager.getInertRoot(t)),l.managedNodes.forEach(function(h){this._manageNode(h.node)},this)}},{key:"_onMutation",value:function(t,l){t.forEach(function(h){var g=h.target;if(h.type==="childList")e.call(h.addedNodes).forEach(function(v){this._makeSubtreeUnfocusable(v)},this),e.call(h.removedNodes).forEach(function(v){this._unmanageSubtree(v)},this);else if(h.type==="attributes"){if(h.attributeName==="tabindex")this._manageNode(g);else if(g!==this._rootElement&&h.attributeName==="inert"&&g.hasAttribute("inert")){this._adoptInertRoot(g);var _=this._inertManager.getInertRoot(g);this._managedNodes.forEach(function(v){g.contains(v.node)&&_._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}(),u=function(){function m(s,t){i(this,m),this._node=s,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(a.call(t,d)){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}(),y=function(){function m(s){if(i(this,m),!s)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=s,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),b(s.head||s.body||s.documentElement),s.readyState==="loading"?s.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}return n(m,[{key:"setInert",value:function(t,l){if(l){if(this._inertRoots.has(t))return;var h=new o(t,this);if(t.setAttribute("inert",""),this._inertRoots.set(t,h),!this._document.body.contains(t))for(var g=t.parentNode;g;)g.nodeType===11&&b(g),g=g.parentNode}else{if(!this._inertRoots.has(t))return;var _=this._inertRoots.get(t);_.destructor(),this._inertRoots.delete(t),t.removeAttribute("inert")}}},{key:"getInertRoot",value:function(t){return this._inertRoots.get(t)}},{key:"register",value:function(t,l){var h=this._managedNodes.get(t);return h!==void 0?h.addInertRoot(l):h=new u(t,l),this._managedNodes.set(t,h),h}},{key:"deregister",value:function(t,l){var h=this._managedNodes.get(t);return h?(h.removeInertRoot(l),h.destroyed&&this._managedNodes.delete(t),h):null}},{key:"_onDocumentLoaded",value:function(){var t=e.call(this._document.querySelectorAll("[inert]"));t.forEach(function(l){this.setInert(l,!0)},this),this._observer.observe(this._document.body||this._document.documentElement,{attributes:!0,subtree:!0,childList:!0})}},{key:"_watchForInert",value:function(t,l){var h=this;t.forEach(function(g){switch(g.type){case"childList":e.call(g.addedNodes).forEac
1h(function(w){if(w.nodeType===Node.ELEMENT_NODE){var M=e.call(w.querySelectorAll("[inert]"));a.call(w,"[inert]")&&M.unshift(w),M.forEach(function(c){this.setInert(c,!0)},h)}},h);break;case"attributes":if(g.attributeName!=="inert")return;var _=g.target,v=_.hasAttribute("inert");h.setInert(_,v);break}},this)}}]),m}();function r(m,s,t){if(m.nodeType==Node.ELEMENT_NODE){var l=m;s&&s(l);var h=l.shadowRoot;if(h){r(h,s);return}if(l.localName=="content"){for(var g=l,_=g.getDistributedNodes?g.getDistributedNodes():[],v=0;v<_.length;v++)r(_[v],s);return}if(l.localName=="slot"){for(var w=l,M=w.assignedNodes?w.assignedNodes({flatten:!0}):[],c=0;c<M.length;c++)r(M[c],s);return}}for(var I=m.firstChild;I!=null;)r(I,s),I=I.nextSibling}function b(m){if(!m.querySelector("style#inert-style, link#inert-style")){var s=document.createElement("style");s.setAttribute("id","inert-style"),s.textContent="\n[inert] {\n pointer-events: none;\n cursor: default;\n}\n\n[inert], [inert] * {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n",m.appendChild(s)}}if(!HTMLElement.prototype.hasOwnProperty("inert")){var N=new y(document);Object.defineProperty(HTMLElement.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(s){N.setInert(this,s)}})}}(),J}$e();function Ke(n,i,e){return{r:255*e(n.r/255,i.r/255),g:255*e(n.g/255,i.g/255),b:255*e(n.b/255,i.b/255)}}function qe(n,i){return n*i}function z(n,i,e){return Math.min(Math.max(n||0,i),e)}function K(n){return{r:z(n.r,0,255),g:z(n.g,0,255),b:z(n.b,0,255),a:z(n.a,0,1)}}function ee(n){return{r:255*n.r,g:255*n.g,b:255*n.b,a:n.a}}function We(n){return{r:n.r/255,g:n.g/255,b:n.b/255,a:n.a}}function te(n,i){i===void 0&&(i=0);var e=Math.pow(10,i);return{r:Math.round(n.r*e)/e,g:Math.round(n.g*e)/e,b:Math.round(n.b*e)/e,a:n.a}}function q(n,i,e,a,d,o){return(1-i/e)*a+i/e*Math.round((1-n)*d+n*o)}function Ge(n,i,e,a,d){d===void 0&&(d={unitInput:!1,unitOutput:!1,roundOutput:!0}),d.unitInput&&(n=ee(n),i=ee(i)),n=K(n);var o=(i=K(i)).a+n.a-i.a*n.a,u=e(n,i,a),y=K({r:q(n.a,i.a,o,n.r,i.r,u.r),g:q(n.a,i.a,o,n.g,i.g,u.g),b:q(n.a,i.a,o,n.b,i.b,u.b),a:o});return y=d.unitOutput?We(y):d.roundOutput?te(y):function(r){return te(r,9)}(y),y}function Xe(n,i){return Ge(n,i,Ke,qe)}class Ye extends p.PureComponent{constructor(){super(...arguments);E(this,"activeElement",this.props.children?document.activeElement:null);E(this,"handleKeyUp",e=>{(e.key==="Escape"||e.key==="Esc"||e.keyCode===27)&&this.props.children&&this.props.onClose()});E(this,"handleKeyDown",e=>{if(e.key==="Tab"){const a=Array.from(this.node.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(u=>window.getComputedStyle(u).display!=="none"),d=a.indexOf(e.target);let o;e.shiftKey?o=a[d-1]||a[a.length-1]:o=a[d+1]||a[0],o&&(o.focus(),e.stopPropagation(),e.preventDefault())}});E(this,"getSiblings",()=>Array(...this.node.parentElement.childNodes).filter(e=>e!==this.node));E(this,"setRef",e=>{this.node=e})}componentDidMount(){window.addEventListener("keyup",this.handleKeyUp,!1),window.addEventListener("keydown",this.handleKeyDown,!1),this.history=this.props.history||ve()}UNSAFE_componentWillReceiveProps(e){e.children&&!this.props.children&&(this.activeElement=document.activeElement,this.getSiblings().forEac
1h(a=>a.setAttribute("inert",!0)))}componentDidUpdate(e){!this.props.children&&e.children&&(this.getSiblings().forEach(a=>a.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,a)=>{a==="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:a,hash:d,state:o}=this.history.location;(!o||o.mastodonModalKey!==this._modalHistoryKey)&&this.history.push({pathname:e,search:a,hash:d},{...o,mastodonModalKey:this._modalHistoryKey})}render(){const{children:e,onClose:a}=this.props,d=!!e;if(!d)return f.jsx("div",{className:"modal-root",ref:this.setRef,style:{opacity:0}});let o=null;if(this.props.backgroundColor&&typeof this.props.backgroundColor=="string")o=this.props.backgroundColor;else if(this.props.backgroundColor){const u=Xe({...this.props.backgroundColor,a:1},{r:0,g:0,b:0,a:.7});o="rgb(".concat(u.r,", ").concat(u.g,", ").concat(u.b,")")}return f.jsx("div",{className:"modal-root",ref:this.setRef,children:f.jsxs("div",{style:{pointerEvents:d?"auto":"none"},children:[f.jsx("div",{role:"presentation",className:"modal-root__overlay",onClick:a,style:{backgroundColor:o}}),f.jsx("div",{role:"dialog",className:"modal-root__container",children:e})]})})}}const _t=ke(Ye),ie=p.forwardRef(({src:n,alt:i,lang:e,width:a,height:d,onClick:o,onMouseDown:u,onTouchStart:y},r)=>{const[b,N]=p.useState(!0),m=p.useCallback(()=>{N(!1)},[N]),s=p.useCallback(t=>{t.stopPropagation(),o==null||o(t)},[o]);return f.jsxs("div",{className:"gifv",children:[b&&f.jsx("canvas",{role:"button",tabIndex:0,"aria-label":i,lang:e,onClick:s}),f.jsx("video",{ref:r,src:n,role:"button",tabIndex:0,"aria-label":i,lang:e,width:a,height:d,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,onClick:s,onLoadedData:m,onMouseDown:u,onTouchStart:y})]})});ie.displayName="GIFV";const Je=["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","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],Qe=n=>{let i=0,e;for(const a of n)e=Je.indexOf(a),i=i*83+e;return i},et=n=>({r:Math.max(0,n>>16),g:Math.max(0,n>>8&255),b:Math.max(0,n&255)}),tt=n=>n?et(Qe(n.slice(2,6))):null,L=1,nt=4,it=250,st=(n,i,e,a)=>{const{clientWidth:d,clientHeight:o}=n,{offsetWidth:u,offsetHeight:y}=i,b=(e/a<d/o?"width":"height")==="width"?Math.min(d,e)/u:Math.min(o,a)/y;return{containerWidth:d,containerHeight:o,imageWidth:u,imageHeight:y,initialScale:b}},at=Fe([Ve,Ze]),ot=(n,i)=>{if(!n||i===L)return{left:-1/0,right:1/0,top:-1/0,bottom:1/0};const{containerWidth:e,containerHeight:a,imageWidth:d,imageHeight:o}=n;return{left:-Math.max(d*i-e,0)/2,right:Math.max(d*i-e,0)/2,top:-Math.max(o*i-a,0)/2,bottom:Math.max(o*i-a,0)/2}},rt=({alt:n="",lang:i="",src:e,width:a,height:d,onClick:o,onDoubleClick:u,onClose:y,onZoomChange:r,zoomedIn:b,blurhash:N})=>{p.useEffect(()=>{const x=k=>{k.preventDefault()};return document.addEventListener("gesturestart",x),document.addEventListener("gesturechange",x),document.addEventListener("gestureend",x),()=>{document.removeEventListener("gesturestart",x),document.removeEventListener("gesturechange",x),document.removeEventListener("gestureend",x)}},[]);const[m,s]=p.useState(!1),[t,l]=p.useState(!1),[h,g]=p.useState(!1),_=p.useRef(null),v=p.useRef(null),w=p.useRef(),M=p.useRef(null),[c,I]=Ce(()=>({x:0,y:0,scale:1,onRest:{scale({value:x}){r&&r(x!==L)}}}));at({onDrag({pinching:x,cancel:k,active:T,last:j,offset:[V,C],velocity:[,Z],direction:[,O],tap:U}){if(U){w.current?(clearTimeout(w.current),w.current=null,u==null||u()):w.current=setTimeout(()=>{o==null||o(),w.current=null},it);return}if(!b){if(j){(Z>.5&&O!==0||Math.abs(C)>150)&&(y==null||y()),I.start({y:0,config:Re.wobbly});return}else if(O!==0){I.start({y:C,immediate:!0});return}k();return}if(x){k();return}s(!!T),I.start({x:V,y:C})},onPinch({origin:[x,k],first:T,movement:[j],offset:[V],memo:C}){if(!v.current)return;if(T){const{width:U,height:ae,x:oe,y:re}=v.current.getBoundingClientRect(),de=x-(oe+U/2),le=k-(re+ae/2);C=[c.x.get(),c.y.get(),de,le]}const Z=C[0]-(j-1)*C[2],O=C[1]-(j-1)*C[3];return I.start({scale:V,x:Z,y:O}),C}},{target:v,drag:{from:()=>
1[c.x.get(),c.y.get()],filterTaps:!0,bounds:()=>ot(M.current,c.scale.get()),rubberband:!0},pinch:{scaleBounds:{min:L,max:nt},rubberband:!0}}),p.useEffect(()=>{!t||!_.current||!v.current||(M.current=st(_.current,v.current,a,d),b?c.scale.get()===L&&I.start({scale:M.current.initialScale,x:0,y:0}):I.start({scale:L,x:0,y:0}))},[I,c.scale,b,a,d,t]);const P=p.useCallback(x=>{x.preventDefault(),x.stopPropagation()},[]),B=p.useCallback(()=>{l(!0)},[l]),S=p.useCallback(()=>{g(!0)},[g]),F=Se([c.scale,c.x,c.y],(x,k,T)=>"matrix(".concat(x,", 0, 0, ").concat(x,", ").concat(k,", ").concat(T,")"));return f.jsxs("div",{className:W("zoomable-image",{"zoomable-image--zoomed-in":b,"zoomable-image--error":h,"zoomable-image--dragging":m}),ref:_,children:[!t&&N&&f.jsx("div",{className:"zoomable-image__preview",style:{aspectRatio:"".concat(a,"/").concat(d),height:"min(".concat(d,"px, 100%)")},children:f.jsx(Te,{hash:N})}),f.jsx(Ae.img,{style:{transform:F},ref:v,alt:n,lang:i,src:e,width:a,height:d,draggable:!1,onLoad:B,onError:S,onClickCapture:P}),!t&&!h&&f.jsx(He,{})]})},dt=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"})),lt=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"})),H=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 Le{constructor(){super(...arguments);E(this,"state",{index:null,navigationHidden:!1,zoomedIn:!1});E(this,"handleZoomClick",()=>{this.setState(e=>({zoomedIn:!e.zoomedIn}))});E(this,"handleZoomChange",e=>{this.setState({zoomedIn:e})});E(this,"handleSwipe",e=>{this.setState({index:e%this.props.media.size,zoomedIn:!1})});E(this,"handleTransitionEnd",()=>{this.setState({zoomedIn:!1})});E(this,"handleNextClick",()=>{this.setState({index:(this.getIndex()+1)%this.props.media.size,zoomedIn:!1})});E(this,"handlePrevClick",()=>{this.setState({index:(this.props.media.size+this.getIndex()-1)%this.props.media.size,zoomedIn:!1})});E(this,"handleChangeIndex",e=>{const a=Number(e.currentTarget.getAttribute("data-index"));this.setState({index:a%this.props.media.size,zoomedIn:!1})});E(this,"handleKeyDown",e=>{switch(e.key){case"ArrowLeft":this.handlePrevClick(),e.preventDefault(),e.stopPropagation();break;case"ArrowRight":this.handleNextClick(),e.preventDefault(),e.stopPropagation();break}});E(this,"handleToggleNavigation",()=>{this.setState(e=>({navigationHidden:!e.navigationHidden}))});E(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,a){a.index!==this.state.index&&this._sendBackgroundColor()}_sendBackgroundColor(){const{media:e,onChangeBackgroundColor:a}=this.props,d=this.getIndex(),o=e.getIn([d,"blurhash"]);if(o){const u=tt(o);a(u)}}componentWillUnmount(){window.removeEventListener("keydown",this.handleKeyDown),this.props.onChangeBackgroun
1dColor(null)}getIndex(){return this.state.index!==null?this.state.index:this.props.index}render(){const{media:e,statusId:a,lang:d,intl:o,onClose:u}=this.props,{navigationHidden:y,zoomedIn:r,viewportWidth:b,viewportHeight:N}=this.state,m=this.getIndex(),s=e.size>1&&f.jsx("button",{tabIndex:0,className:"media-modal__nav media-modal__nav--prev",onClick:this.handlePrevClick,"aria-label":o.formatMessage(H.previous),children:f.jsx(Y,{id:"chevron-left",icon:Be})}),t=e.size>1&&f.jsx("button",{tabIndex:0,className:"media-modal__nav media-modal__nav--next",onClick:this.handleNextClick,"aria-label":o.formatMessage(H.next),children:f.jsx(Y,{id:"chevron-right",icon:je})}),l=e.map((c,I)=>{const P=c.getIn(["meta","original","width"])||null,B=c.getIn(["meta","original","height"])||null,S=c.getIn(["translation","description"])||c.get("description");if(c.get("type")==="image")return f.jsx(rt,{src:c.get("url"),blurhash:c.get("blurhash"),width:P,height:B,alt:S,lang:d,onClick:this.handleToggleNavigation,onDoubleClick:this.handleZoomClick,onClose:u,onZoomChange:this.handleZoomChange,zoomedIn:r&&I===m},c.get("url"));if(c.get("type")==="video"){const{currentTime:F,autoPlay:x,volume:k}=this.props;return f.jsx(Oe,{preview:c.get("preview_url"),blurhash:c.get("blurhash"),src:c.get("url"),frameRate:c.getIn(["meta","original","frame_rate"]),aspectRatio:"".concat(c.getIn(["meta","original","width"])," / ").concat(c.getIn(["meta","original","height"])),startTime:F||0,startPlaying:x||!1,startVolume:k||1,onCloseVideo:u,detailed:!0,alt:S,lang:d},c.get("url"))}else if(c.get("type")==="gifv")return f.jsx(ie,{src:c.get("url"),alt:S,lang:d,onClick:this.toggleNavigation},c.get("url"));return null}).toArray(),h={width:"100%",height:"100%"},g={alignItems:"center"},_=W("media-modal__navigation",{"media-modal__navigation--hidden":y});let v;e.size>1&&(v=e.map((c,I)=>f.jsx("button",{className:W("media-modal__page-dot",{active:I===m}),"data-index":I,onClick:this.handleChangeIndex,children:I+1},I)));const w=e.get(m),M=w.get("type")==="image"&&(w.getIn(["meta","original","width"])>b||w.getIn(["meta","original","height"])>N);return f.jsxs("div",{className:"modal-root__modal media-modal",ref:this.setRef,children:[f.jsx("div",{className:"media-modal__closer",role:"presentation",onClick:u,children:f.jsx(Pe,{style:h,containerStyle:g,onChangeIndex:this.handleSwipe,onTransitionEnd:this.handleTransitionEnd,index:m,disabled:fe||r,children:l})}),f.jsxs("div",{className:_,children:[f.jsxs("div",{className:"media-modal__buttons",children:[M&&f.jsx(D,{title:o.formatMessage(r?H.zoomOut:H.zoomIn),iconComponent:r?dt:lt,onClick:this.handleZoomClick}),f.jsx(D,{title:o.formatMessage(H.close),icon:"times",iconComponent:ze,onClick:u})]}),s,t,f.jsxs("div",{className:"media-modal__overlay",children:[v&&f.jsx("ul",{className:"media-modal__pagination",children:v}),a&&f.jsx(Ue,{statusId:a,withOpenButton:!0,onClose:u})]})]})]})}}E(se,"propTypes",{media:De.list.isRequired,statusId:R.string,lang:R.string,index:R.number.isRequired,onClose:R.func.isRequired,intl:R.object.isRequired,onChangeBackgroundColor:R.func.isRequired,currentTime:R.number,autoPlay:R.bool,volume:R.number});const yt=ge(se);export{Ue as F,ie as G,_t as M,rt as Z,yt as a,tt as g}; 2//# sourceMappingURL=media_modal-BV8822ZQ.js.map
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.