@polymarket/embeds
Advanced tools
Comparing version 0.1.1 to 0.2.0
# @polymarket/embeds | ||
## 0.2.0 | ||
### Minor Changes | ||
- polish, rework query param struct, setup for chart addition, gauge styling, html export, build system | ||
## 0.1.1 | ||
@@ -4,0 +10,0 @@ |
import * as lit_html from 'lit-html'; | ||
import { LitElement, CSSResult } from 'lit'; | ||
declare const ELEMENT_NAME = "polymarket-embed"; | ||
declare class MarketEmbed extends LitElement { | ||
static get styles(): CSSResult; | ||
private accessor marketSlug; | ||
private accessor hideBetAmount; | ||
private accessor market; | ||
private accessor href; | ||
private accessor showVolume; | ||
private accessor showChart; | ||
private accessor _market; | ||
private accessor _href; | ||
private accessor _probability; | ||
private accessor _fillPathD; | ||
constructor(); | ||
@@ -18,9 +20,9 @@ connectedCallback(): void; | ||
interface HTMLElementTagNameMap { | ||
[ELEMENT_NAME]: MarketEmbed; | ||
"polymarket-market-embed": MarketEmbed; | ||
} | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
[ELEMENT_NAME]: { | ||
"polymarket-market-embed": { | ||
market: string; | ||
"hide-bet-amount"?: boolean; | ||
"show-amount-amount"?: boolean; | ||
}; | ||
@@ -27,0 +29,0 @@ } |
@@ -1,33 +0,29 @@ | ||
var Le=Object.create;var I=Object.defineProperty;var He=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var dt=Object.getPrototypeOf,ft=Object.prototype.hasOwnProperty;var Te=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),V=t=>{throw TypeError(t)};var mt=(t,e,o)=>e in t?I(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var Pe=(t,e)=>I(t,"name",{value:e,configurable:!0});var gt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var yt=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of pt(e))!ft.call(t,n)&&n!==o&&I(t,n,{get:()=>e[n],enumerable:!(i=He(e,n))||i.enumerable});return t};var bt=(t,e,o)=>(o=t!=null?Le(dt(t)):{},yt(I(o,"default",{value:t,enumerable:!0}),t));var Re=t=>[,,,Le(t?.[Te("metadata")]??null)],Fe=["class","method","getter","setter","accessor","field","value","get","set"],j=t=>t!==void 0&&typeof t!="function"?V("Function expected"):t,_t=(t,e,o,i,n)=>({kind:Fe[t],name:e,metadata:i,addInitializer:u=>o._?V("Already initialized"):n.push(j(u||null))}),$t=(t,e)=>mt(e,Te("metadata"),t[3]),k=(t,e,o,i)=>{for(var n=0,u=t[e>>1],p=u&&u.length;n<p;n++)e&1?u[n].call(o):i=u[n].call(o,i);return i},U=(t,e,o,i,n,u)=>{var p,m,r,s,h,a=e&7,l=!!(e&8),c=!!(e&16),d=a>3?t.length+1:a?l?1:2:0,f=Fe[a+5],_=a>3&&(t[d-1]=[]),g=t[d]||(t[d]=[]),b=a&&(!c&&!l&&(n=n.prototype),a<5&&(a>3||!c)&&He(a<4?n:{get[o](){return Ne(this,u)},set[o](y){return Oe(this,u,y)}},o));a?c&&a<4&&Pe(u,(a>2?"set ":a>1?"get ":"")+o):Pe(n,o);for(var w=i.length-1;w>=0;w--)s=_t(a,o,r={},t[3],g),a&&(s.static=l,s.private=c,h=s.access={has:c?y=>vt(n,y):y=>o in y},a^3&&(h.get=c?y=>(a^1?Ne:Ct)(y,n,a^4?u:b.get):y=>y[o]),a>2&&(h.set=c?(y,S)=>Oe(y,n,S,a^4?u:b.set):(y,S)=>y[o]=S)),m=(0, i[w])(a?a<4?c?u:b[f]:a>4?void 0:{get:b.get,set:b.set}:n,s),r._=1,a^4||m===void 0?j(m)&&(a>4?_.unshift(m):a?c?u=m:b[f]=m:n=m):typeof m!="object"||m===null?V("Object expected"):(j(p=m.get)&&(b.get=p),j(p=m.set)&&(b.set=p),j(p=m.init)&&_.unshift(p));return a||$t(t,n),b&&I(n,o,b),c?a^4?u:b:n};var ce=(t,e,o)=>e.has(t)||V("Cannot "+o),vt=(t,e)=>Object(e)!==e?V('Cannot use the "in" operator on this value'):t.has(e),Ne=(t,e,o)=>(ce(t,e,"read from private field"),o?o.call(t):e.get(t)),Z=(t,e,o)=>e.has(t)?V("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,o),Oe=(t,e,o,i)=>(ce(t,e,"write to private field"),i?i.call(t,o):e.set(t,o),o),Ct=(t,e,o)=>(ce(t,e,"access private method"),o);var it=gt((ot,ae)=>{(function(t,e){typeof define=="function"&&define.amd?define(e):typeof ae=="object"&&ae.exports?ae.exports=e():t.numeral=e();})(ot,function(){var t,e,o="2.0.6",i={},n={},u={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},p={currentLocale:u.currentLocale,zeroFormat:u.zeroFormat,nullFormat:u.nullFormat,defaultFormat:u.defaultFormat,scalePercentBy100:u.scalePercentBy100};function m(r,s){this._input=r,this._value=s;}return t=function(r){var s,h,a,l;if(t.isNumeral(r))s=r.value();else if(r===0||typeof r>"u")s=0;else if(r===null||e.isNaN(r))s=null;else if(typeof r=="string")if(p.zeroFormat&&r===p.zeroFormat)s=0;else if(p.nullFormat&&r===p.nullFormat||!r.replace(/[^0-9]+/g,"").length)s=null;else {for(h in i)if(l=typeof i[h].regexps.unformat=="function"?i[h].regexps.unformat():i[h].regexps.unformat,l&&r.match(l)){a=i[h].unformat;break}a=a||t._.stringToNumber,s=a(r);}else s=Number(r)||null;return new m(r,s)},t.version=o,t.isNumeral=function(r){return r instanceof m},t._=e={numberToFormat:function(r,s,h){var a=n[t.options.currentLocale],l=!1,c=!1,d=0,f="",_=1e12,g=1e9,b=1e6,w=1e3,y="",S=!1,x,N,v,A,le,Ee,M;if(r=r||0,N=Math.abs(r),t._.includes(s,"(")?(l=!0,s=s.replace(/[\(|\)]/g,"")):(t._.includes(s,"+")||t._.includes(s,"-"))&&(le=t._.includes(s,"+")?s.indexOf("+"):r<0?s.indexOf("-"):-1,s=s.replace(/[\+|\-]/g,"")),t._.includes(s,"a")&&(x=s.match(/a(k|m|b|t)?/),x=x?x[1]:!1,t._.includes(s," a")&&(f=" "),s=s.replace(new RegExp(f+"a[kmbt]?"),""),N>=_&&!x||x==="t"?(f+=a.abbreviations.trillion,r=r/_):N<_&&N>=g&&!x||x==="b"?(f+=a.abbreviations.billion,r=r/g):N<g&&N>=b&&!x||x==="m"?(f+=a.abbreviations.million,r=r/b):(N<b&&N>=w&&!x||x==="k")&&(f+=a.abbreviations.thousand,r=r/w)),t._.includes(s,"[.]")&&(c=!0,s=s.replace("[.]",".")),v=r.toString().split(".")[0],A=s.split(".")[1],Ee=s.indexOf(","),d=(s.split(".")[0].split(",")[0].match(/0/g)||[]).length,A?(t._.includes(A,"[")?(A=A.replace("]",""),A=A.split("["),y=t._.toFixed(r,A[0].length+A[1].length,h,A[1].length)):y=t._.toFixed(r,A.length,h),v=y.split(".")[0],t._.includes(y,".")?y=a.delimiters.decimal+y.split(".")[1]:y="",c&&Number(y.slice(1))===0&&(y="")):v=t._.toFixed(r,0,h),f&&!x&&Number(v)>=1e3&&f!==a.abbreviations.trillion)switch(v=String(Number(v)/1e3),f){case a.abbreviations.thousand:f=a.abbreviations.million;break;case a.abbreviations.million:f=a.abbreviations.billion;break;case a.abbreviations.billion:f=a.abbreviations.trillion;break}if(t._.includes(v,"-")&&(v=v.slice(1),S=!0),v.length<d)for(var Me=d-v.length;Me>0;Me--)v="0"+v;return Ee>-1&&(v=v.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+a.delimiters.thousands)),s.indexOf(".")===0&&(v=""),M=v+y+(f||""),l?M=(l&&S?"(":"")+M+(l&&S?")":""):le>=0?M=le===0?(S?"-":"+")+M:M+(S?"-":"+"):S&&(M="-"+M),M},stringToNumber:function(r){var s=n[p.currentLocale],h=r,a={thousand:3,million:6,billion:9,trillion:12},l,c,f;if(p.zeroFormat&&r===p.zeroFormat)c=0;else if(p.nullFormat&&r===p.nullFormat||!r.replace(/[^0-9]+/g,"").length)c=null;else {c=1,s.delimiters.decimal!=="."&&(r=r.replace(/\./g,"").replace(s.delimiters.decimal,"."));for(l in a)if(f=new RegExp("[^a-zA-Z]"+s.abbreviations[l]+"(?:\\)|(\\"+s.currency.symbol+")?(?:\\))?)?$"),h.match(f)){c*=Math.pow(10,a[l]);break}c*=(r.split("-").length+Math.min(r.split("(").length-1,r.split(")").length-1))%2?1:-1,r=r.replace(/[^0-9\.]+/g,""),c*=Number(r);}return c},isNaN:function(r){return typeof r=="number"&&isNaN(r)},includes:function(r,s){return r.indexOf(s)!==-1},insert:function(r,s,h){return r.slice(0,h)+s+r.slice(h)},reduce:function(r,s){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof s!="function")throw new TypeError(s+" is not a function");var h=Object(r),a=h.length>>>0,l=0,c;if(arguments.length===3)c=arguments[2];else {for(;l<a&&!(l in h);)l++;if(l>=a)throw new TypeError("Reduce of empty array with no initial value");c=h[l++];}for(;l<a;l++)l in h&&(c=s(c,h[l],l,h));return c},multiplier:function(r){var s=r.toString().split(".");return s.length<2?1:Math.pow(10,s[1].length)},correctionFactor:function(){var r=Array.prototype.slice.call(arguments);return r.reduce(function(s,h){var a=e.multiplier(h);return s>a?s:a},1)},toFixed:function(r,s,h,a){var l=r.toString().split("."),c=s-(a||0),d,f,_,g;return l.length===2?d=Math.min(Math.max(l[1].length,c),s):d=c,_=Math.pow(10,d),g=(h(r+"e+"+d)/_).toFixed(d),a>s-d&&(f=new RegExp("\\.?0{1,"+(a-(s-d))+"}$"),g=g.replace(f,"")),g}},t.options=p,t.formats=i,t.locales=n,t.locale=function(r){return r&&(p.currentLocale=r.toLowerCase()),p.currentLocale},t.localeData=function(r){if(!r)return n[p.currentLocale];if(r=r.toLowerCase(),!n[r])throw new Error("Unknown locale : "+r);return n[r]},t.reset=function(){for(var r in u)p[r]=u[r];},t.zeroFormat=function(r){p.zeroFormat=typeof r=="string"?r:null;},t.nullFormat=function(r){p.nullFormat=typeof r=="string"?r:null;},t.defaultFormat=function(r){p.defaultFormat=typeof r=="string"?r:"0.0";},t.register=function(r,s,h){if(s=s.toLowerCase(),this[r+"s"][s])throw new TypeError(s+" "+r+" already registered.");return this[r+"s"][s]=h,h},t.validate=function(r,s){var h,a,l,c,d,f,_,g;if(typeof r!="string"&&(r+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",r)),r=r.trim(),r.match(/^\d+$/))return !0;if(r==="")return !1;try{_=t.localeData(s);}catch{_=t.localeData(t.locale());}return l=_.currency.symbol,d=_.abbreviations,h=_.delimiters.decimal,_.delimiters.thousands==="."?a="\\.":a=_.delimiters.thousands,g=r.match(/^[^\d]+/),g!==null&&(r=r.substr(1),g[0]!==l)||(g=r.match(/[^\d]+$/),g!==null&&(r=r.slice(0,-1),g[0]!==d.thousand&&g[0]!==d.million&&g[0]!==d.billion&&g[0]!==d.trillion))?!1:(f=new RegExp(a+"{2}"),r.match(/[^\d.,]/g)?!1:(c=r.split(h),c.length>2?!1:c.length<2?!!c[0].match(/^\d+.*\d$/)&&!c[0].match(f):c[0].length===1?!!c[0].match(/^\d+$/)&&!c[0].match(f)&&!!c[1].match(/^\d+$/):!!c[0].match(/^\d+.*\d$/)&&!c[0].match(f)&&!!c[1].match(/^\d+$/)))},t.fn=m.prototype={clone:function(){return t(this)},format:function(r,s){var h=this._value,a=r||p.defaultFormat,l,c,d;if(s=s||Math.round,h===0&&p.zeroFormat!==null)c=p.zeroFormat;else if(h===null&&p.nullFormat!==null)c=p.nullFormat;else {for(l in i)if(a.match(i[l].regexps.format)){d=i[l].format;break}d=d||t._.numberToFormat,c=d(h,a,s);}return c},value:function(){return this._value},input:function(){return this._input},set:function(r){return this._value=Number(r),this},add:function(r){var s=e.correctionFactor.call(null,this._value,r);function h(a,l,c,d){return a+Math.round(s*l)}return this._value=e.reduce([this._value,r],h,0)/s,this},subtract:function(r){var s=e.correctionFactor.call(null,this._value,r);function h(a,l,c,d){return a-Math.round(s*l)}return this._value=e.reduce([r],h,Math.round(this._value*s))/s,this},multiply:function(r){function s(h,a,l,c){var d=e.correctionFactor(h,a);return Math.round(h*d)*Math.round(a*d)/Math.round(d*d)}return this._value=e.reduce([this._value,r],s,1),this},divide:function(r){function s(h,a,l,c){var d=e.correctionFactor(h,a);return Math.round(h*d)/Math.round(a*d)}return this._value=e.reduce([this._value,r],s),this},difference:function(r){return Math.abs(t(this._value).subtract(r).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(r){var s=r%10;return ~~(r%100/10)===1?"th":s===1?"st":s===2?"nd":s===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(r,s,h){var a=t._.includes(s," BPS")?" ":"",l;return r=r*1e4,s=s.replace(/\s?BPS/,""),l=t._.numberToFormat(r,s,h),t._.includes(l,")")?(l=l.split(""),l.splice(-1,0,a+"BPS"),l=l.join("")):l=l+a+"BPS",l},unformat:function(r){return +(t._.stringToNumber(r)*1e-4).toFixed(15)}});}(),function(){var r={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},s={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},h=r.suffixes.concat(s.suffixes.filter(function(l){return r.suffixes.indexOf(l)<0})),a=h.join("|");a="("+a.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(a)},format:function(l,c,d){var f,_=t._.includes(c,"ib")?s:r,g=t._.includes(c," b")||t._.includes(c," ib")?" ":"",b,w,y;for(c=c.replace(/\s?i?b/,""),b=0;b<=_.suffixes.length;b++)if(w=Math.pow(_.base,b),y=Math.pow(_.base,b+1),l===null||l===0||l>=w&&l<y){g+=_.suffixes[b],w>0&&(l=l/w);break}return f=t._.numberToFormat(l,c,d),f+g},unformat:function(l){var c=t._.stringToNumber(l),d,f;if(c){for(d=r.suffixes.length-1;d>=0;d--){if(t._.includes(l,r.suffixes[d])){f=Math.pow(r.base,d);break}if(t._.includes(l,s.suffixes[d])){f=Math.pow(s.base,d);break}}c*=f||1;}return c}});}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(r,s,h){var a=t.locales[t.options.currentLocale],l={before:s.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:s.match(/([\+|\-|\)|\s|\$]*)$/)[0]},c,d,f;for(s=s.replace(/\s?\$\s?/,""),c=t._.numberToFormat(r,s,h),r>=0?(l.before=l.before.replace(/[\-\(]/,""),l.after=l.after.replace(/[\-\)]/,"")):r<0&&!t._.includes(l.before,"-")&&!t._.includes(l.before,"(")&&(l.before="-"+l.before),f=0;f<l.before.length;f++)switch(d=l.before[f],d){case"$":c=t._.insert(c,a.currency.symbol,f);break;case" ":c=t._.insert(c," ",f+a.currency.symbol.length-1);break}for(f=l.after.length-1;f>=0;f--)switch(d=l.after[f],d){case"$":c=f===l.after.length-1?c+a.currency.symbol:t._.insert(c,a.currency.symbol,-(l.after.length-(1+f)));break;case" ":c=f===l.after.length-1?c+" ":t._.insert(c," ",-(l.after.length-(1+f)+a.currency.symbol.length-1));break}return c}});}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(r,s,h){var a,l=typeof r=="number"&&!t._.isNaN(r)?r.toExponential():"0e+0",c=l.split("e");return s=s.replace(/e[\+|\-]{1}0/,""),a=t._.numberToFormat(Number(c[0]),s,h),a+"e"+c[1]},unformat:function(r){var s=t._.includes(r,"e+")?r.split("e+"):r.split("e-"),h=Number(s[0]),a=Number(s[1]);a=t._.includes(r,"e-")?a*=-1:a;function l(c,d,f,_){var g=t._.correctionFactor(c,d),b=c*g*(d*g)/(g*g);return b}return t._.reduce([h,Math.pow(10,a)],l,1)}});}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(r,s,h){var a=t.locales[t.options.currentLocale],l,c=t._.includes(s," o")?" ":"";return s=s.replace(/\s?o/,""),c+=a.ordinal(r),l=t._.numberToFormat(r,s,h),l+c}});}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(r,s,h){var a=t._.includes(s," %")?" ":"",l;return t.options.scalePercentBy100&&(r=r*100),s=s.replace(/\s?\%/,""),l=t._.numberToFormat(r,s,h),t._.includes(l,")")?(l=l.split(""),l.splice(-1,0,a+"%"),l=l.join("")):l=l+a+"%",l},unformat:function(r){var s=t._.stringToNumber(r);return t.options.scalePercentBy100?s*.01:s}});}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(r,s,h){var a=Math.floor(r/60/60),l=Math.floor((r-a*60*60)/60),c=Math.round(r-a*60*60-l*60);return a+":"+(l<10?"0"+l:l)+":"+(c<10?"0"+c:c)},unformat:function(r){var s=r.split(":"),h=0;return s.length===3?(h=h+Number(s[0])*60*60,h=h+Number(s[1])*60,h=h+Number(s[2])):s.length===2&&(h=h+Number(s[0])*60,h=h+Number(s[1])),Number(h)}});}(),t});});var ee=globalThis,te=ee.ShadowRoot&&(ee.ShadyCSS===void 0||ee.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,he=Symbol(),Ve=new WeakMap,q=class{constructor(e,o,i){if(this._$cssResult$=!0,i!==he)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=o;}get styleSheet(){let e=this.o,o=this.t;if(te&&e===void 0){let i=o!==void 0&&o.length===1;i&&(e=Ve.get(o)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Ve.set(o,e));}return e}toString(){return this.cssText}},Ue=t=>new q(typeof t=="string"?t:t+"",void 0,he),ue=(t,...e)=>{let o=t.length===1?t[0]:e.reduce((i,n,u)=>i+(p=>{if(p._$cssResult$===!0)return p.cssText;if(typeof p=="number")return p;throw Error("Value passed to 'css' function must be a 'css' function result: "+p+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[u+1],t[0]);return new q(o,t,he)},pe=(t,e)=>{if(te)t.adoptedStyleSheets=e.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of e){let i=document.createElement("style"),n=ee.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=o.cssText,t.appendChild(i);}},re=te?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let o="";for(let i of e.cssRules)o+=i.cssText;return Ue(o)})(t):t;var{is:xt,defineProperty:wt,getOwnPropertyDescriptor:At,getOwnPropertyNames:St,getOwnPropertySymbols:kt,getPrototypeOf:Et}=Object,oe=globalThis,Be=oe.trustedTypes,Mt=Be?Be.emptyScript:"",Pt=oe.reactiveElementPolyfillSupport,D=(t,e)=>t,J={toAttribute(t,e){switch(e){case Boolean:t=t?Mt:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t);}return t},fromAttribute(t,e){let o=t;switch(e){case Boolean:o=t!==null;break;case Number:o=t===null?null:Number(t);break;case Object:case Array:try{o=JSON.parse(t);}catch{o=null;}}return o}},ie=(t,e)=>!xt(t,e),ze={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:ie};Symbol.metadata??=Symbol("metadata"),oe.litPropertyMetadata??=new WeakMap;var P=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,o=ze){if(o.state&&(o.attribute=!1),this._$Ei(),this.elementProperties.set(e,o),!o.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(e,i,o);n!==void 0&&wt(this.prototype,e,n);}}static getPropertyDescriptor(e,o,i){let{get:n,set:u}=At(this.prototype,e)??{get(){return this[o]},set(p){this[o]=p;}};return {get(){return n?.call(this)},set(p){let m=n?.call(this);u.call(this,p),this.requestUpdate(e,m,i);},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ze}static _$Ei(){if(this.hasOwnProperty(D("elementProperties")))return;let e=Et(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties);}static finalize(){if(this.hasOwnProperty(D("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(D("properties"))){let o=this.properties,i=[...St(o),...kt(o)];for(let n of i)this.createProperty(n,o[n]);}let e=this[Symbol.metadata];if(e!==null){let o=litPropertyMetadata.get(e);if(o!==void 0)for(let[i,n]of o)this.elementProperties.set(i,n);}this._$Eh=new Map;for(let[o,i]of this.elementProperties){let n=this._$Eu(o,i);n!==void 0&&this._$Eh.set(n,o);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(e){let o=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)o.unshift(re(n));}else e!==void 0&&o.push(re(e));return o}static _$Eu(e,o){let i=o.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this));}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.();}removeController(e){this._$EO?.delete(e);}_$E_(){let e=new Map,o=this.constructor.elementProperties;for(let i of o.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e);}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return pe(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.());}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.());}attributeChangedCallback(e,o,i){this._$AK(e,i);}_$EC(e,o){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){let u=(i.converter?.toAttribute!==void 0?i.converter:J).toAttribute(o,i.type);this._$Em=e,u==null?this.removeAttribute(n):this.setAttribute(n,u),this._$Em=null;}}_$AK(e,o){let i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let u=i.getPropertyOptions(n),p=typeof u.converter=="function"?{fromAttribute:u.converter}:u.converter?.fromAttribute!==void 0?u.converter:J;this._$Em=n,this[n]=p.fromAttribute(o,u.type),this._$Em=null;}}requestUpdate(e,o,i){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??ie)(this[e],o))return;this.P(e,o,i);}this.isUpdatePending===!1&&(this._$ES=this._$ET());}P(e,o,i){this._$AL.has(e)||this._$AL.set(e,o),i.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e);}async _$ET(){this.isUpdatePending=!0;try{await this._$ES;}catch(o){Promise.reject(o);}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,u]of this._$Ep)this[n]=u;this._$Ep=void 0;}let i=this.constructor.elementProperties;if(i.size>0)for(let[n,u]of i)u.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],u);}let e=!1,o=this._$AL;try{e=this.shouldUpdate(o),e?(this.willUpdate(o),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(o)):this._$EU();}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(o);}willUpdate(e){}_$AE(e){this._$EO?.forEach(o=>o.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e);}_$EU(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return !0}update(e){this._$Ej&&=this._$Ej.forEach(o=>this._$EC(o,this[o])),this._$EU();}updated(e){}firstUpdated(e){}};P.elementStyles=[],P.shadowRootOptions={mode:"open"},P[D("elementProperties")]=new Map,P[D("finalized")]=new Map,Pt?.({ReactiveElement:P}),(oe.reactiveElementVersions??=[]).push("2.0.4");var _e=globalThis,se=_e.trustedTypes,je=se?se.createPolicy("lit-html",{createHTML:t=>t}):void 0,We="$lit$",O=`lit$${Math.random().toFixed(9).slice(2)}$`,Ke="?"+O,Nt=`<${Ke}>`,R=document,K=()=>R.createComment(""),G=t=>t===null||typeof t!="object"&&typeof t!="function",Ge=Array.isArray,Ot=t=>Ge(t)||typeof t?.[Symbol.iterator]=="function",de=`[ | ||
\f\r]`,W=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ie=/-->/g,Ze=/>/g,H=RegExp(`>|${de}(?:([^\\s"'>=/]+)(${de}*=${de}*(?:[^ | ||
\f\r"'\`<>=]|("|')|))|$)`,"g"),qe=/'/g,De=/"/g,Ye=/^(?:script|style|textarea|title)$/i,Xe=t=>(e,...o)=>({_$litType$:t,strings:e,values:o}),$e=Xe(1),F=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),Je=new WeakMap,T=R.createTreeWalker(R,129);function Qe(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return je!==void 0?je.createHTML(e):e}var Lt=(t,e)=>{let o=t.length-1,i=[],n,u=e===2?"<svg>":"",p=W;for(let m=0;m<o;m++){let r=t[m],s,h,a=-1,l=0;for(;l<r.length&&(p.lastIndex=l,h=p.exec(r),h!==null);)l=p.lastIndex,p===W?h[1]==="!--"?p=Ie:h[1]!==void 0?p=Ze:h[2]!==void 0?(Ye.test(h[2])&&(n=RegExp("</"+h[2],"g")),p=H):h[3]!==void 0&&(p=H):p===H?h[0]===">"?(p=n??W,a=-1):h[1]===void 0?a=-2:(a=p.lastIndex-h[2].length,s=h[1],p=h[3]===void 0?H:h[3]==='"'?De:qe):p===De||p===qe?p=H:p===Ie||p===Ze?p=W:(p=H,n=void 0);let c=p===H&&t[m+1].startsWith("/>")?" ":"";u+=p===W?r+Nt:a>=0?(i.push(s),r.slice(0,a)+We+r.slice(a)+O+c):r+O+(a===-2?m:c);}return [Qe(t,u+(t[o]||"<?>")+(e===2?"</svg>":"")),i]},Y=class t{constructor({strings:e,_$litType$:o},i){let n;this.parts=[];let u=0,p=0,m=e.length-1,r=this.parts,[s,h]=Lt(e,o);if(this.el=t.createElement(s,i),T.currentNode=this.el.content,o===2){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes);}for(;(n=T.nextNode())!==null&&r.length<m;){if(n.nodeType===1){if(n.hasAttributes())for(let a of n.getAttributeNames())if(a.endsWith(We)){let l=h[p++],c=n.getAttribute(a).split(O),d=/([.?@])?(.*)/.exec(l);r.push({type:1,index:u,name:d[2],strings:c,ctor:d[1]==="."?me:d[1]==="?"?ge:d[1]==="@"?ye:z}),n.removeAttribute(a);}else a.startsWith(O)&&(r.push({type:6,index:u}),n.removeAttribute(a));if(Ye.test(n.tagName)){let a=n.textContent.split(O),l=a.length-1;if(l>0){n.textContent=se?se.emptyScript:"";for(let c=0;c<l;c++)n.append(a[c],K()),T.nextNode(),r.push({type:2,index:++u});n.append(a[l],K());}}}else if(n.nodeType===8)if(n.data===Ke)r.push({type:2,index:u});else {let a=-1;for(;(a=n.data.indexOf(O,a+1))!==-1;)r.push({type:7,index:u}),a+=O.length-1;}u++;}}static createElement(e,o){let i=R.createElement("template");return i.innerHTML=e,i}};function B(t,e,o=t,i){if(e===F)return e;let n=i!==void 0?o._$Co?.[i]:o._$Cl,u=G(e)?void 0:e._$litDirective$;return n?.constructor!==u&&(n?._$AO?.(!1),u===void 0?n=void 0:(n=new u(t),n._$AT(t,o,i)),i!==void 0?(o._$Co??=[])[i]=n:o._$Cl=n),n!==void 0&&(e=B(t,n._$AS(t,e.values),n,i)),e}var fe=class{constructor(e,o){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=o;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:o},parts:i}=this._$AD,n=(e?.creationScope??R).importNode(o,!0);T.currentNode=n;let u=T.nextNode(),p=0,m=0,r=i[0];for(;r!==void 0;){if(p===r.index){let s;r.type===2?s=new X(u,u.nextSibling,this,e):r.type===1?s=new r.ctor(u,r.name,r.strings,this,e):r.type===6&&(s=new be(u,this,e)),this._$AV.push(s),r=i[++m];}p!==r?.index&&(u=T.nextNode(),p++);}return T.currentNode=R,n}p(e){let o=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,o),o+=i.strings.length-2):i._$AI(e[o])),o++;}},X=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,o,i,n){this.type=2,this._$AH=$,this._$AN=void 0,this._$AA=e,this._$AB=o,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0;}get parentNode(){let e=this._$AA.parentNode,o=this._$AM;return o!==void 0&&e?.nodeType===11&&(e=o.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,o=this){e=B(this,e,o),G(e)?e===$||e==null||e===""?(this._$AH!==$&&this._$AR(),this._$AH=$):e!==this._$AH&&e!==F&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ot(e)?this.k(e):this._(e);}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e));}_(e){this._$AH!==$&&G(this._$AH)?this._$AA.nextSibling.data=e:this.T(R.createTextNode(e)),this._$AH=e;}$(e){let{values:o,_$litType$:i}=e,n=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Y.createElement(Qe(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(o);else {let u=new fe(n,this),p=u.u(this.options);u.p(o),this.T(p),this._$AH=u;}}_$AC(e){let o=Je.get(e.strings);return o===void 0&&Je.set(e.strings,o=new Y(e)),o}k(e){Ge(this._$AH)||(this._$AH=[],this._$AR());let o=this._$AH,i,n=0;for(let u of e)n===o.length?o.push(i=new t(this.S(K()),this.S(K()),this,this.options)):i=o[n],i._$AI(u),n++;n<o.length&&(this._$AR(i&&i._$AB.nextSibling,n),o.length=n);}_$AR(e=this._$AA.nextSibling,o){for(this._$AP?.(!1,!0,o);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i;}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e));}},z=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,o,i,n,u){this.type=1,this._$AH=$,this._$AN=void 0,this.element=e,this.name=o,this._$AM=n,this.options=u,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=$;}_$AI(e,o=this,i,n){let u=this.strings,p=!1;if(u===void 0)e=B(this,e,o,0),p=!G(e)||e!==this._$AH&&e!==F,p&&(this._$AH=e);else {let m=e,r,s;for(e=u[0],r=0;r<u.length-1;r++)s=B(this,m[i+r],o,r),s===F&&(s=this._$AH[r]),p||=!G(s)||s!==this._$AH[r],s===$?e=$:e!==$&&(e+=(s??"")+u[r+1]),this._$AH[r]=s;}p&&!n&&this.j(e);}j(e){e===$?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"");}},me=class extends z{constructor(){super(...arguments),this.type=3;}j(e){this.element[this.name]=e===$?void 0:e;}},ge=class extends z{constructor(){super(...arguments),this.type=4;}j(e){this.element.toggleAttribute(this.name,!!e&&e!==$);}},ye=class extends z{constructor(e,o,i,n,u){super(e,o,i,n,u),this.type=5;}_$AI(e,o=this){if((e=B(this,e,o,0)??$)===F)return;let i=this._$AH,n=e===$&&i!==$||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,u=e!==$&&(i===$||n);n&&this.element.removeEventListener(this.name,this,i),u&&this.element.addEventListener(this.name,this,e),this._$AH=e;}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e);}},be=class{constructor(e,o,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=o,this.options=i;}get _$AU(){return this._$AM._$AU}_$AI(e){B(this,e);}};var Ht=_e.litHtmlPolyfillSupport;Ht?.(Y,X),(_e.litHtmlVersions??=[]).push("3.1.4");var et=(t,e,o)=>{let i=o?.renderBefore??e,n=i._$litPart$;if(n===void 0){let u=o?.renderBefore??null;i._$litPart$=n=new X(e.insertBefore(K(),u),u,void 0,o??{});}return n._$AI(t),n};var L=class extends P{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let o=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=et(o,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1);}render(){return F}};L._$litElement$=!0,L.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:L});var Tt=globalThis.litElementPolyfillSupport;Tt?.({LitElement:L});(globalThis.litElementVersions??=[]).push("4.0.6");var tt=t=>(e,o)=>{o!==void 0?o.addInitializer(()=>{customElements.define(t,e);}):customElements.define(t,e);};var Rt={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:ie},Ft=(t=Rt,e,o)=>{let{kind:i,metadata:n}=o,u=globalThis.litPropertyMetadata.get(n);if(u===void 0&&globalThis.litPropertyMetadata.set(n,u=new Map),u.set(o.name,t),i==="accessor"){let{name:p}=o;return {set(m){let r=e.get.call(this);e.set.call(this,m),this.requestUpdate(p,r,t);},init(m){return m!==void 0&&this.P(p,void 0,t),m}}}if(i==="setter"){let{name:p}=o;return function(m){let r=this[p];e.call(this,m),this.requestUpdate(p,r,t);}}throw Error("Unsupported decorator location: "+i)};function Q(t){return (e,o)=>typeof o=="object"?Ft(t,e,o):((i,n,u)=>{let p=n.hasOwnProperty(u);return n.constructor.createProperty(u,p?{...i,wrapped:!0}:i),p?Object.getOwnPropertyDescriptor(n,u):void 0})(t,e,o)}function ve(t){return Q({...t,state:!0,attribute:!1})}var rt="https://gamma-api.polymarket.com";var Ce=async t=>{let e=t.slug?`markets/slug/${t.slug}`:`markets/${t.id}`,i=await(await fetch(`${rt}/${e}`)).json();return {...i,outcomes:JSON.parse(i.outcomes),outcomePrices:JSON.parse(i.outcomePrices),clobTokenIds:i.clobTokenIds?JSON.parse(i.clobTokenIds):null}};var ut=bt(it());var ke="polymarket-embed",st,nt,at,lt,ct,ht,C,xe,we,Ae,Se;ht=[tt(ke)];var E=class extends(ct=L,lt=[Q({type:String,attribute:"market"})],at=[Q({type:String,attribute:"hide-bet-amount"})],nt=[ve()],st=[ve()],ct){constructor(){super();Z(this,xe,k(C,8,this)),k(C,11,this);Z(this,we,k(C,12,this,!1)),k(C,15,this);Z(this,Ae,k(C,16,this)),k(C,19,this);Z(this,Se,k(C,20,this)),k(C,23,this);}static get styles(){return ue` | ||
@font-face { | ||
font-family: "OpenSans"; | ||
src: url("../assets/fonts/OpenSauceOne-Regular.ttf") | ||
format("truetype"); | ||
font-weight: regular; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "OpenSans"; | ||
src: url("../assets/fonts/OpenSauceOne-Medium.ttf") | ||
format("truetype"); | ||
font-weight: medium; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "OpenSans"; | ||
src: url("../assets/fonts/OpenSauceOne-SemiBold.ttf") | ||
format("truetype"); | ||
font-weight: semi-bold; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "OpenSans"; | ||
src: url("../assets/fonts/OpenSauceOne-Bold.ttf") | ||
format("truetype"); | ||
font-weight: bold; | ||
font-style: normal; | ||
} | ||
var Fe=Object.create;var D=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var vt=Object.getPrototypeOf,$t=Object.prototype.hasOwnProperty;var ze=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),U=t=>{throw TypeError(t)};var xt=(t,e,o)=>e in t?D(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var Oe=(t,e)=>D(t,"name",{value:e,configurable:!0});var wt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ct=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of _t(e))!$t.call(t,n)&&n!==o&&D(t,n,{get:()=>e[n],enumerable:!(i=Re(e,n))||i.enumerable});return t};var At=(t,e,o)=>(o=t!=null?Fe(vt(t)):{},Ct(D(o,"default",{value:t,enumerable:!0}),t));var Ue=t=>[,,,Fe(t?.[ze("metadata")]??null)],Be=["class","method","getter","setter","accessor","field","value","get","set"],Z=t=>t!==void 0&&typeof t!="function"?U("Function expected"):t,kt=(t,e,o,i,n)=>({kind:Be[t],name:e,metadata:i,addInitializer:h=>o._?U("Already initialized"):n.push(Z(h||null))}),St=(t,e)=>xt(e,ze("metadata"),t[3]),w=(t,e,o,i)=>{for(var n=0,h=t[e>>1],p=h&&h.length;n<p;n++)e&1?h[n].call(o):i=h[n].call(o,i);return i},P=(t,e,o,i,n,h)=>{var p,m,r,s,u,a=e&7,l=!!(e&8),c=!!(e&16),d=a>3?t.length+1:a?l?1:2:0,f=Be[a+5],v=a>3&&(t[d-1]=[]),g=t[d]||(t[d]=[]),b=a&&(!c&&!l&&(n=n.prototype),a<5&&(a>3||!c)&&Re(a<4?n:{get[o](){return Te(this,h)},set[o](y){return Ve(this,h,y)}},o));a?c&&a<4&&Oe(h,(a>2?"set ":a>1?"get ":"")+o):Oe(n,o);for(var k=i.length-1;k>=0;k--)s=kt(a,o,r={},t[3],g),a&&(s.static=l,s.private=c,u=s.access={has:c?y=>Et(n,y):y=>o in y},a^3&&(u.get=c?y=>(a^1?Te:Mt)(y,n,a^4?h:b.get):y=>y[o]),a>2&&(u.set=c?(y,E)=>Ve(y,n,E,a^4?h:b.set):(y,E)=>y[o]=E)),m=(0, i[k])(a?a<4?c?h:b[f]:a>4?void 0:{get:b.get,set:b.set}:n,s),r._=1,a^4||m===void 0?Z(m)&&(a>4?v.unshift(m):a?c?h=m:b[f]=m:n=m):typeof m!="object"||m===null?U("Object expected"):(Z(p=m.get)&&(b.get=p),Z(p=m.set)&&(b.set=p),Z(p=m.init)&&v.unshift(p));return a||St(t,n),b&&D(n,o,b),c?a^4?h:b:n};var ue=(t,e,o)=>e.has(t)||U("Cannot "+o),Et=(t,e)=>Object(e)!==e?U('Cannot use the "in" operator on this value'):t.has(e),Te=(t,e,o)=>(ue(t,e,"read from private field"),o?o.call(t):e.get(t)),L=(t,e,o)=>e.has(t)?U("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,o),Ve=(t,e,o,i)=>(ue(t,e,"write to private field"),i?i.call(t,o):e.set(t,o),o),Mt=(t,e,o)=>(ue(t,e,"access private method"),o);var lt=wt((at,le)=>{(function(t,e){typeof define=="function"&&define.amd?define(e):typeof le=="object"&&le.exports?le.exports=e():t.numeral=e();})(at,function(){var t,e,o="2.0.6",i={},n={},h={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},p={currentLocale:h.currentLocale,zeroFormat:h.zeroFormat,nullFormat:h.nullFormat,defaultFormat:h.defaultFormat,scalePercentBy100:h.scalePercentBy100};function m(r,s){this._input=r,this._value=s;}return t=function(r){var s,u,a,l;if(t.isNumeral(r))s=r.value();else if(r===0||typeof r>"u")s=0;else if(r===null||e.isNaN(r))s=null;else if(typeof r=="string")if(p.zeroFormat&&r===p.zeroFormat)s=0;else if(p.nullFormat&&r===p.nullFormat||!r.replace(/[^0-9]+/g,"").length)s=null;else {for(u in i)if(l=typeof i[u].regexps.unformat=="function"?i[u].regexps.unformat():i[u].regexps.unformat,l&&r.match(l)){a=i[u].unformat;break}a=a||t._.stringToNumber,s=a(r);}else s=Number(r)||null;return new m(r,s)},t.version=o,t.isNumeral=function(r){return r instanceof m},t._=e={numberToFormat:function(r,s,u){var a=n[t.options.currentLocale],l=!1,c=!1,d=0,f="",v=1e12,g=1e9,b=1e6,k=1e3,y="",E=!1,C,H,x,S,ce,He,M;if(r=r||0,H=Math.abs(r),t._.includes(s,"(")?(l=!0,s=s.replace(/[\(|\)]/g,"")):(t._.includes(s,"+")||t._.includes(s,"-"))&&(ce=t._.includes(s,"+")?s.indexOf("+"):r<0?s.indexOf("-"):-1,s=s.replace(/[\+|\-]/g,"")),t._.includes(s,"a")&&(C=s.match(/a(k|m|b|t)?/),C=C?C[1]:!1,t._.includes(s," a")&&(f=" "),s=s.replace(new RegExp(f+"a[kmbt]?"),""),H>=v&&!C||C==="t"?(f+=a.abbreviations.trillion,r=r/v):H<v&&H>=g&&!C||C==="b"?(f+=a.abbreviations.billion,r=r/g):H<g&&H>=b&&!C||C==="m"?(f+=a.abbreviations.million,r=r/b):(H<b&&H>=k&&!C||C==="k")&&(f+=a.abbreviations.thousand,r=r/k)),t._.includes(s,"[.]")&&(c=!0,s=s.replace("[.]",".")),x=r.toString().split(".")[0],S=s.split(".")[1],He=s.indexOf(","),d=(s.split(".")[0].split(",")[0].match(/0/g)||[]).length,S?(t._.includes(S,"[")?(S=S.replace("]",""),S=S.split("["),y=t._.toFixed(r,S[0].length+S[1].length,u,S[1].length)):y=t._.toFixed(r,S.length,u),x=y.split(".")[0],t._.includes(y,".")?y=a.delimiters.decimal+y.split(".")[1]:y="",c&&Number(y.slice(1))===0&&(y="")):x=t._.toFixed(r,0,u),f&&!C&&Number(x)>=1e3&&f!==a.abbreviations.trillion)switch(x=String(Number(x)/1e3),f){case a.abbreviations.thousand:f=a.abbreviations.million;break;case a.abbreviations.million:f=a.abbreviations.billion;break;case a.abbreviations.billion:f=a.abbreviations.trillion;break}if(t._.includes(x,"-")&&(x=x.slice(1),E=!0),x.length<d)for(var Le=d-x.length;Le>0;Le--)x="0"+x;return He>-1&&(x=x.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+a.delimiters.thousands)),s.indexOf(".")===0&&(x=""),M=x+y+(f||""),l?M=(l&&E?"(":"")+M+(l&&E?")":""):ce>=0?M=ce===0?(E?"-":"+")+M:M+(E?"-":"+"):E&&(M="-"+M),M},stringToNumber:function(r){var s=n[p.currentLocale],u=r,a={thousand:3,million:6,billion:9,trillion:12},l,c,f;if(p.zeroFormat&&r===p.zeroFormat)c=0;else if(p.nullFormat&&r===p.nullFormat||!r.replace(/[^0-9]+/g,"").length)c=null;else {c=1,s.delimiters.decimal!=="."&&(r=r.replace(/\./g,"").replace(s.delimiters.decimal,"."));for(l in a)if(f=new RegExp("[^a-zA-Z]"+s.abbreviations[l]+"(?:\\)|(\\"+s.currency.symbol+")?(?:\\))?)?$"),u.match(f)){c*=Math.pow(10,a[l]);break}c*=(r.split("-").length+Math.min(r.split("(").length-1,r.split(")").length-1))%2?1:-1,r=r.replace(/[^0-9\.]+/g,""),c*=Number(r);}return c},isNaN:function(r){return typeof r=="number"&&isNaN(r)},includes:function(r,s){return r.indexOf(s)!==-1},insert:function(r,s,u){return r.slice(0,u)+s+r.slice(u)},reduce:function(r,s){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof s!="function")throw new TypeError(s+" is not a function");var u=Object(r),a=u.length>>>0,l=0,c;if(arguments.length===3)c=arguments[2];else {for(;l<a&&!(l in u);)l++;if(l>=a)throw new TypeError("Reduce of empty array with no initial value");c=u[l++];}for(;l<a;l++)l in u&&(c=s(c,u[l],l,u));return c},multiplier:function(r){var s=r.toString().split(".");return s.length<2?1:Math.pow(10,s[1].length)},correctionFactor:function(){var r=Array.prototype.slice.call(arguments);return r.reduce(function(s,u){var a=e.multiplier(u);return s>a?s:a},1)},toFixed:function(r,s,u,a){var l=r.toString().split("."),c=s-(a||0),d,f,v,g;return l.length===2?d=Math.min(Math.max(l[1].length,c),s):d=c,v=Math.pow(10,d),g=(u(r+"e+"+d)/v).toFixed(d),a>s-d&&(f=new RegExp("\\.?0{1,"+(a-(s-d))+"}$"),g=g.replace(f,"")),g}},t.options=p,t.formats=i,t.locales=n,t.locale=function(r){return r&&(p.currentLocale=r.toLowerCase()),p.currentLocale},t.localeData=function(r){if(!r)return n[p.currentLocale];if(r=r.toLowerCase(),!n[r])throw new Error("Unknown locale : "+r);return n[r]},t.reset=function(){for(var r in h)p[r]=h[r];},t.zeroFormat=function(r){p.zeroFormat=typeof r=="string"?r:null;},t.nullFormat=function(r){p.nullFormat=typeof r=="string"?r:null;},t.defaultFormat=function(r){p.defaultFormat=typeof r=="string"?r:"0.0";},t.register=function(r,s,u){if(s=s.toLowerCase(),this[r+"s"][s])throw new TypeError(s+" "+r+" already registered.");return this[r+"s"][s]=u,u},t.validate=function(r,s){var u,a,l,c,d,f,v,g;if(typeof r!="string"&&(r+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",r)),r=r.trim(),r.match(/^\d+$/))return !0;if(r==="")return !1;try{v=t.localeData(s);}catch{v=t.localeData(t.locale());}return l=v.currency.symbol,d=v.abbreviations,u=v.delimiters.decimal,v.delimiters.thousands==="."?a="\\.":a=v.delimiters.thousands,g=r.match(/^[^\d]+/),g!==null&&(r=r.substr(1),g[0]!==l)||(g=r.match(/[^\d]+$/),g!==null&&(r=r.slice(0,-1),g[0]!==d.thousand&&g[0]!==d.million&&g[0]!==d.billion&&g[0]!==d.trillion))?!1:(f=new RegExp(a+"{2}"),r.match(/[^\d.,]/g)?!1:(c=r.split(u),c.length>2?!1:c.length<2?!!c[0].match(/^\d+.*\d$/)&&!c[0].match(f):c[0].length===1?!!c[0].match(/^\d+$/)&&!c[0].match(f)&&!!c[1].match(/^\d+$/):!!c[0].match(/^\d+.*\d$/)&&!c[0].match(f)&&!!c[1].match(/^\d+$/)))},t.fn=m.prototype={clone:function(){return t(this)},format:function(r,s){var u=this._value,a=r||p.defaultFormat,l,c,d;if(s=s||Math.round,u===0&&p.zeroFormat!==null)c=p.zeroFormat;else if(u===null&&p.nullFormat!==null)c=p.nullFormat;else {for(l in i)if(a.match(i[l].regexps.format)){d=i[l].format;break}d=d||t._.numberToFormat,c=d(u,a,s);}return c},value:function(){return this._value},input:function(){return this._input},set:function(r){return this._value=Number(r),this},add:function(r){var s=e.correctionFactor.call(null,this._value,r);function u(a,l,c,d){return a+Math.round(s*l)}return this._value=e.reduce([this._value,r],u,0)/s,this},subtract:function(r){var s=e.correctionFactor.call(null,this._value,r);function u(a,l,c,d){return a-Math.round(s*l)}return this._value=e.reduce([r],u,Math.round(this._value*s))/s,this},multiply:function(r){function s(u,a,l,c){var d=e.correctionFactor(u,a);return Math.round(u*d)*Math.round(a*d)/Math.round(d*d)}return this._value=e.reduce([this._value,r],s,1),this},divide:function(r){function s(u,a,l,c){var d=e.correctionFactor(u,a);return Math.round(u*d)/Math.round(a*d)}return this._value=e.reduce([this._value,r],s),this},difference:function(r){return Math.abs(t(this._value).subtract(r).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(r){var s=r%10;return ~~(r%100/10)===1?"th":s===1?"st":s===2?"nd":s===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(r,s,u){var a=t._.includes(s," BPS")?" ":"",l;return r=r*1e4,s=s.replace(/\s?BPS/,""),l=t._.numberToFormat(r,s,u),t._.includes(l,")")?(l=l.split(""),l.splice(-1,0,a+"BPS"),l=l.join("")):l=l+a+"BPS",l},unformat:function(r){return +(t._.stringToNumber(r)*1e-4).toFixed(15)}});}(),function(){var r={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},s={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},u=r.suffixes.concat(s.suffixes.filter(function(l){return r.suffixes.indexOf(l)<0})),a=u.join("|");a="("+a.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(a)},format:function(l,c,d){var f,v=t._.includes(c,"ib")?s:r,g=t._.includes(c," b")||t._.includes(c," ib")?" ":"",b,k,y;for(c=c.replace(/\s?i?b/,""),b=0;b<=v.suffixes.length;b++)if(k=Math.pow(v.base,b),y=Math.pow(v.base,b+1),l===null||l===0||l>=k&&l<y){g+=v.suffixes[b],k>0&&(l=l/k);break}return f=t._.numberToFormat(l,c,d),f+g},unformat:function(l){var c=t._.stringToNumber(l),d,f;if(c){for(d=r.suffixes.length-1;d>=0;d--){if(t._.includes(l,r.suffixes[d])){f=Math.pow(r.base,d);break}if(t._.includes(l,s.suffixes[d])){f=Math.pow(s.base,d);break}}c*=f||1;}return c}});}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(r,s,u){var a=t.locales[t.options.currentLocale],l={before:s.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:s.match(/([\+|\-|\)|\s|\$]*)$/)[0]},c,d,f;for(s=s.replace(/\s?\$\s?/,""),c=t._.numberToFormat(r,s,u),r>=0?(l.before=l.before.replace(/[\-\(]/,""),l.after=l.after.replace(/[\-\)]/,"")):r<0&&!t._.includes(l.before,"-")&&!t._.includes(l.before,"(")&&(l.before="-"+l.before),f=0;f<l.before.length;f++)switch(d=l.before[f],d){case"$":c=t._.insert(c,a.currency.symbol,f);break;case" ":c=t._.insert(c," ",f+a.currency.symbol.length-1);break}for(f=l.after.length-1;f>=0;f--)switch(d=l.after[f],d){case"$":c=f===l.after.length-1?c+a.currency.symbol:t._.insert(c,a.currency.symbol,-(l.after.length-(1+f)));break;case" ":c=f===l.after.length-1?c+" ":t._.insert(c," ",-(l.after.length-(1+f)+a.currency.symbol.length-1));break}return c}});}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(r,s,u){var a,l=typeof r=="number"&&!t._.isNaN(r)?r.toExponential():"0e+0",c=l.split("e");return s=s.replace(/e[\+|\-]{1}0/,""),a=t._.numberToFormat(Number(c[0]),s,u),a+"e"+c[1]},unformat:function(r){var s=t._.includes(r,"e+")?r.split("e+"):r.split("e-"),u=Number(s[0]),a=Number(s[1]);a=t._.includes(r,"e-")?a*=-1:a;function l(c,d,f,v){var g=t._.correctionFactor(c,d),b=c*g*(d*g)/(g*g);return b}return t._.reduce([u,Math.pow(10,a)],l,1)}});}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(r,s,u){var a=t.locales[t.options.currentLocale],l,c=t._.includes(s," o")?" ":"";return s=s.replace(/\s?o/,""),c+=a.ordinal(r),l=t._.numberToFormat(r,s,u),l+c}});}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(r,s,u){var a=t._.includes(s," %")?" ":"",l;return t.options.scalePercentBy100&&(r=r*100),s=s.replace(/\s?\%/,""),l=t._.numberToFormat(r,s,u),t._.includes(l,")")?(l=l.split(""),l.splice(-1,0,a+"%"),l=l.join("")):l=l+a+"%",l},unformat:function(r){var s=t._.stringToNumber(r);return t.options.scalePercentBy100?s*.01:s}});}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(r,s,u){var a=Math.floor(r/60/60),l=Math.floor((r-a*60*60)/60),c=Math.round(r-a*60*60-l*60);return a+":"+(l<10?"0"+l:l)+":"+(c<10?"0"+c:c)},unformat:function(r){var s=r.split(":"),u=0;return s.length===3?(u=u+Number(s[0])*60*60,u=u+Number(s[1])*60,u=u+Number(s[2])):s.length===2&&(u=u+Number(s[0])*60,u=u+Number(s[1])),Number(u)}});}(),t});});var te=globalThis,re=te.ShadowRoot&&(te.ShadyCSS===void 0||te.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,he=Symbol(),je=new WeakMap,q=class{constructor(e,o,i){if(this._$cssResult$=!0,i!==he)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=o;}get styleSheet(){let e=this.o,o=this.t;if(re&&e===void 0){let i=o!==void 0&&o.length===1;i&&(e=je.get(o)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&je.set(o,e));}return e}toString(){return this.cssText}},Ie=t=>new q(typeof t=="string"?t:t+"",void 0,he),pe=(t,...e)=>{let o=t.length===1?t[0]:e.reduce((i,n,h)=>i+(p=>{if(p._$cssResult$===!0)return p.cssText;if(typeof p=="number")return p;throw Error("Value passed to 'css' function must be a 'css' function result: "+p+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[h+1],t[0]);return new q(o,t,he)},de=(t,e)=>{if(re)t.adoptedStyleSheets=e.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of e){let i=document.createElement("style"),n=te.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=o.cssText,t.appendChild(i);}},oe=re?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let o="";for(let i of e.cssRules)o+=i.cssText;return Ie(o)})(t):t;var{is:Pt,defineProperty:Nt,getOwnPropertyDescriptor:Ht,getOwnPropertyNames:Lt,getOwnPropertySymbols:Ot,getPrototypeOf:Tt}=Object,ie=globalThis,Ze=ie.trustedTypes,Vt=Ze?Ze.emptyScript:"",Ft=ie.reactiveElementPolyfillSupport,J=(t,e)=>t,W={toAttribute(t,e){switch(e){case Boolean:t=t?Vt:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t);}return t},fromAttribute(t,e){let o=t;switch(e){case Boolean:o=t!==null;break;case Number:o=t===null?null:Number(t);break;case Object:case Array:try{o=JSON.parse(t);}catch{o=null;}}return o}},se=(t,e)=>!Pt(t,e),De={attribute:!0,type:String,converter:W,reflect:!1,hasChanged:se};Symbol.metadata??=Symbol("metadata"),ie.litPropertyMetadata??=new WeakMap;var N=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,o=De){if(o.state&&(o.attribute=!1),this._$Ei(),this.elementProperties.set(e,o),!o.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(e,i,o);n!==void 0&&Nt(this.prototype,e,n);}}static getPropertyDescriptor(e,o,i){let{get:n,set:h}=Ht(this.prototype,e)??{get(){return this[o]},set(p){this[o]=p;}};return {get(){return n?.call(this)},set(p){let m=n?.call(this);h.call(this,p),this.requestUpdate(e,m,i);},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??De}static _$Ei(){if(this.hasOwnProperty(J("elementProperties")))return;let e=Tt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties);}static finalize(){if(this.hasOwnProperty(J("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(J("properties"))){let o=this.properties,i=[...Lt(o),...Ot(o)];for(let n of i)this.createProperty(n,o[n]);}let e=this[Symbol.metadata];if(e!==null){let o=litPropertyMetadata.get(e);if(o!==void 0)for(let[i,n]of o)this.elementProperties.set(i,n);}this._$Eh=new Map;for(let[o,i]of this.elementProperties){let n=this._$Eu(o,i);n!==void 0&&this._$Eh.set(n,o);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(e){let o=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)o.unshift(oe(n));}else e!==void 0&&o.push(oe(e));return o}static _$Eu(e,o){let i=o.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this));}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.();}removeController(e){this._$EO?.delete(e);}_$E_(){let e=new Map,o=this.constructor.elementProperties;for(let i of o.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e);}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return de(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.());}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.());}attributeChangedCallback(e,o,i){this._$AK(e,i);}_$EC(e,o){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){let h=(i.converter?.toAttribute!==void 0?i.converter:W).toAttribute(o,i.type);this._$Em=e,h==null?this.removeAttribute(n):this.setAttribute(n,h),this._$Em=null;}}_$AK(e,o){let i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let h=i.getPropertyOptions(n),p=typeof h.converter=="function"?{fromAttribute:h.converter}:h.converter?.fromAttribute!==void 0?h.converter:W;this._$Em=n,this[n]=p.fromAttribute(o,h.type),this._$Em=null;}}requestUpdate(e,o,i){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??se)(this[e],o))return;this.P(e,o,i);}this.isUpdatePending===!1&&(this._$ES=this._$ET());}P(e,o,i){this._$AL.has(e)||this._$AL.set(e,o),i.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e);}async _$ET(){this.isUpdatePending=!0;try{await this._$ES;}catch(o){Promise.reject(o);}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,h]of this._$Ep)this[n]=h;this._$Ep=void 0;}let i=this.constructor.elementProperties;if(i.size>0)for(let[n,h]of i)h.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],h);}let e=!1,o=this._$AL;try{e=this.shouldUpdate(o),e?(this.willUpdate(o),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(o)):this._$EU();}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(o);}willUpdate(e){}_$AE(e){this._$EO?.forEach(o=>o.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e);}_$EU(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return !0}update(e){this._$Ej&&=this._$Ej.forEach(o=>this._$EC(o,this[o])),this._$EU();}updated(e){}firstUpdated(e){}};N.elementStyles=[],N.shadowRootOptions={mode:"open"},N[J("elementProperties")]=new Map,N[J("finalized")]=new Map,Ft?.({ReactiveElement:N}),(ie.reactiveElementVersions??=[]).push("2.0.4");var ve=globalThis,ne=ve.trustedTypes,qe=ne?ne.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ye="$lit$",O=`lit$${Math.random().toFixed(9).slice(2)}$`,Qe="?"+O,Rt=`<${Qe}>`,R=document,G=()=>R.createComment(""),X=t=>t===null||typeof t!="object"&&typeof t!="function",et=Array.isArray,zt=t=>et(t)||typeof t?.[Symbol.iterator]=="function",fe=`[ | ||
\f\r]`,K=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Je=/-->/g,We=/>/g,V=RegExp(`>|${fe}(?:([^\\s"'>=/]+)(${fe}*=${fe}*(?:[^ | ||
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ke=/'/g,Ge=/"/g,tt=/^(?:script|style|textarea|title)$/i,rt=t=>(e,...o)=>({_$litType$:t,strings:e,values:o}),$e=rt(1),z=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),Xe=new WeakMap,F=R.createTreeWalker(R,129);function ot(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return qe!==void 0?qe.createHTML(e):e}var Ut=(t,e)=>{let o=t.length-1,i=[],n,h=e===2?"<svg>":"",p=K;for(let m=0;m<o;m++){let r=t[m],s,u,a=-1,l=0;for(;l<r.length&&(p.lastIndex=l,u=p.exec(r),u!==null);)l=p.lastIndex,p===K?u[1]==="!--"?p=Je:u[1]!==void 0?p=We:u[2]!==void 0?(tt.test(u[2])&&(n=RegExp("</"+u[2],"g")),p=V):u[3]!==void 0&&(p=V):p===V?u[0]===">"?(p=n??K,a=-1):u[1]===void 0?a=-2:(a=p.lastIndex-u[2].length,s=u[1],p=u[3]===void 0?V:u[3]==='"'?Ge:Ke):p===Ge||p===Ke?p=V:p===Je||p===We?p=K:(p=V,n=void 0);let c=p===V&&t[m+1].startsWith("/>")?" ":"";h+=p===K?r+Rt:a>=0?(i.push(s),r.slice(0,a)+Ye+r.slice(a)+O+c):r+O+(a===-2?m:c);}return [ot(t,h+(t[o]||"<?>")+(e===2?"</svg>":"")),i]},Y=class t{constructor({strings:e,_$litType$:o},i){let n;this.parts=[];let h=0,p=0,m=e.length-1,r=this.parts,[s,u]=Ut(e,o);if(this.el=t.createElement(s,i),F.currentNode=this.el.content,o===2){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes);}for(;(n=F.nextNode())!==null&&r.length<m;){if(n.nodeType===1){if(n.hasAttributes())for(let a of n.getAttributeNames())if(a.endsWith(Ye)){let l=u[p++],c=n.getAttribute(a).split(O),d=/([.?@])?(.*)/.exec(l);r.push({type:1,index:h,name:d[2],strings:c,ctor:d[1]==="."?ge:d[1]==="?"?ye:d[1]==="@"?be:j}),n.removeAttribute(a);}else a.startsWith(O)&&(r.push({type:6,index:h}),n.removeAttribute(a));if(tt.test(n.tagName)){let a=n.textContent.split(O),l=a.length-1;if(l>0){n.textContent=ne?ne.emptyScript:"";for(let c=0;c<l;c++)n.append(a[c],G()),F.nextNode(),r.push({type:2,index:++h});n.append(a[l],G());}}}else if(n.nodeType===8)if(n.data===Qe)r.push({type:2,index:h});else {let a=-1;for(;(a=n.data.indexOf(O,a+1))!==-1;)r.push({type:7,index:h}),a+=O.length-1;}h++;}}static createElement(e,o){let i=R.createElement("template");return i.innerHTML=e,i}};function B(t,e,o=t,i){if(e===z)return e;let n=i!==void 0?o._$Co?.[i]:o._$Cl,h=X(e)?void 0:e._$litDirective$;return n?.constructor!==h&&(n?._$AO?.(!1),h===void 0?n=void 0:(n=new h(t),n._$AT(t,o,i)),i!==void 0?(o._$Co??=[])[i]=n:o._$Cl=n),n!==void 0&&(e=B(t,n._$AS(t,e.values),n,i)),e}var me=class{constructor(e,o){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=o;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:o},parts:i}=this._$AD,n=(e?.creationScope??R).importNode(o,!0);F.currentNode=n;let h=F.nextNode(),p=0,m=0,r=i[0];for(;r!==void 0;){if(p===r.index){let s;r.type===2?s=new Q(h,h.nextSibling,this,e):r.type===1?s=new r.ctor(h,r.name,r.strings,this,e):r.type===6&&(s=new _e(h,this,e)),this._$AV.push(s),r=i[++m];}p!==r?.index&&(h=F.nextNode(),p++);}return F.currentNode=R,n}p(e){let o=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,o),o+=i.strings.length-2):i._$AI(e[o])),o++;}},Q=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,o,i,n){this.type=2,this._$AH=$,this._$AN=void 0,this._$AA=e,this._$AB=o,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0;}get parentNode(){let e=this._$AA.parentNode,o=this._$AM;return o!==void 0&&e?.nodeType===11&&(e=o.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,o=this){e=B(this,e,o),X(e)?e===$||e==null||e===""?(this._$AH!==$&&this._$AR(),this._$AH=$):e!==this._$AH&&e!==z&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):zt(e)?this.k(e):this._(e);}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e));}_(e){this._$AH!==$&&X(this._$AH)?this._$AA.nextSibling.data=e:this.T(R.createTextNode(e)),this._$AH=e;}$(e){let{values:o,_$litType$:i}=e,n=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Y.createElement(ot(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(o);else {let h=new me(n,this),p=h.u(this.options);h.p(o),this.T(p),this._$AH=h;}}_$AC(e){let o=Xe.get(e.strings);return o===void 0&&Xe.set(e.strings,o=new Y(e)),o}k(e){et(this._$AH)||(this._$AH=[],this._$AR());let o=this._$AH,i,n=0;for(let h of e)n===o.length?o.push(i=new t(this.S(G()),this.S(G()),this,this.options)):i=o[n],i._$AI(h),n++;n<o.length&&(this._$AR(i&&i._$AB.nextSibling,n),o.length=n);}_$AR(e=this._$AA.nextSibling,o){for(this._$AP?.(!1,!0,o);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i;}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e));}},j=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,o,i,n,h){this.type=1,this._$AH=$,this._$AN=void 0,this.element=e,this.name=o,this._$AM=n,this.options=h,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=$;}_$AI(e,o=this,i,n){let h=this.strings,p=!1;if(h===void 0)e=B(this,e,o,0),p=!X(e)||e!==this._$AH&&e!==z,p&&(this._$AH=e);else {let m=e,r,s;for(e=h[0],r=0;r<h.length-1;r++)s=B(this,m[i+r],o,r),s===z&&(s=this._$AH[r]),p||=!X(s)||s!==this._$AH[r],s===$?e=$:e!==$&&(e+=(s??"")+h[r+1]),this._$AH[r]=s;}p&&!n&&this.j(e);}j(e){e===$?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"");}},ge=class extends j{constructor(){super(...arguments),this.type=3;}j(e){this.element[this.name]=e===$?void 0:e;}},ye=class extends j{constructor(){super(...arguments),this.type=4;}j(e){this.element.toggleAttribute(this.name,!!e&&e!==$);}},be=class extends j{constructor(e,o,i,n,h){super(e,o,i,n,h),this.type=5;}_$AI(e,o=this){if((e=B(this,e,o,0)??$)===z)return;let i=this._$AH,n=e===$&&i!==$||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,h=e!==$&&(i===$||n);n&&this.element.removeEventListener(this.name,this,i),h&&this.element.addEventListener(this.name,this,e),this._$AH=e;}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e);}},_e=class{constructor(e,o,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=o,this.options=i;}get _$AU(){return this._$AM._$AU}_$AI(e){B(this,e);}};var Bt=ve.litHtmlPolyfillSupport;Bt?.(Y,Q),(ve.litHtmlVersions??=[]).push("3.1.4");var it=(t,e,o)=>{let i=o?.renderBefore??e,n=i._$litPart$;if(n===void 0){let h=o?.renderBefore??null;i._$litPart$=n=new Q(e.insertBefore(G(),h),h,void 0,o??{});}return n._$AI(t),n};var T=class extends N{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let o=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=it(o,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1);}render(){return z}};T._$litElement$=!0,T.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:T});var jt=globalThis.litElementPolyfillSupport;jt?.({LitElement:T});(globalThis.litElementVersions??=[]).push("4.0.6");var st=t=>(e,o)=>{o!==void 0?o.addInitializer(()=>{customElements.define(t,e);}):customElements.define(t,e);};var It={attribute:!0,type:String,converter:W,reflect:!1,hasChanged:se},Zt=(t=It,e,o)=>{let{kind:i,metadata:n}=o,h=globalThis.litPropertyMetadata.get(n);if(h===void 0&&globalThis.litPropertyMetadata.set(n,h=new Map),h.set(o.name,t),i==="accessor"){let{name:p}=o;return {set(m){let r=e.get.call(this);e.set.call(this,m),this.requestUpdate(p,r,t);},init(m){return m!==void 0&&this.P(p,void 0,t),m}}}if(i==="setter"){let{name:p}=o;return function(m){let r=this[p];e.call(this,m),this.requestUpdate(p,r,t);}}throw Error("Unsupported decorator location: "+i)};function I(t){return (e,o)=>typeof o=="object"?Zt(t,e,o):((i,n,h)=>{let p=n.hasOwnProperty(h);return n.constructor.createProperty(h,p?{...i,wrapped:!0}:i),p?Object.getOwnPropertyDescriptor(n,h):void 0})(t,e,o)}function ee(t){return I({...t,state:!0,attribute:!1})}var nt="https://gamma-api.polymarket.com";var xe=async t=>{let e=t.slug?`markets/slug/${t.slug}`:`markets/${t.id}`,i=await(await fetch(`${nt}/${e}`)).json();return {...i,outcomes:JSON.parse(i.outcomes),outcomePrices:JSON.parse(i.outcomePrices),clobTokenIds:i.clobTokenIds?JSON.parse(i.clobTokenIds):null}};var Pe=At(lt());var Dt={0:"M5,55 A50,50 0 0 1 5,55",10:"M5,55 A50,50 0 0 1 6,45",20:"M5,55 A50,50 0 0 1 10,33.4",30:"M5,55 A50,50 0 0 1 24,16",40:"M5,55 A50,50 0 0 1 34,9.8",50:"M5,55 A50,50 0 0 1 55,5",60:"M5,55 A50,50 0 0 1 76,9.8",70:"M5,55 A50,50 0 0 1 86,16",80:"M5,55 A50,50 0 0 1 100,33.4",90:"M5,55 A50,50 0 0 1 104,45",100:"M5,55 A50,50 0 0 1 105,55"},ct=!1,Ne=()=>{if(ct)return;ct=!0;let t=new CSSStyleSheet;t.replaceSync(` | ||
@font-face { | ||
font-family: "Open Sauce Sans"; | ||
src: url("./fonts/OpenSauceSans-Regular.ttf") format("truetype"); | ||
font-weight: 400; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "Open Sauce Sans"; | ||
src: url("./fonts/OpenSauceSans-Medium.ttf") format("truetype"); | ||
font-weight: 500; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "Open Sauce Sans"; | ||
src: url("./fonts/OpenSauceSans-SemiBold.ttf") | ||
format("truetype"); | ||
font-weight: 600; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "Open Sauce Sans"; | ||
src: url("./fonts/OpenSauceSans-Bold.ttf") format("truetype"); | ||
font-weight: 700; | ||
font-style: normal; | ||
}`),document.adoptedStyleSheets.push(t);};Ne();var ut,ht,pt,dt,ft,mt,gt,yt,bt,_,we,Ce,Ae,ke,Se,Ee,Me;bt=[st("polymarket-market-embed")];var A=class extends(yt=T,gt=[I({type:String,attribute:"market"})],mt=[I({type:Boolean,attribute:"volume",converter:(o,i)=>i===String?o==="true":i===Boolean?o:!1})],ft=[I({type:Boolean,attribute:"chart",converter:(o,i)=>i===String?o==="true":i===Boolean?o:!1})],dt=[ee()],pt=[ee()],ht=[ee()],ut=[ee()],yt){constructor(){super();L(this,we,w(_,8,this)),w(_,11,this);L(this,Ce,w(_,12,this,!1)),w(_,15,this);L(this,Ae,w(_,16,this,!1)),w(_,19,this);L(this,ke,w(_,20,this)),w(_,23,this);L(this,Se,w(_,24,this)),w(_,27,this);L(this,Ee,w(_,28,this)),w(_,31,this);L(this,Me,w(_,32,this)),w(_,35,this);Ne();}static get styles(){return pe` | ||
:host { | ||
@@ -53,11 +49,11 @@ --polymarket-color-neutral-white: #ffffff; | ||
--polymarket-font-size-sm: 12px; | ||
--polymarket-font-size-md: 14px; | ||
--polymarket-font-size-lg: 16px; | ||
--polymarket-font-size-xl: 20px; | ||
--polymarket-font-size-sm: 11px; | ||
--polymarket-font-size-md: 13px; | ||
--polymarket-font-size-lg: 15px; | ||
--polymarket-font-size-xl: 18px; | ||
--polymarket-line-height-sm: 18px; | ||
--polymarket-line-height-md: 21px; | ||
--polymarket-line-height-lg: 24px; | ||
--polymarket-line-height-xl: 24px; | ||
--polymarket-line-height-sm: 13px; | ||
--polymarket-line-height-md: 17px; | ||
--polymarket-line-height-lg: 19px; | ||
--polymarket-line-height-xl: 21px; | ||
@@ -73,3 +69,3 @@ --polymarket-font-weight-normal: 400; | ||
font-family: "OpenSans", sans-serif; | ||
font-family: "Open Sauce Sans", sans-serif; | ||
font-style: normal; | ||
@@ -88,2 +84,3 @@ -webkit-font-smoothing: antialiased; | ||
width: 100%; | ||
max-width: calc(100vw - 4px); | ||
height: fit-content; | ||
@@ -99,2 +96,3 @@ justify-content: center; | ||
width: 400px; | ||
max-width: calc(100vw - 8px); | ||
height: fit-content; | ||
@@ -113,2 +111,3 @@ padding: 20px; | ||
align-items: center; | ||
height: 60px; | ||
width: 100%; | ||
@@ -144,2 +143,3 @@ gap: var(--polymarket-space-3); | ||
a { | ||
flex: 1; | ||
text-decoration: none; | ||
@@ -150,3 +150,15 @@ color: var(--polymarket-color-neutral-black); | ||
font-weight: var(--polymarket-font-weight-semi); | ||
flex: 1; | ||
text-decoration: underline; | ||
text-decoration-color: transparent; | ||
text-decoration-thickness: 2px; | ||
transition: text-decoration-color 100ms ease; | ||
display: -webkit-box; | ||
-webkit-line-clamp: 2; | ||
-webkit-box-orient: vertical; | ||
overflow: hidden; | ||
&:hover { | ||
text-decoration-color: var( | ||
--polymarket-color-neutral-black | ||
); | ||
} | ||
} | ||
@@ -156,5 +168,7 @@ } | ||
.top-row-right-container { | ||
position: relative; | ||
align-items: center; | ||
width: 60px; | ||
width: 75px; | ||
height: 60px; | ||
overflow: visible; | ||
} | ||
@@ -198,3 +212,3 @@ | ||
align-items: center; | ||
padding: 0px 10px; | ||
padding: 0px var(--polymarket-space-3); | ||
height: 32px; | ||
@@ -210,3 +224,2 @@ background-color: var(--polymarket-color-gray-6); | ||
transition: background-color 100ms ease-in-out; | ||
font-family: "OpenSans", sans-serif; | ||
gap: var(--polymarket-space-1); | ||
@@ -218,3 +231,81 @@ text-decoration: none; | ||
} | ||
`}connectedCallback(){super.connectedCallback(),this.fetchMarketData();}async fetchMarketData(){if(this.marketSlug){let o=await Ce({slug:this.marketSlug});this.market=o,this.href=o.events?.length&&o.events[0]?.slug?`https://polymarket.com/event/${o.events[0].slug}/${o.slug}`:`https://polymarket.com/market/${o.slug}`;}}render(){return this.market?$e` <div class="container"> | ||
.gauge-text-container { | ||
position: absolute; | ||
background-color: transparent; | ||
border-radius: 100% / 100% 100% 0 0; | ||
left: 50%; | ||
top: calc(50% + 2px); | ||
transform: translate(-50%, -50%); | ||
width: calc(120px * 0.85); | ||
height: calc(60px * 0.85); | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-end; | ||
z-index: 3; | ||
} | ||
.gauge-subtext-container { | ||
position: absolute; | ||
left: 0; | ||
bottom: 0; | ||
width: 120px; | ||
height: 60px; | ||
transform: scale(1.1); | ||
background-color: transparent; | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-start; | ||
padding-top: 6px; | ||
z-index: 4; | ||
} | ||
.gauge-text { | ||
position: absolute; | ||
background-color: transparent; | ||
border-radius: 100% / 100% 100% 0 0; | ||
left: 50%; | ||
top: calc(50% + 2px); | ||
transform: translate(-50%, -50%); | ||
z-index: 3; | ||
margin: 0; | ||
color: var(--polymarket-color-neutral-black); | ||
font-size: var(--polymarket-font-size-lg); | ||
line-height: var(--polymarket-line-height-lg); | ||
font-weight: var(--polymarket-font-weight-bold); | ||
} | ||
.gauge-subtext { | ||
position: absolute; | ||
left: 50%; | ||
top: calc(50% + 18px); | ||
transform: translate(-50%, -50%); | ||
background-color: transparent; | ||
z-index: 4; | ||
margin: 0; | ||
color: var(--polymarket-color-gray-3); | ||
font-size: var(--polymarket-font-size-sm); | ||
line-height: var(--polymarket-line-height-sm); | ||
font-weight: var(--polymarket-font-weight-medium); | ||
} | ||
.gauge { | ||
position: absolute; | ||
left: 50%; | ||
top: 50%; | ||
transform: translate(-50%, calc(-50% - 10px)) scaleX(1.1); | ||
} | ||
.gauge-track { | ||
position: absolute; | ||
top: 0; | ||
z-index: 1; | ||
} | ||
.gauge-fill { | ||
position: absolute; | ||
top: 0; | ||
z-index: 1; | ||
} | ||
`}connectedCallback(){super.connectedCallback(),Ne(),this.fetchMarketData();}async fetchMarketData(){if(this.marketSlug){let o=await xe({slug:this.marketSlug});this._market=o,this._href=o.events?.length&&o.events[0]?.slug?`https://polymarket.com/event/${o.events[0].slug}/${o.slug}`:`https://polymarket.com/market/${o.slug}`;let i=o.outcomePrices[0]?parseFloat(o.outcomePrices[0]):0,n=Math.min(Math.max(i*100,0),100),p=[0,10,20,30,40,50,60,70,80,90,100].sort((m,r)=>Math.abs(m-n)-Math.abs(r-n))[0];this._probability=n,this._fillPathD=Dt[p.toFixed(0)];}}render(){return this._market?$e` <div class="container"> | ||
<div class="card-container"> | ||
@@ -224,10 +315,38 @@ <div class="top-row-container"> | ||
<img | ||
src="${this.market.imageOptimized?.imageUrlSource??this.market.image}" | ||
src="${this._market.imageOptimized?.imageUrlSource??this._market.image}" | ||
alt="icon" | ||
/> | ||
<a href="${this.href}">${this.market.question}</a> | ||
<a href="${this._href}">${this._market.question}</a> | ||
</div> | ||
<div class="top-row-right-container"> | ||
<p>gauge</p> | ||
<svg | ||
width="75px" | ||
height="35px" | ||
viewBox="0 0 110 60" | ||
class="gauge" | ||
> | ||
<path | ||
id="gauge-track" | ||
d="M5,55 A50,50 0 0 1 105,55" | ||
class="gauge-track" | ||
fill="none" | ||
stroke="var(--polymarket-color-gray-5)" | ||
stroke-width="8" | ||
/> | ||
<path | ||
id="gauge-fill" | ||
d=${this._fillPathD} | ||
class="gauge-fill" | ||
fill="none" | ||
stroke="${(this._probability??0)<50?"#E64800":"#00B955"}" | ||
stroke-width="8.5" | ||
/> | ||
</svg> | ||
<p class="gauge-text"> | ||
${(0, Pe.default)(this._probability).format("0")}% | ||
</p> | ||
<p class="gauge-subtext">chance</p> | ||
</div> | ||
@@ -262,5 +381,8 @@ </div> | ||
<p class="typography-secondary typography-number"> | ||
${this.hideBetAmount?"":(0, ut.default)(this.market.volumeNum).format("0.[0]a")} | ||
${this.showVolume?`${(0, Pe.default)(this._market.volumeNum).format("0.[0]a")}`:""} | ||
<span style="text-transform: capitalize;" | ||
>${this.showVolume?"Bet":""}</span | ||
> | ||
</p> | ||
<a class="button-primary" href="${this.href}"> | ||
<a class="button-primary" href="${this._href}"> | ||
More details | ||
@@ -284,3 +406,3 @@ <svg | ||
</div> | ||
</div>`:$e` <span>${" "}</span> `}};C=Re(ct),xe=new WeakMap,we=new WeakMap,Ae=new WeakMap,Se=new WeakMap,U(C,4,"marketSlug",lt,E,xe),U(C,4,"hideBetAmount",at,E,we),U(C,4,"market",nt,E,Ae),U(C,4,"href",st,E,Se),E=U(C,0,"MarketEmbed",ht,E),k(C,1,E);customElements.get(ke)||customElements.define(ke,E);/*! Bundled license information: | ||
</div>`:$e` <span>${" "}</span> `}};_=Ue(yt),we=new WeakMap,Ce=new WeakMap,Ae=new WeakMap,ke=new WeakMap,Se=new WeakMap,Ee=new WeakMap,Me=new WeakMap,P(_,4,"marketSlug",gt,A,we),P(_,4,"showVolume",mt,A,Ce),P(_,4,"showChart",ft,A,Ae),P(_,4,"_market",dt,A,ke),P(_,4,"_href",pt,A,Se),P(_,4,"_probability",ht,A,Ee),P(_,4,"_fillPathD",ut,A,Me),A=P(_,0,"MarketEmbed",bt,A),w(_,1,A);customElements.get("polymarket-market-embed")||customElements.define("polymarket-market-embed",A);/*! Bundled license information: | ||
@@ -402,4 +524,4 @@ numeral/numeral.js: | ||
export { E as MarketEmbed }; | ||
export { A as MarketEmbed }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.js.map |
@@ -1,33 +0,29 @@ | ||
var Le=Object.create;var I=Object.defineProperty;var He=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var dt=Object.getPrototypeOf,ft=Object.prototype.hasOwnProperty;var Te=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),V=t=>{throw TypeError(t)};var mt=(t,e,o)=>e in t?I(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var Pe=(t,e)=>I(t,"name",{value:e,configurable:!0});var gt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var yt=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of pt(e))!ft.call(t,n)&&n!==o&&I(t,n,{get:()=>e[n],enumerable:!(i=He(e,n))||i.enumerable});return t};var bt=(t,e,o)=>(o=t!=null?Le(dt(t)):{},yt(I(o,"default",{value:t,enumerable:!0}),t));var Re=t=>[,,,Le(t?.[Te("metadata")]??null)],Fe=["class","method","getter","setter","accessor","field","value","get","set"],j=t=>t!==void 0&&typeof t!="function"?V("Function expected"):t,_t=(t,e,o,i,n)=>({kind:Fe[t],name:e,metadata:i,addInitializer:u=>o._?V("Already initialized"):n.push(j(u||null))}),$t=(t,e)=>mt(e,Te("metadata"),t[3]),E=(t,e,o,i)=>{for(var n=0,u=t[e>>1],p=u&&u.length;n<p;n++)e&1?u[n].call(o):i=u[n].call(o,i);return i},U=(t,e,o,i,n,u)=>{var p,m,r,s,h,a=e&7,l=!!(e&8),c=!!(e&16),d=a>3?t.length+1:a?l?1:2:0,f=Fe[a+5],_=a>3&&(t[d-1]=[]),g=t[d]||(t[d]=[]),b=a&&(!c&&!l&&(n=n.prototype),a<5&&(a>3||!c)&&He(a<4?n:{get[o](){return Ne(this,u)},set[o](y){return Oe(this,u,y)}},o));a?c&&a<4&&Pe(u,(a>2?"set ":a>1?"get ":"")+o):Pe(n,o);for(var w=i.length-1;w>=0;w--)s=_t(a,o,r={},t[3],g),a&&(s.static=l,s.private=c,h=s.access={has:c?y=>vt(n,y):y=>o in y},a^3&&(h.get=c?y=>(a^1?Ne:Ct)(y,n,a^4?u:b.get):y=>y[o]),a>2&&(h.set=c?(y,k)=>Oe(y,n,k,a^4?u:b.set):(y,k)=>y[o]=k)),m=(0, i[w])(a?a<4?c?u:b[f]:a>4?void 0:{get:b.get,set:b.set}:n,s),r._=1,a^4||m===void 0?j(m)&&(a>4?_.unshift(m):a?c?u=m:b[f]=m:n=m):typeof m!="object"||m===null?V("Object expected"):(j(p=m.get)&&(b.get=p),j(p=m.set)&&(b.set=p),j(p=m.init)&&_.unshift(p));return a||$t(t,n),b&&I(n,o,b),c?a^4?u:b:n};var ce=(t,e,o)=>e.has(t)||V("Cannot "+o),vt=(t,e)=>Object(e)!==e?V('Cannot use the "in" operator on this value'):t.has(e),Ne=(t,e,o)=>(ce(t,e,"read from private field"),o?o.call(t):e.get(t)),Z=(t,e,o)=>e.has(t)?V("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,o),Oe=(t,e,o,i)=>(ce(t,e,"write to private field"),i?i.call(t,o):e.set(t,o),o),Ct=(t,e,o)=>(ce(t,e,"access private method"),o);var it=gt((ot,ae)=>{(function(t,e){typeof define=="function"&&define.amd?define(e):typeof ae=="object"&&ae.exports?ae.exports=e():t.numeral=e();})(ot,function(){var t,e,o="2.0.6",i={},n={},u={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},p={currentLocale:u.currentLocale,zeroFormat:u.zeroFormat,nullFormat:u.nullFormat,defaultFormat:u.defaultFormat,scalePercentBy100:u.scalePercentBy100};function m(r,s){this._input=r,this._value=s;}return t=function(r){var s,h,a,l;if(t.isNumeral(r))s=r.value();else if(r===0||typeof r>"u")s=0;else if(r===null||e.isNaN(r))s=null;else if(typeof r=="string")if(p.zeroFormat&&r===p.zeroFormat)s=0;else if(p.nullFormat&&r===p.nullFormat||!r.replace(/[^0-9]+/g,"").length)s=null;else {for(h in i)if(l=typeof i[h].regexps.unformat=="function"?i[h].regexps.unformat():i[h].regexps.unformat,l&&r.match(l)){a=i[h].unformat;break}a=a||t._.stringToNumber,s=a(r);}else s=Number(r)||null;return new m(r,s)},t.version=o,t.isNumeral=function(r){return r instanceof m},t._=e={numberToFormat:function(r,s,h){var a=n[t.options.currentLocale],l=!1,c=!1,d=0,f="",_=1e12,g=1e9,b=1e6,w=1e3,y="",k=!1,x,N,v,A,le,Ee,M;if(r=r||0,N=Math.abs(r),t._.includes(s,"(")?(l=!0,s=s.replace(/[\(|\)]/g,"")):(t._.includes(s,"+")||t._.includes(s,"-"))&&(le=t._.includes(s,"+")?s.indexOf("+"):r<0?s.indexOf("-"):-1,s=s.replace(/[\+|\-]/g,"")),t._.includes(s,"a")&&(x=s.match(/a(k|m|b|t)?/),x=x?x[1]:!1,t._.includes(s," a")&&(f=" "),s=s.replace(new RegExp(f+"a[kmbt]?"),""),N>=_&&!x||x==="t"?(f+=a.abbreviations.trillion,r=r/_):N<_&&N>=g&&!x||x==="b"?(f+=a.abbreviations.billion,r=r/g):N<g&&N>=b&&!x||x==="m"?(f+=a.abbreviations.million,r=r/b):(N<b&&N>=w&&!x||x==="k")&&(f+=a.abbreviations.thousand,r=r/w)),t._.includes(s,"[.]")&&(c=!0,s=s.replace("[.]",".")),v=r.toString().split(".")[0],A=s.split(".")[1],Ee=s.indexOf(","),d=(s.split(".")[0].split(",")[0].match(/0/g)||[]).length,A?(t._.includes(A,"[")?(A=A.replace("]",""),A=A.split("["),y=t._.toFixed(r,A[0].length+A[1].length,h,A[1].length)):y=t._.toFixed(r,A.length,h),v=y.split(".")[0],t._.includes(y,".")?y=a.delimiters.decimal+y.split(".")[1]:y="",c&&Number(y.slice(1))===0&&(y="")):v=t._.toFixed(r,0,h),f&&!x&&Number(v)>=1e3&&f!==a.abbreviations.trillion)switch(v=String(Number(v)/1e3),f){case a.abbreviations.thousand:f=a.abbreviations.million;break;case a.abbreviations.million:f=a.abbreviations.billion;break;case a.abbreviations.billion:f=a.abbreviations.trillion;break}if(t._.includes(v,"-")&&(v=v.slice(1),k=!0),v.length<d)for(var Me=d-v.length;Me>0;Me--)v="0"+v;return Ee>-1&&(v=v.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+a.delimiters.thousands)),s.indexOf(".")===0&&(v=""),M=v+y+(f||""),l?M=(l&&k?"(":"")+M+(l&&k?")":""):le>=0?M=le===0?(k?"-":"+")+M:M+(k?"-":"+"):k&&(M="-"+M),M},stringToNumber:function(r){var s=n[p.currentLocale],h=r,a={thousand:3,million:6,billion:9,trillion:12},l,c,f;if(p.zeroFormat&&r===p.zeroFormat)c=0;else if(p.nullFormat&&r===p.nullFormat||!r.replace(/[^0-9]+/g,"").length)c=null;else {c=1,s.delimiters.decimal!=="."&&(r=r.replace(/\./g,"").replace(s.delimiters.decimal,"."));for(l in a)if(f=new RegExp("[^a-zA-Z]"+s.abbreviations[l]+"(?:\\)|(\\"+s.currency.symbol+")?(?:\\))?)?$"),h.match(f)){c*=Math.pow(10,a[l]);break}c*=(r.split("-").length+Math.min(r.split("(").length-1,r.split(")").length-1))%2?1:-1,r=r.replace(/[^0-9\.]+/g,""),c*=Number(r);}return c},isNaN:function(r){return typeof r=="number"&&isNaN(r)},includes:function(r,s){return r.indexOf(s)!==-1},insert:function(r,s,h){return r.slice(0,h)+s+r.slice(h)},reduce:function(r,s){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof s!="function")throw new TypeError(s+" is not a function");var h=Object(r),a=h.length>>>0,l=0,c;if(arguments.length===3)c=arguments[2];else {for(;l<a&&!(l in h);)l++;if(l>=a)throw new TypeError("Reduce of empty array with no initial value");c=h[l++];}for(;l<a;l++)l in h&&(c=s(c,h[l],l,h));return c},multiplier:function(r){var s=r.toString().split(".");return s.length<2?1:Math.pow(10,s[1].length)},correctionFactor:function(){var r=Array.prototype.slice.call(arguments);return r.reduce(function(s,h){var a=e.multiplier(h);return s>a?s:a},1)},toFixed:function(r,s,h,a){var l=r.toString().split("."),c=s-(a||0),d,f,_,g;return l.length===2?d=Math.min(Math.max(l[1].length,c),s):d=c,_=Math.pow(10,d),g=(h(r+"e+"+d)/_).toFixed(d),a>s-d&&(f=new RegExp("\\.?0{1,"+(a-(s-d))+"}$"),g=g.replace(f,"")),g}},t.options=p,t.formats=i,t.locales=n,t.locale=function(r){return r&&(p.currentLocale=r.toLowerCase()),p.currentLocale},t.localeData=function(r){if(!r)return n[p.currentLocale];if(r=r.toLowerCase(),!n[r])throw new Error("Unknown locale : "+r);return n[r]},t.reset=function(){for(var r in u)p[r]=u[r];},t.zeroFormat=function(r){p.zeroFormat=typeof r=="string"?r:null;},t.nullFormat=function(r){p.nullFormat=typeof r=="string"?r:null;},t.defaultFormat=function(r){p.defaultFormat=typeof r=="string"?r:"0.0";},t.register=function(r,s,h){if(s=s.toLowerCase(),this[r+"s"][s])throw new TypeError(s+" "+r+" already registered.");return this[r+"s"][s]=h,h},t.validate=function(r,s){var h,a,l,c,d,f,_,g;if(typeof r!="string"&&(r+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",r)),r=r.trim(),r.match(/^\d+$/))return !0;if(r==="")return !1;try{_=t.localeData(s);}catch{_=t.localeData(t.locale());}return l=_.currency.symbol,d=_.abbreviations,h=_.delimiters.decimal,_.delimiters.thousands==="."?a="\\.":a=_.delimiters.thousands,g=r.match(/^[^\d]+/),g!==null&&(r=r.substr(1),g[0]!==l)||(g=r.match(/[^\d]+$/),g!==null&&(r=r.slice(0,-1),g[0]!==d.thousand&&g[0]!==d.million&&g[0]!==d.billion&&g[0]!==d.trillion))?!1:(f=new RegExp(a+"{2}"),r.match(/[^\d.,]/g)?!1:(c=r.split(h),c.length>2?!1:c.length<2?!!c[0].match(/^\d+.*\d$/)&&!c[0].match(f):c[0].length===1?!!c[0].match(/^\d+$/)&&!c[0].match(f)&&!!c[1].match(/^\d+$/):!!c[0].match(/^\d+.*\d$/)&&!c[0].match(f)&&!!c[1].match(/^\d+$/)))},t.fn=m.prototype={clone:function(){return t(this)},format:function(r,s){var h=this._value,a=r||p.defaultFormat,l,c,d;if(s=s||Math.round,h===0&&p.zeroFormat!==null)c=p.zeroFormat;else if(h===null&&p.nullFormat!==null)c=p.nullFormat;else {for(l in i)if(a.match(i[l].regexps.format)){d=i[l].format;break}d=d||t._.numberToFormat,c=d(h,a,s);}return c},value:function(){return this._value},input:function(){return this._input},set:function(r){return this._value=Number(r),this},add:function(r){var s=e.correctionFactor.call(null,this._value,r);function h(a,l,c,d){return a+Math.round(s*l)}return this._value=e.reduce([this._value,r],h,0)/s,this},subtract:function(r){var s=e.correctionFactor.call(null,this._value,r);function h(a,l,c,d){return a-Math.round(s*l)}return this._value=e.reduce([r],h,Math.round(this._value*s))/s,this},multiply:function(r){function s(h,a,l,c){var d=e.correctionFactor(h,a);return Math.round(h*d)*Math.round(a*d)/Math.round(d*d)}return this._value=e.reduce([this._value,r],s,1),this},divide:function(r){function s(h,a,l,c){var d=e.correctionFactor(h,a);return Math.round(h*d)/Math.round(a*d)}return this._value=e.reduce([this._value,r],s),this},difference:function(r){return Math.abs(t(this._value).subtract(r).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(r){var s=r%10;return ~~(r%100/10)===1?"th":s===1?"st":s===2?"nd":s===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(r,s,h){var a=t._.includes(s," BPS")?" ":"",l;return r=r*1e4,s=s.replace(/\s?BPS/,""),l=t._.numberToFormat(r,s,h),t._.includes(l,")")?(l=l.split(""),l.splice(-1,0,a+"BPS"),l=l.join("")):l=l+a+"BPS",l},unformat:function(r){return +(t._.stringToNumber(r)*1e-4).toFixed(15)}});}(),function(){var r={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},s={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},h=r.suffixes.concat(s.suffixes.filter(function(l){return r.suffixes.indexOf(l)<0})),a=h.join("|");a="("+a.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(a)},format:function(l,c,d){var f,_=t._.includes(c,"ib")?s:r,g=t._.includes(c," b")||t._.includes(c," ib")?" ":"",b,w,y;for(c=c.replace(/\s?i?b/,""),b=0;b<=_.suffixes.length;b++)if(w=Math.pow(_.base,b),y=Math.pow(_.base,b+1),l===null||l===0||l>=w&&l<y){g+=_.suffixes[b],w>0&&(l=l/w);break}return f=t._.numberToFormat(l,c,d),f+g},unformat:function(l){var c=t._.stringToNumber(l),d,f;if(c){for(d=r.suffixes.length-1;d>=0;d--){if(t._.includes(l,r.suffixes[d])){f=Math.pow(r.base,d);break}if(t._.includes(l,s.suffixes[d])){f=Math.pow(s.base,d);break}}c*=f||1;}return c}});}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(r,s,h){var a=t.locales[t.options.currentLocale],l={before:s.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:s.match(/([\+|\-|\)|\s|\$]*)$/)[0]},c,d,f;for(s=s.replace(/\s?\$\s?/,""),c=t._.numberToFormat(r,s,h),r>=0?(l.before=l.before.replace(/[\-\(]/,""),l.after=l.after.replace(/[\-\)]/,"")):r<0&&!t._.includes(l.before,"-")&&!t._.includes(l.before,"(")&&(l.before="-"+l.before),f=0;f<l.before.length;f++)switch(d=l.before[f],d){case"$":c=t._.insert(c,a.currency.symbol,f);break;case" ":c=t._.insert(c," ",f+a.currency.symbol.length-1);break}for(f=l.after.length-1;f>=0;f--)switch(d=l.after[f],d){case"$":c=f===l.after.length-1?c+a.currency.symbol:t._.insert(c,a.currency.symbol,-(l.after.length-(1+f)));break;case" ":c=f===l.after.length-1?c+" ":t._.insert(c," ",-(l.after.length-(1+f)+a.currency.symbol.length-1));break}return c}});}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(r,s,h){var a,l=typeof r=="number"&&!t._.isNaN(r)?r.toExponential():"0e+0",c=l.split("e");return s=s.replace(/e[\+|\-]{1}0/,""),a=t._.numberToFormat(Number(c[0]),s,h),a+"e"+c[1]},unformat:function(r){var s=t._.includes(r,"e+")?r.split("e+"):r.split("e-"),h=Number(s[0]),a=Number(s[1]);a=t._.includes(r,"e-")?a*=-1:a;function l(c,d,f,_){var g=t._.correctionFactor(c,d),b=c*g*(d*g)/(g*g);return b}return t._.reduce([h,Math.pow(10,a)],l,1)}});}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(r,s,h){var a=t.locales[t.options.currentLocale],l,c=t._.includes(s," o")?" ":"";return s=s.replace(/\s?o/,""),c+=a.ordinal(r),l=t._.numberToFormat(r,s,h),l+c}});}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(r,s,h){var a=t._.includes(s," %")?" ":"",l;return t.options.scalePercentBy100&&(r=r*100),s=s.replace(/\s?\%/,""),l=t._.numberToFormat(r,s,h),t._.includes(l,")")?(l=l.split(""),l.splice(-1,0,a+"%"),l=l.join("")):l=l+a+"%",l},unformat:function(r){var s=t._.stringToNumber(r);return t.options.scalePercentBy100?s*.01:s}});}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(r,s,h){var a=Math.floor(r/60/60),l=Math.floor((r-a*60*60)/60),c=Math.round(r-a*60*60-l*60);return a+":"+(l<10?"0"+l:l)+":"+(c<10?"0"+c:c)},unformat:function(r){var s=r.split(":"),h=0;return s.length===3?(h=h+Number(s[0])*60*60,h=h+Number(s[1])*60,h=h+Number(s[2])):s.length===2&&(h=h+Number(s[0])*60,h=h+Number(s[1])),Number(h)}});}(),t});});var ee=globalThis,te=ee.ShadowRoot&&(ee.ShadyCSS===void 0||ee.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,he=Symbol(),Ve=new WeakMap,q=class{constructor(e,o,i){if(this._$cssResult$=!0,i!==he)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=o;}get styleSheet(){let e=this.o,o=this.t;if(te&&e===void 0){let i=o!==void 0&&o.length===1;i&&(e=Ve.get(o)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Ve.set(o,e));}return e}toString(){return this.cssText}},Ue=t=>new q(typeof t=="string"?t:t+"",void 0,he),ue=(t,...e)=>{let o=t.length===1?t[0]:e.reduce((i,n,u)=>i+(p=>{if(p._$cssResult$===!0)return p.cssText;if(typeof p=="number")return p;throw Error("Value passed to 'css' function must be a 'css' function result: "+p+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[u+1],t[0]);return new q(o,t,he)},pe=(t,e)=>{if(te)t.adoptedStyleSheets=e.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of e){let i=document.createElement("style"),n=ee.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=o.cssText,t.appendChild(i);}},re=te?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let o="";for(let i of e.cssRules)o+=i.cssText;return Ue(o)})(t):t;var{is:xt,defineProperty:wt,getOwnPropertyDescriptor:At,getOwnPropertyNames:St,getOwnPropertySymbols:kt,getPrototypeOf:Et}=Object,oe=globalThis,Be=oe.trustedTypes,Mt=Be?Be.emptyScript:"",Pt=oe.reactiveElementPolyfillSupport,D=(t,e)=>t,J={toAttribute(t,e){switch(e){case Boolean:t=t?Mt:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t);}return t},fromAttribute(t,e){let o=t;switch(e){case Boolean:o=t!==null;break;case Number:o=t===null?null:Number(t);break;case Object:case Array:try{o=JSON.parse(t);}catch{o=null;}}return o}},ie=(t,e)=>!xt(t,e),ze={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:ie};Symbol.metadata??=Symbol("metadata"),oe.litPropertyMetadata??=new WeakMap;var P=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,o=ze){if(o.state&&(o.attribute=!1),this._$Ei(),this.elementProperties.set(e,o),!o.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(e,i,o);n!==void 0&&wt(this.prototype,e,n);}}static getPropertyDescriptor(e,o,i){let{get:n,set:u}=At(this.prototype,e)??{get(){return this[o]},set(p){this[o]=p;}};return {get(){return n?.call(this)},set(p){let m=n?.call(this);u.call(this,p),this.requestUpdate(e,m,i);},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ze}static _$Ei(){if(this.hasOwnProperty(D("elementProperties")))return;let e=Et(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties);}static finalize(){if(this.hasOwnProperty(D("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(D("properties"))){let o=this.properties,i=[...St(o),...kt(o)];for(let n of i)this.createProperty(n,o[n]);}let e=this[Symbol.metadata];if(e!==null){let o=litPropertyMetadata.get(e);if(o!==void 0)for(let[i,n]of o)this.elementProperties.set(i,n);}this._$Eh=new Map;for(let[o,i]of this.elementProperties){let n=this._$Eu(o,i);n!==void 0&&this._$Eh.set(n,o);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(e){let o=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)o.unshift(re(n));}else e!==void 0&&o.push(re(e));return o}static _$Eu(e,o){let i=o.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this));}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.();}removeController(e){this._$EO?.delete(e);}_$E_(){let e=new Map,o=this.constructor.elementProperties;for(let i of o.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e);}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return pe(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.());}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.());}attributeChangedCallback(e,o,i){this._$AK(e,i);}_$EC(e,o){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){let u=(i.converter?.toAttribute!==void 0?i.converter:J).toAttribute(o,i.type);this._$Em=e,u==null?this.removeAttribute(n):this.setAttribute(n,u),this._$Em=null;}}_$AK(e,o){let i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let u=i.getPropertyOptions(n),p=typeof u.converter=="function"?{fromAttribute:u.converter}:u.converter?.fromAttribute!==void 0?u.converter:J;this._$Em=n,this[n]=p.fromAttribute(o,u.type),this._$Em=null;}}requestUpdate(e,o,i){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??ie)(this[e],o))return;this.P(e,o,i);}this.isUpdatePending===!1&&(this._$ES=this._$ET());}P(e,o,i){this._$AL.has(e)||this._$AL.set(e,o),i.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e);}async _$ET(){this.isUpdatePending=!0;try{await this._$ES;}catch(o){Promise.reject(o);}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,u]of this._$Ep)this[n]=u;this._$Ep=void 0;}let i=this.constructor.elementProperties;if(i.size>0)for(let[n,u]of i)u.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],u);}let e=!1,o=this._$AL;try{e=this.shouldUpdate(o),e?(this.willUpdate(o),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(o)):this._$EU();}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(o);}willUpdate(e){}_$AE(e){this._$EO?.forEach(o=>o.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e);}_$EU(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return !0}update(e){this._$Ej&&=this._$Ej.forEach(o=>this._$EC(o,this[o])),this._$EU();}updated(e){}firstUpdated(e){}};P.elementStyles=[],P.shadowRootOptions={mode:"open"},P[D("elementProperties")]=new Map,P[D("finalized")]=new Map,Pt?.({ReactiveElement:P}),(oe.reactiveElementVersions??=[]).push("2.0.4");var _e=globalThis,se=_e.trustedTypes,je=se?se.createPolicy("lit-html",{createHTML:t=>t}):void 0,We="$lit$",O=`lit$${Math.random().toFixed(9).slice(2)}$`,Ke="?"+O,Nt=`<${Ke}>`,R=document,K=()=>R.createComment(""),G=t=>t===null||typeof t!="object"&&typeof t!="function",Ge=Array.isArray,Ot=t=>Ge(t)||typeof t?.[Symbol.iterator]=="function",de=`[ | ||
\f\r]`,W=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ie=/-->/g,Ze=/>/g,H=RegExp(`>|${de}(?:([^\\s"'>=/]+)(${de}*=${de}*(?:[^ | ||
\f\r"'\`<>=]|("|')|))|$)`,"g"),qe=/'/g,De=/"/g,Ye=/^(?:script|style|textarea|title)$/i,Xe=t=>(e,...o)=>({_$litType$:t,strings:e,values:o}),$e=Xe(1),F=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),Je=new WeakMap,T=R.createTreeWalker(R,129);function Qe(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return je!==void 0?je.createHTML(e):e}var Lt=(t,e)=>{let o=t.length-1,i=[],n,u=e===2?"<svg>":"",p=W;for(let m=0;m<o;m++){let r=t[m],s,h,a=-1,l=0;for(;l<r.length&&(p.lastIndex=l,h=p.exec(r),h!==null);)l=p.lastIndex,p===W?h[1]==="!--"?p=Ie:h[1]!==void 0?p=Ze:h[2]!==void 0?(Ye.test(h[2])&&(n=RegExp("</"+h[2],"g")),p=H):h[3]!==void 0&&(p=H):p===H?h[0]===">"?(p=n??W,a=-1):h[1]===void 0?a=-2:(a=p.lastIndex-h[2].length,s=h[1],p=h[3]===void 0?H:h[3]==='"'?De:qe):p===De||p===qe?p=H:p===Ie||p===Ze?p=W:(p=H,n=void 0);let c=p===H&&t[m+1].startsWith("/>")?" ":"";u+=p===W?r+Nt:a>=0?(i.push(s),r.slice(0,a)+We+r.slice(a)+O+c):r+O+(a===-2?m:c);}return [Qe(t,u+(t[o]||"<?>")+(e===2?"</svg>":"")),i]},Y=class t{constructor({strings:e,_$litType$:o},i){let n;this.parts=[];let u=0,p=0,m=e.length-1,r=this.parts,[s,h]=Lt(e,o);if(this.el=t.createElement(s,i),T.currentNode=this.el.content,o===2){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes);}for(;(n=T.nextNode())!==null&&r.length<m;){if(n.nodeType===1){if(n.hasAttributes())for(let a of n.getAttributeNames())if(a.endsWith(We)){let l=h[p++],c=n.getAttribute(a).split(O),d=/([.?@])?(.*)/.exec(l);r.push({type:1,index:u,name:d[2],strings:c,ctor:d[1]==="."?me:d[1]==="?"?ge:d[1]==="@"?ye:z}),n.removeAttribute(a);}else a.startsWith(O)&&(r.push({type:6,index:u}),n.removeAttribute(a));if(Ye.test(n.tagName)){let a=n.textContent.split(O),l=a.length-1;if(l>0){n.textContent=se?se.emptyScript:"";for(let c=0;c<l;c++)n.append(a[c],K()),T.nextNode(),r.push({type:2,index:++u});n.append(a[l],K());}}}else if(n.nodeType===8)if(n.data===Ke)r.push({type:2,index:u});else {let a=-1;for(;(a=n.data.indexOf(O,a+1))!==-1;)r.push({type:7,index:u}),a+=O.length-1;}u++;}}static createElement(e,o){let i=R.createElement("template");return i.innerHTML=e,i}};function B(t,e,o=t,i){if(e===F)return e;let n=i!==void 0?o._$Co?.[i]:o._$Cl,u=G(e)?void 0:e._$litDirective$;return n?.constructor!==u&&(n?._$AO?.(!1),u===void 0?n=void 0:(n=new u(t),n._$AT(t,o,i)),i!==void 0?(o._$Co??=[])[i]=n:o._$Cl=n),n!==void 0&&(e=B(t,n._$AS(t,e.values),n,i)),e}var fe=class{constructor(e,o){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=o;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:o},parts:i}=this._$AD,n=(e?.creationScope??R).importNode(o,!0);T.currentNode=n;let u=T.nextNode(),p=0,m=0,r=i[0];for(;r!==void 0;){if(p===r.index){let s;r.type===2?s=new X(u,u.nextSibling,this,e):r.type===1?s=new r.ctor(u,r.name,r.strings,this,e):r.type===6&&(s=new be(u,this,e)),this._$AV.push(s),r=i[++m];}p!==r?.index&&(u=T.nextNode(),p++);}return T.currentNode=R,n}p(e){let o=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,o),o+=i.strings.length-2):i._$AI(e[o])),o++;}},X=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,o,i,n){this.type=2,this._$AH=$,this._$AN=void 0,this._$AA=e,this._$AB=o,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0;}get parentNode(){let e=this._$AA.parentNode,o=this._$AM;return o!==void 0&&e?.nodeType===11&&(e=o.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,o=this){e=B(this,e,o),G(e)?e===$||e==null||e===""?(this._$AH!==$&&this._$AR(),this._$AH=$):e!==this._$AH&&e!==F&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ot(e)?this.k(e):this._(e);}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e));}_(e){this._$AH!==$&&G(this._$AH)?this._$AA.nextSibling.data=e:this.T(R.createTextNode(e)),this._$AH=e;}$(e){let{values:o,_$litType$:i}=e,n=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Y.createElement(Qe(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(o);else {let u=new fe(n,this),p=u.u(this.options);u.p(o),this.T(p),this._$AH=u;}}_$AC(e){let o=Je.get(e.strings);return o===void 0&&Je.set(e.strings,o=new Y(e)),o}k(e){Ge(this._$AH)||(this._$AH=[],this._$AR());let o=this._$AH,i,n=0;for(let u of e)n===o.length?o.push(i=new t(this.S(K()),this.S(K()),this,this.options)):i=o[n],i._$AI(u),n++;n<o.length&&(this._$AR(i&&i._$AB.nextSibling,n),o.length=n);}_$AR(e=this._$AA.nextSibling,o){for(this._$AP?.(!1,!0,o);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i;}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e));}},z=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,o,i,n,u){this.type=1,this._$AH=$,this._$AN=void 0,this.element=e,this.name=o,this._$AM=n,this.options=u,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=$;}_$AI(e,o=this,i,n){let u=this.strings,p=!1;if(u===void 0)e=B(this,e,o,0),p=!G(e)||e!==this._$AH&&e!==F,p&&(this._$AH=e);else {let m=e,r,s;for(e=u[0],r=0;r<u.length-1;r++)s=B(this,m[i+r],o,r),s===F&&(s=this._$AH[r]),p||=!G(s)||s!==this._$AH[r],s===$?e=$:e!==$&&(e+=(s??"")+u[r+1]),this._$AH[r]=s;}p&&!n&&this.j(e);}j(e){e===$?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"");}},me=class extends z{constructor(){super(...arguments),this.type=3;}j(e){this.element[this.name]=e===$?void 0:e;}},ge=class extends z{constructor(){super(...arguments),this.type=4;}j(e){this.element.toggleAttribute(this.name,!!e&&e!==$);}},ye=class extends z{constructor(e,o,i,n,u){super(e,o,i,n,u),this.type=5;}_$AI(e,o=this){if((e=B(this,e,o,0)??$)===F)return;let i=this._$AH,n=e===$&&i!==$||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,u=e!==$&&(i===$||n);n&&this.element.removeEventListener(this.name,this,i),u&&this.element.addEventListener(this.name,this,e),this._$AH=e;}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e);}},be=class{constructor(e,o,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=o,this.options=i;}get _$AU(){return this._$AM._$AU}_$AI(e){B(this,e);}};var Ht=_e.litHtmlPolyfillSupport;Ht?.(Y,X),(_e.litHtmlVersions??=[]).push("3.1.4");var et=(t,e,o)=>{let i=o?.renderBefore??e,n=i._$litPart$;if(n===void 0){let u=o?.renderBefore??null;i._$litPart$=n=new X(e.insertBefore(K(),u),u,void 0,o??{});}return n._$AI(t),n};var L=class extends P{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let o=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=et(o,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1);}render(){return F}};L._$litElement$=!0,L.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:L});var Tt=globalThis.litElementPolyfillSupport;Tt?.({LitElement:L});(globalThis.litElementVersions??=[]).push("4.0.6");var tt=t=>(e,o)=>{o!==void 0?o.addInitializer(()=>{customElements.define(t,e);}):customElements.define(t,e);};var Rt={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:ie},Ft=(t=Rt,e,o)=>{let{kind:i,metadata:n}=o,u=globalThis.litPropertyMetadata.get(n);if(u===void 0&&globalThis.litPropertyMetadata.set(n,u=new Map),u.set(o.name,t),i==="accessor"){let{name:p}=o;return {set(m){let r=e.get.call(this);e.set.call(this,m),this.requestUpdate(p,r,t);},init(m){return m!==void 0&&this.P(p,void 0,t),m}}}if(i==="setter"){let{name:p}=o;return function(m){let r=this[p];e.call(this,m),this.requestUpdate(p,r,t);}}throw Error("Unsupported decorator location: "+i)};function Q(t){return (e,o)=>typeof o=="object"?Ft(t,e,o):((i,n,u)=>{let p=n.hasOwnProperty(u);return n.constructor.createProperty(u,p?{...i,wrapped:!0}:i),p?Object.getOwnPropertyDescriptor(n,u):void 0})(t,e,o)}function ve(t){return Q({...t,state:!0,attribute:!1})}var rt="https://gamma-api.polymarket.com";var Ce=async t=>{let e=t.slug?`markets/slug/${t.slug}`:`markets/${t.id}`,i=await(await fetch(`${rt}/${e}`)).json();return {...i,outcomes:JSON.parse(i.outcomes),outcomePrices:JSON.parse(i.outcomePrices),clobTokenIds:i.clobTokenIds?JSON.parse(i.clobTokenIds):null}};var ut=bt(it());var ke="polymarket-embed",st,nt,at,lt,ct,ht,C,xe,we,Ae,Se;ht=[tt(ke)];var S=class extends(ct=L,lt=[Q({type:String,attribute:"market"})],at=[Q({type:String,attribute:"hide-bet-amount"})],nt=[ve()],st=[ve()],ct){constructor(){super();Z(this,xe,E(C,8,this)),E(C,11,this);Z(this,we,E(C,12,this,!1)),E(C,15,this);Z(this,Ae,E(C,16,this)),E(C,19,this);Z(this,Se,E(C,20,this)),E(C,23,this);}static get styles(){return ue` | ||
@font-face { | ||
font-family: "OpenSans"; | ||
src: url("../assets/fonts/OpenSauceOne-Regular.ttf") | ||
format("truetype"); | ||
font-weight: regular; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "OpenSans"; | ||
src: url("../assets/fonts/OpenSauceOne-Medium.ttf") | ||
format("truetype"); | ||
font-weight: medium; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "OpenSans"; | ||
src: url("../assets/fonts/OpenSauceOne-SemiBold.ttf") | ||
format("truetype"); | ||
font-weight: semi-bold; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "OpenSans"; | ||
src: url("../assets/fonts/OpenSauceOne-Bold.ttf") | ||
format("truetype"); | ||
font-weight: bold; | ||
font-style: normal; | ||
} | ||
var Fe=Object.create;var D=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var vt=Object.getPrototypeOf,$t=Object.prototype.hasOwnProperty;var ze=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),U=t=>{throw TypeError(t)};var xt=(t,e,o)=>e in t?D(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var Oe=(t,e)=>D(t,"name",{value:e,configurable:!0});var wt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ct=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of _t(e))!$t.call(t,n)&&n!==o&&D(t,n,{get:()=>e[n],enumerable:!(i=Re(e,n))||i.enumerable});return t};var kt=(t,e,o)=>(o=t!=null?Fe(vt(t)):{},Ct(D(o,"default",{value:t,enumerable:!0}),t));var Ue=t=>[,,,Fe(t?.[ze("metadata")]??null)],Be=["class","method","getter","setter","accessor","field","value","get","set"],Z=t=>t!==void 0&&typeof t!="function"?U("Function expected"):t,At=(t,e,o,i,n)=>({kind:Be[t],name:e,metadata:i,addInitializer:h=>o._?U("Already initialized"):n.push(Z(h||null))}),St=(t,e)=>xt(e,ze("metadata"),t[3]),w=(t,e,o,i)=>{for(var n=0,h=t[e>>1],p=h&&h.length;n<p;n++)e&1?h[n].call(o):i=h[n].call(o,i);return i},P=(t,e,o,i,n,h)=>{var p,m,r,s,u,a=e&7,l=!!(e&8),c=!!(e&16),d=a>3?t.length+1:a?l?1:2:0,f=Be[a+5],v=a>3&&(t[d-1]=[]),g=t[d]||(t[d]=[]),b=a&&(!c&&!l&&(n=n.prototype),a<5&&(a>3||!c)&&Re(a<4?n:{get[o](){return Te(this,h)},set[o](y){return Ve(this,h,y)}},o));a?c&&a<4&&Oe(h,(a>2?"set ":a>1?"get ":"")+o):Oe(n,o);for(var A=i.length-1;A>=0;A--)s=At(a,o,r={},t[3],g),a&&(s.static=l,s.private=c,u=s.access={has:c?y=>Et(n,y):y=>o in y},a^3&&(u.get=c?y=>(a^1?Te:Mt)(y,n,a^4?h:b.get):y=>y[o]),a>2&&(u.set=c?(y,E)=>Ve(y,n,E,a^4?h:b.set):(y,E)=>y[o]=E)),m=(0, i[A])(a?a<4?c?h:b[f]:a>4?void 0:{get:b.get,set:b.set}:n,s),r._=1,a^4||m===void 0?Z(m)&&(a>4?v.unshift(m):a?c?h=m:b[f]=m:n=m):typeof m!="object"||m===null?U("Object expected"):(Z(p=m.get)&&(b.get=p),Z(p=m.set)&&(b.set=p),Z(p=m.init)&&v.unshift(p));return a||St(t,n),b&&D(n,o,b),c?a^4?h:b:n};var ue=(t,e,o)=>e.has(t)||U("Cannot "+o),Et=(t,e)=>Object(e)!==e?U('Cannot use the "in" operator on this value'):t.has(e),Te=(t,e,o)=>(ue(t,e,"read from private field"),o?o.call(t):e.get(t)),L=(t,e,o)=>e.has(t)?U("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,o),Ve=(t,e,o,i)=>(ue(t,e,"write to private field"),i?i.call(t,o):e.set(t,o),o),Mt=(t,e,o)=>(ue(t,e,"access private method"),o);var lt=wt((at,le)=>{(function(t,e){typeof define=="function"&&define.amd?define(e):typeof le=="object"&&le.exports?le.exports=e():t.numeral=e();})(at,function(){var t,e,o="2.0.6",i={},n={},h={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},p={currentLocale:h.currentLocale,zeroFormat:h.zeroFormat,nullFormat:h.nullFormat,defaultFormat:h.defaultFormat,scalePercentBy100:h.scalePercentBy100};function m(r,s){this._input=r,this._value=s;}return t=function(r){var s,u,a,l;if(t.isNumeral(r))s=r.value();else if(r===0||typeof r>"u")s=0;else if(r===null||e.isNaN(r))s=null;else if(typeof r=="string")if(p.zeroFormat&&r===p.zeroFormat)s=0;else if(p.nullFormat&&r===p.nullFormat||!r.replace(/[^0-9]+/g,"").length)s=null;else {for(u in i)if(l=typeof i[u].regexps.unformat=="function"?i[u].regexps.unformat():i[u].regexps.unformat,l&&r.match(l)){a=i[u].unformat;break}a=a||t._.stringToNumber,s=a(r);}else s=Number(r)||null;return new m(r,s)},t.version=o,t.isNumeral=function(r){return r instanceof m},t._=e={numberToFormat:function(r,s,u){var a=n[t.options.currentLocale],l=!1,c=!1,d=0,f="",v=1e12,g=1e9,b=1e6,A=1e3,y="",E=!1,k,H,x,S,ce,He,M;if(r=r||0,H=Math.abs(r),t._.includes(s,"(")?(l=!0,s=s.replace(/[\(|\)]/g,"")):(t._.includes(s,"+")||t._.includes(s,"-"))&&(ce=t._.includes(s,"+")?s.indexOf("+"):r<0?s.indexOf("-"):-1,s=s.replace(/[\+|\-]/g,"")),t._.includes(s,"a")&&(k=s.match(/a(k|m|b|t)?/),k=k?k[1]:!1,t._.includes(s," a")&&(f=" "),s=s.replace(new RegExp(f+"a[kmbt]?"),""),H>=v&&!k||k==="t"?(f+=a.abbreviations.trillion,r=r/v):H<v&&H>=g&&!k||k==="b"?(f+=a.abbreviations.billion,r=r/g):H<g&&H>=b&&!k||k==="m"?(f+=a.abbreviations.million,r=r/b):(H<b&&H>=A&&!k||k==="k")&&(f+=a.abbreviations.thousand,r=r/A)),t._.includes(s,"[.]")&&(c=!0,s=s.replace("[.]",".")),x=r.toString().split(".")[0],S=s.split(".")[1],He=s.indexOf(","),d=(s.split(".")[0].split(",")[0].match(/0/g)||[]).length,S?(t._.includes(S,"[")?(S=S.replace("]",""),S=S.split("["),y=t._.toFixed(r,S[0].length+S[1].length,u,S[1].length)):y=t._.toFixed(r,S.length,u),x=y.split(".")[0],t._.includes(y,".")?y=a.delimiters.decimal+y.split(".")[1]:y="",c&&Number(y.slice(1))===0&&(y="")):x=t._.toFixed(r,0,u),f&&!k&&Number(x)>=1e3&&f!==a.abbreviations.trillion)switch(x=String(Number(x)/1e3),f){case a.abbreviations.thousand:f=a.abbreviations.million;break;case a.abbreviations.million:f=a.abbreviations.billion;break;case a.abbreviations.billion:f=a.abbreviations.trillion;break}if(t._.includes(x,"-")&&(x=x.slice(1),E=!0),x.length<d)for(var Le=d-x.length;Le>0;Le--)x="0"+x;return He>-1&&(x=x.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+a.delimiters.thousands)),s.indexOf(".")===0&&(x=""),M=x+y+(f||""),l?M=(l&&E?"(":"")+M+(l&&E?")":""):ce>=0?M=ce===0?(E?"-":"+")+M:M+(E?"-":"+"):E&&(M="-"+M),M},stringToNumber:function(r){var s=n[p.currentLocale],u=r,a={thousand:3,million:6,billion:9,trillion:12},l,c,f;if(p.zeroFormat&&r===p.zeroFormat)c=0;else if(p.nullFormat&&r===p.nullFormat||!r.replace(/[^0-9]+/g,"").length)c=null;else {c=1,s.delimiters.decimal!=="."&&(r=r.replace(/\./g,"").replace(s.delimiters.decimal,"."));for(l in a)if(f=new RegExp("[^a-zA-Z]"+s.abbreviations[l]+"(?:\\)|(\\"+s.currency.symbol+")?(?:\\))?)?$"),u.match(f)){c*=Math.pow(10,a[l]);break}c*=(r.split("-").length+Math.min(r.split("(").length-1,r.split(")").length-1))%2?1:-1,r=r.replace(/[^0-9\.]+/g,""),c*=Number(r);}return c},isNaN:function(r){return typeof r=="number"&&isNaN(r)},includes:function(r,s){return r.indexOf(s)!==-1},insert:function(r,s,u){return r.slice(0,u)+s+r.slice(u)},reduce:function(r,s){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof s!="function")throw new TypeError(s+" is not a function");var u=Object(r),a=u.length>>>0,l=0,c;if(arguments.length===3)c=arguments[2];else {for(;l<a&&!(l in u);)l++;if(l>=a)throw new TypeError("Reduce of empty array with no initial value");c=u[l++];}for(;l<a;l++)l in u&&(c=s(c,u[l],l,u));return c},multiplier:function(r){var s=r.toString().split(".");return s.length<2?1:Math.pow(10,s[1].length)},correctionFactor:function(){var r=Array.prototype.slice.call(arguments);return r.reduce(function(s,u){var a=e.multiplier(u);return s>a?s:a},1)},toFixed:function(r,s,u,a){var l=r.toString().split("."),c=s-(a||0),d,f,v,g;return l.length===2?d=Math.min(Math.max(l[1].length,c),s):d=c,v=Math.pow(10,d),g=(u(r+"e+"+d)/v).toFixed(d),a>s-d&&(f=new RegExp("\\.?0{1,"+(a-(s-d))+"}$"),g=g.replace(f,"")),g}},t.options=p,t.formats=i,t.locales=n,t.locale=function(r){return r&&(p.currentLocale=r.toLowerCase()),p.currentLocale},t.localeData=function(r){if(!r)return n[p.currentLocale];if(r=r.toLowerCase(),!n[r])throw new Error("Unknown locale : "+r);return n[r]},t.reset=function(){for(var r in h)p[r]=h[r];},t.zeroFormat=function(r){p.zeroFormat=typeof r=="string"?r:null;},t.nullFormat=function(r){p.nullFormat=typeof r=="string"?r:null;},t.defaultFormat=function(r){p.defaultFormat=typeof r=="string"?r:"0.0";},t.register=function(r,s,u){if(s=s.toLowerCase(),this[r+"s"][s])throw new TypeError(s+" "+r+" already registered.");return this[r+"s"][s]=u,u},t.validate=function(r,s){var u,a,l,c,d,f,v,g;if(typeof r!="string"&&(r+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",r)),r=r.trim(),r.match(/^\d+$/))return !0;if(r==="")return !1;try{v=t.localeData(s);}catch{v=t.localeData(t.locale());}return l=v.currency.symbol,d=v.abbreviations,u=v.delimiters.decimal,v.delimiters.thousands==="."?a="\\.":a=v.delimiters.thousands,g=r.match(/^[^\d]+/),g!==null&&(r=r.substr(1),g[0]!==l)||(g=r.match(/[^\d]+$/),g!==null&&(r=r.slice(0,-1),g[0]!==d.thousand&&g[0]!==d.million&&g[0]!==d.billion&&g[0]!==d.trillion))?!1:(f=new RegExp(a+"{2}"),r.match(/[^\d.,]/g)?!1:(c=r.split(u),c.length>2?!1:c.length<2?!!c[0].match(/^\d+.*\d$/)&&!c[0].match(f):c[0].length===1?!!c[0].match(/^\d+$/)&&!c[0].match(f)&&!!c[1].match(/^\d+$/):!!c[0].match(/^\d+.*\d$/)&&!c[0].match(f)&&!!c[1].match(/^\d+$/)))},t.fn=m.prototype={clone:function(){return t(this)},format:function(r,s){var u=this._value,a=r||p.defaultFormat,l,c,d;if(s=s||Math.round,u===0&&p.zeroFormat!==null)c=p.zeroFormat;else if(u===null&&p.nullFormat!==null)c=p.nullFormat;else {for(l in i)if(a.match(i[l].regexps.format)){d=i[l].format;break}d=d||t._.numberToFormat,c=d(u,a,s);}return c},value:function(){return this._value},input:function(){return this._input},set:function(r){return this._value=Number(r),this},add:function(r){var s=e.correctionFactor.call(null,this._value,r);function u(a,l,c,d){return a+Math.round(s*l)}return this._value=e.reduce([this._value,r],u,0)/s,this},subtract:function(r){var s=e.correctionFactor.call(null,this._value,r);function u(a,l,c,d){return a-Math.round(s*l)}return this._value=e.reduce([r],u,Math.round(this._value*s))/s,this},multiply:function(r){function s(u,a,l,c){var d=e.correctionFactor(u,a);return Math.round(u*d)*Math.round(a*d)/Math.round(d*d)}return this._value=e.reduce([this._value,r],s,1),this},divide:function(r){function s(u,a,l,c){var d=e.correctionFactor(u,a);return Math.round(u*d)/Math.round(a*d)}return this._value=e.reduce([this._value,r],s),this},difference:function(r){return Math.abs(t(this._value).subtract(r).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(r){var s=r%10;return ~~(r%100/10)===1?"th":s===1?"st":s===2?"nd":s===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(r,s,u){var a=t._.includes(s," BPS")?" ":"",l;return r=r*1e4,s=s.replace(/\s?BPS/,""),l=t._.numberToFormat(r,s,u),t._.includes(l,")")?(l=l.split(""),l.splice(-1,0,a+"BPS"),l=l.join("")):l=l+a+"BPS",l},unformat:function(r){return +(t._.stringToNumber(r)*1e-4).toFixed(15)}});}(),function(){var r={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},s={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},u=r.suffixes.concat(s.suffixes.filter(function(l){return r.suffixes.indexOf(l)<0})),a=u.join("|");a="("+a.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(a)},format:function(l,c,d){var f,v=t._.includes(c,"ib")?s:r,g=t._.includes(c," b")||t._.includes(c," ib")?" ":"",b,A,y;for(c=c.replace(/\s?i?b/,""),b=0;b<=v.suffixes.length;b++)if(A=Math.pow(v.base,b),y=Math.pow(v.base,b+1),l===null||l===0||l>=A&&l<y){g+=v.suffixes[b],A>0&&(l=l/A);break}return f=t._.numberToFormat(l,c,d),f+g},unformat:function(l){var c=t._.stringToNumber(l),d,f;if(c){for(d=r.suffixes.length-1;d>=0;d--){if(t._.includes(l,r.suffixes[d])){f=Math.pow(r.base,d);break}if(t._.includes(l,s.suffixes[d])){f=Math.pow(s.base,d);break}}c*=f||1;}return c}});}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(r,s,u){var a=t.locales[t.options.currentLocale],l={before:s.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:s.match(/([\+|\-|\)|\s|\$]*)$/)[0]},c,d,f;for(s=s.replace(/\s?\$\s?/,""),c=t._.numberToFormat(r,s,u),r>=0?(l.before=l.before.replace(/[\-\(]/,""),l.after=l.after.replace(/[\-\)]/,"")):r<0&&!t._.includes(l.before,"-")&&!t._.includes(l.before,"(")&&(l.before="-"+l.before),f=0;f<l.before.length;f++)switch(d=l.before[f],d){case"$":c=t._.insert(c,a.currency.symbol,f);break;case" ":c=t._.insert(c," ",f+a.currency.symbol.length-1);break}for(f=l.after.length-1;f>=0;f--)switch(d=l.after[f],d){case"$":c=f===l.after.length-1?c+a.currency.symbol:t._.insert(c,a.currency.symbol,-(l.after.length-(1+f)));break;case" ":c=f===l.after.length-1?c+" ":t._.insert(c," ",-(l.after.length-(1+f)+a.currency.symbol.length-1));break}return c}});}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(r,s,u){var a,l=typeof r=="number"&&!t._.isNaN(r)?r.toExponential():"0e+0",c=l.split("e");return s=s.replace(/e[\+|\-]{1}0/,""),a=t._.numberToFormat(Number(c[0]),s,u),a+"e"+c[1]},unformat:function(r){var s=t._.includes(r,"e+")?r.split("e+"):r.split("e-"),u=Number(s[0]),a=Number(s[1]);a=t._.includes(r,"e-")?a*=-1:a;function l(c,d,f,v){var g=t._.correctionFactor(c,d),b=c*g*(d*g)/(g*g);return b}return t._.reduce([u,Math.pow(10,a)],l,1)}});}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(r,s,u){var a=t.locales[t.options.currentLocale],l,c=t._.includes(s," o")?" ":"";return s=s.replace(/\s?o/,""),c+=a.ordinal(r),l=t._.numberToFormat(r,s,u),l+c}});}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(r,s,u){var a=t._.includes(s," %")?" ":"",l;return t.options.scalePercentBy100&&(r=r*100),s=s.replace(/\s?\%/,""),l=t._.numberToFormat(r,s,u),t._.includes(l,")")?(l=l.split(""),l.splice(-1,0,a+"%"),l=l.join("")):l=l+a+"%",l},unformat:function(r){var s=t._.stringToNumber(r);return t.options.scalePercentBy100?s*.01:s}});}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(r,s,u){var a=Math.floor(r/60/60),l=Math.floor((r-a*60*60)/60),c=Math.round(r-a*60*60-l*60);return a+":"+(l<10?"0"+l:l)+":"+(c<10?"0"+c:c)},unformat:function(r){var s=r.split(":"),u=0;return s.length===3?(u=u+Number(s[0])*60*60,u=u+Number(s[1])*60,u=u+Number(s[2])):s.length===2&&(u=u+Number(s[0])*60,u=u+Number(s[1])),Number(u)}});}(),t});});var te=globalThis,re=te.ShadowRoot&&(te.ShadyCSS===void 0||te.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,he=Symbol(),je=new WeakMap,q=class{constructor(e,o,i){if(this._$cssResult$=!0,i!==he)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=o;}get styleSheet(){let e=this.o,o=this.t;if(re&&e===void 0){let i=o!==void 0&&o.length===1;i&&(e=je.get(o)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&je.set(o,e));}return e}toString(){return this.cssText}},Ie=t=>new q(typeof t=="string"?t:t+"",void 0,he),pe=(t,...e)=>{let o=t.length===1?t[0]:e.reduce((i,n,h)=>i+(p=>{if(p._$cssResult$===!0)return p.cssText;if(typeof p=="number")return p;throw Error("Value passed to 'css' function must be a 'css' function result: "+p+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[h+1],t[0]);return new q(o,t,he)},de=(t,e)=>{if(re)t.adoptedStyleSheets=e.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of e){let i=document.createElement("style"),n=te.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=o.cssText,t.appendChild(i);}},oe=re?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let o="";for(let i of e.cssRules)o+=i.cssText;return Ie(o)})(t):t;var{is:Pt,defineProperty:Nt,getOwnPropertyDescriptor:Ht,getOwnPropertyNames:Lt,getOwnPropertySymbols:Ot,getPrototypeOf:Tt}=Object,ie=globalThis,Ze=ie.trustedTypes,Vt=Ze?Ze.emptyScript:"",Ft=ie.reactiveElementPolyfillSupport,J=(t,e)=>t,W={toAttribute(t,e){switch(e){case Boolean:t=t?Vt:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t);}return t},fromAttribute(t,e){let o=t;switch(e){case Boolean:o=t!==null;break;case Number:o=t===null?null:Number(t);break;case Object:case Array:try{o=JSON.parse(t);}catch{o=null;}}return o}},se=(t,e)=>!Pt(t,e),De={attribute:!0,type:String,converter:W,reflect:!1,hasChanged:se};Symbol.metadata??=Symbol("metadata"),ie.litPropertyMetadata??=new WeakMap;var N=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,o=De){if(o.state&&(o.attribute=!1),this._$Ei(),this.elementProperties.set(e,o),!o.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(e,i,o);n!==void 0&&Nt(this.prototype,e,n);}}static getPropertyDescriptor(e,o,i){let{get:n,set:h}=Ht(this.prototype,e)??{get(){return this[o]},set(p){this[o]=p;}};return {get(){return n?.call(this)},set(p){let m=n?.call(this);h.call(this,p),this.requestUpdate(e,m,i);},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??De}static _$Ei(){if(this.hasOwnProperty(J("elementProperties")))return;let e=Tt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties);}static finalize(){if(this.hasOwnProperty(J("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(J("properties"))){let o=this.properties,i=[...Lt(o),...Ot(o)];for(let n of i)this.createProperty(n,o[n]);}let e=this[Symbol.metadata];if(e!==null){let o=litPropertyMetadata.get(e);if(o!==void 0)for(let[i,n]of o)this.elementProperties.set(i,n);}this._$Eh=new Map;for(let[o,i]of this.elementProperties){let n=this._$Eu(o,i);n!==void 0&&this._$Eh.set(n,o);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(e){let o=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)o.unshift(oe(n));}else e!==void 0&&o.push(oe(e));return o}static _$Eu(e,o){let i=o.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this));}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.();}removeController(e){this._$EO?.delete(e);}_$E_(){let e=new Map,o=this.constructor.elementProperties;for(let i of o.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e);}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return de(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.());}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.());}attributeChangedCallback(e,o,i){this._$AK(e,i);}_$EC(e,o){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){let h=(i.converter?.toAttribute!==void 0?i.converter:W).toAttribute(o,i.type);this._$Em=e,h==null?this.removeAttribute(n):this.setAttribute(n,h),this._$Em=null;}}_$AK(e,o){let i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let h=i.getPropertyOptions(n),p=typeof h.converter=="function"?{fromAttribute:h.converter}:h.converter?.fromAttribute!==void 0?h.converter:W;this._$Em=n,this[n]=p.fromAttribute(o,h.type),this._$Em=null;}}requestUpdate(e,o,i){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??se)(this[e],o))return;this.P(e,o,i);}this.isUpdatePending===!1&&(this._$ES=this._$ET());}P(e,o,i){this._$AL.has(e)||this._$AL.set(e,o),i.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e);}async _$ET(){this.isUpdatePending=!0;try{await this._$ES;}catch(o){Promise.reject(o);}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,h]of this._$Ep)this[n]=h;this._$Ep=void 0;}let i=this.constructor.elementProperties;if(i.size>0)for(let[n,h]of i)h.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],h);}let e=!1,o=this._$AL;try{e=this.shouldUpdate(o),e?(this.willUpdate(o),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(o)):this._$EU();}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(o);}willUpdate(e){}_$AE(e){this._$EO?.forEach(o=>o.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e);}_$EU(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return !0}update(e){this._$Ej&&=this._$Ej.forEach(o=>this._$EC(o,this[o])),this._$EU();}updated(e){}firstUpdated(e){}};N.elementStyles=[],N.shadowRootOptions={mode:"open"},N[J("elementProperties")]=new Map,N[J("finalized")]=new Map,Ft?.({ReactiveElement:N}),(ie.reactiveElementVersions??=[]).push("2.0.4");var ve=globalThis,ne=ve.trustedTypes,qe=ne?ne.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ye="$lit$",O=`lit$${Math.random().toFixed(9).slice(2)}$`,Qe="?"+O,Rt=`<${Qe}>`,R=document,G=()=>R.createComment(""),X=t=>t===null||typeof t!="object"&&typeof t!="function",et=Array.isArray,zt=t=>et(t)||typeof t?.[Symbol.iterator]=="function",fe=`[ | ||
\f\r]`,K=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Je=/-->/g,We=/>/g,V=RegExp(`>|${fe}(?:([^\\s"'>=/]+)(${fe}*=${fe}*(?:[^ | ||
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ke=/'/g,Ge=/"/g,tt=/^(?:script|style|textarea|title)$/i,rt=t=>(e,...o)=>({_$litType$:t,strings:e,values:o}),$e=rt(1),z=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),Xe=new WeakMap,F=R.createTreeWalker(R,129);function ot(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return qe!==void 0?qe.createHTML(e):e}var Ut=(t,e)=>{let o=t.length-1,i=[],n,h=e===2?"<svg>":"",p=K;for(let m=0;m<o;m++){let r=t[m],s,u,a=-1,l=0;for(;l<r.length&&(p.lastIndex=l,u=p.exec(r),u!==null);)l=p.lastIndex,p===K?u[1]==="!--"?p=Je:u[1]!==void 0?p=We:u[2]!==void 0?(tt.test(u[2])&&(n=RegExp("</"+u[2],"g")),p=V):u[3]!==void 0&&(p=V):p===V?u[0]===">"?(p=n??K,a=-1):u[1]===void 0?a=-2:(a=p.lastIndex-u[2].length,s=u[1],p=u[3]===void 0?V:u[3]==='"'?Ge:Ke):p===Ge||p===Ke?p=V:p===Je||p===We?p=K:(p=V,n=void 0);let c=p===V&&t[m+1].startsWith("/>")?" ":"";h+=p===K?r+Rt:a>=0?(i.push(s),r.slice(0,a)+Ye+r.slice(a)+O+c):r+O+(a===-2?m:c);}return [ot(t,h+(t[o]||"<?>")+(e===2?"</svg>":"")),i]},Y=class t{constructor({strings:e,_$litType$:o},i){let n;this.parts=[];let h=0,p=0,m=e.length-1,r=this.parts,[s,u]=Ut(e,o);if(this.el=t.createElement(s,i),F.currentNode=this.el.content,o===2){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes);}for(;(n=F.nextNode())!==null&&r.length<m;){if(n.nodeType===1){if(n.hasAttributes())for(let a of n.getAttributeNames())if(a.endsWith(Ye)){let l=u[p++],c=n.getAttribute(a).split(O),d=/([.?@])?(.*)/.exec(l);r.push({type:1,index:h,name:d[2],strings:c,ctor:d[1]==="."?ge:d[1]==="?"?ye:d[1]==="@"?be:j}),n.removeAttribute(a);}else a.startsWith(O)&&(r.push({type:6,index:h}),n.removeAttribute(a));if(tt.test(n.tagName)){let a=n.textContent.split(O),l=a.length-1;if(l>0){n.textContent=ne?ne.emptyScript:"";for(let c=0;c<l;c++)n.append(a[c],G()),F.nextNode(),r.push({type:2,index:++h});n.append(a[l],G());}}}else if(n.nodeType===8)if(n.data===Qe)r.push({type:2,index:h});else {let a=-1;for(;(a=n.data.indexOf(O,a+1))!==-1;)r.push({type:7,index:h}),a+=O.length-1;}h++;}}static createElement(e,o){let i=R.createElement("template");return i.innerHTML=e,i}};function B(t,e,o=t,i){if(e===z)return e;let n=i!==void 0?o._$Co?.[i]:o._$Cl,h=X(e)?void 0:e._$litDirective$;return n?.constructor!==h&&(n?._$AO?.(!1),h===void 0?n=void 0:(n=new h(t),n._$AT(t,o,i)),i!==void 0?(o._$Co??=[])[i]=n:o._$Cl=n),n!==void 0&&(e=B(t,n._$AS(t,e.values),n,i)),e}var me=class{constructor(e,o){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=o;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:o},parts:i}=this._$AD,n=(e?.creationScope??R).importNode(o,!0);F.currentNode=n;let h=F.nextNode(),p=0,m=0,r=i[0];for(;r!==void 0;){if(p===r.index){let s;r.type===2?s=new Q(h,h.nextSibling,this,e):r.type===1?s=new r.ctor(h,r.name,r.strings,this,e):r.type===6&&(s=new _e(h,this,e)),this._$AV.push(s),r=i[++m];}p!==r?.index&&(h=F.nextNode(),p++);}return F.currentNode=R,n}p(e){let o=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,o),o+=i.strings.length-2):i._$AI(e[o])),o++;}},Q=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,o,i,n){this.type=2,this._$AH=$,this._$AN=void 0,this._$AA=e,this._$AB=o,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0;}get parentNode(){let e=this._$AA.parentNode,o=this._$AM;return o!==void 0&&e?.nodeType===11&&(e=o.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,o=this){e=B(this,e,o),X(e)?e===$||e==null||e===""?(this._$AH!==$&&this._$AR(),this._$AH=$):e!==this._$AH&&e!==z&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):zt(e)?this.k(e):this._(e);}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e));}_(e){this._$AH!==$&&X(this._$AH)?this._$AA.nextSibling.data=e:this.T(R.createTextNode(e)),this._$AH=e;}$(e){let{values:o,_$litType$:i}=e,n=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Y.createElement(ot(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(o);else {let h=new me(n,this),p=h.u(this.options);h.p(o),this.T(p),this._$AH=h;}}_$AC(e){let o=Xe.get(e.strings);return o===void 0&&Xe.set(e.strings,o=new Y(e)),o}k(e){et(this._$AH)||(this._$AH=[],this._$AR());let o=this._$AH,i,n=0;for(let h of e)n===o.length?o.push(i=new t(this.S(G()),this.S(G()),this,this.options)):i=o[n],i._$AI(h),n++;n<o.length&&(this._$AR(i&&i._$AB.nextSibling,n),o.length=n);}_$AR(e=this._$AA.nextSibling,o){for(this._$AP?.(!1,!0,o);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i;}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e));}},j=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,o,i,n,h){this.type=1,this._$AH=$,this._$AN=void 0,this.element=e,this.name=o,this._$AM=n,this.options=h,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=$;}_$AI(e,o=this,i,n){let h=this.strings,p=!1;if(h===void 0)e=B(this,e,o,0),p=!X(e)||e!==this._$AH&&e!==z,p&&(this._$AH=e);else {let m=e,r,s;for(e=h[0],r=0;r<h.length-1;r++)s=B(this,m[i+r],o,r),s===z&&(s=this._$AH[r]),p||=!X(s)||s!==this._$AH[r],s===$?e=$:e!==$&&(e+=(s??"")+h[r+1]),this._$AH[r]=s;}p&&!n&&this.j(e);}j(e){e===$?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"");}},ge=class extends j{constructor(){super(...arguments),this.type=3;}j(e){this.element[this.name]=e===$?void 0:e;}},ye=class extends j{constructor(){super(...arguments),this.type=4;}j(e){this.element.toggleAttribute(this.name,!!e&&e!==$);}},be=class extends j{constructor(e,o,i,n,h){super(e,o,i,n,h),this.type=5;}_$AI(e,o=this){if((e=B(this,e,o,0)??$)===z)return;let i=this._$AH,n=e===$&&i!==$||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,h=e!==$&&(i===$||n);n&&this.element.removeEventListener(this.name,this,i),h&&this.element.addEventListener(this.name,this,e),this._$AH=e;}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e);}},_e=class{constructor(e,o,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=o,this.options=i;}get _$AU(){return this._$AM._$AU}_$AI(e){B(this,e);}};var Bt=ve.litHtmlPolyfillSupport;Bt?.(Y,Q),(ve.litHtmlVersions??=[]).push("3.1.4");var it=(t,e,o)=>{let i=o?.renderBefore??e,n=i._$litPart$;if(n===void 0){let h=o?.renderBefore??null;i._$litPart$=n=new Q(e.insertBefore(G(),h),h,void 0,o??{});}return n._$AI(t),n};var T=class extends N{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let o=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=it(o,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1);}render(){return z}};T._$litElement$=!0,T.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:T});var jt=globalThis.litElementPolyfillSupport;jt?.({LitElement:T});(globalThis.litElementVersions??=[]).push("4.0.6");var st=t=>(e,o)=>{o!==void 0?o.addInitializer(()=>{customElements.define(t,e);}):customElements.define(t,e);};var It={attribute:!0,type:String,converter:W,reflect:!1,hasChanged:se},Zt=(t=It,e,o)=>{let{kind:i,metadata:n}=o,h=globalThis.litPropertyMetadata.get(n);if(h===void 0&&globalThis.litPropertyMetadata.set(n,h=new Map),h.set(o.name,t),i==="accessor"){let{name:p}=o;return {set(m){let r=e.get.call(this);e.set.call(this,m),this.requestUpdate(p,r,t);},init(m){return m!==void 0&&this.P(p,void 0,t),m}}}if(i==="setter"){let{name:p}=o;return function(m){let r=this[p];e.call(this,m),this.requestUpdate(p,r,t);}}throw Error("Unsupported decorator location: "+i)};function I(t){return (e,o)=>typeof o=="object"?Zt(t,e,o):((i,n,h)=>{let p=n.hasOwnProperty(h);return n.constructor.createProperty(h,p?{...i,wrapped:!0}:i),p?Object.getOwnPropertyDescriptor(n,h):void 0})(t,e,o)}function ee(t){return I({...t,state:!0,attribute:!1})}var nt="https://gamma-api.polymarket.com";var xe=async t=>{let e=t.slug?`markets/slug/${t.slug}`:`markets/${t.id}`,i=await(await fetch(`${nt}/${e}`)).json();return {...i,outcomes:JSON.parse(i.outcomes),outcomePrices:JSON.parse(i.outcomePrices),clobTokenIds:i.clobTokenIds?JSON.parse(i.clobTokenIds):null}};var Pe=kt(lt());var Dt={0:"M5,55 A50,50 0 0 1 5,55",10:"M5,55 A50,50 0 0 1 6,45",20:"M5,55 A50,50 0 0 1 10,33.4",30:"M5,55 A50,50 0 0 1 24,16",40:"M5,55 A50,50 0 0 1 34,9.8",50:"M5,55 A50,50 0 0 1 55,5",60:"M5,55 A50,50 0 0 1 76,9.8",70:"M5,55 A50,50 0 0 1 86,16",80:"M5,55 A50,50 0 0 1 100,33.4",90:"M5,55 A50,50 0 0 1 104,45",100:"M5,55 A50,50 0 0 1 105,55"},ct=!1,Ne=()=>{if(ct)return;ct=!0;let t=new CSSStyleSheet;t.replaceSync(` | ||
@font-face { | ||
font-family: "Open Sauce Sans"; | ||
src: url("./fonts/OpenSauceSans-Regular.ttf") format("truetype"); | ||
font-weight: 400; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "Open Sauce Sans"; | ||
src: url("./fonts/OpenSauceSans-Medium.ttf") format("truetype"); | ||
font-weight: 500; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "Open Sauce Sans"; | ||
src: url("./fonts/OpenSauceSans-SemiBold.ttf") | ||
format("truetype"); | ||
font-weight: 600; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "Open Sauce Sans"; | ||
src: url("./fonts/OpenSauceSans-Bold.ttf") format("truetype"); | ||
font-weight: 700; | ||
font-style: normal; | ||
}`),document.adoptedStyleSheets.push(t);};Ne();var ut,ht,pt,dt,ft,mt,gt,yt,bt,_,we,Ce,ke,Ae,Se,Ee,Me;bt=[st("polymarket-market-embed")];var C=class extends(yt=T,gt=[I({type:String,attribute:"market"})],mt=[I({type:Boolean,attribute:"volume",converter:(o,i)=>i===String?o==="true":i===Boolean?o:!1})],ft=[I({type:Boolean,attribute:"chart",converter:(o,i)=>i===String?o==="true":i===Boolean?o:!1})],dt=[ee()],pt=[ee()],ht=[ee()],ut=[ee()],yt){constructor(){super();L(this,we,w(_,8,this)),w(_,11,this);L(this,Ce,w(_,12,this,!1)),w(_,15,this);L(this,ke,w(_,16,this,!1)),w(_,19,this);L(this,Ae,w(_,20,this)),w(_,23,this);L(this,Se,w(_,24,this)),w(_,27,this);L(this,Ee,w(_,28,this)),w(_,31,this);L(this,Me,w(_,32,this)),w(_,35,this);Ne();}static get styles(){return pe` | ||
:host { | ||
@@ -53,11 +49,11 @@ --polymarket-color-neutral-white: #ffffff; | ||
--polymarket-font-size-sm: 12px; | ||
--polymarket-font-size-md: 14px; | ||
--polymarket-font-size-lg: 16px; | ||
--polymarket-font-size-xl: 20px; | ||
--polymarket-font-size-sm: 11px; | ||
--polymarket-font-size-md: 13px; | ||
--polymarket-font-size-lg: 15px; | ||
--polymarket-font-size-xl: 18px; | ||
--polymarket-line-height-sm: 18px; | ||
--polymarket-line-height-md: 21px; | ||
--polymarket-line-height-lg: 24px; | ||
--polymarket-line-height-xl: 24px; | ||
--polymarket-line-height-sm: 13px; | ||
--polymarket-line-height-md: 17px; | ||
--polymarket-line-height-lg: 19px; | ||
--polymarket-line-height-xl: 21px; | ||
@@ -73,3 +69,3 @@ --polymarket-font-weight-normal: 400; | ||
font-family: "OpenSans", sans-serif; | ||
font-family: "Open Sauce Sans", sans-serif; | ||
font-style: normal; | ||
@@ -88,2 +84,3 @@ -webkit-font-smoothing: antialiased; | ||
width: 100%; | ||
max-width: calc(100vw - 4px); | ||
height: fit-content; | ||
@@ -99,2 +96,3 @@ justify-content: center; | ||
width: 400px; | ||
max-width: calc(100vw - 8px); | ||
height: fit-content; | ||
@@ -113,2 +111,3 @@ padding: 20px; | ||
align-items: center; | ||
height: 60px; | ||
width: 100%; | ||
@@ -144,2 +143,3 @@ gap: var(--polymarket-space-3); | ||
a { | ||
flex: 1; | ||
text-decoration: none; | ||
@@ -150,3 +150,15 @@ color: var(--polymarket-color-neutral-black); | ||
font-weight: var(--polymarket-font-weight-semi); | ||
flex: 1; | ||
text-decoration: underline; | ||
text-decoration-color: transparent; | ||
text-decoration-thickness: 2px; | ||
transition: text-decoration-color 100ms ease; | ||
display: -webkit-box; | ||
-webkit-line-clamp: 2; | ||
-webkit-box-orient: vertical; | ||
overflow: hidden; | ||
&:hover { | ||
text-decoration-color: var( | ||
--polymarket-color-neutral-black | ||
); | ||
} | ||
} | ||
@@ -156,5 +168,7 @@ } | ||
.top-row-right-container { | ||
position: relative; | ||
align-items: center; | ||
width: 60px; | ||
width: 75px; | ||
height: 60px; | ||
overflow: visible; | ||
} | ||
@@ -198,3 +212,3 @@ | ||
align-items: center; | ||
padding: 0px 10px; | ||
padding: 0px var(--polymarket-space-3); | ||
height: 32px; | ||
@@ -210,3 +224,2 @@ background-color: var(--polymarket-color-gray-6); | ||
transition: background-color 100ms ease-in-out; | ||
font-family: "OpenSans", sans-serif; | ||
gap: var(--polymarket-space-1); | ||
@@ -218,3 +231,81 @@ text-decoration: none; | ||
} | ||
`}connectedCallback(){super.connectedCallback(),this.fetchMarketData();}async fetchMarketData(){if(this.marketSlug){let o=await Ce({slug:this.marketSlug});this.market=o,this.href=o.events?.length&&o.events[0]?.slug?`https://polymarket.com/event/${o.events[0].slug}/${o.slug}`:`https://polymarket.com/market/${o.slug}`;}}render(){return this.market?$e` <div class="container"> | ||
.gauge-text-container { | ||
position: absolute; | ||
background-color: transparent; | ||
border-radius: 100% / 100% 100% 0 0; | ||
left: 50%; | ||
top: calc(50% + 2px); | ||
transform: translate(-50%, -50%); | ||
width: calc(120px * 0.85); | ||
height: calc(60px * 0.85); | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-end; | ||
z-index: 3; | ||
} | ||
.gauge-subtext-container { | ||
position: absolute; | ||
left: 0; | ||
bottom: 0; | ||
width: 120px; | ||
height: 60px; | ||
transform: scale(1.1); | ||
background-color: transparent; | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-start; | ||
padding-top: 6px; | ||
z-index: 4; | ||
} | ||
.gauge-text { | ||
position: absolute; | ||
background-color: transparent; | ||
border-radius: 100% / 100% 100% 0 0; | ||
left: 50%; | ||
top: calc(50% + 2px); | ||
transform: translate(-50%, -50%); | ||
z-index: 3; | ||
margin: 0; | ||
color: var(--polymarket-color-neutral-black); | ||
font-size: var(--polymarket-font-size-lg); | ||
line-height: var(--polymarket-line-height-lg); | ||
font-weight: var(--polymarket-font-weight-bold); | ||
} | ||
.gauge-subtext { | ||
position: absolute; | ||
left: 50%; | ||
top: calc(50% + 18px); | ||
transform: translate(-50%, -50%); | ||
background-color: transparent; | ||
z-index: 4; | ||
margin: 0; | ||
color: var(--polymarket-color-gray-3); | ||
font-size: var(--polymarket-font-size-sm); | ||
line-height: var(--polymarket-line-height-sm); | ||
font-weight: var(--polymarket-font-weight-medium); | ||
} | ||
.gauge { | ||
position: absolute; | ||
left: 50%; | ||
top: 50%; | ||
transform: translate(-50%, calc(-50% - 10px)) scaleX(1.1); | ||
} | ||
.gauge-track { | ||
position: absolute; | ||
top: 0; | ||
z-index: 1; | ||
} | ||
.gauge-fill { | ||
position: absolute; | ||
top: 0; | ||
z-index: 1; | ||
} | ||
`}connectedCallback(){super.connectedCallback(),Ne(),this.fetchMarketData();}async fetchMarketData(){if(this.marketSlug){let o=await xe({slug:this.marketSlug});this._market=o,this._href=o.events?.length&&o.events[0]?.slug?`https://polymarket.com/event/${o.events[0].slug}/${o.slug}`:`https://polymarket.com/market/${o.slug}`;let i=o.outcomePrices[0]?parseFloat(o.outcomePrices[0]):0,n=Math.min(Math.max(i*100,0),100),p=[0,10,20,30,40,50,60,70,80,90,100].sort((m,r)=>Math.abs(m-n)-Math.abs(r-n))[0];this._probability=n,this._fillPathD=Dt[p.toFixed(0)];}}render(){return this._market?$e` <div class="container"> | ||
<div class="card-container"> | ||
@@ -224,10 +315,38 @@ <div class="top-row-container"> | ||
<img | ||
src="${this.market.imageOptimized?.imageUrlSource??this.market.image}" | ||
src="${this._market.imageOptimized?.imageUrlSource??this._market.image}" | ||
alt="icon" | ||
/> | ||
<a href="${this.href}">${this.market.question}</a> | ||
<a href="${this._href}">${this._market.question}</a> | ||
</div> | ||
<div class="top-row-right-container"> | ||
<p>gauge</p> | ||
<svg | ||
width="75px" | ||
height="35px" | ||
viewBox="0 0 110 60" | ||
class="gauge" | ||
> | ||
<path | ||
id="gauge-track" | ||
d="M5,55 A50,50 0 0 1 105,55" | ||
class="gauge-track" | ||
fill="none" | ||
stroke="var(--polymarket-color-gray-5)" | ||
stroke-width="8" | ||
/> | ||
<path | ||
id="gauge-fill" | ||
d=${this._fillPathD} | ||
class="gauge-fill" | ||
fill="none" | ||
stroke="${(this._probability??0)<50?"#E64800":"#00B955"}" | ||
stroke-width="8.5" | ||
/> | ||
</svg> | ||
<p class="gauge-text"> | ||
${(0, Pe.default)(this._probability).format("0")}% | ||
</p> | ||
<p class="gauge-subtext">chance</p> | ||
</div> | ||
@@ -262,5 +381,8 @@ </div> | ||
<p class="typography-secondary typography-number"> | ||
${this.hideBetAmount?"":(0, ut.default)(this.market.volumeNum).format("0.[0]a")} | ||
${this.showVolume?`${(0, Pe.default)(this._market.volumeNum).format("0.[0]a")}`:""} | ||
<span style="text-transform: capitalize;" | ||
>${this.showVolume?"Bet":""}</span | ||
> | ||
</p> | ||
<a class="button-primary" href="${this.href}"> | ||
<a class="button-primary" href="${this._href}"> | ||
More details | ||
@@ -284,3 +406,3 @@ <svg | ||
</div> | ||
</div>`:$e` <span>${" "}</span> `}};C=Re(ct),xe=new WeakMap,we=new WeakMap,Ae=new WeakMap,Se=new WeakMap,U(C,4,"marketSlug",lt,S,xe),U(C,4,"hideBetAmount",at,S,we),U(C,4,"market",nt,S,Ae),U(C,4,"href",st,S,Se),S=U(C,0,"MarketEmbed",ht,S),E(C,1,S);customElements.get(ke)||customElements.define(ke,S);/*! Bundled license information: | ||
</div>`:$e` <span>${" "}</span> `}};_=Ue(yt),we=new WeakMap,Ce=new WeakMap,ke=new WeakMap,Ae=new WeakMap,Se=new WeakMap,Ee=new WeakMap,Me=new WeakMap,P(_,4,"marketSlug",gt,C,we),P(_,4,"showVolume",mt,C,Ce),P(_,4,"showChart",ft,C,ke),P(_,4,"_market",dt,C,Ae),P(_,4,"_href",pt,C,Se),P(_,4,"_probability",ht,C,Ee),P(_,4,"_fillPathD",ut,C,Me),C=P(_,0,"MarketEmbed",bt,C),w(_,1,C);customElements.get("polymarket-market-embed")||customElements.define("polymarket-market-embed",C);/*! Bundled license information: | ||
@@ -402,4 +524,4 @@ numeral/numeral.js: | ||
export { S as MarketEmbed }; | ||
export { C as MarketEmbed }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@polymarket/embeds", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "Web Components for Polymarket", | ||
@@ -30,5 +30,9 @@ "type": "module", | ||
"dev": "tsup --watch", | ||
"clean": "rm -rf dist && rm -rf node_modules", | ||
"prebuild": "rm custom-elements.json && yarn clean", | ||
"postbuild": "custom-elements-manifest analyze && cp ./src/html/pm-market-wc.html ./dist", | ||
"build:watch": "tsc --watch" | ||
}, | ||
"devDependencies": { | ||
"@custom-elements-manifest/analyzer": "^0.10.3", | ||
"@polymarket/eslint-config": "*", | ||
@@ -35,0 +39,0 @@ "@polymarket/typescript-config": "*", |
@@ -7,37 +7,62 @@ import { css, LitElement, html, CSSResult } from "lit"; | ||
const ELEMENT_NAME = "polymarket-embed"; | ||
const VALUE_TO_PATH_MAP = { | ||
"0": "M5,55 A50,50 0 0 1 5,55", | ||
"10": "M5,55 A50,50 0 0 1 6,45", | ||
"20": "M5,55 A50,50 0 0 1 10,33.4", | ||
"30": "M5,55 A50,50 0 0 1 24,16", | ||
"40": "M5,55 A50,50 0 0 1 34,9.8", | ||
"50": "M5,55 A50,50 0 0 1 55,5", | ||
"60": "M5,55 A50,50 0 0 1 76,9.8", | ||
"70": "M5,55 A50,50 0 0 1 86,16", | ||
"80": "M5,55 A50,50 0 0 1 100,33.4", | ||
"90": "M5,55 A50,50 0 0 1 104,45", | ||
"100": "M5,55 A50,50 0 0 1 105,55", | ||
}; | ||
@customElement(ELEMENT_NAME) | ||
let hasLoadedMaterialSymbolsFont = false; | ||
/** | ||
* Loads local fonts. | ||
*/ | ||
const loadFonts = () => { | ||
if (hasLoadedMaterialSymbolsFont) { | ||
return; | ||
} | ||
hasLoadedMaterialSymbolsFont = true; | ||
const fontSheet = new CSSStyleSheet(); | ||
fontSheet.replaceSync(` | ||
@font-face { | ||
font-family: "Open Sauce Sans"; | ||
src: url("./fonts/OpenSauceSans-Regular.ttf") format("truetype"); | ||
font-weight: 400; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "Open Sauce Sans"; | ||
src: url("./fonts/OpenSauceSans-Medium.ttf") format("truetype"); | ||
font-weight: 500; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "Open Sauce Sans"; | ||
src: url("./fonts/OpenSauceSans-SemiBold.ttf") | ||
format("truetype"); | ||
font-weight: 600; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "Open Sauce Sans"; | ||
src: url("./fonts/OpenSauceSans-Bold.ttf") format("truetype"); | ||
font-weight: 700; | ||
font-style: normal; | ||
}`); | ||
document.adoptedStyleSheets.push(fontSheet); | ||
}; | ||
loadFonts(); /* eagerly load fonts */ | ||
@customElement("polymarket-market-embed") | ||
export class MarketEmbed extends LitElement { | ||
static override get styles(): CSSResult { | ||
return css` | ||
@font-face { | ||
font-family: "OpenSans"; | ||
src: url("../assets/fonts/OpenSauceOne-Regular.ttf") | ||
format("truetype"); | ||
font-weight: regular; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "OpenSans"; | ||
src: url("../assets/fonts/OpenSauceOne-Medium.ttf") | ||
format("truetype"); | ||
font-weight: medium; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "OpenSans"; | ||
src: url("../assets/fonts/OpenSauceOne-SemiBold.ttf") | ||
format("truetype"); | ||
font-weight: semi-bold; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "OpenSans"; | ||
src: url("../assets/fonts/OpenSauceOne-Bold.ttf") | ||
format("truetype"); | ||
font-weight: bold; | ||
font-style: normal; | ||
} | ||
:host { | ||
@@ -63,11 +88,11 @@ --polymarket-color-neutral-white: #ffffff; | ||
--polymarket-font-size-sm: 12px; | ||
--polymarket-font-size-md: 14px; | ||
--polymarket-font-size-lg: 16px; | ||
--polymarket-font-size-xl: 20px; | ||
--polymarket-font-size-sm: 11px; | ||
--polymarket-font-size-md: 13px; | ||
--polymarket-font-size-lg: 15px; | ||
--polymarket-font-size-xl: 18px; | ||
--polymarket-line-height-sm: 18px; | ||
--polymarket-line-height-md: 21px; | ||
--polymarket-line-height-lg: 24px; | ||
--polymarket-line-height-xl: 24px; | ||
--polymarket-line-height-sm: 13px; | ||
--polymarket-line-height-md: 17px; | ||
--polymarket-line-height-lg: 19px; | ||
--polymarket-line-height-xl: 21px; | ||
@@ -83,3 +108,3 @@ --polymarket-font-weight-normal: 400; | ||
font-family: "OpenSans", sans-serif; | ||
font-family: "Open Sauce Sans", sans-serif; | ||
font-style: normal; | ||
@@ -98,2 +123,3 @@ -webkit-font-smoothing: antialiased; | ||
width: 100%; | ||
max-width: calc(100vw - 4px); | ||
height: fit-content; | ||
@@ -109,2 +135,3 @@ justify-content: center; | ||
width: 400px; | ||
max-width: calc(100vw - 8px); | ||
height: fit-content; | ||
@@ -123,2 +150,3 @@ padding: 20px; | ||
align-items: center; | ||
height: 60px; | ||
width: 100%; | ||
@@ -154,2 +182,3 @@ gap: var(--polymarket-space-3); | ||
a { | ||
flex: 1; | ||
text-decoration: none; | ||
@@ -160,3 +189,15 @@ color: var(--polymarket-color-neutral-black); | ||
font-weight: var(--polymarket-font-weight-semi); | ||
flex: 1; | ||
text-decoration: underline; | ||
text-decoration-color: transparent; | ||
text-decoration-thickness: 2px; | ||
transition: text-decoration-color 100ms ease; | ||
display: -webkit-box; | ||
-webkit-line-clamp: 2; | ||
-webkit-box-orient: vertical; | ||
overflow: hidden; | ||
&:hover { | ||
text-decoration-color: var( | ||
--polymarket-color-neutral-black | ||
); | ||
} | ||
} | ||
@@ -166,5 +207,7 @@ } | ||
.top-row-right-container { | ||
position: relative; | ||
align-items: center; | ||
width: 60px; | ||
width: 75px; | ||
height: 60px; | ||
overflow: visible; | ||
} | ||
@@ -208,3 +251,3 @@ | ||
align-items: center; | ||
padding: 0px 10px; | ||
padding: 0px var(--polymarket-space-3); | ||
height: 32px; | ||
@@ -220,3 +263,2 @@ background-color: var(--polymarket-color-gray-6); | ||
transition: background-color 100ms ease-in-out; | ||
font-family: "OpenSans", sans-serif; | ||
gap: var(--polymarket-space-1); | ||
@@ -228,2 +270,80 @@ text-decoration: none; | ||
} | ||
.gauge-text-container { | ||
position: absolute; | ||
background-color: transparent; | ||
border-radius: 100% / 100% 100% 0 0; | ||
left: 50%; | ||
top: calc(50% + 2px); | ||
transform: translate(-50%, -50%); | ||
width: calc(120px * 0.85); | ||
height: calc(60px * 0.85); | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-end; | ||
z-index: 3; | ||
} | ||
.gauge-subtext-container { | ||
position: absolute; | ||
left: 0; | ||
bottom: 0; | ||
width: 120px; | ||
height: 60px; | ||
transform: scale(1.1); | ||
background-color: transparent; | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-start; | ||
padding-top: 6px; | ||
z-index: 4; | ||
} | ||
.gauge-text { | ||
position: absolute; | ||
background-color: transparent; | ||
border-radius: 100% / 100% 100% 0 0; | ||
left: 50%; | ||
top: calc(50% + 2px); | ||
transform: translate(-50%, -50%); | ||
z-index: 3; | ||
margin: 0; | ||
color: var(--polymarket-color-neutral-black); | ||
font-size: var(--polymarket-font-size-lg); | ||
line-height: var(--polymarket-line-height-lg); | ||
font-weight: var(--polymarket-font-weight-bold); | ||
} | ||
.gauge-subtext { | ||
position: absolute; | ||
left: 50%; | ||
top: calc(50% + 18px); | ||
transform: translate(-50%, -50%); | ||
background-color: transparent; | ||
z-index: 4; | ||
margin: 0; | ||
color: var(--polymarket-color-gray-3); | ||
font-size: var(--polymarket-font-size-sm); | ||
line-height: var(--polymarket-line-height-sm); | ||
font-weight: var(--polymarket-font-weight-medium); | ||
} | ||
.gauge { | ||
position: absolute; | ||
left: 50%; | ||
top: 50%; | ||
transform: translate(-50%, calc(-50% - 10px)) scaleX(1.1); | ||
} | ||
.gauge-track { | ||
position: absolute; | ||
top: 0; | ||
z-index: 1; | ||
} | ||
.gauge-fill { | ||
position: absolute; | ||
top: 0; | ||
z-index: 1; | ||
} | ||
`; | ||
@@ -235,13 +355,41 @@ } | ||
@property({ type: String, attribute: "hide-bet-amount" }) | ||
private accessor hideBetAmount: boolean = false; | ||
@property({ | ||
type: Boolean, | ||
attribute: "volume", | ||
converter: (value, type) => { | ||
if (type === String) return value === "true"; | ||
if (type === Boolean) return value; | ||
return false; | ||
}, | ||
}) | ||
private accessor showVolume: boolean = false; | ||
@property({ | ||
type: Boolean, | ||
attribute: "chart", | ||
converter: (value, type) => { | ||
if (type === String) return value === "true"; | ||
if (type === Boolean) return value; | ||
return false; | ||
}, | ||
}) | ||
// TODO - Implement chart | ||
// @ts-ignore | ||
private accessor showChart: boolean = false; | ||
@state() | ||
private accessor market: Market | undefined; | ||
private accessor _market: Market | undefined; | ||
@state() | ||
private accessor href: string | undefined; | ||
private accessor _href: string | undefined; | ||
@state() | ||
private accessor _probability: number | undefined; | ||
@state() | ||
private accessor _fillPathD: string | undefined; | ||
constructor() { | ||
super(); | ||
loadFonts(); | ||
} | ||
@@ -251,2 +399,3 @@ | ||
super.connectedCallback(); | ||
loadFonts(); | ||
this.fetchMarketData(); | ||
@@ -258,8 +407,30 @@ } | ||
const market = await getMarket({ slug: this.marketSlug }); | ||
this.market = market; | ||
this._market = market; | ||
this.href = | ||
this._href = | ||
market.events?.length && market.events[0]?.slug | ||
? `https://polymarket.com/event/${market.events[0].slug}/${market.slug}` | ||
: `https://polymarket.com/market/${market.slug}`; | ||
const value = market.outcomePrices[0] | ||
? parseFloat(market.outcomePrices[0]) | ||
: 0; | ||
const normalizedValue = Math.min(Math.max(value * 100, 0), 100); | ||
const safeValues = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]; | ||
const closestToSafeValue = safeValues.sort((a, b) => { | ||
return ( | ||
Math.abs(a - normalizedValue) - | ||
Math.abs(b - normalizedValue) | ||
); | ||
})[0] as number; | ||
this._probability = normalizedValue; | ||
this._fillPathD = | ||
VALUE_TO_PATH_MAP[ | ||
closestToSafeValue.toFixed( | ||
0, | ||
) as keyof typeof VALUE_TO_PATH_MAP | ||
]; | ||
} | ||
@@ -269,3 +440,3 @@ } | ||
override render() { | ||
if (!this.market) { | ||
if (!this._market) { | ||
return html` <span>${" "}</span> `; | ||
@@ -278,11 +449,41 @@ } | ||
<img | ||
src="${this.market.imageOptimized?.imageUrlSource ?? | ||
this.market.image}" | ||
src="${this._market.imageOptimized | ||
?.imageUrlSource ?? this._market.image}" | ||
alt="icon" | ||
/> | ||
<a href="${this.href}">${this.market.question}</a> | ||
<a href="${this._href}">${this._market.question}</a> | ||
</div> | ||
<div class="top-row-right-container"> | ||
<p>gauge</p> | ||
<svg | ||
width="75px" | ||
height="35px" | ||
viewBox="0 0 110 60" | ||
class="gauge" | ||
> | ||
<path | ||
id="gauge-track" | ||
d="M5,55 A50,50 0 0 1 105,55" | ||
class="gauge-track" | ||
fill="none" | ||
stroke="var(--polymarket-color-gray-5)" | ||
stroke-width="8" | ||
/> | ||
<path | ||
id="gauge-fill" | ||
d=${this._fillPathD} | ||
class="gauge-fill" | ||
fill="none" | ||
stroke="${(this._probability ?? 0) < 50 | ||
? "#E64800" | ||
: "#00B955"}" | ||
stroke-width="8.5" | ||
/> | ||
</svg> | ||
<p class="gauge-text"> | ||
${numeral(this._probability).format("0")}% | ||
</p> | ||
<p class="gauge-subtext">chance</p> | ||
</div> | ||
@@ -317,9 +518,12 @@ </div> | ||
<p class="typography-secondary typography-number"> | ||
${this.hideBetAmount | ||
? "" | ||
: numeral(this.market.volumeNum).format( | ||
${this.showVolume | ||
? `${numeral(this._market.volumeNum).format( | ||
"0.[0]a", | ||
)} | ||
)}` | ||
: ""} | ||
<span style="text-transform: capitalize;" | ||
>${this.showVolume ? "Bet" : ""}</span | ||
> | ||
</p> | ||
<a class="button-primary" href="${this.href}"> | ||
<a class="button-primary" href="${this._href}"> | ||
More details | ||
@@ -349,7 +553,10 @@ <svg | ||
interface HTMLElementTagNameMap { | ||
[ELEMENT_NAME]: MarketEmbed; | ||
"polymarket-market-embed": MarketEmbed; | ||
} | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
[ELEMENT_NAME]: { market: string; "hide-bet-amount"?: boolean }; | ||
"polymarket-market-embed": { | ||
market: string; | ||
"show-amount-amount"?: boolean; | ||
}; | ||
} | ||
@@ -361,6 +568,6 @@ } | ||
Define the custom element if it hasn't been defined already. | ||
This is to prevent errors when using multiple versions of the polymarket-embed on the same page. | ||
This is to prevent errors when using multiple versions of the polymarket-market-embed on the same page. | ||
*/ | ||
if (!customElements.get(ELEMENT_NAME)) { | ||
customElements.define(ELEMENT_NAME, MarketEmbed); | ||
if (!customElements.get("polymarket-market-embed")) { | ||
customElements.define("polymarket-market-embed", MarketEmbed); | ||
} |
@@ -22,2 +22,3 @@ import { defineConfig } from "tsup"; | ||
noExternal: Object.keys(pkg.dependencies ?? []), | ||
publicDir: "./src/assets", | ||
})); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 8 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 14 instances in 1 package
4131
20
1975787
8
61