lightbox.8ddde1c9.js 30 KB

1
  1. import{d as I,f as a,e as k,E as V,A as E,C as $,B as g9,S as R9,T as P9,a1 as U,a2 as V9,n as $9,G as i9,u as U9,c as G,a as d,p as r9,a3 as c9,F as G9,i as q9,L as d9,j as W9,o as q}from"./index.c685e846.js";import{I as Z9}from"./icon-bell.2e21c889.js";function C(e,s){s===void 0&&(s={});var i=s.insertAt;if(e&&typeof document<"u"){var l=document.head||document.getElementsByTagName("head")[0],m=document.createElement("style");m.type="text/css",i==="top"&&l.firstChild?l.insertBefore(m,l.firstChild):l.appendChild(m),m.styleSheet?m.styleSheet.cssText=e:m.appendChild(document.createTextNode(e))}}C(".vel-fade-enter-active,.vel-fade-leave-active{-webkit-transition:all .3s ease;transition:all .3s ease}.vel-fade-enter-from,.vel-fade-leave-to{opacity:0}.vel-img-swiper{display:block;position:relative}.vel-modal{background:rgba(0,0,0,.5);bottom:0;left:0;margin:0;position:fixed;right:0;top:0;z-index:9998}.vel-img-wrapper{left:50%;margin:0;position:absolute;top:50%;-webkit-transform:translate(-50% -50%);transform:translate(-50% -50%);-webkit-transition:.3s linear;transition:.3s linear;will-change:transform opacity}.vel-img,.vel-img-wrapper{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vel-img{background-color:rgba(0,0,0,.7);-webkit-box-shadow:0 5px 20px 2px rgba(0,0,0,.7);box-shadow:0 5px 20px 2px rgba(0,0,0,.7);display:block;max-height:80vh;max-width:80vw;position:relative;-webkit-transition:-webkit-transform .3s ease-in-out;transition:-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out;transition:transform .3s ease-in-out,-webkit-transform .3s ease-in-out}@media (max-width:750px){.vel-img{max-height:95vh;max-width:85vw}}.vel-btns-wrapper .btn__close,.vel-btns-wrapper .btn__next,.vel-btns-wrapper .btn__prev{-webkit-tap-highlight-color:transparent;color:#fff;cursor:pointer;font-size:32px;opacity:.6;outline:none;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-transition:.15s linear;transition:.15s linear;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vel-btns-wrapper .btn__close:hover,.vel-btns-wrapper .btn__next:hover,.vel-btns-wrapper .btn__prev:hover{opacity:1}.vel-btns-wrapper .btn__close.disable,.vel-btns-wrapper .btn__close.disable:hover,.vel-btns-wrapper .btn__next.disable,.vel-btns-wrapper .btn__next.disable:hover,.vel-btns-wrapper .btn__prev.disable,.vel-btns-wrapper .btn__prev.disable:hover{cursor:default;opacity:.2}.vel-btns-wrapper .btn__next{right:12px}.vel-btns-wrapper .btn__prev{left:12px}.vel-btns-wrapper .btn__close{right:10px;top:24px}@media (max-width:750px){.vel-btns-wrapper .btn__next,.vel-btns-wrapper .btn__prev{font-size:20px}.vel-btns-wrapper .btn__close{font-size:24px}.vel-btns-wrapper .btn__next{right:4px}.vel-btns-wrapper .btn__prev{left:4px}}.vel-modal.is-rtl .vel-btns-wrapper .btn__next{left:12px;right:auto}.vel-modal.is-rtl .vel-btns-wrapper .btn__prev{left:auto;right:12px}@media (max-width:750px){.vel-modal.is-rtl .vel-btns-wrapper .btn__next{left:4px;right:auto}.vel-modal.is-rtl .vel-btns-wrapper .btn__prev{left:auto;right:4px}}.vel-modal.is-rtl .vel-img-title{direction:rtl}");C('.vel-loading{left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.vel-loading .ring{display:inline-block;height:64px;width:64px}.vel-loading .ring:after{-webkit-animation:ring 1.2s linear infinite;animation:ring 1.2s linear infinite;border-color:hsla(0,0%,100%,.7) transparent;border-radius:50%;border-style:solid;border-width:5px;content:" ";display:block;height:46px;margin:1px;width:46px}@-webkit-keyframes ring{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes ring{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}');C(".vel-on-error{left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.vel-on-error .icon{color:#aaa;font-size:80px}");C(".vel-img-title{bottom:60px;color:#ccc;cursor:default;font-size:12px;left:50%;line-height:1;max-width:80%;opacity:.8;overflow:hidden;position:absolute;text-align:center;text-overflow:ellipsis;-webkit-transform:translate(-50%);transform:translate(-50%);-webkit-transition:opacity .15s;transition:opacity .15s;white-space:nowrap}.vel-img-title:hover{opacity:1}");C(".vel-icon{fill:currentColor;height:1em;overflow:hidden;vertical-align:-.15em;width:1em}");C(".vel-toolbar{border-radius:4px;bottom:8px;display:-webkit-box;display:-ms-flexbox;display:flex;left:50%;opacity:.9;overflow:hidden;padding:0;position:absolute;-webkit-transform:translate(-50%);transform:translate(-50%)}.vel-toolbar,.vel-toolbar .toolbar-btn{background-color:#2d2d2d;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vel-toolbar .toolbar-btn{-ms-flex-negative:0;-webkit-tap-highlight-color:transparent;color:#fff;cursor:pointer;flex-shrink:0;font-size:20px;outline:none;padding:6px 10px}.vel-toolbar .toolbar-btn:active,.vel-toolbar .toolbar-btn:hover{background-color:#3d3d3d}"),function(){if(typeof window<"u"){var e=window,s='<svg><symbol id="icon-rotate-right" viewBox="0 0 1024 1024"><path d="M275.199914 450.496179v20.031994c0.384-38.079988 12.543996-67.423979 36.479989-87.967973 22.431993-20.351994 49.215985-30.55999 80.319975-30.55999 32.06399 0 59.295981 10.175997 81.759974 30.55999 22.815993 20.543994 34.591989 49.887984 35.359989 87.967973v123.935961c-0.768 37.887988-12.543996 67.135979-35.359989 87.679973-22.431993 20.351994-49.695984 30.75199-81.759974 31.10399a120.255962 120.255962 0 0 1-72.991978-24.895992c-21.503993-15.839995-35.359989-38.751988-41.567987-68.735979h60.831981c9.247997 23.007993 27.167992 34.495989 53.759983 34.49599 37.535988-0.384 56.863982-21.407993 57.983982-63.071981v-38.751988c-28.095991 8.863997-54.303983 13.119996-78.623975 12.735996a91.263971 91.263971 0 0 1-68.447979-27.711991c-18.847994-18.303994-28.095991-47.231985-27.711991-86.847973z m62.55998 24.863992c7.103998 24.799992 25.215992 37.343988 54.271983 37.663989 27.103992-0.288 44.703986-11.327996 52.831984-33.11999 3.135999-8.383997 2.655999-29.599991-1.28-38.559988-8.607997-19.615994-25.791992-29.695991-51.551984-30.20799-28.383991 0.576-46.303986 12.639996-53.759983 36.159988a58.719982 58.719982 0 0 0-0.512 28.063991z m390.335878 115.711964v-116.895963c-1.12-41.311987-20.447994-62.335981-57.983981-63.07198-37.727988 0.768-56.959982 21.791993-57.695982 63.07198v116.895963c0.768 41.663987 19.999994 62.68798 57.695982 63.071981 37.535988-0.384 56.863982-21.407993 57.983981-63.071981z m-174.815945 3.391999v-123.935961c0.384-38.079988 12.543996-67.423979 36.479989-87.967973 22.431993-20.351994 49.215985-30.55999 80.319975-30.55999 32.06399 0 59.295981 10.175997 81.759974 30.55999 22.815993 20.543994 34.591989 49.887984 35.359989 87.967973v123.935961c-0.768 37.887988-12.543996 67.135979-35.359989 87.679973-22.431993 20.351994-49.695984 30.75199-81.759974 31.10399-31.10399-0.384-57.887982-10.751997-80.319975-31.10399-23.935993-20.543994-36.127989-49.791984-36.479989-87.679973z m282.559912-479.07185A509.887841 509.887841 0 0 0 511.99984 0.00032C229.215928 0.00032 0 229.216248 0 512.00016s229.215928 511.99984 511.99984 511.99984 511.99984-229.215928 511.99984-511.99984c0-3.743999-0.032-7.455998-0.128-11.167997-1.631999-11.295996-8.159997-27.103992-31.87199-27.103991-27.487991 0-31.67999 21.247993-32.03199 32.06399l0.032 4.127999a30.62399 30.62399 0 0 0 0.16 2.079999H959.9997c0 247.423923-200.575937 447.99986-447.99986 447.99986S63.99998 759.424083 63.99998 512.00016 264.575917 64.0003 511.99984 64.0003a446.079861 446.079861 0 0 1 277.439913 96.22397l-94.91197 91.679971c-25.439992 24.607992-17.439995 44.991986 17.887994 45.599986l188.031942 3.295999a64.31998 64.31998 0 0 0 65.055979-62.84798l3.295999-188.127942C969.407697 15.040315 949.311703 5.792318 923.871711 30.368311l-87.999972 85.023973z" fill="" ></path></symbol><symbol id="icon-rotate-left" viewBox="0 0 1024 1024"><path d="M275.199914 450.496179v20.031994c0.384-38.079988 12.543996-67.423979 36.479989-87.967973 22.431993-20.351994 49.215985-30.55999 80.319975-30.55999 32.06399 0 59.295981 10.175997 81.759974 30.55999 22.815993 20.543994 34.591989 49.887984 35.359989 87.967973v123.935961c-0.768 37.887988-12.543996 67.135979-35.359989 87.679973-22.431993 20.351994-49.695984 30.75199-81.759974 31.10399a120.255962 120.255962 0 0 1-72.991978-24.895992c-21.503993-15.839995-35.359989-38.751988-41.567987-68.735979h60.831981c9.247997 23.007993 27.167992 34.495989 53.759983 34.49599 37.535988-0.384 56.863982-21.407993 57.983982-63.071981v-38.751988c-28.095991 8.863997-54.303983 13.119996-78.623975 12.735996a91.263971 91.263971 0 0 1-68.447979-27.711991c-18.847994-18.303994-28.095991-47.231985-27.711991-86.847973z m62.55998 24.863992c7.103998 24.799992 25.215992 37.343988 54.271983 37.663989 27.103992-0.288 44.703986-11.327996 52.831984-33.11999 3.135999-8.383997 2.655999-29.599991-1.28-38.559988-8.607997-19.615994-25.791992-29.695991-51.551984-30.20799-28.383991 0.576-46.303986 12.639996-53.759983 36.159988a58.719982 58.719982 0 0 0-0.512 28.063991z m390.335878 115.711964v-116.895963c-1.12-41.311987-20.447994-62.335981-57.983981-63.07198-37.727988 0.768-56.959982 21.791993-57.695982 63.07198v116.895963c0.768 41.663987 19.999994 62.68798 57.695982 63.071981 37.535988-0.384 56.863982-21.407993 57.983981-63.071981z m-174.815945 3.391999v-123.935961c0.384-38.079988 12.543996-67.423979 36.479989-87.967973 22.431993-20.351994 49.215985-30.55999 80.319975-30.55999 32.06399 0 59.295981 10.175997 81.759974 30.55999 22.815993 20.543994 34.591989 49.887984 35.359989 87.967973v123.935961c-0.768 37.887988-12.543996 67.135979-35.359989 87.679973-22.431993 20.351994-49.695984 30.75199-81.759974 31.10399-31.10399-0.384-57.887982-10.751997-80.319975-31.10399-23.935993-20.543994-36.127989-49.791984-36.479989-87.679973zM188.159941 115.392284A509.887841 509.887841 0 0 1 511.99984 0.00032c282.783912 0 511.99984 229.215928 511.99984 511.99984s-229.215928 511.99984-511.99984 511.99984S0 794.784072 0 512.00016c0-3.743999 0.032-7.455998 0.128-11.167997 1.631999-11.295996 8.159997-27.103992 31.87199-27.103991 27.487991 0 31.67999 21.247993 32.03199 32.06399L63.99998 509.920161a30.62399 30.62399 0 0 1-0.16 2.079999H63.99998c0 247.423923 200.575937 447.99986 447.99986 447.99986s447.99986-200.575937 447.99986-447.99986S759.423763 64.0003 511.99984 64.0003a446.079861 446.079861 0 0 0-277.439913 96.22397l94.91197 91.679971c25.439992 24.607992 17.439995 44.991986-17.887994 45.599986L123.551961 300.800226a64.31998 64.31998 0 0 1-65.055979-62.84798l-3.295999-188.127942C54.591983 15.040315 74.687977 5.792318 100.127969 30.368311l87.999972 85.023973z" fill="" ></path></symbol><symbol id="icon-resize" viewBox="0 0 1024 1024"><path d="M456.036919 791.8108 270.553461 791.8108 460.818829 601.572038l-39.593763-39.567157L231.314785 751.915162l0.873903-183.953615c0-15.465227-12.515035-27.981285-27.981285-27.981285s-27.981285 12.515035-27.981285 27.981285l0 251.829516c0 8.3072 3.415796 14.975063 8.826016 19.564591 5.082762 5.192256 12.132318 8.416693 19.947308 8.416693l251.036453 0c15.46625 0 27.981285-12.514012 27.981285-27.981285C484.018204 804.325835 471.504192 791.8108 456.036919 791.8108zM838.945819 184.644347c-5.082762-5.191232-12.132318-8.416693-19.947308-8.416693L567.961034 176.227654c-15.46625 0-27.981285 12.515035-27.981285 27.981285 0 15.46625 12.514012 27.981285 27.981285 27.981285l185.483458 0L563.206754 422.427962l39.567157 39.567157 189.910281-189.910281-0.873903 183.953615c0 15.46625 12.514012 27.981285 27.981285 27.981285s27.981285-12.514012 27.981285-27.981285L847.772858 204.208938C847.771835 195.902762 844.356039 189.234899 838.945819 184.644347zM847.771835 64.303538 176.227142 64.303538c-61.809741 0-111.924115 50.115398-111.924115 111.924115l0 671.544693c0 61.809741 50.114374 111.924115 111.924115 111.924115l671.544693 0c61.809741 0 111.924115-50.114374 111.924115-111.924115l0-671.544693C959.69595 114.418936 909.581576 64.303538 847.771835 64.303538zM903.733381 847.772346c0 30.878265-25.056676 55.962569-55.962569 55.962569L176.227142 903.734916c-30.90487 0-55.962569-25.084305-55.962569-55.962569l0-671.544693c0-30.9325 25.056676-55.962569 55.962569-55.962569l671.544693 0c30.90487 0 55.962569 25.03007 55.962569 55.962569L903.734404 847.772346z" ></path></symbol><symbol id="icon-img-broken" viewBox="0 0 1024 1024"><path d="M810.666667 128H213.333333c-46.933333 0-85.333333 38.4-85.333333 85.333333v597.333334c0 46.933333 38.4 85.333333 85.333333 85.333333h597.333334c46.933333 0 85.333333-38.4 85.333333-85.333333V213.333333c0-46.933333-38.4-85.333333-85.333333-85.333333z m0 682.666667H213.333333v-195.413334l42.24 42.24 170.666667-170.666666 170.666667 170.666666 170.666666-170.24L810.666667 530.346667V810.666667z m0-401.493334l-43.093334-43.093333-170.666666 171.093333-170.666667-170.666666-170.666667 170.666666-42.24-42.666666V213.333333h597.333334v195.84z" ></path></symbol><symbol id="icon-prev" viewBox="0 0 1024 1024"><path d="M784.652701 955.6957 346.601985 517.644983c-2.822492-2.822492-2.822492-7.902977 0-11.289967l439.179713-439.179713c6.77398-6.77398 10.725469-16.370452 10.725469-25.966924L796.507166 36.692393c0-20.32194-16.370452-36.692393-36.692393-36.692393l-4.515987 0c-9.596472 0-19.192944 3.951488-25.966924 10.725469L250.072767 489.420066c-12.418964 12.418964-12.418964 32.740904 0 45.159868l477.565601 477.565601c7.338479 7.338479 17.499449 11.854465 28.224917 11.854465l0 0c22.015436 0 40.079383-18.063947 40.079383-40.079383l0 0C796.507166 973.759647 791.99118 963.598677 784.652701 955.6957z" ></path></symbol><symbol id="icon-next" viewBox="0 0 1024 1024"><path d="M246.121279 955.6957l438.050717-438.050717c2.822492-2.822492 2.822492-7.902977 0-11.289967L244.992282 67.175303c-6.77398-6.77398-10.725469-16.370452-10.725469-25.966924L234.266814 36.692393C234.266814 16.370452 250.637266 0 270.959206 0l4.515987 0c9.596472 0 19.192944 3.951488 25.966924 10.725469l478.694598 478.694598c12.418964 12.418964 12.418964 32.740904 0 45.159868l-477.565601 477.565601c-7.338479 7.338479-17.499449 11.854465-28.224917 11.854465l0 0c-22.015436 0-40.079383-18.063947-40.079383-40.079383l0 0C234.266814 973.759647 238.7828 963.598677 246.121279 955.6957z" ></path></symbol><symbol id="icon-zoomin" viewBox="0 0 1024 1024"><path d="M725.504 652.864c46.4-61.44 71.744-136.448 71.744-218.752C797.248 230.464 632.768 64 430.656 64S64 230.464 64 434.112C64 639.36 228.48 805.76 430.656 805.76c86.656 0 164.48-30.144 227.52-81.088L889.984 960 960 891.264l-234.496-238.4z m-294.848 67.456c-155.776 0-282.624-128.896-282.624-286.208s126.848-286.208 282.624-286.208 282.624 128.896 282.624 286.208-126.912 286.208-282.624 286.208z" ></path><path d="M235.712 369.92h390.72v127.104H235.712z" ></path><path d="M367.488 238.144h127.104v390.72H367.488z" ></path></symbol><symbol id="icon-close" viewBox="0 0 1024 1024"><path d="M570.24 512l259.2 259.2-58.88 58.24L512 570.24l-261.12 261.12-58.24-58.24L453.76 512 194.56 252.8l58.24-58.24L512 453.76l261.12-261.12 58.24 58.24z" ></path></symbol><symbol id="icon-zoomout" viewBox="0 0 1024 1024"><path d="M725.504 652.864c46.4-61.44 71.744-136.448 71.744-218.752C797.248 230.464 632.768 64 430.656 64S64 230.464 64 434.112C64 639.36 228.48 805.76 430.656 805.76c86.656 0 164.48-30.144 227.52-81.088L889.984 960 960 891.264l-234.496-238.4z m-294.848 67.456c-155.776 0-282.624-128.896-282.624-286.208s126.848-286.208 282.624-286.208 282.624 128.896 282.624 286.208-126.912 286.208-282.624 286.208z" ></path><path d="M235.712 369.92h390.72v127.104H235.712z" ></path></symbol></svg>';(function(i){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(i,0);else{var l=function(){document.removeEventListener("DOMContentLoaded",l,!1),i()};document.addEventListener("DOMContentLoaded",l,!1)}else document.attachEvent&&(v=i,w=e.document,r=!1,(g=function(){try{w.documentElement.doScroll("left")}catch{return void setTimeout(g,50)}m()})(),w.onreadystatechange=function(){w.readyState=="complete"&&(w.onreadystatechange=null,m())});function m(){r||(r=!0,v())}var v,w,r,g})(function(){var i,l,m,v,w,r;(i=document.createElement("div")).innerHTML=s,s=null,(l=i.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",m=l,(v=document.body).firstChild?(w=m,(r=v.firstChild).parentNode.insertBefore(w,r)):v.appendChild(m))})}}();const y=I({name:"SvgIcon",props:{type:{type:String,default:""}},setup:e=>()=>a("svg",{class:"vel-icon icon","aria-hidden":"true"},[a("use",{"xlink:href":`#icon-${e.type}`},null)])}),O=typeof window<"u",M=()=>{};let h9=!1;if(O)try{const e={};Object.defineProperty(e,"passive",{get(){h9=!0}}),window.addEventListener("test-passive",M,e)}catch{}const u9=function(e,s,i){let l=arguments.length>3&&arguments[3]!==void 0&&arguments[3];O&&e.addEventListener(s,i,!!h9&&{capture:!1,passive:l})},p9=(e,s,i)=>{O&&e.removeEventListener(s,i)},J9=e=>{e.preventDefault()},K9=Object.prototype.toString,K=e=>s=>K9.call(s).slice(8,-1)===e,f9=e=>!!e&&K("String")(e);function Q9(e){return e!=null}const ee=I({name:"Toolbar",props:{zoomIn:{type:Function,default:M},zoomOut:{type:Function,default:M},rotateLeft:{type:Function,default:M},rotateRight:{type:Function,default:M},resize:{type:Function,default:M}},setup:e=>()=>a("div",{class:"vel-toolbar"},[a("div",{role:"button","aria-label":"zoom in button",class:"toolbar-btn toolbar-btn__zoomin",onClick:e.zoomIn},[a(y,{type:"zoomin"},null)]),a("div",{role:"button","aria-label":"zoom out button",class:"toolbar-btn toolbar-btn__zoomout",onClick:e.zoomOut},[a(y,{type:"zoomout"},null)]),a("div",{role:"button","aria-label":"resize image button",class:"toolbar-btn toolbar-btn__resize",onClick:e.resize},[a(y,{type:"resize"},null)]),a("div",{role:"button","aria-label":"image rotate left button",class:"toolbar-btn toolbar-btn__rotate",onClick:e.rotateLeft},[a(y,{type:"rotate-left"},null)]),a("div",{role:"button","aria-label":"image rotate right button",class:"toolbar-btn toolbar-btn__rotate",onClick:e.rotateRight},[a(y,{type:"rotate-right"},null)])])}),te=()=>a("div",{class:"vel-loading"},[a("div",{class:"ring"},null)]),oe=()=>a("div",{class:"vel-on-error"},[a("div",{class:"ring"},null),a(y,{type:"img-broken"},null)]),le=(e,s)=>{let{slots:i}=s;return a("div",{class:"vel-img-title"},[i.default?i.default():""])},Y=O?window:global;let m9=Date.now();function ae(e){const s=Date.now(),i=Math.max(0,16-(s-m9)),l=setTimeout(e,i);return m9=s+i,l}function W(e){return(Y.requestAnimationFrame||ae).call(Y,e)}function v9(e){(Y.cancelAnimationFrame||Y.clearTimeout).call(Y,e)}function b9(e,s){const i=e.clientX-s.clientX,l=e.clientY-s.clientY;return Math.sqrt(i*i+l*l)}function Z(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!V9(e)}function ne(e){return(s=>!!s&&K("Object")(s))(e)&&f9(e.src)}var J=I({name:"VueEasyLightbox",props:{imgs:{type:[Array,String],default:()=>""},visible:{type:Boolean,default:!1},index:{type:Number,default:0},scrollDisabled:{type:Boolean,default:!0},escDisabled:{type:Boolean,default:!1},moveDisabled:{type:Boolean,default:!1},titleDisabled:{type:Boolean,default:!1},maskClosable:{type:Boolean,default:!0},teleport:{type:[String,Object],default:null},swipeTolerance:{type:Number,default:50},loop:{type:Boolean,default:!1},rtl:{type:Boolean,default:!1},zoomScale:{type:Number,default:.12},maxZoom:{type:Number,default:3}},emits:{hide:()=>!0,"on-error":e=>!0,"on-prev":(e,s)=>!0,"on-next":(e,s)=>!0,"on-prev-click":(e,s)=>!0,"on-next-click":(e,s)=>!0,"on-index-change":(e,s)=>!0,"on-rotate":e=>!0},setup(e,s){let{emit:i,slots:l}=s;const{imgRef:m,imgState:v,setImgSize:w}=(()=>{const t=k(),o=V({width:0,height:0,maxScale:1});return{imgRef:t,imgState:o,setImgSize:()=>{if(t.value){const{width:u,height:b,naturalWidth:f}=t.value;o.maxScale=f/u,o.width=u,o.height=b}}}})(),r=k(0),g=k(""),n=V({scale:1,lastScale:1,rotateDeg:0,top:0,left:0,initX:0,initY:0,lastX:0,lastY:0,touches:[]}),c=V({loadError:!1,loading:!1,dragging:!1,gesturing:!1,wheeling:!1}),h=E(()=>{return t=e.imgs,K("Array")(t)?e.imgs.map(o=>typeof o=="string"?{src:o}:ne(o)?o:void 0).filter(Q9):f9(e.imgs)?[{src:e.imgs}]:[];var t}),Q=E(()=>{var t;return(t=h.value[r.value])===null||t===void 0?void 0:t.src}),e9=E(()=>{var t;return(t=h.value[r.value])===null||t===void 0?void 0:t.title}),x9=E(()=>{var t;return(t=h.value[r.value])===null||t===void 0?void 0:t.alt}),w9=E(()=>({cursor:c.loadError?"default":e.moveDisabled?c.dragging?"grabbing":"grab":"move",top:`calc(50% + ${n.top}px)`,left:`calc(50% + ${n.left}px)`,transition:c.dragging||c.gesturing?"none":"",transform:`translate(-50%, -50%) scale(${n.scale}) rotate(${n.rotateDeg}deg)`})),j=()=>{i("hide")},t9=()=>{n.scale=1,n.lastScale=1,n.rotateDeg=0,n.top=0,n.left=0,c.loadError=!1,c.dragging=!1,c.loading=!0},A=(t,o)=>{const u=r.value;t9(),r.value=t,h.value[r.value]===h.value[t]&&i9(()=>{c.loading=!1}),e.visible&&u!==t&&(o&&o(u,t),i("on-index-change",u,t))},L=()=>{const t=r.value,o=e.loop?(t+1)%h.value.length:t+1;!e.loop&&o>h.value.length-1||A(o,(u,b)=>{i("on-next",u,b),i("on-next-click",u,b)})},S=()=>{const t=r.value;let o=t-1;if(t===0){if(!e.loop)return;o=h.value.length-1}A(o,(u,b)=>{i("on-prev",u,b),i("on-prev-click",u,b)})},o9=t=>{Math.abs(1-t)<.05?t=1:Math.abs(v.maxScale-t)<.05&&(t=v.maxScale),n.lastScale=n.scale,n.scale=t},B=()=>{const t=n.scale+e.zoomScale;t<v.maxScale*e.maxZoom&&o9(t)},X=()=>{const t=n.scale-(n.scale<.7?.1:e.zoomScale);t>.1&&o9(t)},l9=()=>{const t=n.rotateDeg%360;i("on-rotate",Math.abs(t<0?t+360:t))},D=()=>{n.rotateDeg-=90,l9()},H=()=>{n.rotateDeg+=90,l9()},N=()=>{n.scale=1,n.top=0,n.left=0},F=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return!e.moveDisabled&&t===0},{onMouseDown:y9,onMouseMove:_9,onMouseUp:k9}=((t,o,u)=>{let b,f=!1;return{onMouseDown:p=>{t.initX=t.lastX=p.clientX,t.initY=t.lastY=p.clientY,o.dragging=!0,f=!1,p.stopPropagation()},onMouseUp:p=>{u(p.button)&&v9(b),o.dragging=!1,f=!1},onMouseMove:p=>{if(o.dragging)if(u(p.button)){if(f)return;f=!0,b=W(()=>{const{top:z,left:x,lastY:R,lastX:P}=t;t.top=z-R+p.clientY,t.left=x-P+p.clientX,t.lastX=p.clientX,t.lastY=p.clientY,f=!1})}else t.lastX=p.clientX,t.lastY=p.clientY;p.stopPropagation()}}})(n,c,F),{onTouchStart:z9,onTouchMove:M9,onTouchEnd:C9}=((t,o,u,b)=>{let f,p=!1;return{onTouchStart:z=>{const{touches:x}=z;x.length>1?(u.gesturing=!0,o.touches=x):(o.initX=o.lastX=x[0].clientX,o.initY=o.lastY=x[0].clientY,u.dragging=!0),z.stopPropagation()},onTouchMove:z=>{if(p)return;const{touches:x}=z,{lastX:R,lastY:P,left:H9,top:N9,scale:F9}=o;if(!u.gesturing&&u.dragging){if(!x[0])return;const{clientX:T,clientY:_}=x[0];b()?f=W(()=>{o.lastX=T,o.lastY=_,o.top=N9-P+_,o.left=H9-R+T,p=!1}):(o.lastX=T,o.lastY=_)}else u.gesturing&&o.touches.length>1&&x.length>1&&(f=W(()=>{const T=(b9(o.touches[0],o.touches[1])-b9(x[0],x[1]))/t.width;o.touches=x;const _=F9-1.3*T;_>.5&&_<1.5*t.maxScale&&(o.scale=_),p=!1}))},onTouchEnd:()=>{v9(f),u.dragging=!1,u.gesturing=!1,p=!1}}})(v,n,c,F),L9=()=>{n.scale!==v.maxScale?(n.lastScale=n.scale,n.scale=v.maxScale):n.scale=n.lastScale},S9=t=>{c.loadError||c.gesturing||c.loading||c.dragging||c.wheeling||!e.scrollDisabled||(c.wheeling=!0,setTimeout(()=>{c.wheeling=!1},80),t.deltaY<0?B():X())},a9=t=>{const o=t;e.visible&&(!e.escDisabled&&o.key==="Escape"&&e.visible&&j(),o.key==="ArrowLeft"&&(e.rtl?L():S()),o.key==="ArrowRight"&&(e.rtl?S():L()))},D9=()=>{e.maskClosable&&j()},T9=()=>{w()},E9=()=>{c.loading=!1},Y9=t=>{c.loading=!1,c.loadError=!0,i("on-error",t)},n9=()=>{e.visible&&w()};$(()=>e.index,t=>{t<0||t>=h.value.length||A(t)}),$(()=>c.dragging,(t,o)=>{const u=!t&&o;if(!F()&&u){const b=n.lastX-n.initX,f=n.lastY-n.initY,p=e.swipeTolerance;Math.abs(b)>Math.abs(f)&&(b<-1*p?L():b>p&&S())}}),$(()=>e.visible,t=>{if(t){t9();const o=h.value.length;if(o===0)return r.value=0,c.loading=!1,void i9(()=>c.loadError=!0);r.value=e.index>=o?o-1:e.index<0?0:e.index,e.scrollDisabled&&j9()}else e.scrollDisabled&&B9()});const j9=()=>{document&&(g.value=document.body.style.overflowY,document.body.style.overflowY="hidden")},B9=()=>{document&&(document.body.style.overflowY=g.value)};g9(()=>{u9(document,"keydown",a9),u9(window,"resize",n9)}),R9(()=>{p9(document,"keydown",a9),p9(window,"resize",n9)});const X9=()=>c.loading?l.loading?l.loading({key:"loading"}):a(te,{key:"img-loading"},null):c.loadError?l.onerror?l.onerror({key:"onerror"}):a(oe,{key:"img-on-error"},null):a("div",{class:"vel-img-wrapper",style:w9.value,key:"img-wrapper"},[a("img",{alt:x9.value,ref:m,draggable:"false",class:"vel-img",src:Q.value,onMousedown:y9,onMouseup:k9,onMousemove:_9,onTouchstart:z9,onTouchmove:M9,onTouchend:C9,onLoad:T9,onDblclick:L9,onDragstart:t=>{t.preventDefault()}},null)]),I9=()=>{if(l["prev-btn"])return l["prev-btn"]({prev:S});if(h.value.length<=1)return;const t=!e.loop&&r.value<=0;return a("div",{role:"button","aria-label":"previous image button",class:"btn__prev "+(t?"disable":""),onClick:S},[e.rtl?a(y,{type:"next"},null):a(y,{type:"prev"},null)])},O9=()=>{if(l["next-btn"])return l["next-btn"]({next:L});if(h.value.length<=1)return;const t=!e.loop&&r.value>=h.value.length-1;return a("div",{role:"button","aria-label":"next image button",class:"btn__next "+(t?"disable":""),onClick:L},[e.rtl?a(y,{type:"prev"},null):a(y,{type:"next"},null)])},A9=()=>{if(e9.value&&!e.titleDisabled&&!c.loading&&!c.loadError)return l.title?l.title():a(le,null,{default:()=>[e9.value]})},s9=()=>{let t;if(e.visible)return a("div",{onTouchmove:J9,class:["vel-modal",e.rtl?"is-rtl":""],onClick:$9(D9,["self"]),onWheel:S9},[a(U,{name:"vel-fade",mode:"out-in"},Z(t=X9())?t:{default:()=>[t]}),a("img",{style:"display:none;",src:Q.value,onError:Y9,onLoad:E9},null),a("div",{class:"vel-btns-wrapper"},[I9(),O9(),A9(),l["close-btn"]?l["close-btn"]({close:j}):a("div",{role:"button","aria-label":"close image preview button",class:"btn__close",onClick:j},[a(y,{type:"close"},null)]),l.toolbar?l.toolbar({toolbarMethods:{zoomIn:B,zoomOut:X,rotate:D,rotateLeft:D,rotateRight:H,resize:N},zoomIn:B,zoomOut:X,rotate:D,rotateLeft:D,rotateRight:H,resize:N}):a(ee,{zoomIn:B,zoomOut:X,resize:N,rotateLeft:D,rotateRight:H},null)])])};return()=>{let t;if(e.teleport){let o;return a(P9,{to:e.teleport},{default:()=>[a(U,{name:"vel-fade"},Z(o=s9())?o:{default:()=>[o]})]})}return a(U,{name:"vel-fade"},Z(t=s9())?t:{default:()=>[t]})}}});const se=Object.assign(J,{install:e=>{e.component(J.name,J)}}),ie=d("ul",{class:"flex space-x-2 rtl:space-x-reverse"},[d("li",null,[d("a",{href:"javascript:;",class:"text-primary hover:underline"},"Components")]),d("li",{class:"before:content-['/'] ltr:before:mr-2 rtl:before:ml-2"},[d("span",null,"Lightbox")])],-1),re={class:"pt-5 space-y-8"},ce={class:"panel p-3 flex items-center text-primary overflow-x-auto whitespace-nowrap"},de={class:"ring-2 ring-primary/30 rounded-full bg-primary text-white p-1.5 ltr:mr-3 rtl:ml-3"},ue=d("span",{class:"ltr:mr-3 rtl:ml-3"},"Documentation: ",-1),pe=d("a",{href:"https://www.npmjs.com/package/vue-easy-lightbox",target:"_blank",class:"block hover:underline"},"https://www.npmjs.com/package/vue-easy-lightbox",-1),me={class:"panel"},ve=d("h5",{class:"font-semibold text-lg dark:text-white-light mb-5"},"Lightbox",-1),be={class:"mb-5"},ge={class:"flex mb-5"},he={class:"ltr:mr-4 rtl:ml-4"},fe=d("div",{class:"flex-1"},[d("h4",{class:"font-semibold text-lg text-primary"},"All controls"),d("p",{class:"media-text"},"Caption, slideshow, thumbnails and fullscreen buttons, tap to toggle controls")],-1),xe={class:"flex"},we={class:"ltr:mr-4 rtl:ml-4"},ye=d("div",{class:"flex-1"},[d("h4",{class:"font-semibold text-lg text-primary"},"Minimal"),d("p",{class:"media-text"},"No caption, no slideshow, no thumbnails, no fullscreen, tap to close")],-1),_e={class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-3 mt-10"},ke=["onClick"],ze=["src"],Le=I({__name:"lightbox",setup(e){U9({title:"Lightbox"});const s=k([]),i=k(null),l=k(!0),m=k(!1);g9(()=>{v()});const v=()=>{l.value?s.value=[{src:"/assets/images/lightbox1.jpg",title:"This is dummy caption. It has been placed here solely to demonstrate the look and feel of finished, typeset text.",description:"Photo: Samuel Rohl"},{src:"/assets/images/lightbox2.jpeg",title:"This is dummy caption. It has been placed here solely to demonstrate the look and feel of finished, typeset text.",description:"Photo: Samuel Rohl"},{src:"/assets/images/lightbox3.jpeg",title:"Dummy caption. It's Greek to you. Unless, of course, you're Greek, in which case, it really makes no sense.",description:"Photo: Michael Hull"},{src:"/assets/images/lightbox4.jpeg",title:"This is dummy caption.",description:"Photo: Folkert Gorter"},{src:"/assets/images/lightbox5.jpeg",title:"It's a dummy caption. He who searches for meaning here will be sorely disappointed.",description:"Photo: Thomas Lefebvre"},{src:"/assets/images/lightbox6.jpeg",title:"It's a dummy caption. He who searches for meaning here will be sorely disappointed.",description:"Photo: Thomas Lefebvre"}]:s.value=[{src:"/assets/images/lightbox1.jpg"},{src:"/assets/images/lightbox2.jpeg"},{src:"/assets/images/lightbox3.jpeg"},{src:"/assets/images/lightbox4.jpeg"},{src:"/assets/images/lightbox5.jpeg"},{src:"/assets/images/lightbox6.jpeg"}]};return(w,r)=>(q(),G("div",null,[ie,d("div",null,[d("div",re,[d("div",ce,[d("div",de,[a(Z9)]),ue,pe]),d("div",me,[ve,d("div",be,[d("div",ge,[d("div",he,[r9(d("input",{"onUpdate:modelValue":r[0]||(r[0]=g=>l.value=g),value:!0,type:"radio",onChange:r[1]||(r[1]=g=>v()),class:"form-radio mt-1.5",checked:""},null,544),[[c9,l.value]])]),fe]),d("div",xe,[d("div",we,[r9(d("input",{"onUpdate:modelValue":r[2]||(r[2]=g=>l.value=g),value:!1,type:"radio",onChange:r[3]||(r[3]=g=>v()),class:"form-radio mt-1.5"},null,544),[[c9,l.value]])]),ye]),d("div",_e,[(q(!0),G(G9,null,q9(s.value,(g,n)=>(q(),G("a",{key:n,href:"javascript:;",class:d9({"md:row-span-2 md:col-span-2":n==3}),onClick:c=>{i.value=n,m.value=!0}},[d("img",{src:g.src,alt:"image-gallery",class:"rounded-md w-full h-full object-cover"},null,8,ze)],10,ke))),128)),a(W9(se),{visible:m.value,imgs:s.value,index:i.value,scrollDisabled:"",moveDisabled:"",loop:"",class:d9({minimal:!l.value}),onHide:r[4]||(r[4]=g=>{i.value=null,m.value=!1})},null,8,["visible","imgs","index","class"])])])])])])]))}});export{Le as default};