img_preview

微信公证号文章中,图片预览

目前為 2023-07-14 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         img_preview
// @namespace    http://tampermonkey.net/
// @version      0.0.4
// @description  微信公证号文章中,图片预览
// @author       Enjoy
// @icon         https://foruda.gitee.com/avatar/1671100286067517749/4867929_enjoy_li_1671100285.png!avatar60
// @match        *://mp.weixin.qq.com/s/*
// @grant        GM_addElement
// @grant        GM_addStyle
// @grant        GM_setClipboard
// @license      GPL License
// ==/UserScript==

// 函数文档 https://www.tampermonkey.net/documentation.php#api:GM_addElement

(function () {


(function(k,ie){typeof exports=="object"&&typeof module<"u"?module.exports=ie():typeof define=="function"&&define.amd?define(ie):(k=typeof globalThis<"u"?globalThis:k||self,k.Humming=ie())})(this,function(){"use strict";function k(){}function ie(t,e){for(const n in e)t[n]=e[n];return t}function He(t){return t()}function Te(){return Object.create(null)}function ee(t){t.forEach(He)}function Ce(t){return typeof t=="function"}function V(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ue;function Se(t,e){return ue||(ue=document.createElement("a")),ue.href=e,t===ue.href}function Je(t){return Object.keys(t).length===0}function Qe(t,e,n,r){if(t){const o=Pe(t,e,n,r);return t[0](o)}}function Pe(t,e,n,r){return t[1]&&r?ie(n.ctx.slice(),t[1](r(e))):n.ctx}function et(t,e,n,r){if(t[2]&&r){const o=t[2](r(n));if(e.dirty===void 0)return o;if(typeof o=="object"){const s=[],c=Math.max(e.dirty.length,o.length);for(let f=0;f<c;f+=1)s[f]=e.dirty[f]|o[f];return s}return e.dirty|o}return e.dirty}function tt(t,e,n,r,o,s){if(o){const c=Pe(e,n,r,s);t.p(c,o)}}function nt(t){if(t.ctx.length>32){const e=[],n=t.ctx.length/32;for(let r=0;r<n;r++)e[r]=-1;return e}return-1}function j(t){return t==null?"":t}function O(t){return t&&Ce(t.destroy)?t.destroy:k}function g(t,e){t.appendChild(e)}function rt(t,e,n){const r=ot(t);if(!r.getElementById(e)){const o=H("style");o.id=e,o.textContent=n,st(r,o)}}function ot(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function st(t,e){g(t.head||t,e)}function M(t,e,n){t.insertBefore(e,n||null)}function E(t){t.parentNode.removeChild(t)}function H(t){return document.createElement(t)}function S(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Ne(t){return document.createTextNode(t)}function G(){return Ne(" ")}function lt(){return Ne("")}function it(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function l(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function ct(t){return Array.from(t.childNodes)}function Re(t,e,n,r){n===null?t.style.removeProperty(e):t.style.setProperty(e,n,r?"important":"")}let $e;function ce(t){$e=t}function te(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(r=>r.call(this,e))}const fe=[],ze=[],de=[],je=[],ft=Promise.resolve();let be=!1;function at(){be||(be=!0,ft.then(Oe))}function ye(t){de.push(t)}const ke=new Set;let me=0;function Oe(){const t=$e;do{for(;me<fe.length;){const e=fe[me];me++,ce(e),ut(e.$$)}for(ce(null),fe.length=0,me=0;ze.length;)ze.pop()();for(let e=0;e<de.length;e+=1){const n=de[e];ke.has(n)||(ke.add(n),n())}de.length=0}while(fe.length);for(;je.length;)je.pop()();be=!1,ke.clear(),ce(t)}function ut(t){if(t.fragment!==null){t.update(),ee(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(ye)}}const he=new Set;let ne;function Ee(){ne={r:0,c:[],p:ne}}function Le(){ne.r||ee(ne.c),ne=ne.p}function p(t,e){t&&t.i&&(he.delete(t),t.i(e))}function w(t,e,n,r){if(t&&t.o){if(he.has(t))return;he.add(t),ne.c.push(()=>{he.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}function T(t){t&&t.c()}function L(t,e,n,r){const{fragment:o,on_mount:s,on_destroy:c,after_update:f}=t.$$;o&&o.m(e,n),r||ye(()=>{const d=s.map(He).filter(Ce);c?c.push(...d):ee(d),t.$$.on_mount=[]}),f.forEach(ye)}function A(t,e){const n=t.$$;n.fragment!==null&&(ee(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function dt(t,e){t.$$.dirty[0]===-1&&(fe.push(t),at(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function W(t,e,n,r,o,s,c,f=[-1]){const d=$e;ce(t);const a=t.$$={fragment:null,ctx:null,props:s,update:k,not_equal:o,bound:Te(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(d?d.$$.context:[])),callbacks:Te(),dirty:f,skip_bound:!1,root:e.target||d.$$.root};c&&c(a.root);let _=!1;if(a.ctx=n?n(t,e.props||{},(h,$,...v)=>{const C=v.length?v[0]:$;return a.ctx&&o(a.ctx[h],a.ctx[h]=C)&&(!a.skip_bound&&a.bound[h]&&a.bound[h](C),_&&dt(t,h)),$}):[],a.update(),_=!0,ee(a.before_update),a.fragment=r?r(a.ctx):!1,e.target){if(e.hydrate){const h=ct(e.target);a.fragment&&a.fragment.l(h),h.forEach(E)}else a.fragment&&a.fragment.c();e.intro&&p(t.$$.fragment),L(t,e.target,e.anchor,e.customElement),Oe()}ce(d)}class X{$destroy(){A(this,1),this.$destroy=k}$on(e,n){const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o!==-1&&r.splice(o,1)}}$set(e){this.$$set&&!Je(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function mt(t){let e,n,r,o,s,c;const f=t[2].default,d=Qe(f,t,t[1],null);return{c(){e=H("span"),n=S("svg"),d&&d.c(),l(n,"viewBox","0 0 24 24"),l(n,"focusable","false"),l(n,"width","1em"),l(n,"height","1em"),l(n,"fill","currentColor"),l(n,"aria-hidden","true"),l(e,"class",r="h-preview-icon "+(t[0]?"h-preview-icon-"+t[0]:""))},m(a,_){M(a,e,_),g(e,n),d&&d.m(n,null),o=!0,s||(c=it(e,"click",t[3]),s=!0)},p(a,[_]){d&&d.p&&(!o||_&2)&&tt(d,f,a,a[1],o?et(f,a[1],_,null):nt(a[1]),null),(!o||_&1&&r!==(r="h-preview-icon "+(a[0]?"h-preview-icon-"+a[0]:"")))&&l(e,"class",r)},i(a){o||(p(d,a),o=!0)},o(a){w(d,a),o=!1},d(a){a&&E(e),d&&d.d(a),s=!1,c()}}}function ht(t,e,n){let{$$slots:r={},$$scope:o}=e,{name:s}=e;function c(f){te.call(this,t,f)}return t.$$set=f=>{"name"in f&&n(0,s=f.name),"$$scope"in f&&n(1,o=f.$$scope)},[s,o,r,c]}class J extends X{constructor(e){super(),W(this,e,ht,mt,V,{name:0})}}function pt(t){let e;return{c(){e=S("path"),l(e,"d","M13.414 6l1.829 1.828-1.415 1.415L9.586 5 13.828.757l1.415 1.415L13.414 4H16a5 5 0 0 1 5 5v4h-2V9a3 3 0 0 0-3-3h-2.586zM15 11v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V11a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1zm-2 1H5v8h8v-8z")},m(n,r){M(n,e,r)},p:k,d(n){n&&E(e)}}}function gt(t){let e,n;return e=new J({props:{name:"rotate-left",$$slots:{default:[pt]},$$scope:{ctx:t}}}),e.$on("click",t[0]),{c(){T(e.$$.fragment)},m(r,o){L(e,r,o),n=!0},p(r,[o]){const s={};o&2&&(s.$$scope={dirty:o,ctx:r}),e.$set(s)},i(r){n||(p(e.$$.fragment,r),n=!0)},o(r){w(e.$$.fragment,r),n=!1},d(r){A(e,r)}}}function vt(t){function e(n){te.call(this,t,n)}return[e]}class wt extends X{constructor(e){super(),W(this,e,vt,gt,V,{})}}function _t(t){let e;return{c(){e=S("path"),l(e,"d","M10.586 4L8.757 2.172 10.172.757 14.414 5l-4.242 4.243-1.415-1.415L10.586 6H8a3 3 0 0 0-3 3v4H3V9a5 5 0 0 1 5-5h2.586zM9 11a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H10a1 1 0 0 1-1-1V11zm2 1v8h8v-8h-8z")},m(n,r){M(n,e,r)},p:k,d(n){n&&E(e)}}}function $t(t){let e,n;return e=new J({props:{name:"rotate-right",$$slots:{default:[_t]},$$scope:{ctx:t}}}),e.$on("click",t[0]),{c(){T(e.$$.fragment)},m(r,o){L(e,r,o),n=!0},p(r,[o]){const s={};o&2&&(s.$$scope={dirty:o,ctx:r}),e.$set(s)},i(r){n||(p(e.$$.fragment,r),n=!0)},o(r){w(e.$$.fragment,r),n=!1},d(r){A(e,r)}}}function zt(t){function e(n){te.call(this,t,n)}return[e]}class bt extends X{constructor(e){super(),W(this,e,zt,$t,V,{})}}function yt(t){let e;return{c(){e=S("path"),l(e,"d","M18.031 16.617l4.283 4.282-1.415 1.415-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9 9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617zm-2.006-.742A6.977 6.977 0 0 0 18 11c0-3.868-3.133-7-7-7-3.868 0-7 3.132-7 7 0 3.867 3.132 7 7 7a6.977 6.977 0 0 0 4.875-1.975l.15-.15zM7 10h8v2H7v-2z")},m(n,r){M(n,e,r)},p:k,d(n){n&&E(e)}}}function kt(t){let e,n;return e=new J({props:{name:"zoom-out",$$slots:{default:[yt]},$$scope:{ctx:t}}}),e.$on("click",t[0]),{c(){T(e.$$.fragment)},m(r,o){L(e,r,o),n=!0},p(r,[o]){const s={};o&2&&(s.$$scope={dirty:o,ctx:r}),e.$set(s)},i(r){n||(p(e.$$.fragment,r),n=!0)},o(r){w(e.$$.fragment,r),n=!1},d(r){A(e,r)}}}function Et(t){function e(n){te.call(this,t,n)}return[e]}class Lt extends X{constructor(e){super(),W(this,e,Et,kt,V,{})}}function At(t){let e;return{c(){e=S("path"),l(e,"d","M18.031 16.617l4.283 4.282-1.415 1.415-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9 9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617zm-2.006-.742A6.977 6.977 0 0 0 18 11c0-3.868-3.133-7-7-7-3.868 0-7 3.132-7 7 0 3.867 3.132 7 7 7a6.977 6.977 0 0 0 4.875-1.975l.15-.15zM10 10V7h2v3h3v2h-3v3h-2v-3H7v-2h3z")},m(n,r){M(n,e,r)},p:k,d(n){n&&E(e)}}}function Mt(t){let e,n;return e=new J({props:{name:"zoom-in",$$slots:{default:[At]},$$scope:{ctx:t}}}),e.$on("click",t[0]),{c(){T(e.$$.fragment)},m(r,o){L(e,r,o),n=!0},p(r,[o]){const s={};o&2&&(s.$$scope={dirty:o,ctx:r}),e.$set(s)},i(r){n||(p(e.$$.fragment,r),n=!0)},o(r){w(e.$$.fragment,r),n=!1},d(r){A(e,r)}}}function Ht(t){function e(n){te.call(this,t,n)}return[e]}class Tt extends X{constructor(e){super(),W(this,e,Ht,Mt,V,{})}}function Ct(t){let e;return{c(){e=S("path"),l(e,"d","M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z")},m(n,r){M(n,e,r)},p:k,d(n){n&&E(e)}}}function St(t){let e,n;return e=new J({props:{name:"close",$$slots:{default:[Ct]},$$scope:{ctx:t}}}),e.$on("click",t[0]),{c(){T(e.$$.fragment)},m(r,o){L(e,r,o),n=!0},p(r,[o]){const s={};o&2&&(s.$$scope={dirty:o,ctx:r}),e.$set(s)},i(r){n||(p(e.$$.fragment,r),n=!0)},o(r){w(e.$$.fragment,r),n=!1},d(r){A(e,r)}}}function Pt(t){function e(n){te.call(this,t,n)}return[e]}class Nt extends X{constructor(e){super(),W(this,e,Pt,St,V,{})}}function Rt(t){let e;return{c(){e=S("path"),l(e,"d","M10.828 12l4.95 4.95-1.414 1.414L8 12l6.364-6.364 1.414 1.414z")},m(n,r){M(n,e,r)},p:k,d(n){n&&E(e)}}}function jt(t){let e,n;return e=new J({props:{name:"arrow-left",$$slots:{default:[Rt]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(r,o){L(e,r,o),n=!0},p(r,[o]){const s={};o&1&&(s.$$scope={dirty:o,ctx:r}),e.$set(s)},i(r){n||(p(e.$$.fragment,r),n=!0)},o(r){w(e.$$.fragment,r),n=!1},d(r){A(e,r)}}}class Ot extends X{constructor(e){super(),W(this,e,null,jt,V,{})}}function xt(t){let e;return{c(){e=S("path"),l(e,"d","M13.172 12l-4.95-4.95 1.414-1.414L16 12l-6.364 6.364-1.414-1.414z")},m(n,r){M(n,e,r)},p:k,d(n){n&&E(e)}}}function It(t){let e,n;return e=new J({props:{name:"arrow-right",$$slots:{default:[xt]},$$scope:{ctx:t}}}),{c(){T(e.$$.fragment)},m(r,o){L(e,r,o),n=!0},p(r,[o]){const s={};o&1&&(s.$$scope={dirty:o,ctx:r}),e.$set(s)},i(r){n||(p(e.$$.fragment,r),n=!0)},o(r){w(e.$$.fragment,r),n=!1},d(r){A(e,r)}}}class qt extends X{constructor(e){super(),W(this,e,null,It,V,{})}}function Dt(t){let e;return{c(){e=S("path"),l(e,"d","M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z")},m(n,r){M(n,e,r)},p:k,d(n){n&&E(e)}}}function Bt(t){let e,n;return e=new J({props:{name:"reset",$$slots:{default:[Dt]},$$scope:{ctx:t}}}),e.$on("click",t[0]),{c(){T(e.$$.fragment)},m(r,o){L(e,r,o),n=!0},p(r,[o]){const s={};o&2&&(s.$$scope={dirty:o,ctx:r}),e.$set(s)},i(r){n||(p(e.$$.fragment,r),n=!0)},o(r){w(e.$$.fragment,r),n=!1},d(r){A(e,r)}}}function Ft(t){function e(n){te.call(this,t,n)}return[e]}class Vt extends X{constructor(e){super(),W(this,e,Ft,Bt,V,{})}}function Wt(t){let e,n,r,o,s,c,f;return{c(){e=S("svg"),n=S("path"),r=S("animateTransform"),o=S("path"),s=S("animateTransform"),c=S("path"),f=S("animateTransform"),l(r,"attributeName","transform"),l(r,"attributeType","XML"),l(r,"type","rotate"),l(r,"dur","2s"),l(r,"from","0 50 50"),l(r,"to","360 50 50"),l(r,"repeatCount","indefinite"),l(n,"d",`M31.6,3.5C5.9,13.6-6.6,42.7,3.5,68.4c10.1,25.7,39.2,38.3,64.9,28.1l-3.1-7.9c-21.3,8.4-45.4-2-53.8-23.3\r
  c-8.4-21.3,2-45.4,23.3-53.8L31.6,3.5z`),l(s,"attributeName","transform"),l(s,"attributeType","XML"),l(s,"type","rotate"),l(s,"dur","1s"),l(s,"from","0 50 50"),l(s,"to","-360 50 50"),l(s,"repeatCount","indefinite"),l(o,"d",`M42.3,39.6c5.7-4.3,13.9-3.1,18.1,2.7c4.3,5.7,3.1,13.9-2.7,18.1l4.1,5.5c8.8-6.5,10.6-19,4.1-27.7\r
  c-6.5-8.8-19-10.6-27.7-4.1L42.3,39.6z`),l(f,"attributeName","transform"),l(f,"attributeType","XML"),l(f,"type","rotate"),l(f,"dur","2s"),l(f,"from","0 50 50"),l(f,"to","360 50 50"),l(f,"repeatCount","indefinite"),l(c,"d",`M82,35.7C74.1,18,53.4,10.1,35.7,18S10.1,46.6,18,64.3l7.6-3.4c-6-13.5,0-29.3,13.5-35.3s29.3,0,35.3,13.5\r
  L82,35.7z`),l(e,"viewBox","0 0 100 100"),l(e,"focusable","false"),l(e,"width","1em"),l(e,"height","1em"),l(e,"fill","currentColor"),l(e,"aria-hidden","true")},m(d,a){M(d,e,a),g(e,n),g(n,r),g(e,o),g(o,s),g(e,c),g(c,f)},p:k,i:k,o:k,d(d){d&&E(e)}}}class Xt extends X{constructor(e){super(),W(this,e,null,Wt,V,{})}}const Yt=window.requestAnimationFrame,Zt=window.cancelAnimationFrame,Kt=function(t,e,...n){typeof t=="function"&&t.call(e,...n)},xe=function(t,e){let n,r=!1,o=Date.now();const s=()=>{r=!0,n&&Zt(n)},c=()=>{if(!r){if(Date.now()-o>=e){s(),Kt(t,this,n);return}n=Yt(c)}};return c(),s},Gt=function(t,e=16){let n;const r=function(){const o=this,s=arguments;n&&n(),n=xe(()=>t.apply(o,s),e)};return r.cancel=function(){n&&n(),n=null},r};function Ut(t){rt(t,"svelte-zdtwro",'.h-preview-root.svelte-zdtwro .svelte-zdtwro{box-sizing:border-box}.h-preview-root.svelte-zdtwro.svelte-zdtwro{background-color:#00000073}.h-preview-icon{display:flex;justify-content:center;align-items:center}.h-preview-root.svelte-zdtwro.svelte-zdtwro,.h-loading.svelte-zdtwro.svelte-zdtwro,.h-preview.svelte-zdtwro.svelte-zdtwro{position:fixed;inset:0;z-index:1000;height:100vh;width:100%;top:0;overflow:hidden;inset:0;outline:0;-webkit-overflow-scrolling:touch}.h-preview-actions.svelte-zdtwro.svelte-zdtwro{display:flex;justify-content:flex-end;align-items:center;width:100%;color:#ffffffa6;list-style:none;background:rgba(0, 0, 0, 0.4);pointer-events:auto;font-size:1.125rem;font-variant:tabular-nums;line-height:1.5715;font-feature-settings:"tnum";position:absolute;top:0;left:0;z-index:1003}.h-preview-actions.svelte-zdtwro>div.svelte-zdtwro{padding:0.75rem;cursor:pointer}.h-preview-prev.h-disabled.svelte-zdtwro.svelte-zdtwro,.h-preview-next.h-disabled.svelte-zdtwro.svelte-zdtwro,.h-preview-actions.svelte-zdtwro>div.h-disabled.svelte-zdtwro{color:#ffffff40}.h-preview-actions.svelte-zdtwro>div.h-disabled.svelte-zdtwro{pointer-events:none}.h-preview-prev.h-disabled.svelte-zdtwro.svelte-zdtwro,.h-preview-next.h-disabled.svelte-zdtwro.svelte-zdtwro{cursor:not-allowed}.h-preview-actions.svelte-zdtwro>div.svelte-zdtwro:not(.h-disabled):hover{color:rgb(255 255 255)}.h-preview-image.svelte-zdtwro.svelte-zdtwro{user-select:none;text-align:center;position:absolute;inset:0;height:100vh;transition:transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);display:flex;justify-content:center;align-items:center}.h-preview-image.svelte-zdtwro>img.svelte-zdtwro{position:relative;max-width:100%;max-height:100%;vertical-align:middle;transform:scale(1);cursor:grab;transition:transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);user-select:none;pointer-events:auto}.h-preview-prev.svelte-zdtwro.svelte-zdtwro,.h-preview-next.svelte-zdtwro.svelte-zdtwro{position:absolute;top:48%;right:0.625rem;z-index:1;display:flex;align-items:center;justify-content:center;width:2.75rem;height:2.75rem;color:#ffffffd9;background:rgba(0, 0, 0, 0.1);border-radius:50%;cursor:pointer;pointer-events:auto;transition:background 0.3s, color 0.3s;font-size:1.5rem}.h-preview-prev.svelte-zdtwro.svelte-zdtwro{right:unset;left:0.625rem}.h-preview-prev.svelte-zdtwro.svelte-zdtwro:not(.h-disabled):hover,.h-preview-next.svelte-zdtwro.svelte-zdtwro:not(.h-disabled):hover{background:rgba(0, 0, 0, 0.3);color:#fff}.h-loading.svelte-zdtwro.svelte-zdtwro{z-index:1002;font-size:3rem;color:#fff}.h-loading.svelte-zdtwro>span.svelte-zdtwro{position:absolute;top:50%;left:50%;transform:translate(-50%, -100%)}')}function Ie(t){let e,n,r,o,s,c,f,d,a,_,h,$,v,C,q,x,y,Y,D,R,Z,Q,re,B,K,se,U,ge,oe,F,ae,ve;s=new Vt({}),a=new wt({}),v=new bt({}),y=new Lt({}),Z=new Tt({}),K=new Nt({});let P=t[2]&&qe(t),z=t[6]>1&&De(t),b=t[0]&&Be(t);return{c(){e=H("div"),n=H("div"),r=H("div"),o=H("div"),T(s.$$.fragment),f=G(),d=H("div"),T(a.$$.fragment),h=G(),$=H("div"),T(v.$$.fragment),q=G(),x=H("div"),T(y.$$.fragment),D=G(),R=H("div"),T(Z.$$.fragment),re=G(),B=H("div"),T(K.$$.fragment),se=G(),U=H("div"),P&&P.c(),ge=G(),z&&z.c(),oe=G(),b&&b.c(),l(o,"class",c=j(t[0]?"h-disabled":"")+" svelte-zdtwro"),l(d,"class",_=j(t[0]?"h-disabled":"")+" svelte-zdtwro"),l($,"class",C=j(t[0]?"h-disabled":"")+" svelte-zdtwro"),l(x,"class",Y=j(t[0]||t[3]<=1?"h-disabled":"")+" svelte-zdtwro"),l(R,"class",Q=j(t[0]?"h-disabled":"")+" svelte-zdtwro"),l(B,"class","svelte-zdtwro"),l(r,"class","h-preview-actions svelte-zdtwro"),l(U,"class","h-preview-image svelte-zdtwro"),l(n,"class","h-preview svelte-zdtwro"),l(e,"class","h-preview-root svelte-zdtwro")},m(m,I){M(m,e,I),g(e,n),g(n,r),g(r,o),L(s,o,null),g(r,f),g(r,d),L(a,d,null),g(r,h),g(r,$),L(v,$,null),g(r,q),g(r,x),L(y,x,null),g(r,D),g(r,R),L(Z,R,null),g(r,re),g(r,B),L(K,B,null),g(n,se),g(n,U),P&&P.m(U,null),g(n,ge),z&&z.m(n,null),g(n,oe),b&&b.m(n,null),F=!0,ae||(ve=[O(t[20].call(null,o,t[10])),O(t[20].call(null,d,t[13])),O(t[20].call(null,$,t[14])),O(t[20].call(null,x,t[11])),O(t[20].call(null,R,t[12])),O(t[18].call(null,B)),O(t[19].call(null,r)),O(t[22].call(null,U)),O(t[18].call(null,n))],ae=!0)},p(m,I){(!F||I[0]&1&&c!==(c=j(m[0]?"h-disabled":"")+" svelte-zdtwro"))&&l(o,"class",c),(!F||I[0]&1&&_!==(_=j(m[0]?"h-disabled":"")+" svelte-zdtwro"))&&l(d,"class",_),(!F||I[0]&1&&C!==(C=j(m[0]?"h-disabled":"")+" svelte-zdtwro"))&&l($,"class",C),(!F||I[0]&9&&Y!==(Y=j(m[0]||m[3]<=1?"h-disabled":"")+" svelte-zdtwro"))&&l(x,"class",Y),(!F||I[0]&1&&Q!==(Q=j(m[0]?"h-disabled":"")+" svelte-zdtwro"))&&l(R,"class",Q),m[2]?P?P.p(m,I):(P=qe(m),P.c(),P.m(U,null)):P&&(P.d(1),P=null),m[6]>1?z?(z.p(m,I),I[0]&64&&p(z,1)):(z=De(m),z.c(),p(z,1),z.m(n,oe)):z&&(Ee(),w(z,1,1,()=>{z=null}),Le()),m[0]?b?I[0]&1&&p(b,1):(b=Be(m),b.c(),p(b,1),b.m(n,null)):b&&(Ee(),w(b,1,1,()=>{b=null}),Le())},i(m){F||(p(s.$$.fragment,m),p(a.$$.fragment,m),p(v.$$.fragment,m),p(y.$$.fragment,m),p(Z.$$.fragment,m),p(K.$$.fragment,m),p(z),p(b),F=!0)},o(m){w(s.$$.fragment,m),w(a.$$.fragment,m),w(v.$$.fragment,m),w(y.$$.fragment,m),w(Z.$$.fragment,m),w(K.$$.fragment,m),w(z),w(b),F=!1},d(m){m&&E(e),A(s),A(a),A(v),A(y),A(Z),A(K),P&&P.d(),z&&z.d(),b&&b.d(),ae=!1,ee(ve)}}}function qe(t){let e,n,r,o,s;return{c(){e=H("img"),Se(e.src,n=t[2].src)||l(e,"src",n),l(e,"alt",r=t[2].alt),l(e,"draggable","false"),Re(e,"transform","translate3d("+t[7]+"px, "+t[8]+"px, 0px) scale3d("+t[3]+", "+t[3]+", 1) rotate("+t[4]+"deg)"),l(e,"class","svelte-zdtwro")},m(c,f){M(c,e,f),t[25](e),o||(s=O(t[21].call(null,e)),o=!0)},p(c,f){f[0]&4&&!Se(e.src,n=c[2].src)&&l(e,"src",n),f[0]&4&&r!==(r=c[2].alt)&&l(e,"alt",r),f[0]&408&&Re(e,"transform","translate3d("+c[7]+"px, "+c[8]+"px, 0px) scale3d("+c[3]+", "+c[3]+", 1) rotate("+c[4]+"deg)")},d(c){c&&E(e),t[25](null),o=!1,s()}}}function De(t){let e,n,r,o,s,c,f,d,a,_;return n=new Ot({}),c=new qt({}),{c(){e=H("div"),T(n.$$.fragment),o=G(),s=H("div"),T(c.$$.fragment),l(e,"class",r=j("h-preview-prev"+(t[5]<=0?" h-disabled":""))+" svelte-zdtwro"),l(s,"class",f=j("h-preview-next"+(t[5]>=t[6]-1?" h-disabled":""))+" svelte-zdtwro")},m(h,$){M(h,e,$),L(n,e,null),M(h,o,$),M(h,s,$),L(c,s,null),d=!0,a||(_=[O(t[19].call(null,e,t[15])),O(t[19].call(null,s,t[16]))],a=!0)},p(h,$){(!d||$[0]&32&&r!==(r=j("h-preview-prev"+(h[5]<=0?" h-disabled":""))+" svelte-zdtwro"))&&l(e,"class",r),(!d||$[0]&96&&f!==(f=j("h-preview-next"+(h[5]>=h[6]-1?" h-disabled":""))+" svelte-zdtwro"))&&l(s,"class",f)},i(h){d||(p(n.$$.fragment,h),p(c.$$.fragment,h),d=!0)},o(h){w(n.$$.fragment,h),w(c.$$.fragment,h),d=!1},d(h){h&&E(e),A(n),h&&E(o),h&&E(s),A(c),a=!1,ee(_)}}}function Be(t){let e,n,r,o,s,c;return r=new Xt({}),{c(){e=H("div"),n=H("span"),T(r.$$.fragment),l(n,"class","svelte-zdtwro"),l(e,"class","h-loading svelte-zdtwro")},m(f,d){M(f,e,d),g(e,n),L(r,n,null),o=!0,s||(c=O(t[19].call(null,e)),s=!0)},i(f){o||(p(r.$$.fragment,f),o=!0)},o(f){w(r.$$.fragment,f),o=!1},d(f){f&&E(e),A(r),s=!1,c()}}}function Jt(t){let e,n,r,o,s=t[1]&&Ie(t);return{c(){s&&s.c(),e=lt()},m(c,f){s&&s.m(c,f),M(c,e,f),n=!0,r||(o=O(t[17].call(null,window)),r=!0)},p(c,f){c[1]?s?(s.p(c,f),f[0]&2&&p(s,1)):(s=Ie(c),s.c(),p(s,1),s.m(e.parentNode,e)):s&&(Ee(),w(s,1,1,()=>{s=null}),Le())},i(c){n||(p(s),n=!0)},o(c){w(s),n=!1},d(c){s&&s.d(c),c&&E(e),r=!1,o()}}}let Fe=200;function Qt(t,e,n){let{selector:r=null}=e;const o=/Mobile|Android|iOS|iPhone|iPad|iPod|Windows Phone|KFAPWI/i.test(navigator.userAgent),s=o?"touchstart":"keydown",c=o?"touchend":"mouseup",f=o?"touchstart":"mousedown",d=o?"touchmove":"mousemove",a=o?"touchstart":"click";let _={},h=!1,$=!1,v=null,C=null,q=1,x=0,y=-1,Y=0,D=0,R=0,Z=0,Q=0,re=!1,B=null,K,se=0;const U=i=>{let u=null;return i instanceof TouchEvent?u=i.changedTouches[0]:u=i,{x:u.pageX,y:u.pageY}},ge=()=>({width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}),oe=function(i){const u=i.getAttribute("data-preview");if(u)if(_[u])n(2,C=_[u]);else{const N=new Image;N.src=u,N.alt=i.alt,n(0,h=!0),i.src&&n(2,C=i),N.onload=function(){n(0,h=!1),n(2,C=N),_[u]=N},N.onerror=function(){n(0,h=!1),i.src&&n(2,C=i)}}else i.src&&n(2,C=i)},F=Gt(function(i){document.documentElement.style.overflowY="hidden";const u=i.target;oe(u),n(5,y=v.indexOf(C)),n(1,$=!0)},150),ae=function(i){if(!(o||!C)&&!(i instanceof TouchEvent))switch(i.key){case"ArrowRight":Ze();break;case"ArrowLeft":Ye();break;case"+":Me();break;case"-":Ae();break}},ve=function(){document.documentElement.style.overflowY="",n(2,C=null),n(1,$=!1),n(9,B=null),Xe()},P=function(i){i.deltaY<0?Me():Ae()},z=function(i){let u=null;return i instanceof TouchEvent?u=i.changedTouches[0]:u=i,u&&u.target.tagName&&u.target.tagName.toUpperCase()==="IMG"},b=function(i,u,N){const we=u-N,_e=we/2;return i<0&&i<=-we?-_e:i>0?_e:!1},m=function(){re=!1;const i=()=>{if(B){let{width:u,height:N,left:we,top:_e}=B.getBoundingClientRect();const{height:Ge,width:Ue}=ge();if(u<Ue)n(7,D=0);else{const le=b(we,u,Ue);le!==!1&&le!==D&&n(7,D=le)}if(N<Ge)n(8,R=0);else{const le=b(_e,N,Ge);le!==!1&&n(8,R=le)}}};K&&K(),Date.now()-se>=Fe?i():K=xe(i,Fe),se=0},I=function(i){if(z(i)){const u=U(i);Z=u.x-D,Q=u.y-R,re=!0}},tn=function(i){if(re){const u=U(i);n(7,D=u.x-Z),n(8,R=u.y-Q),se=Date.now()}},Xe=function(){n(3,q=1),n(4,x=0),n(7,D=0),n(8,R=0),Z=0,Q=0,re=!1},Ae=function(){q>1&&(n(3,q=q-1),n(7,D=D*(1-1/q)),n(8,R=R*(1-1/q)))},Me=function(){n(3,q=q+1)},nn=function(){n(4,x=x-90)},rn=function(){n(4,x=x+90)},Ye=function(){y>0&&(n(5,y=y-1),v[y]&&oe(v[y]))},Ze=function(){y<Y-1&&(n(5,y=y+1),v[y]&&oe(v[y]))},on=i=>{i.addEventListener(c,function(u){m()}),o||i.addEventListener(s,function(u){ae(u)})},sn=i=>{i.addEventListener(a,function(u){ve()})},Ke=(i,u)=>{i.addEventListener(a,function(N){N.stopPropagation(),typeof u=="function"&&u()})},ln=(i,u)=>{i.addEventListener(a,function(N){N.preventDefault(),N.stopPropagation(),u()})},cn=i=>{o||i.addEventListener("wheel",function(u){P(u)},{passive:!1}),Ke(i),i.addEventListener(f,function(u){I(u)}),o&&i.addEventListener("touchend",function(u){m()})},fn=i=>{i.addEventListener(d,function(u){tn(u)})};function an(i){ze[i?"unshift":"push"](()=>{B=i,n(9,B)})}return t.$$set=i=>{"selector"in i&&n(23,r=i.selector)},t.$$.update=()=>{if(t.$$.dirty[0]&25165824){if(_={},n(6,Y=0),r||n(23,r=Array.from(document.querySelectorAll("img")||[])),Array.isArray(r)){const i=r.filter(u=>u instanceof HTMLElement);i&&i.length&&(n(24,v=i),n(6,Y=v.length))}else r instanceof HTMLElement?(n(24,v=[r]),n(6,Y=1)):typeof r=="string"&&(n(24,v=Array.from(document.querySelectorAll(r))),v&&v.length>0&&n(6,Y=v.length));v&&v.length>0&&v.forEach(i=>{i.addEventListener(a,F),o&&i.addEventListener("touchmove",function(){F.cancel()})})}},[h,$,C,q,x,y,Y,D,R,B,Xe,Ae,Me,nn,rn,Ye,Ze,on,sn,Ke,ln,cn,fn,r,v,an]}class en extends X{constructor(e){super(),W(this,e,Qt,Jt,V,{selector:23},Ut,[-1,-1])}}class Ve{constructor(e,n){new en({target:n instanceof HTMLElement?n:document.body,props:{selector:e}})}}const pe=[];function We(t){if(t&&t.length)for(let e of t)pe.indexOf(e)==-1&&pe.push(e)}return We(document.querySelectorAll("[data-humming] img")),We(document.querySelectorAll("[data-humming-img]")),pe.length&&new Ve(pe),Ve});
setTimeout(()=>{
let humming=  new Humming('figure>img')
console.log(`humming => %O `,humming);
},10*1000)
})();