@plotdb/lotion 0.2.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/vector.min.js ADDED
@@ -0,0 +1 @@
1
+ !function(){var C,P,t,e,n,r,L,j,_,o,v,F,B,z,w,V,M,R,i,h,f,g,a,b,l,x,H,k,D,G,T,S,A,c,m,s,I,y,X,N,J,Z,K,$,O,Q,Y,tt,et,d,nt,rt,ot,W,q,it,at,lt,st,ut,ft,ct,ht,pt,E,dt,gt,p=window.lotion,u=p.libs;for(u.satori="https://cdn.jsdelivr.net/npm/satori@0.36.0/+esm",u.woff2="https://cdn.jsdelivr.net/npm/woff2-encoder@2.0.0/dist/decompress.js",u.hbsubset="https://cdn.jsdelivr.net/npm/harfbuzzjs@1.6.3/dist/harfbuzz-subset.wasm",C=["color","fontFamily","fontSize","fontWeight","fontStyle","lineHeight","letterSpacing","textAlign","whiteSpace","wordBreak","textTransform","textShadow","textIndent","backgroundColor","backgroundImage","backgroundPosition","backgroundSize","backgroundRepeat","backgroundClip","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","paddingTop","paddingRight","paddingBottom","paddingLeft","boxShadow","opacity","filter","clipPath","overflow","zIndex","transform","transformOrigin","maskImage","maskPosition","maskSize","maskRepeat"],P={textShadow:"none",textIndent:"0px",textTransform:"none",backgroundColor:"rgba(0, 0, 0, 0)",backgroundImage:"none",backgroundPosition:"0% 0%",backgroundSize:"auto",backgroundRepeat:"repeat",backgroundClip:"border-box",boxShadow:"none",opacity:"1",filter:"none",clipPath:"none",overflow:"visible",zIndex:"auto",transform:"none",maskImage:"none",maskPosition:"0% 0%",maskSize:"auto",maskRepeat:"repeat",lineHeight:"normal",letterSpacing:"normal"},t=0,e=(u=["Top","Right","Bottom","Left"]).length;t<e;++t)n=u[t],P["border"+n+"Width"]="0px",P["border"+n+"Style"]="none",P["padding"+n]="0px";for(t=0,e=(u=["TopLeft","TopRight","BottomRight","BottomLeft"]).length;t<e;++t)r=u[t],P["border"+r+"Radius"]="0px";function U(t,e){for(var n=-1,r=e.length>>>0;++n<r;)if(t===e[n])return 1}L=["color","fontFamily","fontSize","fontWeight","fontStyle","lineHeight","letterSpacing","textAlign","whiteSpace","wordBreak","textTransform","textShadow","textIndent"],j={backdropFilter:"none",textDecorationLine:"none"},_=function(t){for(var e,n=new Uint8Array(t),r="",o=0,i=n.length;o<i;o+=32768)e=o,r+=String.fromCharCode.apply(null,n.subarray(e,e+32768));return btoa(r)},o=function(t){return _((new TextEncoder).encode(t))},v=function(t){return"data:image/svg+xml;base64,"+o(t)},F=function(t){for(var e,n=[],r=[0,""],o=r[0],i=r[1],a=0,l=t.length;a<l;++a)"("===(e=t[a])&&o++,")"===e&&o--,","===e&&0===o?(n.push(i.trim()),i=""):i+=e;return n.push(i.trim()),n.map(function(t){var e;return(e=/^((?:rgba?|hsla?|color)\([^)]*\)|#[0-9a-f]+|[a-z]+)\s+(.*)$/i.exec(t))&&"inset"!==e[1]?e[2]+" "+e[1]:t}).join(", ")},B=function(t){return t.replace(/url\("data:image\/svg\+xml(?:;charset=[^,;]+)?(?:;utf8)?,([^"]*)"\)/g,function(t,e){return'url("'+v((()=>{try{return decodeURIComponent(e)}catch(t){return e}})())+'")'})},z=function(t,e,n,r){var o,i;return null!=t.offsetWidth?(o=t.offsetLeft,i=t.offsetTop,t.offsetParent!==e&&e.offsetParent===t.offsetParent&&(o-=e.offsetLeft+e.clientLeft,i-=e.offsetTop+e.clientTop),[o,i,t.offsetWidth,t.offsetHeight]):(o=(e=[parseFloat(n.width)||0,parseFloat(n.height)||0])[0],i=e[1],"absolute"===(e=n.position)||"fixed"===e?[parseFloat(n.left)||0,parseFloat(n.top)||0,o,i]:(r.warn("<"+t.tagName.toLowerCase()+"> not absolutely positioned: placed at its parent's origin"),[0,0,o,i]))},V=function(t,e,n,c,h){var p,d,r,o,i,a,l,s,u,f,g,m,y,b=t.cloneNode(!0);for(b.setAttribute("width",e),b.setAttribute("height",n),b.getAttribute("viewBox")||b.setAttribute("viewBox","0 0 "+e+" "+n),b.removeAttribute("style"),e=[t].concat(Array.from(t.querySelectorAll("*"))),p=[b].concat(Array.from(b.querySelectorAll("*"))),d=[],e.map(function(t,e){for(var n,r,o,i=p[e],a=getComputedStyle(t),l=0===e?null:getComputedStyle(t.parentNode),s=[],u=0,f=(n=w).length;u<f;++u)r=n[u],o=a.getPropertyValue(r),l&&l.getPropertyValue(r)===o||(0!==e||"opacity"!==r&&"visibility"!==r&&"display"!==r&&"filter"!==r&&"mask"!==r&&"clip-path"!==r)&&s.push(r+":"+o);if(s.length&&i.setAttribute("style",s.join(";")),("text"===(n=t.tagName.toLowerCase())||"tspan"===n||"textpath"===n)&&!t.querySelector("tspan, textPath"))return c.text(a,t.textContent,t={}),d.push([i,t])}),r=new Set,o=0,i=p.length;o<i;++o)for(a=p[o],l=0,u=(s=Array.from(a.attributes)).length;l<u;++l)for(f=s[l],g=/url\(\s*['"]?#([^'")\s]+)['"]?\s*\)|^#(.+)$/g;m=g.exec(f.value);)r.add(m[1]||m[2]);return y=null,r.forEach(function(t){if(!b.querySelector('[id="'+CSS.escape(t)+'"]')&&(t=document.getElementById(t)))return y||(y=document.createElementNS("http://www.w3.org/2000/svg","defs"),b.insertBefore(y,b.firstChild)),y.appendChild(t.cloneNode(!0))}),c.later(function(t){for(var e,n,r,o,i,a,l,s,u=new Set,f=0,c=(e=d).length;f<c;++f)if(r=(n=e[f])[0],(o=n[1]).fontFamily)for(i=r.getAttribute("style")||"",r.setAttribute("style",i+";font-family:"+o.fontFamily),a=0,l=(n=o.fontFamily.split(",")).length;a<l;++a)s=n[a],u.add(s.trim().replace(/'/g,""));return(t=t.filter(function(t){return u.has(t.name)}).map(function(t){return"@font-face{font-family:'"+t.name+"';font-weight:"+t.weight+";font-style:"+t.style+";src:url(data:font/ttf;base64,"+_(t.data)+") format('truetype')}"})).length&&((i=document.createElementNS("http://www.w3.org/2000/svg","style")).textContent=t.join(""),b.insertBefore(i,b.firstChild)),h.props.src=v((new XMLSerializer).serializeToString(b))}),"pending:"+(new XMLSerializer).serializeToString(b)},M=function(t,e){var n,r=t.props.style;return(r.maskImage||r.clipPath)&&r.transform&&((n=(n=/^matrix\(([^)]+)\)$/.exec(r.transform))?n[1].split(",").map(function(t){return+t}):null)&&1===n[0]&&0===n[1]&&0===n[2]&&1===n[3]?(r.left+=n[4],r.top+=n[5],delete r.transform,delete r.transformOrigin):e.warn("mask / clip-path with a non-translation transform: misplaced")),t},R=function(t,e,n,r){var o,i,a,l,s,u,f,c,h,p,d,g,m,y,b,v,w,x,k,S,A,_;if(null==r&&(r={}),A=0===(n=null==n?0:n),"none"===(o=getComputedStyle(t)).display||0==+o.opacity)return null;for(h in i=t.tagName.toLowerCase(),l=(a=z(t,t.parentNode,o,e))[0],s=a[1],u=a[2],f=a[3],c="visible"!==o.visibility,a=j)p=a[h],o[h]&&o[h]!==p&&e.warn(h+": "+o[h]);for((d="normal"!==o.mixBlendMode?o.mixBlendMode:null)&&1!==n&&e.warn("mixBlendMode on a nested element: "+d+" ignored"),g=(S=Array.from(t.childNodes)).filter(function(t){return 3===t.nodeType&&t.textContent.trim()}),m=S.filter(function(t){return 1===t.nodeType}),g.length&&m.length&&e.warn("mixed text and elements in <"+i+">"),y={display:"flex",boxSizing:"border-box",width:u,height:f},A||(y.position="absolute",y.left=l,y.top=s),b=0,v=(a=C).length;b<v;++b)h=a[b],!g.length&&U(h,L)||(p=o[h])&&P[h]!==p&&(y[h]=/data:image\/svg/.test(p)?B(p):"boxShadow"===h||"textShadow"===h?F(p):p);for(b=0,v=(a=["Top","Right","Bottom","Left"]).length;b<v;++b)y["border"+(w=a[b])+"Width"]||delete y["border"+w+"Color"];if(y.overflow&&(y.overflow="hidden"),y.transform?y.transformOrigin=o.transformOrigin:delete y.transformOrigin,c){for(b=0,v=(a=["backgroundColor","backgroundImage","boxShadow","color","textShadow"]).length;b<v;++b)delete y[h=a[b]];for(b=0,v=(a=["Top","Right","Bottom","Left"]).length;b<v;++b)delete y["border"+(w=a[b])+"Width"]}if("img"===i||"canvas"===i||"svg"===i)return c?null:((x={blend:1===n?d:null,type:"img",props:{width:u,height:f,style:y}}).props.src=(()=>{switch(i){case"img":return t.currentSrc||t.src;case"canvas":return t.toDataURL();case"svg":return V(t,u,f,e,x)}})(),r.nobake?x:M(x,e));if(k=[],g.length&&!c&&(S=g.map(function(t){return t.textContent}).join(""),e.text(o,S,y),k.push(S),A={center:"center",right:"flex-end",end:"flex-end"}[o.textAlign])&&!m.length&&(y.justifyContent=A),!r.own)for(b=0,v=m.length;b<v;++b)_=m[b],(_=R(_,e,n+1))&&k.push(_);return x={type:"div",props:{style:y,children:k}},d&&1===n&&(x.blend=d),r.nobake?x:M(x,e)},i={},h=function(t){return t.trim().replace(/^["']|["']$/g,"")},f=function(t){return t?t.split(",").map(function(t){var e;return t=t.trim().replace(/^u\+/i,""),/\?/.test(t)?[parseInt(t.replace(/\?/g,"0"),16),parseInt(t.replace(/\?/g,"F"),16)]:(e=(t=t.split("-"))[0],t=t[1],[parseInt(e,16),parseInt(t||e,16)])}):[[0,1114111]]},g=function(t,e){for(var n,r=[],o=/url\(\s*(['"]?)([^'")]+)\1\s*\)\s*(?:format\(\s*['"]?([^'")]+)['"]?\s*\))?/g;n=o.exec(t);)try{r.push({url:new URL(n[2],e).href,format:(n[3]||n[2].split(".").pop()).toLowerCase()})}catch(t){}return r},a=function(t,e){return{family:h(t("font-family")),weight:(t("font-weight")||"400").split(/\s+/).map(function(t){return"normal"===t?400:"bold"===t?700:+t}),style:t("font-style")||"normal",range:f(t("unicode-range")),src:g(t("src"),e)}},b=function(t,n){return(t.match(/@font-face\s*\{[^}]*\}/g)||[]).map(function(e){return a(function(t){return(new RegExp("(?:^|[{;\\s])"+t+"\\s*:\\s*([^;}]+)").exec(e)||[])[1]},n)})},l=function(t){var e,n=t.href||location.href;try{e=t.cssRules}catch(t){e=null}return e?Promise.all(Array.from(e).map(function(e){return e.styleSheet?l(e.styleSheet):5===e.type?[a(function(t){return e.style.getPropertyValue(t)},n)]:[]})).then(function(t){return t.flat()}):t.href?fetch(t.href).then(function(t){return t.text()}).then(function(t){return b(t,n)}).catch(function(){return[]}):Promise.resolve([])},x=function(){return Promise.all(Array.from(document.styleSheets).map(l)).then(function(t){return t.flat()})},H=function(t){var e,n=t.find(function(t){return"truetype"===(t=t.format)||"opentype"===t||"woff"===t||"ttf"===t||"otf"===t})||t.find(function(t){return"woff2"===t.format});return n?null!=(e=i[t=n.url])?e:i[t]=fetch(n.url).then(function(t){return t.arrayBuffer()}).then(function(e){return"woff2"!==n.format?e:p.lib("woff2").then(function(t){return(t.decompress||t.default)(e)}).then(function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)})}):Promise.resolve(null)},k=function(){return fetch(p.libs.hbsubset).then(function(t){return t.arrayBuffer()}).then(function(t){return WebAssembly.instantiate(t,{})}).then(function(t){t=t.instance.exports;return t._initialize&&t._initialize(),t})},D=function(h,p,d){return k().then(function(t){var e,n,r,o,i,a,l,s,u,f=h.byteLength,c=t.malloc(f);for(new Uint8Array(t.memory.buffer).set(new Uint8Array(h),c),f=t.hb_blob_create(c,f,1,0,0),e=t.hb_face_create(f,0),t.hb_blob_destroy(f),f=t.hb_subset_input_create_or_fail(),n=t.hb_subset_input_unicode_set(f),r=0,i=(o=d).length;r<i;++r)a=o[r],t.hb_set_add(n,a);return t.hb_subset_input_pin_axis_location(f,e,2003265652,p),l=t.hb_subset_or_fail(e,f),t.hb_subset_input_destroy(f),f=null,l&&(s=t.hb_face_reference_blob(l),u=t.hb_blob_get_data(s,0),f=new Uint8Array(t.memory.buffer).slice(u,u+t.hb_blob_get_length(s)).buffer,t.hb_blob_destroy(s),t.hb_face_destroy(l)),t.hb_face_destroy(e),t.free(c),f})},G=function(t,e,n){return Math.min(n,Math.max(e,t))},T=function(t,e){var t=[t.weight[0],t.weight[1]||t.weight[0]],n=t[0],t=t[1];return n<=e&&e<=t?0:500<e?e<n?n-e:1e3+e-t:e<400?t<e?e-t:1e3+n-e:e<n&&n<=500?n-e:t<e?1e3+e-t:2e3+n-e},S=function(_,C){return x().then(function(t){var e,n,r,o,i,a,l,s,u,f,c,h,p,d,g,m,y,b,v={},w=0,x=0;for(e in n=_)for((r=n[e]).names=[],o=0,a=(i=Array.from(r.chars)).length;o<a;++o)if(g=i[o],!((l=g.codePointAt(0))<33)){for(s=null,u=0,c=(f=r.families).length;u<c;++u)if(h=f[u],(p=t.filter(k)).length){s=(p=(d=p.filter(S)).length?d:p).reduce(A);break}s?(g=G(r.weight,s.weight[0],s.weight[1]||s.weight[0]),m=s.src[0].url+"|"+r.weight+"|"+r.style,(m=null!=(f=v[m])?f:v[m]={name:"lotion-font-"+x++,face:s,weight:r.weight,pin:g,style:r.style,cps:new Set([32])}).cps.add(l),U(m.name,r.names)||r.names.push(m.name)):w++}return w&&C.warn(w+" characters have no web font ( system fonts are not available to satori )"),Promise.all((()=>{var t,e=[];for(y in t=v)b=t[y],e.push(b);return e})().map(function(e){return H(e.face.src).then(function(t){return t?D(t,e.pin,Array.from(e.cps)).then(function(t){return t?{name:e.name,data:t,weight:e.weight,style:e.style}:(C.warn("font "+e.face.family+": subset failed"),null)}):null})})).then(function(t){return t.filter(function(t){return t})});function k(t){return t.family===h&&t.src.length&&t.range.some(function(t){return l>=t[0]&&l<=t[1]})}function S(t){return t.style===r.style}function A(t,e){return T(e,r.weight)<T(t,r.weight)?e:t}})},A=function(t,r,o){var e,n,i,a,l,s=r.props.children;if(!s.some(function(t){return t.blend}))return t(r,o);for(e=[{kids:[]}],n=0,i=s.length;n<i;++n)(a=s[n]).blend?e.push({blend:a.blend,kids:[a]}):e[e.length-1].blend?e.push({kids:[a]}):e[e.length-1].kids.push(a);return l={display:"flex",width:o.width,height:o.height,overflow:"hidden"},Promise.all(e.map(function(e,n){return t({type:"div",props:{style:0===n?r.props.style:l,children:e.kids}},o).then(function(t){t=t.replace(/^<svg[^>]*>/,"").replace(/<\/svg>\s*$/,"").replace(/satori_/g,"satori_"+n+"_");return e.blend?'<g style="mix-blend-mode:'+e.blend+'">'+t+"</g>":"<g>"+t+"</g>"})})).then(function(t){return'<svg width="'+o.width+'" height="'+o.height+'" viewBox="0 0 '+o.width+" "+o.height+'" xmlns="http://www.w3.org/2000/svg">'+t.join("")+"</svg>"})},c=function(){var c;return c={warns:{},used:{},laters:[],warn:function(t){return c.warns[t]=(c.warns[t]||0)+1},later:function(t){return c.laters.push(t)},text:function(t,e,n){for(var r,o,i,a=+t.fontWeight||400,l=t.fontFamily+"|"+a+"|"+t.fontStyle,s=null!=(o=(r=c.used)[l])?o:r[l]={families:t.fontFamily.split(",").map(h),weight:a,style:t.fontStyle,chars:new Set,styles:[]},u=0,f=(r=Array.from(e)).length;u<f;++u)i=r[u],s.chars.add(i);return s.styles.push(n)},warnings:function(){var t,e,n,r=[];for(t in e=c.warns)n=e[t],r.push(t+(1<n?" ( x"+n+" )":""));return r}}},m=function(u,f){var t;return Promise.all([(t=f.satori)?Promise.resolve(t):p.lib("satori"),(t=f.fonts)?Promise.resolve(t):S(u.used,u)]).then(function(t){var e,n,r,o,i,a,l=t[0],t=t[1];if(!f.fonts)for(e in n=u.used)for(o=0,a=(i=(r=n[e]).styles).length;o<a;++o)i[o].fontFamily=r.names.map(s).join(", ");return[l.default||l.satori||l,t];function s(t){return"'"+t+"'"}})},s=function(t,e){var a,l,s,u;return null==e&&(e={}),a=c(),l=R(t,a),s=e.width||t.offsetWidth,u=e.height||t.offsetHeight,(t=l.props.style).width=s,t.height=u,t.overflow="hidden",delete l.props.style.transform,delete l.props.style.transformOrigin,m(a,e).then(function(t){for(var e,n=t[0],r=t[1],o=0,i=(e=a.laters).length;o<i;++o)(0,e[o])(r);return A(n,l,{width:s,height:u,fonts:r})}).then(function(t){return{svg:t,warnings:a.warnings()}})},I=[1,0,0,1,0,0],y=function(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]},X=function(t,e){var n;return t&&"none"!==t?(n=/^matrix\(([^)]+)\)$/.exec(t))?n[1].split(",").map(function(t){return+t}):(n=/^matrix3d\(([^)]+)\)$/.exec(t))?(t=n[1].split(",").map(function(t){return+t}),e.warn("3d transform flattened to 2d"),[t[0],t[1],t[4],t[5],t[12],t[13]]):I:I},N=function(t,e,n,r){var o,r=X(n.transform,r);return r===I?[1,0,0,1,t,e]:(o=(n=n.transformOrigin.split(" ").map(function(t){return parseFloat(t)||0}))[0],y([1,0,0,1,t+o,e+(t=n[1])],y(r,[1,0,0,1,-o,-t])))},J=function(t,e,n){return"none"!==e.transform?N(0,0,e,n):(e=t.transform&&t.transform.baseVal)&&e.numberOfItems?[(n=e.consolidate().matrix).a,n.b,n.c,n.d,n.e,n.f]:I},Z=function(t,e,n){var r,o,i=t.viewBox&&t.viewBox.baseVal;return i&&i.width&&i.height?(r=(o=[e/i.width,n/i.height])[0],o=o[1],1===(t=t.preserveAspectRatio.baseVal).align?[r,0,0,o,-i.x*r,-i.y*o]:(r=2===t.meetOrSlice?Math.max(r,o):Math.min(r,o),o=(t.align-2)%3,t=Math.floor((t.align-2)/3),e=(e-i.width*r)*o/2,o=(n-i.height*r)*t/2,[r,0,0,r,e-i.x*r,o-i.y*r])):I},K=function(t){return t&&"none"!==t?(t=/^blur\(([\d.]+)px\)$/.exec(t))?+t[1]:null:0},$=function(t,e){var n,r,o,i,a,l,s,u,f,c,h,p,d,g=[],m=t.length;if(m<3){for(var y=[],b=0,v=m;b<v;++b)y.push(b);return y}for((n=new Uint8Array(m))[0]=n[m-1]=1,r=[[0,m-1]];r.length;){for(i=(o=r.pop())[0],a=o[1],l=(o=[1,-1])[0],s=o[1],u=i+1;u<a;++u)for(c=((f=u)-i)/(a-i),h=0,p=t[i].length;h<p;++h)d=h,l<(d=Math.abs(t[i][d]+(t[a][d]-t[i][d])*c-t[f][d])/e[d])&&(l=d,s=f);0<=s&&(n[s]=1,r.push([i,s],[s,a]))}for(u=0;u<m;++u)n[f=u]&&g.push(f);return g},O=function(t){return+t.toFixed(4)},Q=function(t,e){return+(100*t/e).toFixed(3)+"%"},Y=["g","a","switch"],tt=["defs","clippath","mask","lineargradient","radialgradient","filter","pattern","symbol","style","marker","title","desc","metadata"],et=["x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height"],d=["stroke-dashoffset","stroke-width","fill-opacity","stroke-opacity"],nt=(w=["font-family","font-size","font-weight","font-style","letter-spacing","text-anchor","dominant-baseline","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","paint-order","opacity","visibility","display","filter","mask","clip-path","color"]).filter(function(t){return!U(t,d)&&!("opacity"===t||"visibility"===t||"display"===t)}),rt={text:["x","y"],rect:["x","y"],image:["x","y"],use:["x","y"],foreignobject:["x","y"],circle:["cx","cy"],ellipse:["cx","cy"]},ot=/^\s*-?(\d+\.?\d*|\.\d+)(e-?\d+)?\s*$/,W=function(t){return(new XMLSerializer).serializeToString(t)},q=function(t,e){for(var n,r,o,i=getComputedStyle(t.parentNode),a=[],l=0,s=(n=nt).length;l<s;++l)r=n[l],o=e.getPropertyValue(r),i.getPropertyValue(r)!==o&&a.push(r+":"+o);return a.join(";")},it=function(t,e,n){for(var r,o,i,a,l,s,u,f=t.tagName.toLowerCase(),c=t.cloneNode(!0),h=0,p=(r=["transform","opacity","style","class"]).length;h<p;++h)o=r[h],c.removeAttribute(o);for(i={},h=0,p=(r=et).length;h<p;++h)o=r[h],null!=(a=t.getAttribute(o))&&ot.test(a)&&(i[o]=+a,c.removeAttribute(o));for(l=null,(u=rt[f])&&(l={x:i[u[0]]||0,y:i[u[1]]||0,keys:u},delete i[u[0]],delete i[u[1]]),s={},h=0,p=(r=d).length;h<p;++h)s[o=r[h]]=parseFloat(e.getPropertyValue(o))||0,c.removeAttribute(o);return(u=q(t,e))&&c.setAttribute("style",u),u=null,"text"===f&&n.text(e,t.textContent,u={}),{c:c,a:i,t:l,p:s,f:u}},at=function(t,e){for(var n,r,o,i,a=[],l=0,s=(r=Array.from(t.attributes)).length;l<s;++l)"class"!==(i=(o=r[l]).name)&&"style"!==i&&"transform"!==i&&"opacity"!==i&&a.push(o.name+'="'+o.value.replace(/"/g,"&quot;")+'"');return n=a,(t=q(t,e))&&n.push('style="'+t.replace(/"/g,"'")+'"'),n.join(" ")},lt=function(t){for(var e,n=[[],0,""],r=n[0],o=n[1],i=n[2],a=0,l=t.length;a<l;++a)"("===(e=t[a])&&o++,")"===e&&o--,","===e&&0===o?(r.push(i.trim()),i=""):i+=e;return r.push(i.trim()),r},st=function(t){return(t=/^rgba?\(([^)]*)\)$/.exec(t))?[(t=t[1].split(/[\s,\/]+/).filter(function(t){return t}).map(function(t){return parseFloat(t)}))[0],t[1],t[2],null!=(t=t[3])?t:1]:null},ut=function(t,e,n){var r,o,i,a,l,s,u,f,c,h,p,d,g,m,y,b,v,w,x,k,S;if(!(o=/^linear-gradient\((.*)\)$/.exec(t.maskImage)))return null;if(!/^no-repeat( no-repeat)?$/.test(t.maskRepeat))return null;if(r=lt(o[1]),o=180,y=/^(-?[\d.]+)deg$/.exec(r[0]))o=+y[1],r.shift();else if(/^to /.test(r[0])){if(null==(o={"to top":0,"to right":90,"to bottom":180,"to left":270}[r[0]]))return null;r.shift()}if((o=(o%360+360)%360)%90)return null;for(i=[],a=0,l=r.length;a<l;++a){if(s=r[a],!(s=/^(rgba?\([^)]*\))\s*(.*)$/.exec(s)))return null;for(u=st(s[1]),(f=s[2].split(/\s+/).filter(A)).length||i.push({col:u}),c=0,h=f.length;c<h;++c)p=f[c],i.push({col:u,q:p})}if("cover"===(d=(y=t.maskSize.split(/\s+/))[0])||"contain"===d)return null;for(g=(m=function(t,e){return t&&"auto"!==t?/%$/.test(t)?e*parseFloat(t)/100:parseFloat(t):e})(y[0],e),m=m(y[1],n),e=(y=function(t,e){return/%$/.test(t)?e*parseFloat(t)/100:parseFloat(t)||0})((f=t.maskPosition.split(/\s+/))[0],e-g),y=y(f[1]||"0%",n-m),b=90===o||270===o?g:m,null==(v=i.map(function(t){return null==t.q?null:/%$/.test(t.q)?parseFloat(t.q)/100:parseFloat(t.q)/b}))[0]&&(v[0]=0),null==v[v.length-1]&&(v[v.length-1]=1),w=0;w<v.length;)if(null!=v[w])w++;else{for(x=w;null==v[x];)x++;for(a=w;a<x;++a)v[k=a]=v[w-1]+(v[x]-v[w-1])*(k-w+1)/(x-w+1);w=x}for(a=1,S=v.length;a<S;++a)v[w=a]=Math.max(v[w],v[w-1]);return{grad:'<linearGradient x1="'+(d={90:[0,0,1,0],270:[1,0,0,0],180:[0,0,0,1],0:[0,1,0,0]}[o])[0]+'" y1="'+d[1]+'" x2="'+d[2]+'" y2="'+d[3]+'">'+i.map(function(t,e){return'<stop offset="'+O(v[e])+'" stop-color="rgb('+t.col[0]+","+t.col[1]+","+t.col[2]+')" stop-opacity="'+t.col[3]+'"/>'}).join("")+"</linearGradient>",rect:[e,y,g,m],key:t.maskImage};function A(t){return t}},ft=function(t,e,n){var r,o,i,a,l;return!(t=/^inset\(([^)]*)\)$/.exec(t.clipPath))||/round/.test(t[1])||1!==(r=(t=t[1].trim().split(/\s+/)).length)&&2!==r&&3!==r&&4!==r||t.some(function(t){return!/^-?[\d.]+(px|%)$/.test(t)&&"0"!==t})?null:(t=(r=[t[0],null!=(r=t[1])?r:t[0],null!=(r=t[2])?r:t[0],null!=(r=t[3])||null!=(r=t[1])?r:t[0]])[0],o=r[1],i=r[2],a=r[3],t=(r=[(l=function(t,e){return/%$/.test(t)?e*parseFloat(t)/100:parseFloat(t)||0})(t,n),l(i,n)])[0],i=r[1],o=(r=[l(o,e),l(a,e)])[0],[a=r[1],t,Math.max(0,e-a-o),Math.max(0,n-t-i)])},ct=function(t,S){for(var e,n=t.el,r=t.seek,o=t.n,i=t.fps,a=t.from,l=[],s=new Map,A=function(t,e){var n;return(n=s.get(t))||(n={id:l.length,el:t,parent:e,kids:[],variants:[],keys:new Map,frames:[]},l.push(n),s.set(t,n),e&&e.kids.push(n)),n},_=function(t,e,n){var r=t.keys.get(e);return null==r&&(r=t.variants.length,t.keys.set(e,r),t.variants.push(n())),r},C=function(e,t,n){var r,o,i,a,l,s,u,f,c,h,p,d,g=getComputedStyle(e);if("none"!==g.display)if(u=e.tagName.toLowerCase(),r=A(e,t),U(u,tt))r.kind?W(e)!==r.markup&&S.warn("<"+u+"> changes over time: only the first frame is kept"):(r.kind="static",r.markup=W(e)),r.frames[n]={m:I,o:1,b:0,v:-1};else{if(t=J(e,g,S),o=+g.opacity,"normal"!==g.mixBlendMode&&(r.blend=g.mixBlendMode),!U(u,Y))return r.kind="leaf",u=-1,f=c=null,"visible"===g.visibility&&0<o&&(f=(h=it(e,g,S)).a,c=h.p,h.t&&(null==r.base&&(r.base=h.t),t=y(t,[1,0,0,1,h.t.x-r.base.x,h.t.y-r.base.y]),h.c.setAttribute(h.t.keys[0],r.base.x),h.c.setAttribute(h.t.keys[1],r.base.y)),"path"===e.tagName.toLowerCase()&&(p=(()=>{try{return e.getTotalLength()}catch(t){return e=t,null}})(),d="none"===g.fill&&"none"===g.strokeDasharray&&"none"===g.markerStart&&"none"===g.markerMid&&"none"===g.markerEnd),u=_(r,W(h.c),function(){return{c:h.c,f:h.f,d:e.getAttribute("d"),len:p,drawable:d}})),r.frames[n]={m:t,o:o,b:0,v:u,a:f,p:c};for(r.kind||(r.kind="g",r.attrs=at(e,g)),r.frames[n]={m:t,o:o,b:0,v:-1},i=0,l=(a=Array.from(e.children)).length;i<l;++i)s=a[i],C(s,r,n)}},P=function(t,e,n,r){var o,i,a,l,s,u,f,c,h,p,d,g,m,y,b,v,w,x=[],k=getComputedStyle(t);if("none"!==k.display)if(m=t.tagName.toLowerCase(),o=A(t,e),e=(i=z(t,t.parentNode,k,S))[0],a=i[2],l=i[3],e=0===r?I:N(e,i[1],k,S),o.blend="normal"!==k.mixBlendMode?k.mixBlendMode:null,"auto"!==k.zIndex&&S.warn("z-index ignored ( dom order is used )"),(s="none"!==k.maskImage?ut(k,a,l):null)&&(o.mask?o.mask.key!==s.key&&S.warn("mask image changes over time: only the first is kept"):o.mask=s),(u="none"!==k.clipPath?ft(k,a,l):null)&&(o.clipped=!0),y="none"!==k.maskImage&&!s||"none"!==k.clipPath&&!u,"svg"!==m||y){if(p=K(k.filter),d=Array.from(t.children),g=Array.from(t.childNodes).some(function(t){return 3===t.nodeType&&t.textContent.trim()}),m="img"===m||"canvas"===m||"svg"===m||y||!(null!=p)||g&&d.length,o.atomic=m,"visible"!==k.overflow&&!m&&d.length&&null==o.clip&&(o.clip=[a,l]),y=-1,"visible"===k.visibility&&0<+k.opacity&&(S.laters=[],b=R(t,S,1,{own:!m,nobake:!0}))){for(v=b.props.style,f=0,c=(i=["position","left","top","transform","transformOrigin","opacity"]).length;f<c;++f)delete v[i[f]];if(null!=p&&delete v.filter,s)for(f=0,c=(i=["maskImage","maskPosition","maskSize","maskRepeat"]).length;f<c;++f)delete v[i[f]];u&&delete v.clipPath,delete b.blend,w=S.laters,y=_(o,JSON.stringify(b),function(){return{node:b,w:a,h:l,laters:w}})}if(o.frames[n]={m:e,o:+k.opacity,b:p||0,v:y,k:s&&s.rect,q:u},!m&&0<+k.opacity){for(f=0,c=d.length;f<c;++f)h=d[f],x.push(P(h,o,n,r+1));return x}}else if(o.kind||(o.kind="svg",o.vb=Z(t,a,l),o.clip="visible"===k.overflow?null:[a,l],o.style=q(t,k)),o.frames[n]={m:e,o:+k.opacity,b:0,v:-1,k:s&&s.rect,q:u},0<+k.opacity)for(f=0,c=(i=Array.from(t.children)).length;f<c;++f)h=i[f],C(h,o,n)},u=0;u<o;++u){if(e=u,t.signal&&t.signal.aborted)throw new DOMException("aborted","AbortError");r(a+e/i),P(n,null,e,0),t.progress&&t.progress(.5*(e+1)/o)}return l},ht=function(t){var e,n,r,o,i,a,l,s,u,f,c,h=[],p=t.variants;if(!(p.length<2)&&p.every(function(t){return null!=t.d&&null!=t.len&&t.drawable})){for(n=[],r=[],o=0,i=(e=(()=>{for(var t=[],e=0,n=p.length;e<n;++e)t.push(e);return t})().sort(function(t,e){return p[e].d.length-p[t].d.length})).length;o<i;++o)a=e[o],l=p[a].d,(s=n.find(d))||n.push(s={root:a}),r[a]=s;if(n.length!==p.length){for(t.variants=n.map(function(t,e){var n=p[t.root];return t.j=e,t.L=n.len+1,n.c.setAttribute("stroke-dasharray",t.L+" "+t.L),n}),o=0,i=(u=t.frames).length;o<i;++o)(f=u[o])&&0<=f.v&&(s=r[f.v],f.p=((c=f.p||{})["stroke-dashoffset"]=s.L-p[f.v].len,c),h.push(f.v=s.j));return h}}function d(t){t=p[t.root].d;return t.startsWith(l)&&(t.length===l.length||/[A-Za-z]/.test(t[l.length]))}},pt=function(t,e,n,r,o){var i=o.w+128,a=o.h+128,l=o.node.props.style;return l.position="absolute",l.left=64,l.top=64,t({type:"div",props:{style:{display:"flex",width:i,height:a},children:[o.node]}},{width:i,height:a,fonts:e}).then(function(t){return'<g transform="translate(-64,-64)">'+t.replace(/^<svg[^>]*>/,"").replace(/<\/svg>\s*$/,"").replace(/satori_/g,"s"+n.id+"_"+r+"_")+"</g>"})},E=function(t){return/opacity/.test(t)?.008:.05},dt=function(t,r,e){var d=r.n,n=r.width,o=r.height,g=d/r.fps,m=[],f=new Set,y=r.repeat?" infinite":" forwards",u=function(t){var e=t.find(function(t){return null!=t}),n=t.map(function(t){return e=null!=t?t:e});return n.every(function(t){return t.every(function(t,e){return t===n[0][e]})})?[n,!1]:[n,!0]},b=function(t,e,n,r,o,i,a){var l,n=u(n),s=n[0];if(n[1])return n=(a?(()=>{for(var t=[],e=0,n=d;e<n;++e)0!==(l=e)&&s[l].join()===s[l-1].join()||t.push(l);return t})():$(s,o)).map(function(t){return Q(t,d)+"{"+r+":"+i(s[t])+"}"}).join("")+("100%{"+r+":"+i(s[d-1]))+"}",a=t+"-"+r.replace(/[^a-z]/g,""),m.push("@keyframes "+a+"{"+n+"}"),e.push(r+":"+i(s[0])),a;e.push(r+":"+i(s[0]))},h=function(t,e,n){var e=u(e),r=e[0];return e[1]?(n=(e=$(r,[n])).map(function(t){return t/d}),e=e.map(function(t){return O(r[t][0])}),n[n.length-1]<1&&(n.push(1),e.push(O(r[d-1][0]))),[t,O(r[0][0]),{times:n,vs:e}]):[t,O(r[0][0])]},p=function(t,e){var n=document.createElementNS("http://www.w3.org/2000/svg","animate");return n.setAttribute("attributeName",t),n.setAttribute("dur",g+"s"),n.setAttribute("calcMode","linear"),n.setAttribute("keyTimes",e.times.map(function(t){return+t.toFixed(4)}).join(";")),n.setAttribute("values",e.vs.join(";")),r.repeat?n.setAttribute("repeatCount","indefinite"):n.setAttribute("fill","freeze"),n},v=function(t){for(var e,n,r,o=t.frames,i=new Set,a=0,l=o.length;a<l;++a)if((e=o[a])&&e.a)for(n in e.a)i.add(n);return r=[],i.forEach(function(e){return r.push(h(e,(()=>{for(var t=[],e=0,n=d;e<n;++e)t.push(e);return t})().map(function(t){return o[t]&&o[t].a&&null!=o[t].a[e]?[o[t].a[e]]:null}),E(e)))}),r},i=function(t){var e,n,r,o,i,a,l,s,u=t.frames,f=document.createElementNS("http://www.w3.org/2000/svg","rect");for(f.setAttribute("fill","url(#mg"+t.id+")"),e=0,r=(n=["x","y","width","height"]).length;e<r;++e)(a=h(i=n[o=e],(()=>{var t,e,n=[];for(t=0,e=d;t<e;++t)n.push(t);return n})().map(c),.25))[0],l=a[2],f.setAttribute(i,a[1]),l&&f.appendChild(p(i,l));return s=t.mask.grad.replace("<linearGradient",'<linearGradient id="mg'+t.id+'"'),'<mask id="m'+t.id+'" maskUnits="userSpaceOnUse" x="-100000" y="-100000" width="200000" height="200000" style="mask-type:alpha">'+s+W(f)+"</mask>";function c(t){return u[t]&&u[t].k?[u[t].k[o]]:null}},w=function(t,e){return t.mask?i(t)+'<g mask="url(#m'+t.id+')">'+e+"</g>":e},x=[-1e5,-1e5,2e5,2e5],k=function(t,e){var n,r,o,i,a,l,s,u,f;if(!t.clipped)return e;for(n=t.frames,r=document.createElementNS("http://www.w3.org/2000/svg","rect"),o=0,a=(i=["x","y","width","height"]).length;o<a;++o)(u=h(s=i[l=o],(()=>{var t,e,n=[];for(t=0,e=d;t<e;++t)n.push(t);return n})().map(c),.25))[0],f=u[2],r.setAttribute(s,u[1]),f&&r.appendChild(p(s,f));return'<clipPath id="q'+t.id+'">'+W(r)+'</clipPath><g clip-path="url(#q'+t.id+')">'+e+"</g>";function c(t){return n[t]?[(n[t].q||x)[l]]:null}},S=function(t,e){for(var n,r,o,i,a,l=e.c,s=0,u=(n=t.tracks).length;s<u;++s)o=(r=n[s])[0],i=r[2],l.setAttribute(o,r[1]),i&&l.appendChild(p(o,i));if(e.f&&e.f.fontFamily)for(l.setAttribute("style",(l.getAttribute("style")||"")+";font-family:"+e.f.fontFamily),s=0,u=(n=e.f.fontFamily.split(",")).length;s<u;++s)a=n[s],f.add(a.trim().replace(/'/g,""));return W(l)},A=function(i){var a,r,o,l,s,t,e,n,u,f,c,h,p;if("static"===i.kind)return i.markup;if(r=[],o=[],l=i.frames,(h=b(a="n"+i.id,r,(s=function(e){return(()=>{for(var t=[],e=0,n=d;e<n;++e)t.push(e);return t})().map(function(t){return l[t]?e(l[t]):null})})(function(t){return t.m}),"transform",[.005,.005,.005,.005,.25,.25],function(t){return"matrix("+t.map(function(t,e){return 3<e?+t.toFixed(2):O(t)}).join(",")+")"},!1))&&o.push(h+" "+g+"s linear"),c=(()=>{for(var t=[],e=0,n=d;e<n;++e)t.push(e);return t})().map(function(t){return[l[t]?l[t].o:0]}),(h=b(a,r,c,"opacity",[.008],function(t){return+t[0].toFixed(3)},!1))&&o.push(h+" "+g+"s linear"),(h=b(a,r,s(function(t){return[t.b]}),"filter",[.05],function(t){return.01<t[0]?"blur("+O(t[0])+"px)":"none"},!1))&&o.push(h+" "+g+"s linear"),"leaf"===i.kind){for(t=new Set,e=0,n=l.length;e<n;++e)if((u=l[e])&&u.p)for(f in u.p)t.add(f);t.forEach(function(e){var t,n=/opacity/.test(e)?"":"px";if(t=b(a,r,s(function(t){return t.p?[t.p[e]]:null}),e,[E(e)],function(t){return O(t[0])+""+n},!1))return o.push(t+" "+g+"s linear")})}return i.blend&&r.push("mix-blend-mode:"+i.blend),o.length&&r.push("animation:"+o.map(function(t){return t+y}).join(",")),m.push("."+a+"{"+r.join(";")+"}"),"leaf"===i.kind&&(i.tracks=v(i)),c=i.variants.map(function(t,e){var n=a+"v"+e,r=[],o=(()=>{for(var t=[],e=0,n=d;e<n;++e)t.push(e);return t})().map(function(t){return[l[t]&&l[t].v===e?1:0]});return(o=b(n,r,o,"visibility",[.5],function(t){return t[0]?"visible":"hidden"},!0))&&r.push("animation:"+o+" "+g+"s step-end"+y),m.push("."+n+"{"+r.join(";")+"}"),'<g class="'+n+'">'+("leaf"===i.kind?S(i,t):t.svg)+"</g>"}),h=i.kids.map(A).join(""),"svg"===i.kind?(p='<g transform="matrix('+i.vb.map(O).join(",")+')" style="'+i.style.replace(/"/g,"'")+'">'+h+"</g>",i.clip&&(p='<clipPath id="c'+i.id+'"><rect width="'+i.clip[0]+'" height="'+i.clip[1]+'"/></clipPath><g clip-path="url(#c'+i.id+')">'+p+"</g>"),'<g class="'+a+'">'+k(i,w(i,p))+"</g>"):"g"===i.kind?'<g class="'+a+'" '+i.attrs+">"+h+"</g>":(i.clip&&(h=h&&'<clipPath id="c'+i.id+'"><rect width="'+i.clip[0]+'" height="'+i.clip[1]+'"/></clipPath><g clip-path="url(#c'+i.id+')">'+h+"</g>"),'<g class="'+a+'">'+k(i,w(i,c.join("")+h))+"</g>")},t=A(t[0]);return'<svg width="'+n+'" height="'+o+'" viewBox="0 0 '+n+" "+o+'" xmlns="http://www.w3.org/2000/svg"><style>'+(e.filter(function(t){return f.has(t.name)}).map(function(t){return"@font-face{font-family:'"+t.name+"';font-weight:"+t.weight+";font-style:"+t.style+";src:url(data:font/ttf;base64,"+_(t.data)+") format('truetype')}"}).join("")+"g{transform-box:view-box;transform-origin:0 0}"+m.join(""))+"</style>"+t+"</svg>"},p.animate=gt=function(p){for(var n,d,t,r,g,o=c(),i=(p=null==p?{}:p).fps||30,e=p.from||0,a=null!=(a=p.to)?a:p.duration,l=Math.max(1,Math.round((a-e)*i)),a={el:n=p.el,seek:p.seek,n:l,fps:i,from:e,signal:p.signal,progress:p.progress},s=performance.now(),u=0,f=(d=ct(a,o)).length;u<f;++u)"leaf"===(t=d[u]).kind&&ht(t);return r=performance.now(),g=null,m(o,p).then(function(t){var l,e,n,r,o,i,a,s,u,f,c,h=t[0];for(g=t[1],l=[],e=0,r=(n=d).length;e<r;++e)if(!(o=n[e]).kind)for(i=0,s=(a=o.variants).length;i<s;++i)f=a[u=i],l.push([o,u,f]);return(c=function(e){var t,n,r,o,i,a;if(!(e>=l.length)){for(n=(t=l[e])[0],r=t[1],i=0,a=(t=(o=t[2]).laters).length;i<a;++i)(0,t[i])(g);return pt(h,g,n,r,o).then(function(t){return o.svg=t,p.progress&&p.progress(.5+.5*(e+1)/l.length),c(e+1)})}})(0)}).then(function(){var t=dt(d,{n:l,fps:i,repeat:null==(t=p.loop)||t,width:p.width||n.offsetWidth,height:p.height||n.offsetHeight},g),e=function(e){return d.filter(function(t){return(t.kind||"html")===e}).reduce(function(t,e){return t+e.variants.length},0)},e={frames:l,elements:d.length,variants:{html:e("html"),svg:e("leaf")},sampleMs:Math.round(r-s),totalMs:Math.round(performance.now()-s),bytes:t.length};return{svg:t,warnings:o.warnings(),stats:e}})},p.player.prototype.animate=function(t){var e,n=this;return null==t&&(t={}),this.pause(),e=this.t,Promise.resolve().then(function(){return gt(((t,e)=>{var n,r={}.hasOwnProperty;for(n in e)r.call(e,n)&&(t[n]=e[n]);return t})({el:n.stage,seek:n.opt.seek,duration:n.duration,width:n.width,height:n.height},t))}).finally(function(){return n.opt.seek(e)})},p.vector=s,p.player.prototype.vector=function(e,t){var n=this;return null==t&&(t={}),null!=e&&this.opt.seek(e),s(this.stage,t).then(function(t){return null!=e&&n.opt.seek(n.t),t})}}.call(this);