@typecad/typecad
Version:
🤖programmatically 💥create 🛰️hardware
1 lines • 27 kB
JavaScript
var __classPrivateFieldSet=this&&this['__classPrivateFieldSet']||function(_0x2580c8,_0x4ef516,_0x39e5df,_0x4dfabb,_0x224bb7){if(_0x4dfabb==='m')throw new TypeError('Private\x20method\x20is\x20not\x20writable');function _0x23965e(_0x3275e9,_0x1c2ddb){return a1_0x14a3(_0x3275e9- -0xf2,_0x1c2ddb);}if(_0x4dfabb==='a'&&!_0x224bb7)throw new TypeError('Private\x20accessor\x20was\x20defined\x20without\x20a\x20setter');if(typeof _0x4ef516==='function'?_0x2580c8!==_0x4ef516||!_0x224bb7:!_0x4ef516['has'](_0x2580c8))throw new TypeError('Cannot\x20write\x20private\x20member\x20to\x20an\x20object\x20whose\x20class\x20did\x20not\x20declare\x20it');return _0x4dfabb==='a'?_0x224bb7['call'](_0x2580c8,_0x39e5df):_0x224bb7?_0x224bb7['value']=_0x39e5df:_0x4ef516[_0x23965e(-0xf2,-0xe4)](_0x2580c8,_0x39e5df),_0x39e5df;},__classPrivateFieldGet=this&&this[a1_0x26c6c7(-0x375,-0x394)]||function(_0x2b1aa8,_0x32ed20,_0x1c07f2,_0x2fcfa2){if(_0x1c07f2==='a'&&!_0x2fcfa2)throw new TypeError('Private\x20accessor\x20was\x20defined\x20without\x20a\x20getter');if(typeof _0x32ed20===_0x20bde5(-0x25b,-0x25c)?_0x2b1aa8!==_0x32ed20||!_0x2fcfa2:!_0x32ed20[_0x20bde5(-0x25a,-0x235)](_0x2b1aa8))throw new TypeError('Cannot\x20read\x20private\x20member\x20from\x20an\x20object\x20whose\x20class\x20did\x20not\x20declare\x20it');function _0x20bde5(_0xacc6f3,_0x4f31c0){return a1_0x14a3(_0xacc6f3- -0x25d,_0x4f31c0);}return _0x1c07f2==='m'?_0x2fcfa2:_0x1c07f2==='a'?_0x2fcfa2['call'](_0x2b1aa8):_0x2fcfa2?_0x2fcfa2['value']:_0x32ed20['get'](_0x2b1aa8);},_Component_footprint_file,_Component_symbol_file,_Component_isInitialized;import a1_0x377e98 from'fast-sexpr';import{randomUUID}from'node:crypto';function a1_0x14a3(_0x2718ed,_0x14a328){const _0xcb463c=a1_0x2718();return a1_0x14a3=function(_0x3fbdde,_0x4e2f28){_0x3fbdde=_0x3fbdde-0x0;let _0x2d3cc3=_0xcb463c[_0x3fbdde];return _0x2d3cc3;},a1_0x14a3(_0x2718ed,_0x14a328);}import a1_0x449a95 from'node:fs';import a1_0x37d299 from's-expression.js';function a1_0x2718(){const _0x4e9cf3=['set','__classPrivateFieldGet','function','has','footprint','voltage','front','via','symbol','_uuid','file','Parser','default','line','init','type','arguments','ObjectExpression','loc','left','Identifier','right','split','key','value','StringLiteral','NumericLiteral','BooleanLiteral','TemplateLiteral','trim','startsWith','sourceInfo','indexOf','substring','endsWith','null','map','push','test','👺\x20Error:','setReference','includes','Unknown',']\x20Footprint\x20must\x20be\x20in\x20format\x20\x22library:footprint\x22\x20(e.g.,\x20\x22Resistor_SMD:R_0603_1608Metric\x22\x20or\x20\x22lib:Local_Footprint\x22))','exit','include','model','fontSize','Reference','text','Value','rotation','width','height','bold','fab','show','node_modules','anonymous','component.ts','uuid','pins','isInGroup','groups','getGroups','ignore','log','./build/lib/footprints/','message','reference','getLibraryPaths','existsSync','.kicad_sym','isArray','serialize','readFileSync','prettyPrintSExpr','min','join'];a1_0x2718=function(){return _0x4e9cf3;};return a1_0x2718();}import{KiCAD}from'./kicad';import{Pin}from'./pin';import a1_0x295904 from'chalk';import{ReferenceCounter}from'./reference_counter';import*as a1_0xcb375c from'acorn';import{simple as a1_0x177ec9}from'acorn-walk';import{upgradeFootprint}from'./kicad_commands';const referenceCounter=new ReferenceCounter(),S=new a1_0x37d299();export class Component{constructor({reference:_0x34f806,value:_0x1e2193,footprint:_0x171a88,prefix:_0x3d1af9,datasheet:_0x455930,description:_0x514896,voltage:_0x58ed8a,wattage:_0x297dd4,mpn:_0x36fa1a,via:_0x3afa62,uuid:_0x12ff43,simulation:_0x4b8385,symbol:_0x4d18a3,sch:_0xeba95b,pcb:_0x59286c,viaData:_0x3c3681,text:_0x38bb9c,fab:_0x535f32}={}){this['reference']='',this['value']='',this[_0x476fec(0x268,0x273)]='',this['datasheet']='',this['description']='',this[_0x476fec(0x270,0x274)]='',this['wattage']='',this['mpn']='',this['pcb']={'x':0x0,'y':0x0,'rotation':0x0,'side':_0x476fec(0x281,0x275)},this['dnp']=![],_Component_footprint_file['set'](this,''),_Component_symbol_file[_0x476fec(0x252,0x26f)](this,''),this['pins']=[],this[_0x476fec(0x25f,0x276)]=![],this['simulation']={'include':![],'model':''},this[_0x476fec(0x293,0x277)]='',this['sch']={'x':0x0,'y':0x0,'rotation':0x0},this['groups']=[],this['text']=[],_Component_isInitialized[_0x476fec(0x263,0x26f)](this,![]),this[_0x476fec(0x284,0x278)]='',this['_gettingUuid']=![];const _0x4f97f3=this['getCallSiteForInstantiation']();if(_0x4f97f3){this['sourceInfo']={'file':_0x4f97f3['file'],'line':_0x4f97f3['line'],'variable':undefined,'params':undefined};let _0x4b350c='';try{_0x4b350c=a1_0x449a95['readFileSync'](_0x4f97f3[_0x476fec(0x25b,0x279)],'utf8');let _0x295736;try{const _0x2f9e6a=require('acorn-typescript'),_0x24eddf=a1_0xcb375c[_0x476fec(0x27c,0x27a)]['extend'](_0x2f9e6a[_0x476fec(0x25d,0x27b)]?_0x2f9e6a['default']():_0x2f9e6a());_0x295736=_0x24eddf['parse'](_0x4b350c,{'ecmaVersion':0x7e6,'sourceType':'module','locations':!![],'allowReturnOutsideFunction':!![],'allowImportExportEverywhere':!![]});}catch(_0x1e4cd0){_0x295736=a1_0xcb375c['parse'](_0x4b350c,{'ecmaVersion':0x7e6,'sourceType':'module','locations':!![],'allowReturnOutsideFunction':!![],'allowImportExportEverywhere':!![]});}let _0x25ab1a,_0x4ee3d5;const _0x5c99d8=_0x4f97f3[_0x476fec(0x271,0x27c)];let _0xc6501b=![];a1_0x177ec9(_0x295736,{'VariableDeclaration'(_0x3627ac){function _0xb177da(_0x26880f,_0x32fffd){return a1_0x14a3(_0x32fffd- -0xc3,_0x26880f);}_0x3627ac['loc']&&_0x3627ac['loc']['start']['line']>=_0x4f97f3[_0xb177da(-0xb2,-0xb6)]-0x5&&_0x3627ac['loc']['end']['line']>=_0x4f97f3['line']&&_0x3627ac['declarations']['forEach'](_0x232b0f=>{function _0x118408(_0x3a1c76,_0x1e0b43){return a1_0x14a3(_0x1e0b43- -0x123,_0x3a1c76);}if(_0x232b0f['init']&&_0x232b0f[_0x118408(-0x11b,-0x115)]['type']==='NewExpression'&&_0x232b0f['init']['callee'][_0x118408(-0x11a,-0x114)]==='Identifier'){if(_0x232b0f['init']['loc']&&_0x232b0f['init']['loc']['start'][_0x118408(-0x115,-0x116)]<=_0x4f97f3['line']&&_0x232b0f['init']['loc']['end']['line']>=_0x4f97f3['line']){_0x232b0f['id']&&_0x232b0f['id']['type']==='Identifier'&&(_0x25ab1a=_0x232b0f['id']['name'],_0xc6501b=!![]);const _0x3eee5c=_0x232b0f[_0x118408(-0x12d,-0x115)][_0x118408(-0x121,-0x113)][0x0];_0x3eee5c&&_0x3eee5c[_0x118408(-0xf3,-0x114)]===_0x118408(-0x112,-0x112)&&(_0x4ee3d5=_0x31e1d(_0x3eee5c));}}});},'AssignmentExpression'(_0x30739b){function _0x43ef04(_0x4cee5f,_0x3f32bc){return a1_0x14a3(_0x3f32bc-0x3d7,_0x4cee5f);}if(_0x30739b['loc']&&_0x30739b['loc']['start'][_0x43ef04(0x3bd,0x3e4)]>=_0x4f97f3['line']-0x5&&_0x30739b[_0x43ef04(0x3e8,0x3e9)]['end']['line']>=_0x4f97f3[_0x43ef04(0x3ec,0x3e4)]&&_0x30739b['right']['type']==='NewExpression'&&_0x30739b[_0x43ef04(0x3f9,0x3ea)][_0x43ef04(0x3e4,0x3e6)]===_0x43ef04(0x3f6,0x3eb)){if(_0x30739b['right']['loc']&&_0x30739b['right']['loc']['start']['line']<=_0x4f97f3['line']&&_0x30739b['right']['loc']['end'][_0x43ef04(0x404,0x3e4)]>=_0x4f97f3['line']){_0x25ab1a=_0x30739b['left']['name'],_0xc6501b=!![];const _0x3c55ba=_0x30739b[_0x43ef04(0x3d9,0x3ec)]['arguments'][0x0];_0x3c55ba&&_0x3c55ba['type']==='ObjectExpression'&&(_0x4ee3d5=_0x31e1d(_0x3c55ba));}}}});if(!_0xc6501b&&_0x4f97f3['line']>0x1){const _0x2fe4c0=_0x4b350c[_0x476fec(0x268,0x285)]('\x0a');let _0x2cc815=_0x4f97f3['line']-0x1;while(_0x2cc815>=Math['max'](0x0,_0x4f97f3['line']-0x14)){const _0x14e8bb=_0x2fe4c0[_0x2cc815],_0x91f0bd=_0x14e8bb['match'](/^\s*(let|const|var)\s+(\w+)\s*=\s*new\s+\w+\s*\(/);if(_0x91f0bd){_0x25ab1a=_0x91f0bd[0x2],_0xc6501b=!![];break;}_0x2cc815--;}}function _0x31e1d(_0x39954a){const _0x1830e0={};return _0x39954a['properties']['forEach'](_0xb5bcad=>{function _0x2d749a(_0x5c6fa5,_0x18db69){return a1_0x14a3(_0x18db69- -0x362,_0x5c6fa5);}if(_0xb5bcad[_0x2d749a(-0x372,-0x34b)]&&_0xb5bcad['key']['type']==='Identifier'&&_0xb5bcad['value']){const _0x50b8db=_0xb5bcad['key']['name'];_0x1830e0[_0x50b8db]=_0x2ed832(_0xb5bcad['value']);}}),_0x1830e0;}function _0x2ed832(_0x3e2df2){function _0x377de1(_0x211d98,_0x5b7c92){return a1_0x14a3(_0x211d98- -0x15b,_0x5b7c92);}switch(_0x3e2df2['type']){case'Literal':return _0x3e2df2[_0x377de1(-0x143,-0x153)];case _0x377de1(-0x142,-0x15c):return _0x3e2df2[_0x377de1(-0x143,-0x165)];case _0x377de1(-0x141,-0x136):return _0x3e2df2['value'];case _0x377de1(-0x140,-0x123):return _0x3e2df2['value'];case'ObjectExpression':return _0x31e1d(_0x3e2df2);case'ArrayExpression':return _0x3e2df2['elements']['map'](_0x2ed832);case'Identifier':return _0x3e2df2['name'];case _0x377de1(-0x13f,-0x124):if(_0x3e2df2['quasis']&&_0x3e2df2['quasis']['length']>0x0)return _0x3e2df2['quasis'][0x0][_0x377de1(-0x143,-0x139)]['raw'];return undefined;default:return undefined;}}_0x25ab1a&&(this['sourceInfo']['variable']=_0x25ab1a,this['sourceInfo']['params']=_0x4ee3d5);}catch(_0x13378e){try{const _0x51ece4=_0x4b350c[_0x476fec(0x286,0x285)]('\x0a'),_0x21cdb9=Math['max'](0x0,_0x4f97f3['line']-0xa),_0x43a8a1=Math['min'](_0x51ece4['length'],_0x4f97f3['line']+0xa),_0xa95848=_0x51ece4['slice'](_0x21cdb9,_0x43a8a1)['join']('\x0a'),_0x121d19=_0xa95848['match'](/^\s*(let|const|var)\s+(\w+)\s*=\s*new\s+\w+\s*\(\s*\{[\s\S]*?\}\s*\)\s*;?\s*$/m);if(_0x121d19&&_0x121d19['length']>0x2){this['sourceInfo']['variable']=_0x121d19[0x2];const _0x152a28=_0xa95848['match'](/new\s+\w+\s*\(\s*(\{[\s\S]*?\})\s*\)\s*;?\s*$/m);if(_0x152a28&&_0x152a28[0x1]){const _0x1ab737=_0x152a28[0x1]['trim']();this['sourceInfo']['params']=_0x5d27b8(_0x1ab737);}}else{const _0x1df62a=_0x51ece4[_0x4f97f3['line']-0x1],_0x1f51c0=_0x1df62a['match'](/^\s*(let|const|var)\s+(\w+)\s*=\s*new\s+\w+\s*\((.*)\)\s*;?\s*$/);if(_0x1f51c0&&_0x1f51c0['length']>0x3){this['sourceInfo']['variable']=_0x1f51c0[0x2];const _0x15e31a=_0x1f51c0[0x3][_0x476fec(0x2ae,0x28c)]();_0x15e31a&&(_0x15e31a[_0x476fec(0x268,0x28d)]('{')&&_0x15e31a['endsWith']('}')&&(this[_0x476fec(0x2a1,0x28e)]['params']=_0x5d27b8(_0x15e31a)));}}}catch(_0x2e1b92){}}}function _0x5d27b8(_0x41edf5){const _0x5de6ce={};function _0xc346d4(_0x1354d8,_0x269464){return a1_0x14a3(_0x269464- -0x2c9,_0x1354d8);}const _0xa8f8d5=_0x41edf5['slice'](0x1,-0x1)['trim'](),_0x3e4f8d=_0x324a99(_0xa8f8d5);for(const _0x55e565 of _0x3e4f8d){const _0x2f0eb1=_0x55e565[_0xc346d4(-0x2bc,-0x2a9)](':');if(_0x2f0eb1>0x0){const _0x303224=_0x55e565['substring'](0x0,_0x2f0eb1)['trim'](),_0xdd058=_0x55e565[_0xc346d4(-0x28d,-0x2a8)](_0x2f0eb1+0x1)['trim']();_0x303224&&_0xdd058&&(_0x5de6ce[_0x303224]=_0x44e734(_0xdd058));}}return _0x5de6ce;}function _0x324a99(_0x4cb27f){const _0x4db9fd=[];let _0x3cd943='',_0x4557ff=0x0;function _0x4830cc(_0x55efa5,_0x2c8086){return a1_0x14a3(_0x55efa5-0x219,_0x2c8086);}let _0x12c680=0x0;for(let _0x4ab83d=0x0;_0x4ab83d<_0x4cb27f['length'];_0x4ab83d++){const _0x33d794=_0x4cb27f[_0x4ab83d];_0x3cd943+=_0x33d794;if(_0x33d794==='{')_0x4557ff++;if(_0x33d794==='}')_0x4557ff--;if(_0x33d794==='[')_0x12c680++;if(_0x33d794===']')_0x12c680--;_0x33d794===','&&_0x4557ff===0x0&&_0x12c680===0x0&&(_0x4db9fd['push'](_0x3cd943['slice'](0x0,-0x1)[_0x4830cc(0x236,0x252)]()),_0x3cd943='');}return _0x3cd943['trim']()&&_0x4db9fd['push'](_0x3cd943['trim']()),_0x4db9fd;}function _0x44e734(_0x417786){_0x417786=_0x417786['trim']();if(_0x417786[_0x13610a(0xca,0xd9)]('\x22')&&_0x417786['endsWith']('\x22')||_0x417786['startsWith']('\x27')&&_0x417786[_0x13610a(0xce,0xf2)]('\x27'))return _0x417786['slice'](0x1,-0x1);if(!isNaN(Number(_0x417786)))return Number(_0x417786);if(_0x417786==='true')return!![];if(_0x417786==='false')return![];if(_0x417786===_0x13610a(0xcf,0xe2))return null;if(_0x417786==='undefined')return undefined;function _0x13610a(_0x1544f8,_0x1b7013){return a1_0x14a3(_0x1544f8-0xac,_0x1b7013);}if(_0x417786['startsWith']('{')&&_0x417786['endsWith']('}'))return _0x5d27b8(_0x417786);if(_0x417786[_0x13610a(0xca,0xba)]('[')&&_0x417786['endsWith'](']')){const _0x1bfefc=_0x417786['slice'](0x1,-0x1)[_0x13610a(0xc9,0xcc)]();if(!_0x1bfefc)return[];const _0x313ef4=_0x466810(_0x1bfefc);return _0x313ef4[_0x13610a(0xd0,0xba)](_0x44e734);}return _0x417786;}function _0x466810(_0x2638ad){function _0x395d2d(_0x155aaf,_0x50c37c){return a1_0x14a3(_0x50c37c-0x2ce,_0x155aaf);}const _0x1a6f21=[];let _0x2dd407='',_0x53bb4d=0x0,_0x39fdf6=0x0,_0x23161b='';for(let _0x4d04ce=0x0;_0x4d04ce<_0x2638ad['length'];_0x4d04ce++){const _0x1de9ba=_0x2638ad[_0x4d04ce];_0x2dd407+=_0x1de9ba;if((_0x1de9ba==='\x22'||_0x1de9ba==='\x27')&&!_0x23161b)_0x23161b=_0x1de9ba;else _0x1de9ba===_0x23161b&&(_0x23161b='');if(!_0x23161b){if(_0x1de9ba==='{')_0x53bb4d++;if(_0x1de9ba==='}')_0x53bb4d--;if(_0x1de9ba==='[')_0x39fdf6++;if(_0x1de9ba===']')_0x39fdf6--;}_0x1de9ba===','&&_0x53bb4d===0x0&&_0x39fdf6===0x0&&!_0x23161b&&(_0x1a6f21['push'](_0x2dd407['slice'](0x0,-0x1)[_0x395d2d(0x30f,0x2eb)]()),_0x2dd407='');}return _0x2dd407['trim']()&&_0x1a6f21[_0x395d2d(0x30e,0x2f3)](_0x2dd407['trim']()),_0x1a6f21;}let _0x3dc683,_0x6ce911;if(_0x34f806!=undefined){if(Array['isArray'](_0x34f806)){const _0x1cec07=_0x34f806[0x0];_0x6ce911=_0x34f806[0x1],_0x1cec07&&_0x1cec07!==''?_0x3dc683=_0x1cec07:_0x3dc683=undefined;}else typeof _0x34f806==='object'?(_0x6ce911=_0x34f806,_0x3dc683=undefined):_0x3dc683=_0x34f806;if(_0x3dc683!=undefined&&_0x3dc683!==''){this['reference']=_0x3dc683;const _0x2dc217=/^[A-Za-z]+\d+$/;!_0x2dc217[_0x476fec(0x277,0x295)](_0x3dc683)&&(process['stdout']['write'](a1_0x295904['bgRed'](_0x476fec(0x27f,0x296))+a1_0x295904['bold']('\x20['+_0x3dc683+',\x20'+_0x1e2193+',\x20'+_0x171a88+']\x20Pin\x20number\x20must\x20be\x20a\x20number\x20or\x20a\x20string'+'\x0a')),process['exit'](0x1)),!referenceCounter[_0x476fec(0x2af,0x297)](_0x3dc683)&&(this['reference']=referenceCounter['getNextReference'](_0x3d1af9||'U'),process['stdout']['write'](a1_0x295904['whiteBright']['bgYellow']('🚩\x20\x20renaming\x20'+_0x3dc683+'\x20to\x20'+this['reference']+'\x0a')));}else this['reference']=referenceCounter['getNextReference'](_0x3d1af9||'U');}else this['reference']=referenceCounter['getNextReference'](_0x3d1af9||'U');let _0x31259e,_0x5a7e76;if(_0x1e2193!=undefined){if(Array['isArray'](_0x1e2193))_0x31259e=_0x1e2193[0x0],_0x5a7e76=_0x1e2193[0x1];else typeof _0x1e2193==='object'?(_0x5a7e76=_0x1e2193,_0x31259e=''):_0x31259e=_0x1e2193;_0x31259e!==undefined&&(this['value']=_0x31259e);}_0x171a88!=undefined&&(_0x171a88&&!_0x171a88[_0x476fec(0x2b0,0x298)](':')&&(process['stdout']['write'](a1_0x295904['bgRed']('👺\x20Error:')+a1_0x295904['bold']('\x20['+(_0x34f806||'Unknown')+',\x20'+(_0x1e2193||_0x476fec(0x2c0,0x299))+',\x20'+_0x171a88+_0x476fec(0x283,0x29a))+'\x0a'),process[_0x476fec(0x277,0x29b)](0x1)),this['footprint']=_0x171a88);if(_0x455930!=undefined)this['datasheet']=_0x455930;if(_0x514896!=undefined)this['description']=_0x514896;if(_0x58ed8a!=undefined)this['voltage']=_0x58ed8a;if(_0x297dd4!=undefined)this['wattage']=_0x297dd4;if(_0x4d18a3!=undefined)this[_0x476fec(0x28a,0x277)]=_0x4d18a3;if(_0xeba95b!=undefined)this['sch']=_0xeba95b;if(_0x59286c!=undefined)this['pcb']=_0x59286c;if(_0x36fa1a!=undefined)this['mpn']=_0x36fa1a;if(_0x4b8385!=undefined)this['simulation']={'include':_0x4b8385[_0x476fec(0x27e,0x29c)],'model':_0x4b8385[_0x476fec(0x2a5,0x29d)]||''};this['via']=_0x3afa62||![];_0x3c3681&&(this['viaData']=_0x3c3681);_0x38bb9c!=undefined&&(this['text']=_0x38bb9c);function _0x476fec(_0x4b5f07,_0x240291){return a1_0x14a3(_0x240291-0x26f,_0x4b5f07);}if(_0x6ce911){const _0x2bf474={'property':'Reference','text':this['reference'],'x':_0x6ce911['x'],'y':_0x6ce911['y'],'rotation':_0x6ce911['rotation'],'layer':_0x6ce911['layer'],'width':_0x6ce911['width'],'height':_0x6ce911['height'],'fontSize':_0x6ce911[_0x476fec(0x281,0x29e)],'thickness':_0x6ce911['thickness'],'bold':_0x6ce911['bold'],'italic':_0x6ce911['italic'],'justify':_0x6ce911['justify'],'show':_0x6ce911['show']},_0x2c0d8a=this['text']['findIndex'](_0x49be54=>_0x49be54['property']===_0x476fec(0x2af,0x29f));_0x2c0d8a>=0x0?this['text'][_0x2c0d8a]=_0x2bf474:this[_0x476fec(0x2b1,0x2a0)]['push'](_0x2bf474);}if(_0x5a7e76){const _0x1ef33e={'property':_0x476fec(0x289,0x2a1),'text':this['value'],'x':_0x5a7e76['x'],'y':_0x5a7e76['y'],'rotation':_0x5a7e76[_0x476fec(0x28d,0x2a2)],'layer':_0x5a7e76['layer'],'width':_0x5a7e76[_0x476fec(0x29b,0x2a3)],'height':_0x5a7e76[_0x476fec(0x2b1,0x2a4)],'fontSize':_0x5a7e76['fontSize'],'thickness':_0x5a7e76['thickness'],'bold':_0x5a7e76[_0x476fec(0x29a,0x2a5)],'italic':_0x5a7e76['italic'],'justify':_0x5a7e76['justify'],'show':_0x5a7e76['show']},_0x483641=this[_0x476fec(0x2bd,0x2a0)]['findIndex'](_0x1f341e=>_0x1f341e['property']==='Value');_0x483641>=0x0?this['text'][_0x483641]=_0x1ef33e:this[_0x476fec(0x287,0x2a0)][_0x476fec(0x27f,0x294)](_0x1ef33e),this['valueFootprint']={'x':_0x5a7e76['x'],'y':_0x5a7e76['y'],'rotation':_0x5a7e76[_0x476fec(0x2c3,0x2a2)],'layer':_0x5a7e76['layer'],'width':_0x5a7e76['width'],'height':_0x5a7e76[_0x476fec(0x2ad,0x2a4)],'fontSize':_0x5a7e76[_0x476fec(0x29a,0x29e)],'thickness':_0x5a7e76['thickness'],'bold':_0x5a7e76['bold'],'italic':_0x5a7e76['italic'],'justify':_0x5a7e76['justify'],'show':_0x5a7e76['show']};}if(_0x535f32!=undefined){let _0x352181,_0x41ff6a;Array['isArray'](_0x535f32)?(_0x352181=_0x535f32[0x0]||'${REFERENCE}',(!_0x352181||_0x352181==='')&&(_0x352181='${REFERENCE}'),_0x41ff6a=_0x535f32[0x1]):(_0x352181='${REFERENCE}',_0x41ff6a=_0x535f32),this[_0x476fec(0x2ca,0x2a6)]={'text':_0x352181,'x':_0x41ff6a['x'],'y':_0x41ff6a['y'],'rotation':_0x41ff6a['rotation'],'layer':_0x41ff6a['layer'],'width':_0x41ff6a['width'],'height':_0x41ff6a['height'],'fontSize':_0x41ff6a[_0x476fec(0x2b5,0x29e)],'thickness':_0x41ff6a['thickness'],'bold':_0x41ff6a['bold'],'italic':_0x41ff6a['italic'],'justify':_0x41ff6a['justify'],'show':_0x41ff6a[_0x476fec(0x2c1,0x2a7)]};}_0x12ff43!=undefined&&(this['_uuid']=_0x12ff43);if(this['via']){}else{}__classPrivateFieldSet(this,_Component_isInitialized,!![],'f');}['getCallSite'](){const _0x5d9a23=new Error()['stack']?.['split']('\x0a')||[];for(let _0x38adff=0x4;_0x38adff<_0x5d9a23['length'];_0x38adff++){const _0x4b9d3e=_0x5d9a23[_0x38adff][_0x28c567(0x1ed,0x1c5)]();if(_0x4b9d3e){const _0xcd14f6=_0x4b9d3e['match'](/at\s+(?:(.+?)\s+\()?(.+):(\d+):(\d+)\)?/);if(_0xcd14f6){const _0x5ec82b=_0xcd14f6[0x2];if(!_0x5ec82b['includes'](_0x28c567(0x209,0x201))&&!_0x5ec82b['includes']('\x5cdist\x5c')&&!_0x5ec82b[_0x28c567(0x1f9,0x208)]('/dist/')&&!_0x5ec82b[_0x28c567(0x1f9,0x1dd)]('component.ts')&&!_0x5ec82b['includes']('pcb.ts')&&!_0x5ec82b[_0x28c567(0x1f9,0x1e1)]('pcb_track_builder.ts'))return{'function':_0xcd14f6[0x1]?.['trim']()||_0x28c567(0x20a,0x1f3),'file':_0x5ec82b,'line':parseInt(_0xcd14f6[0x3],0xa),'column':parseInt(_0xcd14f6[0x4],0xa)};}}}function _0x28c567(_0x421cda,_0x3eccf9){return a1_0x14a3(_0x421cda-0x1d0,_0x3eccf9);}if(_0x5d9a23[0x3]){const _0x544a64=_0x5d9a23[0x3]['match'](/at\s+(?:(.+?)\s+\()?(.+):(\d+):(\d+)\)?/);if(_0x544a64){const _0x439426=_0x544a64[0x2];if(!_0x439426[_0x28c567(0x1f9,0x1f0)]('node_modules')&&!_0x439426['includes']('dist')&&!_0x439426[_0x28c567(0x1f9,0x1f6)]('component.ts'))return{'function':_0x544a64[0x1]?.['trim']()||'anonymous','file':_0x439426,'line':parseInt(_0x544a64[0x3],0xa),'column':parseInt(_0x544a64[0x4],0xa)};}}return null;}['getCallSiteForInstantiation'](){const _0x2ae957=new Error()['stack']?.['split']('\x0a')||[];for(let _0x58dd0f=0x3;_0x58dd0f<_0x2ae957['length'];_0x58dd0f++){const _0x101929=_0x2ae957[_0x58dd0f][_0x4a2190(-0x31b,-0x31a)]();if(_0x101929){const _0x491e3a=_0x101929['match'](/at\s+(?:(.+?)\s+\()?(.+):(\d+):(\d+)\)?/);if(_0x491e3a){const _0xffd0a7=_0x491e3a[0x2],_0x5cd62f=_0x491e3a[0x1]?.['trim']()||'anonymous';if(!_0xffd0a7['includes']('node_modules')&&!_0xffd0a7['includes']('\x5cdist\x5c')&&!_0xffd0a7[_0x4a2190(-0x334,-0x30e)]('/dist/')&&!_0xffd0a7['includes'](_0x4a2190(-0x2ea,-0x2fc))&&!_0xffd0a7['includes']('pcb.ts')&&!_0xffd0a7['includes']('pcb_track_builder.ts')&&!_0x5cd62f['includes']('Component')&&!_0x5cd62f['includes']('Resistor')&&!_0x5cd62f['includes']('ATtiny85'))return{'function':_0x5cd62f,'file':_0xffd0a7,'line':parseInt(_0x491e3a[0x3],0xa),'column':parseInt(_0x491e3a[0x4],0xa)};}}}function _0x4a2190(_0x72758b,_0x444aa4){return a1_0x14a3(_0x444aa4- -0x337,_0x72758b);}return null;}get['uuid'](){if(this[_0x20faca(-0x244,-0x230)]===''&&__classPrivateFieldGet(this,_Component_isInitialized,'f')){if(this['_gettingUuid'])return randomUUID();try{this['_gettingUuid']=!![],this[_0x20faca(-0x244,-0x22d)]=randomUUID();}finally{this['_gettingUuid']=![];}}function _0x20faca(_0x50e560,_0x5a4789){return a1_0x14a3(_0x50e560- -0x24d,_0x5a4789);}return this['_uuid'];}set['uuid'](_0x14b8b8){this['_uuid']=_0x14b8b8;}['pin'](_0x2deea9){function _0x8a1a0(_0x31580e,_0x5c2610){return a1_0x14a3(_0x5c2610-0x2aa,_0x31580e);}typeof _0x2deea9!=='number'&&typeof _0x2deea9!=='string'&&(process['stdout']['write'](a1_0x295904['bgRed']('👺\x20Error:')+a1_0x295904[_0x8a1a0(0x2e5,0x2e0)]('\x20Pin\x20number\x20must\x20be\x20a\x20number\x20or\x20a\x20string'+'\x0a')),process['exit'](0x1));const _0x3727f8=String(_0x2deea9),_0x28c4ee=this['pins']['find'](_0x14633d=>_0x14633d['number']===_0x3727f8);if(_0x28c4ee)return!_0x28c4ee['uuid']&&(_0x28c4ee[_0x8a1a0(0x2f0,0x2e6)]=this['uuid']),_0x28c4ee;const _0x457b5c=new Pin(this['reference'],_0x3727f8,undefined,this);return _0x457b5c['uuid']=this[_0x8a1a0(0x2e6,0x2e6)],this[_0x8a1a0(0x2c0,0x2e7)]['push'](_0x457b5c),_0x457b5c;}[a1_0x26c6c7(-0x343,-0x357)](_0x1519de){function _0x130351(_0x10e474,_0x79d75f){return a1_0x14a3(_0x79d75f-0x2c6,_0x10e474);}return this[_0x130351(0x321,0x305)]['includes'](_0x1519de);}[a1_0x26c6c7(-0x34e,-0x355)](){function _0x73b26b(_0x87bdcb,_0x244e93){return a1_0x14a3(_0x244e93-0x283,_0x87bdcb);}return[...this[_0x73b26b(0x2ab,0x2c2)]];}['footprint_lib'](_0x47646a){if(__classPrivateFieldGet(this,_Component_footprint_file,'f')!='')return __classPrivateFieldGet(this,_Component_footprint_file,'f');let _0x90d0a3='';function _0x51e698(_0xb03554,_0x427fcc){return a1_0x14a3(_0xb03554- -0x26c,_0x427fcc);}const _0x28d436=_0x47646a['split'](':');let _0x20352d='';const _0x18d8aa=new KiCAD(),_0x1ceafd=_0x18d8aa['getLibraryPaths']();_0x20352d=_0x1ceafd['footprints'];try{if(_0x20352d&&a1_0x449a95['existsSync'](_0x20352d+'/'+_0x28d436[0x0]+'.pretty/'+_0x28d436[0x1]+'.kicad_mod'))_0x90d0a3=a1_0x449a95['readFileSync'](_0x20352d+'/'+_0x28d436[0x0]+'.pretty/'+_0x28d436[0x1]+'.kicad_mod','utf8');else{try{upgradeFootprint('./build/lib/footprints/',{'stdio':_0x51e698(-0x22b,-0x22d)});}catch(_0x3ac462){console[_0x51e698(-0x22a,-0x23d)]('Footprint\x20upgrade\x20failed,\x20continuing\x20anyway');}const _0x4c3966=_0x51e698(-0x229,-0x222)+_0x28d436[0x1]+'.kicad_mod';if(!a1_0x449a95['existsSync'](_0x4c3966))throw new Error('Footprint\x20file\x20not\x20found:\x20'+_0x4c3966+'.\x20Is\x20the\x20.kicad_mod\x20missing\x20or\x20empty\x20in\x20build/footprints/?\x20Footprint\x20must\x20be\x20in\x20format\x20\x22library:footprint\x22\x20(e.g.,\x20\x22Resistor_SMD:R_0603_1608Metric\x22\x20or\x20\x22lib:Local_Footprint\x22)');_0x90d0a3=a1_0x449a95['readFileSync'](_0x4c3966,'utf8');}_0x90d0a3=_0x90d0a3['replaceAll']('\x22','`');const _0x3181c9=a1_0x377e98(_0x90d0a3)['pop']();_0x3181c9[0x0]=='module'&&(_0x3181c9[0x0]=_0x51e698(-0x268,-0x24d));const _0x5c4b79=S['serialize'](_0x3181c9)['replaceAll']('`','\x22');__classPrivateFieldSet(this,_Component_footprint_file,this['prettyPrintSExpr'](_0x5c4b79),'f');}catch(_0x15dd3e){const _0x4a6586=_0x15dd3e[_0x51e698(-0x228,-0x236)]||'Unknown\x20error\x20occurred\x20while\x20loading\x20footprint';throw new Error('['+(this[_0x51e698(-0x227,-0x238)]||'Unknown')+',\x20'+(this['value']||'Unknown')+',\x20'+_0x47646a+']\x20'+_0x4a6586);}if(__classPrivateFieldGet(this,_Component_footprint_file,'f')=='')throw new Error('['+(this['reference']||'Unknown')+',\x20'+(this['value']||_0x51e698(-0x242,-0x25b))+',\x20'+_0x47646a+']\x20Failed\x20to\x20load\x20footprint.\x20Footprint\x20file\x20is\x20empty\x20or\x20invalid.');return __classPrivateFieldGet(this,_Component_footprint_file,'f');}['symbol_lib'](_0x158fd5){function _0x2070bb(_0x454cbd,_0x535f68){return a1_0x14a3(_0x454cbd- -0x49,_0x535f68);}if(__classPrivateFieldGet(this,_Component_symbol_file,'f')!='')return __classPrivateFieldGet(this,_Component_symbol_file,'f');const _0x1ab596=_0x158fd5['split'](':');if(_0x1ab596['length']!==0x2)return console['warn']('Invalid\x20symbol\x20format:\x20'+_0x158fd5+'.\x20Expected\x20format\x20\x22library:symbol\x22'),'';const [_0x2eeb2c,_0x5e7425]=_0x1ab596;let _0x12d059='';const _0x538ef5=new KiCAD(),_0x5dafe4=_0x538ef5[_0x2070bb(-0x3,-0x12)](),_0x19ba3c=_0x5dafe4['symbols'];try{if(_0x19ba3c&&a1_0x449a95[_0x2070bb(-0x2,0x15)](_0x19ba3c+'/'+_0x2eeb2c+_0x2070bb(-0x1,0x14))){const _0x5513c7=a1_0x449a95['readFileSync'](_0x19ba3c+'/'+_0x2eeb2c+_0x2070bb(-0x1,0x1f),'utf8'),_0x4b762d=a1_0x377e98(_0x5513c7);for(const _0x314077 of _0x4b762d){if(Array[_0x2070bb(0x0,-0x25)](_0x314077)&&_0x314077[0x0]==='symbol'&&_0x314077[0x1]===_0x5e7425){_0x12d059=S[_0x2070bb(0x1,0x19)](_0x314077);break;}}}if(_0x12d059===''){const _0x2b58fc='./build/lib/symbols/'+_0x5e7425+_0x2070bb(-0x1,-0xd);a1_0x449a95[_0x2070bb(-0x2,-0x28)](_0x2b58fc)&&(_0x12d059=a1_0x449a95[_0x2070bb(0x2,0x15)](_0x2b58fc,'utf8'));}_0x12d059!==''&&__classPrivateFieldSet(this,_Component_symbol_file,_0x12d059,'f');}catch(_0x4f885c){console['warn']('Failed\x20to\x20load\x20symbol\x20'+_0x158fd5+':\x20'+_0x4f885c['message']);}return __classPrivateFieldGet(this,_Component_symbol_file,'f')||'';}[a1_0x26c6c7(-0x35f,-0x349)](_0x1ca0de){const _0x13716c=[];let _0x2508bf=0x0,_0x48b12e=![];function _0x1b7417(_0x713874,_0x1a3c5f){return a1_0x14a3(_0x1a3c5f- -0x1a2,_0x713874);}let _0x371500='';const _0x4aec87=0x2,_0x3a3816=0x64,_0x27a980=new Array(_0x3a3816);for(let _0x1d91bb=0x0;_0x1d91bb<_0x3a3816;_0x1d91bb++){_0x27a980[_0x1d91bb]='\x20'['repeat'](_0x1d91bb*_0x4aec87);}for(let _0x330c8b=0x0;_0x330c8b<_0x1ca0de['length'];_0x330c8b++){const _0x50f964=_0x1ca0de[_0x330c8b],_0x46656b=_0x1ca0de[_0x330c8b+0x1];if(_0x50f964==='\x22'&&_0x371500!=='\x5c'){_0x48b12e=!_0x48b12e,_0x13716c[_0x1b7417(-0x174,-0x17d)](_0x50f964),_0x371500=_0x50f964;continue;}if(_0x48b12e){_0x13716c['push'](_0x50f964),_0x371500=_0x50f964;continue;}if(_0x50f964==='(')_0x13716c[_0x1b7417(-0x197,-0x17d)](_0x50f964),_0x2508bf++,_0x46656b==='('&&(_0x13716c['push']('\x0a'),_0x13716c['push'](_0x27a980[Math[_0x1b7417(-0x135,-0x155)](_0x2508bf,_0x3a3816-0x1)]));else{if(_0x50f964===')')_0x2508bf--,_0x371500===')'&&(_0x13716c['push']('\x0a'),_0x13716c['push'](_0x27a980[Math[_0x1b7417(-0x14e,-0x155)](_0x2508bf,_0x3a3816-0x1)])),_0x13716c['push'](_0x50f964);else _0x50f964==='\x20'&&_0x46656b==='('?(_0x13716c[_0x1b7417(-0x194,-0x17d)]('\x0a'),_0x13716c['push'](_0x27a980[Math['min'](_0x2508bf,_0x3a3816-0x1)])):_0x13716c['push'](_0x50f964);}_0x371500=_0x50f964;}return _0x13716c[_0x1b7417(-0x164,-0x154)]('');}}function a1_0x26c6c7(_0xe7c91c,_0x54e6f4){return a1_0x14a3(_0x54e6f4- -0x395,_0xe7c91c);}_Component_footprint_file=new WeakMap(),_Component_symbol_file=new WeakMap(),_Component_isInitialized=new WeakMap();