| 1 |
!function(){var e={640:function(e,t,o){"use strict";var n=o(742),r={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var o,a,c,l,i,s,d=!1;t||(t={}),o=t.debug||!1;try{if(c=n(),l=document.createRange(),i=document.getSelection(),(s=document.createElement("span")).textContent=e,s.ariaHidden="true",s.style.all="unset",s.style.position="fixed",s.style.top=0,s.style.clip="rect(0, 0, 0, 0)",s.style.whiteSpace="pre",s.style.webkitUserSelect="text",s.style.MozUserSelect="text",s.style.msUserSelect="text",s.style.userSelect="text",s.addEventListener("copy",(function(n){if(n.stopPropagation(),t.format)if(n.preventDefault(),void 0===n.clipboardData){o&&console.warn("unable to use e.clipboardData"),o&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=r[t.format]||r.default;window.clipboardData.setData(a,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e);t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))})),document.body.appendChild(s),l.selectNodeContents(s),i.addRange(l),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");d=!0}catch(n){o&&console.error("unable to copy using execCommand: ",n),o&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),d=!0}catch(n){o&&console.error("unable to copy using clipboardData: ",n),o&&console.error("falling back to prompt"),a=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(a,e)}}finally{i&&("function"==typeof i.removeRange?i.removeRange(l):i.removeAllRanges()),s&&document.body.removeChild(s),c()}return d}},742:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,o=[],n=0;n<e.rangeCount;n++)o.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||o.forEach((function(t){e.addRange(t)})),t&&t.focus()}}}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,o),a.exports}o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=o(640),t=o.n(e);addEventListener("DOMContentLoaded",(()=>{Array.from(document.querySelectorAll(".code-block-pro-copy-button")).forEach((e=>{e.style.display="block",e.addEventListener("click",(e=>{var o,n,r;const a=null===(o=e.target)||void 0===o?void 0:o.closest("span");t()(null!==(n=null==a||null===(r=a.dataset)||void 0===r?void 0:r.code)&&void 0!==n?n:"",{format:"text/plain"}),a.classList.add("copying"),setTimeout((()=>{a.classList.remove("copying")}),2e3)}))}))})),addEventListener("DOMContentLoaded",(()=>{Array.from(document.querySelectorAll(".wp-block-kevinbatdorf-code-block-pro pre")).forEach((e=>{const t=e.querySelectorAll(".cbp-line-highlight");t.length&&(new ResizeObserver((t=>{t.forEach((t=>{const o=t.target.querySelector("code").offsetWidth,n=o+16===t.target.scrollWidth?o+16:t.target.scrollWidth+16;e.style.setProperty("--cbp-block-width","0"),e.style.setProperty("--cbp-block-width",`${n}px`)}))})).observe(e),t.forEach((e=>{e.insertAdjacentHTML("beforeend",'<span aria-hidden="true" class="cbp-line-highlighter"></span>')})))}))})),addEventListener("DOMContentLoaded",(()=>{var e,t;null!==(e=window.codeBlockPro)&&void 0!==e&&e.pluginUrl&&[...new Set(Array.from(null!==(t=document.querySelectorAll("[data-code-block-pro-font-family]"))&&void 0!==t?t:[]).map((e=>e.dataset.codeBlockProFontFamily)).filter(Boolean))].forEach((async e=>{const t=new FontFace(e,`url(${window.codeBlockPro.pluginUrl}/build/fonts/${e}.woff2)`);await t.load(),document.fonts.add(t)}))}))}()}(); |