From d6e0d25f7147db4650423f3573880ebb02170fc9 Mon Sep 17 00:00:00 2001 From: Omar Adobati Date: Sun, 29 Dec 2024 20:05:09 +0100 Subject: [PATCH] chore: update build files --- dist/plugin.js | 2 +- dist/ui.html | 2 +- dist/ui.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/plugin.js b/dist/plugin.js index 2c116efc..8aed795b 100644 --- a/dist/plugin.js +++ b/dist/plugin.js @@ -1 +1 @@ -(()=>{"use strict";const e={filename:"design-tokens",extension:".tokens.json",nameConversion:"default",tokenFormat:"standard",compression:!1,urlJsonCompression:!0,serverUrl:void 0,eventType:"update-tokens",accessToken:void 0,acceptHeader:"application/vnd.github.everest-preview+json",contentType:"text/plain;charset=UTF-8",authType:"token",reference:"main",exclusionPrefix:"",excludeExtensionProp:!1,alias:"alias, ref, reference",keyInName:!1,prefixInName:!0,modeInTokenValue:!1,modeInTokenName:!1,resolveSameCollectionOrModeReference:!1,prefix:{color:"color",gradient:"gradient",typography:"typography",font:"font",effect:"effect",grid:"grid",border:"border, borders",breakpoint:"breakpoint, breakpoints",radius:"radius, radii",size:"size, sizes",spacing:"spacing",motion:"motion",opacity:"opacity, opacities"},exports:{color:!0,gradient:!0,font:!0,typography:!0,effect:!0,grid:!0,border:!0,breakpoint:!0,radius:!0,size:!0,spacing:!0,motion:!0,opacity:!0,variables:!0}},t={ui:{generalSettings:{width:550,height:836},export:{width:550,height:356},urlExport:{width:550,height:650}},key:{lastVersionSettingsOpened:"lastVersionSettingsOpened",fileId:"fileId",settings:"settings",extensionPluginData:"org.lukasoppermann.figmaDesignTokens",extensionFigmaStyleId:"styleId",extensionVariableStyleId:"variableId",extensionAlias:"alias",authType:{token:"token",gitlabToken:"gitlab_token",gitlabCommit:"gitlab_commit",basic:"Basic",bearer:"Bearer"}},exclusionPrefixDefault:["_","."],fileExtensions:[{label:".tokens.json",value:".tokens.json"},{label:".tokens",value:".tokens"},{label:".json",value:".json"}]},n=(e,t=!0)=>!0===t?JSON.stringify(e):JSON.stringify(e,null,2),i=(e,t)=>Object.fromEntries(Object.entries(e).map((([n,i])=>void 0!==i&&typeof t[n]!=typeof i?[n,e[n]]:[n,t[n]])));var a=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const o={generalSettings:"generalSettings",export:"export",sendSettings:"sendSettings",urlExport:"urlExport",help:"help",demo:"demo",openUrl:"openUrl",reset:"reset",saveSettings:"saveSettings",closePlugin:"closePlugin"},r="6.11.0";const s=e=>{return n=void 0,i=void 0,o=function*(){const n=yield e.clientStorage.getAsync(t.key.lastVersionSettingsOpened),i=((e,t="1.0.0")=>{const[n,i,a]=t.split("."),[o,r,s]=e.split(".");return n{let n=e.root.getPluginData(t.key.fileId);return void 0!==n&&""!==n||(e.root.setPluginData(t.key.fileId,e.root.name+" "+Math.floor(1e9*Math.random())),n=e.root.getPluginData(t.key.fileId)),n},c="color",p="gradient",u="font",d="effect",g="grid",y="border",m="breakpoint",f="radius",v="size",x="spacing",b="motion",h="opacity",k="variables",S=(e,t=2)=>{if(void 0===e)return;if("number"!=typeof e||"number"!=typeof t)throw new Error(`Invalid parameters, both value "${e}" (${typeof e}) and decimalPlaces "${t}" (${typeof t}) must be of type number`);const n=Math.pow(10,t);return Math.round(e*n)/n},I=(e,t)=>{var n;return{r:S(255*e.r,0),g:S(255*e.g,0),b:S(255*e.b,0),a:S(null!==(n=null!=t?t:e.a)&&void 0!==n?n:1)}},A=e=>"SOLID"===e.type&&!0===e.visible?I(e.color,e.opacity):null,E={fill:{value:{r:0,g:0,b:0,a:0},type:"color",blendMode:"normal"}},O=e=>e?{[t.key.extensionAlias]:e}:{},R={GRADIENT_LINEAR:"linear",GRADIENT_RADIAL:"radial",GRADIENT_ANGULAR:"angular",GRADIENT_DIAMOND:"diamond"},T=([[e,t],[n,i]])=>{const a=Math.atan2(i-t,n-e)*(180/Math.PI)+315;return a>360?a-360:a},w=(e,n)=>e.reduce(((e,i)=>{const a=i.paints.filter((e=>"IMAGE"!==e.type));if(i.paints.length&&0===a.length)return e;i.paints=a;const{alias:o,description:r}=((e="",t)=>{t=t&&0!==t.filter((e=>e)).length?t:["Ref:"];const n=new RegExp("("+t.join("|").toLowerCase()+"):?\\s");let i;const a=e.split(/\r?\n/).filter((e=>!e.toLowerCase().match(n)||(i=e.toLowerCase().replace(n,"").trim(),!1)));return{alias:i,description:a.join("\n")}})(i.description,n.alias),s=(l=i.paints[0],["GRADIENT_LINEAR","GRADIENT_RADIAL","GRADIENT_ANGULAR","GRADIENT_DIAMOND"].includes(null==l?void 0:l.type));var l;const u=i.paints.length?i.paints.map((e=>(e=>{var t;return"SOLID"===e.type?{fill:{value:A(e),type:"color",blendMode:(null===(t=e.blendMode)||void 0===t?void 0:t.toLowerCase())||"normal"}}:["GRADIENT_LINEAR","GRADIENT_RADIAL","GRADIENT_ANGULAR","GRADIENT_DIAMOND"].includes(e.type)?{gradientType:{value:R[e.type],type:"string"},rotation:{value:T(e.gradientTransform),type:"number",unit:"degree"},stops:e.gradientStops.map((e=>({position:{value:S(e.position),type:"number"},color:{value:I(e.color),type:"color"}}))),opacity:{value:S(e.opacity),type:"number"}}:null})(e))):[E];return[...e,{name:`${s?n.gradient[0]:n.color[0]}/${i.name}`,category:s?"gradient":"color",exportKey:s?p:c,description:r,values:u,extensions:{[t.key.extensionPluginData]:Object.assign({[t.key.extensionFigmaStyleId]:i.id,exportKey:s?p:c},O(o))}}]}),[]),L=(e,n)=>e.filter((e=>e.layoutGrids.length>0)).map((e=>({name:`${n[0]}/${e.name}`,category:"grid",exportKey:g,description:e.description||null,values:e.layoutGrids.map((e=>"GRID"===e.pattern?(e=>({pattern:{value:e.pattern.toLowerCase(),type:"string"},sectionSize:{value:e.sectionSize,unit:"pixel",type:"number"}}))(e):(e=>{return Object.assign(Object.assign(Object.assign({pattern:{value:e.pattern.toLowerCase(),type:"string"}},void 0!==e.sectionSize&&{sectionSize:{value:e.sectionSize,unit:"pixel",type:"number"}}),{gutterSize:{value:e.gutterSize,unit:"pixel",type:"number"},alignment:{value:e.alignment.toLowerCase(),type:"string"},count:(t=e.count,t===1/0?{value:"auto",type:"string"}:{value:t,type:"number"})}),void 0!==e.offset&&{offset:{value:e.offset,unit:"pixel",type:"number"}});var t})(e))),extensions:{[t.key.extensionPluginData]:{[t.key.extensionFigmaStyleId]:e.id,exportKey:g}}}))),C={NONE:"none",UNDERLINE:"underline",STRIKETHROUGH:"line-through"},N={ORIGINAL:"none",UPPER:"uppercase",LOWER:"lowercase",TITLE:"capitalize",SMALL_CAPS:"small-caps"},P={100:100,thin:100,w1:100,200:200,w2:200,extralight:200,ultralight:200,extraleicht:200,300:300,light:300,leicht:300,w3:300,400:400,normal:400,regular:400,buch:400,w4:400,500:500,medium:500,kraeftig:500,kräftig:500,w5:500,600:600,semibold:600,demibold:600,halbfett:600,w6:600,700:700,bold:700,dreiviertelfett:700,w7:700,800:800,extrabold:800,ultabold:800,fett:800,w8:800,900:900,black:900,heavy:900,super:900,extrafett:900,w9:900},D={normal:"normal",condensed:"condensed",expanded:"expanded",extended:"expanded"},_={normal:"normal",italic:"italic",kursiv:"italic",oblique:"oblique"},M=e=>{const t=e.toLowerCase().split(" ");let n=t[0];return["extra","ultra","semi","demi"].includes(t[0])&&["bold","light"].includes(t[1])&&(n=`${t[0]}${t[1]}`),P[n]||400},j=e=>{const t=e.toLowerCase().split(" ");return D[t[t.length-1]]||D[t[t.length-2]]||"normal"},B=e=>{const t=e.toLowerCase().split(" ").pop();return _[t]||"normal"},z=(e,n)=>e.map((e=>({name:`${n[0]}/${e.name}`,category:"font",exportKey:u,description:e.description||void 0,values:{fontSize:{value:e.fontSize,unit:"pixel",type:"number"},textDecoration:{value:C[e.textDecoration],type:"string"},fontFamily:{value:e.fontName.family,type:"string"},fontWeight:{value:M(e.fontName.style),type:"number"},fontStyle:{value:B(e.fontName.style),type:"string"},fontStretch:{value:j(e.fontName.style),type:"string"},_fontStyleOld:{value:e.fontName.style,type:"string"},letterSpacing:{value:S(e.letterSpacing.value),unit:"pixels"===e.letterSpacing.unit.toLowerCase()?"pixel":e.letterSpacing.unit.toLowerCase(),type:"number"},lineHeight:{value:Object.prototype.hasOwnProperty.call(e.lineHeight,"value")?S(e.lineHeight.value):"normal",unit:"pixels"===e.lineHeight.unit.toLowerCase()?"pixel":e.lineHeight.unit.toLowerCase(),type:Object.prototype.hasOwnProperty.call(e.lineHeight,"value")?"number":"string"},paragraphIndent:{value:e.paragraphIndent,unit:"pixel",type:"number"},paragraphSpacing:{value:e.paragraphSpacing,unit:"pixel",type:"number"},textCase:{value:N[e.textCase]||"none",type:"string"}},extensions:{[t.key.extensionPluginData]:{[t.key.extensionFigmaStyleId]:e.id,exportKey:u}}}))),U={LAYER_BLUR:"layerBlur",BACKGROUND_BLUR:"backgroundBlur",DROP_SHADOW:"dropShadow",INNER_SHADOW:"innerShadow"},G=(e,n)=>e.filter((e=>e.effects.length>0)).map((e=>({name:`${n[0]}/${e.name}`,category:"effect",exportKey:d,description:e.description||null,values:e.effects.map((e=>"LAYER_BLUR"===e.type||"BACKGROUND_BLUR"===e.type?(e=>({effectType:{value:U[e.type],type:"string"},radius:{value:e.radius,unit:"pixel",type:"number"}}))(e):(e=>({effectType:{value:U[e.type],type:"string"},radius:{value:e.radius,unit:"pixel",type:"number"},color:{value:I(e.color),type:"color"},offset:{x:{value:e.offset.x,unit:"pixel",type:"number"},y:{value:e.offset.y,unit:"pixel",type:"number"}},spread:{value:e.spread,unit:"pixel",type:"number"}}))(e))),extensions:{[t.key.extensionPluginData]:{[t.key.extensionFigmaStyleId]:e.id,exportKey:d}}}))),K=e=>t=>{if(!Array.isArray(e))return;const n=t.name.substr(0,t.name.indexOf("/")).replace(/\s+/g,"");return 0!==n.length?e.includes(n):void 0},F=e=>{if(Object.prototype.hasOwnProperty.call(e,"direction"))return{direction:{value:e.direction.toLowerCase(),type:"string"}}},$={CUSTOM_CUBIC_BEZIER:{type:"custom-cubicBezier",curveType:"cubicBezier",easing:void 0},CUSTOM_SPRING:{type:"custom-spring",curveType:"spring",easing:void 0},LINEAR:{type:"linear",curveType:"cubicBezier",easing:{x1:0,y1:0,x2:1,y2:1}},EASE_IN:{type:"ease-in",curveType:"cubicBezier",easing:{x1:.41999998688697815,y1:0,x2:1,y2:1}},EASE_OUT:{type:"ease-out",curveType:"cubicBezier",easing:{x1:0,y1:0,x2:.5799999833106995,y2:1}},EASE_IN_AND_OUT:{type:"ease-in-out",curveType:"cubicBezier",easing:{x1:.41999998688697815,y1:0,x2:.5799999833106995,y2:1}},EASE_IN_BACK:{type:"ease-in-back",curveType:"cubicBezier",easing:{x1:.30000001192092896,y1:-.05000000074505806,x2:.699999988079071,y2:-.5}},EASE_OUT_BACK:{type:"ease-out-back",curveType:"cubicBezier",easing:{x1:.44999998807907104,y1:1.4500000476837158,x2:.800000011920929,y2:1}},EASE_IN_AND_OUT_BACK:{type:"ease-in-out-back",curveType:"cubicBezier",easing:{x1:.699999988079071,y1:-.4000000059604645,x2:.4000000059604645,y2:1.399999976158142}},BOUNCY:{type:"bouncy",curveType:"spring",easing:{mass:1,stiffness:600,damping:15}},GENTLE:{type:"gentle",curveType:"spring",easing:{mass:1,stiffness:100,damping:15}},QUICK:{type:"quick",curveType:"spring",easing:{mass:1,stiffness:300,damping:20}},SLOW:{type:"slow",curveType:"spring",easing:{mass:1,stiffness:80,damping:20}}},V=e=>{var t;if("type"in e&&void 0!==$[e.type])return"CUSTOM_CUBIC_BEZIER"===e.type&&($.CUSTOM_CUBIC_BEZIER.easing={x1:e.easingFunctionCubicBezier.x1,y1:e.easingFunctionCubicBezier.y1,x2:e.easingFunctionCubicBezier.x2,y2:e.easingFunctionCubicBezier.y2}),"CUSTOM_SPRING"===e.type&&($.CUSTOM_SPRING.easing={mass:e.easingFunctionSpring.mass,stiffness:e.easingFunctionSpring.stiffness,damping:e.easingFunctionSpring.damping}),{easingType:{value:$[e.type].type,type:"string"},easingCurveType:{value:$[e.type].curveType,type:"string"},easingFunction:(t=$[e.type],"spring"===t.curveType?{mass:{value:t.easing.mass,type:"number"},stiffness:{value:t.easing.stiffness,type:"number"},damping:{value:t.easing.damping,type:"number"}}:"cubicBezier"===t.curveType?{x1:{value:t.easing.x1,type:"number"},x2:{value:t.easing.x2,type:"number"},y1:{value:t.easing.y1,type:"number"},y2:{value:t.easing.y2,type:"number"}}:void 0)}},H=e=>{var t;const n=Object.keys($);return!!(e.reactions.length>0&&"NODE"===(null===(t=e.reactions[0].action)||void 0===t?void 0:t.type)&&null!==e.reactions[0].action.transition&&n.includes(e.reactions[0].action.transition.easing.type))},J=(e,n)=>e.filter(K(n)).filter(H).map((e=>({name:e.name,category:"motion",exportKey:b,description:e.description||null,values:Object.assign(Object.assign({transitionType:{value:e.reactions[0].action.transition.type.toLocaleLowerCase(),type:"string"},duration:{value:Math.round(1e3*(e.reactions[0].action.transition.duration+Number.EPSILON))/1e3,unit:"s",type:"number"}},V(e.reactions[0].action.transition.easing)),F(e.reactions[0].action.transition)),extensions:{[t.key.extensionPluginData]:{exportKey:b}}}))),W=(e,n)=>e.filter(K(n)).map((e=>({name:e.name,category:"spacing",exportKey:x,description:e.description||null,values:{top:{value:S(e.paddingTop,2),unit:"pixel",type:"number"},right:{value:S(e.paddingRight,2),unit:"pixel",type:"number"},bottom:{value:S(e.paddingBottom,2),unit:"pixel",type:"number"},left:{value:S(e.paddingLeft,2),unit:"pixel",type:"number"}},extensions:{[t.key.extensionPluginData]:{exportKey:x}}}))),q={MITER:"miter",BEVEL:"bevel",ROUND:"round"},Q={CENTER:"center",INSIDE:"inside",OUTSIDE:"outside"},Y=(e,n)=>e.filter(K(n)).filter((e=>e.strokes.length>0)).map((e=>({name:e.name,category:"border",exportKey:y,description:e.description||null,values:{strokeAlign:{value:Q[e.strokeAlign],type:"string"},dashPattern:{value:[...void 0!==e.dashPattern&&e.dashPattern.length>0?e.dashPattern:[0,0]],type:"string"},strokeCap:{value:"string"==typeof e.strokeCap?e.strokeCap.toLowerCase():"mixed",type:"string"},strokeJoin:{value:q[e.strokeJoin],type:"string"},strokeMiterLimit:{value:S(e.strokeMiterLimit),unit:"degree",type:"number"},strokeWeight:{value:e.strokeWeight,unit:"pixel",type:"number"},stroke:{value:e.strokes[0],type:"color"}},extensions:{[t.key.extensionPluginData]:{exportKey:y}}}))),Z=(e,n)=>{const i=e=>({topLeft:{value:e.topLeftRadius||0,unit:"pixel",type:"number"},topRight:{value:e.topRightRadius||0,unit:"pixel",type:"number"},bottomRight:{value:e.bottomRightRadius||0,unit:"pixel",type:"number"},bottomLeft:{value:e.bottomLeftRadius||0,unit:"pixel",type:"number"}});return e.filter(K(n)).map((e=>{return{name:e.name,category:"radius",exportKey:f,description:e.description||null,values:Object.assign(Object.assign({},"number"==typeof e.cornerRadius&&{radius:{value:e.cornerRadius,unit:"pixel",type:"number"}}),{radiusType:{value:(n=e.cornerRadius,"number"==typeof n?"single":"mixed"),type:"string"},radii:i(e),smoothing:{value:S(e.cornerSmoothing,2),comment:"Percent as decimal from 0.0 - 1.0",type:"number"}}),extensions:{[t.key.extensionPluginData]:{exportKey:f}}};var n}))},X=(e,n)=>e.filter(K(n)).map((e=>({name:e.name,category:"breakpoint",exportKey:m,description:e.description||null,values:{width:{value:S(e.width,2),unit:"pixel",type:"number"},height:{value:S(e.height,2),unit:"pixel",type:"number"}},extensions:{[t.key.extensionPluginData]:{exportKey:m}}}))),ee=(e,n)=>e.filter(K(n)).map((e=>({name:e.name,category:"opacity",exportKey:h,description:e.description||null,values:{opacity:{value:S(e.opacity,2),type:"number"}},extensions:{[t.key.extensionPluginData]:{exportKey:h}}}))),te=(e,n)=>!(e=>[...t.exclusionPrefixDefault,...e])(n).includes(e.name.trim().substr(0,1)),ne=e=>{const t=[];return e.forEach((e=>{t.push({name:e.name,id:e.id,description:e.description,paints:e.paints})})),t},ie=e=>{const t=[];return e.forEach((e=>{t.push({name:e.name,id:e.id,description:e.description,layoutGrids:e.layoutGrids})})),t},ae=e=>{var t,n;return{name:e.name,description:e.description||void 0,bottomLeftRadius:e.bottomLeftRadius,bottomRightRadius:e.bottomRightRadius,topLeftRadius:e.topLeftRadius,topRightRadius:e.topRightRadius,cornerRadius:e.cornerRadius||void 0,cornerSmoothing:e.cornerSmoothing,strokes:(n=e.strokes,[...n].map((e=>A(e))).filter((e=>null!=e))),strokeWeight:e.strokeWeight,strokeStyleId:e.strokeStyleId,strokeMiterLimit:e.strokeMiterLimit,strokeJoin:e.strokeJoin,strokeCap:e.strokeCap,dashPattern:e.dashPattern,strokeAlign:e.strokeAlign,width:e.width,height:e.height,reactions:e.reactions||void 0,paddingTop:e.paddingTop||0,paddingRight:e.paddingRight||0,paddingBottom:e.paddingBottom||0,paddingLeft:e.paddingLeft||0,opacity:null!==(t=e.opacity)&&void 0!==t?t:1}},oe=["COMPONENT","COMPONENT_SET","RECTANGLE","FRAME"],re="_tokens",se=e=>[...e.map((e=>e.findChildren((e=>(e=>"FRAME"===e.type&&e.name.trim().toLowerCase().substr(0,re.length)===re)(e))))).reduce(((e,t)=>[...e,...t]))].map((e=>e.findAll((e=>(e=>"COMPONENT_SET"!==e.parent.type&&oe.includes(e.type)&&e.name.length>0)(e))))).reduce(((e,t)=>[...e,...t]),[]).map((e=>("RECTANGLE"!==e.type&&"FRAME"!==e.type||console.warn("Please use only main components and variants, other types may be deprecated as tokens in the future"),"COMPONENT_SET"===e.type?e.children.map((t=>{return Object.assign(Object.assign({},ae(t)),{name:(n=e.name,i=t.name,`${n}/${i=i.split(",").filter((e=>!["_","."].includes(e.trim().substr(0,1)))).map((e=>e.split("=")[1])).join("/")}`)});var n,i})):[ae(e)]))).reduce(((e,t)=>[...e,...t]),[]),le=e=>{const t=[];return e.forEach((e=>{t.push({name:e.name,id:e.id,description:e.description,fontSize:e.fontSize,textDecoration:e.textDecoration,fontName:e.fontName,letterSpacing:e.letterSpacing,lineHeight:e.lineHeight,paragraphIndent:e.paragraphIndent,paragraphSpacing:e.paragraphSpacing,textCase:e.textCase})})),t},ce=e=>{const t=[];return e.forEach((e=>{t.push({name:e.name,id:e.id,description:e.description,effects:e.effects})})),t};const pe=(e,t)=>{return n=void 0,i=void 0,o=function*(){const n=se([...e.root.children]),i=t.exclusionPrefix.split(",").map((e=>e.replace(/\s+/g,"")));return{tokenFrames:n,paintStyles:ne(yield e.getLocalPaintStylesAsync()).filter((e=>te(e,i))),gridStyles:ie(yield e.getLocalGridStylesAsync()).filter((e=>te(e,i))),textStyles:le(yield e.getLocalTextStylesAsync()).filter((e=>te(e,i))),effectStyles:ce(yield e.getLocalEffectStylesAsync()).filter((e=>te(e,i)))}},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof a?n:new a((function(e){e(n)}))).then(r,s)}l((o=o.apply(n,i||[])).next())}));var n,i,a,o},ue=e=>"boolean"==typeof e?"string":"number"==typeof e?"dimension":"object"==typeof e?"color":"string"==typeof e?"string":void 0,de=(e,t="/",n=".")=>e.split(t).join(n).toLowerCase();const ge=function(e,t,n,i=!1){return a=this,o=void 0,s=function*(){const a=yield figma.variables.getVariableByIdAsync(t.id),o=yield figma.variables.getVariableCollectionByIdAsync(a.variableCollectionId);return{description:e.description||"",exportKey:k,category:ue(Object.values(a.valuesByMode)[0]),values:`{${o.name.toLowerCase()}.${de(a.name,"/",".")}}`,aliasCollectionName:o.name.toLowerCase(),aliasMode:n,aliasSameMode:e.aliasSameMode||i}},new((r=void 0)||(r=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function i(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var a;t.done?e(t.value):(a=t.value,a instanceof r?a:new r((function(e){e(a)}))).then(n,i)}l((s=s.apply(a,o||[])).next())}));var a,o,r,s},ye=e=>e.reduce(((e,t)=>{if(!t.aliasMode)return e.push(t),e;const{aliasMode:n,aliasCollectionName:i}=t;return e.push(Object.assign(Object.assign({},t),{values:t.values.replace(`{${i}.`,`{${i}.${n.name.toLowerCase()}.`)})),e}),[]),me=(e,t)=>{const n=e=>e&&"object"==typeof e;return n(e)&&n(t)?(Object.keys(t).forEach((i=>{const a=e[i],o=t[i];Array.isArray(a)&&Array.isArray(o)?e[i]=a.concat(o):n(a)&&n(o)?e[i]=me(Object.assign({},a),o):e[i]=o})),e):t},fe=me;var ve=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const xe=(e,t)=>{var n;let i={};return t&&(null===(n=null==e?void 0:e.modes)||void 0===n||n.forEach((n=>{const a=t.valuesByMode[n.modeId];e.variableIds.forEach((e=>ve(void 0,void 0,void 0,(function*(){const o=yield figma.variables.getVariableByIdAsync(e);o&&a&&"object"==typeof a&&t.name!==o.name&&a.id===o.id&&(i=ge(t,a,n,!0))}))))}))),fe(t,i)},be=(e,n)=>ve(void 0,void 0,void 0,(function*(){const i=yield e.variables.getLocalVariableCollectionsAsync(),a=yield e.variables.getLocalVariablesAsync(),o=i.filter((e=>![".","_",...n.exclusionPrefix.split(",")].includes(e.name.charAt(0)))).map((e=>e.id)),r=Object.fromEntries(i.map((e=>[e.id,e]))),s=a.filter((e=>o.includes(e.variableCollectionId))).map((e=>{const{variableCollectionId:i}=e,{name:a,modes:o}=r[i];return n.resolveSameCollectionOrModeReference&&(e=xe(r[i],e)),Object.entries(e.valuesByMode).map((([i,r])=>{const s=n.modeInTokenName&&o.length>1,l=o.find((({modeId:e})=>e===i)),c=`${a}/${e.name}`,p=`${a}/${l.name}/${e.name}`;return Object.assign(Object.assign({},((e,t,n)=>{let i="color",a={};if("VARIABLE_ALIAS"===t.type)return ge(e,t,n);switch(e.resolvedType){case"COLOR":i="color",a={fill:{value:I(t),type:"color",blendMode:"normal"}};break;case"FLOAT":i="dimension",a=S(t,2);break;case"STRING":i="string",a=t;break;case"BOOLEAN":i="boolean",a=t}return{name:e.name,description:e.description||void 0,exportKey:k,category:i,values:a}})(e,r,l)),{name:s?p:c,extensions:{[t.key.extensionPluginData]:{mode:n.modeInTokenValue?l.name:void 0,collection:a,scopes:e.scopes,[t.key.extensionVariableStyleId]:e.id,exportKey:k}}})}))}));return n.modeInTokenValue?ye(s.flat()):s.flat().map((e=>(null==e?void 0:e.aliasSameMode)?ye([e]):e)).flat()}));const he=(e="")=>e.split(",").map((e=>e.replace(/\s+/g,"")));var ke=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};figma.showUI(__html__,{themeColors:!0,visible:!1}),[o.export,o.urlExport,o.generalSettings].includes(figma.command)&&ke(void 0,void 0,void 0,(function*(){const r=(()=>{let n=figma.root.getPluginData(t.key.settings);if(""===n)return e;n=JSON.parse(n);const a=i(e,n);return a.prefix=i(e.prefix,a.prefix),a.exports=i(e.exports,a.exports),a})(),c=yield s(figma);figma.ui.resize(t.ui[figma.command].width,t.ui[figma.command].height),void 0!==c&&"patch"!==c&&figma.ui.resize(t.ui[figma.command].width,t.ui[figma.command].height+60);const p={command:figma.command,payload:{settings:Object.assign(Object.assign({},r),{accessToken:yield(u=l(figma),a(void 0,void 0,void 0,(function*(){const e=yield figma.clientStorage.getAsync("accessTokens");return void 0!==e&&e instanceof Object&&e[u]||""})))}),data:null,versionDifference:c,metadata:{filename:figma.root.name}}};var u;[o.export,o.urlExport].includes(figma.command)&&(p.payload.data=n(((e,n)=>{return i=void 0,a=void 0,r=function*(){const i=yield pe(e,n);return[...(a=i.tokenFrames,o=he(n.prefix.size),a.filter(K(o)).map((e=>({name:e.name,category:"size",exportKey:v,description:e.description||null,values:{width:{value:S(e.width,2),unit:"pixel",type:"number"},height:{value:S(e.height,2),unit:"pixel",type:"number"}},extensions:{[t.key.extensionPluginData]:{exportKey:v}}})))),...X(i.tokenFrames,he(n.prefix.breakpoint)),...W(i.tokenFrames,he(n.prefix.spacing)),...Y(i.tokenFrames,he(n.prefix.border)),...Z(i.tokenFrames,he(n.prefix.radius)),...J(i.tokenFrames,he(n.prefix.motion)),...ee(i.tokenFrames,he(n.prefix.opacity)),...w(i.paintStyles,{color:he(n.prefix.color),gradient:he(n.prefix.gradient),alias:he(n.alias)}),...L(i.gridStyles,he(n.prefix.grid)),...z(i.textStyles,he(n.prefix.font)),...G(i.effectStyles,he(n.prefix.effect)),...yield be(e,n)];var a,o},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(r.next(e))}catch(e){t(e)}}function s(e){try{l(r.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(n,s)}l((r=r.apply(i,a||[])).next())}));var i,a,o,r})(figma,r))),figma.ui.postMessage(Object.assign({},p)),figma.ui.show()})),figma.command===o.help&&figma.ui.postMessage({command:o.help,payload:{url:"https://github.com/lukasoppermann/design-tokens"}}),figma.command===o.demo&&figma.ui.postMessage({command:o.demo,payload:{url:"https://www.figma.com/file/2MQ759R5kJtzQn4qSHuqR7/Design-Tokens-for-Figma?node-id=231%3A2"}}),figma.command===o.reset&&(figma.root.setPluginData(t.key.settings,n(e)),figma.notify("⚙️ Settings have been reset."),figma.closePlugin()),figma.ui.onmessage=i=>ke(void 0,void 0,void 0,(function*(){const{command:r,payload:s}=i;var c,p,u;r===o.closePlugin&&(void 0!==(null==s?void 0:s.notification)&&""!==(null==s?void 0:s.notification)&&figma.notify(s.notification),figma.ui.hide(),figma.closePlugin()),r===o.saveSettings&&(u=s.settings,u=Object.assign(Object.assign({},e),u),figma.root.setPluginData(t.key.settings,n(u)),yield(c=l(figma),p=s.accessToken,a(void 0,void 0,void 0,(function*(){const e=(yield figma.clientStorage.getAsync("accessTokens"))||{},t=Object.assign(Object.assign({},e),{[c]:p});return yield figma.clientStorage.setAsync("accessTokens",t)}))),s.closePlugin&&!0===s.closePlugin&&figma.closePlugin())}))})(); \ No newline at end of file +(()=>{"use strict";const e={filename:"design-tokens",extension:".tokens.json",nameConversion:"default",tokenFormat:"standard",compression:!1,urlJsonCompression:!0,serverUrl:void 0,eventType:"update-tokens",accessToken:void 0,acceptHeader:"application/vnd.github.everest-preview+json",contentType:"text/plain;charset=UTF-8",authType:"token",reference:"main",exclusionPrefix:"",excludeExtensionProp:!1,alias:"alias, ref, reference",keyInName:!1,prefixInName:!0,modeInTokenValue:!1,modeInTokenName:!1,resolveSameCollectionOrModeReference:!1,prefix:{color:"color",gradient:"gradient",typography:"typography",font:"font",effect:"effect",grid:"grid",border:"border, borders",breakpoint:"breakpoint, breakpoints",radius:"radius, radii",size:"size, sizes",spacing:"spacing",motion:"motion",opacity:"opacity, opacities"},exports:{color:!0,gradient:!0,font:!0,typography:!0,effect:!0,grid:!0,border:!0,breakpoint:!0,radius:!0,size:!0,spacing:!0,motion:!0,opacity:!0,variables:!0}},t={ui:{generalSettings:{width:550,height:836},export:{width:550,height:356},urlExport:{width:550,height:650}},key:{lastVersionSettingsOpened:"lastVersionSettingsOpened",fileId:"fileId",settings:"settings",extensionPluginData:"org.lukasoppermann.figmaDesignTokens",extensionFigmaStyleId:"styleId",extensionVariableStyleId:"variableId",extensionAlias:"alias",authType:{token:"token",gitlabToken:"gitlab_token",gitlabCommit:"gitlab_commit",basic:"Basic",bearer:"Bearer"}},exclusionPrefixDefault:["_","."],fileExtensions:[{label:".tokens.json",value:".tokens.json"},{label:".tokens",value:".tokens"},{label:".json",value:".json"}]},n=(e,t=!0)=>!0===t?JSON.stringify(e):JSON.stringify(e,null,2),i=(e,t)=>Object.fromEntries(Object.entries(e).map((([n,i])=>void 0!==i&&typeof t[n]!=typeof i?[n,e[n]]:[n,t[n]])));var a=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const o={generalSettings:"generalSettings",export:"export",sendSettings:"sendSettings",urlExport:"urlExport",help:"help",demo:"demo",openUrl:"openUrl",reset:"reset",saveSettings:"saveSettings",closePlugin:"closePlugin"},r="6.11.0";const s=e=>{return n=void 0,i=void 0,o=function*(){const n=yield e.clientStorage.getAsync(t.key.lastVersionSettingsOpened),i=((e,t="1.0.0")=>{const[n,i,a]=t.split("."),[o,r,s]=e.split(".");return n{let n=e.root.getPluginData(t.key.fileId);return void 0!==n&&""!==n||(e.root.setPluginData(t.key.fileId,e.root.name+" "+Math.floor(1e9*Math.random())),n=e.root.getPluginData(t.key.fileId)),n},u="color",c="gradient",p="font",d="effect",g="grid",y="border",m="breakpoint",f="radius",v="size",x="spacing",b="motion",h="opacity",k="variables",S=(e,t=2)=>{if(void 0===e)return;if("number"!=typeof e||"number"!=typeof t)throw new Error(`Invalid parameters, both value "${e}" (${typeof e}) and decimalPlaces "${t}" (${typeof t}) must be of type number`);const n=Math.pow(10,t);return Math.round(e*n)/n},I=(e,t)=>{var n;return{r:S(255*e.r,0),g:S(255*e.g,0),b:S(255*e.b,0),a:S(null!==(n=null!=t?t:e.a)&&void 0!==n?n:1)}},A=e=>"SOLID"===e.type&&!0===e.visible?I(e.color,e.opacity):null,E={fill:{value:{r:0,g:0,b:0,a:0},type:"color",blendMode:"normal"}},O=e=>e?{[t.key.extensionAlias]:e}:{},R={GRADIENT_LINEAR:"linear",GRADIENT_RADIAL:"radial",GRADIENT_ANGULAR:"angular",GRADIENT_DIAMOND:"diamond"},T=([[e,t],[n,i]])=>{const a=Math.atan2(i-t,n-e)*(180/Math.PI)+315;return a>360?a-360:a},w=(e,n)=>e.reduce(((e,i)=>{const a=i.paints.filter((e=>"IMAGE"!==e.type));if(i.paints.length&&0===a.length)return e;i.paints=a;const{alias:o,description:r}=((e="",t)=>{t=t&&0!==t.filter((e=>e)).length?t:["Ref:"];const n=new RegExp("("+t.join("|").toLowerCase()+"):?\\s");let i;const a=e.split(/\r?\n/).filter((e=>!e.toLowerCase().match(n)||(i=e.toLowerCase().replace(n,"").trim(),!1)));return{alias:i,description:a.join("\n")}})(i.description,n.alias),s=(l=i.paints[0],["GRADIENT_LINEAR","GRADIENT_RADIAL","GRADIENT_ANGULAR","GRADIENT_DIAMOND"].includes(null==l?void 0:l.type));var l;const p=i.paints.length?i.paints.map((e=>(e=>{var t;return"SOLID"===e.type?{fill:{value:A(e),type:"color",blendMode:(null===(t=e.blendMode)||void 0===t?void 0:t.toLowerCase())||"normal"}}:["GRADIENT_LINEAR","GRADIENT_RADIAL","GRADIENT_ANGULAR","GRADIENT_DIAMOND"].includes(e.type)?{gradientType:{value:R[e.type],type:"string"},rotation:{value:T(e.gradientTransform),type:"number",unit:"degree"},stops:e.gradientStops.map((e=>({position:{value:S(e.position),type:"number"},color:{value:I(e.color),type:"color"}}))),opacity:{value:S(e.opacity),type:"number"}}:null})(e))):[E];return[...e,{name:`${s?n.gradient[0]:n.color[0]}/${i.name}`,category:s?"gradient":"color",exportKey:s?c:u,description:r,values:p,extensions:{[t.key.extensionPluginData]:Object.assign({[t.key.extensionFigmaStyleId]:i.id,exportKey:s?c:u},O(o))}}]}),[]),L=(e,n)=>e.filter((e=>e.layoutGrids.length>0)).map((e=>({name:`${n[0]}/${e.name}`,category:"grid",exportKey:g,description:e.description||null,values:e.layoutGrids.map((e=>"GRID"===e.pattern?(e=>({pattern:{value:e.pattern.toLowerCase(),type:"string"},sectionSize:{value:e.sectionSize,unit:"pixel",type:"number"}}))(e):(e=>{return Object.assign(Object.assign(Object.assign({pattern:{value:e.pattern.toLowerCase(),type:"string"}},void 0!==e.sectionSize&&{sectionSize:{value:e.sectionSize,unit:"pixel",type:"number"}}),{gutterSize:{value:e.gutterSize,unit:"pixel",type:"number"},alignment:{value:e.alignment.toLowerCase(),type:"string"},count:(t=e.count,t===1/0?{value:"auto",type:"string"}:{value:t,type:"number"})}),void 0!==e.offset&&{offset:{value:e.offset,unit:"pixel",type:"number"}});var t})(e))),extensions:{[t.key.extensionPluginData]:{[t.key.extensionFigmaStyleId]:e.id,exportKey:g}}}))),C={NONE:"none",UNDERLINE:"underline",STRIKETHROUGH:"line-through"},N={ORIGINAL:"none",UPPER:"uppercase",LOWER:"lowercase",TITLE:"capitalize",SMALL_CAPS:"small-caps"},P={100:100,thin:100,w1:100,200:200,w2:200,extralight:200,ultralight:200,extraleicht:200,300:300,light:300,leicht:300,w3:300,400:400,normal:400,regular:400,buch:400,w4:400,500:500,medium:500,kraeftig:500,kräftig:500,w5:500,600:600,semibold:600,demibold:600,halbfett:600,w6:600,700:700,bold:700,dreiviertelfett:700,w7:700,800:800,extrabold:800,ultabold:800,fett:800,w8:800,900:900,black:900,heavy:900,super:900,extrafett:900,w9:900},D={normal:"normal",condensed:"condensed",expanded:"expanded",extended:"expanded"},_={normal:"normal",italic:"italic",kursiv:"italic",oblique:"oblique"},M=e=>{const t=e.toLowerCase().split(" ");let n=t[0];return["extra","ultra","semi","demi"].includes(t[0])&&["bold","light"].includes(t[1])&&(n=`${t[0]}${t[1]}`),P[n]||400},j=e=>{const t=e.toLowerCase().split(" ");return D[t[t.length-1]]||D[t[t.length-2]]||"normal"},B=e=>{const t=e.toLowerCase().split(" ").pop();return _[t]||"normal"},z=(e,n)=>e.map((e=>({name:`${n[0]}/${e.name}`,category:"font",exportKey:p,description:e.description||void 0,values:{fontSize:{value:e.fontSize,unit:"pixel",type:"number"},textDecoration:{value:C[e.textDecoration],type:"string"},fontFamily:{value:e.fontName.family,type:"string"},fontWeight:{value:M(e.fontName.style),type:"number"},fontStyle:{value:B(e.fontName.style),type:"string"},fontStretch:{value:j(e.fontName.style),type:"string"},_fontStyleOld:{value:e.fontName.style,type:"string"},letterSpacing:{value:S(e.letterSpacing.value),unit:"pixels"===e.letterSpacing.unit.toLowerCase()?"pixel":e.letterSpacing.unit.toLowerCase(),type:"number"},lineHeight:{value:Object.prototype.hasOwnProperty.call(e.lineHeight,"value")?S(e.lineHeight.value):"normal",unit:"pixels"===e.lineHeight.unit.toLowerCase()?"pixel":e.lineHeight.unit.toLowerCase(),type:Object.prototype.hasOwnProperty.call(e.lineHeight,"value")?"number":"string"},paragraphIndent:{value:e.paragraphIndent,unit:"pixel",type:"number"},paragraphSpacing:{value:e.paragraphSpacing,unit:"pixel",type:"number"},textCase:{value:N[e.textCase]||"none",type:"string"}},extensions:{[t.key.extensionPluginData]:{[t.key.extensionFigmaStyleId]:e.id,exportKey:p}}}))),U={LAYER_BLUR:"layerBlur",BACKGROUND_BLUR:"backgroundBlur",DROP_SHADOW:"dropShadow",INNER_SHADOW:"innerShadow"},G=(e,n)=>e.filter((e=>e.effects.length>0)).map((e=>({name:`${n[0]}/${e.name}`,category:"effect",exportKey:d,description:e.description||null,values:e.effects.map((e=>"LAYER_BLUR"===e.type||"BACKGROUND_BLUR"===e.type?(e=>({effectType:{value:U[e.type],type:"string"},radius:{value:e.radius,unit:"pixel",type:"number"}}))(e):(e=>({effectType:{value:U[e.type],type:"string"},radius:{value:e.radius,unit:"pixel",type:"number"},color:{value:I(e.color),type:"color"},offset:{x:{value:e.offset.x,unit:"pixel",type:"number"},y:{value:e.offset.y,unit:"pixel",type:"number"}},spread:{value:e.spread,unit:"pixel",type:"number"}}))(e))),extensions:{[t.key.extensionPluginData]:{[t.key.extensionFigmaStyleId]:e.id,exportKey:d}}}))),K=e=>t=>{if(!Array.isArray(e))return;const n=t.name.substr(0,t.name.indexOf("/")).replace(/\s+/g,"");return 0!==n.length?e.includes(n):void 0},F=e=>{if(Object.prototype.hasOwnProperty.call(e,"direction"))return{direction:{value:e.direction.toLowerCase(),type:"string"}}},$={CUSTOM_CUBIC_BEZIER:{type:"custom-cubicBezier",curveType:"cubicBezier",easing:void 0},CUSTOM_SPRING:{type:"custom-spring",curveType:"spring",easing:void 0},LINEAR:{type:"linear",curveType:"cubicBezier",easing:{x1:0,y1:0,x2:1,y2:1}},EASE_IN:{type:"ease-in",curveType:"cubicBezier",easing:{x1:.41999998688697815,y1:0,x2:1,y2:1}},EASE_OUT:{type:"ease-out",curveType:"cubicBezier",easing:{x1:0,y1:0,x2:.5799999833106995,y2:1}},EASE_IN_AND_OUT:{type:"ease-in-out",curveType:"cubicBezier",easing:{x1:.41999998688697815,y1:0,x2:.5799999833106995,y2:1}},EASE_IN_BACK:{type:"ease-in-back",curveType:"cubicBezier",easing:{x1:.30000001192092896,y1:-.05000000074505806,x2:.699999988079071,y2:-.5}},EASE_OUT_BACK:{type:"ease-out-back",curveType:"cubicBezier",easing:{x1:.44999998807907104,y1:1.4500000476837158,x2:.800000011920929,y2:1}},EASE_IN_AND_OUT_BACK:{type:"ease-in-out-back",curveType:"cubicBezier",easing:{x1:.699999988079071,y1:-.4000000059604645,x2:.4000000059604645,y2:1.399999976158142}},BOUNCY:{type:"bouncy",curveType:"spring",easing:{mass:1,stiffness:600,damping:15}},GENTLE:{type:"gentle",curveType:"spring",easing:{mass:1,stiffness:100,damping:15}},QUICK:{type:"quick",curveType:"spring",easing:{mass:1,stiffness:300,damping:20}},SLOW:{type:"slow",curveType:"spring",easing:{mass:1,stiffness:80,damping:20}}},V=e=>{var t;if("type"in e&&void 0!==$[e.type])return"CUSTOM_CUBIC_BEZIER"===e.type&&($.CUSTOM_CUBIC_BEZIER.easing={x1:e.easingFunctionCubicBezier.x1,y1:e.easingFunctionCubicBezier.y1,x2:e.easingFunctionCubicBezier.x2,y2:e.easingFunctionCubicBezier.y2}),"CUSTOM_SPRING"===e.type&&($.CUSTOM_SPRING.easing={mass:e.easingFunctionSpring.mass,stiffness:e.easingFunctionSpring.stiffness,damping:e.easingFunctionSpring.damping}),{easingType:{value:$[e.type].type,type:"string"},easingCurveType:{value:$[e.type].curveType,type:"string"},easingFunction:(t=$[e.type],"spring"===t.curveType?{mass:{value:t.easing.mass,type:"number"},stiffness:{value:t.easing.stiffness,type:"number"},damping:{value:t.easing.damping,type:"number"}}:"cubicBezier"===t.curveType?{x1:{value:t.easing.x1,type:"number"},x2:{value:t.easing.x2,type:"number"},y1:{value:t.easing.y1,type:"number"},y2:{value:t.easing.y2,type:"number"}}:void 0)}},H=e=>{var t;const n=Object.keys($);return!!(e.reactions.length>0&&"NODE"===(null===(t=e.reactions[0].action)||void 0===t?void 0:t.type)&&null!==e.reactions[0].action.transition&&n.includes(e.reactions[0].action.transition.easing.type))},J=(e,n)=>e.filter(K(n)).filter(H).map((e=>({name:e.name,category:"motion",exportKey:b,description:e.description||null,values:Object.assign(Object.assign({transitionType:{value:e.reactions[0].action.transition.type.toLocaleLowerCase(),type:"string"},duration:{value:Math.round(1e3*(e.reactions[0].action.transition.duration+Number.EPSILON))/1e3,unit:"s",type:"number"}},V(e.reactions[0].action.transition.easing)),F(e.reactions[0].action.transition)),extensions:{[t.key.extensionPluginData]:{exportKey:b}}}))),W=(e,n)=>e.filter(K(n)).map((e=>({name:e.name,category:"spacing",exportKey:x,description:e.description||null,values:{top:{value:S(e.paddingTop,2),unit:"pixel",type:"number"},right:{value:S(e.paddingRight,2),unit:"pixel",type:"number"},bottom:{value:S(e.paddingBottom,2),unit:"pixel",type:"number"},left:{value:S(e.paddingLeft,2),unit:"pixel",type:"number"}},extensions:{[t.key.extensionPluginData]:{exportKey:x}}}))),q={MITER:"miter",BEVEL:"bevel",ROUND:"round"},Q={CENTER:"center",INSIDE:"inside",OUTSIDE:"outside"},Y=(e,n)=>e.filter(K(n)).filter((e=>e.strokes.length>0)).map((e=>({name:e.name,category:"border",exportKey:y,description:e.description||null,values:{strokeAlign:{value:Q[e.strokeAlign],type:"string"},dashPattern:{value:[...void 0!==e.dashPattern&&e.dashPattern.length>0?e.dashPattern:[0,0]],type:"string"},strokeCap:{value:"string"==typeof e.strokeCap?e.strokeCap.toLowerCase():"mixed",type:"string"},strokeJoin:{value:q[e.strokeJoin],type:"string"},strokeMiterLimit:{value:S(e.strokeMiterLimit),unit:"degree",type:"number"},strokeWeight:{value:e.strokeWeight,unit:"pixel",type:"number"},stroke:{value:e.strokes[0],type:"color"}},extensions:{[t.key.extensionPluginData]:{exportKey:y}}}))),Z=(e,n)=>{const i=e=>({topLeft:{value:e.topLeftRadius||0,unit:"pixel",type:"number"},topRight:{value:e.topRightRadius||0,unit:"pixel",type:"number"},bottomRight:{value:e.bottomRightRadius||0,unit:"pixel",type:"number"},bottomLeft:{value:e.bottomLeftRadius||0,unit:"pixel",type:"number"}});return e.filter(K(n)).map((e=>{return{name:e.name,category:"radius",exportKey:f,description:e.description||null,values:Object.assign(Object.assign({},"number"==typeof e.cornerRadius&&{radius:{value:e.cornerRadius,unit:"pixel",type:"number"}}),{radiusType:{value:(n=e.cornerRadius,"number"==typeof n?"single":"mixed"),type:"string"},radii:i(e),smoothing:{value:S(e.cornerSmoothing,2),comment:"Percent as decimal from 0.0 - 1.0",type:"number"}}),extensions:{[t.key.extensionPluginData]:{exportKey:f}}};var n}))},X=(e,n)=>e.filter(K(n)).map((e=>({name:e.name,category:"breakpoint",exportKey:m,description:e.description||null,values:{width:{value:S(e.width,2),unit:"pixel",type:"number"},height:{value:S(e.height,2),unit:"pixel",type:"number"}},extensions:{[t.key.extensionPluginData]:{exportKey:m}}}))),ee=(e,n)=>e.filter(K(n)).map((e=>({name:e.name,category:"opacity",exportKey:h,description:e.description||null,values:{opacity:{value:S(e.opacity,2),type:"number"}},extensions:{[t.key.extensionPluginData]:{exportKey:h}}}))),te=(e,n)=>!(e=>[...t.exclusionPrefixDefault,...e])(n).includes(e.name.trim().substr(0,1)),ne=e=>{const t=[];return e.forEach((e=>{t.push({name:e.name,id:e.id,description:e.description,paints:e.paints})})),t},ie=e=>{const t=[];return e.forEach((e=>{t.push({name:e.name,id:e.id,description:e.description,layoutGrids:e.layoutGrids})})),t},ae=e=>{var t,n;return{name:e.name,description:e.description||void 0,bottomLeftRadius:e.bottomLeftRadius,bottomRightRadius:e.bottomRightRadius,topLeftRadius:e.topLeftRadius,topRightRadius:e.topRightRadius,cornerRadius:e.cornerRadius||void 0,cornerSmoothing:e.cornerSmoothing,strokes:(n=e.strokes,[...n].map((e=>A(e))).filter((e=>null!=e))),strokeWeight:e.strokeWeight,strokeStyleId:e.strokeStyleId,strokeMiterLimit:e.strokeMiterLimit,strokeJoin:e.strokeJoin,strokeCap:e.strokeCap,dashPattern:e.dashPattern,strokeAlign:e.strokeAlign,width:e.width,height:e.height,reactions:e.reactions||void 0,paddingTop:e.paddingTop||0,paddingRight:e.paddingRight||0,paddingBottom:e.paddingBottom||0,paddingLeft:e.paddingLeft||0,opacity:null!==(t=e.opacity)&&void 0!==t?t:1}},oe=["COMPONENT","COMPONENT_SET","RECTANGLE","FRAME"],re="_tokens",se=e=>[...e.map((e=>e.findChildren((e=>(e=>"FRAME"===e.type&&e.name.trim().toLowerCase().substr(0,re.length)===re)(e))))).reduce(((e,t)=>[...e,...t]))].map((e=>e.findAll((e=>(e=>"COMPONENT_SET"!==e.parent.type&&oe.includes(e.type)&&e.name.length>0)(e))))).reduce(((e,t)=>[...e,...t]),[]).map((e=>("RECTANGLE"!==e.type&&"FRAME"!==e.type||console.warn("Please use only main components and variants, other types may be deprecated as tokens in the future"),"COMPONENT_SET"===e.type?e.children.map((t=>{return Object.assign(Object.assign({},ae(t)),{name:(n=e.name,i=t.name,`${n}/${i=i.split(",").filter((e=>!["_","."].includes(e.trim().substr(0,1)))).map((e=>e.split("=")[1])).join("/")}`)});var n,i})):[ae(e)]))).reduce(((e,t)=>[...e,...t]),[]),le=e=>{const t=[];return e.forEach((e=>{t.push({name:e.name,id:e.id,description:e.description,fontSize:e.fontSize,textDecoration:e.textDecoration,fontName:e.fontName,letterSpacing:e.letterSpacing,lineHeight:e.lineHeight,paragraphIndent:e.paragraphIndent,paragraphSpacing:e.paragraphSpacing,textCase:e.textCase})})),t},ue=e=>{const t=[];return e.forEach((e=>{t.push({name:e.name,id:e.id,description:e.description,effects:e.effects})})),t};const ce=(e,t)=>{return n=void 0,i=void 0,o=function*(){const n=se([...e.root.children]),i=t.exclusionPrefix.split(",").map((e=>e.replace(/\s+/g,"")));return{tokenFrames:n,paintStyles:ne(yield e.getLocalPaintStylesAsync()).filter((e=>te(e,i))),gridStyles:ie(yield e.getLocalGridStylesAsync()).filter((e=>te(e,i))),textStyles:le(yield e.getLocalTextStylesAsync()).filter((e=>te(e,i))),effectStyles:ue(yield e.getLocalEffectStylesAsync()).filter((e=>te(e,i)))}},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof a?n:new a((function(e){e(n)}))).then(r,s)}l((o=o.apply(n,i||[])).next())}));var n,i,a,o},pe=e=>"boolean"==typeof e?"string":"number"==typeof e?"dimension":"object"==typeof e?"color":"string"==typeof e?"string":void 0,de=(e,t="/",n=".")=>e.split(t).join(n).toLowerCase();const ge=function(e,t,n,i=!1){return a=this,o=void 0,s=function*(){const a=yield figma.variables.getVariableByIdAsync(t.id),o=yield figma.variables.getVariableCollectionByIdAsync(a.variableCollectionId);return{description:e.description||"",exportKey:k,category:pe(Object.values(a.valuesByMode)[0]),values:`{${o.name.toLowerCase()}.${de(a.name,"/",".")}}`,aliasCollectionName:o.name.toLowerCase(),aliasMode:n,aliasSameMode:e.aliasSameMode||i}},new((r=void 0)||(r=Promise))((function(e,t){function n(e){try{l(s.next(e))}catch(e){t(e)}}function i(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var a;t.done?e(t.value):(a=t.value,a instanceof r?a:new r((function(e){e(a)}))).then(n,i)}l((s=s.apply(a,o||[])).next())}));var a,o,r,s},ye=e=>e.reduce(((e,t)=>{if(!t.aliasMode)return e.push(t),e;const{aliasMode:n,aliasCollectionName:i}=t;return e.push(Object.assign(Object.assign({},t),{values:t.values.replace(`{${i}.`,`{${i}.${n.name.toLowerCase()}.`)})),e}),[]),me=(e,t)=>{const n=e=>e&&"object"==typeof e;return n(e)&&n(t)?(Object.keys(t).forEach((i=>{const a=e[i],o=t[i];Array.isArray(a)&&Array.isArray(o)?e[i]=a.concat(o):n(a)&&n(o)?e[i]=me(Object.assign({},a),o):e[i]=o})),e):t},fe=me;var ve=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const xe=(e,t)=>{var n;let i={};return t&&(null===(n=null==e?void 0:e.modes)||void 0===n||n.forEach((n=>{const a=t.valuesByMode[n.modeId];e.variableIds.forEach((e=>ve(void 0,void 0,void 0,(function*(){const o=yield figma.variables.getVariableByIdAsync(e);o&&a&&"object"==typeof a&&t.name!==o.name&&a.id===o.id&&(i=ge(t,a,n,!0))}))))}))),fe(t,i)},be=(e,n)=>ve(void 0,void 0,void 0,(function*(){var i;const a=yield e.variables.getLocalVariableCollectionsAsync(),o=yield e.variables.getLocalVariablesAsync(),r=null==a?void 0:a.filter((e=>![".","_",...n.exclusionPrefix.split(",")].includes(e.name.charAt(0)))).map((e=>e.id)),s=a?Object.fromEntries(null==a?void 0:a.map((e=>[e.id,e]))):[],l=(null===(i=null==o?void 0:o.filter((e=>r.includes(e.variableCollectionId))))||void 0===i?void 0:i.map((e=>{var i;const{variableCollectionId:a}=e,{name:o,modes:r}=s[a];return n.resolveSameCollectionOrModeReference&&(e=xe(s[a],e)),null===(i=Object.entries(e.valuesByMode))||void 0===i?void 0:i.map((([i,a])=>{const s=n.modeInTokenName&&r.length>1,l=r.find((({modeId:e})=>e===i)),u=`${o}/${e.name}`,c=`${o}/${l.name}/${e.name}`;return Object.assign(Object.assign({},((e,t,n)=>{let i="color",a={};if("VARIABLE_ALIAS"===t.type)return ge(e,t,n);switch(e.resolvedType){case"COLOR":i="color",a={fill:{value:I(t),type:"color",blendMode:"normal"}};break;case"FLOAT":i="dimension",a=S(t,2);break;case"STRING":i="string",a=t;break;case"BOOLEAN":i="boolean",a=t}return{name:e.name,description:e.description||void 0,exportKey:k,category:i,values:a}})(e,a,l)),{name:s?c:u,extensions:{[t.key.extensionPluginData]:{mode:n.modeInTokenValue?l.name:void 0,collection:o,scopes:e.scopes,[t.key.extensionVariableStyleId]:e.id,exportKey:k}}})}))})))||[];return n.modeInTokenValue?ye(l.flat()):l.flat().map((e=>(null==e?void 0:e.aliasSameMode)?ye([e]):e)).flat()}));const he=(e="")=>e.split(",").map((e=>e.replace(/\s+/g,"")));var ke=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};figma.showUI(__html__,{themeColors:!0,visible:!1}),[o.export,o.urlExport,o.generalSettings].includes(figma.command)&&ke(void 0,void 0,void 0,(function*(){const r=(()=>{let n=figma.root.getPluginData(t.key.settings);if(""===n)return e;n=JSON.parse(n);const a=i(e,n);return a.prefix=i(e.prefix,a.prefix),a.exports=i(e.exports,a.exports),a})(),u=yield s(figma);figma.ui.resize(t.ui[figma.command].width,t.ui[figma.command].height),void 0!==u&&"patch"!==u&&figma.ui.resize(t.ui[figma.command].width,t.ui[figma.command].height+60);const c={command:figma.command,payload:{settings:Object.assign(Object.assign({},r),{accessToken:yield(p=l(figma),a(void 0,void 0,void 0,(function*(){const e=yield figma.clientStorage.getAsync("accessTokens");return void 0!==e&&e instanceof Object&&e[p]||""})))}),data:null,versionDifference:u,metadata:{filename:figma.root.name}}};var p;[o.export,o.urlExport].includes(figma.command)&&(c.payload.data=n(((e,n)=>{return i=void 0,a=void 0,r=function*(){const i=yield ce(e,n);return[...(a=null==i?void 0:i.tokenFrames,o=he(n.prefix.size),a.filter(K(o)).map((e=>({name:e.name,category:"size",exportKey:v,description:e.description||null,values:{width:{value:S(e.width,2),unit:"pixel",type:"number"},height:{value:S(e.height,2),unit:"pixel",type:"number"}},extensions:{[t.key.extensionPluginData]:{exportKey:v}}})))),...X(null==i?void 0:i.tokenFrames,he(n.prefix.breakpoint)),...W(null==i?void 0:i.tokenFrames,he(n.prefix.spacing)),...Y(null==i?void 0:i.tokenFrames,he(n.prefix.border)),...Z(null==i?void 0:i.tokenFrames,he(n.prefix.radius)),...J(null==i?void 0:i.tokenFrames,he(n.prefix.motion)),...ee(null==i?void 0:i.tokenFrames,he(n.prefix.opacity)),...w(null==i?void 0:i.paintStyles,{color:he(n.prefix.color),gradient:he(n.prefix.gradient),alias:he(n.alias)}),...L(null==i?void 0:i.gridStyles,he(n.prefix.grid)),...z(null==i?void 0:i.textStyles,he(n.prefix.font)),...G(null==i?void 0:i.effectStyles,he(n.prefix.effect)),...yield be(e,n)];var a,o},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{l(r.next(e))}catch(e){t(e)}}function s(e){try{l(r.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(n,s)}l((r=r.apply(i,a||[])).next())}));var i,a,o,r})(figma,r))),figma.ui.postMessage(Object.assign({},c)),figma.ui.show()})),figma.command===o.help&&figma.ui.postMessage({command:o.help,payload:{url:"https://github.com/lukasoppermann/design-tokens"}}),figma.command===o.demo&&figma.ui.postMessage({command:o.demo,payload:{url:"https://www.figma.com/file/2MQ759R5kJtzQn4qSHuqR7/Design-Tokens-for-Figma?node-id=231%3A2"}}),figma.command===o.reset&&(figma.root.setPluginData(t.key.settings,n(e)),figma.notify("⚙️ Settings have been reset."),figma.closePlugin()),figma.ui.onmessage=i=>ke(void 0,void 0,void 0,(function*(){const{command:r,payload:s}=i;var u,c,p;r===o.closePlugin&&(void 0!==(null==s?void 0:s.notification)&&""!==(null==s?void 0:s.notification)&&figma.notify(s.notification),figma.ui.hide(),figma.closePlugin()),r===o.saveSettings&&(p=s.settings,p=Object.assign(Object.assign({},e),p),figma.root.setPluginData(t.key.settings,n(p)),yield(u=l(figma),c=s.accessToken,a(void 0,void 0,void 0,(function*(){const e=(yield figma.clientStorage.getAsync("accessTokens"))||{},t=Object.assign(Object.assign({},e),{[u]:c});return yield figma.clientStorage.setAsync("accessTokens",t)}))),s.closePlugin&&!0===s.closePlugin&&figma.closePlugin())}))})(); \ No newline at end of file diff --git a/dist/ui.html b/dist/ui.html index dc3a7ea1..96ec6a62 100644 --- a/dist/ui.html +++ b/dist/ui.html @@ -651,7 +651,7 @@ margin-right: var(--size-xxsmall); margin-left: var(--size-xxxsmall); } -`,kt=({versionDifference:n})=>"major"!==n&&"minor"!==n?e.createElement(e.Fragment,null):e.createElement("div",{id:"versionNotice",className:wt},e.createElement("div",{className:"icon"},"🎉"),e.createElement("div",null,"The ",e.createElement("a",{className:"subtle",href:"https://www.figma.com/community/plugin/888356646278934516/Design-Tokens",target:"_blank",rel:"noreferrer"},"Design Token plugin")," was updated.",e.createElement("br",null),"Find out about changes & new features in the ",e.createElement("a",{href:"https://github.com/lukasoppermann/design-tokens/releases",target:"_blank",rel:"noreferrer"},"release notes →"))),Et={filename:"design-tokens",extension:".tokens.json",nameConversion:"default",tokenFormat:"standard",compression:!1,urlJsonCompression:!0,serverUrl:void 0,eventType:"update-tokens",accessToken:void 0,acceptHeader:"application/vnd.github.everest-preview+json",contentType:"text/plain;charset=UTF-8",authType:"token",reference:"main",exclusionPrefix:"",excludeExtensionProp:!1,alias:"alias, ref, reference",keyInName:!1,prefixInName:!0,modeInTokenValue:!1,modeInTokenName:!1,resolveSameCollectionOrModeReference:!1,prefix:{color:"color",gradient:"gradient",typography:"typography",font:"font",effect:"effect",grid:"grid",border:"border, borders",breakpoint:"breakpoint, breakpoints",radius:"radius, radii",size:"size, sizes",spacing:"spacing",motion:"motion",opacity:"opacity, opacities"},exports:{color:!0,gradient:!0,font:!0,typography:!0,effect:!0,grid:!0,border:!0,breakpoint:!0,radius:!0,size:!0,spacing:!0,motion:!0,opacity:!0,variables:!0}};function zt(e,n){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var t=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===n?e:Math.min(n,Math.max(0,parseFloat(e))),t&&(e=parseInt(String(e*n),10)/100),Math.abs(e-n)<1e-6?1:e=360===n?(e<0?e%n+n:e%n)/parseFloat(String(n)):e%n/parseFloat(String(n))}function Ct(e){return Math.min(1,Math.max(0,e))}function St(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function _t(e){return e<=1?"".concat(100*Number(e),"%"):e}function Mt(e){return 1===e.length?"0"+e:String(e)}function Pt(e,n,t){e=zt(e,255),n=zt(n,255),t=zt(t,255);var r=Math.max(e,n,t),a=Math.min(e,n,t),l=0,o=0,i=(r+a)/2;if(r===a)o=0,l=0;else{var s=r-a;switch(o=i>.5?s/(2-r-a):s/(r+a),r){case e:l=(n-t)/s+(n1&&(t-=1),t<1/6?e+6*t*(n-e):t<.5?n:t<2/3?e+(n-e)*(2/3-t)*6:e}function At(e,n,t){e=zt(e,255),n=zt(n,255),t=zt(t,255);var r=Math.max(e,n,t),a=Math.min(e,n,t),l=0,o=r,i=r-a,s=0===r?0:i/r;if(r===a)l=0;else{switch(r){case e:l=(n-t)/i+(n>16,g:(65280&e)>>8,b:255&e}}(n)),this.originalInput=n;var a=function(e){var n={r:0,g:0,b:0},t=1,r=null,a=null,l=null,o=!1,i=!1;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var n=!1;if(Ft[e])e=Ft[e],n=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var t=Dt.rgb.exec(e);return t?{r:t[1],g:t[2],b:t[3]}:(t=Dt.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Dt.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=Dt.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Dt.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=Dt.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Dt.hex8.exec(e))?{r:Tt(t[1]),g:Tt(t[2]),b:Tt(t[3]),a:Nt(t[4]),format:n?"name":"hex8"}:(t=Dt.hex6.exec(e))?{r:Tt(t[1]),g:Tt(t[2]),b:Tt(t[3]),format:n?"name":"hex"}:(t=Dt.hex4.exec(e))?{r:Tt(t[1]+t[1]),g:Tt(t[2]+t[2]),b:Tt(t[3]+t[3]),a:Nt(t[4]+t[4]),format:n?"name":"hex8"}:!!(t=Dt.hex3.exec(e))&&{r:Tt(t[1]+t[1]),g:Tt(t[2]+t[2]),b:Tt(t[3]+t[3]),format:n?"name":"hex"}}(e)),"object"==typeof e&&($t(e.r)&&$t(e.g)&&$t(e.b)?(n=function(e,n,t){return{r:255*zt(e,255),g:255*zt(n,255),b:255*zt(t,255)}}(e.r,e.g,e.b),o=!0,i="%"===String(e.r).substr(-1)?"prgb":"rgb"):$t(e.h)&&$t(e.s)&&$t(e.v)?(r=_t(e.s),a=_t(e.v),n=function(e,n,t){e=6*zt(e,360),n=zt(n,100),t=zt(t,100);var r=Math.floor(e),a=e-r,l=t*(1-n),o=t*(1-a*n),i=t*(1-(1-a)*n),s=r%6;return{r:255*[t,o,l,l,i,t][s],g:255*[i,t,t,o,l,l][s],b:255*[l,l,i,t,t,o][s]}}(e.h,r,a),o=!0,i="hsv"):$t(e.h)&&$t(e.s)&&$t(e.l)&&(r=_t(e.s),l=_t(e.l),n=function(e,n,t){var r,a,l;if(e=zt(e,360),n=zt(n,100),t=zt(t,100),0===n)a=t,l=t,r=t;else{var o=t<.5?t*(1+n):t+n-t*n,i=2*t-o;r=Ot(i,o,e+1/3),a=Ot(i,o,e),l=Ot(i,o,e-1/3)}return{r:255*r,g:255*a,b:255*l}}(e.h,r,l),o=!0,i="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(t=e.a)),t=St(t),{ok:o,format:e.format||i,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:t}}(n);this.originalInput=n,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(r=t.format)&&void 0!==r?r:a.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=a.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),n=e.r/255,t=e.g/255,r=e.b/255;return.2126*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=St(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var e=At(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=At(this.r,this.g,this.b),n=Math.round(360*e.h),t=Math.round(100*e.s),r=Math.round(100*e.v);return 1===this.a?"hsv(".concat(n,", ").concat(t,"%, ").concat(r,"%)"):"hsva(".concat(n,", ").concat(t,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=Pt(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=Pt(this.r,this.g,this.b),n=Math.round(360*e.h),t=Math.round(100*e.s),r=Math.round(100*e.l);return 1===this.a?"hsl(".concat(n,", ").concat(t,"%, ").concat(r,"%)"):"hsla(".concat(n,", ").concat(t,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),Lt(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),function(e,n,t,r,a){var l=[Mt(Math.round(e).toString(16)),Mt(Math.round(n).toString(16)),Mt(Math.round(t).toString(16)),Mt(Rt(r))];return a&&l[0].startsWith(l[0].charAt(1))&&l[1].startsWith(l[1].charAt(1))&&l[2].startsWith(l[2].charAt(1))&&l[3].startsWith(l[3].charAt(1))?l[0].charAt(0)+l[1].charAt(0)+l[2].charAt(0)+l[3].charAt(0):l.join("")}(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),n=Math.round(this.g),t=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(n,", ").concat(t,")"):"rgba(".concat(e,", ").concat(n,", ").concat(t,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*zt(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*zt(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+Lt(this.r,this.g,this.b,!1),n=0,t=Object.entries(Ft);n=0;return n||!r||!e.startsWith("hex")&&"name"!==e?("rgb"===e&&(t=this.toRgbString()),"prgb"===e&&(t=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(t=this.toHexString()),"hex3"===e&&(t=this.toHexString(!0)),"hex4"===e&&(t=this.toHex8String(!0)),"hex8"===e&&(t=this.toHex8String()),"name"===e&&(t=this.toName()),"hsl"===e&&(t=this.toHslString()),"hsv"===e&&(t=this.toHsvString()),t||this.toHexString()):"name"===e&&0===this.a?this.toName():this.toRgbString()},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(n){void 0===n&&(n=10);var t=this.toHsl();return t.l+=n/100,t.l=Ct(t.l),new e(t)},e.prototype.brighten=function(n){void 0===n&&(n=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(-n/100*255))),t.g=Math.max(0,Math.min(255,t.g-Math.round(-n/100*255))),t.b=Math.max(0,Math.min(255,t.b-Math.round(-n/100*255))),new e(t)},e.prototype.darken=function(n){void 0===n&&(n=10);var t=this.toHsl();return t.l-=n/100,t.l=Ct(t.l),new e(t)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(n){void 0===n&&(n=10);var t=this.toHsl();return t.s-=n/100,t.s=Ct(t.s),new e(t)},e.prototype.saturate=function(n){void 0===n&&(n=10);var t=this.toHsl();return t.s+=n/100,t.s=Ct(t.s),new e(t)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(n){var t=this.toHsl(),r=(t.h+n)%360;return t.h=r<0?360+r:r,new e(t)},e.prototype.mix=function(n,t){void 0===t&&(t=50);var r=this.toRgb(),a=new e(n).toRgb(),l=t/100;return new e({r:(a.r-r.r)*l+r.r,g:(a.g-r.g)*l+r.g,b:(a.b-r.b)*l+r.b,a:(a.a-r.a)*l+r.a})},e.prototype.analogous=function(n,t){void 0===n&&(n=6),void 0===t&&(t=30);var r=this.toHsl(),a=360/t,l=[this];for(r.h=(r.h-(a*n>>1)+720)%360;--n;)r.h=(r.h+a)%360,l.push(new e(r));return l},e.prototype.complement=function(){var n=this.toHsl();return n.h=(n.h+180)%360,new e(n)},e.prototype.monochromatic=function(n){void 0===n&&(n=6);for(var t=this.toHsv(),r=t.h,a=t.s,l=t.v,o=[],i=1/n;n--;)o.push(new e({h:r,s:a,v:l})),l=(l+i)%1;return o},e.prototype.splitcomplement=function(){var n=this.toHsl(),t=n.h;return[this,new e({h:(t+72)%360,s:n.s,l:n.l}),new e({h:(t+216)%360,s:n.s,l:n.l})]},e.prototype.onBackground=function(n){var t=this.toRgb(),r=new e(n).toRgb();return new e({r:r.r+(t.r-r.r)*t.a,g:r.g+(t.g-r.g)*t.a,b:r.b+(t.b-r.b)*t.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(n){for(var t=this.toHsl(),r=t.h,a=[this],l=360/n,o=1;o`rgba(${e.r}, ${e.g}, ${e.b}, ${e.a})`,Bt=e=>{return(n=Vt(e),void 0===n&&(n=""),void 0===t&&(t={}),new Ht(n,t)).toHex8String();var n,t},Wt=({width:e})=>Object.assign({value:e.value,type:e.type},void 0!==e.unit&&{unit:e.unit}),qt=(e,n)=>{if(null!=e)return"color"===n?Vt(e):e},Qt=e=>Object.assign(Object.assign({value:qt(e.value,e.type),type:e.type},void 0!==e.description&&{comment:e.description}),void 0!==e.unit&&{unit:e.unit}),Gt=e=>{Array.isArray(e)&&1===e.length&&(e=e[0]);const n={};return Object.keys(e).forEach((function(t){Object.prototype.hasOwnProperty.call(e[t],"value")?n[t]=Qt(e[t]):n[t]=Gt(e[t])})),1===Object.keys(n).length?Object.values(n)[0]:n},Kt={size:Wt,color:Gt,gradient:Gt,font:Gt,effect:e=>{const n=e.map((e=>["dropShadow","innerShadow"].includes(e.effectType.value)?(e=>({type:{value:e.effectType.value,type:"string"},radius:{value:e.radius.value,type:"number",unit:"pixel"},color:{value:Vt(e.color.value),type:"color"},offset:{x:{value:e.offset.x.value,type:"number",unit:"pixel"},y:{value:e.offset.y.value,type:"number",unit:"pixel"}},spread:{value:e.spread.value,type:"number",unit:"pixel"}}))(e):(e=>({type:{value:e.effectType.value,type:"string"},radius:{value:e.radius.value,type:"number",unit:"pixel"}}))(e)));return Array.isArray(n)&&1===n.length?n[0]:n},grid:Gt,border:e=>Object.fromEntries(Object.entries(e).map((([e,n])=>{if("dashPattern"===e){const t=Qt(n);return t.value=t.value.join(", "),[e,t]}return[e,Qt(n)]}))),breakpoint:Wt,radius:Gt,spacing:Gt,motion:e=>Object.assign(Object.assign({type:{value:e.transitionType.value,type:"string"},duration:{value:e.duration.value,type:"number",unit:"s"}},e.direction?{direction:{value:e.direction.value,type:"string"}}:{}),{easing:{value:e.easingType.value.replace("cubicBezier","cubic-bezier"),type:"string"},easingFunction:e.easingFunction}),opacity:({opacity:e})=>({value:e.value,type:e.type})},Yt=(e,n=2)=>{if(void 0===e)return;if("number"!=typeof e||"number"!=typeof n)throw new Error(`Invalid parameters, both value "${e}" (${typeof e}) and decimalPlaces "${n}" (${typeof n}) must be of type number`);const t=Math.pow(10,n);return Math.round(e*t)/t},Xt=(e,{excludeExtensionProp:n})=>{if(!0!==n)return{extensions:Object.assign({},e.extensions)}},Zt=(e,n="/",t=".")=>e.split(n).join(t).toLowerCase(),Jt=e=>"pixel"===e.lineHeight.unit?Yt(e.lineHeight.value,3):"percent"===e.lineHeight.unit?Yt(e.fontSize.value*(e.lineHeight.value/100),3):Yt(1.2*e.fontSize.value,3),er=e=>"pixel"===e.letterSpacing.unit?Yt(e.letterSpacing.value,3):"percent"===e.letterSpacing.unit?Yt(e.fontSize.value*(e.letterSpacing.value/100),3):void 0,nr=({values:e})=>({value:e.width.value,type:"dimension"}),tr=({values:e})=>({type:"typography",value:{fontSize:e.fontSize.value.toString(),textDecoration:e.textDecoration.value,fontFamily:e.fontFamily.value,fontWeight:e.fontWeight.value.toString(),fontStyle:e.fontStyle.value,fontStretch:e.fontStretch.value,letterSpacing:er(e).toString(),lineHeight:Jt(e).toString(),paragraphIndent:e.paragraphIndent.value.toString(),paragraphSpacing:e.paragraphSpacing.value.toString(),textCase:e.textCase.value}}),rr=e=>{var n,t,r;if(e.extensions&&e.extensions[cn.key.extensionPluginData]&&e.extensions[cn.key.extensionPluginData].alias)return{type:Object.hasOwnProperty.call(e.values[0],"fill")?"color":"custom-gradient",value:`{${e.extensions[cn.key.extensionPluginData].alias}}`,blendMode:(null===(r=null===(t=null===(n=e.values[0])||void 0===n?void 0:n.fill)||void 0===t?void 0:t.blendMode)||void 0===r?void 0:r.toLowerCase())||"normal"};const a=e.values.map((e=>Object.hasOwnProperty.call(e,"fill")?(({fill:e})=>{var n;return{type:"color",value:Bt(e.value),blendMode:(null===(n=e.blendMode)||void 0===n?void 0:n.toLowerCase())||"normal"}})(e):(({gradientType:e,rotation:n,stops:t,opacity:r})=>({type:"custom-gradient",value:{gradientType:e.value,rotation:n.value,stops:t.map((e=>({position:e.position.value,color:Bt(Object.assign(Object.assign({},e.color.value),{a:e.color.value.a*r.value}))})))}}))(e)));return 1===a.length?a[0]:Object.assign({},a)},ar={size:nr,color:rr,gradient:rr,font:({values:e})=>({type:"custom-fontStyle",value:{fontSize:e.fontSize.value,textDecoration:e.textDecoration.value,fontFamily:e.fontFamily.value,fontWeight:e.fontWeight.value,fontStyle:e.fontStyle.value,fontStretch:e.fontStretch.value,letterSpacing:er(e),lineHeight:Jt(e),paragraphIndent:e.paragraphIndent.value,paragraphSpacing:e.paragraphSpacing.value,textCase:e.textCase.value}}),effect:({values:e})=>{const n=e.map((e=>{return["dropShadow","innerShadow"].includes(e.effectType.value)?{type:"custom-shadow",value:{shadowType:(n=e).effectType.value,radius:n.radius.value,color:Bt(n.color.value),offsetX:n.offset.x.value,offsetY:n.offset.y.value,spread:n.spread.value}}:null;var n}));return 1===n.length?n[0]:Object.assign({},n)},grid:({values:e})=>{const n=e.map((e=>({type:"custom-grid",value:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({pattern:e.pattern.value},e.sectionSize?{sectionSize:e.sectionSize.value}:{}),e.gutterSize?{gutterSize:e.gutterSize.value}:{}),e.alignment?{alignment:e.alignment.value}:{}),e.count?{count:e.count.value}:{}),e.offset?{offset:e.offset.value}:{})})));return 1===n.length?n[0]:Object.assign({},n)},border:({values:e})=>({type:"custom-stroke",value:{align:e.strokeAlign.value,dashPattern:e.dashPattern.value,lineCap:e.strokeCap.value,lineJoin:e.strokeJoin.value,miterLimit:e.strokeMiterLimit.value,weight:e.strokeWeight.value,color:Bt(e.stroke.value)}}),breakpoint:nr,radius:({values:e})=>({type:"custom-radius",value:{smoothing:e.smoothing.value,topLeft:e.radii.topLeft.value,topRight:e.radii.topRight.value,bottomLeft:e.radii.bottomLeft.value,bottomRight:e.radii.bottomRight.value}}),spacing:({values:e})=>({type:"custom-spacing",value:{top:e.top.value,bottom:e.bottom.value,left:e.left.value,right:e.right.value}}),motion:({values:e})=>({type:"custom-transition",value:Object.assign(Object.assign({transitionType:e.transitionType.value,duration:e.duration.value},e.direction?{direction:e.direction.value}:{}),{easingType:e.easingCurveType.value,easingFunction:Object.fromEntries(Object.entries(e.easingFunction).map((([e,n])=>[e,n.value])))})}),opacity:({values:e})=>({value:e.opacity.value,type:"custom-opacity"})},lr=(e,n)=>"typography"===e.category?{name:e.name,description:e.description,value:tr(e),type:"typography"}:"variables"===e.extensions[cn.key.extensionPluginData].exportKey?Object.assign(Object.assign({name:e.name,description:e.description},(({values:e,category:n})=>{var t;return/^{[^{}]*}$/.test(e)?{type:n,value:Zt(e,"/",".")}:"color"===n?{type:"color",value:Bt(e.fill.value),blendMode:(null===(t=e.fill.blendMode)||void 0===t?void 0:t.toLowerCase())||"normal"}:["dimension","boolean","string"].includes(n)?{type:n,value:e}:void 0})(e)),Xt(e,n)):Object.assign(Object.assign({name:e.name,description:e.description},(e=>ar[e.category](e))(e)),Xt(e,n)),or=(e,n)=>{const t=e=>e&&"object"==typeof e;return t(e)&&t(n)?(Object.keys(n).forEach((r=>{const a=e[r],l=n[r];Array.isArray(a)&&Array.isArray(l)?e[r]=a.concat(l):t(a)&&t(l)?e[r]=or(Object.assign({},a),l):e[r]=l})),e):n},ir=or,sr=(e,n,t)=>{if("string"==typeof e&&""!==e)return e;throw new Error(`converting "${n}" to ${t}, resulting in "${e}"`)},ur=(e,n="default")=>"camelCase"===n?(e=>{const n=e.toLowerCase().replace(/['"]/g,"").replace(/([-_ ]){1,}/g," ").replace(/\W+/g," ").trim().replace(/ (.)/g,(function(e){return e.toUpperCase()})).replace(/ /g,"");return sr(n,e,"camelCase")})(e):"kebabCase"===n?(e=>{const n=e.toLowerCase().replace(/['"]/g,"").replace(/([-_ ]){1,}/g," ").replace(/\W+/g," ").trim().replace(/ /g,"-");return sr(n,e,"kebabCase")})(e):e.trim().toLowerCase(),cr={color:{label:"Colors",key:"color"},gradient:{label:"Gradients",key:"gradient"},font:{label:"Font Styles",key:"font"},typography:{label:"Typography",key:"typography",exclude:["original"]},effect:{label:"Effects",key:"effect"},grid:{label:"Grids",key:"grid"},border:{label:"Borders",key:"border"},breakpoint:{label:"Breakpoints",key:"breakpoint"},radius:{label:"Radii",key:"radius"},size:{label:"Sizes",key:"size"},spacing:{label:"Spacing",key:"spacing"},motion:{label:"Motion",key:"motion"},opacity:{label:"Opacity",key:"opacity"},variables:{label:"Figma Variables (BETA)",key:"variables",exclude:["original"]}},dr=e=>{var n,t;return void 0!==(null===(t=null===(n=e.extensions)||void 0===n?void 0:n[cn.key.extensionPluginData])||void 0===t?void 0:t.exportKey)?e.extensions[cn.key.extensionPluginData].exportKey:"missingExportKey"},fr={original:e=>"variables"===e.extensions[cn.key.extensionPluginData].exportKey?null:Object.assign(Object.assign({name:e.name,category:e.category,exportKey:e.extensions[cn.key.extensionPluginData].exportKey},e.description&&e.description.length>0&&{comment:e.description}),Kt[e.category](e.values)||{}),standard:lr,standardDeprecated:lr},pr=(e,n)=>"standard"===n.tokenFormat?JSON.parse(JSON.stringify(e.filter((e=>e.category===cr.font.key)))).map((e=>(e.name="typography/"+e.name.substr(e.name.indexOf("/")+1).trim().trimStart(),e.category=cr.typography.key,e.exportKey=cr.typography.key,!0!==n.excludeExtensionProp&&(e.extensions[cn.key.extensionPluginData].exportKey=cr.typography.key),e))):[],gr=(e,n)=>{0===e.length&&(e="[{}]");let t=JSON.parse(e);t=[...t,...pr(t,n)];const r=((e,n)=>e.length<=0?[]:e.map((e=>{var t,r,a,l;if(!1===n.prefixInName&&"variables"!==e.exportKey)e.name=e.name.substr(e.name.indexOf("/")+1).trim().trimLeft();else if(void 0!==(null===(r=null===(t=e.extensions)||void 0===t?void 0:t[cn.key.extensionPluginData])||void 0===r?void 0:r.alias)){const n=e.name.substr(0,e.name.indexOf("/")).trim().trimLeft();e.extensions[cn.key.extensionPluginData].alias=`${n}.${e.extensions[cn.key.extensionPluginData].alias}`}return n.keyInName&&(e.name=`${dr(e)}/${e.name}`,void 0!==(null===(l=null===(a=e.extensions)||void 0===a?void 0:a[cn.key.extensionPluginData])||void 0===l?void 0:l.alias)&&(e.extensions[cn.key.extensionPluginData].alias=`${dr(e)}.${e.extensions[cn.key.extensionPluginData].alias}`)),e})))(t.filter((({exportKey:e})=>n.exports[e])),n),a=r.map((e=>fr[n.tokenFormat](e,n))).filter(Boolean),l=((e,n)=>{if(e.length<=0)return[];const t=e.map((e=>{const t=e.name.split("/").map((e=>ur(e,n.nameConversion)));return delete e.name,r=e,t.reduceRight(((e,n)=>({[n]:e})),r);var r}));return t.reduce(((e={},n)=>ir(e,n)))})(a,n);return l},hr=(e,n=!0)=>!0===n?JSON.stringify(e):JSON.stringify(e,null,2);var mr=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a"major"!==n&&"minor"!==n?e.createElement(e.Fragment,null):e.createElement("div",{id:"versionNotice",className:wt},e.createElement("div",{className:"icon"},"🎉"),e.createElement("div",null,"The ",e.createElement("a",{className:"subtle",href:"https://www.figma.com/community/plugin/888356646278934516/Design-Tokens",target:"_blank",rel:"noreferrer"},"Design Token plugin")," was updated.",e.createElement("br",null),"Find out about changes & new features in the ",e.createElement("a",{href:"https://github.com/lukasoppermann/design-tokens/releases",target:"_blank",rel:"noreferrer"},"release notes →"))),Et={filename:"design-tokens",extension:".tokens.json",nameConversion:"default",tokenFormat:"standard",compression:!1,urlJsonCompression:!0,serverUrl:void 0,eventType:"update-tokens",accessToken:void 0,acceptHeader:"application/vnd.github.everest-preview+json",contentType:"text/plain;charset=UTF-8",authType:"token",reference:"main",exclusionPrefix:"",excludeExtensionProp:!1,alias:"alias, ref, reference",keyInName:!1,prefixInName:!0,modeInTokenValue:!1,modeInTokenName:!1,resolveSameCollectionOrModeReference:!1,prefix:{color:"color",gradient:"gradient",typography:"typography",font:"font",effect:"effect",grid:"grid",border:"border, borders",breakpoint:"breakpoint, breakpoints",radius:"radius, radii",size:"size, sizes",spacing:"spacing",motion:"motion",opacity:"opacity, opacities"},exports:{color:!0,gradient:!0,font:!0,typography:!0,effect:!0,grid:!0,border:!0,breakpoint:!0,radius:!0,size:!0,spacing:!0,motion:!0,opacity:!0,variables:!0}};function zt(e,n){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var t=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===n?e:Math.min(n,Math.max(0,parseFloat(e))),t&&(e=parseInt(String(e*n),10)/100),Math.abs(e-n)<1e-6?1:e=360===n?(e<0?e%n+n:e%n)/parseFloat(String(n)):e%n/parseFloat(String(n))}function Ct(e){return Math.min(1,Math.max(0,e))}function St(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function _t(e){return e<=1?"".concat(100*Number(e),"%"):e}function Mt(e){return 1===e.length?"0"+e:String(e)}function Pt(e,n,t){e=zt(e,255),n=zt(n,255),t=zt(t,255);var r=Math.max(e,n,t),a=Math.min(e,n,t),l=0,o=0,i=(r+a)/2;if(r===a)o=0,l=0;else{var s=r-a;switch(o=i>.5?s/(2-r-a):s/(r+a),r){case e:l=(n-t)/s+(n1&&(t-=1),t<1/6?e+6*t*(n-e):t<.5?n:t<2/3?e+(n-e)*(2/3-t)*6:e}function At(e,n,t){e=zt(e,255),n=zt(n,255),t=zt(t,255);var r=Math.max(e,n,t),a=Math.min(e,n,t),l=0,o=r,i=r-a,s=0===r?0:i/r;if(r===a)l=0;else{switch(r){case e:l=(n-t)/i+(n>16,g:(65280&e)>>8,b:255&e}}(n)),this.originalInput=n;var a=function(e){var n={r:0,g:0,b:0},t=1,r=null,a=null,l=null,o=!1,i=!1;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var n=!1;if(Ft[e])e=Ft[e],n=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var t=Dt.rgb.exec(e);return t?{r:t[1],g:t[2],b:t[3]}:(t=Dt.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Dt.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=Dt.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Dt.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=Dt.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Dt.hex8.exec(e))?{r:Tt(t[1]),g:Tt(t[2]),b:Tt(t[3]),a:Nt(t[4]),format:n?"name":"hex8"}:(t=Dt.hex6.exec(e))?{r:Tt(t[1]),g:Tt(t[2]),b:Tt(t[3]),format:n?"name":"hex"}:(t=Dt.hex4.exec(e))?{r:Tt(t[1]+t[1]),g:Tt(t[2]+t[2]),b:Tt(t[3]+t[3]),a:Nt(t[4]+t[4]),format:n?"name":"hex8"}:!!(t=Dt.hex3.exec(e))&&{r:Tt(t[1]+t[1]),g:Tt(t[2]+t[2]),b:Tt(t[3]+t[3]),format:n?"name":"hex"}}(e)),"object"==typeof e&&($t(e.r)&&$t(e.g)&&$t(e.b)?(n=function(e,n,t){return{r:255*zt(e,255),g:255*zt(n,255),b:255*zt(t,255)}}(e.r,e.g,e.b),o=!0,i="%"===String(e.r).substr(-1)?"prgb":"rgb"):$t(e.h)&&$t(e.s)&&$t(e.v)?(r=_t(e.s),a=_t(e.v),n=function(e,n,t){e=6*zt(e,360),n=zt(n,100),t=zt(t,100);var r=Math.floor(e),a=e-r,l=t*(1-n),o=t*(1-a*n),i=t*(1-(1-a)*n),s=r%6;return{r:255*[t,o,l,l,i,t][s],g:255*[i,t,t,o,l,l][s],b:255*[l,l,i,t,t,o][s]}}(e.h,r,a),o=!0,i="hsv"):$t(e.h)&&$t(e.s)&&$t(e.l)&&(r=_t(e.s),l=_t(e.l),n=function(e,n,t){var r,a,l;if(e=zt(e,360),n=zt(n,100),t=zt(t,100),0===n)a=t,l=t,r=t;else{var o=t<.5?t*(1+n):t+n-t*n,i=2*t-o;r=Ot(i,o,e+1/3),a=Ot(i,o,e),l=Ot(i,o,e-1/3)}return{r:255*r,g:255*a,b:255*l}}(e.h,r,l),o=!0,i="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(t=e.a)),t=St(t),{ok:o,format:e.format||i,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:t}}(n);this.originalInput=n,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(r=t.format)&&void 0!==r?r:a.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=a.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),n=e.r/255,t=e.g/255,r=e.b/255;return.2126*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=St(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var e=At(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=At(this.r,this.g,this.b),n=Math.round(360*e.h),t=Math.round(100*e.s),r=Math.round(100*e.v);return 1===this.a?"hsv(".concat(n,", ").concat(t,"%, ").concat(r,"%)"):"hsva(".concat(n,", ").concat(t,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=Pt(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=Pt(this.r,this.g,this.b),n=Math.round(360*e.h),t=Math.round(100*e.s),r=Math.round(100*e.l);return 1===this.a?"hsl(".concat(n,", ").concat(t,"%, ").concat(r,"%)"):"hsla(".concat(n,", ").concat(t,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),Lt(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),function(e,n,t,r,a){var l=[Mt(Math.round(e).toString(16)),Mt(Math.round(n).toString(16)),Mt(Math.round(t).toString(16)),Mt(Rt(r))];return a&&l[0].startsWith(l[0].charAt(1))&&l[1].startsWith(l[1].charAt(1))&&l[2].startsWith(l[2].charAt(1))&&l[3].startsWith(l[3].charAt(1))?l[0].charAt(0)+l[1].charAt(0)+l[2].charAt(0)+l[3].charAt(0):l.join("")}(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),n=Math.round(this.g),t=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(n,", ").concat(t,")"):"rgba(".concat(e,", ").concat(n,", ").concat(t,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*zt(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*zt(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+Lt(this.r,this.g,this.b,!1),n=0,t=Object.entries(Ft);n=0;return n||!r||!e.startsWith("hex")&&"name"!==e?("rgb"===e&&(t=this.toRgbString()),"prgb"===e&&(t=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(t=this.toHexString()),"hex3"===e&&(t=this.toHexString(!0)),"hex4"===e&&(t=this.toHex8String(!0)),"hex8"===e&&(t=this.toHex8String()),"name"===e&&(t=this.toName()),"hsl"===e&&(t=this.toHslString()),"hsv"===e&&(t=this.toHsvString()),t||this.toHexString()):"name"===e&&0===this.a?this.toName():this.toRgbString()},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(n){void 0===n&&(n=10);var t=this.toHsl();return t.l+=n/100,t.l=Ct(t.l),new e(t)},e.prototype.brighten=function(n){void 0===n&&(n=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(-n/100*255))),t.g=Math.max(0,Math.min(255,t.g-Math.round(-n/100*255))),t.b=Math.max(0,Math.min(255,t.b-Math.round(-n/100*255))),new e(t)},e.prototype.darken=function(n){void 0===n&&(n=10);var t=this.toHsl();return t.l-=n/100,t.l=Ct(t.l),new e(t)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(n){void 0===n&&(n=10);var t=this.toHsl();return t.s-=n/100,t.s=Ct(t.s),new e(t)},e.prototype.saturate=function(n){void 0===n&&(n=10);var t=this.toHsl();return t.s+=n/100,t.s=Ct(t.s),new e(t)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(n){var t=this.toHsl(),r=(t.h+n)%360;return t.h=r<0?360+r:r,new e(t)},e.prototype.mix=function(n,t){void 0===t&&(t=50);var r=this.toRgb(),a=new e(n).toRgb(),l=t/100;return new e({r:(a.r-r.r)*l+r.r,g:(a.g-r.g)*l+r.g,b:(a.b-r.b)*l+r.b,a:(a.a-r.a)*l+r.a})},e.prototype.analogous=function(n,t){void 0===n&&(n=6),void 0===t&&(t=30);var r=this.toHsl(),a=360/t,l=[this];for(r.h=(r.h-(a*n>>1)+720)%360;--n;)r.h=(r.h+a)%360,l.push(new e(r));return l},e.prototype.complement=function(){var n=this.toHsl();return n.h=(n.h+180)%360,new e(n)},e.prototype.monochromatic=function(n){void 0===n&&(n=6);for(var t=this.toHsv(),r=t.h,a=t.s,l=t.v,o=[],i=1/n;n--;)o.push(new e({h:r,s:a,v:l})),l=(l+i)%1;return o},e.prototype.splitcomplement=function(){var n=this.toHsl(),t=n.h;return[this,new e({h:(t+72)%360,s:n.s,l:n.l}),new e({h:(t+216)%360,s:n.s,l:n.l})]},e.prototype.onBackground=function(n){var t=this.toRgb(),r=new e(n).toRgb();return new e({r:r.r+(t.r-r.r)*t.a,g:r.g+(t.g-r.g)*t.a,b:r.b+(t.b-r.b)*t.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(n){for(var t=this.toHsl(),r=t.h,a=[this],l=360/n,o=1;o`rgba(${e.r}, ${e.g}, ${e.b}, ${e.a})`,Bt=e=>{return(n=Vt(e),void 0===n&&(n=""),void 0===t&&(t={}),new Ht(n,t)).toHex8String();var n,t},Wt=({width:e})=>Object.assign({value:e.value,type:e.type},void 0!==e.unit&&{unit:e.unit}),qt=(e,n)=>{if(null!=e)return"color"===n?Vt(e):e},Qt=e=>Object.assign(Object.assign({value:qt(e.value,e.type),type:e.type},void 0!==e.description&&{comment:e.description}),void 0!==e.unit&&{unit:e.unit}),Gt=e=>{Array.isArray(e)&&1===e.length&&(e=e[0]);const n={};return Object.keys(e).forEach((function(t){Object.prototype.hasOwnProperty.call(e[t],"value")?n[t]=Qt(e[t]):n[t]=Gt(e[t])})),1===Object.keys(n).length?Object.values(n)[0]:n},Kt={size:Wt,color:Gt,gradient:Gt,font:Gt,effect:e=>{const n=e.map((e=>["dropShadow","innerShadow"].includes(e.effectType.value)?(e=>({type:{value:e.effectType.value,type:"string"},radius:{value:e.radius.value,type:"number",unit:"pixel"},color:{value:Vt(e.color.value),type:"color"},offset:{x:{value:e.offset.x.value,type:"number",unit:"pixel"},y:{value:e.offset.y.value,type:"number",unit:"pixel"}},spread:{value:e.spread.value,type:"number",unit:"pixel"}}))(e):(e=>({type:{value:e.effectType.value,type:"string"},radius:{value:e.radius.value,type:"number",unit:"pixel"}}))(e)));return Array.isArray(n)&&1===n.length?n[0]:n},grid:Gt,border:e=>Object.fromEntries(Object.entries(e).map((([e,n])=>{if("dashPattern"===e){const t=Qt(n);return t.value=t.value.join(", "),[e,t]}return[e,Qt(n)]}))),breakpoint:Wt,radius:Gt,spacing:Gt,motion:e=>Object.assign(Object.assign({type:{value:e.transitionType.value,type:"string"},duration:{value:e.duration.value,type:"number",unit:"s"}},e.direction?{direction:{value:e.direction.value,type:"string"}}:{}),{easing:{value:e.easingType.value.replace("cubicBezier","cubic-bezier"),type:"string"},easingFunction:e.easingFunction}),opacity:({opacity:e})=>({value:e.value,type:e.type})},Yt=(e,n=2)=>{if(void 0===e)return;if("number"!=typeof e||"number"!=typeof n)throw new Error(`Invalid parameters, both value "${e}" (${typeof e}) and decimalPlaces "${n}" (${typeof n}) must be of type number`);const t=Math.pow(10,n);return Math.round(e*t)/t},Xt=(e,{excludeExtensionProp:n})=>{if(!0!==n)return{extensions:Object.assign({},e.extensions)}},Zt=(e,n="/",t=".")=>e.split(n).join(t).toLowerCase(),Jt=e=>"pixel"===e.lineHeight.unit?Yt(e.lineHeight.value,3):"percent"===e.lineHeight.unit?Yt(e.fontSize.value*(e.lineHeight.value/100),3):Yt(1.2*e.fontSize.value,3),er=e=>"pixel"===e.letterSpacing.unit?Yt(e.letterSpacing.value,3):"percent"===e.letterSpacing.unit?Yt(e.fontSize.value*(e.letterSpacing.value/100),3):void 0,nr=({values:e})=>({value:e.width.value,type:"dimension"}),tr=({values:e})=>({fontSize:{type:"dimension",value:e.fontSize.value},textDecoration:{type:"string",value:e.textDecoration.value},fontFamily:{type:"string",value:e.fontFamily.value},fontWeight:{type:"number",value:e.fontWeight.value},fontStyle:{type:"string",value:e.fontStyle.value},fontStretch:{type:"string",value:e.fontStretch.value},letterSpacing:{type:"dimension",value:er(e)},lineHeight:{type:"dimension",value:Jt(e)},paragraphIndent:{type:"dimension",value:e.paragraphIndent.value},paragraphSpacing:{type:"dimension",value:e.paragraphSpacing.value},textCase:{type:"string",value:e.textCase.value}}),rr=e=>{var n,t,r;if(e.extensions&&e.extensions[cn.key.extensionPluginData]&&e.extensions[cn.key.extensionPluginData].alias)return{type:Object.hasOwnProperty.call(e.values[0],"fill")?"color":"custom-gradient",value:`{${e.extensions[cn.key.extensionPluginData].alias}}`,blendMode:(null===(r=null===(t=null===(n=e.values[0])||void 0===n?void 0:n.fill)||void 0===t?void 0:t.blendMode)||void 0===r?void 0:r.toLowerCase())||"normal"};const a=e.values.map((e=>Object.hasOwnProperty.call(e,"fill")?(({fill:e})=>{var n;return{type:"color",value:Bt(e.value),blendMode:(null===(n=e.blendMode)||void 0===n?void 0:n.toLowerCase())||"normal"}})(e):(({gradientType:e,rotation:n,stops:t,opacity:r})=>({type:"custom-gradient",value:{gradientType:e.value,rotation:n.value,stops:t.map((e=>({position:e.position.value,color:Bt(Object.assign(Object.assign({},e.color.value),{a:e.color.value.a*r.value}))})))}}))(e)));return 1===a.length?a[0]:Object.assign({},a)},ar={size:nr,color:rr,gradient:rr,font:({values:e})=>({type:"custom-fontStyle",value:{fontSize:e.fontSize.value,textDecoration:e.textDecoration.value,fontFamily:e.fontFamily.value,fontWeight:e.fontWeight.value,fontStyle:e.fontStyle.value,fontStretch:e.fontStretch.value,letterSpacing:er(e),lineHeight:Jt(e),paragraphIndent:e.paragraphIndent.value,paragraphSpacing:e.paragraphSpacing.value,textCase:e.textCase.value}}),effect:({values:e})=>{const n=e.map((e=>{return["dropShadow","innerShadow"].includes(e.effectType.value)?{type:"custom-shadow",value:{shadowType:(n=e).effectType.value,radius:n.radius.value,color:Bt(n.color.value),offsetX:n.offset.x.value,offsetY:n.offset.y.value,spread:n.spread.value}}:null;var n}));return 1===n.length?n[0]:Object.assign({},n)},grid:({values:e})=>{const n=e.map((e=>({type:"custom-grid",value:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({pattern:e.pattern.value},e.sectionSize?{sectionSize:e.sectionSize.value}:{}),e.gutterSize?{gutterSize:e.gutterSize.value}:{}),e.alignment?{alignment:e.alignment.value}:{}),e.count?{count:e.count.value}:{}),e.offset?{offset:e.offset.value}:{})})));return 1===n.length?n[0]:Object.assign({},n)},border:({values:e})=>({type:"custom-stroke",value:{align:e.strokeAlign.value,dashPattern:e.dashPattern.value,lineCap:e.strokeCap.value,lineJoin:e.strokeJoin.value,miterLimit:e.strokeMiterLimit.value,weight:e.strokeWeight.value,color:Bt(e.stroke.value)}}),breakpoint:nr,radius:({values:e})=>({type:"custom-radius",value:{smoothing:e.smoothing.value,topLeft:e.radii.topLeft.value,topRight:e.radii.topRight.value,bottomLeft:e.radii.bottomLeft.value,bottomRight:e.radii.bottomRight.value}}),spacing:({values:e})=>({type:"custom-spacing",value:{top:e.top.value,bottom:e.bottom.value,left:e.left.value,right:e.right.value}}),motion:({values:e})=>({type:"custom-transition",value:Object.assign(Object.assign({transitionType:e.transitionType.value,duration:e.duration.value},e.direction?{direction:e.direction.value}:{}),{easingType:e.easingCurveType.value,easingFunction:Object.fromEntries(Object.entries(e.easingFunction).map((([e,n])=>[e,n.value])))})}),opacity:({values:e})=>({value:e.opacity.value,type:"custom-opacity"})},lr=(e,n)=>"typography"===e.category?{name:e.name,description:e.description,value:tr(e),type:"typography"}:"variables"===e.extensions[cn.key.extensionPluginData].exportKey?Object.assign(Object.assign({name:e.name,description:e.description},(({values:e,category:n})=>{var t;return/^{[^{}]*}$/.test(e)?{type:n,value:Zt(e,"/",".")}:"color"===n?{type:"color",value:Bt(e.fill.value),blendMode:(null===(t=e.fill.blendMode)||void 0===t?void 0:t.toLowerCase())||"normal"}:["dimension","boolean","string"].includes(n)?{type:n,value:e}:void 0})(e)),Xt(e,n)):Object.assign(Object.assign({name:e.name,description:e.description},(e=>ar[e.category](e))(e)),Xt(e,n)),or=(e,n)=>{const t=e=>e&&"object"==typeof e;return t(e)&&t(n)?(Object.keys(n).forEach((r=>{const a=e[r],l=n[r];Array.isArray(a)&&Array.isArray(l)?e[r]=a.concat(l):t(a)&&t(l)?e[r]=or(Object.assign({},a),l):e[r]=l})),e):n},ir=or,sr=(e,n,t)=>{if("string"==typeof e&&""!==e)return e;throw new Error(`converting "${n}" to ${t}, resulting in "${e}"`)},ur=(e,n="default")=>"camelCase"===n?(e=>{const n=e.toLowerCase().replace(/['"]/g,"").replace(/([-_ ]){1,}/g," ").replace(/\W+/g," ").trim().replace(/ (.)/g,(function(e){return e.toUpperCase()})).replace(/ /g,"");return sr(n,e,"camelCase")})(e):"kebabCase"===n?(e=>{const n=e.toLowerCase().replace(/['"]/g,"").replace(/([-_ ]){1,}/g," ").replace(/\W+/g," ").trim().replace(/ /g,"-");return sr(n,e,"kebabCase")})(e):e.trim().toLowerCase(),cr={color:{label:"Colors",key:"color"},gradient:{label:"Gradients",key:"gradient"},font:{label:"Font Styles",key:"font"},typography:{label:"Typography",key:"typography",exclude:["original"]},effect:{label:"Effects",key:"effect"},grid:{label:"Grids",key:"grid"},border:{label:"Borders",key:"border"},breakpoint:{label:"Breakpoints",key:"breakpoint"},radius:{label:"Radii",key:"radius"},size:{label:"Sizes",key:"size"},spacing:{label:"Spacing",key:"spacing"},motion:{label:"Motion",key:"motion"},opacity:{label:"Opacity",key:"opacity"},variables:{label:"Figma Variables (BETA)",key:"variables",exclude:["original"]}},dr=e=>{var n,t;return void 0!==(null===(t=null===(n=e.extensions)||void 0===n?void 0:n[cn.key.extensionPluginData])||void 0===t?void 0:t.exportKey)?e.extensions[cn.key.extensionPluginData].exportKey:"missingExportKey"},fr={original:(e,n)=>"variables"===e.extensions[cn.key.extensionPluginData].exportKey?null:Object.assign(Object.assign({name:e.name,category:e.category,exportKey:e.extensions[cn.key.extensionPluginData].exportKey},e.description&&e.description.length>0&&{comment:e.description}),Kt[e.category](e.values)||{}),standard:lr,standardDeprecated:lr},pr=(e,n)=>"standard"===n.tokenFormat?JSON.parse(JSON.stringify(e.filter((e=>e.category===cr.font.key)))).map((e=>(e.name="typography/"+e.name.substr(e.name.indexOf("/")+1).trim().trimStart(),e.category=cr.typography.key,e.exportKey=cr.typography.key,!0!==n.excludeExtensionProp&&(e.extensions[cn.key.extensionPluginData].exportKey=cr.typography.key),e))):[],gr=(e,n)=>{0===e.length&&(e="[{}]");let t=JSON.parse(e);t=[...t,...pr(t,n)];const r=((e,n)=>e.length<=0?[]:e.map((e=>{var t,r,a,l;if(!1===n.prefixInName&&"variables"!==e.exportKey)e.name=e.name.substr(e.name.indexOf("/")+1).trim().trimLeft();else if(void 0!==(null===(r=null===(t=e.extensions)||void 0===t?void 0:t[cn.key.extensionPluginData])||void 0===r?void 0:r.alias)){const n=e.name.substr(0,e.name.indexOf("/")).trim().trimLeft();e.extensions[cn.key.extensionPluginData].alias=`${n}.${e.extensions[cn.key.extensionPluginData].alias}`}return n.keyInName&&(e.name=`${dr(e)}/${e.name}`,void 0!==(null===(l=null===(a=e.extensions)||void 0===a?void 0:a[cn.key.extensionPluginData])||void 0===l?void 0:l.alias)&&(e.extensions[cn.key.extensionPluginData].alias=`${dr(e)}.${e.extensions[cn.key.extensionPluginData].alias}`)),e})))(t.filter((({exportKey:e})=>n.exports[e])),n),a=r.map((e=>fr[n.tokenFormat](e,n))).filter(Boolean),l=((e,n)=>{if(e.length<=0)return[];const t=e.map((e=>{const t=e.name.split("/").map((e=>ur(e,n.nameConversion)));return delete e.name,r=e,t.reduceRight(((e,n)=>({[n]:e})),r);var r}));return t.reduce(((e={},n)=>ir(e,n)))})(a,n);return l},hr=(e,n=!0)=>!0===n?JSON.stringify(e):JSON.stringify(e,null,2);var mr=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a"major"!==n&&"minor"!==n?e.createElement(e.Fragment,null):e.createElement("div",{id:"versionNotice",className:wt},e.createElement("div",{className:"icon"},"🎉"),e.createElement("div",null,"The ",e.createElement("a",{className:"subtle",href:"https://www.figma.com/community/plugin/888356646278934516/Design-Tokens",target:"_blank",rel:"noreferrer"},"Design Token plugin")," was updated.",e.createElement("br",null),"Find out about changes & new features in the ",e.createElement("a",{href:"https://github.com/lukasoppermann/design-tokens/releases",target:"_blank",rel:"noreferrer"},"release notes →"))),Et={filename:"design-tokens",extension:".tokens.json",nameConversion:"default",tokenFormat:"standard",compression:!1,urlJsonCompression:!0,serverUrl:void 0,eventType:"update-tokens",accessToken:void 0,acceptHeader:"application/vnd.github.everest-preview+json",contentType:"text/plain;charset=UTF-8",authType:"token",reference:"main",exclusionPrefix:"",excludeExtensionProp:!1,alias:"alias, ref, reference",keyInName:!1,prefixInName:!0,modeInTokenValue:!1,modeInTokenName:!1,resolveSameCollectionOrModeReference:!1,prefix:{color:"color",gradient:"gradient",typography:"typography",font:"font",effect:"effect",grid:"grid",border:"border, borders",breakpoint:"breakpoint, breakpoints",radius:"radius, radii",size:"size, sizes",spacing:"spacing",motion:"motion",opacity:"opacity, opacities"},exports:{color:!0,gradient:!0,font:!0,typography:!0,effect:!0,grid:!0,border:!0,breakpoint:!0,radius:!0,size:!0,spacing:!0,motion:!0,opacity:!0,variables:!0}};function zt(e,n){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var t=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===n?e:Math.min(n,Math.max(0,parseFloat(e))),t&&(e=parseInt(String(e*n),10)/100),Math.abs(e-n)<1e-6?1:e=360===n?(e<0?e%n+n:e%n)/parseFloat(String(n)):e%n/parseFloat(String(n))}function Ct(e){return Math.min(1,Math.max(0,e))}function St(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function _t(e){return e<=1?"".concat(100*Number(e),"%"):e}function Mt(e){return 1===e.length?"0"+e:String(e)}function Pt(e,n,t){e=zt(e,255),n=zt(n,255),t=zt(t,255);var r=Math.max(e,n,t),a=Math.min(e,n,t),l=0,o=0,i=(r+a)/2;if(r===a)o=0,l=0;else{var s=r-a;switch(o=i>.5?s/(2-r-a):s/(r+a),r){case e:l=(n-t)/s+(n1&&(t-=1),t<1/6?e+6*t*(n-e):t<.5?n:t<2/3?e+(n-e)*(2/3-t)*6:e}function At(e,n,t){e=zt(e,255),n=zt(n,255),t=zt(t,255);var r=Math.max(e,n,t),a=Math.min(e,n,t),l=0,o=r,i=r-a,s=0===r?0:i/r;if(r===a)l=0;else{switch(r){case e:l=(n-t)/i+(n>16,g:(65280&e)>>8,b:255&e}}(n)),this.originalInput=n;var a=function(e){var n={r:0,g:0,b:0},t=1,r=null,a=null,l=null,o=!1,i=!1;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var n=!1;if(Ft[e])e=Ft[e],n=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var t=Dt.rgb.exec(e);return t?{r:t[1],g:t[2],b:t[3]}:(t=Dt.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Dt.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=Dt.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Dt.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=Dt.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Dt.hex8.exec(e))?{r:Tt(t[1]),g:Tt(t[2]),b:Tt(t[3]),a:Nt(t[4]),format:n?"name":"hex8"}:(t=Dt.hex6.exec(e))?{r:Tt(t[1]),g:Tt(t[2]),b:Tt(t[3]),format:n?"name":"hex"}:(t=Dt.hex4.exec(e))?{r:Tt(t[1]+t[1]),g:Tt(t[2]+t[2]),b:Tt(t[3]+t[3]),a:Nt(t[4]+t[4]),format:n?"name":"hex8"}:!!(t=Dt.hex3.exec(e))&&{r:Tt(t[1]+t[1]),g:Tt(t[2]+t[2]),b:Tt(t[3]+t[3]),format:n?"name":"hex"}}(e)),"object"==typeof e&&($t(e.r)&&$t(e.g)&&$t(e.b)?(n=function(e,n,t){return{r:255*zt(e,255),g:255*zt(n,255),b:255*zt(t,255)}}(e.r,e.g,e.b),o=!0,i="%"===String(e.r).substr(-1)?"prgb":"rgb"):$t(e.h)&&$t(e.s)&&$t(e.v)?(r=_t(e.s),a=_t(e.v),n=function(e,n,t){e=6*zt(e,360),n=zt(n,100),t=zt(t,100);var r=Math.floor(e),a=e-r,l=t*(1-n),o=t*(1-a*n),i=t*(1-(1-a)*n),s=r%6;return{r:255*[t,o,l,l,i,t][s],g:255*[i,t,t,o,l,l][s],b:255*[l,l,i,t,t,o][s]}}(e.h,r,a),o=!0,i="hsv"):$t(e.h)&&$t(e.s)&&$t(e.l)&&(r=_t(e.s),l=_t(e.l),n=function(e,n,t){var r,a,l;if(e=zt(e,360),n=zt(n,100),t=zt(t,100),0===n)a=t,l=t,r=t;else{var o=t<.5?t*(1+n):t+n-t*n,i=2*t-o;r=Ot(i,o,e+1/3),a=Ot(i,o,e),l=Ot(i,o,e-1/3)}return{r:255*r,g:255*a,b:255*l}}(e.h,r,l),o=!0,i="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(t=e.a)),t=St(t),{ok:o,format:e.format||i,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:t}}(n);this.originalInput=n,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(r=t.format)&&void 0!==r?r:a.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=a.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),n=e.r/255,t=e.g/255,r=e.b/255;return.2126*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=St(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var e=At(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=At(this.r,this.g,this.b),n=Math.round(360*e.h),t=Math.round(100*e.s),r=Math.round(100*e.v);return 1===this.a?"hsv(".concat(n,", ").concat(t,"%, ").concat(r,"%)"):"hsva(".concat(n,", ").concat(t,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=Pt(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=Pt(this.r,this.g,this.b),n=Math.round(360*e.h),t=Math.round(100*e.s),r=Math.round(100*e.l);return 1===this.a?"hsl(".concat(n,", ").concat(t,"%, ").concat(r,"%)"):"hsla(".concat(n,", ").concat(t,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),Lt(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),function(e,n,t,r,a){var l=[Mt(Math.round(e).toString(16)),Mt(Math.round(n).toString(16)),Mt(Math.round(t).toString(16)),Mt(Rt(r))];return a&&l[0].startsWith(l[0].charAt(1))&&l[1].startsWith(l[1].charAt(1))&&l[2].startsWith(l[2].charAt(1))&&l[3].startsWith(l[3].charAt(1))?l[0].charAt(0)+l[1].charAt(0)+l[2].charAt(0)+l[3].charAt(0):l.join("")}(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),n=Math.round(this.g),t=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(n,", ").concat(t,")"):"rgba(".concat(e,", ").concat(n,", ").concat(t,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*zt(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*zt(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+Lt(this.r,this.g,this.b,!1),n=0,t=Object.entries(Ft);n=0;return n||!r||!e.startsWith("hex")&&"name"!==e?("rgb"===e&&(t=this.toRgbString()),"prgb"===e&&(t=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(t=this.toHexString()),"hex3"===e&&(t=this.toHexString(!0)),"hex4"===e&&(t=this.toHex8String(!0)),"hex8"===e&&(t=this.toHex8String()),"name"===e&&(t=this.toName()),"hsl"===e&&(t=this.toHslString()),"hsv"===e&&(t=this.toHsvString()),t||this.toHexString()):"name"===e&&0===this.a?this.toName():this.toRgbString()},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(n){void 0===n&&(n=10);var t=this.toHsl();return t.l+=n/100,t.l=Ct(t.l),new e(t)},e.prototype.brighten=function(n){void 0===n&&(n=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(-n/100*255))),t.g=Math.max(0,Math.min(255,t.g-Math.round(-n/100*255))),t.b=Math.max(0,Math.min(255,t.b-Math.round(-n/100*255))),new e(t)},e.prototype.darken=function(n){void 0===n&&(n=10);var t=this.toHsl();return t.l-=n/100,t.l=Ct(t.l),new e(t)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(n){void 0===n&&(n=10);var t=this.toHsl();return t.s-=n/100,t.s=Ct(t.s),new e(t)},e.prototype.saturate=function(n){void 0===n&&(n=10);var t=this.toHsl();return t.s+=n/100,t.s=Ct(t.s),new e(t)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(n){var t=this.toHsl(),r=(t.h+n)%360;return t.h=r<0?360+r:r,new e(t)},e.prototype.mix=function(n,t){void 0===t&&(t=50);var r=this.toRgb(),a=new e(n).toRgb(),l=t/100;return new e({r:(a.r-r.r)*l+r.r,g:(a.g-r.g)*l+r.g,b:(a.b-r.b)*l+r.b,a:(a.a-r.a)*l+r.a})},e.prototype.analogous=function(n,t){void 0===n&&(n=6),void 0===t&&(t=30);var r=this.toHsl(),a=360/t,l=[this];for(r.h=(r.h-(a*n>>1)+720)%360;--n;)r.h=(r.h+a)%360,l.push(new e(r));return l},e.prototype.complement=function(){var n=this.toHsl();return n.h=(n.h+180)%360,new e(n)},e.prototype.monochromatic=function(n){void 0===n&&(n=6);for(var t=this.toHsv(),r=t.h,a=t.s,l=t.v,o=[],i=1/n;n--;)o.push(new e({h:r,s:a,v:l})),l=(l+i)%1;return o},e.prototype.splitcomplement=function(){var n=this.toHsl(),t=n.h;return[this,new e({h:(t+72)%360,s:n.s,l:n.l}),new e({h:(t+216)%360,s:n.s,l:n.l})]},e.prototype.onBackground=function(n){var t=this.toRgb(),r=new e(n).toRgb();return new e({r:r.r+(t.r-r.r)*t.a,g:r.g+(t.g-r.g)*t.a,b:r.b+(t.b-r.b)*t.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(n){for(var t=this.toHsl(),r=t.h,a=[this],l=360/n,o=1;o`rgba(${e.r}, ${e.g}, ${e.b}, ${e.a})`,Bt=e=>{return(n=Vt(e),void 0===n&&(n=""),void 0===t&&(t={}),new Ht(n,t)).toHex8String();var n,t},Wt=({width:e})=>Object.assign({value:e.value,type:e.type},void 0!==e.unit&&{unit:e.unit}),qt=(e,n)=>{if(null!=e)return"color"===n?Vt(e):e},Qt=e=>Object.assign(Object.assign({value:qt(e.value,e.type),type:e.type},void 0!==e.description&&{comment:e.description}),void 0!==e.unit&&{unit:e.unit}),Gt=e=>{Array.isArray(e)&&1===e.length&&(e=e[0]);const n={};return Object.keys(e).forEach((function(t){Object.prototype.hasOwnProperty.call(e[t],"value")?n[t]=Qt(e[t]):n[t]=Gt(e[t])})),1===Object.keys(n).length?Object.values(n)[0]:n},Kt={size:Wt,color:Gt,gradient:Gt,font:Gt,effect:e=>{const n=e.map((e=>["dropShadow","innerShadow"].includes(e.effectType.value)?(e=>({type:{value:e.effectType.value,type:"string"},radius:{value:e.radius.value,type:"number",unit:"pixel"},color:{value:Vt(e.color.value),type:"color"},offset:{x:{value:e.offset.x.value,type:"number",unit:"pixel"},y:{value:e.offset.y.value,type:"number",unit:"pixel"}},spread:{value:e.spread.value,type:"number",unit:"pixel"}}))(e):(e=>({type:{value:e.effectType.value,type:"string"},radius:{value:e.radius.value,type:"number",unit:"pixel"}}))(e)));return Array.isArray(n)&&1===n.length?n[0]:n},grid:Gt,border:e=>Object.fromEntries(Object.entries(e).map((([e,n])=>{if("dashPattern"===e){const t=Qt(n);return t.value=t.value.join(", "),[e,t]}return[e,Qt(n)]}))),breakpoint:Wt,radius:Gt,spacing:Gt,motion:e=>Object.assign(Object.assign({type:{value:e.transitionType.value,type:"string"},duration:{value:e.duration.value,type:"number",unit:"s"}},e.direction?{direction:{value:e.direction.value,type:"string"}}:{}),{easing:{value:e.easingType.value.replace("cubicBezier","cubic-bezier"),type:"string"},easingFunction:e.easingFunction}),opacity:({opacity:e})=>({value:e.value,type:e.type})},Yt=(e,n=2)=>{if(void 0===e)return;if("number"!=typeof e||"number"!=typeof n)throw new Error(`Invalid parameters, both value "${e}" (${typeof e}) and decimalPlaces "${n}" (${typeof n}) must be of type number`);const t=Math.pow(10,n);return Math.round(e*t)/t},Xt=(e,{excludeExtensionProp:n})=>{if(!0!==n)return{extensions:Object.assign({},e.extensions)}},Zt=(e,n="/",t=".")=>e.split(n).join(t).toLowerCase(),Jt=e=>"pixel"===e.lineHeight.unit?Yt(e.lineHeight.value,3):"percent"===e.lineHeight.unit?Yt(e.fontSize.value*(e.lineHeight.value/100),3):Yt(1.2*e.fontSize.value,3),er=e=>"pixel"===e.letterSpacing.unit?Yt(e.letterSpacing.value,3):"percent"===e.letterSpacing.unit?Yt(e.fontSize.value*(e.letterSpacing.value/100),3):void 0,nr=({values:e})=>({value:e.width.value,type:"dimension"}),tr=({values:e})=>({type:"typography",value:{fontSize:e.fontSize.value.toString(),textDecoration:e.textDecoration.value,fontFamily:e.fontFamily.value,fontWeight:e.fontWeight.value.toString(),fontStyle:e.fontStyle.value,fontStretch:e.fontStretch.value,letterSpacing:er(e).toString(),lineHeight:Jt(e).toString(),paragraphIndent:e.paragraphIndent.value.toString(),paragraphSpacing:e.paragraphSpacing.value.toString(),textCase:e.textCase.value}}),rr=e=>{var n,t,r;if(e.extensions&&e.extensions[cn.key.extensionPluginData]&&e.extensions[cn.key.extensionPluginData].alias)return{type:Object.hasOwnProperty.call(e.values[0],"fill")?"color":"custom-gradient",value:`{${e.extensions[cn.key.extensionPluginData].alias}}`,blendMode:(null===(r=null===(t=null===(n=e.values[0])||void 0===n?void 0:n.fill)||void 0===t?void 0:t.blendMode)||void 0===r?void 0:r.toLowerCase())||"normal"};const a=e.values.map((e=>Object.hasOwnProperty.call(e,"fill")?(({fill:e})=>{var n;return{type:"color",value:Bt(e.value),blendMode:(null===(n=e.blendMode)||void 0===n?void 0:n.toLowerCase())||"normal"}})(e):(({gradientType:e,rotation:n,stops:t,opacity:r})=>({type:"custom-gradient",value:{gradientType:e.value,rotation:n.value,stops:t.map((e=>({position:e.position.value,color:Bt(Object.assign(Object.assign({},e.color.value),{a:e.color.value.a*r.value}))})))}}))(e)));return 1===a.length?a[0]:Object.assign({},a)},ar={size:nr,color:rr,gradient:rr,font:({values:e})=>({type:"custom-fontStyle",value:{fontSize:e.fontSize.value,textDecoration:e.textDecoration.value,fontFamily:e.fontFamily.value,fontWeight:e.fontWeight.value,fontStyle:e.fontStyle.value,fontStretch:e.fontStretch.value,letterSpacing:er(e),lineHeight:Jt(e),paragraphIndent:e.paragraphIndent.value,paragraphSpacing:e.paragraphSpacing.value,textCase:e.textCase.value}}),effect:({values:e})=>{const n=e.map((e=>{return["dropShadow","innerShadow"].includes(e.effectType.value)?{type:"custom-shadow",value:{shadowType:(n=e).effectType.value,radius:n.radius.value,color:Bt(n.color.value),offsetX:n.offset.x.value,offsetY:n.offset.y.value,spread:n.spread.value}}:null;var n}));return 1===n.length?n[0]:Object.assign({},n)},grid:({values:e})=>{const n=e.map((e=>({type:"custom-grid",value:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({pattern:e.pattern.value},e.sectionSize?{sectionSize:e.sectionSize.value}:{}),e.gutterSize?{gutterSize:e.gutterSize.value}:{}),e.alignment?{alignment:e.alignment.value}:{}),e.count?{count:e.count.value}:{}),e.offset?{offset:e.offset.value}:{})})));return 1===n.length?n[0]:Object.assign({},n)},border:({values:e})=>({type:"custom-stroke",value:{align:e.strokeAlign.value,dashPattern:e.dashPattern.value,lineCap:e.strokeCap.value,lineJoin:e.strokeJoin.value,miterLimit:e.strokeMiterLimit.value,weight:e.strokeWeight.value,color:Bt(e.stroke.value)}}),breakpoint:nr,radius:({values:e})=>({type:"custom-radius",value:{smoothing:e.smoothing.value,topLeft:e.radii.topLeft.value,topRight:e.radii.topRight.value,bottomLeft:e.radii.bottomLeft.value,bottomRight:e.radii.bottomRight.value}}),spacing:({values:e})=>({type:"custom-spacing",value:{top:e.top.value,bottom:e.bottom.value,left:e.left.value,right:e.right.value}}),motion:({values:e})=>({type:"custom-transition",value:Object.assign(Object.assign({transitionType:e.transitionType.value,duration:e.duration.value},e.direction?{direction:e.direction.value}:{}),{easingType:e.easingCurveType.value,easingFunction:Object.fromEntries(Object.entries(e.easingFunction).map((([e,n])=>[e,n.value])))})}),opacity:({values:e})=>({value:e.opacity.value,type:"custom-opacity"})},lr=(e,n)=>"typography"===e.category?{name:e.name,description:e.description,value:tr(e),type:"typography"}:"variables"===e.extensions[cn.key.extensionPluginData].exportKey?Object.assign(Object.assign({name:e.name,description:e.description},(({values:e,category:n})=>{var t;return/^{[^{}]*}$/.test(e)?{type:n,value:Zt(e,"/",".")}:"color"===n?{type:"color",value:Bt(e.fill.value),blendMode:(null===(t=e.fill.blendMode)||void 0===t?void 0:t.toLowerCase())||"normal"}:["dimension","boolean","string"].includes(n)?{type:n,value:e}:void 0})(e)),Xt(e,n)):Object.assign(Object.assign({name:e.name,description:e.description},(e=>ar[e.category](e))(e)),Xt(e,n)),or=(e,n)=>{const t=e=>e&&"object"==typeof e;return t(e)&&t(n)?(Object.keys(n).forEach((r=>{const a=e[r],l=n[r];Array.isArray(a)&&Array.isArray(l)?e[r]=a.concat(l):t(a)&&t(l)?e[r]=or(Object.assign({},a),l):e[r]=l})),e):n},ir=or,sr=(e,n,t)=>{if("string"==typeof e&&""!==e)return e;throw new Error(`converting "${n}" to ${t}, resulting in "${e}"`)},ur=(e,n="default")=>"camelCase"===n?(e=>{const n=e.toLowerCase().replace(/['"]/g,"").replace(/([-_ ]){1,}/g," ").replace(/\W+/g," ").trim().replace(/ (.)/g,(function(e){return e.toUpperCase()})).replace(/ /g,"");return sr(n,e,"camelCase")})(e):"kebabCase"===n?(e=>{const n=e.toLowerCase().replace(/['"]/g,"").replace(/([-_ ]){1,}/g," ").replace(/\W+/g," ").trim().replace(/ /g,"-");return sr(n,e,"kebabCase")})(e):e.trim().toLowerCase(),cr={color:{label:"Colors",key:"color"},gradient:{label:"Gradients",key:"gradient"},font:{label:"Font Styles",key:"font"},typography:{label:"Typography",key:"typography",exclude:["original"]},effect:{label:"Effects",key:"effect"},grid:{label:"Grids",key:"grid"},border:{label:"Borders",key:"border"},breakpoint:{label:"Breakpoints",key:"breakpoint"},radius:{label:"Radii",key:"radius"},size:{label:"Sizes",key:"size"},spacing:{label:"Spacing",key:"spacing"},motion:{label:"Motion",key:"motion"},opacity:{label:"Opacity",key:"opacity"},variables:{label:"Figma Variables (BETA)",key:"variables",exclude:["original"]}},dr=e=>{var n,t;return void 0!==(null===(t=null===(n=e.extensions)||void 0===n?void 0:n[cn.key.extensionPluginData])||void 0===t?void 0:t.exportKey)?e.extensions[cn.key.extensionPluginData].exportKey:"missingExportKey"},fr={original:e=>"variables"===e.extensions[cn.key.extensionPluginData].exportKey?null:Object.assign(Object.assign({name:e.name,category:e.category,exportKey:e.extensions[cn.key.extensionPluginData].exportKey},e.description&&e.description.length>0&&{comment:e.description}),Kt[e.category](e.values)||{}),standard:lr,standardDeprecated:lr},pr=(e,n)=>"standard"===n.tokenFormat?JSON.parse(JSON.stringify(e.filter((e=>e.category===cr.font.key)))).map((e=>(e.name="typography/"+e.name.substr(e.name.indexOf("/")+1).trim().trimStart(),e.category=cr.typography.key,e.exportKey=cr.typography.key,!0!==n.excludeExtensionProp&&(e.extensions[cn.key.extensionPluginData].exportKey=cr.typography.key),e))):[],gr=(e,n)=>{0===e.length&&(e="[{}]");let t=JSON.parse(e);t=[...t,...pr(t,n)];const r=((e,n)=>e.length<=0?[]:e.map((e=>{var t,r,a,l;if(!1===n.prefixInName&&"variables"!==e.exportKey)e.name=e.name.substr(e.name.indexOf("/")+1).trim().trimLeft();else if(void 0!==(null===(r=null===(t=e.extensions)||void 0===t?void 0:t[cn.key.extensionPluginData])||void 0===r?void 0:r.alias)){const n=e.name.substr(0,e.name.indexOf("/")).trim().trimLeft();e.extensions[cn.key.extensionPluginData].alias=`${n}.${e.extensions[cn.key.extensionPluginData].alias}`}return n.keyInName&&(e.name=`${dr(e)}/${e.name}`,void 0!==(null===(l=null===(a=e.extensions)||void 0===a?void 0:a[cn.key.extensionPluginData])||void 0===l?void 0:l.alias)&&(e.extensions[cn.key.extensionPluginData].alias=`${dr(e)}.${e.extensions[cn.key.extensionPluginData].alias}`)),e})))(t.filter((({exportKey:e})=>n.exports[e])),n),a=r.map((e=>fr[n.tokenFormat](e,n))).filter(Boolean),l=((e,n)=>{if(e.length<=0)return[];const t=e.map((e=>{const t=e.name.split("/").map((e=>ur(e,n.nameConversion)));return delete e.name,r=e,t.reduceRight(((e,n)=>({[n]:e})),r);var r}));return t.reduce(((e={},n)=>ir(e,n)))})(a,n);return l},hr=(e,n=!0)=>!0===n?JSON.stringify(e):JSON.stringify(e,null,2);var mr=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a"major"!==n&&"minor"!==n?e.createElement(e.Fragment,null):e.createElement("div",{id:"versionNotice",className:wt},e.createElement("div",{className:"icon"},"🎉"),e.createElement("div",null,"The ",e.createElement("a",{className:"subtle",href:"https://www.figma.com/community/plugin/888356646278934516/Design-Tokens",target:"_blank",rel:"noreferrer"},"Design Token plugin")," was updated.",e.createElement("br",null),"Find out about changes & new features in the ",e.createElement("a",{href:"https://github.com/lukasoppermann/design-tokens/releases",target:"_blank",rel:"noreferrer"},"release notes →"))),Et={filename:"design-tokens",extension:".tokens.json",nameConversion:"default",tokenFormat:"standard",compression:!1,urlJsonCompression:!0,serverUrl:void 0,eventType:"update-tokens",accessToken:void 0,acceptHeader:"application/vnd.github.everest-preview+json",contentType:"text/plain;charset=UTF-8",authType:"token",reference:"main",exclusionPrefix:"",excludeExtensionProp:!1,alias:"alias, ref, reference",keyInName:!1,prefixInName:!0,modeInTokenValue:!1,modeInTokenName:!1,resolveSameCollectionOrModeReference:!1,prefix:{color:"color",gradient:"gradient",typography:"typography",font:"font",effect:"effect",grid:"grid",border:"border, borders",breakpoint:"breakpoint, breakpoints",radius:"radius, radii",size:"size, sizes",spacing:"spacing",motion:"motion",opacity:"opacity, opacities"},exports:{color:!0,gradient:!0,font:!0,typography:!0,effect:!0,grid:!0,border:!0,breakpoint:!0,radius:!0,size:!0,spacing:!0,motion:!0,opacity:!0,variables:!0}};function zt(e,n){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var t=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===n?e:Math.min(n,Math.max(0,parseFloat(e))),t&&(e=parseInt(String(e*n),10)/100),Math.abs(e-n)<1e-6?1:e=360===n?(e<0?e%n+n:e%n)/parseFloat(String(n)):e%n/parseFloat(String(n))}function Ct(e){return Math.min(1,Math.max(0,e))}function St(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function _t(e){return e<=1?"".concat(100*Number(e),"%"):e}function Mt(e){return 1===e.length?"0"+e:String(e)}function Pt(e,n,t){e=zt(e,255),n=zt(n,255),t=zt(t,255);var r=Math.max(e,n,t),a=Math.min(e,n,t),l=0,o=0,i=(r+a)/2;if(r===a)o=0,l=0;else{var s=r-a;switch(o=i>.5?s/(2-r-a):s/(r+a),r){case e:l=(n-t)/s+(n1&&(t-=1),t<1/6?e+6*t*(n-e):t<.5?n:t<2/3?e+(n-e)*(2/3-t)*6:e}function At(e,n,t){e=zt(e,255),n=zt(n,255),t=zt(t,255);var r=Math.max(e,n,t),a=Math.min(e,n,t),l=0,o=r,i=r-a,s=0===r?0:i/r;if(r===a)l=0;else{switch(r){case e:l=(n-t)/i+(n>16,g:(65280&e)>>8,b:255&e}}(n)),this.originalInput=n;var a=function(e){var n={r:0,g:0,b:0},t=1,r=null,a=null,l=null,o=!1,i=!1;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var n=!1;if(Ft[e])e=Ft[e],n=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var t=Dt.rgb.exec(e);return t?{r:t[1],g:t[2],b:t[3]}:(t=Dt.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Dt.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=Dt.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Dt.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=Dt.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Dt.hex8.exec(e))?{r:Tt(t[1]),g:Tt(t[2]),b:Tt(t[3]),a:Nt(t[4]),format:n?"name":"hex8"}:(t=Dt.hex6.exec(e))?{r:Tt(t[1]),g:Tt(t[2]),b:Tt(t[3]),format:n?"name":"hex"}:(t=Dt.hex4.exec(e))?{r:Tt(t[1]+t[1]),g:Tt(t[2]+t[2]),b:Tt(t[3]+t[3]),a:Nt(t[4]+t[4]),format:n?"name":"hex8"}:!!(t=Dt.hex3.exec(e))&&{r:Tt(t[1]+t[1]),g:Tt(t[2]+t[2]),b:Tt(t[3]+t[3]),format:n?"name":"hex"}}(e)),"object"==typeof e&&($t(e.r)&&$t(e.g)&&$t(e.b)?(n=function(e,n,t){return{r:255*zt(e,255),g:255*zt(n,255),b:255*zt(t,255)}}(e.r,e.g,e.b),o=!0,i="%"===String(e.r).substr(-1)?"prgb":"rgb"):$t(e.h)&&$t(e.s)&&$t(e.v)?(r=_t(e.s),a=_t(e.v),n=function(e,n,t){e=6*zt(e,360),n=zt(n,100),t=zt(t,100);var r=Math.floor(e),a=e-r,l=t*(1-n),o=t*(1-a*n),i=t*(1-(1-a)*n),s=r%6;return{r:255*[t,o,l,l,i,t][s],g:255*[i,t,t,o,l,l][s],b:255*[l,l,i,t,t,o][s]}}(e.h,r,a),o=!0,i="hsv"):$t(e.h)&&$t(e.s)&&$t(e.l)&&(r=_t(e.s),l=_t(e.l),n=function(e,n,t){var r,a,l;if(e=zt(e,360),n=zt(n,100),t=zt(t,100),0===n)a=t,l=t,r=t;else{var o=t<.5?t*(1+n):t+n-t*n,i=2*t-o;r=Ot(i,o,e+1/3),a=Ot(i,o,e),l=Ot(i,o,e-1/3)}return{r:255*r,g:255*a,b:255*l}}(e.h,r,l),o=!0,i="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(t=e.a)),t=St(t),{ok:o,format:e.format||i,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:t}}(n);this.originalInput=n,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(r=t.format)&&void 0!==r?r:a.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=a.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),n=e.r/255,t=e.g/255,r=e.b/255;return.2126*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=St(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var e=At(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=At(this.r,this.g,this.b),n=Math.round(360*e.h),t=Math.round(100*e.s),r=Math.round(100*e.v);return 1===this.a?"hsv(".concat(n,", ").concat(t,"%, ").concat(r,"%)"):"hsva(".concat(n,", ").concat(t,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=Pt(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=Pt(this.r,this.g,this.b),n=Math.round(360*e.h),t=Math.round(100*e.s),r=Math.round(100*e.l);return 1===this.a?"hsl(".concat(n,", ").concat(t,"%, ").concat(r,"%)"):"hsla(".concat(n,", ").concat(t,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),Lt(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),function(e,n,t,r,a){var l=[Mt(Math.round(e).toString(16)),Mt(Math.round(n).toString(16)),Mt(Math.round(t).toString(16)),Mt(Rt(r))];return a&&l[0].startsWith(l[0].charAt(1))&&l[1].startsWith(l[1].charAt(1))&&l[2].startsWith(l[2].charAt(1))&&l[3].startsWith(l[3].charAt(1))?l[0].charAt(0)+l[1].charAt(0)+l[2].charAt(0)+l[3].charAt(0):l.join("")}(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),n=Math.round(this.g),t=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(n,", ").concat(t,")"):"rgba(".concat(e,", ").concat(n,", ").concat(t,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*zt(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*zt(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+Lt(this.r,this.g,this.b,!1),n=0,t=Object.entries(Ft);n=0;return n||!r||!e.startsWith("hex")&&"name"!==e?("rgb"===e&&(t=this.toRgbString()),"prgb"===e&&(t=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(t=this.toHexString()),"hex3"===e&&(t=this.toHexString(!0)),"hex4"===e&&(t=this.toHex8String(!0)),"hex8"===e&&(t=this.toHex8String()),"name"===e&&(t=this.toName()),"hsl"===e&&(t=this.toHslString()),"hsv"===e&&(t=this.toHsvString()),t||this.toHexString()):"name"===e&&0===this.a?this.toName():this.toRgbString()},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(n){void 0===n&&(n=10);var t=this.toHsl();return t.l+=n/100,t.l=Ct(t.l),new e(t)},e.prototype.brighten=function(n){void 0===n&&(n=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(-n/100*255))),t.g=Math.max(0,Math.min(255,t.g-Math.round(-n/100*255))),t.b=Math.max(0,Math.min(255,t.b-Math.round(-n/100*255))),new e(t)},e.prototype.darken=function(n){void 0===n&&(n=10);var t=this.toHsl();return t.l-=n/100,t.l=Ct(t.l),new e(t)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(n){void 0===n&&(n=10);var t=this.toHsl();return t.s-=n/100,t.s=Ct(t.s),new e(t)},e.prototype.saturate=function(n){void 0===n&&(n=10);var t=this.toHsl();return t.s+=n/100,t.s=Ct(t.s),new e(t)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(n){var t=this.toHsl(),r=(t.h+n)%360;return t.h=r<0?360+r:r,new e(t)},e.prototype.mix=function(n,t){void 0===t&&(t=50);var r=this.toRgb(),a=new e(n).toRgb(),l=t/100;return new e({r:(a.r-r.r)*l+r.r,g:(a.g-r.g)*l+r.g,b:(a.b-r.b)*l+r.b,a:(a.a-r.a)*l+r.a})},e.prototype.analogous=function(n,t){void 0===n&&(n=6),void 0===t&&(t=30);var r=this.toHsl(),a=360/t,l=[this];for(r.h=(r.h-(a*n>>1)+720)%360;--n;)r.h=(r.h+a)%360,l.push(new e(r));return l},e.prototype.complement=function(){var n=this.toHsl();return n.h=(n.h+180)%360,new e(n)},e.prototype.monochromatic=function(n){void 0===n&&(n=6);for(var t=this.toHsv(),r=t.h,a=t.s,l=t.v,o=[],i=1/n;n--;)o.push(new e({h:r,s:a,v:l})),l=(l+i)%1;return o},e.prototype.splitcomplement=function(){var n=this.toHsl(),t=n.h;return[this,new e({h:(t+72)%360,s:n.s,l:n.l}),new e({h:(t+216)%360,s:n.s,l:n.l})]},e.prototype.onBackground=function(n){var t=this.toRgb(),r=new e(n).toRgb();return new e({r:r.r+(t.r-r.r)*t.a,g:r.g+(t.g-r.g)*t.a,b:r.b+(t.b-r.b)*t.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(n){for(var t=this.toHsl(),r=t.h,a=[this],l=360/n,o=1;o`rgba(${e.r}, ${e.g}, ${e.b}, ${e.a})`,Bt=e=>{return(n=Vt(e),void 0===n&&(n=""),void 0===t&&(t={}),new Ht(n,t)).toHex8String();var n,t},Wt=({width:e})=>Object.assign({value:e.value,type:e.type},void 0!==e.unit&&{unit:e.unit}),qt=(e,n)=>{if(null!=e)return"color"===n?Vt(e):e},Qt=e=>Object.assign(Object.assign({value:qt(e.value,e.type),type:e.type},void 0!==e.description&&{comment:e.description}),void 0!==e.unit&&{unit:e.unit}),Gt=e=>{Array.isArray(e)&&1===e.length&&(e=e[0]);const n={};return Object.keys(e).forEach((function(t){Object.prototype.hasOwnProperty.call(e[t],"value")?n[t]=Qt(e[t]):n[t]=Gt(e[t])})),1===Object.keys(n).length?Object.values(n)[0]:n},Kt={size:Wt,color:Gt,gradient:Gt,font:Gt,effect:e=>{const n=e.map((e=>["dropShadow","innerShadow"].includes(e.effectType.value)?(e=>({type:{value:e.effectType.value,type:"string"},radius:{value:e.radius.value,type:"number",unit:"pixel"},color:{value:Vt(e.color.value),type:"color"},offset:{x:{value:e.offset.x.value,type:"number",unit:"pixel"},y:{value:e.offset.y.value,type:"number",unit:"pixel"}},spread:{value:e.spread.value,type:"number",unit:"pixel"}}))(e):(e=>({type:{value:e.effectType.value,type:"string"},radius:{value:e.radius.value,type:"number",unit:"pixel"}}))(e)));return Array.isArray(n)&&1===n.length?n[0]:n},grid:Gt,border:e=>Object.fromEntries(Object.entries(e).map((([e,n])=>{if("dashPattern"===e){const t=Qt(n);return t.value=t.value.join(", "),[e,t]}return[e,Qt(n)]}))),breakpoint:Wt,radius:Gt,spacing:Gt,motion:e=>Object.assign(Object.assign({type:{value:e.transitionType.value,type:"string"},duration:{value:e.duration.value,type:"number",unit:"s"}},e.direction?{direction:{value:e.direction.value,type:"string"}}:{}),{easing:{value:e.easingType.value.replace("cubicBezier","cubic-bezier"),type:"string"},easingFunction:e.easingFunction}),opacity:({opacity:e})=>({value:e.value,type:e.type})},Yt=(e,n=2)=>{if(void 0===e)return;if("number"!=typeof e||"number"!=typeof n)throw new Error(`Invalid parameters, both value "${e}" (${typeof e}) and decimalPlaces "${n}" (${typeof n}) must be of type number`);const t=Math.pow(10,n);return Math.round(e*t)/t},Xt=(e,{excludeExtensionProp:n})=>{if(!0!==n)return{extensions:Object.assign({},e.extensions)}},Zt=(e,n="/",t=".")=>e.split(n).join(t).toLowerCase(),Jt=e=>"pixel"===e.lineHeight.unit?Yt(e.lineHeight.value,3):"percent"===e.lineHeight.unit?Yt(e.fontSize.value*(e.lineHeight.value/100),3):Yt(1.2*e.fontSize.value,3),er=e=>"pixel"===e.letterSpacing.unit?Yt(e.letterSpacing.value,3):"percent"===e.letterSpacing.unit?Yt(e.fontSize.value*(e.letterSpacing.value/100),3):void 0,nr=({values:e})=>({value:e.width.value,type:"dimension"}),tr=({values:e})=>({fontSize:{type:"dimension",value:e.fontSize.value},textDecoration:{type:"string",value:e.textDecoration.value},fontFamily:{type:"string",value:e.fontFamily.value},fontWeight:{type:"number",value:e.fontWeight.value},fontStyle:{type:"string",value:e.fontStyle.value},fontStretch:{type:"string",value:e.fontStretch.value},letterSpacing:{type:"dimension",value:er(e)},lineHeight:{type:"dimension",value:Jt(e)},paragraphIndent:{type:"dimension",value:e.paragraphIndent.value},paragraphSpacing:{type:"dimension",value:e.paragraphSpacing.value},textCase:{type:"string",value:e.textCase.value}}),rr=e=>{var n,t,r;if(e.extensions&&e.extensions[cn.key.extensionPluginData]&&e.extensions[cn.key.extensionPluginData].alias)return{type:Object.hasOwnProperty.call(e.values[0],"fill")?"color":"custom-gradient",value:`{${e.extensions[cn.key.extensionPluginData].alias}}`,blendMode:(null===(r=null===(t=null===(n=e.values[0])||void 0===n?void 0:n.fill)||void 0===t?void 0:t.blendMode)||void 0===r?void 0:r.toLowerCase())||"normal"};const a=e.values.map((e=>Object.hasOwnProperty.call(e,"fill")?(({fill:e})=>{var n;return{type:"color",value:Bt(e.value),blendMode:(null===(n=e.blendMode)||void 0===n?void 0:n.toLowerCase())||"normal"}})(e):(({gradientType:e,rotation:n,stops:t,opacity:r})=>({type:"custom-gradient",value:{gradientType:e.value,rotation:n.value,stops:t.map((e=>({position:e.position.value,color:Bt(Object.assign(Object.assign({},e.color.value),{a:e.color.value.a*r.value}))})))}}))(e)));return 1===a.length?a[0]:Object.assign({},a)},ar={size:nr,color:rr,gradient:rr,font:({values:e})=>({type:"custom-fontStyle",value:{fontSize:e.fontSize.value,textDecoration:e.textDecoration.value,fontFamily:e.fontFamily.value,fontWeight:e.fontWeight.value,fontStyle:e.fontStyle.value,fontStretch:e.fontStretch.value,letterSpacing:er(e),lineHeight:Jt(e),paragraphIndent:e.paragraphIndent.value,paragraphSpacing:e.paragraphSpacing.value,textCase:e.textCase.value}}),effect:({values:e})=>{const n=e.map((e=>{return["dropShadow","innerShadow"].includes(e.effectType.value)?{type:"custom-shadow",value:{shadowType:(n=e).effectType.value,radius:n.radius.value,color:Bt(n.color.value),offsetX:n.offset.x.value,offsetY:n.offset.y.value,spread:n.spread.value}}:null;var n}));return 1===n.length?n[0]:Object.assign({},n)},grid:({values:e})=>{const n=e.map((e=>({type:"custom-grid",value:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({pattern:e.pattern.value},e.sectionSize?{sectionSize:e.sectionSize.value}:{}),e.gutterSize?{gutterSize:e.gutterSize.value}:{}),e.alignment?{alignment:e.alignment.value}:{}),e.count?{count:e.count.value}:{}),e.offset?{offset:e.offset.value}:{})})));return 1===n.length?n[0]:Object.assign({},n)},border:({values:e})=>({type:"custom-stroke",value:{align:e.strokeAlign.value,dashPattern:e.dashPattern.value,lineCap:e.strokeCap.value,lineJoin:e.strokeJoin.value,miterLimit:e.strokeMiterLimit.value,weight:e.strokeWeight.value,color:Bt(e.stroke.value)}}),breakpoint:nr,radius:({values:e})=>({type:"custom-radius",value:{smoothing:e.smoothing.value,topLeft:e.radii.topLeft.value,topRight:e.radii.topRight.value,bottomLeft:e.radii.bottomLeft.value,bottomRight:e.radii.bottomRight.value}}),spacing:({values:e})=>({type:"custom-spacing",value:{top:e.top.value,bottom:e.bottom.value,left:e.left.value,right:e.right.value}}),motion:({values:e})=>({type:"custom-transition",value:Object.assign(Object.assign({transitionType:e.transitionType.value,duration:e.duration.value},e.direction?{direction:e.direction.value}:{}),{easingType:e.easingCurveType.value,easingFunction:Object.fromEntries(Object.entries(e.easingFunction).map((([e,n])=>[e,n.value])))})}),opacity:({values:e})=>({value:e.opacity.value,type:"custom-opacity"})},lr=(e,n)=>"typography"===e.category?{name:e.name,description:e.description,value:tr(e),type:"typography"}:"variables"===e.extensions[cn.key.extensionPluginData].exportKey?Object.assign(Object.assign({name:e.name,description:e.description},(({values:e,category:n})=>{var t;return/^{[^{}]*}$/.test(e)?{type:n,value:Zt(e,"/",".")}:"color"===n?{type:"color",value:Bt(e.fill.value),blendMode:(null===(t=e.fill.blendMode)||void 0===t?void 0:t.toLowerCase())||"normal"}:["dimension","boolean","string"].includes(n)?{type:n,value:e}:void 0})(e)),Xt(e,n)):Object.assign(Object.assign({name:e.name,description:e.description},(e=>ar[e.category](e))(e)),Xt(e,n)),or=(e,n)=>{const t=e=>e&&"object"==typeof e;return t(e)&&t(n)?(Object.keys(n).forEach((r=>{const a=e[r],l=n[r];Array.isArray(a)&&Array.isArray(l)?e[r]=a.concat(l):t(a)&&t(l)?e[r]=or(Object.assign({},a),l):e[r]=l})),e):n},ir=or,sr=(e,n,t)=>{if("string"==typeof e&&""!==e)return e;throw new Error(`converting "${n}" to ${t}, resulting in "${e}"`)},ur=(e,n="default")=>"camelCase"===n?(e=>{const n=e.toLowerCase().replace(/['"]/g,"").replace(/([-_ ]){1,}/g," ").replace(/\W+/g," ").trim().replace(/ (.)/g,(function(e){return e.toUpperCase()})).replace(/ /g,"");return sr(n,e,"camelCase")})(e):"kebabCase"===n?(e=>{const n=e.toLowerCase().replace(/['"]/g,"").replace(/([-_ ]){1,}/g," ").replace(/\W+/g," ").trim().replace(/ /g,"-");return sr(n,e,"kebabCase")})(e):e.trim().toLowerCase(),cr={color:{label:"Colors",key:"color"},gradient:{label:"Gradients",key:"gradient"},font:{label:"Font Styles",key:"font"},typography:{label:"Typography",key:"typography",exclude:["original"]},effect:{label:"Effects",key:"effect"},grid:{label:"Grids",key:"grid"},border:{label:"Borders",key:"border"},breakpoint:{label:"Breakpoints",key:"breakpoint"},radius:{label:"Radii",key:"radius"},size:{label:"Sizes",key:"size"},spacing:{label:"Spacing",key:"spacing"},motion:{label:"Motion",key:"motion"},opacity:{label:"Opacity",key:"opacity"},variables:{label:"Figma Variables (BETA)",key:"variables",exclude:["original"]}},dr=e=>{var n,t;return void 0!==(null===(t=null===(n=e.extensions)||void 0===n?void 0:n[cn.key.extensionPluginData])||void 0===t?void 0:t.exportKey)?e.extensions[cn.key.extensionPluginData].exportKey:"missingExportKey"},fr={original:(e,n)=>"variables"===e.extensions[cn.key.extensionPluginData].exportKey?null:Object.assign(Object.assign({name:e.name,category:e.category,exportKey:e.extensions[cn.key.extensionPluginData].exportKey},e.description&&e.description.length>0&&{comment:e.description}),Kt[e.category](e.values)||{}),standard:lr,standardDeprecated:lr},pr=(e,n)=>"standard"===n.tokenFormat?JSON.parse(JSON.stringify(e.filter((e=>e.category===cr.font.key)))).map((e=>(e.name="typography/"+e.name.substr(e.name.indexOf("/")+1).trim().trimStart(),e.category=cr.typography.key,e.exportKey=cr.typography.key,!0!==n.excludeExtensionProp&&(e.extensions[cn.key.extensionPluginData].exportKey=cr.typography.key),e))):[],gr=(e,n)=>{0===e.length&&(e="[{}]");let t=JSON.parse(e);t=[...t,...pr(t,n)];const r=((e,n)=>e.length<=0?[]:e.map((e=>{var t,r,a,l;if(!1===n.prefixInName&&"variables"!==e.exportKey)e.name=e.name.substr(e.name.indexOf("/")+1).trim().trimLeft();else if(void 0!==(null===(r=null===(t=e.extensions)||void 0===t?void 0:t[cn.key.extensionPluginData])||void 0===r?void 0:r.alias)){const n=e.name.substr(0,e.name.indexOf("/")).trim().trimLeft();e.extensions[cn.key.extensionPluginData].alias=`${n}.${e.extensions[cn.key.extensionPluginData].alias}`}return n.keyInName&&(e.name=`${dr(e)}/${e.name}`,void 0!==(null===(l=null===(a=e.extensions)||void 0===a?void 0:a[cn.key.extensionPluginData])||void 0===l?void 0:l.alias)&&(e.extensions[cn.key.extensionPluginData].alias=`${dr(e)}.${e.extensions[cn.key.extensionPluginData].alias}`)),e})))(t.filter((({exportKey:e})=>n.exports[e])),n),a=r.map((e=>fr[n.tokenFormat](e,n))).filter(Boolean),l=((e,n)=>{if(e.length<=0)return[];const t=e.map((e=>{const t=e.name.split("/").map((e=>ur(e,n.nameConversion)));return delete e.name,r=e,t.reduceRight(((e,n)=>({[n]:e})),r);var r}));return t.reduce(((e={},n)=>ir(e,n)))})(a,n);return l},hr=(e,n=!0)=>!0===n?JSON.stringify(e):JSON.stringify(e,null,2);var mr=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a