1/** 2 * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1. 3 * Original file: /npm/[email protected]/dist/bundle.js 4 * 5 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 */ 7var U={exports:{}},E;function z(){return E||(E=1,(function(M,V){(function(w,S){M.exports=S()})(window,(function(){return(function(w){var S={};function u(n){if(S[n])return S[n].exports;var a=S[n]={i:n,l:!1,exports:{}};return w[n].call(a.exports,a,a.exports,u),a.l=!0,a.exports}return u.m=w,u.c=S,u.d=function(n,a,m){u.o(n,a)||Object.defineProperty(n,a,{enumerable:!0,get:m})},u.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},u.t=function(n,a){if(1&a&&(n=u(n)),8&a||4&a&&typeof n=="object"&&n&&n.__esModule)return n;var m=Object.create(null);if(u.r(m),Object.defineProperty(m,"default",{enumerable:!0,value:n}),2&a&&typeof n!="string")for(var b in n)u.d(m,b,function(d){return n[d]}.bind(null,b));return m},u.n=function(n){var a=n&&n.__esModule?function(){return n.default}:function(){return n};return u.d(a,"a",a),a},u.o=function(n,a){return Object.prototype.hasOwnProperty.call(n,a)},u.p="/",u(u.s=0)})([function(w,S,u){function n(b){return(function(d){if(Array.isArray(d)){for(var h=0,c=new Array(d.length);h<d.length;h++)c[h]=d[h];return c}})(b)||(function(d){if(Symbol.iterator in Object(d)||Object.prototype.toString.call(d)==="[object Arguments]")return Array.from(d)})(b)||(function(){throw new TypeError("Invalid attempt to spread non-iterable instance")})()}function a(b,d){for(var h=0;h<d.length;h++){var c=d[h];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(b,c.key,c)}}u(1).toString();var m=(function(){function b(o){var i=o.data,p=(o.config,o.api);(function(g,x){if(!(g instanceof x))throw new TypeError("Cannot call a class as a function")})(this,b),this.api=p,this.blockIndex=this.api.blocks.getCurrentBlockIndex()+1,this.CSS={baseClass:this.api.styles.block,loading:this.api.styles.loader,input:this.api.styles.input,settingsButton:this.api.styles.settingsButton,settingsButtonActive:this.api.styles.settingsButtonActive,wrapper:"cdx-simple-image",imageHolder:"cdx-simple-image__picture",caption:"cdx-simple-image__caption"},this.nodes={wrapper:null,imageHolder:null,image:null,caption:null},this.data={url:i.url||"",caption:i.caption||"",withBorder:i.withBorder!==void 0&&i.withBorder,withBackground:i.withBackground!==void 0&&i.withBackground,stretched:i.stretched!==void 0&&i.stretched},this.settings=[{name:"withBorder",icon:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15.8 10.592v2.043h2.35v2.138H15.8v2.232h-2.25v-2.232h-2.4v-2.138h2.4v-2.28h2.25v.237h1.15-1.15zM1.9 8.455v-3.42c0-1.154.985-2.09 2.2-2.09h4.2v2.137H4.15v3.373H1.9zm0 2.137h2.25v3.325H8.3v2.138H4.1c-1.215 0-2.2-.936-2.2-2.09v-3.373zm15.05-2.137H14.7V5.082h-4.15V2.945h4.2c1.215 0 2.2.936 2.2 2.09v3.42z"/></svg>'},{name:"stretched",icon:'<svg width="17" height="10" viewBox="0 0 17 10" xmlns="http://www.w3.org/2000/svg"><path d="M13.568 5.925H4.056l1.703 1.703a1.125 1.125 0 0 1-1.59 1.591L.962 6.014A1.069 1.069 0 0 1 .588 4.26L4.38.469a1.069 1.069 0 0 1 1.512 1.511L4.084 3.787h9.606l-1.85-1.85a1.069 1.069 0 1 1 1.512-1.51l3.792 3.791a1.069 1.069 0 0 1-.475 1.788L13.514 9.16a1.125 1.125 0 0 1-1.59-1.591l1.644-1.644z"/></svg>'},{name:"withBackground",icon:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.043 8.265l3.183-3.183h-2.924L4.75 10.636v2.923l4.15-4.15v2.351l-2.158 2.159H8.9v2.137H4.7c-1.215 0-2.2-.936-2.2-2.09v-8.93c0-1.154.985-2.09 2.2-2.09h10.663l.033-.033.034.034c1.178.04 2.12.96 2.12 2.089v3.23H15.3V5.359l-2.906 2.906h-2.35zM7.951 5.082H4.75v3.201l3.201-3.2zm5.099 7.078v3.04h4.15v-3.04h-4.15zm-1.1-2.137h6.35c.635 0 1.15.489 1.15 1.092v5.13c0 .603-.515 1.092-1.15 1.092h-6.35c-.635 0-1.15-.489-1.15-1.092v-5.13c0-.603.515-1.092 1.15-1.092z"/></svg>'}]}var d,h,c;return d=b,c=[{key:"toolbox",get:function(){return{title:"Image",icon:'<svg width="17" height="15" viewBox="0 0 336 276" xmlns="http://www.w3.org/2000/svg"><path d="M291 150V79c0-19-15-34-34-34H79c-19 0-34 15-34 34v42l67-44 81 72 56-29 42 30zm0 52l-43-30-56 30-81-67-66 39v23c0 19 15 34 34 34h178c17 0 31-13 34-29zM79 0h178c44 0 79 35 79 79v118c0 44-35 79-79 79H79c-44 0-79-35-79-79V79C0 35 35 0 79 0z"/></svg>'}}},{key:"sanitize",get:function(){return{url:{},withBorder:{}
7,withBackground:{},stretched:{},caption:{br:!0}}}},{key:"pasteConfig",get:function(){return{patterns:{image:/https?:\/\/\S+\.(gif|jpe?g|tiff|png)$/i},tags:["img"],files:{mimeTypes:["image/*"]}}}}],(h=[{key:"render",value:function(){var o=this,i=this._make("div",[this.CSS.baseClass,this.CSS.wrapper]),p=this._make("input",[],{type:"file"}),g=this._make("div",this.CSS.loading),x=this._make("div",this.CSS.imageHolder),k=this._make("img"),C=this._make("div",[this.CSS.input,this.CSS.caption],{contentEditable:"true",innerHTML:this.data.caption||""});return this.nodes.imageHolder=x,this.nodes.wrapper=i,this.nodes.image=k,this.nodes.caption=C,this.nodes.loader=g,this.nodes.loadButton=p,C.dataset.placeholder="Enter a caption",k.onload=function(){i.classList.remove(o.CSS.loading),x.appendChild(k),i.appendChild(x),i.appendChild(C),g.remove(),p!==null&&(p.remove(),p=null),o.nodes.loader=null,o._acceptTuneView()},k.onerror=function(_){console.log("Failed to load an image",_)},this.data.url?(i.appendChild(g),k.src=this.data.url):(i.appendChild(p),p.onchange=function(_){var B=_.target.files[0],j=URL.createObjectURL(B);o.data={url:j,caption:B.name},p.remove(),p=null}),i}},{key:"save",value:function(o){var i=o.querySelector("img"),p=o.querySelector("."+this.CSS.input);return i?Object.assign(this.data,{url:i.src,caption:p.innerHTML}):this.data}},{key:"onPaste",value:function(o){switch(o.type){case"tag":var i=o.detail.data;this.data={url:i.src};break;case"pattern":var p=o.detail.data;this.data={url:p};break;case"file":var g=o.detail.file;this.data={url:URL.createObjectURL(g),caption:g.name}}this.nodes.loadButton.remove(),this.nodes.loadButton=null}},{key:"renderSettings",value:function(){var o=this,i=document.createElement("div");return this.settings.forEach((function(p){var g=document.createElement("div");g.classList.add(o.CSS.settingsButton),g.innerHTML=p.icon,g.addEventListener("click",(function(){o._toggleTune(p.name),g.classList.toggle(o.CSS.settingsButtonActive)})),g.classList.toggle(o.CSS.settingsButtonActive,o.data[p.name]),i.appendChild(g)})),i}},{key:"removed",value:function(){this.data.url&&this.data.url.startsWith("blob:")&&URL.revokeObjectURL(this.data.url)}},{key:"_make",value:function(o){var i,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},x=document.createElement(o);for(var k in Array.isArray(p)?(i=x.classList).add.apply(i,n(p)):p&&x.classList.add(p),g)x[k]=g[k];return x}},{key:"_toggleTune",value:function(o){this.data[o]=!this.data[o],this._acceptTuneView()}},{key:"_acceptTuneView",value:function(){var o=this;this.settings.forEach((function(i){o.nodes.imageHolder.classList.toggle(o.CSS.imageHolder+"--"+i.name.replace(/([A-Z])/g,(function(p){return"-".concat(p[0].toLowerCase())})),!!o.data[i.name]),i.name==="stretched"&&o.api.blocks.stretchBlock(o.blockIndex,!!o.data.stretched)}))}},{key:"data",get:function(){return this._data},set:function(o){this._data=Object.assign({},this.data,o),this.nodes.image&&(this.nodes.image.src=this.data.url),this.nodes.caption&&(this.nodes.caption.innerHTML=this.data.caption)}}])&&a(d.prototype,h),c&&a(d,c),b})();w.exports=m},function(w,S,u){var n=u(2);typeof n=="string"&&(n=[[w.i,n,""]]);var a={hmr:!0,transform:void 0,insertInto:void 0};u(4)(n,a),n.locals&&(w.exports=n.locals)},function(w,S,u){(w.exports=u(3)(!1)).push([w.i,`.cdx-simple-image {} 8 9.cdx-simple-image .cdx-loader { 10 min-height: 200px; 11} 12 13.cdx-simple-image .cdx-input { 14 margin-top: 10px; 15} 16 17.cdx-simple-image img { 18 max-width: 100%; 19 vertical-align: bottom; 20} 21 22.cdx-simple-image__caption[contentEditable=true][data-placeholder]:empty::before { 23 position: absolute; 24 content: attr(data-placeholder); 25 color: #707684; 26 font-weight: normal; 27 opacity: 0; 28 } 29 30.cdx-simple-image__caption[contentEditable=true][data-placeholder]:empty::before { 31 opacity: 1; 32} 33 34.cdx-simple-image__caption[contentEditable=true][data-placeholder]:empty:focus::before { 35 opacity: 0; 36} 37 38 39.cdx-simple-image__picture--with-background { 40 background: #eff2f5; 41 padding: 10px; 42} 43 44.cdx-simple-image__picture--with-background img { 45 display: block; 46 max-width: 60%; 47 margin: 0 auto; 48} 49 50.cdx-simple-image__picture--with-border { 51 border: 1px solid #e8e8eb; 52 padding: 1px; 53} 54 55.cdx-simple-image__picture--stretched img { 56 max-width: none; 57 width: 100%; 58} 59`,""])},function(w,S){w.exports=function(u){var n=[];return n.toString=function(){return this.map((function(a){var m=(function(b,d){var h=b[1]||"",c=b[3];if(!c)return h;if(d&&typeof btoa=="function"){var o=(p=c,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(p))))+" */"),i=c.sources.map((function(g){return"/*# sourceURL="+c.sourceRoot+g+" */"}));
vendor: 4,337 bytes, lines 59-67
59return[h].concat(i).concat([o]).join(` 60`)}var p;return[h].join(` 61`)})(a,u);return a[2]?"@media "+a[2]+"{"+m+"}":m})).join("")},n.i=function(a,m){typeof a=="string"&&(a=[[null,a,""]]);for(var b={},d=0;d<this.length;d++){var h=this[d][0];typeof h=="number"&&(b[h]=!0)}for(d=0;d<a.length;d++){var c=a[d];typeof c[0]=="number"&&b[c[0]]||(m&&!c[2]?c[2]=m:m&&(c[2]="("+c[2]+") and ("+m+")"),n.push(c))}},n}},function(w,S,u){var n,a,m={},b=(n=function(){return window&&document&&document.all&&!window.atob},function(){return a===void 0&&(a=n.apply(this,arguments)),a}),d=function(t){return document.querySelector(t)},h=(function(t){var e={};return function(r){if(typeof r=="function")return r();if(e[r]===void 0){var s=d.call(this,r);if(window.HTMLIFrameElement&&s instanceof window.HTMLIFrameElement)try{s=s.contentDocument.head}catch{s=null}e[r]=s}return e[r]}})(),c=null,o=0,i=[],p=u(5);function g(t,e){for(var r=0;r<t.length;r++){var s=t[r],f=m[s.id];if(f){f.refs++;for(var l=0;l<f.parts.length;l++)f.parts[l](s.parts[l]);for(;l<s.parts.length;l++)f.parts.push(j(s.parts[l],e))}else{var y=[];for(l=0;l<s.parts.length;l++)y.push(j(s.parts[l],e));m[s.id]={id:s.id,refs:1,parts:y}}}}function x(t,e){for(var r=[],s={},f=0;f<t.length;f++){var l=t[f],y=e.base?l[0]+e.base:l[0],v={css:l[1],media:l[2],sourceMap:l[3]};s[y]?s[y].parts.push(v):r.push(s[y]={id:y,parts:[v]})}return r}function k(t,e){var r=h(t.insertInto);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var s=i[i.length-1];if(t.insertAt==="top")s?s.nextSibling?r.insertBefore(e,s.nextSibling):r.appendChild(e):r.insertBefore(e,r.firstChild),i.push(e);else if(t.insertAt==="bottom")r.appendChild(e);else{if(typeof t.insertAt!="object"||!t.insertAt.before)throw new Error(`[Style Loader] 62 63 Invalid value for parameter 'insertAt' ('options.insertAt') found. 64 Must be 'top', 'bottom', or Object. 65 (https://github.com/webpack-contrib/style-loader#insertat) 66`);var f=h(t.insertInto+" "+t.insertAt.before);r.insertBefore(e,f)}}function C(t){if(t.parentNode===null)return!1;t.parentNode.removeChild(t);var e=i.indexOf(t);e>=0&&i.splice(e,1)}function _(t){var e=document.createElement("style");return t.attrs.type===void 0&&(t.attrs.type="text/css"),B(e,t.attrs),k(t,e),e}function B(t,e){Object.keys(e).forEach((function(r){t.setAttribute(r,e[r])}))}function j(t,e){var r,s,f,l;if(e.transform&&t.css){if(!(l=e.transform(t.css)))return function(){};t.css=l}if(e.singleton){var y=o++;r=c||(c=_(e)),s=A.bind(null,r,y,!1),f=A.bind(null,r,y,!0)}else t.sourceMap&&typeof URL=="function"&&typeof URL.createObjectURL=="function"&&typeof URL.revokeObjectURL=="function"&&typeof Blob=="function"&&typeof btoa=="function"?(r=(function(v){var L=document.createElement("link");return v.attrs.type===void 0&&(v.attrs.type="text/css"),v.attrs.rel="stylesheet",B(L,v.attrs),k(v,L),L})(e),s=I.bind(null,r,e),f=function(){C(r),r.href&&URL.revokeObjectURL(r.href)}):(r=_(e),s=T.bind(null,r),f=function(){C(r)});return s(t),function(v){if(v){if(v.css===t.css&&v.media===t.media&&v.sourceMap===t.sourceMap)return;s(t=v)}else f()}}w.exports=function(t,e){if(typeof DEBUG<"u"&&DEBUG&&typeof document!="object")throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs=typeof e.attrs=="object"?e.attrs:{},e.singleton||typeof e.singleton=="boolean"||(e.singleton=b()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var r=x(t,e);return g(r,e),function(s){for(var f=[],l=0;l<r.length;l++){var y=r[l];(v=m[y.id]).refs--,f.push(v)}for(s&&g(x(s,e),e),l=0;l<f.length;l++){var v;if((v=f[l]).refs===0){for(var L=0;L<v.parts.length;L++)v.parts[L]();delete m[v.id]}}}};var O,R=(O=[],function(t,e){return O[t]=e,O.filter(Boolean).join(` 67`)});function A(t,e,r,s){var f=r?"":s.css;if(t.styleSheet)t.styleSheet.cssText=R(e,f);else{var l=document.createTextNode(f),y=t.childNodes;y[e]&&t.removeChild(y[e]),y.length?t.insertBefore(l,y[e]):t.appendChild(l)}}function T(t,e){var r=e.css,s=e.media;if(s&&t.setAttribute("media",s),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}function I(t,e,r){var s=r.css,f=r.sourceMap,l=e.convertToAbsoluteUrls===void 0&&f;(e.convertToAbsoluteUrls||l)&&(s=p(s)),f&&(s+=`
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.