You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
7 months ago
|
"use strict";(globalThis.webpackChunkweb_stories_wp=globalThis.webpackChunkweb_stories_wp||[]).push([[3182],{10183:(t,e,n)=>{n.r(e),n.d(e,{getFontEmbedCSS:()=>_,toBlob:()=>B,toCanvas:()=>F,toJpeg:()=>O,toPixelData:()=>j,toPng:()=>q,toSvg:()=>U});const r="application/font-woff",o="image/jpeg",i={woff:r,woff2:r,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:o,jpeg:o,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"};function a(t){const e=function(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}(t).toLowerCase();return i[e]||""}function s(t){return-1!==t.search(/^(data:)/)}function c(t,e){return`data:${e};base64,${t}`}async function l(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 u={};async function h(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!=u[r])return u[r];let o;n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime());try{const r=await l(t,n.fetchRequestInit,(({res:t,result:n})=>(e||(e=t.headers.get("Content-Type")||""),function(t){return t.split(/,/)[1]}(n))));o=c(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 u[r]=o,o}const f=(()=>{let t=0;return()=>(t+=1,`u${`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4)}${t}`)})();function d(t){const e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n]);return e}function g(t,e){const n=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(e);return n?parseFloat(n.replace("px","")):0}function p(t,e={}){return{width:e.width||function(t){const e=g(t,"border-left-width"),n=g(t,"border-right-width");return t.clientWidth+e+n}(t),height:e.height||function(t){const e=g(t,"border-top-width"),n=g(t,"border-bottom-width");return t.clientHeight+e+n}(t)}}const w=16384;function m(t){return new Promise(((e,n)=>{const r=new Image;r.onerror=n,r.crossOrigin="anonymous",r.decoding="sync",r.src=t,r.decode().then((()=>e(r))).catch(n)}))}async function y(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)}function b(t,e,n){const r=`.${t}:${e}`,o=n.cssText?function(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}(n):function(t){return d(t).map((e=>`${e}: ${t.getPropertyValue(e)}${t.getPropertyPriority(e)?" !important":""};`)).join(" ")}(n);return document.createTextNode(`${r}{${o}}`)}function S(t,e,n){const r=window.getComputedStyle(t,n),o=r.getPropertyValue("content");if(""===o||"none"===o)return;const i=f();try{e.className=`${e.className} ${i}`}catch(t){return}const a=document.createElement("style");a.appendChild(b(i,n,r)),e.appendChild(a)}async function E(t,e){return t instanceof HTMLCanvasElement?async function(t){const e=t.toDataURL();return"data:,"===e?t.cloneNode(!1):m(e)}(t):t instanceof HTMLVideoElement&&t.poster?async function(t,e){const n=t.poster,r=a(n);return m(await h(n,r,e))}(t,e):t.cloneNode(!1)}const $=t=>null!=t.tagName&&"SLOT"===t.tagName.toUpperCase();function x(t,e){return e instanceof 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):d(r).forEa
|