e();function e(){t(),penpot.closePlugin()}function t(){let e=penpot.library.local.colors.sort((e,t)=>e.name.toLowerCase()>t.name.toLowerCase()?1:e.name.toLowerCase()<t.name.toLowerCase()?-1:0),t=Math.ceil(e.length/4),n=t*100+Math.max(0,t-1)*10+20,r=penpot.createBoard();r.name=`Palette`;let i=penpot.viewport;if(r.x=i.center.x-850/2,r.y=i.center.y-n/2,e.length===0)return;r.resize(850,n),r.borderRadius=8;let a=r.addGridLayout();for(let e=0;e<t;e++)a.addRow(`flex`,1);for(let e=0;e<4;e++)a.addColumn(`flex`,1);a.alignItems=`center`,a.justifyItems=`start`,a.justifyContent=`stretch`,a.alignContent=`stretch`,a.rowGap=10,a.columnGap=10,a.verticalPadding=10,a.horizontalPadding=10,a.horizontalSizing=`auto`;for(let n=0;n<t;n++)for(let t=0;t<4;t++){let r=n*4+t,i=e[r];if(r>=e.length)return;let o=penpot.createBoard();a.appendChild(o,n+1,t+1),o.fills=[i.asFill()],o.strokes=[{strokeColor:`#000000`,strokeOpacity:.3,strokeStyle:`solid`}],o.layoutChild&&(o.layoutChild.horizontalSizing=`fill`,o.layoutChild.verticalSizing=`fill`);let s=o.addFlexLayout();s.alignItems=`center`,s.justifyContent=`center`,s.verticalPadding=8,s.horizontalPadding=8;let c=penpot.createText(i.name);c.fontWeight=`bold`,c.fontVariantId=`bold`,c.growType=`auto-width`,c.strokes=[{strokeColor:`#FFFFFF`,strokeWidth:1,strokeAlignment:`outer`,strokeOpacity:.5,strokeStyle:`solid`}],o.appendChild(c)}}