UNPKG

@typecad/typecad

Version:

🤖programmatically 💥create 🛰️hardware

1 lines 1.5 kB
export class ReferenceCounter{constructor(){function _0x4c2418(_0x29b43c,_0x634ee2){return a22_0x5dcf(_0x634ee2-0x232,_0x29b43c);}this['counters']=new Map(),this[_0x4c2418(0x234,0x232)]=new Set();}['getNextReference'](_0x3a88b6){let _0x54bc3f,_0x427fa9=this['counters']['get'](_0x3a88b6)||0x0;do{_0x427fa9++,_0x54bc3f=''+_0x3a88b6+_0x427fa9;}while(this['usedReferences']['has'](_0x54bc3f));this[_0x469c6e(0x111,0x110)]['set'](_0x3a88b6,_0x427fa9);function _0x469c6e(_0xfb158,_0x2f42d9){return a22_0x5dcf(_0x2f42d9-0x10f,_0xfb158);}return this[_0x469c6e(0x110,0x10f)]['add'](_0x54bc3f),_0x54bc3f;}['setReference'](_0x1c4f95){if(this[_0x162224(-0x2e5,-0x2e3)]['has'](_0x1c4f95))return![];const _0x19d432=_0x1c4f95['match'](/^[#]?[a-zA-Z]+/)[0x0][_0x162224(-0x2e0,-0x2e1)](),_0x49a5a2=parseInt(_0x1c4f95['match'](/\d+/)[0x0]);this[_0x162224(-0x2e5,-0x2e3)]['add'](_0x1c4f95);const _0x5d4f08=this[_0x162224(-0x2e1,-0x2e2)]['get'](_0x19d432)||0x0;function _0x162224(_0x2c4f94,_0x5929fd){return a22_0x5dcf(_0x5929fd- -0x2e3,_0x2c4f94);}return _0x49a5a2>_0x5d4f08&&this[_0x162224(-0x2e1,-0x2e2)]['set'](_0x19d432,_0x49a5a2),!![];}}function a22_0x5dcf(_0x299718,_0x5dcfae){const _0x3435d8=a22_0x2997();return a22_0x5dcf=function(_0x236606,_0x2d7005){_0x236606=_0x236606-0x0;let _0xe1218=_0x3435d8[_0x236606];return _0xe1218;},a22_0x5dcf(_0x299718,_0x5dcfae);}function a22_0x2997(){const _0x17e536=['usedReferences','counters','toLowerCase'];a22_0x2997=function(){return _0x17e536;};return a22_0x2997();}