← Back
Editing: 777.min.js
"use strict";(self.webpackChunkpost_expirator=self.webpackChunkpost_expirator||[]).push([[777],{777:(t,e,n)=>{n.r(e),n.d(e,{getFontEmbedCSS:()=>U,toBlob:()=>q,toCanvas:()=>M,toJpeg:()=>F,toPixelData:()=>H,toPng:()=>V,toSvg:()=>D});const r=(()=>{let t=0;return()=>(t+=1,`u${`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4)}${t}`)})();function o(t){const e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n]);return e}function i(t,e){const n=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(e);return n?parseFloat(n.replace("px","")):0}function a(t,e={}){return{width:e.width||function(t){const e=i(t,"border-left-width"),n=i(t,"border-right-width");return t.clientWidth+e+n}(t),height:e.height||function(t){const e=i(t,"border-top-width"),n=i(t,"border-bottom-width");return t.clientHeight+e+n}(t)}}const c=16384;function s(t){return new Promise(((e,n)=>{const r=new Image;r.decode=()=>e(r),r.onload=()=>e(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=t}))}const l=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return null!==n&&(n.constructor.name===e.name||l(n,e))};function u(t,e,n){const i=window.getComputedStyle(t,n),a=i.getPropertyValue("content");if(""===a||"none"===a)return;const c=r();try{e.className=`${e.className} ${c}`}catch(t){return}const s=document.createElement("style");s.appendChild(function(t,e,n){const r=`.${t}:${e}`,i=n.cssText?function(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}(n):function(t){return o(t).map((e=>`${e}: ${t.getPropertyValue(e)}${t.getPropertyPriority(e)?" !important":""};`)).join(" ")}(n);return document.createTextNode(`${r}{${i}}`)}(c,n,i)),e.appendChild(s)}const h="application/font-woff",d="image/jpeg",f={woff:h,woff2:h,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:d,jpeg:d,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function g(t){const e=function(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}(t).toLowerCase();return f[e]||""}function p(t){return-1!==t.search(/^(data:)/)}function m(t,e){return`data:${e};base64,${t}`}async function w(t,e,n){const r=await fetch(t,e);if(404===r.status)throw new Error(`Resource "${r.url}" not found`);const o=await r.blob();return new Promise(((t,e)=>{const i=new FileReader;i.onerror=e,i.onloadend=()=>{try{t(n({res:r,result:i.result}))}catch(t){e(t)}},i.readAsDataURL(o)}))}const y={};async function b(t,e,n){const r=function(t,e,n){let r=t.replace(/\?.*/,"");return n&&(r=t),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),e?`[${e}]${r}`:r}(t,e,n.includeQueryParams);if(null!=y[r])return y[r];let o;n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime());try{const r=await w(t,n.fetchRequestInit,(({res:t,result:n})=>(e||(e=t.headers.get("Content-Type")||""),function(t){return t.split(/,/)[1]}(n))));o=m(r,e)}catch(e){o=n.imagePlaceholder||"";let r=`Failed to fetch resource: ${t}`;e&&(r="string"==typeof e?e:e.message),r&&console.warn(r)}return y[r]=o,o}const S=t=>null!=t.tagName&&"SLOT"===t.tagName.toUpperCase();async function E(t,e,n){return n||!e.filter||e.filter(t)?Promise.resolve(t).then((t=>async function(t,e){return l(t,HTMLCanvasElement)?async function(t){const e=t.toDataURL();return"data:,"===e?t.cloneNode(!1):s(e)}(t):l(t,HTMLVideoElement)?async function(t,e){if(t.currentSrc){const e=document.createElement("canvas"),n=e.getContext("2d");return e.width=t.clientWidth,e.height=t.clientHeight,null==n||n.drawImage(t,0,0,e.width,e.height),s(e.toDataURL())}const n=t.poster,r=g(n);return s(await b(n,r,e))}(t,e):l(t,HTMLIFrameElement)?async function(t){var e;try{if(null===(e=null==t?void 0:t.contentDocument)||void 0===e?void 0:e.body)return await E(t.contentDocument.body,{},!0)}catch(t){}return t.cloneNode(!1)}(t):t.cloneNode(!1)}(t,e))).then((n=>async function(t,e,n){var r,i;let a=[];return a=S(t)&&t.assignedNodes?o(t.assignedNodes()):l(t,HTMLIFrameElement)&&(null===(r=t.contentDocument)||void 0===r?void 0:r.body)?o(t.contentDocument.body.childNodes):o((null!==(i=t.shadowRoot)&&void 0!==i?i:t).childNodes),0===a.length||l(t,HTMLVideoElement)||await a.reduce(((t,r)=>t.then((()=>E(r,n))).then((t=>{t&&e.appendChild(t)}))),Promise.resolve()),e}(t,n,e))).then((e=>function(t,e){return l(e,Element)&&(function(t,e){const n=e.style;if(!n)return;const r=window.getComputedStyle(t);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):o(r).forEach((o=>{let i=r.getPropertyValue(o);if("font-size"===o&&i.endsWith("px")){const t=Math.floor(parseFloat(i.substring(0,i.length-2)))-.1;i=`${t}px`}l(t,HTMLIFrameElement)&&"display"===o&&"inline"===i&&(i="block"),"d"===o&&e.getAttribute("d")&&(i=`path(${e.getAttribute("d")})`),n.setProperty(o,i,r.getPropertyPriority(o))}))}(t,e),function(t,e){u(t,e,":before"),u(t,e,":after")}(t,e),function(t,e){l(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),l(t,HTMLInputElement)&&e.setAttribute("value",t.value)}(t,e),function(t,e){if(l(t,HTMLSelectElement)){const n=e,r=Array.from(n.children).find((e=>t.value===e.getAttribute("value")));r&&r.setAttribute("selected","")}}(t,e)),e}(t,e))).then((t=>async function(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(0===n.length)return t;const r={};for(let o=0;o<n.length;o++){const i=n[o].getAttribute("xlink:href");if(i){const n=t.querySelector(i),o=document.querySelector(i);n||!o||r[i]||(r[i]=await E(o,e,!0))}}const o=Object.values(r);if(o.length){const e="http://www.w3.org/1999/xhtml",n=document.createElementNS(e,"svg");n.setAttribute("xmlns",e),n.style.position="absolute",n.style.width="0",n.style.height="0",n.style.overflow="hidden",n.style.display="none";const r=document.createElementNS(e,"defs");n.appendChild(r);for(let t=0;t<o.length;t++)r.appendChild(o[t]);t.appendChild(n)}return t}(t,e))):null}const x=/url\((['"]?)([^'"]+?)\1\)/g,v=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,$=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function C(t){return-1!==t.search(x)}async function P(t,e,n){if(!C(t))return t;const r=function(t,{preferredFontFormat:e}){return e?t.replace($,(t=>{for(;;){const[n,,r]=v.exec(t)||[];if(!r)return"";if(r===e)return`src: ${n};`}})):t}(t,n),o=function(t){const e=[];return t.replace(x,((t,n,r)=>(e.push(r),t))),e.filter((t=>!p(t)))}(r);return o.reduce(((t,r)=>t.then((t=>async function(t,e,n,r,o){try{const i=n?function(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),o=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(o),e&&(r.href=e),o.href=t,o.href}(e,n):e,a=g(e);let c;return c=o?m(await o(i),a):await b(i,a,r),t.replace(function(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}(e),`$1${c}$3`)}catch(t){}return t}(t,r,e,n)))),Promise.resolve(r))}async function R(t,e,n){var r;const o=null===(r=e.style)||void 0===r?void 0:r.getPropertyValue(t);if(o){const r=await P(o,null,n);return e.style.setProperty(t,r,e.style.getPropertyPriority(t)),!0}return!1}async function T(t,e){l(t,Element)&&(await async function(t,e){await R("background",t,e)||await R("background-image",t,e),await R("mask",t,e)||await R("mask-image",t,e)}(t,e),await async function(t,e){const n=l(t,HTMLImageElement);if((!n||p(t.src))&&(!l(t,SVGImageElement)||p(t.href.baseVal)))return;const r=n?t.src:t.href.baseVal,o=await b(r,g(r),e);await new Promise(((e,r)=>{t.onload=e,t.onerror=r;const i=t;i.decode&&(i.decode=e),"lazy"===i.loading&&(i.loading="eager"),n?(t.srcset="",t.src=o):t.href.baseVal=o}))}(t,e),await async function(t,e){const n=o(t.childNodes).map((t=>T(t,e)));await Promise.all(n).then((()=>t))}(t,e))}const A={};async function L(t){let e=A[t];if(null!=e)return e;const n=await fetch(t);return e={url:t,cssText:await n.text()},A[t]=e,e}async function N(t,e){let n=t.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map((async o=>{let i=o.replace(r,"$1");return i.startsWith("https://")||(i=new URL(i,t.url).href),w(i,e.fetchRequestInit,(({result:t})=>(n=n.replace(o,`url(${t})`),[o,t])))}));return Promise.all(o).then((()=>n))}function k(t){if(null==t)return[];const e=[];let n=t.replace(/(\/\*[\s\S]*?\*\/)/gi,"");const r=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const t=r.exec(n);if(null===t)break;e.push(t[0])}n=n.replace(r,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let t=o.exec(n);if(null===t){if(t=i.exec(n),null===t)break;o.lastIndex=i.lastIndex}else i.lastIndex=o.lastIndex;e.push(t[0])}return e}async function I(t,e){const n=await async function(t,e){if(null==t.ownerDocument)throw new Error("Provided element is not within a Document");const n=o(t.ownerDocument.styleSheets),r=await async function(t,e){const n=[],r=[];return t.forEach((n=>{if("cssRules"in n)try{o(n.cssRules||[]).forEach(((t,o)=>{if(t.type===CSSRule.IMPORT_RULE){let i=o+1;const a=L(t.href).then((t=>N(t,e))).then((t=>k(t).forEach((t=>{try{n.insertRule(t,t.startsWith("@import")?i+=1:n.cssRules.length)}catch(e){console.error("Error inserting rule from remote css",{rule:t,error:e})}})))).catch((t=>{console.error("Error loading remote css",t.toString())}));r.push(a)}}))}catch(o){const i=t.find((t=>null==t.href))||document.styleSheets[0];null!=n.href&&r.push(L(n.href).then((t=>N(t,e))).then((t=>k(t).forEach((t=>{i.insertRule(t,n.cssRules.length)})))).catch((t=>{console.error("Error loading remote stylesheet",t)}))),console.error("Error inlining remote css file",o)}})),Promise.all(r).then((()=>(t.forEach((t=>{if("cssRules"in t)try{o(t.cssRules||[]).forEach((t=>{n.push(t)}))}catch(e){console.error(`Error while reading CSS rules from ${t.href}`,e)}})),n)))}(n,e);return function(t){return t.filter((t=>t.type===CSSRule.FONT_FACE_RULE)).filter((t=>C(t.style.getPropertyValue("src"))))}(r)}(t,e);return(await Promise.all(n.map((t=>{const n=t.parentStyleSheet?t.parentStyleSheet.href:null;return P(t.cssText,n,e)})))).join("\n")}async function D(t,e={}){const{width:n,height:r}=a(t,e),o=await E(t,e,!0);return await async function(t,e){const n=null!=e.fontEmbedCSS?e.fontEmbedCSS:e.skipFonts?null:await I(t,e);if(n){const e=document.createElement("style"),r=document.createTextNode(n);e.appendChild(r),t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}}(o,e),await T(o,e),function(t,e){const{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);const r=e.style;null!=r&&Object.keys(r).forEach((t=>{n[t]=r[t]}))}(o,e),await async function(t,e,n){const r="http://www.w3.org/2000/svg",o=document.createElementNS(r,"svg"),i=document.createElementNS(r,"foreignObject");return o.setAttribute("width",`${e}`),o.setAttribute("height",`${n}`),o.setAttribute("viewBox",`0 0 ${e} ${n}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),o.appendChild(i),i.appendChild(t),async function(t){return Promise.resolve().then((()=>(new XMLSerializer).serializeToString(t))).then(encodeURIComponent).then((t=>`data:image/svg+xml;charset=utf-8,${t}`))}(o)}(o,n,r)}async function M(t,e={}){const{width:n,height:r}=a(t,e),o=await D(t,e),i=await s(o),l=document.createElement("canvas"),u=l.getContext("2d"),h=e.pixelRatio||function(){let t,e;try{e=process}catch(t){}const n=e&&e.env?e.env.devicePixelRatio:null;return n&&(t=parseInt(n,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}(),d=e.canvasWidth||n,f=e.canvasHeight||r;return l.width=d*h,l.height=f*h,e.skipAutoScale||function(t){(t.width>c||t.height>c)&&(t.width>c&&t.height>c?t.width>t.height?(t.height*=c/t.width,t.width=c):(t.width*=c/t.height,t.height=c):t.width>c?(t.height*=c/t.width,t.width=c):(t.width*=c/t.height,t.height=c))}(l),l.style.width=`${d}`,l.style.height=`${f}`,e.backgroundColor&&(u.fillStyle=e.backgroundColor,u.fillRect(0,0,l.width,l.height)),u.drawImage(i,0,0,l.width,l.height),l}async function H(t,e={}){const{width:n,height:r}=a(t,e);return(await M(t,e)).getContext("2d").getImageData(0,0,n,r).data}async function V(t,e={}){return(await M(t,e)).toDataURL()}async function F(t,e={}){return(await M(t,e)).toDataURL("image/jpeg",e.quality||1)}async function q(t,e={}){const n=await M(t,e),r=await function(t,e={}){return t.toBlob?new Promise((n=>{t.toBlob(n,e.type?e.type:"image/png",e.quality?e.quality:1)})):new Promise((n=>{const r=window.atob(t.toDataURL(e.type?e.type:void 0,e.quality?e.quality:void 0).split(",")[1]),o=r.length,i=new Uint8Array(o);for(let t=0;t<o;t+=1)i[t]=r.charCodeAt(t);n(new Blob([i],{type:e.type?e.type:"image/png"}))}))}(n);return r}async function U(t,e={}){return I(t,e)}}}]);
Save File
Cancel