@tscircuit/runframe 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bun.lockb +0 -0
- package/dist/standalone.min.js +14 -5
- package/lib/components/RunFrameWithApi/index.tsx +5 -2
- package/package.json +3 -2
- package/vite.config.ts +5 -1
package/dist/standalone.min.js
CHANGED
|
@@ -393,7 +393,7 @@ This ensures that you're testing the behavior the user would see in the browser.
|
|
|
393
393
|
|
|
394
394
|
Check the render method of \``+WR+"`.")}throw new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) "+("but got: "+(TV==null?TV:typeof TV)+"."+ul))}}var CR=EV(gl,iV,mV,HV);return CR.elementType=TV,CR.type=El,CR.lanes=LV,CR._debugOwner=SV,CR}function lR(TV,mV,iV){var SV=null;SV=TV._owner;var HV=TV.type,LV=TV.key,gl=TV.props,El=yl(HV,LV,gl,SV,mV,iV);return El._debugSource=TV._source,El._debugOwner=TV._owner,El}function dR(TV,mV,iV,SV){var HV=EV(ll,TV,SV,mV);return HV.lanes=iV,HV}function YR(TV,mV,iV,SV){typeof TV.id!="string"&&CV('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof TV.id);var HV=EV(fV,TV,SV,mV|tZ);return HV.elementType=gR,HV.lanes=iV,HV.stateNode={effectDuration:0,passiveEffectDuration:0},HV}function nR(TV,mV,iV,SV){var HV=EV(Ul,TV,SV,mV);return HV.elementType=MR,HV.lanes=iV,HV}function eR(TV,mV,iV,SV){var HV=EV(ol,TV,SV,mV);return HV.elementType=cR,HV.lanes=iV,HV}function fR(TV,mV,iV,SV){var HV=EV(wl,TV,SV,mV);HV.elementType=sU,HV.lanes=iV;var LV={isHidden:!1};return HV.stateNode=LV,HV}function cU(TV,mV,iV){var SV=EV(yV,TV,null,mV);return SV.lanes=iV,SV}function WU(){var TV=EV(vV,null,null,HI);return TV.elementType="DELETED",TV}function VU(TV){var mV=EV(kl,null,null,HI);return mV.stateNode=TV,mV}function pU(TV,mV,iV){var SV=TV.children!==null?TV.children:[],HV=EV(wV,SV,TV.key,mV);return HV.lanes=iV,HV.stateNode={containerInfo:TV.containerInfo,pendingChildren:null,implementation:TV.implementation},HV}function xU(TV,mV){return TV===null&&(TV=EV(xV,null,null,HI)),TV.tag=mV.tag,TV.key=mV.key,TV.elementType=mV.elementType,TV.type=mV.type,TV.stateNode=mV.stateNode,TV.return=mV.return,TV.child=mV.child,TV.sibling=mV.sibling,TV.index=mV.index,TV.ref=mV.ref,TV.pendingProps=mV.pendingProps,TV.memoizedProps=mV.memoizedProps,TV.updateQueue=mV.updateQueue,TV.memoizedState=mV.memoizedState,TV.dependencies=mV.dependencies,TV.mode=mV.mode,TV.flags=mV.flags,TV.subtreeFlags=mV.subtreeFlags,TV.deletions=mV.deletions,TV.lanes=mV.lanes,TV.childLanes=mV.childLanes,TV.alternate=mV.alternate,TV.actualDuration=mV.actualDuration,TV.actualStartTime=mV.actualStartTime,TV.selfBaseDuration=mV.selfBaseDuration,TV.treeBaseDuration=mV.treeBaseDuration,TV._debugSource=mV._debugSource,TV._debugOwner=mV._debugOwner,TV._debugNeedsRemount=mV._debugNeedsRemount,TV._debugHookTypes=mV._debugHookTypes,TV}function gZ(TV,mV,iV,SV,HV){this.tag=mV,this.containerInfo=TV,this.pendingChildren=null,this.current=null,this.pingCache=null,this.finishedWork=null,this.timeoutHandle=AU,this.context=null,this.pendingContext=null,this.callbackNode=null,this.callbackPriority=bF,this.eventTimes=tN(sW),this.expirationTimes=tN(JC),this.pendingLanes=sW,this.suspendedLanes=sW,this.pingedLanes=sW,this.expiredLanes=sW,this.mutableReadLanes=sW,this.finishedLanes=sW,this.entangledLanes=sW,this.entanglements=tN(sW),this.identifierPrefix=SV,this.onRecoverableError=HV,bW&&(this.mutableSourceEagerHydrationData=null),this.effectDuration=0,this.passiveEffectDuration=0;{this.memoizedUpdaters=new Set;for(var LV=this.pendingUpdatersLaneMap=[],gl=0;gl<h0;gl++)LV.push(new Set)}switch(mV){case UJ:this._debugRootType=iV?"hydrateRoot()":"createRoot()";break;case KF:this._debugRootType=iV?"hydrate()":"render()";break}}function yZ(TV,mV,iV,SV,HV,LV,gl,El,ul,WR){var CR=new gZ(TV,mV,iV,El,ul),lU=Xl(mV,LV);CR.current=lU,lU.stateNode=CR;{var CU={element:SV,isDehydrated:iV,cache:null,transitions:null,pendingSuspenseBoundaries:null};lU.memoizedState=CU}return zY(lU),CR}var pZ="18.3.1";function VW(TV,mV,iV){var SV=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return IY(SV),{$$typeof:Ol,key:SV==null?null:""+SV,children:TV,containerInfo:mV,implementation:iV}}var eW,eI;eW=!1,eI={};function cZ(TV){if(!TV)return MC;var mV=eV(TV),iV=Dg(mV);if(mV.tag===MV){var SV=mV.type;if(Pd(SV))return eF(mV,SV,iV)}return iV}function nZ(TV){var mV=eV(TV);if(mV===void 0){if(typeof TV.render=="function")throw new Error("Unable to find node on an unmounted component.");var iV=Object.keys(TV).join(",");throw new Error("Argument appears to not be a ReactComponent. Keys: "+iV)}var SV=dW(mV);return SV===null?null:SV.stateNode}function HW(TV,mV){{var iV=eV(TV);if(iV===void 0){if(typeof TV.render=="function")throw new Error("Unable to find node on an unmounted component.");var SV=Object.keys(TV).join(",");throw new Error("Argument appears to not be a ReactComponent. Keys: "+SV)}var HV=dW(iV);if(HV===null)return null;if(HV.mode&Zd){var LV=nU(iV)||"Component";if(!eI[LV]){eI[LV]=!0;var gl=NZ;try{aZ(HV),iV.mode&Zd?CV("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",mV,mV,LV):CV("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",mV,mV,LV)}finally{gl?aZ(gl):bI()}}}return HV.stateNode}}function dI(TV,mV,iV,SV,HV,LV,gl,El){var ul=!1,WR=null;return yZ(TV,mV,ul,WR,iV,SV,HV,LV,gl)}function vW(TV,mV,iV,SV,HV,LV,gl,El,ul,WR){var CR=!0,lU=yZ(iV,SV,CR,TV,HV,LV,gl,El,ul);lU.context=cZ(null);var CU=lU.current,oU=Xg(),WZ=xc(CU),GZ=EY(oU,WZ);return GZ.callback=mV??null,ba(CU,GZ,WZ),iA(lU,WZ,oU),lU}function dd(TV,mV,iV,SV){pg(mV,TV);var HV=mV.current,LV=Xg(),gl=xc(HV);pF(gl);var El=cZ(iV);mV.context===null?mV.context=El:mV.pendingContext=El,jW&&NZ!==null&&!eW&&(eW=!0,CV(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.
|
|
395
395
|
|
|
396
|
-
Check the render method of %s.`,nU(NZ)||"Unknown"));var ul=EY(LV,gl);ul.payload={element:TV},SV=SV===void 0?null:SV,SV!==null&&(typeof SV!="function"&&CV("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",SV),ul.callback=SV);var WR=ba(HV,ul,gl);return WR!==null&&(Pg(WR,HV,gl,LV),VY(WR,HV,gl)),gl}function GI(TV){var mV=TV.current;if(!mV.child)return null;switch(mV.child.tag){case vV:return ZZ(mV.child.stateNode);default:return mV.child.stateNode}}function qd(TV){switch(TV.tag){case uV:{var mV=TV.stateNode;if(Kl(mV)){var iV=OG(mV);dT(mV,iV)}break}case Ul:{bk(function(){var HV=MF(TV,XW);if(HV!==null){var LV=Xg();Pg(HV,TV,XW,LV)}});var SV=XW;cI(TV,SV);break}}}function uZ(TV,mV){var iV=TV.memoizedState;iV!==null&&iV.dehydrated!==null&&(iV.retryLane=HN(iV.retryLane,mV))}function cI(TV,mV){uZ(TV,mV);var iV=TV.alternate;iV&&uZ(iV,mV)}function pI(TV){if(TV.tag===Ul){var mV=XW,iV=MF(TV,mV);if(iV!==null){var SV=Xg();Pg(iV,TV,mV,SV)}cI(TV,mV)}}function fI(TV){if(TV.tag===Ul){var mV=SJ,iV=MF(TV,mV);if(iV!==null){var SV=Xg();Pg(iV,TV,mV,SV)}cI(TV,mV)}}function Qd(TV){if(TV.tag===Ul){var mV=xc(TV),iV=MF(TV,mV);if(iV!==null){var SV=Xg();Pg(iV,TV,mV,SV)}cI(TV,mV)}}function VI(TV){var mV=YZ(TV);return mV===null?null:mV.stateNode}var LI=function(TV){return null};function md(TV){return LI(TV)}var xC=function(TV){return!1};function LZ(TV){return xC(TV)}var SZ=null,BI=null,$I=null,ld=null,XZ=null,cd=null,KV=null,_V=null,ml=null;{var jl=function(TV,mV,iV){var SV=mV[iV],HV=bU(TV)?TV.slice():NV({},TV);return iV+1===mV.length?(bU(HV)?HV.splice(SV,1):delete HV[SV],HV):(HV[SV]=jl(TV[SV],mV,iV+1),HV)},UR=function(TV,mV){return jl(TV,mV,0)},vR=function(TV,mV,iV,SV){var HV=mV[SV],LV=bU(TV)?TV.slice():NV({},TV);if(SV+1===mV.length){var gl=iV[SV];LV[gl]=LV[HV],bU(LV)?LV.splice(HV,1):delete LV[HV]}else LV[HV]=vR(TV[HV],mV,iV,SV+1);return LV},rR=function(TV,mV,iV){if(mV.length!==iV.length){dV("copyWithRename() expects paths of the same length");return}else for(var SV=0;SV<iV.length-1;SV++)if(mV[SV]!==iV[SV]){dV("copyWithRename() expects paths to be the same except for the deepest key");return}return vR(TV,mV,iV,0)},xR=function(TV,mV,iV,SV){if(iV>=mV.length)return SV;var HV=mV[iV],LV=bU(TV)?TV.slice():NV({},TV);return LV[HV]=xR(TV[HV],mV,iV+1,SV),LV},HU=function(TV,mV,iV){return xR(TV,mV,0,iV)},iZ=function(TV,mV){for(var iV=TV.memoizedState;iV!==null&&mV>0;)iV=iV.next,mV--;return iV};SZ=function(TV,mV,iV,SV){var HV=iZ(TV,mV);if(HV!==null){var LV=HU(HV.memoizedState,iV,SV);HV.memoizedState=LV,HV.baseState=LV,TV.memoizedProps=NV({},TV.memoizedProps);var gl=MF(TV,XW);gl!==null&&Pg(gl,TV,XW,JC)}},BI=function(TV,mV,iV){var SV=iZ(TV,mV);if(SV!==null){var HV=UR(SV.memoizedState,iV);SV.memoizedState=HV,SV.baseState=HV,TV.memoizedProps=NV({},TV.memoizedProps);var LV=MF(TV,XW);LV!==null&&Pg(LV,TV,XW,JC)}},$I=function(TV,mV,iV,SV){var HV=iZ(TV,mV);if(HV!==null){var LV=rR(HV.memoizedState,iV,SV);HV.memoizedState=LV,HV.baseState=LV,TV.memoizedProps=NV({},TV.memoizedProps);var gl=MF(TV,XW);gl!==null&&Pg(gl,TV,XW,JC)}},ld=function(TV,mV,iV){TV.pendingProps=HU(TV.memoizedProps,mV,iV),TV.alternate&&(TV.alternate.pendingProps=TV.pendingProps);var SV=MF(TV,XW);SV!==null&&Pg(SV,TV,XW,JC)},XZ=function(TV,mV){TV.pendingProps=UR(TV.memoizedProps,mV),TV.alternate&&(TV.alternate.pendingProps=TV.pendingProps);var iV=MF(TV,XW);iV!==null&&Pg(iV,TV,XW,JC)},cd=function(TV,mV,iV){TV.pendingProps=rR(TV.memoizedProps,mV,iV),TV.alternate&&(TV.alternate.pendingProps=TV.pendingProps);var SV=MF(TV,XW);SV!==null&&Pg(SV,TV,XW,JC)},KV=function(TV){var mV=MF(TV,XW);mV!==null&&Pg(mV,TV,XW,JC)},_V=function(TV){LI=TV},ml=function(TV){xC=TV}}function zZ(TV){var mV=dW(TV);return mV===null?null:mV.stateNode}function VZ(TV){return null}function kW(){return NZ}function $Z(TV){var mV=TV.findFiberByHostInstance,iV=ZV.ReactCurrentDispatcher;return IJ({bundleType:TV.bundleType,version:TV.version,rendererPackageName:TV.rendererPackageName,rendererConfig:TV.rendererConfig,overrideHookState:SZ,overrideHookStateDeletePath:BI,overrideHookStateRenamePath:$I,overrideProps:ld,overridePropsDeletePath:XZ,overridePropsRenamePath:cd,setErrorHandler:_V,setSuspenseHandler:ml,scheduleUpdate:KV,currentDispatcherRef:iV,findHostInstanceByFiber:zZ,findFiberByHostInstance:mV||VZ,findHostInstancesForRefresh:rl,scheduleRefresh:Rl,scheduleRoot:hl,setRefreshHandler:sG,getCurrentFiber:kW,reconcilerVersion:pZ})}return VV.attemptContinuousHydration=fI,VV.attemptDiscreteHydration=pI,VV.attemptHydrationAtCurrentPriority=Qd,VV.attemptSynchronousHydration=qd,VV.batchedUpdates=vS,VV.createComponentSelector=US,VV.createContainer=dI,VV.createHasPseudoClassSelector=ZS,VV.createHydrationContainer=vW,VV.createPortal=VW,VV.createRoleSelector=nA,VV.createTestNameSelector=IA,VV.createTextSelector=ym,VV.deferredUpdates=xS,VV.discreteUpdates=Qk,VV.findAllNodes=Wk,VV.findBoundingRects=tS,VV.findHostInstance=nZ,VV.findHostInstanceWithNoPortals=VI,VV.findHostInstanceWithWarning=HW,VV.flushControlled=cm,VV.flushPassiveEffects=aY,VV.flushSync=bk,VV.focusWithin=dA,VV.getCurrentUpdatePriority=_F,VV.getFindAllNodesFailureDescription=zS,VV.getPublicRootInstance=GI,VV.injectIntoDevTools=$Z,VV.isAlreadyRendering=TA,VV.observeVisibleRects=wG,VV.registerMutableSourceForHydration=Em,VV.runWithPriority=Sd,VV.shouldError=md,VV.shouldSuspend=LZ,VV.updateContainer=dd,VV}),reactReconciler_development$2.exports}var hasRequiredReactReconciler$2;function requireReactReconciler$2(){return hasRequiredReactReconciler$2||(hasRequiredReactReconciler$2=1,process.env.NODE_ENV==="production"?reactReconciler$2.exports=requireReactReconciler_production_min$2():reactReconciler$2.exports=requireReactReconciler_development$2()),reactReconciler$2.exports}var reactReconcilerExports$1=requireReactReconciler$2();const ReactReconciler=getDefaultExportFromCjs$1(reactReconcilerExports$1);function defineSymbol(lV){return lV}var ac_voltmeter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:.09442299999999992,y:-.1322587999999998},{x:-.004364400000000712,y:.05922830000000001},{x:-.1110211000000012,y:-.1322587999999998}],color:"primary",fill:!1},path17:{type:"path",points:[{x:-.0061693999999994364,y:.1322588},{x:.06546170000000107,y:.10639120000000002}],color:"primary",fill:!1},path18:{type:"path",points:[{x:.06546170000000107,y:.10639120000000002},{x:.13709280000000135,y:.1322588}],color:"primary",fill:!1},path19:{type:"path",points:[{x:-.14943149999999927,y:.1322588},{x:-.07780039999999877,y:.10639120000000002}],color:"primary",fill:!1},path20:{type:"path",points:[{x:-.0778004000000001,y:.10639120000000002},{x:-.006169299999999822,y:.1322588}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.3959705999999994},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.3983547000000005}},refblocks:{left1:{x:-.5446330999999993,y:0},right1:{x:.5381638000000004,y:0}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:-.1322587999999998,maxY:.1322588,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:11102230246251565e-32},circles:{path1:{type:"circle",x:0,y:0,radius:.28854213,color:"primary",fill:!1}}},{paths,bounds,refblocks,circles}=ac_voltmeter_default,ac_voltmeter_horz_default={primitives:[...Object.values(paths),...Object.values(circles),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"}],ports:[{...refblocks.left1,labels:["1"]},{...refblocks.right1,labels:["2"]}],size:{width:bounds.width,height:bounds.height},center:{x:bounds.centerX,y:bounds.centerY}},rotateAnchor=(lV,J="right")=>{switch(J){case"up":switch(lV){case"middle_top":return"middle_left";case"middle_bottom":return"middle_right";case"middle_left":return"middle_bottom";case"middle_right":return"middle_top"}break;case"down":switch(lV){case"middle_top":return"middle_right";case"middle_bottom":return"middle_left";case"middle_left":return"middle_top";case"middle_right":return"middle_bottom"}break;case"left":switch(lV){case"middle_top":return"middle_bottom";case"middle_bottom":return"middle_top";case"middle_left":return"middle_right";case"middle_right":return"middle_left"}break;case"right":return lV}return lV},flipSymbolOverYAxis=(lV,J)=>{const{primitives:VV,center:RV,ports:UV,size:ZV}=lV,WV=transform({a:-1,b:0,c:0,d:1,e:0,f:2*RV.x}),IV=VV.map(CV=>{switch(CV={...CV},CV.type){case"path":return{...CV,points:CV.points.map(gV=>applyToPoint(WV,gV))};case"text":const FV=applyToPoint(WV,{x:CV.x,y:CV.y}),NV={top_left:"top_right",top_right:"top_left",bottom_left:"bottom_right",bottom_right:"bottom_left",center:"center",middle_top:"middle_top",middle_bottom:"middle_bottom",middle_left:"middle_right",middle_right:"middle_left"};return{...CV,x:FV.x,y:FV.y,anchor:NV[CV.anchor]};case"circle":case"box":const eV=applyToPoint(WV,{x:CV.x,y:CV.y});return{...CV,x:eV.x,y:eV.y}}}),dV=UV.map(CV=>({...CV,...applyToPoint(WV,CV)}));return{primitives:IV,center:RV,ports:dV,size:ZV,...J}},rotateSymbol=(lV,J,VV)=>{const RV={up:-Math.PI/2,right:0,down:Math.PI/2,left:-Math.PI},UV=rotate(J?RV[J]:Math.PI/2,lV.center.x,lV.center.y),{primitives:ZV,center:WV,size:IV,ports:dV}=lV,CV=ZV.map(NV=>{switch(NV={...NV},NV.type){case"path":return{...NV,points:NV.points.map(JV=>applyToPoint(UV,JV))};case"text":const eV=applyToPoint(UV,{x:NV.x,y:NV.y});return NV.anchor=rotateAnchor(NV.anchor,J??"right"),{...NV,x:eV.x,y:eV.y};case"circle":const gV=applyToPoint(UV,{x:NV.x,y:NV.y});return{...NV,x:gV.x,y:gV.y};case"box":const nV=applyToPoint(UV,{x:NV.x,y:NV.y});return{...NV,x:nV.x,y:nV.y,width:NV.height,height:NV.width}}}),FV=dV.map(NV=>({...NV,...applyToPoint(UV,NV)}));return{primitives:CV,center:WV,ports:FV,size:{width:J==="up"||J==="down"?IV.width:IV.height,height:J==="up"||J==="down"?IV.height:IV.width},...VV}},{2:letter,3:path1,4:path2$1,5:path3,6:path4,...rest}=ac_voltmeter_horz_default.primitives;function isPrimitive(lV){return typeof lV=="object"}var rotatedSymbol=rotateSymbol({...ac_voltmeter_horz_default,primitives:Object.values(rest).filter(isPrimitive)}),ac_voltmeter_vert_default={...rotatedSymbol,primitives:[...rotatedSymbol.primitives,letter,path1,path2$1,path3,path4]},avalanche_diode_default={paths:{path40:{type:"path",points:[{x:.1413337499999996,y:-.00033784999999975085},{x:-.12324954999999993,y:.1319538500000006}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.12324954999999993,y:-.1326295500000001},{x:.1413337499999996,y:-.00033784999999975085}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.12324954999999993,y:.13195384999999926},{x:-.12324954999999993,y:-.1326295500000001}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.1413337499999996,y:-.1326295500000001},{x:.1413337499999996,y:.13195384999999926}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.12545425,y:-.00033784999999975085},{x:-.52012455,y:-.00033784999999975085}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:.5201245499999998,y:-.00025265000000018745},{x:.14641644999999937,y:-.00025265000000018745}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:.1401360499999995,y:-.13311245000000027},{x:.07443344999999923,y:-.15673055000000047}],color:"primary",fill:!1},"path43-8-3":{type:"path",points:[{x:.20757744999999939,y:.15673055000000025},{x:.1418748499999991,y:.13311245000000005}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.0082802500000001,y:-.2301468499999999},bottom1:{type:"text",text:"{VAL}",x:-.0033669500000002017,y:.31754375}},refblocks:{left1:{x:-.5224022500000005,y:-.0012222500000007575},right1:{x:.5158919499999994,y:-.00019764999999982713}},bounds:{minX:-.52012455,maxX:.5201245499999998,minY:-.15673055000000047,maxY:.15673055000000025,width:1.0402490999999998,height:1,centerX:-11102230246251565e-32,centerY:-11102230246251565e-32},circles:{}},{paths:paths2,texts,bounds:bounds2,refblocks:refblocks2,circles:circles2}=avalanche_diode_default,avalanche_diode_horz_default={primitives:[...Object.values(paths2),...Object.values(circles2),{...texts.top1,anchor:"middle_bottom"},{...texts.bottom1,anchor:"middle_top"}],ports:[{...refblocks2.left1,labels:["1"]},{...refblocks2.right1,labels:["2"]}],size:{width:bounds2.width,height:bounds2.height},center:{x:bounds2.centerX,y:bounds2.centerY}},rotated=rotateSymbol(avalanche_diode_horz_default),ref=rotated.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val=rotated.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref.anchor="middle_left",val.anchor="middle_right";var avalanche_diode_vert_default=rotated,battery_default={paths:{path43:{type:"path",points:[{x:-.05901489999999909,y:-.18831315000000015},{x:-.05869489999999833,y:.11814524999999954}],color:"primary",fill:!1},"path43-6":{type:"path",points:[{x:.015375000000000805,y:-.12533125000000034},{x:.016669000000000933,y:.05562075000000033}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.06443049999999961,y:-.032673549999999496},{x:-.4368029,y:-.032673549999999496}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:.4350822999999997,y:-.03438825000000034},{x:.028285099999999952,y:-.03438825000000034}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.027835099999999446,y:-.26964474999999943},bottom1:{type:"text",text:"{VAL}",x:-.028373699999999502,y:.19564474999999967}},refblocks:{left1:{x:-.4458008,y:-.033557849999999334},right1:{x:.4458008,y:-.03343344999999931}},bounds:{minX:-.473959241,maxX:.473959241,minY:-.3656447499999994,maxY:.27564474999999966,width:.947918482,height:.2912894999999991,centerX:0,centerY:-.04499999999999987},circles:{}},{paths:paths3,texts:texts2,bounds:bounds3,refblocks:refblocks3,circles:circles3}=battery_default,battery_horz_default={primitives:[...Object.values(paths3),...Object.values(circles3),{...texts2.top1,anchor:"middle_bottom"},{...texts2.bottom1,anchor:"middle_top"}],ports:[{...refblocks3.left1,labels:["1"]},{...refblocks3.right1,labels:["2"]}],size:{width:bounds3.width,height:bounds3.height},center:{x:bounds3.centerX,y:bounds3.centerY}},battery_vert_default=rotateSymbol(battery_horz_default),boxresistor_default={paths:{path1:{type:"path",points:[{x:-.511850799999999,y:-.04116140000000179},{x:-.24726749999999953,y:-.04116140000000179}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.2818991000000013,y:-.04116140000000179},{x:.5464825000000006,y:-.04116140000000179}],color:"primary",fill:!1},path3:{type:"path",points:[{x:.0173157000000006,y:-.17345310000000147},{x:.2818990000000001,y:-.17345310000000147},{x:.2818990000000001,y:.09113029999999789},{x:-.24726770000000053,y:.09113029999999789},{x:-.24726770000000053,y:-.17345310000000147},{x:.017315699999998824,y:-.17345310000000147}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.0014247999999992267,y:-.24499800000000072},bottom1:{type:"text",text:"{VAL}",x:-.0004627999999997634,y:.2549980000000005}},refblocks:{left1:{x:-.5337907000000002,y:-.04080519999999943},right1:{x:.5337907000000004,y:-.04025870000000076}},bounds:{minX:-.5619491410000002,maxX:.5619491410000004,minY:-.3449980000000007,maxY:.2549980000000005,width:1.1238982820000005,height:.24999600000000122,centerX:11102230246251565e-32,centerY:-.045000000000000095},circles:{}},{paths:paths4,texts:texts3,bounds:bounds4,refblocks:refblocks4}=boxresistor_default,boxresistor_horz_default={primitives:[...Object.values(paths4),{...texts3.top1,anchor:"middle_bottom"},{...texts3.bottom1,anchor:"middle_top"}],ports:[{...refblocks4.left1,labels:["1"]},{...refblocks4.right1,labels:["2"]}],size:{width:bounds4.width,height:bounds4.height},center:{x:bounds4.centerX,y:bounds4.centerY}},boxresistor_vert_default=rotateSymbol(boxresistor_horz_default),capacitor_default={paths:{path27:{type:"path",points:[{x:.5229378000000002,y:-.012283099999995883},{x:.07314620000000005,y:-.012283099999995883}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-.08560379999999945,y:-.012283099999995883},{x:-.5353954999999999,y:-.012283099999995883}],color:"primary",fill:!1},path29:{type:"path",points:[{x:.07314620000000005,y:-.2768663999999976},{x:.07314620000000005,y:.2523002000000023}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-.0856037999999999,y:-.2768663999999976},{x:-.08560379999999945,y:.2523002000000023}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.012864500000000056,y:-.4150086999999978},bottom1:{type:"text",text:"{VAL}",x:-.003850500000000423,y:.4250087000000011}},refblocks:{left1:{x:-.5512093000000002,y:-.011380399999998403},right1:{x:.5512093,y:-.011926899999997076}},bounds:{minX:-.5793677410000002,maxX:.579367741,minY:-.5150086999999978,maxY:.4250087000000011,width:1.1587354820000002,height:.5900173999999989,centerX:-11102230246251565e-32,centerY:-.04499999999999832},circles:{}},{paths:paths5,bounds:bounds5,refblocks:refblocks5,texts:texts4}=capacitor_default,capacitor_horz_default={primitives:[...Object.values(paths5),{...texts4.top1,anchor:"middle_bottom"},{...texts4.bottom1,anchor:"middle_top"}],ports:[{...refblocks5.left1,labels:["1"]},{...refblocks5.right1,labels:["2"]}],size:{width:bounds5.width,height:bounds5.height},center:{x:bounds5.centerX,y:bounds5.centerY}},capacitor_down_default=rotateSymbol(capacitor_horz_default,"down"),capacitor_left_default=rotateSymbol(capacitor_horz_default,"left"),capacitor_right_default=capacitor_horz_default,capacitor_up_default=rotateSymbol(capacitor_horz_default,"up"),capacitor_vert_default=rotateSymbol(capacitor_horz_default),constant_current_diode_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.2899773000000003,y:-.2633966000000001},{x:.2899773000000003,y:.2633966000000001}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.36197569999999946},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.43234960000000044}},refblocks:{left1:{x:-.5446330999999993,y:.000852800000000542},right1:{x:.5381638000000004,y:-.00014359999999924433}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:-.2633966000000001,maxY:.2633966000000001,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.007128299999999532,radius:.28854213,color:"primary",fill:!1}}},{paths:paths6,texts:texts5,bounds:bounds6,refblocks:refblocks6,circles:circles4}=constant_current_diode_default,constant_current_diode_horz_default={primitives:[...Object.values(paths6),...Object.values(circles4),{...texts5.top1,anchor:"middle_left",x:-.15,y:-.4},{...texts5.bottom1,anchor:"middle_left",x:-.15}],ports:[{...refblocks6.left1,labels:["1"]},{...refblocks6.right1,labels:["2"]}],size:{width:bounds6.width,height:bounds6.height},center:{x:bounds6.centerX,y:bounds6.centerY}},rotatedSymbol2=rotateSymbol(constant_current_diode_horz_default),texts6=rotatedSymbol2.primitives.filter(lV=>lV.type==="text"),val2=texts6.find(lV=>lV.text==="{VAL}");val2.x=-.35,val2.y=0,val2.anchor="middle_right";var ref2=texts6.find(lV=>lV.text==="{REF}");ref2.y=0,ref2.x=.35,ref2.anchor="middle_left";var constant_current_diode_vert_default=rotatedSymbol2,crystal_default={paths:{path27:{type:"path",points:[{x:.5229378000000002,y:-.012283099999995883},{x:.13246630000000037,y:-.012283099999995883}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-.14263049999999966,y:-.012283099999995883},{x:-.5353954999999999,y:-.012283099999995883}],color:"primary",fill:!1},path29:{type:"path",points:[{x:.12606289999999998,y:-.2768663999999976},{x:.12606290000000042,y:.2523002000000023}],color:"primary",fill:!1},"path29-2":{type:"path",points:[{x:.07263109999999973,y:-.27614569999999716},{x:.07263110000000017,y:.253020900000001}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-.13852050000000027,y:-.2768663999999976},{x:-.13852049999999982,y:.2523002000000023}],color:"primary",fill:!1},"path29-5":{type:"path",points:[{x:-.08244070000000026,y:-.27777869999999893},{x:-.08244069999999981,y:.2513879000000028}],color:"primary",fill:!1},"path29-2-7":{type:"path",points:[{x:.07253150000000019,y:-.27761959999999597},{x:-.08185069999999994,y:-.27761959999999597}],color:"primary",fill:!1},"path29-2-7-6":{type:"path",points:[{x:.0721257000000004,y:.255806800000002},{x:-.08225649999999973,y:.255806800000002}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.012864500000000056,y:-.4150086999999978},bottom1:{type:"text",text:"{VAL}",x:-.003850500000000423,y:.4250087000000011}},refblocks:{left1:{x:-.5512093000000002,y:-.011380399999998403},right1:{x:.5512093,y:-.011926899999997076}},bounds:{minX:-.5793677410000002,maxX:.579367741,minY:-.5150086999999978,maxY:.4250087000000011,width:1.1587354820000002,height:1,centerX:-11102230246251565e-32,centerY:-.04499999999999832},circles:{}},{paths:paths7,texts:texts7,bounds:bounds7,refblocks:refblocks7,circles:circles5}=crystal_default,crystal_horz_default={primitives:[...Object.values(paths7),...Object.values(circles5),{type:"text",text:"{REF}",x:-.012864500000000056,y:-.4150086999999978,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:-.003850500000000423,y:.4250087000000011,anchor:"middle_top"}],ports:[{...refblocks7.left1,labels:["1"]},{...refblocks7.right1,labels:["2"]}],size:{width:bounds7.width,height:bounds7.height},center:{x:bounds7.centerX,y:bounds7.centerY}},rotatedSymbol3=rotateSymbol(crystal_horz_default),texts8=rotatedSymbol3.primitives.filter(lV=>lV.type==="text"),ref3=texts8.find(lV=>lV.text==="{REF}"),val3=texts8.find(lV=>lV.text==="{VAL}");val3.x=-.4,ref3.x=.35;var crystal_vert_default=rotatedSymbol3,darlington_pair_transistor_default={paths:{path11:{type:"path",points:[{x:1.9942486145,y:1.6315233295000002},{x:2.0984258145,y:1.6321433295000003}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:2.1030704145000003,y:1.4702420295},{x:2.1026604145,y:1.7934203295}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:2.2218770145,y:1.4862575295},{x:2.1063461145,y:1.5650515295000003}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:2.2286252145,y:1.7712556295000002},{x:2.1136540145000002,y:1.6926424295}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:2.2273251145,y:1.4841963295},{x:2.2284101145,y:1.1411599295000001}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:2.2276017145,y:1.9460598295},{x:2.2281317145,y:1.7781501295000002}],color:"primary",fill:!1},"arrow-2":{type:"path",points:[{x:2.1704797145,y:1.6884541295000002},{x:2.1275815145,y:1.7497189295000002},{x:2.1917009144999997,y:1.7494989295000003},{x:2.1704797145,y:1.6884541295000002}],color:"primary",fill:!0},path1:{type:"path",points:[{x:1.5978828145000001,y:1.4913252295000001},{x:1.8597023145000002,y:1.4928722295}],color:"primary",fill:!1},path2:{type:"path",points:[{x:1.8686937145000002,y:1.3305097295000001},{x:1.8682837145,y:1.6536880295}],color:"primary",fill:!1},path3:{type:"path",points:[{x:1.9875004145000004,y:1.3465253295000001},{x:1.8719693145,y:1.4253192295000001}],color:"primary",fill:!1},path4:{type:"path",points:[{x:1.9942486145,y:1.6315233295000002},{x:1.8792773145000001,y:1.5529101295000003}],color:"primary",fill:!1},"arrow-1":{type:"path",points:[{x:1.9361028144999999,y:1.5487218295000003},{x:1.8932048145,y:1.6099866295000003},{x:1.9573242144999998,y:1.6097666295000004},{x:1.9361028144999999,y:1.5487218295000003}],color:"primary",fill:!0},path9:{type:"path",points:[{x:1.9943087144999998,y:1.3432655295000002},{x:2.2269582145,y:1.3449695295000001}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{VAL}",x:1.8,y:1.8674276295000003},right1:{type:"text",text:"{REF}",x:1.8,y:1.177447295}},refblocks:{right1:{x:2.2278680145,y:1.1297132295},right2:{x:1.5977076145000002,y:1.4920988295000002},right3:{x:2.2278617145000004,y:1.9544573295000003}},bounds:{minX:1.5810976555000003,maxX:2.3461148445,minY:1.0757447295,maxY:1.9710672885000002,width:1,height:1,centerX:1.9636062500000002,centerY:1.5234060090000001},circles:{"path1-0":{type:"circle",x:2.0463372145000003,y:1.5256545295000001,radius:.29977763,color:"primary",fill:!1}}},{paths:paths8,texts:texts9,bounds:bounds8,refblocks:refblocks8,circles:circles6}=darlington_pair_transistor_default,darlington_pair_transistor_horz_default={primitives:[...Object.values(paths8),...Object.values(circles6),{...texts9.bottom1,anchor:"middle_top"},{...texts9.right1,anchor:"middle_bottom"}],ports:[{...refblocks8.right1,labels:["3"]},{...refblocks8.right2,labels:["1"]},{...refblocks8.right3,labels:["2"]}],size:{width:bounds8.width,height:bounds8.height},center:{x:bounds8.centerX,y:bounds8.centerY}},darlington_pair_transistor_vert_default=rotateSymbol(darlington_pair_transistor_horz_default),dc_ammeter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-.12447409999999959,y:.0852510999999998},{x:.11626639999999999,y:.0852510999999998}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.4472267999999995},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.3470985000000004},left1:{type:"text",text:"A",x:0,y:-.1}},refblocks:{left1:{x:-.5446330999999993,y:0},right1:{x:.5381638000000004,y:0}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:-.08525110000000002,maxY:.0852510999999998,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:-11102230246251565e-32},circles:{path1:{type:"circle",x:0,y:0,radius:.28854213,color:"primary",fill:!1}}},{paths:paths9,texts:texts10,bounds:bounds9,refblocks:refblocks9,circles:circles7}=dc_ammeter_default,dc_ammeter_horz_default={primitives:[...Object.values(paths9),...Object.values(circles7),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"},{...texts10.left1,anchor:"center",fontSize:.3}],ports:[{...refblocks9.left1,labels:["1"]},{...refblocks9.right1,labels:["2"]}],size:{width:bounds9.width,height:bounds9.height},center:{x:bounds9.centerX,y:bounds9.centerY}};function isPathPrimitive(lV){return typeof lV=="object"&&lV!==null&&lV.type==="path"&&Array.isArray(lV.points)&&typeof lV.color=="string"}function isTextPrimitive(lV){return typeof lV=="object"&&lV!==null&&lV.type==="text"&&typeof lV.text=="string"&&typeof lV.x=="number"&&typeof lV.y=="number"&&typeof lV.anchor=="string"}var{6:letter2,2:underline,...rest2}=dc_ammeter_horz_default.primitives;isPathPrimitive(underline)&&underline.points.map(lV=>{lV.y+=.05}),isTextPrimitive(letter2)&&(letter2.y+=.025);function isPrimitive2(lV){return typeof lV=="object"}var rotatedSymbol4=rotateSymbol({...dc_ammeter_horz_default,primitives:Object.values(rest2).filter(isPrimitive2)}),dc_ammeter_vert_default={...rotatedSymbol4,primitives:[...rotatedSymbol4.primitives,letter2,underline]},dc_voltmeter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:.09442299999999992,y:-.13438304999999984},{x:-.004364400000000712,y:.05710404999999996},{x:-.1110211000000012,y:-.13438304999999984}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-.12447409999999959,y:.13438304999999984},{x:.11626639999999999,y:.13438304999999984}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.39809484999999944},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.39623045000000046}},refblocks:{left1:{x:-.5446330999999993,y:0},right1:{x:.5381638000000004,y:0}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:-.13438304999999984,maxY:.13438304999999984,width:1.0614356000000003,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0,radius:.28854213,color:"primary",fill:!1}}},{paths:paths10,texts:texts11,bounds:bounds10,refblocks:refblocks10,circles:circles8}=dc_voltmeter_default,dc_voltmeter_horz_default={primitives:[...Object.values(paths10),...Object.values(circles8),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"}],ports:[{...refblocks10.left1,labels:["1"]},{...refblocks10.right1,labels:["2"]}],size:{width:bounds10.width,height:bounds10.height},center:{x:bounds10.centerX,y:bounds10.centerY}},{2:letter3,3:underline2,...rest3}=dc_voltmeter_horz_default.primitives;function isPrimitive3(lV){return typeof lV=="object"}var rotatedSymbol5=rotateSymbol({...dc_voltmeter_horz_default,primitives:Object.values(rest3).filter(isPrimitive3)}),dc_voltmeter_vert_default={...rotatedSymbol5,primitives:[...rotatedSymbol5.primitives,letter3,underline2]},diac_default={paths:{path11:{type:"path",points:[{x:-.5176700499999997,y:-.03674505000000039},{x:-.10888805000000024,y:-.03674505000000039}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.1031184499999993,y:-.03674505000000039},{x:.5246894499999994,y:-.03674505000000039}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-.09343985000000021,y:.15120634999999893},{x:-.0930998500000002,y:-.2533405500000008}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:.08519034999999908,y:.15003384999999914},{x:.08553034999999909,y:-.2545130500000006}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-.08315755000000014,y:-.05093445000000041},{x:-.08415755000000047,y:.15178124999999976},{x:.08653524999999984,y:.05604664999999964},{x:-.08126175000000035,y:-.051477150000000194}],color:"primary",fill:!0},"path11-0-9-0":{type:"path",points:[{x:.07661224999999927,y:-.25165445000000086},{x:.07761224999999983,y:-.04893885000000098},{x:-.0930805500000007,y:-.1446734500000011},{x:.07471644999999949,y:-.2521971500000013}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-.17328624999999964,y:-.41183614999999985},bottom1:{type:"text",text:"{VAL}",x:-.03022294999999975,y:.4218361500000001}},refblocks:{left1:{x:-.54139845,y:-.0358920500000004},right1:{x:.5413984499999995,y:-.03688844999999996}},bounds:{minX:-.569556891,maxX:.5695568909999995,minY:-.5118361499999998,maxY:.4218361500000001,width:1.1391137819999995,height:.5836722999999999,centerX:-2220446049250313e-31,centerY:-.04499999999999987},circles:{path1:{type:"circle",x:-.0037626500000003116,y:-.04387315000000025,radius:.28854213,color:"primary",fill:!1}}},{paths:paths11,texts:texts12,bounds:bounds11,refblocks:refblocks11,circles:circles9}=diac_default,diac_horz_default={primitives:[...Object.values(paths11),...Object.values(circles9),{...texts12.top1,anchor:"middle_bottom"},{...texts12.bottom1,anchor:"middle_top"}],ports:[{...refblocks11.left1,labels:["1"]},{...refblocks11.right1,labels:["2"]}],size:{width:bounds11.width,height:bounds11.height},center:{x:bounds11.centerX,y:bounds11.centerY}},rotatedSymbol6=rotateSymbol(diac_horz_default),texts13=rotatedSymbol6.primitives.filter(lV=>lV.type==="text"),ref4=texts13.find(lV=>lV.text==="{REF}"),val4=texts13.find(lV=>lV.text==="{VAL}");ref4.y=0,val4.y=0;var diac_vert_default=rotatedSymbol6,diode_default={paths:{path40:{type:"path",points:[{x:.14458890000000002,y:-.03903629999999936},{x:-.1199943999999995,y:.09325540000000032}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.1199943999999995,y:-.1713280000000026},{x:.14458890000000002,y:-.03903629999999936}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.1199943999999995,y:.09325539999999677},{x:-.1199943999999995,y:-.1713280000000026}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.14458890000000002,y:-.1713280000000026},{x:.14458890000000002,y:.09325539999999677}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.12219909999999956,y:-.03903629999999936},{x:-.5168693999999996,y:-.03903629999999936}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:.5233797,y:-.038951100000002015},{x:.14967160000000002,y:-.038951100000002015}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.0050250999999996715,y:-.26884529999999884},bottom1:{type:"text",text:"{VAL}",x:-.00011179999999999524,y:.2788453000000004}},refblocks:{left1:{x:-.5191471000000001,y:-.0399206999999997},right1:{x:.5191471000000001,y:-.03889610000000232}},bounds:{minX:-.5473055410000001,maxX:.5473055410000001,minY:-.3688452999999988,maxY:.2788453000000004,width:1.0946110820000001,height:.29769059999999925,centerX:0,centerY:-.04499999999999921},circles:{}},{paths:paths12,texts:texts14,bounds:bounds12,refblocks:refblocks12,circles:circles10}=diode_default,diode_right_default={primitives:[...Object.values(paths12),...Object.values(circles10),{...texts14.top1,anchor:"middle_bottom"},{...texts14.bottom1,anchor:"middle_top"}],ports:[{...refblocks12.left1,labels:["1"]},{...refblocks12.right1,labels:["2"]}],size:{width:bounds12.width,height:bounds12.height},center:{x:bounds12.centerX,y:bounds12.centerY}},diode_down_default=rotateSymbol(diode_right_default,"down"),diode_left_default=rotateSymbol(diode_right_default,"left"),diode_up_default=rotateSymbol(diode_right_default,"up"),dpst_switch_default={paths:{path11:{type:"path",points:[{x:-.3622268000000006,y:-.05787995000000046},{x:-.1357978000000004,y:-.05787995000000046}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-.12009950000000069,y:-.0563494500000008},{x:.10307889999999986,y:-.19603885000000099}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.12795640000000064,y:-.05787995000000046},{x:.36869780000000096,y:-.05787995000000046}],color:"primary",fill:!1},"path11-5":{type:"path",points:[{x:-.3622270999999999,y:.1736642499999992},{x:-.1357980999999997,y:.1736642499999992}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:-.12009979999999998,y:.17519474999999973},{x:.10307860000000058,y:.035505349999999325}],color:"primary",fill:!1},"path12-0":{type:"path",points:[{x:.12795610000000002,y:.1736642499999992},{x:.3686968000000006,y:.1736642499999992}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.1958158999999995,y:-.39216264999999995},bottom1:{type:"text",text:"{VAL}",x:-.029144200000000398,y:.40216264999999995}},refblocks:{bottom1:{x:-.12356020000000001,y:.17845394999999975},bottom2:{x:.1153169000000005,y:.17845394999999975},left1:{x:-.37614279999999956,y:-.057027350000000254},left2:{x:-.12356020000000001,y:-.05309054999999985},left3:{x:-.37614279999999956,y:.17451715000000023},right1:{x:.37614279999999933,y:-.05802374999999982},right2:{x:.1153169000000005,y:-.05309054999999985},right3:{x:.37614279999999933,y:.17352074999999978}},bounds:{minX:-.40430124099999953,maxX:.4043012409999993,minY:-.4921626499999999,maxY:.40216264999999995,width:1,height:1,centerX:-11102230246251565e-32,centerY:-.044999999999999984},circles:{}},{paths:paths13,texts:texts15,bounds:bounds13,refblocks:refblocks13,circles:circles11}=dpst_switch_default,dpst_switch_horz_default={primitives:[...Object.values(paths13),...Object.values(circles11),{...texts15.top1,anchor:"middle_bottom",x:0},{...texts15.bottom1,anchor:"middle_top",x:0}],ports:[{...refblocks13.left1,labels:["1","left1"]},{...refblocks13.left3,labels:["3","left3"]},{...refblocks13.right1,labels:["2","right1"]},{...refblocks13.right3,labels:["4","right3"]}],size:{width:bounds13.width,height:bounds13.height},center:{x:bounds13.centerX,y:bounds13.centerY}},rotatedSymbol7=rotateSymbol(dpst_switch_horz_default),texts16=rotatedSymbol7.primitives.filter(lV=>lV.type==="text"),val5=texts16.find(lV=>lV.text==="{VAL}");val5.anchor="middle_right",val5.x=-.35,val5.y=0;var ref5=texts16.find(lV=>lV.text==="{REF}");ref5.anchor="middle_left",ref5.x=.3,ref5.y=0;var dpst_switch_vert_default=rotatedSymbol7,filled_diode_default={paths:{path11:{type:"path",points:[{x:-.5464958295000011,y:-.03674480953641934},{x:-.22498262950000125,y:-.03674480953641934}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.13950697049999894,y:-.04461410953641942},{x:.45879767049999964,y:-.04461410953641942}],color:"primary",fill:!1},"path12-6":{type:"path",points:[{x:.1346534705000002,y:.1570013904635803},{x:.13354747050000015,y:-.24621560953641985}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-.2177038295000011,y:-.26567520953641943},{x:-.2197708295000007,y:.15700869046358035},{x:.13282137049999876,y:-.0426085095364197},{x:-.21378932950000062,y:-.2668066095364201}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-.2435859295000009,y:-.3777354095364187},bottom1:{type:"text",text:"{VAL}",x:-.07353149016142102,y:.3877354095364185},right1:{type:"text",text:"",x:.5834896704999997,y:.3364777904635812}},refblocks:{left1:{x:-.5653312295,y:-.0358920095364188},right1:{x:.47024967049999944,y:-.044757709536418666}},bounds:{minX:-.5934896705,maxX:.6834896704999996,minY:-.4777354095364187,maxY:.3877354095364185,width:1.2769793409999997,height:1,centerX:.04499999999999982,centerY:-.045000000000000095},circles:{}},{paths:paths14,texts:texts17,bounds:bounds14,refblocks:refblocks14,circles:circles12}=filled_diode_default,filled_diode_horz_default={primitives:[...Object.values(paths14),...Object.values(circles12),{type:"text",text:"{REF}",x:-.1,y:-.38,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:-.1,y:.28,anchor:"middle_top"}],ports:[{...refblocks14.left1,labels:["1"]},{...refblocks14.right1,labels:["2"]}],size:{width:bounds14.width,height:bounds14.height},center:{x:bounds14.centerX,y:bounds14.centerY}},filled_diode_vert_default=rotateSymbol(filled_diode_horz_default),frequency_meter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.36197569999999946},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.43234960000000044},left1:{type:"text",text:"Hz",x:0,y:-.035}},refblocks:{left1:{x:-.5446330999999993,y:.000852800000000542},right1:{x:.5381638000000004,y:-.00014359999999924433}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:0,maxY:0,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.007128299999999532,radius:.28854213,color:"primary",fill:!1}}},{paths:paths15,texts:texts18,bounds:bounds15,refblocks:refblocks15,circles:circles13}=frequency_meter_default,frequency_meter_horz_default={primitives:[...Object.values(paths15),...Object.values(circles13),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"},{...texts18.left1,anchor:"center",fontSize:.2}],ports:[{...refblocks15.left1,labels:["1"]},{...refblocks15.right1,labels:["2"]}],size:{width:bounds15.width,height:bounds15.height},center:{x:bounds15.centerX,y:bounds15.centerY}},{5:letter4,...rest4}=frequency_meter_horz_default.primitives;function isPrimitive4(lV){return typeof lV=="object"}var rotatedSymbol8=rotateSymbol({...frequency_meter_horz_default,primitives:Object.values(rest4).filter(isPrimitive4)}),frequency_meter_vert_default={...rotatedSymbol8,primitives:[...rotatedSymbol8.primitives,letter4]},fuse_default={paths:{path10:{type:"path",points:[{x:-.5283037500000001,y:-.03141365000000107},{x:.5300302500000003,y:-.03141365000000107}],color:"primary",fill:!1},path14:{type:"path",points:[{x:.0008652499999994845,y:-.16370535000000075},{x:.2654482499999995,y:-.16370535000000075},{x:.2654482499999995,y:.10087804999999861},{x:-.2637187499999998,y:.10087804999999861},{x:-.2637187499999998,y:-.16370535000000075},{x:.0008652499999994845,y:-.16370535000000075}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.008263949999999909,y:-.23091725000000096},bottom1:{type:"text",text:"{VAL}",x:-.1716539500000005,y:.24091724999999897}},refblocks:{left1:{x:-.5345548500000001,y:-.03446055000000037},right1:{x:.5345548500000001,y:-.030256149999999593}},bounds:{minX:-.5627132910000001,maxX:.5627132910000001,minY:-.33091725000000094,maxY:.24091724999999897,width:1.1254265820000002,height:.22183449999999993,centerX:0,centerY:-.045000000000000984},circles:{}},{paths:paths16,texts:texts19,bounds:bounds16,refblocks:refblocks16}=fuse_default,fuse_horz_default={primitives:[...Object.values(paths16),{...texts19.top1,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.2,anchor:"middle_top"}],ports:[{...refblocks16.left1,labels:["1"]},{...refblocks16.right1,labels:["2"]}],size:{width:bounds16.width,height:bounds16.height},center:{x:bounds16.centerX,y:bounds16.centerY}},fuse_vert_default=rotateSymbol(fuse_horz_default),ground_default={paths:{path1:{type:"path",points:[{x:-.3449701000000003,y:-.4545300000000001},{x:-.044970100000000235,y:-.4545300000000001}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-.025322899999999926,y:-.25053000000000014},{x:-.025322900000000148,y:-.65053}],color:"primary",fill:!1},path3:{type:"path",points:[{x:.04499999999999993,y:-.3005300000000002},{x:.04499999999999993,y:-.60053}],color:"primary",fill:!1},path4:{type:"path",points:[{x:.14499999999999957,y:-.40053000000000005},{x:.14499999999999957,y:-.5005300000000001}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{REF}",x:-.45500000000000007,y:.6505299999999998},right1:{type:"text",text:"{VAL}",x:.4449999999999996,y:-.35053}},refblocks:{top1:{x:-.3449701000000003,y:-.4545300000000001},top2:{x:.16500000000000004,y:-.4535300000000002}},bounds:{minX:-.45500000000000007,maxX:.5449999999999996,minY:-.65053,maxY:.6505299999999998,width:.9999999999999997,height:.9510599999999999,centerX:.04499999999999976,centerY:-11102230246251565e-32},circles:{}},{paths:paths17,circles:circles14,bounds:bounds17,refblocks:refblocks17}=ground_default,horizontalSymbol={primitives:[...Object.values(paths17),...Object.values(circles14),{type:"text",text:"{REF}",x:-.1,y:-.8,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:-.1,y:-.1,anchor:"middle_top"}],ports:[{...refblocks17.top1,labels:["1"]}],size:{width:bounds17.width,height:bounds17.height},center:{x:bounds17.centerX-.09,y:bounds17.centerY-.45}},ground_horz_default=horizontalSymbol,{paths:paths18,circles:circles15,bounds:bounds18,refblocks:refblocks18}=ground_default,verticalSymbol={primitives:[...Object.values(paths18),...Object.values(circles15),{type:"text",text:"{REF}",x:-.015,y:-.75,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:-.015,y:-.12,anchor:"middle_top"}],ports:[{...refblocks18.top1,labels:["1"]}],size:{width:bounds18.width,height:bounds18.height},center:{x:bounds18.centerX,y:bounds18.centerY-.45}},ground_vert_default=rotateSymbol(verticalSymbol),gunn_diode_default={paths:{path11:{type:"path",points:[{x:-.49895505000000084,y:-.036744850000000495},{x:-.177441850000001,y:-.036744850000000495}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.18704774999999918,y:-.044614150000000574},{x:.5063384499999999,y:-.044614150000000574}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-.3067105499999998,y:-.19992595000000035},{x:-.3084575500000002,y:.10413894999999984},{x:-.01040014999999972,y:-.03945905000000027},{x:-.3034011499999991,y:-.20073985000000039}],color:"primary",fill:!0},"path11-0-9-5":{type:"path",points:[{x:.3324594500000002,y:-.20076375000000035},{x:.33420945000000013,y:.10330114999999984},{x:.03615254999999973,y:-.04029685000000027},{x:.32915344999999974,y:-.20157765000000039}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-.11729224999999999,y:-.37773544999999986},bottom1:{type:"text",text:"{VAL}",x:.030109249999999532,y:.38773544999999987}},refblocks:{left1:{x:-.5177904499999998,y:-.03589204999999995},right1:{x:.5177904499999997,y:-.04475774999999982}},bounds:{minX:-.5459488909999998,maxX:.5459488909999997,minY:-.47773544999999984,maxY:.38773544999999987,width:1.0918977819999993,height:1,centerX:-5551115123125783e-32,centerY:-.044999999999999984},circles:{}},{paths:paths19,texts:texts20,bounds:bounds19,refblocks:refblocks19,circles:circles16}=gunn_diode_default,gunn_diode_horz_default={primitives:[...Object.values(paths19),...Object.values(circles16),{...texts20.top1,anchor:"middle_left"},{type:"text",text:"{VAL}",x:-.11,y:.38773544999999987}],ports:[{...refblocks19.left1,labels:["1"]},{...refblocks19.right1,labels:["2"]}],size:{width:bounds19.width,height:bounds19.height},center:{x:bounds19.centerX,y:bounds19.centerY}},rotatedSymbol9=rotateSymbol(gunn_diode_horz_default),texts21=rotatedSymbol9.primitives.filter(lV=>lV.type==="text"),ref6=texts21.find(lV=>lV.text==="{REF}"),val6=texts21.find(lV=>lV.text==="{VAL}");ref6.x=.25,ref6.y=-.045,val6.x=-.55,val6.y=0;var gunn_diode_vert_default=rotatedSymbol9,igbt_transistor_default={paths:{path11:{type:"path",points:[{x:-.33466555000000053,y:-.0037939000000000167},{x:.04390385000000019,y:-.0011709000000001968}],color:"primary",fill:!1},path40:{type:"path",points:[{x:.12457955000000065,y:-.19306540000000028},{x:.123649550000001,y:.1750840999999994}],color:"primary",fill:!1},path42:{type:"path",points:[{x:.06045334999999952,y:.1174366},{x:.06045334999999952,y:-.14714680000000002}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.33417885,y:.2434666000000001},{x:.33357884999999987,y:.5397975000000004}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:.3346655500000004,y:-.5397975000000003},{x:.33406555000000027,y:-.2706031000000002}],color:"primary",fill:!1},path15:{type:"path",points:[{x:.2236118499999995,y:.21260169999999978},{x:.32845994999999917,y:.22765899999999983},{x:.2828999499999987,y:.13876569999999977}],color:"primary",fill:!0},path17:{type:"path",points:[{x:.12747495000000053,y:.08265219999999984},{x:.2829977500000005,y:.19494979999999984}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.1246791499999993,y:-.11535130000000038},{x:.3341235499999988,y:-.2634207000000004}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.10113134999999929,y:-.3683925999999993},bottom1:{type:"text",text:"{VAL}",x:.08975225000000009,y:.4174267000000007}},refblocks:{top1:{x:.3348183499999997,y:-.5593924999999992},bottom1:{x:.3327607500000005,y:.5538097000000006},left1:{x:-.34858084999999983,y:-.0029410999999994747}},bounds:{minX:-.33466555000000053,maxX:.3346655500000004,minY:-.5397975000000003,maxY:.5397975000000004,width:1,height:1.0795950000000007,centerX:-5551115123125783e-32,centerY:5551115123125783e-32},circles:{path1:{type:"circle",x:.18905494999999983,y:-.010922199999999549,radius:.28854213,color:"primary",fill:!1}}},{paths:paths20,texts:texts22,bounds:bounds20,refblocks:refblocks20,circles:circles17}=igbt_transistor_default,igbt_transistor_horz_default={primitives:[...Object.values(paths20),...Object.values(circles17),{type:"text",text:"{REF}",x:0,y:-.4,anchor:"middle_right"},{type:"text",text:"{VAL}",x:0,y:.4,anchor:"middle_right"}],ports:[{...refblocks20.top1,labels:["1"]},{...refblocks20.bottom1,labels:["2"]},{...refblocks20.left1,labels:["3"]}],size:{width:bounds20.width,height:bounds20.height},center:{x:bounds20.centerX+.06,y:bounds20.centerY}},rotated2=rotateSymbol(igbt_transistor_horz_default),ref7=rotated2.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val7=rotated2.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref7.anchor="middle_left",val7.anchor="middle_right",ref7.x=.45,ref7.y+=.065,val7.y+=.065;var igbt_transistor_vert_default=rotated2,illuminated_push_button_normally_open_default={paths:{"path12-1-8-6-9":{type:"path",points:[{x:.023137150000000162,y:.024940499999996035},{x:.023137150000000162,y:.10494049999999788}],color:"primary",fill:!1},"path12-1-5-6":{type:"path",points:[{x:-.48740694999999956,y:.18801149999999645},{x:-.1731006500000003,y:.18801149999999645}],color:"primary",fill:!1},"path12-1-5-6-8":{type:"path",points:[{x:.023792949999999813,y:-.1693045000000044},{x:.023792949999999813,y:-.1026565000000037}],color:"primary",fill:!1},"path12-1-8-0":{type:"path",points:[{x:-.14922445000000018,y:.035203499999997945},{x:.19549865000000022,y:.18762249999999803}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:.19549885000000078,y:.18762249999999803},{x:.4881437499999999,y:.18762249999999803}],color:"primary",fill:!1},"path12-1-8-6-9-4":{type:"path",points:[{x:.023137150000000162,y:-.11686550000000295},{x:.023137150000000162,y:-.015065500000002174}],color:"primary",fill:!1},"path12-1-8-6-9-4-3":{type:"path",points:[{x:.08312335000000015,y:-.10471550000000285},{x:.08312335000000015,y:-.047931500000004235}],color:"primary",fill:!1},"path12-1-8-6-9-4-3-1":{type:"path",points:[{x:-.03684904999999983,y:-.10471550000000285},{x:-.03684904999999983,y:-.047931500000004235}],color:"primary",fill:!1},"path12-1-8-6-9-4-4":{type:"path",points:[{x:.08312335000000015,y:-.10471550000000285},{x:-.03684904999999983,y:-.10471550000000285}],color:"primary",fill:!1},"path14-5":{type:"path",points:[{x:-.011640198644880861,y:-.2799169119921796},{x:.01182744133211866,y:-.2516822395036833},{x:.035295081309120846,y:-.22344756701517987},{x:.05876272128612037,y:-.19521289452668178}],color:"primary",fill:!0},"path14-5-3":{type:"path",points:[{x:-.011818241440559873,y:-.1952224926985373},{x:.01171692178543804,y:-.22339535480803718},{x:.03525208501144128,y:-.2515682169175424},{x:.058787248237439194,y:-.27974107902703693}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:.010987250000000337,y:-.37833950000000094},bottom1:{type:"text",text:"{VAL}",x:-.1564439499999999,y:.3883394999999972}},refblocks:{left1:{x:-.4717985499999999,y:.18798249999999506},right1:{x:.4717985499999999,y:.1880084999999987}},bounds:{minX:-.4999569909999999,maxX:.4999569909999999,minY:-.4783395000000009,maxY:.3883394999999972,width:.9999139819999998,height:.5166789999999981,centerX:0,centerY:-.04500000000000187},circles:{path9:{type:"circle",x:.02379285000000042,y:-.23747350000000367,radius:.059920847,color:"primary",fill:!1}}},{paths:paths21,texts:texts23,bounds:bounds21,refblocks:refblocks21,circles:circles18}=illuminated_push_button_normally_open_default,illuminated_push_button_normally_open_horz_default={primitives:[...Object.values(paths21),...Object.values(circles18),{...texts23.top1,anchor:"middle_right",x:0,y:-.4},{...texts23.bottom1,anchor:"middle_right",x:0}],ports:[{...refblocks21.left1,labels:["1"]},{...refblocks21.right1,labels:["2"]}],size:{width:bounds21.width,height:bounds21.height},center:{x:bounds21.centerX,y:bounds21.centerY}},rotatedSymbol10=rotateSymbol(illuminated_push_button_normally_open_horz_default),texts24=rotatedSymbol10.primitives.filter(lV=>lV.type==="text"),val8=texts24.find(lV=>lV.text==="{VAL}");val8.x=-.35,val8.y=0,val8.anchor="middle_right";var ref8=texts24.find(lV=>lV.text==="{REF}");ref8.y=0,ref8.x=.35,ref8.anchor="middle_left";var illuminated_push_button_normally_open_vert_default=rotatedSymbol10,inductor_default={paths:{path8698:{type:"path",points:[{x:-.20003504999999944,y:.028826854587890027},{x:-.2033544366666661,y:.022384739650748782},{x:-.20667382333333278,y:.015976838014532466},{x:-.20999320999999949,y:.009636988132081447},{x:-.21331259666666616,y:.003398282866981144},{x:-.21663198333333286,y:-.002707293078776634},{x:-.21995136999999956,y:-.008649213595881871},{x:-.2232707566666662,y:-.014398745618147975},{x:-.2265901433333329,y:-.019929263927997674},{x:-.22990952999999958,y:-.02521654286791855},{x:-.23322891666666629,y:-.030239021761836165},{x:-.23654830333333293,y:-.03497804113839313},{x:-.23986768999999963,y:-.039418047168021914},{x:-.24318707666666634,y:-.04354676207395655},{x:-.246506463333333,y:-.047355318650124094},{x:-.24982584999999968,y:-.05083835741210997},{x:-.25314523666666633,y:-.05399408531679076},{x:-.25646462333333303,y:-.056824295407289886},{x:-.25978400999999973,y:-.05933434716802191},{x:-.26310339666666643,y:-.061533107805059786},{x:-.2664227833333331,y:-.0634328550951695},{x:-.2697421699999998,y:-.06504914286791855},{x:-.2730615566666664,y:-.06640063059466435},{x:-.2763809433333332,y:-.0675088789514813},{x:-.27970032999999983,y:-.06839811359588187},{x:-.28301971666666653,y:-.0690949597454433},{x:-.28633910333333323,y:-.06962815046635218},{x:-.2896584899999999,y:-.07002821186791855},{x:-.2929778766666666,y:-.07032712865213421},{x:-.2962972633333332,y:-.07055799368258454},{x:-.29961664999999993,y:-.07075464541210996},{x:-.30293603333333324,y:-.07055799368258453},{x:-.30625541666666656,y:-.07032712865213421},{x:-.30957479999999993,y:-.07002821186791855},{x:-.31289418333333324,y:-.06962815046635219},{x:-.31621356666666656,y:-.0690949597454433},{x:-.31953294999999987,y:-.06839811359588187},{x:-.32285233333333313,y:-.0675088789514813},{x:-.3261717166666665,y:-.06640063059466433},{x:-.32949109999999976,y:-.06504914286791855},{x:-.33281048333333313,y:-.06343285509516951},{x:-.33612986666666644,y:-.061533107805059786},{x:-.33944924999999976,y:-.05933434716802191},{x:-.3427686333333331,y:-.056824295407289886},{x:-.3460880166666664,y:-.05399408531679075},{x:-.3494073999999997,y:-.05083835741210997},{x:-.352726783333333,y:-.0473553186501241},{x:-.35604616666666633,y:-.04354676207395655},{x:-.35936554999999964,y:-.039418047168021914},{x:-.362684933333333,y:-.03497804113839313},{x:-.36600431666666633,y:-.030239021761836175},{x:-.3693236999999996,y:-.025216542867918555},{x:-.3726430833333329,y:-.01992926392799769},{x:-.3759624666666663,y:-.014398745618147961},{x:-.3792818499999996,y:-.008649213595881871},{x:-.38260123333333285,y:-.0027072930787766323},{x:-.38592061666666616,y:.003398282866981149},{x:-.38923999999999953,y:.009636988132081444},{x:-.39255938333333285,y:.015976838014532466},{x:-.39587876666666616,y:.022384739650748775},{x:-.3991981499999995,y:.028826854587890027}],color:"primary",fill:!1},path8700:{type:"path",points:[{x:-.000872049999999458,y:.028826154587890507},{x:-.004191433333332769,y:.022384036317415937},{x:-.00751081666666608,y:.01597613134786629},{x:-.010830199999999391,y:.009636278132081942},{x:-.014149583333332702,y:.003397569533648309},{x:-.01746896666666601,y:-.0027080097454427934},{x:-.020788349999999324,y:-.008649933595881358},{x:-.02410773333333263,y:-.014399468951480792},{x:-.027427116666665946,y:-.019929990594663816},{x:-.030746499999999254,y:-.025217272867918025},{x:-.03406588333333256,y:-.030239755095168967},{x:-.037385266666665876,y:-.03497877780505925},{x:-.04070464999999919,y:-.03941878716802137},{x:-.0440240333333325,y:-.04354750540728934},{x:-.047343416666665805,y:-.0473560653167902},{x:-.05066279999999912,y:-.05083910741210941},{x:-.053982183333332434,y:-.05399483865012353},{x:-.05730156666666574,y:-.05682505207395598},{x:-.06062094999999905,y:-.05933510716802134},{x:-.06394033333333236,y:-.06153387113839254},{x:-.06725971666666566,y:-.06343362176183558},{x:-.07057909999999898,y:-.06504991286791795},{x:-.0738984833333323,y:-.06640140392799708},{x:-.07721786666666561,y:-.06750965561814737},{x:-.08053724999999892,y:-.06839889359588126},{x:-.08385663333333224,y:-.06909574307877601},{x:-.08717601666666554,y:-.06962893713301824},{x:-.09049539999999885,y:-.07002900186791793},{x:-.09381478333333215,y:-.0703279219854669},{x:-.09713416666666547,y:-.07055879034925058},{x:-.10045354999999878,y:-.07075544541210932},{x:-.10377293666666547,y:-.07055879034925057},{x:-.10709232333333214,y:-.0703279219854669},{x:-.11041170999999883,y:-.07002900186791793},{x:-.1137310966666655,y:-.06962893713301824},{x:-.1170504833333322,y:-.06909574307877601},{x:-.1203698699999989,y:-.06839889359588126},{x:-.12368925666666555,y:-.06750965561814737},{x:-.12700864333333226,y:-.06640140392799707},{x:-.13032802999999893,y:-.06504991286791795},{x:-.13364741666666563,y:-.06343362176183559},{x:-.13696680333333228,y:-.06153387113839254},{x:-.14028618999999898,y:-.05933510716802133},{x:-.14360557666666568,y:-.05682505207395598},{x:-.14692496333333235,y:-.05399483865012352},{x:-.15024434999999903,y:-.05083910741210941},{x:-.1535637366666657,y:-.04735606531679021},{x:-.15688312333333237,y:-.04354750540728934},{x:-.16020250999999908,y:-.03941878716802137},{x:-.16352189666666575,y:-.03497877780505926},{x:-.16684128333333245,y:-.030239755095168977},{x:-.1701606699999991,y:-.025217272867918028},{x:-.1734800566666658,y:-.019929990594663834},{x:-.1767994433333325,y:-.014399468951480778},{x:-.1801188299999992,y:-.008649933595881358},{x:-.18343821666666585,y:-.0027080097454427916},{x:-.18675760333333255,y:.0033975695336483144},{x:-.19007698999999922,y:.009636278132081942},{x:-.19339637666666593,y:.01597613134786629},{x:-.19671576333333257,y:.02238403631741593},{x:-.20003514999999927,y:.028826154587890507}],color:"primary",fill:!1},path8702:{type:"path",points:[{x:.19829105000000036,y:.028826154587890507},{x:.19497166333333366,y:.022384036317415937},{x:.191652276666667,y:.01597613134786629},{x:.1883328900000003,y:.009636278132081942},{x:.18501350333333363,y:.003397569533648309},{x:.18169411666666693,y:-.0027080097454427934},{x:.1783747300000003,y:-.008649933595881358},{x:.17505534333333356,y:-.014399468951480792},{x:.1717359566666669,y:-.019929990594663816},{x:.16841657000000018,y:-.025217272867918025},{x:.16509718333333356,y:-.030239755095168967},{x:.16177779666666683,y:-.03497877780505925},{x:.15845841000000016,y:-.03941878716802137},{x:.15513902333333346,y:-.04354750540728934},{x:.15181963666666679,y:-.0473560653167902},{x:.1485002500000001,y:-.05083910741210941},{x:.14518086333333344,y:-.05399483865012353},{x:.14186147666666676,y:-.05682505207395598},{x:.13854209000000006,y:-.05933510716802134},{x:.1352227033333334,y:-.06153387113839254},{x:.13190331666666671,y:-.06343362176183558},{x:.12858393,y:-.06504991286791795},{x:.12526454333333334,y:-.06640140392799708},{x:.12194515666666664,y:-.06750965561814737},{x:.11862576999999996,y:-.06839889359588126},{x:.11530638333333329,y:-.06909574307877601},{x:.11198699666666659,y:-.06962893713301824},{x:.10866760999999991,y:-.07002900186791793},{x:.10534822333333323,y:-.0703279219854669},{x:.10202883666666655,y:-.07055879034925058},{x:.09870944999999987,y:-.07075544541210932},{x:.09539006666666656,y:-.07055879034925057},{x:.09207068333333325,y:-.0703279219854669},{x:.08875129999999994,y:-.07002900186791793},{x:.08543191666666662,y:-.06962893713301824},{x:.08211253333333332,y:-.06909574307877601},{x:.07879315,y:-.06839889359588126},{x:.07547376666666669,y:-.06750965561814737},{x:.07215438333333338,y:-.06640140392799707},{x:.06883500000000006,y:-.06504991286791795},{x:.06551561666666676,y:-.06343362176183559},{x:.06219623333333345,y:-.06153387113839254},{x:.05887685000000013,y:-.05933510716802133},{x:.055557466666666826,y:-.05682505207395598},{x:.05223808333333351,y:-.05399483865012352},{x:.048918700000000204,y:-.05083910741210941},{x:.045599316666666896,y:-.04735606531679021},{x:.04227993333333358,y:-.04354750540728934},{x:.038960550000000274,y:-.03941878716802137},{x:.03564116666666696,y:-.03497877780505926},{x:.03232178333333365,y:-.030239755095168977},{x:.02900240000000034,y:-.025217272867918028},{x:.025683016666667034,y:-.019929990594663834},{x:.022363633333333712,y:-.014399468951480778},{x:.019044250000000405,y:-.008649933595881358},{x:.015724866666667094,y:-.0027080097454427916},{x:.01240548333333378,y:.0033975695336483144},{x:.009086100000000473,y:.009636278132081942},{x:.0057667166666671614,y:.01597613134786629},{x:.002447333333333852,y:.02238403631741593},{x:-.000872049999999458,y:.028826154587890507}],color:"primary",fill:!1},path8704:{type:"path",points:[{x:.39745405000000034,y:.028826154587890507},{x:.3941346666666671,y:.022384036317415937},{x:.3908152833333337,y:.01597613134786629},{x:.38749590000000045,y:.009636278132081942},{x:.3841765166666671,y:.003397569533648309},{x:.3808571333333338,y:-.0027080097454427934},{x:.3775377500000005,y:-.008649933595881358},{x:.37421836666666713,y:-.014399468951480792},{x:.3708989833333339,y:-.019929990594663816},{x:.3675796000000005,y:-.025217272867918025},{x:.36426021666666725,y:-.030239755095168967},{x:.36094083333333393,y:-.03497877780505925},{x:.35762145000000056,y:-.03941878716802137},{x:.3543020666666673,y:-.04354750540728934},{x:.350982683333334,y:-.0473560653167902},{x:.3476633000000007,y:-.05083910741210941},{x:.34434391666666736,y:-.05399483865012353},{x:.34102453333333405,y:-.05682505207395598},{x:.3377051500000008,y:-.05933510716802134},{x:.3343857666666674,y:-.06153387113839254},{x:.33106638333333416,y:-.06343362176183558},{x:.3277470000000008,y:-.06504991286791795},{x:.32442761666666753,y:-.06640140392799708},{x:.32110823333333416,y:-.06750965561814737},{x:.3177888500000009,y:-.06839889359588126},{x:.31446946666666753,y:-.06909574307877601},{x:.31115008333333427,y:-.06962893713301824},{x:.30783070000000096,y:-.07002900186791793},{x:.30451131666666764,y:-.0703279219854669},{x:.3011919333333343,y:-.07055879034925058},{x:.297872550000001,y:-.07075544541210932},{x:.29455316333333437,y:-.07055879034925057},{x:.29123377666666767,y:-.0703279219854669},{x:.287914390000001,y:-.07002900186791793},{x:.28459500333333426,y:-.06962893713301824},{x:.2812756166666676,y:-.06909574307877601},{x:.2779562300000009,y:-.06839889359588126},{x:.2746368433333342,y:-.06750965561814737},{x:.27131745666666757,y:-.06640140392799707},{x:.26799807000000087,y:-.06504991286791795},{x:.2646786833333342,y:-.06343362176183559},{x:.26135929666666746,y:-.06153387113839254},{x:.2580399100000008,y:-.05933510716802133},{x:.2547205233333341,y:-.05682505207395598},{x:.25140113666666747,y:-.05399483865012352},{x:.24808175000000077,y:-.05083910741210941},{x:.24476236333333407,y:-.04735606531679021},{x:.24144297666666742,y:-.04354750540728934},{x:.23812359000000072,y:-.03941878716802137},{x:.23480420333333404,y:-.03497877780505926},{x:.23148481666666734,y:-.030239755095168977},{x:.22816543000000067,y:-.025217272867918028},{x:.224846043333334,y:-.019929990594663834},{x:.2215266566666673,y:-.014399468951480778},{x:.21820727000000062,y:-.008649933595881358},{x:.21488788333333395,y:-.0027080097454427916},{x:.21156849666666724,y:.0033975695336483144},{x:.20824911000000057,y:.009636278132081942},{x:.2049297233333339,y:.01597613134786629},{x:.2016103366666672,y:.02238403631741593},{x:.19829095000000052,y:.028826154587890507}],color:"primary",fill:!1},path8706:{type:"path",points:[{x:-.4023286499999996,y:.02754405458789022},{x:-.5293590499999994,y:.02754405458789022}],color:"primary",fill:!1},"path8706-5":{type:"path",points:[{x:.5261604500000003,y:.03211105458789021},{x:.39913004999999946,y:.03211105458789021}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.0040821499999992295,y:-.22497364541210985},bottom1:{type:"text",text:"{VAL}",x:-.004252755294839927,y:.23497364541211008}},refblocks:{left1:{x:-.5504428500000003,y:.02627215458789056},right1:{x:.5504428500000005,y:.03152125458789001}},bounds:{minX:-.5786012910000002,maxX:.5786012910000005,minY:-.3249736454121098,maxY:.23497364541211008,width:1.1572025820000007,height:.20994729082421992,centerX:11102230246251565e-32,centerY:-.04499999999999987},circles:{}},{paths:paths22,texts:texts25,bounds:bounds22,refblocks:refblocks22,circles:circles19}=inductor_default,inductor_horz_default={primitives:[...Object.values(paths22),...Object.values(circles19),{...texts25.top1,anchor:"middle_bottom"},{...texts25.bottom1,anchor:"middle_top"}],ports:[{...refblocks22.left1,labels:["1"]},{...refblocks22.right1,labels:["2"]}],size:{width:bounds22.width,height:bounds22.height},center:{x:bounds22.centerX,y:bounds22.centerY}},inductor_vert_default=rotateSymbol(inductor_horz_default),laser_diode_default={paths:{path11:{type:"path",points:[{x:-.5307178000000008,y:.2023617000000002},{x:-.15214840000000018,y:.20498470000000002}],color:"primary",fill:!1},path40:{type:"path",points:[{x:.1289840999999996,y:.19130049999999987},{x:-.13559890000000085,y:.32359219999999955}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.13559890000000085,y:.059008800000000194},{x:.1289840999999996,y:.19130049999999987}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.13559890000000085,y:.3235922000000002},{x:-.13559890000000085,y:.059008800000000194}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.1289840999999996,y:.059008800000000194},{x:.1289840999999996,y:.3235922000000002}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.13259069999999995,y:.1918692999999998},{x:.5307178000000008,y:.20236169999999953}],color:"primary",fill:!1},"path25-0-9-8":{type:"path",points:[{x:-.03268000000000071,y:-.25134120000000015},{x:-.05649420000000016,y:-.3235922000000002},{x:-.08048579999999972,y:-.2514182000000005}],color:"primary",fill:!0},"path78-6-5-5":{type:"path",points:[{x:-.05685430000000058,y:-.13143119999999997},{x:-.056826700000000674,y:-.14405819999999991},{x:-.056536700000000994,y:-.2719202000000003},{x:-.056346700000000416,y:-.2728202000000004}],color:"primary",fill:!1},"path25-0-9-8-2":{type:"path",points:[{x:.06541730000000001,y:-.25134120000000015},{x:.04160310000000034,y:-.3235922000000002},{x:.017611500000001,y:-.2514182000000005}],color:"primary",fill:!0},"path78-6-5-5-7":{type:"path",points:[{x:.04124299999999992,y:-.13143119999999997},{x:.041270600000000046,y:-.14405819999999991},{x:.041560599999999726,y:-.2719202000000003},{x:.041750600000000304,y:-.2728202000000004}],color:"primary",fill:!1},"path43-1":{type:"path",points:[{x:.028013799999999422,y:.08349260000000025},{x:.028013799999999422,y:.30697360000000073}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:.18325689999999928,y:-.23713399999999885},bottom1:{type:"text",text:"{VAL}",x:-.00984920000000078,y:.6347113000000009}},refblocks:{left1:{x:-.5446331000000002,y:.20321450000000074},right1:{x:.5381637999999993,y:.20221810000000118}},bounds:{minX:-.5307178000000008,maxX:.5307178000000008,minY:-.3235922000000002,maxY:.3235922000000002,width:1.0614356000000016,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-.006997300000000539,y:.1952334000000009,radius:.28854213,color:"primary",fill:!1}}},{paths:paths23,texts:texts26,bounds:bounds23,refblocks:refblocks23,circles:circles20}=laser_diode_default,laser_diode_horz_default={primitives:[...Object.values(paths23),...Object.values(circles20),{...texts26.top1,anchor:"middle_left"},{...texts26.bottom1,anchor:"middle_bottom"}],ports:[{...refblocks23.left1,labels:["1"]},{...refblocks23.right1,labels:["2"]}],size:{width:bounds23.width,height:bounds23.height},center:{x:bounds23.centerX,y:bounds23.centerY}},rotatedSymbol11=rotateSymbol(laser_diode_horz_default),texts27=rotatedSymbol11.primitives.filter(lV=>lV.type==="text"),ref9=texts27.find(lV=>lV.text==="{VAL}");ref9.x=-.52,ref9.anchor="middle_right";var laser_diode_vert_default=rotatedSymbol11,led_default={paths:{path45:{type:"path",points:[{x:.13585750000000063,y:.003696399999999045},{x:-.12872579999999934,y:.13598810000000228}],color:"primary",fill:!1},"path1-8":{type:"path",points:[{x:.12763670000000094,y:.003920199999999596},{x:.5265564000000009,y:.003920199999999596}],color:"primary",fill:!1},path46:{type:"path",points:[{x:-.12872579999999934,y:-.12859530000000063},{x:.13585750000000063,y:.003696399999999045}],color:"primary",fill:!1},path47:{type:"path",points:[{x:-.12872579999999934,y:.13598810000000228},{x:-.12872579999999934,y:-.12859530000000063}],color:"primary",fill:!1},path48:{type:"path",points:[{x:.13585750000000063,y:-.12859530000000063},{x:.13585750000000063,y:.13598810000000228}],color:"primary",fill:!1},path49:{type:"path",points:[{x:-.13076959999999938,y:.003696399999999045},{x:-.5256007999999994,y:.003696399999999045}],color:"primary",fill:!1},path25:{type:"path",points:[{x:-.1557438999999996,y:-.28545279999999806},{x:-.2530861999999994,y:-.3023319999999998},{x:-.21878339999999952,y:-.20956920000000068}],color:"primary",fill:!0},path78:{type:"path",points:[{x:-.08000449999999937,y:-.16590799999999817},{x:-.09202799999999911,y:-.1748410000000007},{x:-.2137844999999996,y:-.26529680000000155},{x:-.2144144999999993,y:-.2662468000000011}],color:"primary",fill:!1},"path25-0":{type:"path",points:[{x:.021722400000000697,y:-.30658939999999646},{x:-.07561989999999952,y:-.3234685999999982},{x:-.04131709999999922,y:-.23070579999999907}],color:"primary",fill:!0},"path78-6":{type:"path",points:[{x:.09746180000000093,y:-.18704459999999656},{x:.08543830000000074,y:-.19597759999999909},{x:-.0363181999999993,y:-.28643339999999995},{x:-.03694819999999943,y:-.2873833999999995}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{VAL}",x:-.009561699999999451,y:.3234685999999982},right1:{type:"text",text:"{REF}",x:.31464070000000044,y:-.22386570000000106}},refblocks:{left1:{x:-.5362092999999997,y:.004432900000001183},right1:{x:.5362093000000003,y:.004886400000003732}},bounds:{minX:-.5643677409999996,maxX:.5643677410000003,minY:-.32386570000000103,maxY:.3234685999999982,width:1.128735482,height:.2973342999999993,centerX:33306690738754696e-32,centerY:-.00019855000000140732},circles:{}},{paths:paths24,texts:texts28,bounds:bounds24,refblocks:refblocks24,circles:circles21}=led_default,led_right_default={primitives:[...Object.values(paths24),...Object.values(circles21),{...texts28.bottom1,anchor:"middle_top"},{...texts28.right1,anchor:"middle_bottom"}],ports:[{...refblocks24.left1,labels:["1"]},{...refblocks24.right1,labels:["2"]}],size:{width:bounds24.width,height:bounds24.height},center:{x:bounds24.centerX,y:bounds24.centerY}},led_down_default=rotateSymbol(led_right_default,"down"),led_left_default=flipSymbolOverYAxis(led_right_default),baseSymbol=rotateSymbol(led_right_default,"up"),modifiedSymbol={...baseSymbol,primitives:baseSymbol.primitives.map(lV=>lV.type==="path"&&(lV.points.length===3||lV.points.length===4)?{...lV,points:lV.points.map(J=>({x:J.x,y:-J.y+2*baseSymbol.center.y}))}:lV)},led_up_default=modifiedSymbol,light_dependent_resistor_default={paths:{path11:{type:"path",points:[{x:-.5053201665812097,y:-.010839730805804138},{x:-.1829962316128657,y:-.010839730805804138}],color:"primary",fill:!1},"path11-2":{type:"path",points:[{x:-.1674747072814866,y:-.11471502212593476},{x:-.1674747072814866,y:.07736981415388478}],color:"primary",fill:!1},"path11-5":{type:"path",points:[{x:-.1674747072814866,y:-.11632056223474518},{x:.16018133830019532,y:-.11632056223474518}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:-.1674747072814866,y:.07736981415388478},{x:.16018133830019532,y:.07736981415388478}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.17205869804197382,y:-.010839950577224311},{x:.5116721586832798,y:-.010839950577224311}],color:"primary",fill:!1},"path11-2-1":{type:"path",points:[{x:.16064490317338742,y:-.11622177498145403},{x:.16064490317338742,y:.07727135655772521}],color:"primary",fill:!1},"path25-0-9":{type:"path",points:[{x:-.40391896081308554,y:-.2111951150487743},{x:-.32538818309991635,y:-.1776462385858042},{x:-.33843942905204627,y:-.26928059146906413}],color:"primary",fill:!0},"path78-6-5":{type:"path",points:[{x:-.4470989190253618,y:-.3351265263866847},{x:-.4385525777085817,y:-.32468848279378437},{x:-.3520048317368336,y:-.21897414423109507},{x:-.3516268465799328,y:-.21798517284109487}],color:"primary",fill:!1},"path25-0-9-0":{type:"path",points:[{x:-.30220674110432255,y:-.3403193953841548},{x:-.22367596339115314,y:-.30677051892118534},{x:-.23672720934328306,y:-.3984048718044453}],color:"primary",fill:!0},"path78-6-5-9":{type:"path",points:[{x:-.3453866993165988,y:-.464250806722065},{x:-.3368403579998187,y:-.45381276312916397},{x:-.2502926120280704,y:-.34809842456647466},{x:-.24991462687116983,y:-.34710945317647446}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.1679477702432366,y:-.40859918889256375},bottom1:{type:"text",text:"{VAL}",x:-.006410773639930811,y:.464250806722065}},refblocks:{left1:{x:-.5247194309452994,y:-.009902515585214156},right1:{x:.5247194309452992,y:-.010997416799653603}},bounds:{minX:-.5520103866874645,maxX:.5520103866874643,minY:-.5085991888925637,maxY:.464250806722065,width:1.1040207733749288,height:.6228499956146287,centerX:-11102230246251565e-32,centerY:-.022174191085249373},circles:{path1:{type:"circle",x:-.003646732950281173,y:-.018672603986024328,radius:.2796529289238723,color:"primary",fill:!1}}},{paths:paths25,texts:texts29,bounds:bounds25,refblocks:refblocks25,circles:circles22}=light_dependent_resistor_default,light_dependent_resistor_horz_default={primitives:[...Object.values(paths25),...Object.values(circles22),{...texts29.top1,anchor:"middle_left",x:0},{...texts29.bottom1,anchor:"middle_left",x:0}],ports:[{...refblocks25.left1,labels:["1"]},{...refblocks25.right1,labels:["2"]}],size:{width:bounds25.width,height:bounds25.height},center:{x:bounds25.centerX,y:bounds25.centerY}},rotatedSymbol12=rotateSymbol(light_dependent_resistor_horz_default),texts30=rotatedSymbol12.primitives.filter(lV=>lV.type==="text"),val9=texts30.find(lV=>lV.text==="{VAL}");val9.x=-.35,val9.y=0,val9.anchor="middle_right";var ref10=texts30.find(lV=>lV.text==="{REF}");ref10.y=0,ref10.x=.35,ref10.anchor="middle_left";var light_dependent_resistor_vert_default=rotatedSymbol12,mosfet_depletion_normally_on_default={paths:{path208:{type:"path",points:[{x:.3793021704999999,y:-.13154093999999894},{x:.5115938705000005,y:.13304206000000107}],color:"primary",fill:!1},path209:{type:"path",points:[{x:.24701047050000025,y:.13304206000000107},{x:.3793021704999999,y:-.13154093999999894}],color:"primary",fill:!1},path210:{type:"path",points:[{x:.5115938705000005,y:.13304206000000107},{x:.24701047050000025,y:.13304206000000107}],color:"primary",fill:!1},path211:{type:"path",points:[{x:.24701047050000025,y:-.13154093999999894},{x:.5115938705000005,y:-.13154093999999894}],color:"primary",fill:!1},path212:{type:"path",points:[{x:.11471887050000085,y:.39762406000000006},{x:.3793021704999999,y:.39762406000000006}],color:"primary",fill:!1},path213:{type:"path",points:[{x:.3793021704999999,y:-.39612494},{x:.11471887050000085,y:-.39612494}],color:"primary",fill:!1},path214:{type:"path",points:[{x:.11471887050000085,y:-.5284169399999996},{x:.11471887050000085,y:-.18445994}],color:"primary",fill:!1},path215:{type:"path",points:[{x:.11471887050000085,y:.5299150600000004},{x:.11471887050000085,y:.0007480600000011606}],color:"primary",fill:!1},path216:{type:"path",points:[{x:.3793021704999999,y:.39762469000000067},{x:.3793021704999999,y:-.3961256399999993}],color:"primary",fill:!1},path217:{type:"path",points:[{x:-.1498644295,y:-.2638359399999999},{x:-.1498644295,y:.26533006000000015}],color:"primary",fill:!1},path218:{type:"path",points:[{x:-.22923942949999887,y:.2653310599999994},{x:-.22923942949999887,y:-.26383493999999885}],color:"primary",fill:!1},path219:{type:"path",points:[{x:-.5467394294999997,y:.26533006000000015},{x:-.22923942949999887,y:.2653320600000004}],color:"primary",fill:!1},path220:{type:"path",points:[{x:-.1498644295,y:.18595506000000128},{x:.11471897050000024,y:.18595506000000128}],color:"primary",fill:!1},path221:{type:"path",points:[{x:-.1498644295,y:-.18446093999999924},{x:.11471897050000024,y:-.18446093999999924}],color:"primary",fill:!1},path222:{type:"path",points:[{x:-.07048942950000026,y:.0007480600000011606},{x:.11471887050000085,y:.0007480600000011606}],color:"primary",fill:!1}},texts:{right1:{type:"text",text:"{REF}",x:.5651646705000006,y:-.2085436499999993},right2:{type:"text",text:"{VAL}",x:.5665500705,y:-.02044358999999929}},refblocks:{top1:{x:.11518067050000003,y:-.5432738300000004},bottom1:{x:.11482247050000094,y:.5432738300000004},left1:{x:-.5483916295000002,y:.2663988600000007}},bounds:{minX:-.5765500705000002,maxX:.6665500704999999,minY:-.5714322710000004,maxY:.5714322710000004,width:1.2431001410000002,height:.7928645420000008,centerX:.04499999999999987,centerY:0},circles:{}},{paths:paths26,texts:texts31,bounds:bounds26,refblocks:refblocks26}=mosfet_depletion_normally_on_default,mosfet_depletion_normally_on_horz_default={primitives:[...Object.values(paths26),{...texts31.right1,anchor:"middle_left"},{...texts31.right2,anchor:"middle_left"}],ports:[{...refblocks26.top1,labels:["1"]},{...refblocks26.bottom1,labels:["2"]},{...refblocks26.left1,labels:["3"]}],size:{width:bounds26.width+.4,height:bounds26.height},center:{x:bounds26.centerX+.2,y:bounds26.centerY}},rotated3=rotateSymbol(mosfet_depletion_normally_on_horz_default),ref11=rotated3.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val10=rotated3.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref11.anchor="middle_top",val10.anchor="middle_top",ref11.x=val10.x,val10.y+=.15;var mosfet_depletion_normally_on_vert_default=rotated3,mushroom_head_normally_open_momentary_default={paths:{"path12-1-8-6-9":{type:"path",points:[{x:.005962250000000502,y:-.06421149999999898},{x:.005962250000000502,y:.010086499999999887}],color:"primary",fill:!1},"path12-1-5-6":{type:"path",points:[{x:-.48740705000000073,y:.0979945000000022},{x:-.17310075000000058,y:.0979945000000022}],color:"primary",fill:!1},"path12-1-8-0":{type:"path",points:[{x:-.16008695000000017,y:.015660500000000965},{x:.1719709499999995,y:.015660500000000965}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:.1954987499999996,y:.09760550000000023},{x:.4881436499999996,y:.09760550000000023}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-.09950044999999985,y:-.05339449999999957},{x:-.09950104999999976,y:-.05697449999999904},{x:-.09932044999999956,y:-.06050449999999863},{x:-.09896044999999987,y:-.06401049999999842},{x:-.09860045000000017,y:-.06750049999999774},{x:-.09806045000000019,y:-.07093049999999756},{x:-.09735344999999995,y:-.07429949999999863},{x:-.09663345000000056,y:-.07765949999999933},{x:-.09578045000000035,y:-.080999499999999},{x:-.09475245000000054,y:-.08424949999999853},{x:-.09379245000000047,y:-.08755949999999757},{x:-.09254545000000025,y:-.09067949999999847},{x:-.09120844999999989,y:-.09377950000000013},{x:-.08986644999999971,y:-.09686950000000039},{x:-.08839545000000015,y:-.09992949999999823},{x:-.08675845000000049,y:-.1028394999999982},{x:-.08506245000000057,y:-.10569950000000006},{x:-.08334244999999996,y:-.10860950000000003},{x:-.08146945000000017,y:-.11138949999999781},{x:-.0795824500000002,y:-.11416949999999915},{x:-.07752845000000086,y:-.11680949999999868},{x:-.07546944999999994,y:-.11942949999999897},{x:-.07325945000000011,y:-.12193949999999987},{x:-.07104145000000006,y:-.12444949999999722},{x:-.06867544999999975,y:-.12682949999999948},{x:-.06628845000000005,y:-.12916949999999972},{x:-.06379544999999975,y:-.13141949999999802},{x:-.06114145000000004,y:-.1334894999999996},{x:-.05848745000000033,y:-.135569499999999},{x:-.05584345000000024,y:-.13761949999999956},{x:-.05306845000000049,y:-.13949949999999944},{x:-.05029345000000074,y:-.14139950000000034},{x:-.04738844999999969,y:-.14311950000000095},{x:-.04437445000000029,y:-.14469949999999798},{x:-.04134744999999995,y:-.14631949999999883},{x:-.038316449999999946,y:-.1477594999999976},{x:-.03515645000000056,y:-.14907949999999914},{x:-.03204444999999989,y:-.15036950000000004},{x:-.028770450000000558,y:-.1515594999999994},{x:-.025468450000000864,y:-.1525794999999981},{x:-.02213745000000067,y:-.1536395000000006},{x:-.018790450000000014,y:-.15442949999999733},{x:-.01536325000000005,y:-.15512949999999748},{x:-.011980249999999693,y:-.1558294999999994},{x:-.008442250000000762,y:-.15641949999999838},{x:-.004890650000000107,y:-.15674949999999832},{x:-.0013406500000003874,y:-.15704949999999585},{x:.002252350000000014,y:-.1571494999999974},{x:.005893849999999645,y:-.1571494999999974},{x:.009534849999998762,y:-.1571494999999974},{x:.013136849999999534,y:-.15704949999999585},{x:.016683149999999536,y:-.15674949999999832},{x:.020231149999998976,y:-.15644949999999902},{x:.023727149999999142,y:-.15604949999999818},{x:.02715474999999934,y:-.15512949999999748},{x:.03057874999999921,y:-.15452949999999888},{x:.03395574999999962,y:-.15367949999999908},{x:.03725995000000015,y:-.1525894999999995},{x:.0405679499999998,y:-.15152949999999876},{x:.04379994999999948,y:-.15041949999999815},{x:.04695294999999966,y:-.14909950000000016},{x:.050101949999999285,y:-.14780949999999926},{x:.053191949999999544,y:-.14631949999999883},{x:.05617794999999948,y:-.14473950000000002},{x:.05916694999999983,y:-.14311950000000095},{x:.06206694999999929,y:-.14139950000000034},{x:.06487294999999982,y:-.13955950000000072},{x:.06767095000000012,y:-.13769950000000186},{x:.07038294999999994,y:-.1356995000000012},{x:.07299194999999958,y:-.13357950000000152},{x:.07560095000000011,y:-.13145950000000184},{x:.07809294999999938,y:-.12920950000000175},{x:.08047994999999997,y:-.12687950000000114},{x:.08287894999999956,y:-.12453950000000091},{x:.08515495000000062,y:-.12206950000000028},{x:.08729294999999926,y:-.11951950000000089},{x:.08944594999999911,y:-.11692950000000124},{x:.0914679499999993,y:-.11430950000000095},{x:.09337295000000001,y:-.11152949999999962},{x:.0971669499999992,y:-.1060194999999986},{x:.10043494999999947,y:-.1001245000000015},{x:.10311494999999926,y:-.09390950000000053},{x:.10444094999999987,y:-.09081950000000028},{x:.10564094999999973,y:-.08762950000000025},{x:.10667494999999949,y:-.08435950000000147},{x:.10769994999999977,y:-.08110950000000194},{x:.1085699499999997,y:-.07779950000000291},{x:.10927795000000007,y:-.07442950000000259},{x:.10999794999999946,y:-.0710595000000005},{x:.11051994999999959,y:-.06762950000000068},{x:.11088394999999984,y:-.06413950000000135},{x:.11124394999999954,y:-.06064950000000202},{x:.11142394999999983,y:-.05709950000000141},{x:.11142394999999983,y:-.053543499999999966},{x:.10483595000000001,y:-.05353049999999904},{x:.0982479500000002,y:-.05351650000000063},{x:.09164495000000006,y:-.05351850000000091},{x:.08505695000000024,y:-.05350850000000129},{x:.078453950000001,y:-.05350950000000054},{x:.07186595000000029,y:-.053496499999999614},{x:.06526295000000104,y:-.05349750000000064},{x:.058674950000001225,y:-.053485499999998964},{x:.05208695000000052,y:-.05347349999999906},{x:.04548395000000127,y:-.05347549999999934},{x:.038895950000001456,y:-.05346150000000094},{x:.03230795000000075,y:-.053448499999998234},{x:.025704950000001503,y:-.053453499999998044},{x:.019101950000001366,y:-.053454499999997296},{x:.01251395000000155,y:-.05344149999999637},{x:.005925950000001734,y:-.05342749999999796},{x:-.0006560499999990199,y:-.0534214999999989},{x:-.007240049999999165,y:-.05341449999999881},{x:-.01382404999999931,y:-.05340849999999975},{x:-.020406049999999176,y:-.053402500000000686},{x:-.02699004999999932,y:-.053394500000001344},{x:-.03357404999999947,y:-.05338950000000331},{x:-.04015604999999933,y:-.05338350000000425},{x:-.04674004999999948,y:-.05337450000000388},{x:-.05332205000000023,y:-.053368500000004815},{x:-.05990605000000038,y:-.05336050000000547},{x:-.06649005000000052,y:-.05335550000000566},{x:-.07307205000000039,y:-.0533495000000066},{x:-.07965605000000053,y:-.05334150000000726},{x:-.08624005000000068,y:-.053335500000008196},{x:-.09282205000000143,y:-.05333050000001016}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:.01254745000000046,y:-.26112850000000165},bottom1:{type:"text",text:"{VAL}",x:-.16130964999999975,y:.27112849999999966}},refblocks:{left1:{x:-.4717985499999999,y:.0979675000000011},right1:{x:.4717985499999999,y:.09799250000000015}},bounds:{minX:-.4999569909999999,maxX:.4999569909999999,minY:-.36112850000000163,maxY:.27112849999999966,width:1,height:1,centerX:0,centerY:-.045000000000000984},circles:{}},{paths:paths27,texts:texts32,bounds:bounds27,refblocks:refblocks27,circles:circles23}=mushroom_head_normally_open_momentary_default,mushroom_head_normally_open_momentary_horz_default={primitives:[...Object.values(paths27),...Object.values(circles23),{...texts32.top1,anchor:"middle_bottom",x:0},{...texts32.bottom1,anchor:"middle_top",x:0}],ports:[{...refblocks27.left1,labels:["1"]},{...refblocks27.right1,labels:["2"]}],size:{width:bounds27.width,height:bounds27.height},center:{x:bounds27.centerX+.006,y:bounds27.centerY+.06}},rotated4=rotateSymbol(mushroom_head_normally_open_momentary_horz_default),ref12=rotated4.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val11=rotated4.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref12.anchor="middle_left",val11.anchor="middle_right",ref12.x=ref12.x-.03,ref12.y=ref12.y,val11.x=val11.x,val11.y=0;var mushroom_head_normally_open_momentary_vert_default=rotated4,n_channel_d_mosfet_transistor_default={paths:{path11:{type:"path",points:[{x:-.39274354450000026,y:.10329954999999957},{x:.05111245549999932,y:.1059225499999994}],color:"primary",fill:!1},path40:{type:"path",points:[{x:.09373835550000087,y:-.18559775000000034},{x:.09280835550000122,y:.18255174999999935}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:.30382435550000064,y:-.53233025},{x:.3032243555000005,y:-.10600584999999985}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:.3108281555000003,y:.5323308500000001},{x:.31142815550000025,y:.005876249999999805}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.09383795549999951,y:-.10788365000000044},{x:.31104975549999936,y:-.10659565000000004}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:.09383795549999951,y:.10232114999999986},{x:.31104975549999936,y:.10360915000000026}],color:"primary",fill:!1},path15:{type:"path",points:[{x:.27419885550000034,y:.04077644999999963},{x:.27419885550000034,y:-.030615650000000327},{x:.2024438555000001,y:.004662050000000084}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:.09383795549999951,y:.004018049999999551},{x:.31104975549999936,y:.005306049999999729}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:.05171245550000081,y:-.16715385000000005},{x:.05111245550000065,y:.10592255000000006}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.13197254449999907,y:-.36092494999999936},bottom1:{type:"text",text:"{VAL}",x:.05891105550000031,y:.42489435000000064}},refblocks:{top1:{x:.30397715549999993,y:-.5519248499999992},bottom1:{x:.31067575550000126,y:.5519248499999994},left1:{x:-.41859744450000025,y:.10250625000000024}},bounds:{minX:-.4467558855000002,maxX:.44675588550000006,minY:-.5800832909999992,maxY:.5800832909999993,width:1,height:1.1601665819999987,centerX:-8326672684688674e-32,centerY:5551115123125783e-32},circles:{path1:{type:"circle",x:.15821375550000005,y:-.003454549999999612,radius:.28854213,color:"primary",fill:!1}}},{paths:paths28,texts:texts33,bounds:bounds28,refblocks:refblocks28,circles:circles24}=n_channel_d_mosfet_transistor_default,n_channel_d_mosfet_transistor_horz_default={primitives:[...Object.values(paths28),...Object.values(circles24),{...texts33.top1,anchor:"middle_right",x:0},{...texts33.bottom1,anchor:"middle_right",x:0}],ports:[{...refblocks28.top1,labels:["1","drain"]},{...refblocks28.bottom1,labels:["2","source"]},{...refblocks28.left1,labels:["3","gate"]}],size:{width:bounds28.width,height:bounds28.height},center:{x:bounds28.centerX,y:bounds28.centerY}},rotatedSymbol13=rotateSymbol(n_channel_d_mosfet_transistor_horz_default),texts34=rotatedSymbol13.primitives.filter(lV=>lV.type==="text"),val12=texts34.find(lV=>lV.text==="{VAL}");val12.x=-.35,val12.y=0,val12.anchor="middle_right";var ref13=texts34.find(lV=>lV.text==="{REF}");ref13.y=0,ref13.x=.35,ref13.anchor="middle_left";var n_channel_d_mosfet_transistor_vert_default=rotatedSymbol13,n_channel_e_mosfet_transistor_default={paths:{path11:{type:"path",points:[{x:-.39274354450000026,y:.10329954999999957},{x:.05111245549999932,y:.1059225499999994}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:.30382435550000064,y:-.53233025},{x:.3032243555000005,y:-.10600584999999985}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:.3108281555000003,y:.5323308500000001},{x:.31142815550000025,y:.005876249999999805}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.09383795549999951,y:-.10788365000000044},{x:.31104975549999936,y:-.10659565000000004}],color:"primary",fill:!1},"path2-8-3-7":{type:"path",points:[{x:.09448295549999952,y:-.14677165000000048},{x:.09319295549999951,y:-.06899565000000041}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:.09383795549999951,y:.10232114999999986},{x:.31104975549999936,y:.10360915000000026}],color:"primary",fill:!1},"path2-8-3":{type:"path",points:[{x:.09440455549999993,y:.07703174999999951},{x:.09311455549999992,y:.15480774999999958}],color:"primary",fill:!1},"path2-8-3-2":{type:"path",points:[{x:.09448295549999952,y:-.03486995000000048},{x:.09319295549999951,y:.042906049999999585}],color:"primary",fill:!1},path15:{type:"path",points:[{x:.2741991554999996,y:.040776550000000134},{x:.2741991554999996,y:-.030615549999999825},{x:.2024441554999994,y:.004662350000000037}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:.09383795549999951,y:.004018049999999551},{x:.31104975549999936,y:.005306049999999729}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:.05171245550000081,y:-.10847375000000059},{x:.05111245550000065,y:.1059225499999994}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.13197254449999907,y:-.36092494999999936},bottom1:{type:"text",text:"{VAL}",x:.05891105550000031,y:.42489435000000064}},refblocks:{top1:{x:.30397715549999993,y:-.5519248499999992},bottom1:{x:.31067575550000126,y:.5519248499999994},left1:{x:-.41859744450000025,y:.10250625000000024}},bounds:{minX:-.4467558855000002,maxX:.44675588550000006,minY:-.5800832909999992,maxY:.5800832909999993,width:1,height:1.1601665819999987,centerX:-8326672684688674e-32,centerY:5551115123125783e-32},circles:{path1:{type:"circle",x:.15821375550000005,y:-.003454549999999612,radius:.28854213,color:"primary",fill:!1}}},{paths:paths29,texts:texts35,bounds:bounds29,refblocks:refblocks29,circles:circles25}=n_channel_e_mosfet_transistor_default,n_channel_e_mosfet_transistor_horz_default={primitives:[...Object.values(paths29),...Object.values(circles25),{...texts35.top1,anchor:"middle_right",x:0},{...texts35.bottom1,anchor:"middle_right",x:0}],ports:[{...refblocks29.top1,labels:["1","drain"]},{...refblocks29.bottom1,labels:["2","source"]},{...refblocks29.left1,labels:["3","gate"]}],size:{width:bounds29.width,height:bounds29.height},center:{x:bounds29.centerX,y:bounds29.centerY}},rotatedSymbol14=rotateSymbol(n_channel_e_mosfet_transistor_horz_default),texts36=rotatedSymbol14.primitives.filter(lV=>lV.type==="text"),val13=texts36.find(lV=>lV.text==="{VAL}");val13.x=-.35,val13.y=0,val13.anchor="middle_right";var ref14=texts36.find(lV=>lV.text==="{REF}");ref14.y=0,ref14.x=.35,ref14.anchor="middle_left";var n_channel_e_mosfet_transistor_vert_default=rotatedSymbol14,njfet_transistor_default={paths:{path11:{type:"path",points:[{x:-.38509374449999945,y:.00367374999999992},{x:.05876225550000025,y:.00629674999999974}],color:"primary",fill:!1},path40:{type:"path",points:[{x:.07415065550000066,y:-.18559775000000034},{x:.07322065550000101,y:.18255174999999935}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:.28423665550000043,y:-.53233025},{x:.2836366555000003,y:-.10600584999999985}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:.2912404555000001,y:.5298821500000002},{x:.29184045550000004,y:.10355795000000012}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.07425025549999931,y:-.10788365000000044},{x:.29146205549999915,y:-.10659565000000004}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:.07425025549999931,y:.10232114999999986},{x:.29146205549999915,y:.10360915000000026}],color:"primary",fill:!1},path15:{type:"path",points:[{x:-.0829488445000004,y:-.06153284999999986},{x:-.0829488445000004,y:.06535114999999969},{x:.005945155500000077,y:.0026521499999998532}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-.15156024449999927,y:-.36092494999999936},bottom1:{type:"text",text:"{VAL}",x:.0393233555000001,y:.42489435000000064}},refblocks:{top1:{x:.2843894554999997,y:-.5519248499999992},bottom1:{x:.29108805550000105,y:.5519248499999994},left1:{x:-.3990097444999998,y:.004526550000000462}},bounds:{minX:-.4271681854999998,maxX:.42716818549999985,minY:-.5800832909999992,maxY:.5800832909999993,width:1,height:1.1601665819999987,centerX:27755575615628914e-33,centerY:5551115123125783e-32},circles:{path1:{type:"circle",x:.13862605549999985,y:-.003454549999999612,radius:.28854213,color:"primary",fill:!1}}},{paths:paths30,texts:texts37,bounds:bounds30,refblocks:refblocks30,circles:circles26}=njfet_transistor_default,njfet_transistor_horz_default={primitives:[...Object.values(paths30),...Object.values(circles26),{...texts37.top1,anchor:"middle_right",x:0},{...texts37.bottom1,anchor:"middle_right",x:0}],ports:[{...refblocks30.top1,labels:["1","drain"]},{...refblocks30.bottom1,labels:["2","source"]},{...refblocks30.left1,labels:["3","gate"]}],size:{width:bounds30.width,height:bounds30.height},center:{x:bounds30.centerX,y:bounds30.centerY}},rotatedSymbol15=rotateSymbol(njfet_transistor_horz_default),texts38=rotatedSymbol15.primitives.filter(lV=>lV.type==="text"),val14=texts38.find(lV=>lV.text==="{VAL}");val14.x=-.35,val14.y=0,val14.anchor="middle_right";var ref15=texts38.find(lV=>lV.text==="{REF}");ref15.y=0,ref15.x=.35,ref15.anchor="middle_left";var njfet_transistor_vert_default=rotatedSymbol15,npn_bipolar_transistor_default={paths:{path11:{type:"path",points:[{x:-.3850939444999988,y:.0036735999999999436},{x:.0587620555000008,y:.0062965999999997635}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:.07400475550000118,y:-.2689528999999997},{x:.07335475550000092,y:.2789230000000007}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:.2754149555000005,y:-.24180210000000013},{x:.07955815550000045,y:-.10822479999999968}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:.2868554555000009,y:.24134789999999984},{x:.09194705550000082,y:.10807689999999992}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:.2851204555,y:-.25311099999999964},{x:.2860204555000001,y:-.5377640999999995}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:.2851204555,y:.5376890000000012},{x:.2860204555000001,y:.25303590000000065}],color:"primary",fill:!1},path15:{type:"path",points:[{x:.1882816555000013,y:.10097660000000008},{x:.11555775550000158,y:.20483720000000027},{x:.22425775550000182,y:.20446720000000007}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-.22497334449999973,y:-.3596647999999991},bottom1:{type:"text",text:"{VAL}",x:-.0679100444999996,y:.4129789000000006}},refblocks:{top1:{x:.28556045550000064,y:-.5519250999999994},bottom1:{x:.285560455500002,y:.5519250999999992},left1:{x:-.3990097444999998,y:.004526300000000871}},bounds:{minX:-.4271681854999998,maxX:.4271681855000001,minY:-.5800835409999994,maxY:.5800835409999991,width:1,height:1.1601670819999985,centerX:13877787807814457e-32,centerY:-11102230246251565e-32},circles:{"path1-0":{type:"circle",x:.13862605550000007,y:-.003454799999999203,radius:.28854213,color:"primary",fill:!1}}},{paths:paths31,texts:texts39,bounds:bounds31,refblocks:refblocks31,circles:circles27}=npn_bipolar_transistor_default,npn_bipolar_transistor_horz_default={primitives:[...Object.values(paths31),...Object.values(circles27),{type:"text",text:"{REF}",x:-.07,y:-.3596647999999991,anchor:"middle_right"},{type:"text",text:"{VAL}",x:-.0679100444999996,y:.4129789000000006,anchor:"middle_right"}],ports:[{...refblocks31.top1,labels:["1","collector"]},{...refblocks31.bottom1,labels:["2","emitter"]},{...refblocks31.left1,labels:["3","base"]}],size:{width:bounds31.width,height:bounds31.height},center:{x:bounds31.centerX,y:bounds31.centerY}},rotatedSymbol16=rotateSymbol(npn_bipolar_transistor_horz_default),texts40=rotatedSymbol16.primitives.filter(lV=>lV.type==="text"),ref16=texts40.find(lV=>lV.text==="{REF}");ref16.anchor="middle_left";var npn_bipolar_transistor_vert_default=rotatedSymbol16,p_channel_d_mosfet_transistor_default={paths:{path11:{type:"path",points:[{x:-.39274354450000026,y:.10329954999999957},{x:.05111245549999932,y:.1059225499999994}],color:"primary",fill:!1},path40:{type:"path",points:[{x:.09373835550000087,y:-.18559775000000034},{x:.09280835550000122,y:.18255174999999935}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:.30382435550000064,y:-.53233025},{x:.3032243555000005,y:-.10600584999999985}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:.3108281555000003,y:.5323308500000001},{x:.31142815550000025,y:.005876249999999805}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.09383795549999951,y:-.10788365000000044},{x:.31104975549999936,y:-.10659565000000004}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:.09383795549999951,y:.10232114999999986},{x:.31104975549999936,y:.10360915000000026}],color:"primary",fill:!1},path15:{type:"path",points:[{x:.20244405549999955,y:-.03061555000000049},{x:.20244405549999955,y:.04077654999999947},{x:.2741990554999998,y:.0054987499999992195}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:.09383795549999951,y:.004018049999999551},{x:.31104975549999936,y:.005306049999999729}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:.05171245550000081,y:-.16715385000000005},{x:.05111245550000065,y:.10592255000000006}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.13197254449999907,y:-.36092494999999936},bottom1:{type:"text",text:"{VAL}",x:.05891105550000031,y:.42489435000000064}},refblocks:{top1:{x:.30397715549999993,y:-.5519248499999992},bottom1:{x:.31067575550000126,y:.5519248499999994},left1:{x:-.41859744450000025,y:.10250625000000024}},bounds:{minX:-.4467558855000002,maxX:.44675588550000006,minY:-.5800832909999992,maxY:.5800832909999993,width:1,height:1.1601665819999987,centerX:-8326672684688674e-32,centerY:5551115123125783e-32},circles:{path1:{type:"circle",x:.15821375550000005,y:-.003454549999999612,radius:.28854213,color:"primary",fill:!1}}},{paths:paths32,texts:texts41,bounds:bounds32,refblocks:refblocks32,circles:circles28}=p_channel_d_mosfet_transistor_default,p_channel_d_mosfet_transistor_horz_default={primitives:[...Object.values(paths32),...Object.values(circles28),{...texts41.top1,anchor:"middle_right",x:0},{...texts41.bottom1,anchor:"middle_right",x:0}],ports:[{...refblocks32.top1,labels:["1","drain"]},{...refblocks32.bottom1,labels:["2","source"]},{...refblocks32.left1,labels:["3","gate"]}],size:{width:bounds32.width,height:bounds32.height},center:{x:bounds32.centerX,y:bounds32.centerY}},rotatedSymbol17=rotateSymbol(p_channel_d_mosfet_transistor_horz_default),texts42=rotatedSymbol17.primitives.filter(lV=>lV.type==="text"),val15=texts42.find(lV=>lV.text==="{VAL}");val15.x=-.35,val15.y=0,val15.anchor="middle_right";var ref17=texts42.find(lV=>lV.text==="{REF}");ref17.y=0,ref17.x=.35,ref17.anchor="middle_left";var p_channel_d_mosfet_transistor_vert_default=rotatedSymbol17,p_channel_e_mosfet_transistor_default={paths:{path11:{type:"path",points:[{x:-.39274354450000026,y:.10329954999999957},{x:.05111245549999932,y:.1059225499999994}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:.30382435550000064,y:-.53233025},{x:.3032243555000005,y:-.10600584999999985}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:.3108281555000003,y:.5323308500000001},{x:.31142815550000025,y:.005876249999999805}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.09383795549999951,y:-.10788365000000044},{x:.31104975549999936,y:-.10659565000000004}],color:"primary",fill:!1},"path2-8-3-7":{type:"path",points:[{x:.09448295549999952,y:-.14677165000000048},{x:.09319295549999951,y:-.06899565000000041}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:.09383795549999951,y:.10232114999999986},{x:.31104975549999936,y:.10360915000000026}],color:"primary",fill:!1},"path2-8-3":{type:"path",points:[{x:.09440455549999993,y:.07703174999999951},{x:.09311455549999992,y:.15480774999999958}],color:"primary",fill:!1},"path2-8-3-2":{type:"path",points:[{x:.09448295549999952,y:-.03486995000000048},{x:.09319295549999951,y:.042906049999999585}],color:"primary",fill:!1},path15:{type:"path",points:[{x:.20244405549999955,y:-.03061555000000049},{x:.20244405549999955,y:.04077654999999947},{x:.2741990554999998,y:.0054987499999992195}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:.09383795549999951,y:.004018049999999551},{x:.31104975549999936,y:.005306049999999729}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:.05171245550000081,y:-.10847375000000059},{x:.05111245550000065,y:.1059225499999994}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.13197254449999907,y:-.36092494999999936},bottom1:{type:"text",text:"{VAL}",x:.05891105550000031,y:.42489435000000064}},refblocks:{top1:{x:.30397715549999993,y:-.5519248499999992},bottom1:{x:.31067575550000126,y:.5519248499999994},left1:{x:-.41859744450000025,y:.10250625000000024}},bounds:{minX:-.4467558855000002,maxX:.44675588550000006,minY:-.5800832909999992,maxY:.5800832909999993,width:1,height:1.1601665819999987,centerX:-8326672684688674e-32,centerY:5551115123125783e-32},circles:{path1:{type:"circle",x:.15821375550000005,y:-.003454549999999612,radius:.28854213,color:"primary",fill:!1}}},{paths:paths33,texts:texts43,bounds:bounds33,refblocks:refblocks33,circles:circles29}=p_channel_e_mosfet_transistor_default,p_channel_e_mosfet_transistor_horz_default={primitives:[...Object.values(paths33),...Object.values(circles29),{...texts43.top1,anchor:"middle_right",x:0},{...texts43.bottom1,anchor:"middle_right",x:0}],ports:[{...refblocks33.top1,labels:["1","drain"]},{...refblocks33.bottom1,labels:["2","source"]},{...refblocks33.left1,labels:["3","gate"]}],size:{width:bounds33.width,height:bounds33.height},center:{x:bounds33.centerX,y:bounds33.centerY}},rotatedSymbol18=rotateSymbol(p_channel_e_mosfet_transistor_horz_default),texts44=rotatedSymbol18.primitives.filter(lV=>lV.type==="text"),val16=texts44.find(lV=>lV.text==="{VAL}");val16.x=-.35,val16.y=0,val16.anchor="middle_right";var ref18=texts44.find(lV=>lV.text==="{REF}");ref18.y=0,ref18.x=.35,ref18.anchor="middle_left";var p_channel_e_mosfet_transistor_vert_default=rotatedSymbol18,photodiode_default={paths:{path11:{type:"path",points:[{x:-.5307178000000009,y:.15879225000000008},{x:-.15214840000000018,y:.1614152499999999}],color:"primary",fill:!1},path40:{type:"path",points:[{x:.12898409999999938,y:.14773104999999975},{x:-.13559890000000085,y:.28002274999999943}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.13559890000000085,y:.015439350000000074},{x:.12898409999999938,y:.14773104999999975}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.13559890000000085,y:.2800227500000001},{x:-.13559890000000085,y:.015439350000000074}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.12898409999999938,y:.015439350000000074},{x:.12898409999999938,y:.2800227500000001}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.13259069999999995,y:.14829984999999968},{x:.5307178000000006,y:.1587922499999994}],color:"primary",fill:!1},"path25-0":{type:"path",points:[{x:.19516320000000031,y:-.22938755000000044},{x:.15939019999999982,y:-.13729605000000022},{x:.2571001999999991,y:-.1526013500000003}],color:"primary",fill:!0},"path78-6":{type:"path",points:[{x:.32731219999999994,y:-.2800227500000003},{x:.3161811999999997,y:-.2700010500000003},{x:.20345820000000003,y:-.1685088500000005},{x:.2024082000000007,y:-.16810885000000053}],color:"primary",fill:!1},"path25-0-9":{type:"path",points:[{x:.3425051999999993,y:-.20294964999999987},{x:.306732199999999,y:-.11085814999999966},{x:.4044417999999992,y:-.12616344999999973}],color:"primary",fill:!0},"path78-6-5":{type:"path",points:[{x:.4746538,y:-.25358484999999975},{x:.4635227999999998,y:-.24356314999999973},{x:.3507997999999999,y:-.14207094999999992},{x:.34974980000000055,y:-.14167095000000018}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999987,y:-.20318344999999938},bottom1:{type:"text",text:"{VAL}",x:-.00984920000000078,y:.5911418500000005}},refblocks:{left1:{x:-.5446331000000002,y:.15964505000000062},right1:{x:.5381637999999995,y:.15864865000000083}},bounds:{minX:-.5307178000000009,maxX:.5307178000000006,minY:-.2800227500000003,maxY:.2800227500000001,width:1.0614356000000016,height:1,centerX:-16653345369377348e-32,centerY:-11102230246251565e-32},circles:{path1:{type:"circle",x:-.006997300000000539,y:.15166395000000055,radius:.28854213,color:"primary",fill:!1}}},{paths:paths34,texts:texts45,bounds:bounds34,refblocks:refblocks34,circles:circles30}=photodiode_default,photodiode_horz_default={primitives:[...Object.values(paths34),...Object.values(circles30),{type:"text",text:"{REF}",x:-.15,y:-.20318344999999938,anchor:"middle_right"},{type:"text",text:"{VAL}",x:-.00984920000000078,y:.5,anchor:"middle_top"}],ports:[{...refblocks34.left1,labels:["1"]},{...refblocks34.right1,labels:["2"]}],size:{width:bounds34.width,height:bounds34.height},center:{x:bounds34.centerX,y:bounds34.centerY}},rotatedSymbol19=rotateSymbol(photodiode_horz_default),texts46=rotatedSymbol19.primitives.filter(lV=>lV.type==="text"),ref19=texts46.find(lV=>lV.text==="{REF}");ref19.y=0,ref19.anchor="middle_left";var photodiode_vert_default=rotatedSymbol19,pjfet_transistor_default={paths:{path11:{type:"path",points:[{x:-.38509374449999945,y:.00367374999999992},{x:.05876225550000025,y:.00629674999999974}],color:"primary",fill:!1},path40:{type:"path",points:[{x:.07415065550000066,y:-.18559775000000034},{x:.07322065550000101,y:.18255174999999935}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:.28423665550000043,y:-.53233025},{x:.2836366555000003,y:-.10600584999999985}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:.2912404555000001,y:.5298821500000002},{x:.29184045550000004,y:.10355795000000012}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.07425025549999931,y:-.10788365000000044},{x:.29146205549999915,y:-.10659565000000004}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:.07425025549999931,y:.10232114999999986},{x:.29146205549999915,y:.10360915000000026}],color:"primary",fill:!1},path15:{type:"path",points:[{x:.005945155500000077,y:.06535114999999969},{x:.005945155500000077,y:-.06153284999999986},{x:-.0829488445000004,y:.001166149999999977}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-.15156024449999927,y:-.36092494999999936},bottom1:{type:"text",text:"{VAL}",x:.0393233555000001,y:.42489435000000064}},refblocks:{top1:{x:.2843894554999997,y:-.5519248499999992},bottom1:{x:.29108805550000105,y:.5519248499999994},left1:{x:-.3990097444999998,y:.004526550000000462}},bounds:{minX:-.4271681854999998,maxX:.42716818549999985,minY:-.5800832909999992,maxY:.5800832909999993,width:1,height:1.1601665819999987,centerX:27755575615628914e-33,centerY:5551115123125783e-32},circles:{path1:{type:"circle",x:.13862605549999985,y:-.003454549999999612,radius:.28854213,color:"primary",fill:!1}}},{paths:paths35,texts:texts47,bounds:bounds35,refblocks:refblocks35,circles:circles31}=pjfet_transistor_default,pjfet_transistor_horz_default={primitives:[...Object.values(paths35),...Object.values(circles31),{...texts47.top1,anchor:"middle_right",x:0},{...texts47.bottom1,anchor:"middle_right"}],ports:[{...refblocks35.top1,labels:["1","drain"]},{...refblocks35.bottom1,labels:["2","source"]},{...refblocks35.left1,labels:["3","gate"]}],size:{width:bounds35.width,height:bounds35.height},center:{x:bounds35.centerX,y:bounds35.centerY}},rotatedSymbol20=rotateSymbol(pjfet_transistor_horz_default),texts48=rotatedSymbol20.primitives.filter(lV=>lV.type==="text"),val17=texts48.find(lV=>lV.text==="{VAL}");val17.x=-.35,val17.y=0,val17.anchor="middle_right";var ref20=texts48.find(lV=>lV.text==="{REF}");ref20.y=0,ref20.x=.35,ref20.anchor="middle_left";var pjfet_transistor_vert_default=rotatedSymbol20,pnp_bipolar_transistor_default={paths:{path11:{type:"path",points:[{x:-.3850939444999988,y:.0036735999999999436},{x:.0587620555000008,y:.0062965999999997635}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:.07400475550000118,y:-.2689528999999997},{x:.07335475550000092,y:.2789230000000007}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:.2754149555000005,y:-.24180210000000013},{x:.07955815550000045,y:-.10822479999999968}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:.2868554555000009,y:.24134789999999984},{x:.09194705550000082,y:.10807689999999992}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:.2851204555,y:-.25311099999999964},{x:.2860204555000001,y:-.5377640999999995}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:.2851204555,y:.5376890000000012},{x:.2860204555000001,y:.25303590000000065}],color:"primary",fill:!1},path15:{type:"path",points:[{x:.15155145550000038,y:.2268796000000004},{x:.2242753555000001,y:.12301900000000021},{x:.11557535549999942,y:.12338900000000042}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-.22497334449999973,y:-.3596647999999991},bottom1:{type:"text",text:"{VAL}",x:-.0679100444999996,y:.4129789000000006}},refblocks:{top1:{x:.28556045550000064,y:-.5519250999999994},bottom1:{x:.285560455500002,y:.5519250999999992},left1:{x:-.3990097444999998,y:.004526300000000871}},bounds:{minX:-.4271681854999998,maxX:.4271681855000001,minY:-.5800835409999994,maxY:.5800835409999991,width:1,height:1.1601670819999985,centerX:13877787807814457e-32,centerY:-11102230246251565e-32},circles:{"path1-0":{type:"circle",x:.13862605550000007,y:-.003454799999999203,radius:.28854213,color:"primary",fill:!1}}},{paths:paths36,texts:texts49,bounds:bounds36,refblocks:refblocks36,circles:circles32}=pnp_bipolar_transistor_default,pnp_bipolar_transistor_horz_default={primitives:[...Object.values(paths36),...Object.values(circles32),{type:"text",text:"{REF}",x:-.07,y:-.3596647999999991,anchor:"middle_right"},{type:"text",text:"{VAL}",x:-.0679100444999996,y:.4129789000000006,anchor:"middle_right"}],ports:[{...refblocks36.top1,labels:["1","collector"]},{...refblocks36.bottom1,labels:["2","emitter"]},{...refblocks36.left1,labels:["3","base"]}],size:{width:bounds36.width,height:bounds36.height},center:{x:bounds36.centerX,y:bounds36.centerY}},rotatedSymbol21=rotateSymbol(pnp_bipolar_transistor_horz_default),texts50=rotatedSymbol21.primitives.filter(lV=>lV.type==="text"),ref21=texts50.find(lV=>lV.text==="{REF}");ref21.anchor="middle_left";var pnp_bipolar_transistor_vert_default=rotatedSymbol21,potentiometer_default={paths:{path11:{type:"path",points:[{x:-.5274831500000005,y:-.03018695000000049},{x:-.30105415000000013,y:-.03018695000000049}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2932119499999999,y:-.03018695000000049},{x:.5339524499999997,y:-.03018695000000049}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:.09765764999999949,y:-.12845085000000034},{x:-.0011297500000011507,y:.06303624999999946},{x:-.10778645000000164,y:-.12845085000000034}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-.12123945000000003,y:.14031524999999934},{x:.11950104999999955,y:.14031524999999934}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17328624999999942,y:-.39216264999999995},bottom1:{type:"text",text:"{VAL}",x:-.00661455000000033,y:.40216264999999995}},refblocks:{left1:{x:-.5413984499999998,y:-.029334149999999948},right1:{x:.54139845,y:-.030330549999999734}},bounds:{minX:-.5695568909999997,maxX:.569556891,minY:-.4921626499999999,maxY:.40216264999999995,width:1.1391137819999997,height:.5443252999999999,centerX:11102230246251565e-32,centerY:-.044999999999999984},circles:{path1:{type:"circle",x:-.0037626500000000895,y:-.03731525000000002,radius:.28854213,color:"primary",fill:!1}}},{paths:paths37,texts:texts51,bounds:bounds37,refblocks:refblocks37}=potentiometer_default,potentiometer_horz_default={primitives:[...Object.values(paths37),{...texts51.bottom1,y:.35,anchor:"middle_top"},{...texts51.top1,anchor:"middle_left"}],ports:[{...refblocks37.left1,labels:["1"]},{...refblocks37.right1,labels:["2"]}],size:{width:bounds37.width+.05,height:bounds37.height},center:{x:bounds37.centerX,y:bounds37.centerY}},rotated5=rotateSymbol(potentiometer_horz_default),potentiometer_vert_default=rotated5,potentiometer2_default={paths:{path18:{type:"path",points:[{x:-.53224045,y:.0008545000000008685},{x:-.26765715000000023,y:.0008545000000008685}],color:"primary",fill:!1},path19:{type:"path",points:[{x:.2615098499999995,y:.0008545000000008685},{x:.5260934499999994,y:.0008545000000008685}],color:"primary",fill:!1},path20:{type:"path",points:[{x:-.0030722500000006647,y:-.1314371999999988},{x:.2615107499999998,y:-.1314371999999988},{x:.2615107499999998,y:.13314619999999877},{x:-.26765624999999993,y:.13314619999999877},{x:-.26765624999999993,y:-.1314371999999988},{x:-.0030722499999988884,y:-.1314371999999988}],color:"primary",fill:!1},path23:{type:"path",points:[{x:.2782993499999993,y:.2822274},{x:.17598844999999885,y:.25486950000000164},{x:.25094144999999823,y:.1799165000000027}],color:"primary",fill:!0},path24:{type:"path",points:[{x:.2882692499999995,y:.2921307000000013},{x:.25467554999999953,y:.16634940000000142},{x:.16229264999999948,y:.25853690000000284}],color:"primary",fill:!0},path26:{type:"path",points:[{x:-.2985911500000009,y:-.2921307000000013},{x:.22988164999999938,y:.2328032000000011}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:.055041669999999154,y:-.2009376800000009},bottom1:{type:"text",text:"{VAL}",x:-.10019643000000089,y:.27857531999999985}},refblocks:{left1:{x:-.5346914500000006,y:.0013439000000019519},right1:{x:.5346914500000004,y:.001956599999999753}},bounds:{minX:-.5628498910000006,maxX:.5628498910000004,minY:-.3009376800000009,maxY:.2921307000000013,width:1.125699782000001,height:.2430683800000022,centerX:-11102230246251565e-32,centerY:-.004403489999999788},circles:{}},{paths:paths38,texts:texts52,bounds:bounds38,refblocks:refblocks38}=potentiometer2_default,potentiometer2_horz_default={primitives:[...Object.values(paths38),{...texts52.bottom1,anchor:"middle_top"},{...texts52.top1,anchor:"middle_bottom"}],ports:[{...refblocks38.left1,labels:["1"]},{...refblocks38.right1,labels:["2"]}],size:{width:bounds38.width,height:bounds38.height},center:{x:bounds38.centerX,y:bounds38.centerY}},rotated6=rotateSymbol(potentiometer2_horz_default),texts53=rotated6.primitives.filter(lV=>lV.type==="text"),val18=texts53.find(lV=>lV.text==="{VAL}");val18.anchor="middle_right";var ref22=texts53.find(lV=>lV.text==="{REF}");ref22.anchor="middle_left";var potentiometer2_vert_default=rotated6,power_factor_meter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.16538809999999904,y:-.36705149999999964},bottom1:{type:"text",text:"{VAL}",x:-.0066096999999991635,y:.42330070000000064},left1:{type:"text",text:"COS φ",x:-.14859499999999937,y:.014279000000000375}},refblocks:{left1:{x:-.5446330999999993,y:.000852800000000542},right1:{x:.5381638000000004,y:-.00014359999999924433}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:0,maxY:0,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.007128299999999532,radius:.28854213,color:"primary",fill:!1}}},{paths:paths39,texts:texts54,bounds:bounds39,refblocks:refblocks39,circles:circles33}=power_factor_meter_default,power_factor_meter_horz_default={primitives:[...Object.values(paths39),...Object.values(circles33),{type:"text",text:"{REF}",x:-.15,y:-.42330070000000064,anchor:"middle_left"},{type:"text",text:"{VAL}",x:-.15,y:.42330070000000064,anchor:"middle_left"},{type:"text",text:"COS φ",x:-.14,y:.014279000000000375,anchor:"middle-left"}],ports:[{...refblocks39.left1,labels:["1"]},{...refblocks39.right1,labels:["2"]}],size:{width:bounds39.width,height:bounds39.height},center:{x:bounds39.centerX,y:bounds39.centerY}},rotatedSymbol22=rotateSymbol(power_factor_meter_horz_default),texts55=rotatedSymbol22.primitives.filter(lV=>lV.type==="text"),ref23=texts55.find(lV=>lV.text==="{REF}"),val19=texts55.find(lV=>lV.text==="{VAL}"),text_cos=texts55.find(lV=>lV.text==="COS φ");ref23.x=.35,ref23.y=0,val19.x=-.6,val19.y=0,text_cos.x=-.1,text_cos.y=0;var power_factor_meter_vert_default=rotatedSymbol22,push_button_normally_closed_momentary_default={paths:{"path12-1-8-6-9":{type:"path",points:[{x:.010157449999999457,y:-.07203999999999766},{x:.010157449999999457,y:.04317300000000124}],color:"primary",fill:!1},"path12-1-5-6":{type:"path",points:[{x:-.48740705000000073,y:.024894000000003302},{x:-.17310075000000147,y:.024894000000003302}],color:"primary",fill:!1},"path12-1-8-0":{type:"path",points:[{x:-.17515525000000043,y:.04869000000000234},{x:.1954249499999996,y:.04869000000000234}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:.1954987499999996,y:.02450500000000133},{x:.4881436499999996,y:.02450500000000133}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:.009807749999999338,y:-.252520999999998},bottom1:{type:"text",text:"{VAL}",x:-.157175650000001,y:.26252100000000134}},refblocks:{left1:{x:-.4717985500000008,y:.02486700000000397},right1:{x:.4717985499999999,y:.024892000000003023}},bounds:{minX:-.4999569910000008,maxX:.4999569909999999,minY:-.352520999999998,maxY:.26252100000000134,width:.9999139820000007,height:.26504199999999933,centerX:-4440892098500626e-31,centerY:-.04499999999999832},circles:{}},{paths:paths40,texts:texts56,bounds:bounds40,refblocks:refblocks40}=push_button_normally_closed_momentary_default,push_button_normally_closed_momentary_horz_default={primitives:[...Object.values(paths40),{...texts56.top1,anchor:"middle_bottom"},{...texts56.bottom1,anchor:"middle_top"}],ports:[{...refblocks40.left1,labels:["1"]},{...refblocks40.right1,labels:["2"]}],size:{width:bounds40.width,height:bounds40.height},center:{x:bounds40.centerX,y:bounds40.centerY}},rotated7=rotateSymbol(push_button_normally_closed_momentary_horz_default),ref24=rotated7.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val20=rotated7.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref24.anchor="middle_left",val20.anchor="middle_right",ref24.x=ref24.x-.03,ref24.y=ref24.y,val20.x=val20.x,val20.y=0;var push_button_normally_closed_momentary_vert_default=rotated7,push_button_normally_open_momentary_default={paths:{"path12-1-8-6-9":{type:"path",points:[{x:.005962250000000502,y:-.14781649999999757},{x:.005962250000000502,y:-.03142349999999894}],color:"primary",fill:!1},"path12-1-5-6":{type:"path",points:[{x:-.48740705000000073,y:.05648450000000338},{x:-.17310075000000058,y:.05648450000000338}],color:"primary",fill:!1},"path12-1-8-0":{type:"path",points:[{x:-.16008695000000017,y:-.02584949999999786},{x:.1719709499999995,y:-.02584949999999786}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:.1954987499999996,y:.05609550000000141},{x:.4881436499999996,y:.05609550000000141}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:.006701050000000208,y:-.2196184999999975},bottom1:{type:"text",text:"{VAL}",x:-.16130964999999975,y:.22961850000000084}},refblocks:{left1:{x:-.4717985499999999,y:.05645750000000227},right1:{x:.4717985499999999,y:.05648250000000132}},bounds:{minX:-.4999569909999999,maxX:.4999569909999999,minY:-.3196184999999975,maxY:.22961850000000084,width:.9999139819999998,height:.19923699999999833,centerX:0,centerY:-.04499999999999832},circles:{}},{paths:paths41,texts:texts57,bounds:bounds41,refblocks:refblocks41}=push_button_normally_open_momentary_default,push_button_normally_open_momentary_horz_default={primitives:[...Object.values(paths41),{...texts57.top1,anchor:"middle_bottom"},{...texts57.bottom1,anchor:"middle_top"}],ports:[{...refblocks41.left1,labels:["1"]},{...refblocks41.right1,labels:["2"]}],size:{width:bounds41.width,height:bounds41.height},center:{x:bounds41.centerX,y:bounds41.centerY}},rotated8=rotateSymbol(push_button_normally_open_momentary_horz_default),ref25=rotated8.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val21=rotated8.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref25.anchor="middle_left",val21.anchor="middle_right",ref25.x=ref25.x+.1,ref25.y=ref25.y,val21.x=val21.x,val21.y=0;var push_button_normally_open_momentary_vert_default=rotated8,rectifier_diode_default={paths:{path40:{type:"path",points:[{x:-.19250837381256392,y:-.32749349347032286},{x:-.25568957329611974,y:-.13794979950157282}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.38205206778131373,y:-.26431229398676837},{x:-.19250837381256392,y:-.32749349347032286}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.2556895732961204,y:-.13794979950157416},{x:-.38205206778131373,y:-.26431229398676837}],color:"primary",fill:!1},path43:{type:"path",points:[{x:-.2556896210551609,y:-.39067474071292196},{x:-.12932712656996737,y:-.26431224622772653}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.3199237641156438,y:-.2000781031672434},{x:-.5084145145074668,y:-.011587352775420667}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:-.011560829633404435,y:-.5083596562436202},{x:-.19004023433272543,y:-.3298802515442989}],color:"primary",fill:!1},"path40-4":{type:"path",points:[{x:-.19250813152967883,y:.3220463011874377},{x:-.38205182549842887,y:.2588651017038819}],color:"primary",fill:!1},"path41-1":{type:"path",points:[{x:-.2556893310132333,y:.13250260721868767},{x:-.19250813152967883,y:.3220463011874377}],color:"primary",fill:!1},"path42-7":{type:"path",points:[{x:-.38205182549842753,y:.258865101703881},{x:-.2556893310132333,y:.13250260721868767}],color:"primary",fill:!1},"path43-1":{type:"path",points:[{x:-.12932688428707984,y:.2588650539448407},{x:-.25568937877227516,y:.38522754843003404}],color:"primary",fill:!1},"path44-8":{type:"path",points:[{x:-.3199235218327583,y:.19463091088435758},{x:-.508414272224581,y:.006140160492534852}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:-.011641968756381349,y:.5029938453665972},{x:-.1901213734557028,y:.3245144406672762}],color:"primary",fill:!1},"path40-4-0":{type:"path",points:[{x:.322578868470321,y:-.19315369881256328},{x:.13303517450157099,y:-.2563348982961191}],color:"primary",fill:!1},"path41-1-2":{type:"path",points:[{x:.2593976689867663,y:-.3826973927813131},{x:.322578868470321,y:-.19315369881256328}],color:"primary",fill:!1},"path42-7-1":{type:"path",points:[{x:.13303517450157232,y:-.2563348982961198},{x:.2593976689867663,y:-.3826973927813131}],color:"primary",fill:!1},"path43-1-8":{type:"path",points:[{x:.38576011571292,y:-.2563349460551603},{x:.2593976212277247,y:-.12997245156996673}],color:"primary",fill:!1},"path44-8-7":{type:"path",points:[{x:.19516347816724133,y:-.3205690891156432},{x:.006672727775418608,y:-.509059839507466}],color:"primary",fill:!1},"path44-0-7-1":{type:"path",points:[{x:.5034450312436185,y:-.012206154633403798},{x:.32496562654429706,y:-.19068555933272457}],color:"primary",fill:!1},"path40-4-8":{type:"path",points:[{x:.3220220261874358,y:.19326390652967795},{x:.25884082670387976,y:.382807600498428}],color:"primary",fill:!1},"path41-1-4":{type:"path",points:[{x:.13247833221868577,y:.25644510601323245},{x:.3220220261874358,y:.19326390652967795}],color:"primary",fill:!1},"path42-7-0":{type:"path",points:[{x:.2588408267038793,y:.38280760049842666},{x:.13247833221868577,y:.25644510601323245}],color:"primary",fill:!1},"path43-1-0":{type:"path",points:[{x:.2588407789448386,y:.13008265928707896},{x:.38520327343003213,y:.2564451537722743}],color:"primary",fill:!1},"path44-8-9":{type:"path",points:[{x:.19460663588435567,y:.3206792968327574},{x:.0061158854925329464,y:.5091700472245801}],color:"primary",fill:!1},"path44-0-7-3":{type:"path",points:[{x:.5029695703665951,y:.012397743756380697},{x:.3244901656672745,y:.19087714845570192}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.2872803000000015,y:-.4564494249999992},bottom1:{type:"text",text:"{VAL}",x:-.2872803000000015,y:.4960514750000007}},refblocks:{top1:{x:.0005126999999993664,y:-.5191475},bottom1:{x:-.0005123000000009093,y:.5191475000000001},left1:{x:-.5191472999999998,y:-.0005123250000014234},right1:{x:.5191473000000002,y:.0005123749999977889}},bounds:{minX:-.5473057409999997,maxX:.5473057410000002,minY:-.5564494249999992,maxY:.5473059410000001,width:1.094611482,height:1.1037553659999992,centerX:2220446049250313e-31,centerY:-.004571741999999546},circles:{}},{paths:paths42,texts:texts58,bounds:bounds42,refblocks:refblocks42,circles:circles34}=rectifier_diode_default,rectifier_diode_horz_default={primitives:[...Object.values(paths42),...Object.values(circles34),{...texts58.top1,anchor:"middle_right"},{...texts58.bottom1,anchor:"middle_right"}],ports:[{...refblocks42.top1,labels:["1"]},{...refblocks42.bottom1,labels:["2"]},{...refblocks42.left1,labels:["3"]},{...refblocks42.right1,labels:["4"]}],size:{width:bounds42.width,height:bounds42.height},center:{x:bounds42.centerX,y:bounds42.centerY}},rotated9=rotateSymbol(rectifier_diode_horz_default),ref26=rotated9.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val22=rotated9.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref26.anchor="middle_left",val22.anchor="middle_right";var rectifier_diode_vert_default=rotated9,resonator_default={paths:{path27:{type:"path",points:[{x:.7635944500000007,y:.28495445000000075},{x:.3138028500000005,y:.28495445000000075}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-.301017949999999,y:.02024775000000112},{x:-.7508096499999994,y:.02024775000000112}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-.3010179499999994,y:-.34304865000000007},{x:-.301017949999999,y:.2848310499999993}],color:"primary",fill:!1},"path27-3":{type:"path",points:[{x:.7729788499999999,y:-.34624514999999967},{x:.32318725000000015,y:-.34624514999999967}],color:"primary",fill:!1},"path29-5":{type:"path",points:[{x:-.07279374999999932,y:.28481924999999997},{x:-.2983350499999995,y:.28481924999999997}],color:"primary",fill:!1},"path29-5-7":{type:"path",points:[{x:.33114835000000076,y:.284840449999999},{x:.10560705000000059,y:.284840449999999}],color:"primary",fill:!1},"path29-5-7-6":{type:"path",points:[{x:-.055820049999999455,y:.17265845000000013},{x:-.055820049999999455,y:.39819974999999985}],color:"primary",fill:!1},"path29-5-7-6-6":{type:"path",points:[{x:.09396265000000081,y:.17268285000000105},{x:.09396265000000081,y:.3982241500000008}],color:"primary",fill:!1},"path29-5-9":{type:"path",points:[{x:-.07296184999999955,y:-.3463701499999985},{x:-.2985031499999997,y:-.3463701499999985}],color:"primary",fill:!1},"path29-5-7-2":{type:"path",points:[{x:.33098025000000053,y:-.3463489500000012},{x:.10543895000000036,y:-.3463489500000012}],color:"primary",fill:!1},"path29-5-7-6-0":{type:"path",points:[{x:-.05598814999999968,y:-.4585309500000001},{x:-.05598814999999968,y:-.2329896499999986}],color:"primary",fill:!1},"path29-5-7-6-6-2":{type:"path",points:[{x:.09379455000000014,y:-.45850655000000096},{x:.09379455000000014,y:-.23296525000000123}],color:"primary",fill:!1},"path29-5-92":{type:"path",points:[{x:.3315317500000008,y:-.12063885000000063},{x:.33153175000000035,y:-.34618015000000035}],color:"primary",fill:!1},"path29-5-7-28":{type:"path",points:[{x:.3315105500000004,y:.28330324999999945},{x:.3315105500000004,y:.05776194999999973}],color:"primary",fill:!1},"path29-5-7-6-9":{type:"path",points:[{x:.44369255000000063,y:-.1036651500000012},{x:.21815125000000046,y:-.1036651500000012}],color:"primary",fill:!1},"path29-5-7-6-6-7":{type:"path",points:[{x:.4436681500000006,y:.04611754999999995},{x:.21812685000000043,y:.04611754999999995}],color:"primary",fill:!1},"path29-5-7-6-9-2":{type:"path",points:[{x:.44235445000000073,y:-.06667004999999904},{x:.21681315000000057,y:-.06667004999999904}],color:"primary",fill:!1},"path29-5-7-6-9-2-4":{type:"path",points:[{x:.4429695500000004,y:.007559849999998036},{x:.4430214500000007,y:-.06634914999999886}],color:"primary",fill:!1},"path29-5-7-6-9-2-4-6":{type:"path",points:[{x:.21634305000000031,y:.008546850000001882},{x:.21639495000000064,y:-.06536215000000212}],color:"primary",fill:!1},"path29-5-7-6-9-2-9":{type:"path",points:[{x:.4429537500000005,y:.009130850000000024},{x:.21741245000000076,y:.009130850000000024}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:.01596175000000022,y:-.5308501500000009},bottom1:{type:"text",text:"{VAL}",x:.013116750000000454,y:.5408501499999989}},refblocks:{left1:{x:-.7666234499999998,y:.0211504499999986},right1:{x:.7666234500000004,y:-.344347250000002},right2:{x:.7572390499999999,y:.2868523500000002}},bounds:{minX:-.7947818909999997,maxX:.7947818910000004,minY:-.6308501500000009,maxY:.5408501499999989,width:1.5895637820000001,height:1.1717003,centerX:33306690738754696e-32,centerY:-.045000000000000984},circles:{}},{paths:paths43,texts:texts59,bounds:bounds43,refblocks:refblocks43,circles:circles35}=resonator_default,resonator_horz_default={primitives:[...Object.values(paths43),...Object.values(circles35),{type:"text",text:"{REF}",x:.01596175000000022,y:-.5308501500000009,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:.013116750000000454,y:.5408501499999989,anchor:"middle_top"}],ports:[{...refblocks43.left1,labels:["1"]},{...refblocks43.right1,labels:["2"]},{...refblocks43.right2,labels:["3"]}],size:{width:bounds43.width,height:bounds43.height},center:{x:bounds43.centerX,y:bounds43.centerY}},resonator_vert_default=rotateSymbol(resonator_horz_default),schottky_diode_default={paths:{path40:{type:"path",points:[{x:.14133375000000115,y:.0006371999999998934},{x:-.12324954999999838,y:.13292890000000046}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.12324954999999971,y:-.13165450000000045},{x:.1413337499999998,y:.0006371999999998934}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.12324954999999971,y:.13292890000000046},{x:-.12324954999999971,y:-.1316544999999989}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.14027445000000127,y:-.13377310000000042},{x:.14133345000000053,y:.1329288999999989}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.12545424999999977,y:.0006371999999998934},{x:-.5201245499999998,y:.0006371999999998934}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:.5201245499999998,y:.0007223999999994568},{x:.1464164499999996,y:.0007223999999994568}],color:"primary",fill:!1},"path43-7":{type:"path",points:[{x:.20429785000000056,y:-.13505779999999978},{x:.14015525000000095,y:-.1339758000000002}],color:"primary",fill:!1},"path43-7-9":{type:"path",points:[{x:.20608895000000027,y:-.08549420000000074},{x:.2047149500000005,y:-.13482980000000122}],color:"primary",fill:!1},"path43-7-2":{type:"path",points:[{x:.0765343500000002,y:.1349070999999995},{x:.13988425000000015,y:.1346870999999994}],color:"primary",fill:!1},"path43-7-9-3":{type:"path",points:[{x:.0743883500000011,y:.0857221999999993},{x:.07576235000000087,y:.1350578}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.00828064999999878,y:-.2291716000000008},bottom1:{type:"text",text:"{VAL}",x:-.003367349999999103,y:.31851899999999933}},refblocks:{left1:{x:-.5224026499999993,y:-.0002470999999999446},right1:{x:.5158915500000005,y:.0007775999999992678}},bounds:{minX:-.5201245499999998,maxX:.5201245499999998,minY:-.13505779999999978,maxY:.1350578,width:1.0402490999999996,height:1,centerX:0,centerY:11102230246251565e-32},circles:{}},{paths:paths44,texts:texts60,bounds:bounds44,refblocks:refblocks44,circles:circles36}=schottky_diode_default,schottky_diode_horz_default={primitives:[...Object.values(paths44),...Object.values(circles36),{...texts60.top1,anchor:"middle_bottom"},{...texts60.bottom1,anchor:"middle_top"}],ports:[{...refblocks44.left1,labels:["1"]},{...refblocks44.right1,labels:["2"]}],size:{width:bounds44.width,height:bounds44.height},center:{x:bounds44.centerX,y:bounds44.centerY}},rotated10=rotateSymbol(schottky_diode_horz_default),ref27=rotated10.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val23=rotated10.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref27.anchor="middle_left",val23.anchor="middle_right";var schottky_diode_vert_default=rotated10,silicon_controlled_rectifier_default={paths:{path11:{type:"path",points:[{x:-.49895505000000084,y:-.036744850000000495},{x:-.177441850000001,y:-.036744850000000495}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.18704774999999918,y:-.044614150000000574},{x:.5063384499999999,y:-.044614150000000574}],color:"primary",fill:!1},"path12-6":{type:"path",points:[{x:.18219425000000045,y:.15700134999999915},{x:.1810882500000004,y:-.246215650000001}],color:"primary",fill:!1},"path12-2":{type:"path",points:[{x:.18646324999999986,y:.00021334999999966797},{x:.34602244999999954,y:.14039324999999936}],color:"primary",fill:!1},"path12-2-9":{type:"path",points:[{x:.3463884499999992,y:.14577354999999947},{x:.3447284499999994,y:.3393437499999994}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-.17016305000000087,y:-.2656752500000006},{x:-.17223005000000047,y:.1570086499999992},{x:.180362149999999,y:-.042608550000000855},{x:-.16624855000000038,y:-.26680665000000126}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-.22312565000000006,y:-.37773544999999986},bottom1:{type:"text",text:"{VAL}",x:.030109249999999532,y:.38773544999999987}},refblocks:{bottom1:{x:.3445824499999999,y:.35453845000000017},left1:{x:-.5177904499999998,y:-.03589204999999995},right1:{x:.5177904499999997,y:-.04475774999999982}},bounds:{minX:-.5459488909999998,maxX:.5459488909999997,minY:-.47773544999999984,maxY:.38773544999999987,width:1.0918977819999993,height:1,centerX:-5551115123125783e-32,centerY:-.044999999999999984},circles:{}},{paths:paths45,texts:texts61,bounds:bounds45,refblocks:refblocks45,circles:circles37}=silicon_controlled_rectifier_default,silicon_controlled_rectifier_horz_default={primitives:[...Object.values(paths45),...Object.values(circles37),{...texts61.top1,anchor:"middle_left"},{...texts61.bottom1,anchor:"middle_top"}],ports:[{...refblocks45.left1,labels:["1"]},{...refblocks45.right1,labels:["2"]},{...refblocks45.bottom1,labels:["3"]}],size:{width:bounds45.width,height:bounds45.height},center:{x:bounds45.centerX,y:bounds45.centerY}},rotatedSymbol23=rotateSymbol(silicon_controlled_rectifier_horz_default),texts62=rotatedSymbol23.primitives.filter(lV=>lV.type==="text"),ref28=texts62.find(lV=>lV.text==="{REF}");ref28.y=0,ref28.anchor="middle_left";var silicon_controlled_rectifier_vert_default=rotatedSymbol23,SPDT_switch_default={paths:{path1:{type:"path",points:[{x:-.3543583500000005,y:-.027043850000000758},{x:-.12792935000000005,y:-.027043850000000758}],color:"primary",fill:!1},"path-1-3":{type:"path",points:[{x:-.1133669500000003,y:-.027198750000000382},{x:.11208324999999997,y:-.14100155000000036}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.1043477500000003,y:.06951304999999941},{x:.34508875000000017,y:.06951304999999941}],color:"primary",fill:!1},path3:{type:"path",points:[{x:.12008575000000055,y:-.1671466500000005},{x:.3608267500000004,y:-.1671466500000005}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17853294999999947,y:-.39216264999999995},bottom1:{type:"text",text:"{VAL}",x:-.011861250000000378,y:.40216264999999995}},refblocks:{top1:{x:.10744654999999947,y:-.16714664999999962},left1:{x:-.3682737499999995,y:-.02704385000000009},left2:{x:-.11569114999999996,y:-.02704385000000009},right1:{x:.3682737499999995,y:-.16714664999999962},right2:{x:.3682737499999995,y:.06951305000000008},right3:{x:.10744725000000055,y:.06951305000000008}},bounds:{minX:-.3964321909999995,maxX:.3964321909999995,minY:-.4921626499999999,maxY:.40216264999999995,width:.792864381999999,height:.5443252999999999,centerX:0,centerY:-.044999999999999984},circles:{}},{paths:paths46,texts:texts63,bounds:bounds46,refblocks:refblocks46,circles:circles38}=SPDT_switch_default,SPDT_switch_horz_default={primitives:[...Object.values(paths46),...Object.values(circles38),{...texts63.top1,anchor:"middle_bottom",x:-.01},{...texts63.bottom1,anchor:"middle_top",x:-.01}],ports:[{...refblocks46.left1,labels:["1"]},{...refblocks46.right1,labels:["3"]},{...refblocks46.right2,labels:["2"]}],size:{width:bounds46.width,height:bounds46.height},center:{x:bounds46.centerX,y:bounds46.centerY}},rotatedSymbol24=rotateSymbol(SPDT_switch_horz_default),texts64=rotatedSymbol24.primitives.filter(lV=>lV.type==="text"),val24=texts64.find(lV=>lV.text==="{VAL}");val24.anchor="middle_right",val24.x=-.3,val24.y=0;var ref29=texts64.find(lV=>lV.text==="{REF}");ref29.anchor="middle_left",ref29.x=.3,ref29.y=0;var SPDT_switch_vert_default=rotatedSymbol24,SPST_switch_default={paths:{path11:{type:"path",points:[{x:-.3622273500000006,y:-.029865150000000895},{x:-.13579835000000018,y:-.029865150000000895}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-.12010005000000046,y:-.02833465000000035},{x:.10307834999999987,y:-.16802405000000076}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.12795584999999932,y:-.029865150000000895},{x:.3686967499999996,y:-.029865150000000895}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.1864019499999996,y:-.39216264999999995},bottom1:{type:"text",text:"{VAL}",x:-.019730250000000504,y:.40216264999999995}},refblocks:{left1:{x:-.37614274999999964,y:-.02901224999999985},left2:{x:-.12356015000000009,y:-.025075450000000332},right1:{x:.37614274999999964,y:-.030008650000000303},right2:{x:.11531695000000042,y:-.025075450000000332}},bounds:{minX:-.4043011909999996,maxX:.4043011909999996,minY:-.4921626499999999,maxY:.40216264999999995,width:1,height:1,centerX:0,centerY:-.044999999999999984},circles:{}},{paths:paths47,texts:texts65,bounds:bounds47,refblocks:refblocks47,circles:circles39}=SPST_switch_default,SPST_switch_horz_default={primitives:[...Object.values(paths47),...Object.values(circles39),{...texts65.top1,anchor:"middle_bottom",x:0},{...texts65.bottom1,anchor:"middle_top",x:0}],ports:[{...refblocks47.left1,labels:["1"]},{...refblocks47.right1,labels:["2"]}],size:{width:bounds47.width,height:bounds47.height},center:{x:bounds47.centerX,y:bounds47.centerY}},rotatedSymbol25=rotateSymbol(SPST_switch_horz_default),texts66=rotatedSymbol25.primitives.filter(lV=>lV.type==="text"),val25=texts66.find(lV=>lV.text==="{VAL}");val25.anchor="middle_right",val25.x=-.3,val25.y=0;var ref30=texts66.find(lV=>lV.text==="{REF}");ref30.anchor="middle_left",ref30.x=.3,ref30.y=0;var SPST_switch_vert_default=rotatedSymbol25,step_recovery_diode_default={paths:{path40:{type:"path",points:[{x:.14458890000000002,y:-.03903629999999936},{x:-.1199943999999995,y:.09325540000000032}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.1199943999999995,y:-.1713280000000026},{x:.14458890000000002,y:-.03903629999999936}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.1199943999999995,y:.09325539999999677},{x:-.1199943999999995,y:-.1713280000000026}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.14458890000000002,y:-.1713280000000026},{x:.14458890000000002,y:.09325539999999677}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.12219909999999956,y:-.03903629999999936},{x:-.5168693999999996,y:-.03903629999999936}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:.5233797,y:-.038951100000002015},{x:.14967160000000002,y:-.038951100000002015}],color:"primary",fill:!1},"path43-5":{type:"path",points:[{x:.19156529999999972,y:.09340209999999871},{x:.14591529999999908,y:.0937620999999993}],color:"primary",fill:!1},"path43-5-2":{type:"path",points:[{x:.19233440000000046,y:.1405493999999976},{x:.19197439999999988,y:.09489939999999919}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.0050250999999996715,y:-.26884529999999884},bottom1:{type:"text",text:"{VAL}",x:-.00011179999999999524,y:.2788453000000004}},refblocks:{left1:{x:-.5191471000000001,y:-.0399206999999997},right1:{x:.5191471000000001,y:-.03889610000000232}},bounds:{minX:-.5473055410000001,maxX:.5473055410000001,minY:-.3688452999999988,maxY:.2788453000000004,width:1.0946110820000001,height:1,centerX:0,centerY:-.04499999999999921},circles:{}},{paths:paths48,texts:texts67,bounds:bounds48,refblocks:refblocks48,circles:circles40}=step_recovery_diode_default,step_recovery_diode_horz_default={primitives:[...Object.values(paths48),...Object.values(circles40),{type:"text",text:"{REF}",x:-.0050250999999996715,y:-.26884529999999884,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:-.00011179999999999524,y:.2788453000000004,anchor:"middle_top"}],ports:[{...refblocks48.left1,labels:["1"]},{...refblocks48.right1,labels:["2"]}],size:{width:bounds48.width,height:bounds48.height},center:{x:bounds48.centerX,y:bounds48.centerY}},step_recovery_diode_vert_default=rotateSymbol(step_recovery_diode_horz_default),tachometer_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.36197569999999946},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.43234960000000044},left1:{type:"text",text:"RPM",x:0,y:-.025}},refblocks:{left1:{x:-.5446330999999993,y:.000852800000000542},right1:{x:.5381638000000004,y:-.00014359999999924433}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:0,maxY:0,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.007128299999999532,radius:.28854213,color:"primary",fill:!1}}},{paths:paths49,texts:texts68,bounds:bounds49,refblocks:refblocks49,circles:circles41}=tachometer_default,tachometer_horz_default={primitives:[...Object.values(paths49),...Object.values(circles41),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"},{...texts68.left1,anchor:"center",fontSize:.2}],ports:[{...refblocks49.left1,labels:["1"]},{...refblocks49.right1,labels:["2"]}],size:{width:bounds49.width,height:bounds49.height},center:{x:bounds49.centerX,y:bounds49.centerY}},{5:letter5,...rest5}=tachometer_horz_default.primitives;function isPrimitive5(lV){return typeof lV=="object"}var rotatedSymbol26=rotateSymbol({...tachometer_horz_default,primitives:Object.values(rest5).filter(isPrimitive5)}),tachometer_vert_default={...rotatedSymbol26,primitives:[...rotatedSymbol26.primitives,letter5]},triac_default={paths:{path11:{type:"path",points:[{x:-.5176700499999997,y:-.03674505000000039},{x:-.10888805000000024,y:-.03674505000000039}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.1031184499999993,y:-.03674505000000039},{x:.5246894499999994,y:-.03674505000000039}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-.09343985000000021,y:.15120634999999893},{x:-.0930998500000002,y:-.2533405500000008}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:.08519034999999908,y:.15003384999999914},{x:.08553034999999909,y:-.2545130500000006}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-.08315755000000014,y:-.05093445000000041},{x:-.08415755000000047,y:.15178124999999976},{x:.08653524999999984,y:.05604664999999964},{x:-.08126175000000035,y:-.051477150000000194}],color:"primary",fill:!0},"path11-0-9-0":{type:"path",points:[{x:.07661224999999927,y:-.25165445000000086},{x:.07761224999999983,y:-.04893885000000098},{x:-.0930805500000007,y:-.1446734500000011},{x:.07471644999999949,y:-.2521971500000013}],color:"primary",fill:!0},"path12-2":{type:"path",points:[{x:.09001085000000009,y:.06464874999999926},{x:.2707999499999998,y:.17611474999999932}],color:"primary",fill:!1},"path12-2-9":{type:"path",points:[{x:.27291134999999955,y:.18091894999999947},{x:.27124034999999935,y:.30668314999999935}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17328624999999964,y:-.41183614999999985},bottom1:{type:"text",text:"{VAL}",x:-.03022294999999975,y:.4218361500000001}},refblocks:{bottom1:{x:.27223905000000026,y:.31379625},left1:{x:-.54139845,y:-.0358920500000004},right1:{x:.5413984499999995,y:-.03688844999999996}},bounds:{minX:-.569556891,maxX:.5695568909999995,minY:-.5118361499999998,maxY:.4218361500000001,width:1.1391137819999995,height:.5836722999999999,centerX:-2220446049250313e-31,centerY:-.04499999999999987},circles:{path1:{type:"circle",x:-.0037626500000003116,y:-.04387315000000025,radius:.28854213,color:"primary",fill:!1}}},{paths:paths50,texts:texts69,bounds:bounds50,refblocks:refblocks50,circles:circles42}=triac_default,triac_horz_default={primitives:[...Object.values(paths50),...Object.values(circles42),{...texts69.top1,anchor:"middle_left"},{...texts69.bottom1,anchor:"middle_top"}],ports:[{...refblocks50.left1,labels:["1"]},{...refblocks50.right1,labels:["2"]},{...refblocks50.bottom1,labels:["3"]}],size:{width:bounds50.width,height:bounds50.height},center:{x:bounds50.centerX,y:bounds50.centerY}},rotatedSymbol27=rotateSymbol(triac_horz_default),texts70=rotatedSymbol27.primitives.filter(lV=>lV.type==="text"),ref31=texts70.find(lV=>lV.text==="{REF}"),val26=texts70.find(lV=>lV.text==="{VAL}");ref31.y=0,val26.y=0;var triac_vert_default=rotatedSymbol27,tunnel_diode_default={paths:{path40:{type:"path",points:[{x:.1413337499999996,y:-.00041674999999941065},{x:-.12324954999999993,y:.13187495000000093}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.12324954999999993,y:-.13270844999999976},{x:.1413337499999996,y:-.00041674999999941065}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.12324954999999993,y:.1318749499999996},{x:-.12324954999999993,y:-.13270844999999976}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.1413337499999996,y:-.13270844999999976},{x:.1413337499999996,y:.1318749499999996}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.12545425,y:-.00041674999999941065},{x:-.52012455,y:-.00041674999999941065}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:.5201245499999998,y:-.00033154999999984724},{x:.14641644999999937,y:-.00033154999999984724}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:.1401360499999995,y:-.13319134999999993},{x:.07403164999999912,y:-.13270134999999916}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:.14135174999999967,y:.13270134999999939},{x:.07524734999999927,y:.13319134999999993}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.0082802500000001,y:-.23022574999999956},bottom1:{type:"text",text:"{VAL}",x:-.0033669500000002017,y:.31746485000000035}},refblocks:{left1:{x:-.5224022500000005,y:-.0013011500000004173},right1:{x:.5158919499999994,y:-.00027654999999948693}},bounds:{minX:-.52012455,maxX:.5201245499999998,minY:-.13319134999999993,maxY:.13319134999999993,width:1.0402490999999998,height:1,centerX:-11102230246251565e-32,centerY:0},circles:{}},{paths:paths51,texts:texts71,bounds:bounds51,refblocks:refblocks51,circles:circles43}=tunnel_diode_default,tunnel_diode_horz_default={primitives:[...Object.values(paths51),...Object.values(circles43),{...texts71.top1,anchor:"middle_bottom"},{...texts71.bottom1,anchor:"middle_top"}],ports:[{...refblocks51.left1,labels:["1"]},{...refblocks51.right1,labels:["2"]}],size:{width:bounds51.width,height:bounds51.height},center:{x:bounds51.centerX,y:bounds51.centerY}},rotated11=rotateSymbol(tunnel_diode_horz_default),ref32=rotated11.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val27=rotated11.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref32.anchor="middle_left",val27.anchor="middle_right";var tunnel_diode_vert_default=rotated11,unijunction_transistor_default={paths:{path11:{type:"path",points:[{x:-.3274461945,y:-.20527883627037657},{x:-.021085194500000348,y:-.007570136270376837}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2331163055000003,y:-.1251673362703769},{x:.2320633055000001,y:-.3759855362703768}],color:"primary",fill:!1},"path12-2":{type:"path",points:[{x:.23221610549999938,y:.0818845637296235},{x:.2311631054999992,y:.33270276372962315}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-.013263894499999873,y:.1792007637296229},{x:-.012923894499999866,y:-.2253461362703768}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:.23222970550000066,y:-.12047013627037662},{x:-.011307094499999115,y:-.11996013627037683}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-.1124341944999998,y:-.131359936270377},{x:-.16993279449999954,y:-.039004036270377185},{x:-.05822649449999928,y:-.03212003627037707},{x:-.11133889449999979,y:-.13104553627037707}],color:"primary",fill:!0},"path11-0-3-8":{type:"path",points:[{x:.23230320549999983,y:.08329316372962325},{x:-.011233594499999944,y:.07900616372962332}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.19541139450000045,y:-.389088136270376},bottom1:{type:"text",text:"{VAL}",x:-.031363394499999364,y:.42359956372962415}},refblocks:{top1:{x:.2317438004035266,y:-.3954411227296242},bottom1:{x:.2308431668082036,y:.35215823360635445},left1:{x:-.34055979449999985,y:-.21512343627037622}},bounds:{minX:-.3687182354999998,maxX:.3687182354999999,minY:-.48908813627037595,maxY:.42359956372962415,width:.7374364709999996,height:.5626877000000001,centerX:27755575615628914e-33,centerY:-.0327442862703759},circles:{path1:{type:"circle",x:.08017610549999987,y:-.006746336270376352,radius:.28854213,color:"primary",fill:!1}}},{paths:paths52,texts:texts72,bounds:bounds52,refblocks:refblocks52,circles:circles44}=unijunction_transistor_default,unijunction_transistor_horz_default={primitives:[...Object.values(paths52),...Object.values(circles44),{...texts72.top1,anchor:"middle_left"},{...texts72.bottom1,anchor:"middle_right"}],ports:[{...refblocks52.top1,labels:["1"]},{...refblocks52.bottom1,labels:["2"]},{...refblocks52.left1,labels:["3"]}],size:{width:bounds52.width,height:bounds52.height},center:{x:bounds52.centerX,y:bounds52.centerY}},rotatedSymbol28=rotateSymbol(unijunction_transistor_horz_default),texts73=rotatedSymbol28.primitives.filter(lV=>lV.type==="text"),ref33=texts73.find(lV=>lV.text==="{REF}");ref33.y=.1;var val28=texts73.find(lV=>lV.text==="{VAL}");val28.y=.1,val28.x=-.4;var unijunction_transistor_vert_default=rotatedSymbol28,var_meter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.36197569999999946},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.43234960000000044},left1:{type:"text",text:"Var",x:-.19436529999999896,y:.07249430000000023}},refblocks:{left1:{x:-.5446330999999993,y:.000852800000000542},right1:{x:.5381638000000004,y:-.00014359999999924433}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:0,maxY:0,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.007128299999999532,radius:.28854213,color:"primary",fill:!1}}},{paths:paths53,texts:texts74,bounds:bounds53,refblocks:refblocks53,circles:circles45}=var_meter_default,var_meter_horz_default={primitives:[...Object.values(paths53),...Object.values(circles45),{...texts74.top1,x:0,y:-.3594553499999995,anchor:"middle_bottom"},{...texts74.bottom1,x:0,y:.35,anchor:"middle_top"},{...texts74.left1,x:-.02,y:-.02,fontSize:.2,anchor:"center"}],ports:[{...refblocks53.left1,labels:["1"]},{...refblocks53.right1,labels:["2"]}],size:{width:bounds53.width,height:bounds53.height},center:{x:bounds53.centerX,y:bounds53.centerY}},var_meter_vert_default=rotateSymbol(var_meter_horz_default),varactor_diode_default={paths:{path40:{type:"path",points:[{x:.08035965000000034,y:-.0017977999999994054},{x:-.18422364999999918,y:.13049390000000116}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.18422365000000052,y:-.13408949999999975},{x:.080359649999999,y:-.0017977999999994054}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.18422365000000052,y:.13049390000000116},{x:-.18422365000000052,y:-.1340894999999982}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.09188504999999969,y:-.1326124999999998},{x:.09294404999999917,y:.13408949999999953}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.1984993499999994,y:-.0017977999999994054},{x:-.5222461500000002,y:-.0017977999999994054}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:.5222461500000002,y:-.001712599999999842},{x:.20220525000000067,y:-.001712599999999842}],color:"primary",fill:!1},"path43-6":{type:"path",points:[{x:.18242454999999969,y:-.13264619999999994},{x:.18348354999999894,y:.1340557999999994}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.008090549999999253,y:-.2316066000000001},bottom1:{type:"text",text:"{VAL}",x:-.0031772499999995762,y:.31608400000000003}},refblocks:{left1:{x:-.5222125499999998,y:-.0026820999999992434},right1:{x:.5160816500000001,y:-.001657400000000031}},bounds:{minX:-.5222461500000002,maxX:.5222461500000002,minY:-.13408949999999975,maxY:.13408949999999953,width:1.0444923000000004,height:1,centerX:0,centerY:-11102230246251565e-32},circles:{}},{paths:paths54,texts:texts75,bounds:bounds54,refblocks:refblocks54,circles:circles46}=varactor_diode_default,varactor_diode_horz_default={primitives:[...Object.values(paths54),...Object.values(circles46),{...texts75.top1,anchor:"middle_bottom"},{...texts75.bottom1,anchor:"middle_top"}],ports:[{...refblocks54.left1,labels:["1"]},{...refblocks54.right1,labels:["2"]}],size:{width:bounds54.width,height:bounds54.height},center:{x:bounds54.centerX,y:bounds54.centerY}},rotated12=rotateSymbol(varactor_diode_horz_default),ref34=rotated12.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val29=rotated12.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref34.anchor="middle_left",val29.anchor="middle_right";var varactor_diode_vert_default=rotated12,varistor_default={paths:{path5:{type:"path",points:[{x:-.5245830500000004,y:.00034089999999764586},{x:-.25999975000000086,y:.00034089999999764586}],color:"primary",fill:!1},path6:{type:"path",points:[{x:.2691672500000002,y:.00034089999999764586},{x:.5337505499999997,y:.00034089999999764586}],color:"primary",fill:!1},path7:{type:"path",points:[{x:.2691672500000002,y:.23846589999999956},{x:-.25999974999999953,y:-.2377841000000025}],color:"primary",fill:!1},path8:{type:"path",points:[{x:.37500025000000026,y:.23846589999999956},{x:.2691672500000002,y:.23846589999999956}],color:"primary",fill:!1},path9:{type:"path",points:[{x:.004585150000000482,y:-.13195090000000143},{x:.26916815000000094,y:-.13195090000000143},{x:.26916815000000094,y:.1326324999999997},{x:-.2599988499999988,y:.1326324999999997},{x:-.2599988499999988,y:-.13195090000000143},{x:.004585150000001814,y:-.13195090000000143}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.05849044999999986,y:-.24666550000000065},bottom1:{type:"text",text:"{VAL}",x:.008507150000000685,y:.25666549999999866}},refblocks:{left1:{x:-.5392315500000002,y:.0020305999999994384},right1:{x:.5392315500000002,y:-.00033980000000077837}},bounds:{minX:-.5673899910000002,maxX:.5673899910000002,minY:-.3466655000000006,maxY:.25666549999999866,width:1.1347799820000004,height:.2533309999999993,centerX:0,centerY:-.045000000000000984},circles:{}},{paths:paths55,texts:texts76,bounds:bounds55,refblocks:refblocks55}=varistor_default,varistor_horz_default={primitives:[...Object.values(paths55),{...texts76.top1,anchor:"middle_left"},{...texts76.bottom1,anchor:"middle_right"}],ports:[{...refblocks55.left1,labels:["1","-"]},{...refblocks55.right1,labels:["2","+"]}],size:{width:bounds55.width,height:bounds55.height},center:{x:bounds55.centerX,y:bounds55.centerY}},varistor_vert_default=rotateSymbol(varistor_horz_default),varmeter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.36197569999999946},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.43234960000000044},left1:{type:"text",text:"Var",x:0,y:-.025}},refblocks:{left1:{x:-.5446330999999993,y:.000852800000000542},right1:{x:.5381638000000004,y:-.00014359999999924433}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:0,maxY:0,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.007128299999999532,radius:.28854213,color:"primary",fill:!1}}},{paths:paths56,texts:texts77,bounds:bounds56,refblocks:refblocks56,circles:circles47}=varmeter_default,varmeter_horz_default={primitives:[...Object.values(paths56),...Object.values(circles47),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"},{...texts77.left1,anchor:"center",fontSize:.2}],ports:[{...refblocks56.left1,labels:["1"]},{...refblocks56.right1,labels:["2"]}],size:{width:bounds56.width,height:bounds56.height},center:{x:bounds56.centerX,y:bounds56.centerY}},{5:letter6,...rest6}=varmeter_horz_default.primitives;function isPrimitive6(lV){return typeof lV=="object"}var rotatedSymbol29=rotateSymbol({...varmeter_horz_default,primitives:Object.values(rest6).filter(isPrimitive6)}),varmeter_vert_default={...rotatedSymbol29,primitives:[...rotatedSymbol29.primitives,letter6]},volt_meter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:.002520349999999949},{x:-.3042887999999997,y:.002520349999999949}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:.09442299999999992,y:-.0957435499999999},{x:-.004364400000000712,y:.0957435499999999},{x:-.1110211000000012,y:-.0957435499999999}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:.002520349999999949},{x:.5307178000000001,y:.002520349999999949}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.3594553499999995},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.4348699500000004}},refblocks:{left1:{x:-.5446330999999993,y:.003373150000000491},right1:{x:.5381638000000004,y:.0023767500000007047}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:-.0957435499999999,maxY:.0957435499999999,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.004607949999999583,radius:.28854213,color:"primary",fill:!1}}},{paths:paths57,texts:texts78,bounds:bounds57,circles:circles48,refblocks:refblocks57}=volt_meter_default,volt_meter_horz_default={primitives:[...Object.values(paths57),...Object.values(circles48),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"}],ports:[{...refblocks57.left1,labels:["1"]},{...refblocks57.right1,labels:["2"]}],size:{width:bounds57.width,height:bounds57.height},center:{x:bounds57.centerX,y:bounds57.centerY}},volt_meter_vert_default=rotateSymbol(volt_meter_horz_default),watt_hour_meter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.36197569999999946},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.43234960000000044},left1:{type:"text",text:"Wh",x:0,y:-.025}},refblocks:{left1:{x:-.5446330999999993,y:.000852800000000542},right1:{x:.5381638000000004,y:-.00014359999999924433}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:0,maxY:0,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.007128299999999532,radius:.28854213,color:"primary",fill:!1}}},{paths:paths58,texts:texts79,bounds:bounds58,refblocks:refblocks58,circles:circles49}=watt_hour_meter_default,watt_hour_meter_horz_default={primitives:[...Object.values(paths58),...Object.values(circles49),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"},{...texts79.left1,anchor:"center",fontSize:.2}],ports:[{...refblocks58.left1,labels:["1"]},{...refblocks58.right1,labels:["2"]}],size:{width:bounds58.width,height:bounds58.height},center:{x:bounds58.centerX,y:bounds58.centerY}},{5:letter7,...rest7}=watt_hour_meter_horz_default.primitives;function isPrimitive7(lV){return typeof lV=="object"}var rotatedSymbol30=rotateSymbol({...watt_hour_meter_horz_default,primitives:Object.values(rest7).filter(isPrimitive7)}),watt_hour_meter_vert_default={...rotatedSymbol30,primitives:[...rotatedSymbol30.primitives,letter7]},wattmeter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.36197569999999946},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.43234960000000044},left1:{type:"text",text:"W",x:0,y:-.025}},refblocks:{left1:{x:-.5446330999999993,y:.000852800000000542},right1:{x:.5381638000000004,y:-.00014359999999924433}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:0,maxY:0,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.007128299999999532,radius:.28854213,color:"primary",fill:!1}}},{paths:paths59,texts:texts80,bounds:bounds59,refblocks:refblocks59,circles:circles50}=wattmeter_default,wattmeter_horz_default={primitives:[...Object.values(paths59),...Object.values(circles50),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"},{...texts80.left1,anchor:"center",fontSize:.3}],ports:[{...refblocks59.left1,labels:["1"]},{...refblocks59.right1,labels:["2"]}],size:{width:bounds59.width,height:bounds59.height},center:{x:bounds59.centerX,y:bounds59.centerY}},{5:letter8,...rest8}=wattmeter_horz_default.primitives;function isPrimitive8(lV){return typeof lV=="object"}var rotatedSymbol31=rotateSymbol({...wattmeter_horz_default,primitives:Object.values(rest8).filter(isPrimitive8)}),wattmeter_vert_default={...rotatedSymbol31,primitives:[...rotatedSymbol31.primitives,letter8]},zener_diode_default={paths:{path40:{type:"path",points:[{x:.1413337499999996,y:.00024145000000008743},{x:-.12324954999999993,y:.13253315000000043}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.12324954999999993,y:-.13205025000000026},{x:.1413337499999996,y:.00024145000000008743}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.12324954999999993,y:.1325331499999991},{x:-.12324954999999993,y:-.13205025000000026}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.1413337499999996,y:-.13205025000000026},{x:.1413337499999996,y:.1325331499999991}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.12545425,y:.00024145000000008743},{x:-.52012455,y:.00024145000000008743}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:.5201245499999998,y:.00032664999999965083},{x:.14641644999999937,y:.00032664999999965083}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:.1401360499999995,y:-.13253315000000043},{x:.07403164999999912,y:-.13204314999999966}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.0082802500000001,y:-.22956755000000006},bottom1:{type:"text",text:"{VAL}",x:-.0033669500000002017,y:.31812304999999985}},refblocks:{left1:{x:-.5224022500000005,y:-.0006429500000009192},right1:{x:.5158919499999994,y:.00038165000000001115}},bounds:{minX:-.52012455,maxX:.5201245499999998,minY:-.13253315000000043,maxY:.13253315000000043,width:1.0402490999999998,height:1,centerX:-11102230246251565e-32,centerY:0},circles:{}},{paths:paths60,texts:texts81,bounds:bounds60,refblocks:refblocks60,circles:circles51}=zener_diode_default,zener_diode_horz_default={primitives:[...Object.values(paths60),...Object.values(circles51),{...texts81.top1,anchor:"middle_bottom"},{...texts81.bottom1,anchor:"middle_top"}],ports:[{...refblocks60.left1,labels:["1"]},{...refblocks60.right1,labels:["2"]}],size:{width:bounds60.width,height:bounds60.height},center:{x:bounds60.centerX,y:bounds60.centerY}},rotated13=rotateSymbol(zener_diode_horz_default),ref35=rotated13.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val30=rotated13.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref35.anchor="middle_left",val30.anchor="middle_right";var zener_diode_vert_default=rotated13,symbols_index_default={ac_voltmeter_horz:ac_voltmeter_horz_default,ac_voltmeter_vert:ac_voltmeter_vert_default,avalanche_diode_horz:avalanche_diode_horz_default,avalanche_diode_vert:avalanche_diode_vert_default,battery_horz:battery_horz_default,battery_vert:battery_vert_default,boxresistor_horz:boxresistor_horz_default,boxresistor_vert:boxresistor_vert_default,capacitor_down:capacitor_down_default,capacitor_horz:capacitor_horz_default,capacitor_left:capacitor_left_default,capacitor_right:capacitor_right_default,capacitor_up:capacitor_up_default,capacitor_vert:capacitor_vert_default,constant_current_diode_horz:constant_current_diode_horz_default,constant_current_diode_vert:constant_current_diode_vert_default,crystal_horz:crystal_horz_default,crystal_vert:crystal_vert_default,darlington_pair_transistor_horz:darlington_pair_transistor_horz_default,darlington_pair_transistor_vert:darlington_pair_transistor_vert_default,dc_ammeter_horz:dc_ammeter_horz_default,dc_ammeter_vert:dc_ammeter_vert_default,dc_voltmeter_horz:dc_voltmeter_horz_default,dc_voltmeter_vert:dc_voltmeter_vert_default,diac_horz:diac_horz_default,diac_vert:diac_vert_default,diode_down:diode_down_default,diode_left:diode_left_default,diode_right:diode_right_default,diode_up:diode_up_default,dpst_switch_horz:dpst_switch_horz_default,dpst_switch_vert:dpst_switch_vert_default,filled_diode_horz:filled_diode_horz_default,filled_diode_vert:filled_diode_vert_default,frequency_meter_horz:frequency_meter_horz_default,frequency_meter_vert:frequency_meter_vert_default,fuse_horz:fuse_horz_default,fuse_vert:fuse_vert_default,ground_horz:ground_horz_default,ground_vert:ground_vert_default,gunn_diode_horz:gunn_diode_horz_default,gunn_diode_vert:gunn_diode_vert_default,igbt_transistor_horz:igbt_transistor_horz_default,igbt_transistor_vert:igbt_transistor_vert_default,illuminated_push_button_normally_open_horz:illuminated_push_button_normally_open_horz_default,illuminated_push_button_normally_open_vert:illuminated_push_button_normally_open_vert_default,inductor_horz:inductor_horz_default,inductor_vert:inductor_vert_default,laser_diode_horz:laser_diode_horz_default,laser_diode_vert:laser_diode_vert_default,led_down:led_down_default,led_left:led_left_default,led_right:led_right_default,led_up:led_up_default,light_dependent_resistor_horz:light_dependent_resistor_horz_default,light_dependent_resistor_vert:light_dependent_resistor_vert_default,mosfet_depletion_normally_on_horz:mosfet_depletion_normally_on_horz_default,mosfet_depletion_normally_on_vert:mosfet_depletion_normally_on_vert_default,mushroom_head_normally_open_momentary_horz:mushroom_head_normally_open_momentary_horz_default,mushroom_head_normally_open_momentary_vert:mushroom_head_normally_open_momentary_vert_default,n_channel_d_mosfet_transistor_horz:n_channel_d_mosfet_transistor_horz_default,n_channel_d_mosfet_transistor_vert:n_channel_d_mosfet_transistor_vert_default,n_channel_e_mosfet_transistor_horz:n_channel_e_mosfet_transistor_horz_default,n_channel_e_mosfet_transistor_vert:n_channel_e_mosfet_transistor_vert_default,njfet_transistor_horz:njfet_transistor_horz_default,njfet_transistor_vert:njfet_transistor_vert_default,npn_bipolar_transistor_horz:npn_bipolar_transistor_horz_default,npn_bipolar_transistor_vert:npn_bipolar_transistor_vert_default,p_channel_d_mosfet_transistor_horz:p_channel_d_mosfet_transistor_horz_default,p_channel_d_mosfet_transistor_vert:p_channel_d_mosfet_transistor_vert_default,p_channel_e_mosfet_transistor_horz:p_channel_e_mosfet_transistor_horz_default,p_channel_e_mosfet_transistor_vert:p_channel_e_mosfet_transistor_vert_default,photodiode_horz:photodiode_horz_default,photodiode_vert:photodiode_vert_default,pjfet_transistor_horz:pjfet_transistor_horz_default,pjfet_transistor_vert:pjfet_transistor_vert_default,pnp_bipolar_transistor_horz:pnp_bipolar_transistor_horz_default,pnp_bipolar_transistor_vert:pnp_bipolar_transistor_vert_default,potentiometer_horz:potentiometer_horz_default,potentiometer_vert:potentiometer_vert_default,potentiometer2_horz:potentiometer2_horz_default,potentiometer2_vert:potentiometer2_vert_default,power_factor_meter_horz:power_factor_meter_horz_default,power_factor_meter_vert:power_factor_meter_vert_default,push_button_normally_closed_momentary_horz:push_button_normally_closed_momentary_horz_default,push_button_normally_closed_momentary_vert:push_button_normally_closed_momentary_vert_default,push_button_normally_open_momentary_horz:push_button_normally_open_momentary_horz_default,push_button_normally_open_momentary_vert:push_button_normally_open_momentary_vert_default,rectifier_diode_horz:rectifier_diode_horz_default,rectifier_diode_vert:rectifier_diode_vert_default,resonator_horz:resonator_horz_default,resonator_vert:resonator_vert_default,schottky_diode_horz:schottky_diode_horz_default,schottky_diode_vert:schottky_diode_vert_default,silicon_controlled_rectifier_horz:silicon_controlled_rectifier_horz_default,silicon_controlled_rectifier_vert:silicon_controlled_rectifier_vert_default,SPDT_switch_horz:SPDT_switch_horz_default,SPDT_switch_vert:SPDT_switch_vert_default,SPST_switch_horz:SPST_switch_horz_default,SPST_switch_vert:SPST_switch_vert_default,step_recovery_diode_horz:step_recovery_diode_horz_default,step_recovery_diode_vert:step_recovery_diode_vert_default,tachometer_horz:tachometer_horz_default,tachometer_vert:tachometer_vert_default,triac_horz:triac_horz_default,triac_vert:triac_vert_default,tunnel_diode_horz:tunnel_diode_horz_default,tunnel_diode_vert:tunnel_diode_vert_default,unijunction_transistor_horz:unijunction_transistor_horz_default,unijunction_transistor_vert:unijunction_transistor_vert_default,var_meter_horz:var_meter_horz_default,var_meter_vert:var_meter_vert_default,varactor_diode_horz:varactor_diode_horz_default,varactor_diode_vert:varactor_diode_vert_default,varistor_horz:varistor_horz_default,varistor_vert:varistor_vert_default,varmeter_horz:varmeter_horz_default,varmeter_vert:varmeter_vert_default,volt_meter_horz:volt_meter_horz_default,volt_meter_vert:volt_meter_vert_default,watt_hour_meter_horz:watt_hour_meter_horz_default,watt_hour_meter_vert:watt_hour_meter_vert_default,wattmeter_horz:wattmeter_horz_default,wattmeter_vert:wattmeter_vert_default,zener_diode_horz:zener_diode_horz_default,zener_diode_vert:zener_diode_vert_default};Object.fromEntries(Object.keys(symbols_index_default).map(lV=>[lV,lV]));var lodash__objecttypes,hasRequiredLodash__objecttypes;function requireLodash__objecttypes(){if(hasRequiredLodash__objecttypes)return lodash__objecttypes;hasRequiredLodash__objecttypes=1;var lV={boolean:!1,function:!0,object:!0,number:!1,string:!1,undefined:!1};return lodash__objecttypes=lV,lodash__objecttypes}var lodash_isobject,hasRequiredLodash_isobject;function requireLodash_isobject(){if(hasRequiredLodash_isobject)return lodash_isobject;hasRequiredLodash_isobject=1;var lV=requireLodash__objecttypes();function J(VV){return!!(VV&&lV[typeof VV])}return lodash_isobject=J,lodash_isobject}var lodash__renative,hasRequiredLodash__renative;function requireLodash__renative(){if(hasRequiredLodash__renative)return lodash__renative;hasRequiredLodash__renative=1;var lV=Object.prototype,J=lV.toString,VV=RegExp("^"+String(J).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$");return lodash__renative=VV,lodash__renative}var lodash__shimkeys,hasRequiredLodash__shimkeys;function requireLodash__shimkeys(){if(hasRequiredLodash__shimkeys)return lodash__shimkeys;hasRequiredLodash__shimkeys=1;var lV=requireLodash__objecttypes(),J=Object.prototype,VV=J.hasOwnProperty,RV=function(UV){var ZV,WV=UV,IV=[];if(!WV||!lV[typeof UV])return IV;for(ZV in WV)VV.call(WV,ZV)&&IV.push(ZV);return IV};return lodash__shimkeys=RV,lodash__shimkeys}var lodash_keys,hasRequiredLodash_keys;function requireLodash_keys(){if(hasRequiredLodash_keys)return lodash_keys;hasRequiredLodash_keys=1;var lV=requireLodash_isobject(),J=requireLodash__renative(),VV=requireLodash__shimkeys(),RV=J.test(RV=Object.keys)&&RV,UV=RV?function(ZV){return lV(ZV)?RV(ZV):[]}:VV;return lodash_keys=UV,lodash_keys}var lodash_noop,hasRequiredLodash_noop;function requireLodash_noop(){if(hasRequiredLodash_noop)return lodash_noop;hasRequiredLodash_noop=1;function lV(){}return lodash_noop=lV,lodash_noop}var lodash__basecreate,hasRequiredLodash__basecreate;function requireLodash__basecreate(){if(hasRequiredLodash__basecreate)return lodash__basecreate;hasRequiredLodash__basecreate=1;var lV={},J=requireLodash_isobject();requireLodash_noop();var VV=requireLodash__renative(),RV=VV.test(RV=Object.create)&&RV;function UV(ZV,WV){return J(ZV)?RV(ZV):{}}return RV||(UV=function(){function ZV(){}return function(WV){if(J(WV)){ZV.prototype=WV;var IV=new ZV;ZV.prototype=null}return IV||lV.Object()}}()),lodash__basecreate=UV,lodash__basecreate}var lodash__setbinddata,hasRequiredLodash__setbinddata;function requireLodash__setbinddata(){if(hasRequiredLodash__setbinddata)return lodash__setbinddata;hasRequiredLodash__setbinddata=1;var lV=requireLodash_noop(),J=requireLodash__renative(),VV={configurable:!1,enumerable:!1,value:null,writable:!1},RV=function(){try{var ZV={},WV=J.test(WV=Object.defineProperty)&&WV,IV=WV(ZV,ZV,ZV)&&WV}catch{}return IV}(),UV=RV?function(ZV,WV){VV.value=WV,RV(ZV,"__bindData__",VV)}:lV;return lodash__setbinddata=UV,lodash__setbinddata}var lodash__basebind,hasRequiredLodash__basebind;function requireLodash__basebind(){if(hasRequiredLodash__basebind)return lodash__basebind;hasRequiredLodash__basebind=1;var lV=requireLodash__basecreate(),J=requireLodash_isobject(),VV=requireLodash__setbinddata(),RV=[],UV=RV.push;function ZV(WV){var IV=WV[0],dV=WV[2],CV=WV[4];function FV(){if(dV){var NV=dV.slice();UV.apply(NV,arguments)}if(this instanceof FV){var eV=lV(IV.prototype),gV=IV.apply(eV,NV||arguments);return J(gV)?gV:eV}return IV.apply(CV,NV||arguments)}return VV(FV,WV),FV}return lodash__basebind=ZV,lodash__basebind}var lodash__slice,hasRequiredLodash__slice;function requireLodash__slice(){if(hasRequiredLodash__slice)return lodash__slice;hasRequiredLodash__slice=1;function lV(J,VV,RV){VV||(VV=0),typeof RV>"u"&&(RV=J?J.length:0);for(var UV=-1,ZV=RV-VV||0,WV=Array(ZV<0?0:ZV);++UV<ZV;)WV[UV]=J[VV+UV];return WV}return lodash__slice=lV,lodash__slice}var lodash__basecreatewrapper,hasRequiredLodash__basecreatewrapper;function requireLodash__basecreatewrapper(){if(hasRequiredLodash__basecreatewrapper)return lodash__basecreatewrapper;hasRequiredLodash__basecreatewrapper=1;var lV=requireLodash__basecreate(),J=requireLodash_isobject(),VV=requireLodash__setbinddata(),RV=requireLodash__slice(),UV=[],ZV=UV.push;function WV(IV){var dV=IV[0],CV=IV[1],FV=IV[2],NV=IV[3],eV=IV[4],gV=IV[5],nV=CV&1,JV=CV&2,aV=CV&4,GV=CV&8,YV=dV;function tV(){var kV=nV?eV:this;if(FV){var AV=FV.slice();ZV.apply(AV,arguments)}if((NV||aV)&&(AV||(AV=RV(arguments)),NV&&ZV.apply(AV,NV),aV&&AV.length<gV))return CV|=16,WV([dV,GV?CV:CV&-4,AV,null,eV,gV]);if(AV||(AV=arguments),JV&&(dV=kV[YV]),this instanceof tV){kV=lV(dV.prototype);var XV=dV.apply(kV,AV);return J(XV)?XV:kV}return dV.apply(kV,AV)}return VV(tV,IV),tV}return lodash__basecreatewrapper=WV,lodash__basecreatewrapper}var lodash_isfunction,hasRequiredLodash_isfunction;function requireLodash_isfunction(){if(hasRequiredLodash_isfunction)return lodash_isfunction;hasRequiredLodash_isfunction=1;function lV(J){return typeof J=="function"}return lodash_isfunction=lV,lodash_isfunction}var lodash__createwrapper,hasRequiredLodash__createwrapper;function requireLodash__createwrapper(){if(hasRequiredLodash__createwrapper)return lodash__createwrapper;hasRequiredLodash__createwrapper=1;var lV=requireLodash__basebind(),J=requireLodash__basecreatewrapper(),VV=requireLodash_isfunction(),RV=[],UV=RV.push;function ZV(WV,IV,dV,CV,FV,NV){var eV=IV&1,gV=IV&2,nV=IV&4,JV=IV&16,aV=IV&32;if(!gV&&!VV(WV))throw new TypeError;JV&&!dV.length&&(IV&=-17,JV=dV=!1),aV&&!CV.length&&(IV&=-33,aV=CV=!1);var GV=WV&&WV.__bindData__;if(GV&&GV!==!0)return GV=GV.slice(),eV&&!(GV[1]&1)&&(GV[4]=FV),!eV&&GV[1]&1&&(IV|=8),nV&&!(GV[1]&4)&&(GV[5]=NV),JV&&UV.apply(GV[2]||(GV[2]=[]),dV),aV&&UV.apply(GV[3]||(GV[3]=[]),CV),GV[1]|=IV,ZV.apply(null,GV);var YV=IV==1||IV===17?lV:J;return YV([WV,IV,dV,CV,FV,NV])}return lodash__createwrapper=ZV,lodash__createwrapper}var lodash_bind,hasRequiredLodash_bind;function requireLodash_bind(){if(hasRequiredLodash_bind)return lodash_bind;hasRequiredLodash_bind=1;var lV=requireLodash__createwrapper();requireLodash__renative();var J=requireLodash__slice();function VV(RV,UV){return arguments.length>2?lV(RV,17,J(arguments,2),null,UV):lV(RV,1,null,null,UV)}return lodash_bind=VV,lodash_bind}var lodash_identity,hasRequiredLodash_identity;function requireLodash_identity(){if(hasRequiredLodash_identity)return lodash_identity;hasRequiredLodash_identity=1;function lV(J){return J}return lodash_identity=lV,lodash_identity}var lodash_support,hasRequiredLodash_support;function requireLodash_support(){if(hasRequiredLodash_support)return lodash_support;hasRequiredLodash_support=1;var lV={},J=requireLodash__renative(),VV=/\bthis\b/,RV={};return RV.funcDecomp=!J.test(lV.WinRTError)&&VV.test(function(){return this}),RV.funcNames=typeof Function.name=="string",lodash_support=RV,lodash_support}var lodash__basecreatecallback,hasRequiredLodash__basecreatecallback;function requireLodash__basecreatecallback(){if(hasRequiredLodash__basecreatecallback)return lodash__basecreatecallback;hasRequiredLodash__basecreatecallback=1;var lV=requireLodash_bind(),J=requireLodash_identity(),VV=requireLodash__setbinddata(),RV=requireLodash_support(),UV=/^\s*function[ \n\r\t]+\w/,ZV=/\bthis\b/,WV=Function.prototype.toString;function IV(dV,CV,FV){if(typeof dV!="function")return J;if(typeof CV>"u"||!("prototype"in dV))return dV;var NV=dV.__bindData__;if(typeof NV>"u"&&(RV.funcNames&&(NV=!dV.name),NV=NV||!RV.funcDecomp,!NV)){var eV=WV.call(dV);RV.funcNames||(NV=!UV.test(eV)),NV||(NV=ZV.test(eV),VV(dV,NV))}if(NV===!1||NV!==!0&&NV[1]&1)return dV;switch(FV){case 1:return function(gV){return dV.call(CV,gV)};case 2:return function(gV,nV){return dV.call(CV,gV,nV)};case 3:return function(gV,nV,JV){return dV.call(CV,gV,nV,JV)};case 4:return function(gV,nV,JV,aV){return dV.call(CV,gV,nV,JV,aV)}}return lV(dV,CV)}return lodash__basecreatecallback=IV,lodash__basecreatecallback}var lodash_forown,hasRequiredLodash_forown;function requireLodash_forown(){if(hasRequiredLodash_forown)return lodash_forown;hasRequiredLodash_forown=1;var lV=requireLodash__basecreatecallback(),J=requireLodash_keys(),VV=requireLodash__objecttypes(),RV=function(UV,ZV,WV){var IV,dV=UV,CV=dV;if(!dV||!VV[typeof dV])return CV;ZV=ZV&&typeof WV>"u"?ZV:lV(ZV,WV,3);for(var FV=-1,NV=VV[typeof dV]&&J(dV),eV=NV?NV.length:0;++FV<eV;)if(IV=NV[FV],ZV(dV[IV],IV,UV)===!1)return CV;return CV};return lodash_forown=RV,lodash_forown}var lodash_foreach,hasRequiredLodash_foreach;function requireLodash_foreach(){if(hasRequiredLodash_foreach)return lodash_foreach;hasRequiredLodash_foreach=1;var lV=requireLodash__basecreatecallback(),J=requireLodash_forown();function VV(RV,UV,ZV){var WV=-1,IV=RV?RV.length:0;if(UV=UV&&typeof ZV>"u"?UV:lV(UV,ZV,3),typeof IV=="number")for(;++WV<IV&&UV(RV[WV],WV,RV)!==!1;);else J(RV,UV);return RV}return lodash_foreach=VV,lodash_foreach}var length$2,hasRequiredLength$3;function requireLength$3(){if(hasRequiredLength$3)return length$2;hasRequiredLength$3=1;var lV,J;return lV={mm:{name:{singular:"Millimeter",plural:"Millimeters"},to_anchor:1/1e3},cm:{name:{singular:"Centimeter",plural:"Centimeters"},to_anchor:1/100},m:{name:{singular:"Meter",plural:"Meters"},to_anchor:1},km:{name:{singular:"Kilometer",plural:"Kilometers"},to_anchor:1e3}},J={in:{name:{singular:"Inch",plural:"Inches"},to_anchor:1/12},yd:{name:{singular:"Yard",plural:"Yards"},to_anchor:3},"ft-us":{name:{singular:"US Survey Foot",plural:"US Survey Feet"},to_anchor:1.000002},ft:{name:{singular:"Foot",plural:"Feet"},to_anchor:1},mi:{name:{singular:"Mile",plural:"Miles"},to_anchor:5280}},length$2={metric:lV,imperial:J,_anchors:{metric:{unit:"m",ratio:3.28084},imperial:{unit:"ft",ratio:1/3.28084}}},length$2}var area$1,hasRequiredArea$1;function requireArea$1(){if(hasRequiredArea$1)return area$1;hasRequiredArea$1=1;var lV,J;return lV={mm2:{name:{singular:"Square Millimeter",plural:"Square Millimeters"},to_anchor:1/1e6},cm2:{name:{singular:"Centimeter",plural:"Centimeters"},to_anchor:1/1e4},m2:{name:{singular:"Square Meter",plural:"Square Meters"},to_anchor:1},ha:{name:{singular:"Hectare",plural:"Hectares"},to_anchor:1e4},km2:{name:{singular:"Square Kilometer",plural:"Square Kilometers"},to_anchor:1e6}},J={in2:{name:{singular:"Square Inch",plural:"Square Inches"},to_anchor:1/144},yd2:{name:{singular:"Square Yard",plural:"Square Yards"},to_anchor:9},ft2:{name:{singular:"Square Foot",plural:"Square Feet"},to_anchor:1},ac:{name:{singular:"Acre",plural:"Acres"},to_anchor:43560},mi2:{name:{singular:"Square Mile",plural:"Square Miles"},to_anchor:27878400}},area$1={metric:lV,imperial:J,_anchors:{metric:{unit:"m2",ratio:10.7639},imperial:{unit:"ft2",ratio:1/10.7639}}},area$1}var mass,hasRequiredMass;function requireMass(){if(hasRequiredMass)return mass;hasRequiredMass=1;var lV,J;return lV={mcg:{name:{singular:"Microgram",plural:"Micrograms"},to_anchor:1/1e6},mg:{name:{singular:"Milligram",plural:"Milligrams"},to_anchor:1/1e3},g:{name:{singular:"Gram",plural:"Grams"},to_anchor:1},kg:{name:{singular:"Kilogram",plural:"Kilograms"},to_anchor:1e3},mt:{name:{singular:"Metric Tonne",plural:"Metric Tonnes"},to_anchor:1e6}},J={oz:{name:{singular:"Ounce",plural:"Ounces"},to_anchor:1/16},lb:{name:{singular:"Pound",plural:"Pounds"},to_anchor:1},t:{name:{singular:"Ton",plural:"Tons"},to_anchor:2e3}},mass={metric:lV,imperial:J,_anchors:{metric:{unit:"g",ratio:1/453.592},imperial:{unit:"lb",ratio:453.592}}},mass}var volume,hasRequiredVolume$1;function requireVolume$1(){if(hasRequiredVolume$1)return volume;hasRequiredVolume$1=1;var lV,J;return lV={mm3:{name:{singular:"Cubic Millimeter",plural:"Cubic Millimeters"},to_anchor:1/1e6},cm3:{name:{singular:"Cubic Centimeter",plural:"Cubic Centimeters"},to_anchor:1/1e3},ml:{name:{singular:"Millilitre",plural:"Millilitres"},to_anchor:1/1e3},cl:{name:{singular:"Centilitre",plural:"Centilitres"},to_anchor:1/100},dl:{name:{singular:"Decilitre",plural:"Decilitres"},to_anchor:1/10},l:{name:{singular:"Litre",plural:"Litres"},to_anchor:1},kl:{name:{singular:"Kilolitre",plural:"Kilolitres"},to_anchor:1e3},m3:{name:{singular:"Cubic meter",plural:"Cubic meters"},to_anchor:1e3},km3:{name:{singular:"Cubic kilometer",plural:"Cubic kilometers"},to_anchor:1e12},krm:{name:{singular:"Matsked",plural:"Matskedar"},to_anchor:1/1e3},tsk:{name:{singular:"Tesked",plural:"Teskedar"},to_anchor:5/1e3},msk:{name:{singular:"Matsked",plural:"Matskedar"},to_anchor:15/1e3},kkp:{name:{singular:"Kaffekopp",plural:"Kaffekoppar"},to_anchor:150/1e3},glas:{name:{singular:"Glas",plural:"Glas"},to_anchor:200/1e3},kanna:{name:{singular:"Kanna",plural:"Kannor"},to_anchor:2.617}},J={tsp:{name:{singular:"Teaspoon",plural:"Teaspoons"},to_anchor:1/6},Tbs:{name:{singular:"Tablespoon",plural:"Tablespoons"},to_anchor:1/2},in3:{name:{singular:"Cubic inch",plural:"Cubic inches"},to_anchor:.55411},"fl-oz":{name:{singular:"Fluid Ounce",plural:"Fluid Ounces"},to_anchor:1},cup:{name:{singular:"Cup",plural:"Cups"},to_anchor:8},pnt:{name:{singular:"Pint",plural:"Pints"},to_anchor:16},qt:{name:{singular:"Quart",plural:"Quarts"},to_anchor:32},gal:{name:{singular:"Gallon",plural:"Gallons"},to_anchor:128},ft3:{name:{singular:"Cubic foot",plural:"Cubic feet"},to_anchor:957.506},yd3:{name:{singular:"Cubic yard",plural:"Cubic yards"},to_anchor:25852.7}},volume={metric:lV,imperial:J,_anchors:{metric:{unit:"l",ratio:33.8140226},imperial:{unit:"fl-oz",ratio:1/33.8140226}}},volume}var each$1,hasRequiredEach;function requireEach(){if(hasRequiredEach)return each$1;hasRequiredEach=1;var lV;return lV={ea:{name:{singular:"Each",plural:"Each"},to_anchor:1},dz:{name:{singular:"Dozen",plural:"Dozens"},to_anchor:12}},each$1={metric:lV,imperial:{},_anchors:{metric:{unit:"ea",ratio:1}}},each$1}var temperature,hasRequiredTemperature;function requireTemperature(){if(hasRequiredTemperature)return temperature;hasRequiredTemperature=1;var lV,J;return lV={C:{name:{singular:"degree Celsius",plural:"degrees Celsius"},to_anchor:1,anchor_shift:0},K:{name:{singular:"degree Kelvin",plural:"degrees Kelvin"},to_anchor:1,anchor_shift:273.15}},J={F:{name:{singular:"degree Fahrenheit",plural:"degrees Fahrenheit"},to_anchor:1},R:{name:{singular:"degree Rankine",plural:"degrees Rankine"},to_anchor:1,anchor_shift:459.67}},temperature={metric:lV,imperial:J,_anchors:{metric:{unit:"C",transform:function(VV){return VV/(5/9)+32}},imperial:{unit:"F",transform:function(VV){return(VV-32)*(5/9)}}}},temperature}var time_1,hasRequiredTime;function requireTime(){if(hasRequiredTime)return time_1;hasRequiredTime=1;var lV,J=365.25;return lV={ns:{name:{singular:"Nanosecond",plural:"Nanoseconds"},to_anchor:1/1e9},mu:{name:{singular:"Microsecond",plural:"Microseconds"},to_anchor:1/1e6},ms:{name:{singular:"Millisecond",plural:"Milliseconds"},to_anchor:1/1e3},s:{name:{singular:"Second",plural:"Seconds"},to_anchor:1},min:{name:{singular:"Minute",plural:"Minutes"},to_anchor:60},h:{name:{singular:"Hour",plural:"Hours"},to_anchor:60*60},d:{name:{singular:"Day",plural:"Days"},to_anchor:60*60*24},week:{name:{singular:"Week",plural:"Weeks"},to_anchor:60*60*24*7},month:{name:{singular:"Month",plural:"Months"},to_anchor:60*60*24*J/12},year:{name:{singular:"Year",plural:"Years"},to_anchor:60*60*24*J}},time_1={metric:lV,_anchors:{metric:{unit:"s",ratio:1}}},time_1}var digital,hasRequiredDigital;function requireDigital(){if(hasRequiredDigital)return digital;hasRequiredDigital=1;var lV,J;return lV={b:{name:{singular:"Bit",plural:"Bits"},to_anchor:1},Kb:{name:{singular:"Kilobit",plural:"Kilobits"},to_anchor:1024},Mb:{name:{singular:"Megabit",plural:"Megabits"},to_anchor:1048576},Gb:{name:{singular:"Gigabit",plural:"Gigabits"},to_anchor:1073741824},Tb:{name:{singular:"Terabit",plural:"Terabits"},to_anchor:1099511627776}},J={B:{name:{singular:"Byte",plural:"Bytes"},to_anchor:1},KB:{name:{singular:"Kilobyte",plural:"Kilobytes"},to_anchor:1024},MB:{name:{singular:"Megabyte",plural:"Megabytes"},to_anchor:1048576},GB:{name:{singular:"Gigabyte",plural:"Gigabytes"},to_anchor:1073741824},TB:{name:{singular:"Terabyte",plural:"Terabytes"},to_anchor:1099511627776}},digital={bits:lV,bytes:J,_anchors:{bits:{unit:"b",ratio:1/8},bytes:{unit:"B",ratio:8}}},digital}var partsPer,hasRequiredPartsPer;function requirePartsPer(){if(hasRequiredPartsPer)return partsPer;hasRequiredPartsPer=1;var lV;return lV={ppm:{name:{singular:"Part-per Million",plural:"Parts-per Million"},to_anchor:1},ppb:{name:{singular:"Part-per Billion",plural:"Parts-per Billion"},to_anchor:.001},ppt:{name:{singular:"Part-per Trillion",plural:"Parts-per Trillion"},to_anchor:1e-6},ppq:{name:{singular:"Part-per Quadrillion",plural:"Parts-per Quadrillion"},to_anchor:1e-9}},partsPer={metric:lV,imperial:{},_anchors:{metric:{unit:"ppm",ratio:1e-6}}},partsPer}var speed,hasRequiredSpeed;function requireSpeed(){if(hasRequiredSpeed)return speed;hasRequiredSpeed=1;var lV,J;return lV={"m/s":{name:{singular:"Metre per second",plural:"Metres per second"},to_anchor:3.6},"km/h":{name:{singular:"Kilometre per hour",plural:"Kilometres per hour"},to_anchor:1}},J={"m/h":{name:{singular:"Mile per hour",plural:"Miles per hour"},to_anchor:1},knot:{name:{singular:"Knot",plural:"Knots"},to_anchor:1.150779},"ft/s":{name:{singular:"Foot per second",plural:"Feet per second"},to_anchor:.681818}},speed={metric:lV,imperial:J,_anchors:{metric:{unit:"km/h",ratio:1/1.609344},imperial:{unit:"m/h",ratio:1.609344}}},speed}var pace,hasRequiredPace;function requirePace(){if(hasRequiredPace)return pace;hasRequiredPace=1;var lV,J;return lV={"min/km":{name:{singular:"Minute per kilometre",plural:"Minutes per kilometre"},to_anchor:.06},"s/m":{name:{singular:"Second per metre",plural:"Seconds per metre"},to_anchor:1}},J={"min/mi":{name:{singular:"Minute per mile",plural:"Minutes per mile"},to_anchor:.0113636},"s/ft":{name:{singular:"Second per foot",plural:"Seconds per foot"},to_anchor:1}},pace={metric:lV,imperial:J,_anchors:{metric:{unit:"s/m",ratio:.3048},imperial:{unit:"s/ft",ratio:1/.3048}}},pace}var pressure,hasRequiredPressure;function requirePressure(){if(hasRequiredPressure)return pressure;hasRequiredPressure=1;var lV,J;return lV={Pa:{name:{singular:"pascal",plural:"pascals"},to_anchor:1/1e3},kPa:{name:{singular:"kilopascal",plural:"kilopascals"},to_anchor:1},MPa:{name:{singular:"megapascal",plural:"megapascals"},to_anchor:1e3},hPa:{name:{singular:"hectopascal",plural:"hectopascals"},to_anchor:1/10},bar:{name:{singular:"bar",plural:"bar"},to_anchor:100},torr:{name:{singular:"torr",plural:"torr"},to_anchor:101325/76e4}},J={psi:{name:{singular:"pound per square inch",plural:"pounds per square inch"},to_anchor:1/1e3},ksi:{name:{singular:"kilopound per square inch",plural:"kilopound per square inch"},to_anchor:1}},pressure={metric:lV,imperial:J,_anchors:{metric:{unit:"kPa",ratio:.00014503768078},imperial:{unit:"psi",ratio:1/.00014503768078}}},pressure}var current_1,hasRequiredCurrent;function requireCurrent(){if(hasRequiredCurrent)return current_1;hasRequiredCurrent=1;var lV;return lV={A:{name:{singular:"Ampere",plural:"Amperes"},to_anchor:1},mA:{name:{singular:"Milliampere",plural:"Milliamperes"},to_anchor:.001},kA:{name:{singular:"Kiloampere",plural:"Kiloamperes"},to_anchor:1e3}},current_1={metric:lV,_anchors:{metric:{unit:"A",ratio:1}}},current_1}var voltage_1,hasRequiredVoltage;function requireVoltage(){if(hasRequiredVoltage)return voltage_1;hasRequiredVoltage=1;var lV;return lV={V:{name:{singular:"Volt",plural:"Volts"},to_anchor:1},mV:{name:{singular:"Millivolt",plural:"Millivolts"},to_anchor:.001},kV:{name:{singular:"Kilovolt",plural:"Kilovolts"},to_anchor:1e3}},voltage_1={metric:lV,_anchors:{metric:{unit:"V",ratio:1}}},voltage_1}var power_1,hasRequiredPower;function requirePower(){if(hasRequiredPower)return power_1;hasRequiredPower=1;var lV;return lV={W:{name:{singular:"Watt",plural:"Watts"},to_anchor:1},mW:{name:{singular:"Milliwatt",plural:"Milliwatts"},to_anchor:.001},kW:{name:{singular:"Kilowatt",plural:"Kilowatts"},to_anchor:1e3},MW:{name:{singular:"Megawatt",plural:"Megawatts"},to_anchor:1e6},GW:{name:{singular:"Gigawatt",plural:"Gigawatts"},to_anchor:1e9}},power_1={metric:lV,_anchors:{metric:{unit:"W",ratio:1}}},power_1}var reactivePower_1,hasRequiredReactivePower;function requireReactivePower(){if(hasRequiredReactivePower)return reactivePower_1;hasRequiredReactivePower=1;var lV;return lV={VAR:{name:{singular:"Volt-Ampere Reactive",plural:"Volt-Amperes Reactive"},to_anchor:1},mVAR:{name:{singular:"Millivolt-Ampere Reactive",plural:"Millivolt-Amperes Reactive"},to_anchor:.001},kVAR:{name:{singular:"Kilovolt-Ampere Reactive",plural:"Kilovolt-Amperes Reactive"},to_anchor:1e3},MVAR:{name:{singular:"Megavolt-Ampere Reactive",plural:"Megavolt-Amperes Reactive"},to_anchor:1e6},GVAR:{name:{singular:"Gigavolt-Ampere Reactive",plural:"Gigavolt-Amperes Reactive"},to_anchor:1e9}},reactivePower_1={metric:lV,_anchors:{metric:{unit:"VAR",ratio:1}}},reactivePower_1}var apparentPower_1,hasRequiredApparentPower;function requireApparentPower(){if(hasRequiredApparentPower)return apparentPower_1;hasRequiredApparentPower=1;var lV;return lV={VA:{name:{singular:"Volt-Ampere",plural:"Volt-Amperes"},to_anchor:1},mVA:{name:{singular:"Millivolt-Ampere",plural:"Millivolt-Amperes"},to_anchor:.001},kVA:{name:{singular:"Kilovolt-Ampere",plural:"Kilovolt-Amperes"},to_anchor:1e3},MVA:{name:{singular:"Megavolt-Ampere",plural:"Megavolt-Amperes"},to_anchor:1e6},GVA:{name:{singular:"Gigavolt-Ampere",plural:"Gigavolt-Amperes"},to_anchor:1e9}},apparentPower_1={metric:lV,_anchors:{metric:{unit:"VA",ratio:1}}},apparentPower_1}var energy_1,hasRequiredEnergy;function requireEnergy(){if(hasRequiredEnergy)return energy_1;hasRequiredEnergy=1;var lV;return lV={Wh:{name:{singular:"Watt-hour",plural:"Watt-hours"},to_anchor:3600},mWh:{name:{singular:"Milliwatt-hour",plural:"Milliwatt-hours"},to_anchor:3.6},kWh:{name:{singular:"Kilowatt-hour",plural:"Kilowatt-hours"},to_anchor:36e5},MWh:{name:{singular:"Megawatt-hour",plural:"Megawatt-hours"},to_anchor:36e8},GWh:{name:{singular:"Gigawatt-hour",plural:"Gigawatt-hours"},to_anchor:36e11},J:{name:{singular:"Joule",plural:"Joules"},to_anchor:1},kJ:{name:{singular:"Kilojoule",plural:"Kilojoules"},to_anchor:1e3}},energy_1={metric:lV,_anchors:{metric:{unit:"J",ratio:1}}},energy_1}var reactiveEnergy_1,hasRequiredReactiveEnergy;function requireReactiveEnergy(){if(hasRequiredReactiveEnergy)return reactiveEnergy_1;hasRequiredReactiveEnergy=1;var lV;return lV={VARh:{name:{singular:"Volt-Ampere Reactive Hour",plural:"Volt-Amperes Reactive Hour"},to_anchor:1},mVARh:{name:{singular:"Millivolt-Ampere Reactive Hour",plural:"Millivolt-Amperes Reactive Hour"},to_anchor:.001},kVARh:{name:{singular:"Kilovolt-Ampere Reactive Hour",plural:"Kilovolt-Amperes Reactive Hour"},to_anchor:1e3},MVARh:{name:{singular:"Megavolt-Ampere Reactive Hour",plural:"Megavolt-Amperes Reactive Hour"},to_anchor:1e6},GVARh:{name:{singular:"Gigavolt-Ampere Reactive Hour",plural:"Gigavolt-Amperes Reactive Hour"},to_anchor:1e9}},reactiveEnergy_1={metric:lV,_anchors:{metric:{unit:"VARh",ratio:1}}},reactiveEnergy_1}var volumeFlowRate,hasRequiredVolumeFlowRate;function requireVolumeFlowRate(){if(hasRequiredVolumeFlowRate)return volumeFlowRate;hasRequiredVolumeFlowRate=1;var lV,J;return lV={"mm3/s":{name:{singular:"Cubic Millimeter per second",plural:"Cubic Millimeters per second"},to_anchor:1/1e6},"cm3/s":{name:{singular:"Cubic Centimeter per second",plural:"Cubic Centimeters per second"},to_anchor:1/1e3},"ml/s":{name:{singular:"Millilitre per second",plural:"Millilitres per second"},to_anchor:1/1e3},"cl/s":{name:{singular:"Centilitre per second",plural:"Centilitres per second"},to_anchor:1/100},"dl/s":{name:{singular:"Decilitre per second",plural:"Decilitres per second"},to_anchor:1/10},"l/s":{name:{singular:"Litre per second",plural:"Litres per second"},to_anchor:1},"l/min":{name:{singular:"Litre per minute",plural:"Litres per minute"},to_anchor:1/60},"l/h":{name:{singular:"Litre per hour",plural:"Litres per hour"},to_anchor:1/3600},"kl/s":{name:{singular:"Kilolitre per second",plural:"Kilolitres per second"},to_anchor:1e3},"kl/min":{name:{singular:"Kilolitre per minute",plural:"Kilolitres per minute"},to_anchor:50/3},"kl/h":{name:{singular:"Kilolitre per hour",plural:"Kilolitres per hour"},to_anchor:5/18},"m3/s":{name:{singular:"Cubic meter per second",plural:"Cubic meters per second"},to_anchor:1e3},"m3/min":{name:{singular:"Cubic meter per minute",plural:"Cubic meters per minute"},to_anchor:50/3},"m3/h":{name:{singular:"Cubic meter per hour",plural:"Cubic meters per hour"},to_anchor:5/18},"km3/s":{name:{singular:"Cubic kilometer per second",plural:"Cubic kilometers per second"},to_anchor:1e12}},J={"tsp/s":{name:{singular:"Teaspoon per second",plural:"Teaspoons per second"},to_anchor:1/6},"Tbs/s":{name:{singular:"Tablespoon per second",plural:"Tablespoons per second"},to_anchor:1/2},"in3/s":{name:{singular:"Cubic inch per second",plural:"Cubic inches per second"},to_anchor:.55411},"in3/min":{name:{singular:"Cubic inch per minute",plural:"Cubic inches per minute"},to_anchor:.55411/60},"in3/h":{name:{singular:"Cubic inch per hour",plural:"Cubic inches per hour"},to_anchor:.55411/3600},"fl-oz/s":{name:{singular:"Fluid Ounce per second",plural:"Fluid Ounces per second"},to_anchor:1},"fl-oz/min":{name:{singular:"Fluid Ounce per minute",plural:"Fluid Ounces per minute"},to_anchor:1/60},"fl-oz/h":{name:{singular:"Fluid Ounce per hour",plural:"Fluid Ounces per hour"},to_anchor:1/3600},"cup/s":{name:{singular:"Cup per second",plural:"Cups per second"},to_anchor:8},"pnt/s":{name:{singular:"Pint per second",plural:"Pints per second"},to_anchor:16},"pnt/min":{name:{singular:"Pint per minute",plural:"Pints per minute"},to_anchor:4/15},"pnt/h":{name:{singular:"Pint per hour",plural:"Pints per hour"},to_anchor:1/225},"qt/s":{name:{singular:"Quart per second",plural:"Quarts per second"},to_anchor:32},"gal/s":{name:{singular:"Gallon per second",plural:"Gallons per second"},to_anchor:128},"gal/min":{name:{singular:"Gallon per minute",plural:"Gallons per minute"},to_anchor:32/15},"gal/h":{name:{singular:"Gallon per hour",plural:"Gallons per hour"},to_anchor:8/225},"ft3/s":{name:{singular:"Cubic foot per second",plural:"Cubic feet per second"},to_anchor:957.506},"ft3/min":{name:{singular:"Cubic foot per minute",plural:"Cubic feet per minute"},to_anchor:957.506/60},"ft3/h":{name:{singular:"Cubic foot per hour",plural:"Cubic feet per hour"},to_anchor:957.506/3600},"yd3/s":{name:{singular:"Cubic yard per second",plural:"Cubic yards per second"},to_anchor:25852.7},"yd3/min":{name:{singular:"Cubic yard per minute",plural:"Cubic yards per minute"},to_anchor:25852.7/60},"yd3/h":{name:{singular:"Cubic yard per hour",plural:"Cubic yards per hour"},to_anchor:25852.7/3600}},volumeFlowRate={metric:lV,imperial:J,_anchors:{metric:{unit:"l/s",ratio:33.8140227},imperial:{unit:"fl-oz/s",ratio:1/33.8140227}}},volumeFlowRate}var illuminance,hasRequiredIlluminance;function requireIlluminance(){if(hasRequiredIlluminance)return illuminance;hasRequiredIlluminance=1;var lV,J;return lV={lx:{name:{singular:"Lux",plural:"Lux"},to_anchor:1}},J={"ft-cd":{name:{singular:"Foot-candle",plural:"Foot-candles"},to_anchor:1}},illuminance={metric:lV,imperial:J,_anchors:{metric:{unit:"lx",ratio:1/10.76391},imperial:{unit:"ft-cd",ratio:10.76391}}},illuminance}var frequency_1,hasRequiredFrequency;function requireFrequency(){if(hasRequiredFrequency)return frequency_1;hasRequiredFrequency=1;var lV;return lV={mHz:{name:{singular:"millihertz",plural:"millihertz"},to_anchor:1/1e3},Hz:{name:{singular:"hertz",plural:"hertz"},to_anchor:1},kHz:{name:{singular:"kilohertz",plural:"kilohertz"},to_anchor:1e3},MHz:{name:{singular:"megahertz",plural:"megahertz"},to_anchor:1e3*1e3},GHz:{name:{singular:"gigahertz",plural:"gigahertz"},to_anchor:1e3*1e3*1e3},THz:{name:{singular:"terahertz",plural:"terahertz"},to_anchor:1e3*1e3*1e3*1e3},rpm:{name:{singular:"rotation per minute",plural:"rotations per minute"},to_anchor:1/60},"deg/s":{name:{singular:"degree per second",plural:"degrees per second"},to_anchor:1/360},"rad/s":{name:{singular:"radian per second",plural:"radians per second"},to_anchor:1/(Math.PI*2)}},frequency_1={metric:lV,_anchors:{frequency:{unit:"hz",ratio:1}}},frequency_1}var angle_1$1,hasRequiredAngle$2;function requireAngle$2(){if(hasRequiredAngle$2)return angle_1$1;hasRequiredAngle$2=1;var lV;return lV={rad:{name:{singular:"radian",plural:"radians"},to_anchor:180/Math.PI},deg:{name:{singular:"degree",plural:"degrees"},to_anchor:1},grad:{name:{singular:"gradian",plural:"gradians"},to_anchor:9/10},arcmin:{name:{singular:"arcminute",plural:"arcminutes"},to_anchor:1/60},arcsec:{name:{singular:"arcsecond",plural:"arcseconds"},to_anchor:1/3600}},angle_1$1={metric:lV,_anchors:{metric:{unit:"deg",ratio:1}}},angle_1$1}var lib$1,hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var lV,J=requireLodash_keys(),VV=requireLodash_foreach(),RV={length:requireLength$3(),area:requireArea$1(),mass:requireMass(),volume:requireVolume$1(),each:requireEach(),temperature:requireTemperature(),time:requireTime(),digital:requireDigital(),partsPer:requirePartsPer(),speed:requireSpeed(),pace:requirePace(),pressure:requirePressure(),current:requireCurrent(),voltage:requireVoltage(),power:requirePower(),reactivePower:requireReactivePower(),apparentPower:requireApparentPower(),energy:requireEnergy(),reactiveEnergy:requireReactiveEnergy(),volumeFlowRate:requireVolumeFlowRate(),illuminance:requireIlluminance(),frequency:requireFrequency(),angle:requireAngle$2()},UV;UV=function(WV,IV){IV?this.val=WV/IV:this.val=WV},UV.prototype.from=function(WV){if(this.destination)throw new Error(".from must be called before .to");return this.origin=this.getUnit(WV),this.origin||this.throwUnsupportedUnitError(WV),this},UV.prototype.to=function(WV){if(!this.origin)throw new Error(".to must be called after .from");this.destination=this.getUnit(WV);var IV,dV;if(this.destination||this.throwUnsupportedUnitError(WV),this.origin.abbr===this.destination.abbr)return this.val;if(this.destination.measure!=this.origin.measure)throw new Error("Cannot convert incompatible measures of "+this.destination.measure+" and "+this.origin.measure);return IV=this.val*this.origin.unit.to_anchor,this.origin.unit.anchor_shift&&(IV-=this.origin.unit.anchor_shift),this.origin.system!=this.destination.system&&(dV=RV[this.origin.measure]._anchors[this.origin.system].transform,typeof dV=="function"?IV=dV(IV):IV*=RV[this.origin.measure]._anchors[this.origin.system].ratio),this.destination.unit.anchor_shift&&(IV+=this.destination.unit.anchor_shift),IV/this.destination.unit.to_anchor},UV.prototype.toBest=function(IV){if(!this.origin)throw new Error(".toBest must be called after .from");var IV=Object.assign({exclude:[],cutOffNumber:1},IV),dV;return VV(this.possibilities(),(function(CV){var FV=this.describe(CV),NV=IV.exclude.indexOf(CV)===-1;if(NV&&FV.system===this.origin.system){var eV=this.to(CV);(!dV||eV>=IV.cutOffNumber&&eV<dV.val)&&(dV={val:eV,unit:CV,singular:FV.singular,plural:FV.plural})}}).bind(this)),dV},UV.prototype.getUnit=function(WV){var IV;return VV(RV,function(dV,CV){if(VV(dV,function(FV,NV){if(NV=="_anchors"||(VV(FV,function(eV,gV){if(gV==WV)return IV={abbr:WV,measure:CV,system:NV,unit:eV},!1}),IV))return!1}),IV)return!1}),IV};var ZV=function(WV){return{abbr:WV.abbr,measure:WV.measure,system:WV.system,singular:WV.unit.name.singular,plural:WV.unit.name.plural}};return UV.prototype.describe=function(WV){var IV=UV.prototype.getUnit(WV),dV=null;try{dV=ZV(IV)}catch{this.throwUnsupportedUnitError(WV)}return dV},UV.prototype.list=function(WV){var IV=[];return VV(RV,function(dV,CV){WV&&WV!==CV||VV(dV,function(FV,NV){if(NV=="_anchors")return!1;VV(FV,function(eV,gV){IV=IV.concat(ZV({abbr:gV,measure:CV,system:NV,unit:eV}))})})}),IV},UV.prototype.throwUnsupportedUnitError=function(WV){var IV=[];throw VV(RV,function(dV,CV){VV(dV,function(FV,NV){if(NV=="_anchors")return!1;IV=IV.concat(J(FV))})}),new Error("Unsupported unit "+WV+", use one of: "+IV.join(", "))},UV.prototype.possibilities=function(WV){var IV=[];return!this.origin&&!WV?VV(J(RV),function(dV){VV(RV[dV],function(CV,FV){if(FV=="_anchors")return!1;IV=IV.concat(J(CV))})}):(WV=WV||this.origin.measure,VV(RV[WV],function(dV,CV){if(CV=="_anchors")return!1;IV=IV.concat(J(dV))})),IV},UV.prototype.measures=function(){return J(RV)},lV=function(WV){return new UV(WV)},lib$1=lV,lib$1}const urlAlphabet$1="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let random=lV=>crypto.getRandomValues(new Uint8Array(lV)),customRandom=(lV,J,VV)=>{let RV=(2<<Math.log2(lV.length-1))-1,UV=-~(1.6*RV*J/lV.length);return(ZV=J)=>{let WV="";for(;;){let IV=VV(UV),dV=UV|0;for(;dV--;)if(WV+=lV[IV[dV]&RV]||"",WV.length>=ZV)return WV}}},customAlphabet=(lV,J=21)=>customRandom(lV,J|0,random),nanoid$2=(lV=21)=>{let J="",VV=crypto.getRandomValues(new Uint8Array(lV|=0));for(;lV--;)J+=urlAlphabet$1[VV[lV]&63];return J};const index_browser=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet,customRandom,nanoid:nanoid$2,random,urlAlphabet:urlAlphabet$1},Symbol.toStringTag,{value:"Module"})),require$$2$2=getAugmentedNamespace(index_browser);var dist$a,hasRequiredDist$7;function requireDist$7(){if(hasRequiredDist$7)return dist$a;hasRequiredDist$7=1;var lV=Object.create,J=Object.defineProperty,VV=Object.getOwnPropertyDescriptor,RV=Object.getOwnPropertyNames,UV=Object.getPrototypeOf,ZV=Object.prototype.hasOwnProperty,WV=(KZ,XI)=>{for(var DW in XI)J(KZ,DW,{get:XI[DW],enumerable:!0})},IV=(KZ,XI,DW,yI)=>{if(XI&&typeof XI=="object"||typeof XI=="function")for(let CI of RV(XI))!ZV.call(KZ,CI)&&CI!==DW&&J(KZ,CI,{get:()=>XI[CI],enumerable:!(yI=VV(XI,CI))||yI.enumerable});return KZ},dV=(KZ,XI,DW)=>(DW=KZ!=null?lV(UV(KZ)):{},IV(!KZ||!KZ.__esModule?J(DW,"default",{value:KZ,enumerable:!0}):DW,KZ)),CV=KZ=>IV(J({},"__esModule",{value:!0}),KZ),FV={};WV(FV,{all_layers:()=>iW,any_circuit_element:()=>vU,any_soup_element:()=>TW,any_source_component:()=>mR,cad_component:()=>DU,capacitance:()=>tV,current:()=>xV,distance:()=>MV,inductance:()=>kV,layer_ref:()=>KW,layer_string:()=>_W,length:()=>XV,pcb_board:()=>_Z,pcb_component:()=>BU,pcb_fabrication_note_path:()=>nI,pcb_fabrication_note_text:()=>pW,pcb_hole:()=>_l,pcb_keepout:()=>jU,pcb_placement_error:()=>sZ,pcb_plated_hole:()=>yR,pcb_port:()=>uU,pcb_port_not_matched_error:()=>YU,pcb_route_hint:()=>JW,pcb_route_hints:()=>cW,pcb_silkscreen_circle:()=>DZ,pcb_silkscreen_line:()=>RW,pcb_silkscreen_oval:()=>bW,pcb_silkscreen_path:()=>gI,pcb_silkscreen_rect:()=>lZ,pcb_silkscreen_text:()=>aU,pcb_smtpad:()=>PU,pcb_text:()=>QZ,pcb_trace:()=>dW,pcb_trace_error:()=>YZ,pcb_trace_hint:()=>wZ,pcb_via:()=>ZZ,point:()=>yV,point3:()=>al,position:()=>ll,position3:()=>el,resistance:()=>YV,rotation:()=>wV,route_hint_point:()=>CZ,schematic_box:()=>vl,schematic_component:()=>RU,schematic_error:()=>hW,schematic_line:()=>FR,schematic_net_label:()=>MW,schematic_path:()=>iR,schematic_pin_styles:()=>PR,schematic_port:()=>OZ,schematic_text:()=>MZ,schematic_trace:()=>NU,size:()=>fV,source_component_base:()=>Bl,source_group:()=>KR,source_led:()=>tR,source_net:()=>eU,source_port:()=>XR,source_simple_bug:()=>Ol,source_simple_capacitor:()=>kl,source_simple_chip:()=>hR,source_simple_diode:()=>Pl,source_simple_ground:()=>Tl,source_simple_power_source:()=>MR,source_simple_resistor:()=>xl,source_trace:()=>sU,supplier_name:()=>Il,time:()=>uV,visible_layer:()=>hZ,voltage:()=>AV}),dist$a=CV(FV);var NV=dV(requireLib$1()),eV={tera:1e13,T:1e13,giga:1e10,G:1e10,mega:1e7,M:1e7,kilo:1e4,k:1e4,deci:1,d:1,centi:.1,c:.1,milli:.01,m:.01,micro:1e-5,u:1e-5,µ:1e-5,nano:1e-8,n:1e-8,pico:1e-11,p:1e-11},gV=Object.keys(eV),nV={mass:"g",length:"mm",time:"ms",volume:"ml",angle:"deg"};function JV(KZ){for(const XI of gV)if(KZ.startsWith(XI))return eV[XI];return 1}var aV=KZ=>{var FI,rd;if(typeof KZ>"u")return{unit:null,value:null};if(typeof KZ=="string"&&KZ.match(/^[\d\.]+$/))return{value:parseFloat(KZ),unit:null};if(typeof KZ=="number")return{value:KZ,unit:null};if(typeof KZ=="object"&&"x"in KZ&&"y"in KZ)return{unit:aV(KZ.x).unit,value:{x:aV(KZ.x).value,y:aV(KZ.y).value}};const XI=(FI=KZ.split("").reverse().join("").match(/[a-zA-Z]+/))==null?void 0:FI[0];if(!XI)throw new Error(`Could not determine unit: "${KZ}"`);const DW=XI.split("").reverse().join(""),yI=KZ.slice(0,-DW.length);let CI;try{CI=(rd=(0,NV.default)().describe(DW))==null?void 0:rd.measure}catch{}if(CI){const Nd=nV[CI];if(!Nd)throw new Error(`Could not determine target unit for measure: "${CI}"`);return{unit:DW,value:(0,NV.default)(parseFloat(yI)).from(DW).to(Nd)}}else return{unit:DW,value:JV(DW)*parseFloat(yI)}},GV=requireLib$2(),YV=GV.z.string().or(GV.z.number()).transform(KZ=>aV(KZ).value),tV=GV.z.string().or(GV.z.number()).transform(KZ=>aV(KZ).value),kV=GV.z.string().or(GV.z.number()).transform(KZ=>aV(KZ).value),AV=GV.z.string().or(GV.z.number()).transform(KZ=>aV(KZ).value),XV=GV.z.string().or(GV.z.number()).transform(KZ=>aV(KZ).value),MV=XV,xV=GV.z.string().or(GV.z.number()).transform(KZ=>aV(KZ).value),uV=GV.z.string().or(GV.z.number()).transform(KZ=>aV(KZ).value),wV=GV.z.string().or(GV.z.number()).transform(KZ=>typeof KZ=="number"?KZ:KZ.endsWith("deg")?Number.parseFloat(KZ.split("deg")[0]):KZ.endsWith("rad")?Number.parseFloat(KZ.split("rad")[0])*180/Math.PI:Number.parseFloat(KZ)),vV=requireLib$2(),yV=vV.z.object({x:MV,y:MV}),ll=yV,Nl=requireLib$2(),al=Nl.z.object({x:MV,y:MV,z:MV}),el=al,qV=requireLib$2(),fV=qV.z.object({width:qV.z.number(),height:qV.z.number()}),Ul=requireLib$2(),Cl=requireLib$2(),Il=Cl.z.enum(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),Jl=requireLib$2(),Bl=Jl.z.object({type:Jl.z.literal("source_component"),ftype:Jl.z.string().optional(),source_component_id:Jl.z.string(),name:Jl.z.string(),manufacturer_part_number:Jl.z.string().optional(),supplier_part_numbers:Jl.z.record(Il,Jl.z.array(Jl.z.string())).optional()}),kl=Bl.extend({ftype:Ul.z.literal("simple_capacitor"),capacitance:tV}),ol=requireLib$2(),xl=Bl.extend({ftype:ol.z.literal("simple_resistor"),resistance:YV}),wl=requireLib$2(),Pl=Bl.extend({ftype:wl.z.literal("simple_diode")}),zl=requireLib$2(),Tl=Bl.extend({ftype:zl.z.literal("simple_ground")}),Al=requireLib$2(),Ol=Bl.extend({ftype:Al.z.literal("simple_bug")}).describe("@deprecated"),RR=requireLib$2(),hR=Bl.extend({ftype:RR.z.literal("simple_chip")}),gR=requireLib$2();Bl.extend({ftype:gR.z.literal("simple_inductor"),inductance:kV});var sR=requireLib$2(),tR=Pl.extend({ftype:sR.z.literal("led")}),pR=requireLib$2(),MR=Bl.extend({ftype:pR.z.literal("simple_power_source"),voltage:AV}),cR=requireLib$2(),mR=cR.z.union([xl,kl,Pl,Tl,hR,Ol,tR,MR]),zR=requireLib$2(),XR=zR.z.object({type:zR.z.literal("source_port"),pin_number:zR.z.number().optional(),port_hints:zR.z.array(zR.z.string()).optional(),name:zR.z.string(),source_port_id:zR.z.string(),source_component_id:zR.z.string()}),ZU=requireLib$2(),sU=ZU.z.object({type:ZU.z.literal("source_trace"),source_trace_id:ZU.z.string(),connected_source_port_ids:ZU.z.array(ZU.z.string()),connected_source_net_ids:ZU.z.array(ZU.z.string())}),rU=requireLib$2(),KR=rU.z.object({type:rU.z.literal("source_group"),source_group_id:rU.z.string(),name:rU.z.string().optional()}),HR=requireLib$2(),eU=HR.z.object({type:HR.z.literal("source_net"),source_net_id:HR.z.string(),name:HR.z.string(),member_source_group_ids:HR.z.array(HR.z.string()),is_power:HR.z.boolean().optional(),is_ground:HR.z.boolean().optional(),is_digital_signal:HR.z.boolean().optional(),is_analog_signal:HR.z.boolean().optional(),trace_width:HR.z.number().optional()}),BR=requireLib$2(),vl=BR.z.object({type:BR.z.literal("schematic_box"),schematic_component_id:BR.z.string(),width:MV,height:MV,x:MV,y:MV}).describe("Draws a box on the schematic"),ER=requireLib$2(),iR=ER.z.object({type:ER.z.literal("schematic_path"),schematic_component_id:ER.z.string(),fill_color:ER.z.enum(["red","blue"]).optional(),is_filled:ER.z.boolean().optional(),points:ER.z.array(yV)}),TR=requireLib$2(),PR=TR.z.record(TR.z.object({left_margin:XV.optional(),right_margin:XV.optional(),top_margin:XV.optional(),bottom_margin:XV.optional()})),RU=TR.z.object({type:TR.z.literal("schematic_component"),rotation:wV.default(0),size:fV,center:yV,source_component_id:TR.z.string(),schematic_component_id:TR.z.string(),pin_spacing:XV.optional(),pin_styles:PR.optional(),box_width:XV.optional(),symbol_name:TR.z.string().optional(),port_arrangement:TR.z.union([TR.z.object({left_size:TR.z.number(),right_size:TR.z.number(),top_size:TR.z.number().optional(),bottom_size:TR.z.number().optional()}),TR.z.object({left_side:TR.z.object({pins:TR.z.array(TR.z.number()),direction:TR.z.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:TR.z.object({pins:TR.z.array(TR.z.number()),direction:TR.z.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:TR.z.object({pins:TR.z.array(TR.z.number()),direction:TR.z.enum(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:TR.z.object({pins:TR.z.array(TR.z.number()),direction:TR.z.enum(["left-to-right","right-to-left"]).optional()}).optional()})]).optional(),port_labels:TR.z.record(TR.z.string()).optional()}),nU=requireLib$2(),FR=nU.z.object({type:nU.z.literal("schematic_line"),schematic_component_id:nU.z.string(),x1:MV,x2:MV,y1:MV,y2:MV}),dU=requireLib$2(),NU=dU.z.object({type:dU.z.literal("schematic_trace"),schematic_trace_id:dU.z.string(),source_trace_id:dU.z.string(),edges:dU.z.array(dU.z.object({from:dU.z.object({x:dU.z.number(),y:dU.z.number()}),to:dU.z.object({x:dU.z.number(),y:dU.z.number()}),from_schematic_port_id:dU.z.string().optional(),to_schematic_port_id:dU.z.string().optional()}))}),OU=requireLib$2(),MZ=OU.z.object({type:OU.z.literal("schematic_text"),schematic_component_id:OU.z.string(),schematic_text_id:OU.z.string(),text:OU.z.string(),position:OU.z.object({x:MV,y:MV}),rotation:OU.z.number().default(0),anchor:OU.z.enum(["center","left","right","top","bottom"]).default("center")}),jZ=requireLib$2(),OZ=jZ.z.object({type:jZ.z.literal("schematic_port"),schematic_port_id:jZ.z.string(),source_port_id:jZ.z.string(),schematic_component_id:jZ.z.string().optional(),center:yV,facing_direction:jZ.z.enum(["up","down","left","right"]).optional()}).describe("Defines a port on a schematic component"),oZ=requireLib$2(),MW=oZ.z.object({type:oZ.z.literal("schematic_net_label"),source_net_id:oZ.z.string(),center:yV,anchor_side:oZ.z.enum(["top","bottom","left","right"]),text:oZ.z.string()}),LU=requireLib$2(),hW=LU.z.object({schematic_error_id:LU.z.string(),type:LU.z.literal("schematic_error"),error_type:LU.z.literal("schematic_port_not_found"),message:LU.z.string()}).describe("Defines a schematic error on the schematic"),CW=requireLib$2(),iW=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6"],_W=CW.z.enum(iW),KW=_W.or(CW.z.object({name:_W})).transform(KZ=>typeof KZ=="string"?KZ:KZ.name),hZ=CW.z.enum(["top","bottom"]),nW=requireLib$2(),JW=nW.z.object({x:MV,y:MV,via:nW.z.boolean().optional(),via_to_layer:KW.optional()}),cW=nW.z.array(JW),oW=requireLib$2(),CZ=oW.z.object({x:MV,y:MV,via:oW.z.boolean().optional(),to_layer:KW.optional(),trace_width:MV.optional()}),IU=requireLib$2(),wR=requireLib$2(),JU=require$$2$2,uR=KZ=>wR.z.string().optional().default(()=>`${KZ}_${(0,JU.nanoid)(10)}`),BU=IU.z.object({type:IU.z.literal("pcb_component"),pcb_component_id:uR("pcb_component"),source_component_id:IU.z.string(),center:yV,layer:KW,rotation:wV,width:XV,height:XV}).describe("Defines a component on the PCB"),KU=requireLib$2(),_l=KU.z.object({pcb_hole_id:KU.z.string(),type:KU.z.literal("pcb_hole"),hole_shape:KU.z.enum(["circle","square","round"]).default("circle").transform(KZ=>KZ==="round"?"circle":KZ),hole_diameter:KU.z.number(),x:MV,y:MV}).or(KU.z.object({pcb_hole_id:KU.z.string(),type:KU.z.literal("pcb_hole"),hole_shape:KU.z.literal("oval"),hole_width:KU.z.number(),hole_height:KU.z.number(),x:MV,y:MV})).describe("Defines a hole on the PCB"),ql=requireLib$2(),yR=ql.z.object({type:ql.z.literal("pcb_plated_hole"),shape:ql.z.literal("circle"),outer_diameter:ql.z.number(),hole_diameter:ql.z.number(),x:MV,y:MV,layers:ql.z.array(KW),port_hints:ql.z.array(ql.z.string()).optional(),pcb_component_id:ql.z.string().optional(),pcb_port_id:ql.z.string().optional(),pcb_plated_hole_id:ql.z.string()}).or(ql.z.object({type:ql.z.literal("pcb_plated_hole"),shape:ql.z.enum(["oval","pill"]),outer_width:ql.z.number(),outer_height:ql.z.number(),hole_width:ql.z.number(),hole_height:ql.z.number(),x:MV,y:MV,layers:ql.z.array(KW),port_hints:ql.z.array(ql.z.string()).optional(),pcb_component_id:ql.z.string().optional(),pcb_port_id:ql.z.string().optional(),pcb_plated_hole_id:ql.z.string()})).describe("Defines a plated hole on the PCB"),GU=requireLib$2(),uU=GU.z.object({type:GU.z.literal("pcb_port"),pcb_port_id:GU.z.string(),source_port_id:GU.z.string(),pcb_component_id:GU.z.string(),x:MV,y:MV,layers:GU.z.array(KW)}).describe("Defines a port on the PCB"),_U=requireLib$2(),PU=_U.z.union([_U.z.object({pcb_smtpad_id:_U.z.string(),type:_U.z.literal("pcb_smtpad"),shape:_U.z.literal("circle"),x:MV,y:MV,radius:_U.z.number(),layer:KW,port_hints:_U.z.array(_U.z.string()).optional(),pcb_component_id:_U.z.string().optional(),pcb_port_id:_U.z.string().optional()}),_U.z.object({pcb_smtpad_id:_U.z.string(),type:_U.z.literal("pcb_smtpad"),shape:_U.z.literal("rect"),x:MV,y:MV,width:_U.z.number(),height:_U.z.number(),layer:KW,port_hints:_U.z.array(_U.z.string()).optional(),pcb_component_id:_U.z.string().optional(),pcb_port_id:_U.z.string().optional()})]).describe("Defines an SMT pad on the PCB"),FW=requireLib$2(),QZ=FW.z.object({type:FW.z.literal("pcb_text"),text:FW.z.string(),x:MV,y:MV,align:FW.z.enum(["bottom-left"]),width:MV,height:MV,lines:FW.z.number()}).describe("Defines text on the PCB"),HZ=requireLib$2(),dW=HZ.z.object({type:HZ.z.literal("pcb_trace"),source_trace_id:HZ.z.string().optional(),pcb_component_id:HZ.z.string().optional(),pcb_trace_id:HZ.z.string(),route_thickness_mode:HZ.z.enum(["constant","interpolated"]).default("constant").optional(),should_round_corners:HZ.z.boolean().optional(),route:HZ.z.array(HZ.z.union([HZ.z.object({route_type:HZ.z.literal("wire"),x:MV,y:MV,width:MV,start_pcb_port_id:HZ.z.string().optional(),end_pcb_port_id:HZ.z.string().optional(),layer:KW}),HZ.z.object({route_type:HZ.z.literal("via"),x:MV,y:MV,from_layer:HZ.z.string(),to_layer:HZ.z.string()})]))}),tW=requireLib$2(),YZ=tW.z.object({pcb_error_id:tW.z.string(),type:tW.z.literal("pcb_error"),error_type:tW.z.literal("pcb_trace_error"),message:tW.z.string(),center:yV.optional(),pcb_trace_id:tW.z.string(),source_trace_id:tW.z.string(),pcb_component_ids:tW.z.array(tW.z.string()),pcb_port_ids:tW.z.array(tW.z.string())}).describe("Defines a trace error on the PCB"),bR=requireLib$2(),YU=bR.z.object({pcb_error_id:bR.z.string(),type:bR.z.literal("pcb_error"),error_type:bR.z.literal("pcb_port_not_matched_error"),message:bR.z.string(),pcb_component_ids:bR.z.array(bR.z.string())}).describe("Defines a trace error on the PCB"),bU=requireLib$2(),ZZ=bU.z.object({type:bU.z.literal("pcb_via"),x:MV,y:MV,outer_diameter:MV.default("0.6mm"),hole_diameter:MV.default("0.25mm"),from_layer:KW.optional(),to_layer:KW.optional(),layers:bU.z.array(KW)}).describe("Defines a via on the PCB"),mZ=requireLib$2(),_Z=mZ.z.object({type:mZ.z.literal("pcb_board"),pcb_board_id:mZ.z.string().default("pcb_board_0").optional(),width:XV,height:XV,center:yV,outline:mZ.z.array(yV).optional()}).describe("Defines the board outline of the PCB"),YW=requireLib$2(),sZ=YW.z.object({pcb_error_id:YW.z.string(),type:YW.z.literal("pcb_error"),error_type:YW.z.literal("pcb_placement_error"),message:YW.z.string()}).describe("Defines a placement error on the PCB"),$U=requireLib$2(),wZ=$U.z.object({pcb_trace_hint_id:$U.z.string(),type:$U.z.literal("pcb_trace_hint"),pcb_port_id:$U.z.string(),pcb_component_id:$U.z.string(),route:$U.z.array(CZ.optional())}).describe("A hint that can be used to generate a PCB trace"),gW=requireLib$2(),RW=gW.z.object({type:gW.z.literal("pcb_silkscreen_line"),pcb_silkscreen_line_id:gW.z.string(),pcb_component_id:gW.z.string(),stroke_width:MV.default("0.1mm"),x1:MV,y1:MV,x2:MV,y2:MV,layer:hZ}).describe("Defines a silkscreen line on the PCB"),SW=requireLib$2(),gI=SW.z.object({type:SW.z.literal("pcb_silkscreen_path"),pcb_silkscreen_path_id:SW.z.string(),pcb_component_id:SW.z.string(),layer:hZ,route:SW.z.array(yV),stroke_width:XV}).describe("Defines a silkscreen path on the PCB"),TU=requireLib$2(),aU=TU.z.object({type:TU.z.literal("pcb_silkscreen_text"),font:TU.z.literal("tscircuit2024").default("tscircuit2024"),font_size:MV.default("0.2mm"),pcb_component_id:TU.z.string(),text:TU.z.string(),layer:hZ,anchor_position:yV.default({x:0,y:0}),anchor_alignment:TU.z.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center")}).describe("Defines silkscreen text on the PCB"),AU=requireLib$2(),lZ=AU.z.object({type:AU.z.literal("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:AU.z.string(),pcb_component_id:AU.z.string(),center:yV,width:MV,height:MV,layer:hZ}).describe("Defines a silkscreen rect on the PCB"),xZ=requireLib$2(),DZ=xZ.z.object({type:xZ.z.literal("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:xZ.z.string(),pcb_component_id:xZ.z.string(),center:yV,radius:MV,layer:hZ}).describe("Defines a silkscreen circle on the PCB"),rW=requireLib$2(),bW=rW.z.object({type:rW.z.literal("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:rW.z.string(),pcb_component_id:rW.z.string(),center:yV,radius_x:MV,radius_y:MV,layer:hZ}).describe("Defines a silkscreen oval on the PCB"),II=requireLib$2(),pW=II.z.object({type:II.z.literal("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:uR("pcb_fabrication_note_text"),font:II.z.literal("tscircuit2024").default("tscircuit2024"),font_size:MV.default("1mm"),pcb_component_id:II.z.string(),text:II.z.string(),layer:hZ,anchor_position:yV.default({x:0,y:0}),anchor_alignment:II.z.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:II.z.string().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),iI=requireLib$2(),nI=iI.z.object({type:iI.z.literal("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:uR("pcb_fabrication_note_path"),pcb_component_id:iI.z.string(),layer:hZ,route:iI.z.array(yV),stroke_width:XV,color:iI.z.string().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),sI=requireLib$2(),jU=sI.z.object({type:sI.z.literal("pcb_keepout"),shape:sI.z.literal("rect"),center:yV,width:MV,height:MV,pcb_keepout_id:sI.z.string(),layers:sI.z.array(sI.z.string()),description:sI.z.string().optional()}).or(sI.z.object({type:sI.z.literal("pcb_keepout"),shape:sI.z.literal("circle"),center:yV,radius:MV,pcb_keepout_id:sI.z.string(),layers:sI.z.array(sI.z.string()),description:sI.z.string().optional()})),MU=requireLib$2(),DU=MU.z.object({type:MU.z.literal("cad_component"),cad_component_id:MU.z.string(),pcb_component_id:MU.z.string(),source_component_id:MU.z.string(),position:al,rotation:al.optional(),size:al.optional(),layer:KW.optional(),footprinter_string:MU.z.string().optional(),model_obj_url:MU.z.string().optional(),model_stl_url:MU.z.string().optional(),model_3mf_url:MU.z.string().optional(),model_jscad:MU.z.any().optional()}).describe("Defines a component on the PCB"),RZ=requireLib$2(),vU=RZ.z.union([sU,XR,mR,tR,eU,KR,Ol,hR,kl,Pl,xl,MR,BU,_l,yR,jU,uU,QZ,dW,ZZ,PU,_Z,wZ,RW,gI,aU,lZ,DZ,bW,YZ,sZ,YU,nI,pW,vl,MZ,FR,RU,OZ,NU,iR,hW,MW,DU]),TW=vU;return dist$a}const require$$2$1=getAugmentedNamespace(parsel);var dist$9,hasRequiredDist$6;function requireDist$6(){if(hasRequiredDist$6)return dist$9;hasRequiredDist$6=1;var lV=Object.create,J=Object.defineProperty,VV=Object.getOwnPropertyDescriptor,RV=Object.getOwnPropertyNames,UV=Object.getPrototypeOf,ZV=Object.prototype.hasOwnProperty,WV=(Jl,Bl)=>{for(var kl in Bl)J(Jl,kl,{get:Bl[kl],enumerable:!0})},IV=(Jl,Bl,kl,ol)=>{if(Bl&&typeof Bl=="object"||typeof Bl=="function")for(let xl of RV(Bl))!ZV.call(Jl,xl)&&xl!==kl&&J(Jl,xl,{get:()=>Bl[xl],enumerable:!(ol=VV(Bl,xl))||ol.enumerable});return Jl},dV=(Jl,Bl,kl)=>(kl=Jl!=null?lV(UV(Jl)):{},IV(J(kl,"default",{value:Jl,enumerable:!0}),Jl)),CV=Jl=>IV(J({},"__esModule",{value:!0}),Jl),FV={};WV(FV,{applySelector:()=>ll,applySelectorAST:()=>al,directionToVec:()=>JV,getElementById:()=>qV,getElementId:()=>el,getReadableNameForElement:()=>Il,getReadableNameForPcbPort:()=>Ul,getReadableNameForPcbSmtpad:()=>Cl,getReadableNameForPcbTrace:()=>fV,oppositeDirection:()=>kV,oppositeSide:()=>AV,rotateClockwise:()=>GV,rotateCounterClockwise:()=>YV,rotateDirection:()=>tV,su:()=>gV,transformPCBElement:()=>xV,transformPCBElements:()=>uV,transformSchematicElement:()=>XV,transformSchematicElements:()=>MV,vecToDirection:()=>aV}),dist$9=CV(FV);var NV=dV(requireDist$7()),eV=(Jl,Bl={})=>{let kl=Jl._internal_store;if(!kl){kl={counts:{}},Jl._internal_store=kl;for(const xl of Jl){const wl=xl.type,Pl=xl[`${wl}_id`];if(!Pl)continue;const zl=Number.parseInt(Pl.split("_").pop());Number.isNaN(zl)||(kl.counts[wl]=Math.max(kl.counts[wl]??0,zl))}}return new Proxy({},{get:(xl,wl)=>wl==="toArray"?()=>Jl:{get:Pl=>Jl.find(zl=>zl.type===wl&&zl[`${wl}_id`]===Pl),getUsing:Pl=>{const zl=Object.keys(Pl);if(zl.length!==1)throw new Error("getUsing requires exactly one key, e.g. { pcb_component_id }");const Tl=zl[0],Al=Tl.replace("_id",""),Ol=Jl.find(RR=>RR.type===Al&&RR[Tl]===Pl[Tl]);return Ol?Jl.find(RR=>RR.type===wl&&RR[`${wl}_id`]===Ol[`${wl}_id`]):null},getWhere:Pl=>{const zl=Object.keys(Pl);return Jl.find(Tl=>Tl.type===wl&&zl.every(Al=>Tl[Al]===Pl[Al]))},list:Pl=>{const zl=Pl?Object.keys(Pl):[];return Jl.filter(Tl=>Tl.type===wl&&zl.every(Al=>Tl[Al]===Pl[Al]))},insert:Pl=>{var Al;(Al=kl.counts)[wl]??(Al[wl]=-1),kl.counts[wl]++;const zl=kl.counts[wl],Tl={type:wl,[`${wl}_id`]:`${wl}_${zl}`,...Pl};return Bl.validateInserts&&(NV[wl]??NV.any_soup_element).parse(Tl),Jl.push(Tl),Tl},delete:Pl=>{const zl=Jl.find(Tl=>Tl[`${wl}_id`]===Pl);zl&&Jl.splice(Jl.indexOf(zl),1)},update:(Pl,zl)=>{const Tl=Jl.find(Al=>Al[`${wl}_id`]===Pl);if(Tl)return Object.assign(Tl,zl),Tl},select:Pl=>{if(wl==="source_component")return Jl.find(zl=>zl.type==="source_component"&&zl.name===Pl.replace(/\./g,""));if(wl==="pcb_port"||wl==="source_port"||wl==="schematic_port"){const[zl,Tl]=Pl.replace(/\./g,"").split(/[\s\>]+/),Al=Jl.find(RR=>RR.type==="source_component"&&RR.name===zl);if(!Al)return null;const Ol=Jl.find(RR=>RR.type==="source_port"&&RR.source_component_id===Al.source_component_id&&(RR.name===Tl||(RR.port_hints??[]).includes(Tl)));if(!Ol)return null;if(wl==="source_port")return Ol;if(wl==="pcb_port")return Jl.find(RR=>RR.type==="pcb_port"&&RR.source_port_id===Ol.source_port_id);if(wl==="schematic_port")return Jl.find(RR=>RR.type==="schematic_port"&&RR.source_port_id===Ol.source_port_id)}}}})};eV.unparsed=eV;var gV=eV,nV=require$$0,JV=Jl=>{if(Jl==="up")return{x:0,y:1};if(Jl==="down")return{x:0,y:-1};if(Jl==="left")return{x:-1,y:0};if(Jl==="right")return{x:1,y:0};throw new Error("Invalid direction")},aV=({x:Jl,y:Bl})=>{if(Jl>Bl&&(Bl=0),Bl>Jl&&(Jl=0),Jl>0&&Bl===0)return"right";if(Jl<0&&Bl===0)return"left";if(Jl===0&&Bl>0)return"up";if(Jl===0&&Bl<0)return"down";throw new Error(`Invalid vector for direction conversion (${Jl}, ${Bl})`)},GV=Jl=>{if(Jl==="up")return"right";if(Jl==="right")return"down";if(Jl==="down")return"left";if(Jl==="left")return"up";throw new Error(`Invalid direction: ${Jl}`)},YV=Jl=>{if(Jl==="up")return"left";if(Jl==="left")return"down";if(Jl==="down")return"right";if(Jl==="right")return"up";throw new Error(`Invalid direction: ${Jl}`)},tV=(Jl,Bl)=>{for(;Bl>0;)Jl=GV(Jl),Bl--;for(;Bl<0;)Jl=YV(Jl),Bl++;return Jl},kV=Jl=>{if(Jl==="up")return"down";if(Jl==="down")return"up";if(Jl==="left")return"right";if(Jl==="right")return"left";throw new Error(`Invalid direction: ${Jl}`)},AV=Jl=>{if(Jl==="top"||Jl==="up")return"bottom";if(Jl==="bottom"||Jl==="down")return"top";if(Jl==="left")return"right";if(Jl==="right")return"left";throw new Error(`Invalid sideOrDir: ${Jl}`)},XV=(Jl,Bl)=>{if(Jl.type==="schematic_component")Jl.center=(0,nV.applyToPoint)(Bl,Jl.center);else if(Jl.type==="schematic_port")Jl.center=(0,nV.applyToPoint)(Bl,Jl.center),Jl.facing_direction&&(Jl.facing_direction=tV(Jl.facing_direction,-(Math.atan2(Bl.b,Bl.a)/Math.PI)*2));else if(Jl.type==="schematic_text")Jl.position=(0,nV.applyToPoint)(Bl,Jl.position);else if(Jl.type!=="schematic_trace"){if(Jl.type==="schematic_box"){const{x:kl,y:ol}=(0,nV.applyToPoint)(Bl,{x:Jl.x,y:Jl.y});Jl.x=kl,Jl.y=ol}else if(Jl.type==="schematic_line"){const{x:kl,y:ol}=(0,nV.applyToPoint)(Bl,{x:Jl.x1,y:Jl.y1}),{x:xl,y:wl}=(0,nV.applyToPoint)(Bl,{x:Jl.x2,y:Jl.y2});Jl.x1=kl,Jl.y1=ol,Jl.x2=xl,Jl.y2=wl}}return Jl},MV=(Jl,Bl)=>Jl.map(kl=>XV(kl,Bl)),xV=(Jl,Bl)=>{if(Jl.type==="pcb_plated_hole"||Jl.type==="pcb_hole"||Jl.type==="pcb_via"||Jl.type==="pcb_smtpad"||Jl.type==="pcb_port"){const{x:kl,y:ol}=(0,nV.applyToPoint)(Bl,{x:Jl.x,y:Jl.y});Jl.x=kl,Jl.y=ol}else if(Jl.type==="pcb_keepout")Jl.center=(0,nV.applyToPoint)(Bl,Jl.center);else if(Jl.type==="pcb_silkscreen_text"||Jl.type==="pcb_fabrication_note_text")Jl.anchor_position=(0,nV.applyToPoint)(Bl,Jl.anchor_position);else if(Jl.type==="pcb_silkscreen_circle"||Jl.type==="pcb_silkscreen_rect"||Jl.type==="pcb_component")Jl.center=(0,nV.applyToPoint)(Bl,Jl.center);else if(Jl.type==="pcb_silkscreen_path"||Jl.type==="pcb_trace"||Jl.type==="pcb_fabrication_note_path")Jl.route=Jl.route.map(kl=>{const ol=(0,nV.applyToPoint)(Bl,kl);return kl.x=ol.x,kl.y=ol.y,kl});else if(Jl.type==="pcb_silkscreen_line"){const kl={x:Jl.x1,y:Jl.y1},ol={x:Jl.x2,y:Jl.y2},xl=(0,nV.applyToPoint)(Bl,kl),wl=(0,nV.applyToPoint)(Bl,ol);Jl.x1=xl.x,Jl.y1=xl.y,Jl.x2=wl.x,Jl.y2=wl.y}else if(Jl.type==="cad_component"){const kl=(0,nV.applyToPoint)(Bl,{x:Jl.position.x,y:Jl.position.y});Jl.position.x=kl.x,Jl.position.y=kl.y}return Jl},uV=(Jl,Bl)=>{const kl=(0,nV.decomposeTSR)(Bl),ol=Math.round(kl.rotation.angle/(Math.PI/2))%2===1;let xl=Jl.map(wl=>xV(wl,Bl));return ol&&(xl=xl.map(wl=>(wl.type==="pcb_smtpad"&&wl.shape==="rect"&&([wl.width,wl.height]=[wl.height,wl.width]),wl))),xl},wV=dV(require$$2$1),vV=Jl=>{switch(Jl){case"port":return"source_port";case"net":return"source_net";case"power":return"simple_power_source"}return Jl},yV=(Jl,Bl)=>(Bl=vV(Bl),Jl.filter(kl=>"ftype"in kl&&kl.ftype===Bl||kl.type===Bl)),ll=(Jl,Bl)=>{const kl=wV.parse(Bl);return al(Jl,kl)},Nl=(Jl,Bl)=>{var kl;return"name"in Jl&&Jl.name===Bl||"port_hints"in Jl&&((kl=Jl.port_hints)==null?void 0:kl.includes(Bl))},al=(Jl,Bl)=>{switch(Bl.type){case"complex":{switch(Bl.combinator){case" ":case">":{const{left:kl,right:ol}=Bl;if(kl.type==="class"||kl.type==="type"){let xl;kl.type==="class"?xl=Jl.filter(Pl=>Nl(Pl,kl.name)):kl.type==="type"?xl=yV(Jl,kl.name):xl=[];const wl=xl.flatMap(Pl=>Jl.filter(zl=>zl[`${Pl.type}_id`]===Pl[`${Pl.type}_id`]&&zl!==Pl));return al(wl,ol)}else throw new Error(`unsupported selector type "${kl.type}" `)}default:throw new Error(`Couldn't apply selector AST for complex combinator "${Bl.combinator}"`)}return[]}case"compound":{const kl=Bl.list.map(ol=>{switch(ol.type){case"class":return xl=>Nl(xl,ol.name);case"type":{const xl=vV(ol.name);return wl=>wl.type===xl}}});return Jl.filter(ol=>kl.every(xl=>xl==null?void 0:xl(ol)))}case"type":return yV(Jl,Bl.name);case"class":return Jl.filter(kl=>Nl(kl,Bl.name));default:throw new Error(`Couldn't apply selector AST for type: "${Bl.type}" ${JSON.stringify(Bl,null," ")}`)}},el=Jl=>{const Bl=Jl.type;return Jl[`${Bl}_id`]},qV=(Jl,Bl)=>Jl.find(kl=>el(kl)===Bl)??null;function fV(Jl,Bl){const kl=eV(Jl).pcb_trace.get(Bl);if(!kl)return`trace[${Bl}]`;const ol=kl.route.flatMap(Pl=>[Pl.start_pcb_port_id,Pl.end_pcb_port_id]).filter(Boolean);if(ol.length===0)return`trace[${Bl}]`;function xl(Pl){const zl=eV(Jl).pcb_port.get(Pl);if(!zl)return null;const Tl=eV(Jl).pcb_component.get(zl.pcb_component_id);if(!Tl)return null;const Al=eV(Jl).source_component.get(Tl.source_component_id);if(!Al)return null;const Ol=eV(Jl).source_port.get(zl.source_port_id),RR=Ol!=null&&Ol.port_hints?Ol.port_hints[1]:"";return{componentName:Al.name,portHint:RR}}return`trace[${ol.map(Pl=>{const zl=xl(Pl);return zl?`.${zl.componentName} > port.${zl.portHint}`:`port[${Pl}]`}).join(", ")}]`}var Ul=(Jl,Bl)=>{const kl=eV(Jl).pcb_port.get(Bl);if(!kl)return`pcb_port[#${Bl}]`;const ol=eV(Jl).pcb_component.get(kl==null?void 0:kl.pcb_component_id);if(!ol)return`pcb_port[#${Bl}]`;const xl=eV(Jl).source_component.get(ol.source_component_id);if(!xl)return`pcb_port[#${Bl}]`;const wl=eV(Jl).source_port.get(kl.source_port_id);if(!wl)return`pcb_port[#${Bl}]`;let Pl;return wl!=null&&wl.port_hints&&wl.port_hints.length>0||wl.port_hints&&wl.port_hints.length>0?Pl=wl.port_hints[0]:Pl=Bl,`pcb_port[.${xl.name} > .${Pl}]`};function Cl(Jl,Bl){const kl=eV(Jl).pcb_smtpad.get(Bl);return!kl||!kl.pcb_port_id?`smtpad[${Bl}]`:Ul(Jl,kl.pcb_port_id)}var Il=(Jl,Bl)=>{if(typeof Bl=="string"){const kl=qV(Jl,Bl);return Il(Jl,kl)}switch(Bl.type){case"pcb_port":return Ul(Jl,Bl.pcb_port_id);case"pcb_smtpad":return Cl(Jl,Bl.pcb_smtpad_id);case"pcb_trace":return fV(Jl,Bl.pcb_trace_id);case"source_component":return`source_component[${Bl.name}]`;default:return`${Bl.type}[#${el(Bl)}]`}};return dist$9}var distExports$4=requireDist$6(),performanceNow$1={exports:{}},performanceNow=performanceNow$1.exports,hasRequiredPerformanceNow;function requirePerformanceNow(){return hasRequiredPerformanceNow||(hasRequiredPerformanceNow=1,(function(){var lV,J,VV,RV,UV,ZV;typeof performance<"u"&&performance!==null&&performance.now?performanceNow$1.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(performanceNow$1.exports=function(){return(lV()-UV)/1e6},J=process.hrtime,lV=function(){var WV;return WV=J(),WV[0]*1e9+WV[1]},RV=lV(),ZV=process.uptime()*1e9,UV=RV-ZV):Date.now?(performanceNow$1.exports=function(){return Date.now()-VV},VV=Date.now()):(performanceNow$1.exports=function(){return new Date().getTime()-VV},VV=new Date().getTime())}).call(performanceNow)),performanceNow$1.exports}requirePerformanceNow();function doesLineIntersectLine$1([lV,J],[VV,RV],{lineThickness:UV=0}={}){return UV===0?doSegmentsIntersect$1(lV,J,VV,RV):segmentsDistance$1(lV,J,VV,RV)<=UV}function doSegmentsIntersect$1(lV,J,VV,RV){const UV=orientation$1(lV,J,VV),ZV=orientation$1(lV,J,RV),WV=orientation$1(VV,RV,lV),IV=orientation$1(VV,RV,J);return!!(UV!==ZV&&WV!==IV||UV===0&&onSegment$2(lV,VV,J)||ZV===0&&onSegment$2(lV,RV,J)||WV===0&&onSegment$2(VV,lV,RV)||IV===0&&onSegment$2(VV,J,RV))}function orientation$1(lV,J,VV){const RV=(J.y-lV.y)*(VV.x-J.x)-(J.x-lV.x)*(VV.y-J.y);return RV===0?0:RV>0?1:2}function onSegment$2(lV,J,VV){return J.x<=Math.max(lV.x,VV.x)&&J.x>=Math.min(lV.x,VV.x)&&J.y<=Math.max(lV.y,VV.y)&&J.y>=Math.min(lV.y,VV.y)}function segmentsDistance$1(lV,J,VV,RV){if(lV.x===J.x&&lV.y===J.y)return pointToSegmentDistance$1(lV,VV,RV);if(VV.x===RV.x&&VV.y===RV.y)return pointToSegmentDistance$1(VV,lV,J);if(doSegmentsIntersect$1(lV,J,VV,RV))return 0;const UV=[pointToSegmentDistance$1(lV,VV,RV),pointToSegmentDistance$1(J,VV,RV),pointToSegmentDistance$1(VV,lV,J),pointToSegmentDistance$1(RV,lV,J)];return Math.min(...UV)}function pointToSegmentDistance$1(lV,J,VV){const RV=(VV.x-J.x)**2+(VV.y-J.y)**2;if(RV===0)return distance$2(lV,J);let UV=((lV.x-J.x)*(VV.x-J.x)+(lV.y-J.y)*(VV.y-J.y))/RV;UV=Math.max(0,Math.min(1,UV));const ZV={x:J.x+UV*(VV.x-J.x),y:J.y+UV*(VV.y-J.y)};return distance$2(lV,ZV)}function distance$2(lV,J){const VV=lV.x-J.x,RV=lV.y-J.y;return Math.sqrt(VV*VV+RV*RV)}function findConnectedNetworks$1(lV){const J=new Map;let VV=0;function RV(UV){for(const[,WV]of J)if(WV.has(UV))return WV;const ZV=new Set;return J.set(`connectivity_net${VV++}`,ZV),ZV}for(const UV of lV){let ZV=null;for(const WV of UV){if(!ZV)ZV=RV(WV);else if(!ZV.has(WV)){const IV=RV(WV);if(IV!==ZV){for(const dV of IV)ZV.add(dV);J.delete(Array.from(J.entries()).find(([,dV])=>dV===IV)[0])}}ZV.add(WV)}}return Object.fromEntries(Array.from(J.entries()).map(([UV,ZV])=>[UV,Array.from(ZV)]))}var ConnectivityMap$1=class{constructor(J){Fd(this,"netMap");Fd(this,"idToNetMap");this.netMap=J,this.idToNetMap={};for(const[VV,RV]of Object.entries(J))for(const UV of RV)this.idToNetMap[UV]=VV}addConnections(J){for(const VV of J){const RV=new Set;for(const ZV of VV){const WV=this.idToNetMap[ZV];WV&&RV.add(WV)}let UV;if(RV.size===0)UV=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[UV]=[];else if(RV.size===1)UV=RV.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{UV=RV.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(const ZV of RV)if(ZV!==UV){this.netMap[UV].push(...this.netMap[ZV]),this.netMap[ZV]=this.netMap[UV];for(const WV of this.netMap[UV])this.idToNetMap[WV]=UV}}for(const ZV of VV)this.netMap[UV].includes(ZV)||this.netMap[UV].push(ZV),this.idToNetMap[ZV]=UV}}getIdsConnectedToNet(J){return this.netMap[J]||[]}getNetConnectedToId(J){return this.idToNetMap[J]}areIdsConnected(J,VV){const RV=this.getNetConnectedToId(J),UV=this.getNetConnectedToId(VV);return RV===UV||UV===J||UV===J}areAllIdsConnected(J){const VV=this.getNetConnectedToId(J[0]);for(const RV of J){const UV=this.getNetConnectedToId(RV);if(UV===void 0||UV!==VV)return!1}return!0}},getSourcePortConnectivityMapFromCircuitJson=lV=>{const J=[];for(const RV of lV)RV.type==="source_trace"&&J.push([...RV.connected_source_port_ids??[],...RV.connected_source_net_ids??[]]);const VV=findConnectedNetworks$1(J);return new ConnectivityMap$1(VV)},getFullConnectivityMapFromCircuitJson$1=lV=>{const J=[];for(const RV of lV)if(RV.type==="source_trace")J.push([RV.source_trace_id,...RV.connected_source_port_ids??[],...RV.connected_source_net_ids??[]].filter(Boolean));else if(RV.type==="pcb_port"){const{pcb_port_id:UV,source_port_id:ZV}=RV;ZV&&UV&&J.push([ZV,UV])}else if(RV.type==="pcb_smtpad"){const{pcb_smtpad_id:UV,pcb_port_id:ZV}=RV;ZV&&UV&&J.push([UV,ZV])}else if(RV.type==="pcb_plated_hole"){const{pcb_plated_hole_id:UV,pcb_port_id:ZV}=RV;ZV&&UV&&J.push([UV,ZV])}else if(RV.type==="pcb_trace"){const{pcb_trace_id:UV,source_trace_id:ZV}=RV;ZV&&UV&&J.push([UV,ZV])}const VV=findConnectedNetworks$1(J);return new ConnectivityMap$1(VV)},PcbConnectivityMap=class{constructor(lV){Fd(this,"circuitJson");Fd(this,"traceIdToElm");Fd(this,"portIdToElm");Fd(this,"connMap");this.circuitJson=lV||[],this.traceIdToElm=new Map,this.portIdToElm=new Map,lV?(this._buildTraceMap(),this._buildPortMap(),this.connMap=this._buildTraceConnectivityMap()):this.connMap=new ConnectivityMap$1({})}_buildPortMap(){for(const lV of this.circuitJson)lV.type==="pcb_port"&&this.portIdToElm.set(lV.pcb_port_id,lV)}_buildTraceMap(){for(const lV of this.circuitJson)lV.type==="pcb_trace"&&this.traceIdToElm.set(lV.pcb_trace_id,lV)}_buildTraceConnectivityMap(){const lV=[],J=Array.from(this.traceIdToElm.keys());for(let VV=0;VV<J.length;VV++)for(let RV=VV+1;RV<J.length;RV++){const UV=this.traceIdToElm.get(J[VV]),ZV=this.traceIdToElm.get(J[RV]);this._arePcbTracesConnected(UV,ZV)&&lV.push([J[VV],J[RV]])}for(const VV of this.portIdToElm.values())for(const RV of this.traceIdToElm.values())for(const UV of RV.route)UV.route_type==="wire"&&(UV.start_pcb_port_id===VV.pcb_port_id?lV.push([VV.pcb_port_id,RV.pcb_trace_id]):UV.end_pcb_port_id===VV.pcb_port_id&&lV.push([RV.pcb_trace_id,VV.pcb_port_id]));return new ConnectivityMap$1(findConnectedNetworks$1(lV))}addTrace(lV){this.traceIdToElm.set(lV.pcb_trace_id,lV);const J=[];for(const VV of lV.route)VV.route_type==="wire"&&(VV.start_pcb_port_id&&J.push([VV.start_pcb_port_id,lV.pcb_trace_id]),VV.end_pcb_port_id&&J.push([VV.end_pcb_port_id,lV.pcb_trace_id]));this.connMap.addConnections(J)}_arePcbTracesConnected(lV,J){for(let VV=0;VV<lV.route.length-1;VV++){const RV=lV.route[VV],UV=lV.route[VV+1];if(RV.route_type==="wire"&&UV.route_type==="wire")for(let ZV=0;ZV<J.route.length-1;ZV++){const WV=J.route[ZV],IV=J.route[ZV+1];if(WV.route_type!=="wire"||IV.route_type!=="wire")continue;if(doesLineIntersectLine$1([RV,UV],[WV,IV],{lineThickness:(RV.width+WV.width)/2}))return!0}}return!1}areTracesConnected(lV,J){return this.connMap.areIdsConnected(lV,J)}getAllTracesConnectedToTrace(lV){const J=this.connMap.getNetConnectedToId(lV);return J?this.connMap.getIdsConnectedToNet(J).filter(VV=>this.traceIdToElm.has(VV)).map(VV=>this.traceIdToElm.get(VV)):[]}getAllTracesConnectedToPort(lV){const J=this.connMap.getNetConnectedToId(lV);return J?this.connMap.getIdsConnectedToNet(J).filter(VV=>this.traceIdToElm.has(VV)).map(VV=>this.traceIdToElm.get(VV)):[]}};const dist$8=Object.freeze(Object.defineProperty({__proto__:null,ConnectivityMap:ConnectivityMap$1,PcbConnectivityMap,findConnectedNetworks:findConnectedNetworks$1,getFullConnectivityMapFromCircuitJson:getFullConnectivityMapFromCircuitJson$1,getSourcePortConnectivityMapFromCircuitJson},Symbol.toStringTag,{value:"Module"}));function getBoundingBox(lV){const J=lV.width/2,VV=lV.height/2;return{minX:lV.center.x-J,maxX:lV.center.x+J,minY:lV.center.y-VV,maxY:lV.center.y+VV}}function computeDistanceBetweenBoxes(lV,J){const VV=getBoundingBox(lV),RV=getBoundingBox(J),UV=Math.max(VV.minX-RV.maxX,RV.minX-VV.maxX,0),ZV=Math.max(VV.minY-RV.maxY,RV.minY-VV.maxY,0),WV={x:0,y:0},IV={x:0,y:0};return UV===0&&ZV===0?{distance:0,pointA:lV.center,pointB:J.center}:(WV.x=clamp$7(lV.center.x,RV.minX,RV.maxX),WV.y=clamp$7(lV.center.y,RV.minY,RV.maxY),IV.x=clamp$7(J.center.x,VV.minX,VV.maxX),IV.y=clamp$7(J.center.y,VV.minY,VV.maxY),{distance:Math.hypot(WV.x-IV.x,WV.y-IV.y),pointA:WV,pointB:IV})}function clamp$7(lV,J,VV){return Math.max(J,Math.min(VV,lV))}function findNearestPointsBetweenBoxSets(lV,J){let VV=Number.POSITIVE_INFINITY,RV={x:0,y:0},UV={x:0,y:0};for(const ZV of lV)for(const WV of J){const{distance:IV,pointA:dV,pointB:CV}=computeDistanceBetweenBoxes(ZV,WV);IV<VV&&(VV=IV,RV=dV,UV=CV)}return{pointA:RV,pointB:UV,distance:VV}}let nanoid$1=(lV=21)=>crypto.getRandomValues(new Uint8Array(lV)).reduce((J,VV)=>(VV&=63,VV<36?J+=VV.toString(36):VV<62?J+=(VV-26).toString(36).toUpperCase():VV>62?J+="-":J+="_",J),"");var manDist=(lV,J)=>Math.abs(lV.x-J.x)+Math.abs(lV.y-J.y),dirFromAToB=(lV,J)=>{const VV=J.x-lV.x,RV=J.y-lV.y;return Math.abs(VV)>Math.abs(RV)?{dx:Math.sign(VV),dy:0}:{dx:0,dy:Math.sign(RV)}},distAlongDir=(lV,J,VV)=>Math.abs(lV.x-J.x)*Math.abs(VV.dx)+Math.abs(lV.y-J.y)*Math.abs(VV.dy),nodeName=(lV,J=.1)=>`${Math.round(lV.x/J)},${Math.round(lV.y/J)}`,isCloseTo=(lV,J)=>Math.abs(lV-J)<1e-4,getObstaclesFromRoute=(lV,J,{viaDiameter:VV=.5}={})=>{const RV=[];for(let UV=0;UV<lV.length-1;UV++){const[ZV,WV]=[lV[UV],lV[UV+1]],IV=UV-1>=0?lV[UV-1]:null,dV=isCloseTo(ZV.y,WV.y),CV=isCloseTo(ZV.x,WV.x);if(!dV&&!CV)throw new Error(`getObstaclesFromTrace currently only supports horizontal and vertical traces (not diagonals) Conflicting trace: ${J}, start: (${ZV.x}, ${ZV.y}), end: (${WV.x}, ${WV.y})`);const FV={type:"rect",layers:[ZV.layer],center:{x:(ZV.x+WV.x)/2,y:(ZV.y+WV.y)/2},width:dV?Math.abs(ZV.x-WV.x):.1,height:CV?Math.abs(ZV.y-WV.y):.1,connectedTo:[J]};if(RV.push(FV),IV&&IV.layer===ZV.layer&&ZV.layer!==WV.layer){const NV={type:"rect",layers:[ZV.layer,WV.layer],center:{x:ZV.x,y:ZV.y},connectedTo:[J],width:VV,height:VV};RV.push(NV)}}return RV},ObstacleList=class{constructor(lV){Fd(this,"obstacles");Fd(this,"GRID_STEP",.1);this.obstacles=lV.map(J=>({...J,left:J.center.x-J.width/2,right:J.center.x+J.width/2,top:J.center.y+J.height/2,bottom:J.center.y-J.height/2}))}getObstacleAt(lV,J,VV){VV??(VV=this.GRID_STEP);for(const RV of this.obstacles){const UV=RV.width/2+VV,ZV=RV.height/2+VV;if(lV>=RV.center.x-UV&&lV<=RV.center.x+UV&&J>=RV.center.y-ZV&&J<=RV.center.y+ZV)return RV}return null}isObstacleAt(lV,J,VV){return this.getObstacleAt(lV,J,VV)!==null}getDirectionDistancesToNearestObstacle(lV,J){const{GRID_STEP:VV}=this,RV={left:1/0,top:1/0,bottom:1/0,right:1/0};for(const UV of this.obstacles)if(UV.type==="rect"){const ZV=UV.center.x-UV.width/2-VV,WV=UV.center.x+UV.width/2+VV,IV=UV.center.y+UV.height/2+VV,dV=UV.center.y-UV.height/2-VV;J>=dV&&J<=IV&&lV>ZV&&(RV.left=Math.min(RV.left,lV-WV)),J>=dV&&J<=IV&&lV<WV&&(RV.right=Math.min(RV.right,ZV-lV)),lV>=ZV&&lV<=WV&&J<IV&&(RV.top=Math.min(RV.top,dV-J)),lV>=ZV&&lV<=WV&&J>dV&&(RV.bottom=Math.min(RV.bottom,J-IV))}return RV}getOrthoDirectionCollisionInfo(lV,J,{margin:VV=0}={}){const{x:RV,y:UV}=lV,{dx:ZV,dy:WV}=J;let IV=1/0,dV=null;for(const CV of this.obstacles){const FV=CV.left-VV,NV=CV.right+VV,eV=CV.top+VV,gV=CV.bottom-VV;let nV=null;ZV===1&&WV===0?UV>gV&&UV<eV&&RV<CV.left&&(nV=CV.left-RV):ZV===-1&&WV===0?UV>gV&&UV<eV&&RV>CV.right&&(nV=RV-CV.right):ZV===0&&WV===1?RV>FV&&RV<NV&&UV<CV.bottom&&(nV=CV.bottom-UV):ZV===0&&WV===-1&&RV>FV&&RV<NV&&UV>CV.top&&(nV=UV-CV.top),nV!==null&&nV<IV&&(IV=nV,dV=CV)}return{dx:ZV,dy:WV,wallDistance:IV,obstacle:dV}}getObstaclesOverlappingRegion(lV){const J=[];for(const VV of this.obstacles){const{left:RV,right:UV,top:ZV,bottom:WV}=VV;RV>=lV.minX&&UV<=lV.maxX&&ZV>=lV.minY&&WV<=lV.maxY&&J.push(VV)}return J}};function removePathLoops(lV){if(lV.length<4)return lV;const J=[{...lV[0]}];let VV=lV[0].layer;for(let RV=1;RV<lV.length;RV++){const UV={start:lV[RV-1],end:lV[RV]},ZV=lV[RV].route_type==="via"||lV[RV-1].route_type==="via";if(lV[RV].layer!==VV||ZV){J.push({...lV[RV]}),VV=lV[RV].layer;continue}let WV=!1,IV=null,dV=-1;for(let FV=0;FV<J.length-1;FV++){const NV={start:J[FV],end:J[FV+1]};if(NV.start.layer===UV.start.layer&&NV.start.layer===UV.start.layer){const eV=findIntersection(NV,UV);if(eV){WV=!0,IV={...eV,layer:VV},dV=FV;break}}}WV&&IV&&(J.splice(dV+1),J.push(IV));const CV=J[J.length-1];(CV.x!==lV[RV].x||CV.y!==lV[RV].y)&&J.push(lV[RV])}return J}function findIntersection(lV,J){if(lV.start.x===lV.end.x&&J.start.x===J.end.x||lV.start.y===lV.end.y&&J.start.y===J.end.y)return null;let VV;if(lV.start.x===lV.end.x){const RV=lV.start.x,UV=J.start.y;VV={...lV.start,x:RV,y:UV}}else{const RV=J.start.x,UV=lV.start.y;VV={...lV.start,x:RV,y:UV}}return isPointInSegment(VV,lV)&&isPointInSegment(VV,J)?VV:null}function isPointInSegment(lV,J){return lV.x>=Math.min(J.start.x,J.end.x)&&lV.x<=Math.max(J.start.x,J.end.x)&&lV.y>=Math.min(J.start.y,J.end.y)&&lV.y<=Math.max(J.start.y,J.end.y)}function addViasWhenLayerChanges(lV){const J=[lV[0]];for(let VV=1;VV<lV.length-1;VV++){const[RV,UV,ZV]=[lV[VV-1],lV[VV],lV[VV+1]];J.push(UV),!(UV.route_type!=="wire"||RV.route_type!=="wire"||ZV.route_type!=="wire")&&RV.layer===UV.layer&&UV.layer!==ZV.layer&&J.push({route_type:"via",from_layer:UV.layer,to_layer:ZV.layer,x:UV.x,y:UV.y})}return J.push(lV[lV.length-1]),J}var debug$1=Debug4("autorouting-dataset:astar"),GeneralizedAstarAutorouter=class{constructor(lV){Fd(this,"openSet",[]);Fd(this,"closedSet",new Set);Fd(this,"debug",!1);Fd(this,"debugSolutions");Fd(this,"debugMessage",null);Fd(this,"debugTraceCount",0);Fd(this,"input");Fd(this,"obstacles");Fd(this,"allObstacles");Fd(this,"startNode");Fd(this,"goalPoint");Fd(this,"GRID_STEP");Fd(this,"OBSTACLE_MARGIN");Fd(this,"MAX_ITERATIONS");Fd(this,"isRemovePathLoopsEnabled");Fd(this,"GREEDY_MULTIPLIER",1.1);Fd(this,"iterations",-1);this.input=lV.input,this.allObstacles=lV.input.obstacles,this.startNode=lV.startNode,this.goalPoint=lV.goalPoint?{l:0,...lV.goalPoint}:void 0,this.GRID_STEP=lV.GRID_STEP??.1,this.OBSTACLE_MARGIN=lV.OBSTACLE_MARGIN??.15,this.MAX_ITERATIONS=lV.MAX_ITERATIONS??100,this.debug=lV.debug??debug$1.enabled,this.isRemovePathLoopsEnabled=lV.isRemovePathLoopsEnabled??!1,this.debug&&(debug$1.enabled=!0),debug$1.enabled&&(this.debugSolutions={},this.debugMessage="")}getNeighbors(lV){return[]}isSameNode(lV,J){return manDist(lV,J)<this.GRID_STEP}computeG(lV,J){return lV.g+manDist(lV,J)}computeH(lV){return manDist(lV,this.goalPoint)}getNodeName(lV){return nodeName(lV,this.GRID_STEP)}solveOneStep(){this.iterations+=1;const{openSet:lV,closedSet:J,GRID_STEP:VV,goalPoint:RV}=this;lV.sort((IV,dV)=>IV.f-dV.f);const UV=lV.shift();if(this.computeH(UV)<=VV*2)return{solved:!0,current:UV,newNeighbors:[]};this.closedSet.add(this.getNodeName(UV));let WV=[];for(const IV of this.getNeighbors(UV)){if(J.has(this.getNodeName(IV)))continue;const dV=this.computeG(UV,IV),CV=this.openSet.find(FV=>this.isSameNode(FV,IV));if(!CV||dV<CV.g){const FV=this.computeH(IV),NV=dV+FV*this.GREEDY_MULTIPLIER,eV={...IV,g:dV,h:FV,f:NV,obstacleHit:IV.obstacleHit??void 0,manDistFromParent:manDist(UV,IV),nodesInPath:UV.nodesInPath+1,parent:UV,enterMarginCost:IV.enterMarginCost,travelMarginCostFactor:IV.travelMarginCostFactor};lV.push(eV),WV.push(eV)}}return debug$1.enabled&&(lV.sort((IV,dV)=>IV.f-dV.f),this.drawDebugSolution({current:UV,newNeighbors:WV})),{solved:!1,current:UV,newNeighbors:WV}}getStartNode(lV){return{x:lV.pointsToConnect[0].x,y:lV.pointsToConnect[0].y,manDistFromParent:0,f:0,g:0,h:0,nodesInPath:0,parent:null}}layerToIndex(lV){return 0}indexToLayer(lV){return"top"}preprocessConnectionBeforeSolving(lV){return lV}solveConnection(lV){if(lV.pointsToConnect.length>2)throw new Error("GeneralizedAstarAutorouter doesn't currently support 2+ points in a connection");lV=this.preprocessConnectionBeforeSolving(lV);const{pointsToConnect:J}=lV;for(this.iterations=0,this.closedSet=new Set,this.startNode=this.getStartNode(lV),this.goalPoint={...J[J.length-1],l:this.layerToIndex(J[J.length-1].layer)},this.openSet=[this.startNode];this.iterations<this.MAX_ITERATIONS;){const{solved:VV,current:RV}=this.solveOneStep();if(VV){let UV=[],ZV=RV;for(;ZV;){const WV=ZV.l;UV.unshift({x:ZV.x,y:ZV.y,layer:WV!==void 0?this.indexToLayer(WV):J[0].layer}),ZV=ZV.parent}return debug$1.enabled&&(this.debugMessage+=`t${this.debugTraceCount}: ${this.iterations} iterations
|
|
396
|
+
Check the render method of %s.`,nU(NZ)||"Unknown"));var ul=EY(LV,gl);ul.payload={element:TV},SV=SV===void 0?null:SV,SV!==null&&(typeof SV!="function"&&CV("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",SV),ul.callback=SV);var WR=ba(HV,ul,gl);return WR!==null&&(Pg(WR,HV,gl,LV),VY(WR,HV,gl)),gl}function GI(TV){var mV=TV.current;if(!mV.child)return null;switch(mV.child.tag){case vV:return ZZ(mV.child.stateNode);default:return mV.child.stateNode}}function qd(TV){switch(TV.tag){case uV:{var mV=TV.stateNode;if(Kl(mV)){var iV=OG(mV);dT(mV,iV)}break}case Ul:{bk(function(){var HV=MF(TV,XW);if(HV!==null){var LV=Xg();Pg(HV,TV,XW,LV)}});var SV=XW;cI(TV,SV);break}}}function uZ(TV,mV){var iV=TV.memoizedState;iV!==null&&iV.dehydrated!==null&&(iV.retryLane=HN(iV.retryLane,mV))}function cI(TV,mV){uZ(TV,mV);var iV=TV.alternate;iV&&uZ(iV,mV)}function pI(TV){if(TV.tag===Ul){var mV=XW,iV=MF(TV,mV);if(iV!==null){var SV=Xg();Pg(iV,TV,mV,SV)}cI(TV,mV)}}function fI(TV){if(TV.tag===Ul){var mV=SJ,iV=MF(TV,mV);if(iV!==null){var SV=Xg();Pg(iV,TV,mV,SV)}cI(TV,mV)}}function Qd(TV){if(TV.tag===Ul){var mV=xc(TV),iV=MF(TV,mV);if(iV!==null){var SV=Xg();Pg(iV,TV,mV,SV)}cI(TV,mV)}}function VI(TV){var mV=YZ(TV);return mV===null?null:mV.stateNode}var LI=function(TV){return null};function md(TV){return LI(TV)}var xC=function(TV){return!1};function LZ(TV){return xC(TV)}var SZ=null,BI=null,$I=null,ld=null,XZ=null,cd=null,KV=null,_V=null,ml=null;{var jl=function(TV,mV,iV){var SV=mV[iV],HV=bU(TV)?TV.slice():NV({},TV);return iV+1===mV.length?(bU(HV)?HV.splice(SV,1):delete HV[SV],HV):(HV[SV]=jl(TV[SV],mV,iV+1),HV)},UR=function(TV,mV){return jl(TV,mV,0)},vR=function(TV,mV,iV,SV){var HV=mV[SV],LV=bU(TV)?TV.slice():NV({},TV);if(SV+1===mV.length){var gl=iV[SV];LV[gl]=LV[HV],bU(LV)?LV.splice(HV,1):delete LV[HV]}else LV[HV]=vR(TV[HV],mV,iV,SV+1);return LV},rR=function(TV,mV,iV){if(mV.length!==iV.length){dV("copyWithRename() expects paths of the same length");return}else for(var SV=0;SV<iV.length-1;SV++)if(mV[SV]!==iV[SV]){dV("copyWithRename() expects paths to be the same except for the deepest key");return}return vR(TV,mV,iV,0)},xR=function(TV,mV,iV,SV){if(iV>=mV.length)return SV;var HV=mV[iV],LV=bU(TV)?TV.slice():NV({},TV);return LV[HV]=xR(TV[HV],mV,iV+1,SV),LV},HU=function(TV,mV,iV){return xR(TV,mV,0,iV)},iZ=function(TV,mV){for(var iV=TV.memoizedState;iV!==null&&mV>0;)iV=iV.next,mV--;return iV};SZ=function(TV,mV,iV,SV){var HV=iZ(TV,mV);if(HV!==null){var LV=HU(HV.memoizedState,iV,SV);HV.memoizedState=LV,HV.baseState=LV,TV.memoizedProps=NV({},TV.memoizedProps);var gl=MF(TV,XW);gl!==null&&Pg(gl,TV,XW,JC)}},BI=function(TV,mV,iV){var SV=iZ(TV,mV);if(SV!==null){var HV=UR(SV.memoizedState,iV);SV.memoizedState=HV,SV.baseState=HV,TV.memoizedProps=NV({},TV.memoizedProps);var LV=MF(TV,XW);LV!==null&&Pg(LV,TV,XW,JC)}},$I=function(TV,mV,iV,SV){var HV=iZ(TV,mV);if(HV!==null){var LV=rR(HV.memoizedState,iV,SV);HV.memoizedState=LV,HV.baseState=LV,TV.memoizedProps=NV({},TV.memoizedProps);var gl=MF(TV,XW);gl!==null&&Pg(gl,TV,XW,JC)}},ld=function(TV,mV,iV){TV.pendingProps=HU(TV.memoizedProps,mV,iV),TV.alternate&&(TV.alternate.pendingProps=TV.pendingProps);var SV=MF(TV,XW);SV!==null&&Pg(SV,TV,XW,JC)},XZ=function(TV,mV){TV.pendingProps=UR(TV.memoizedProps,mV),TV.alternate&&(TV.alternate.pendingProps=TV.pendingProps);var iV=MF(TV,XW);iV!==null&&Pg(iV,TV,XW,JC)},cd=function(TV,mV,iV){TV.pendingProps=rR(TV.memoizedProps,mV,iV),TV.alternate&&(TV.alternate.pendingProps=TV.pendingProps);var SV=MF(TV,XW);SV!==null&&Pg(SV,TV,XW,JC)},KV=function(TV){var mV=MF(TV,XW);mV!==null&&Pg(mV,TV,XW,JC)},_V=function(TV){LI=TV},ml=function(TV){xC=TV}}function zZ(TV){var mV=dW(TV);return mV===null?null:mV.stateNode}function VZ(TV){return null}function kW(){return NZ}function $Z(TV){var mV=TV.findFiberByHostInstance,iV=ZV.ReactCurrentDispatcher;return IJ({bundleType:TV.bundleType,version:TV.version,rendererPackageName:TV.rendererPackageName,rendererConfig:TV.rendererConfig,overrideHookState:SZ,overrideHookStateDeletePath:BI,overrideHookStateRenamePath:$I,overrideProps:ld,overridePropsDeletePath:XZ,overridePropsRenamePath:cd,setErrorHandler:_V,setSuspenseHandler:ml,scheduleUpdate:KV,currentDispatcherRef:iV,findHostInstanceByFiber:zZ,findFiberByHostInstance:mV||VZ,findHostInstancesForRefresh:rl,scheduleRefresh:Rl,scheduleRoot:hl,setRefreshHandler:sG,getCurrentFiber:kW,reconcilerVersion:pZ})}return VV.attemptContinuousHydration=fI,VV.attemptDiscreteHydration=pI,VV.attemptHydrationAtCurrentPriority=Qd,VV.attemptSynchronousHydration=qd,VV.batchedUpdates=vS,VV.createComponentSelector=US,VV.createContainer=dI,VV.createHasPseudoClassSelector=ZS,VV.createHydrationContainer=vW,VV.createPortal=VW,VV.createRoleSelector=nA,VV.createTestNameSelector=IA,VV.createTextSelector=ym,VV.deferredUpdates=xS,VV.discreteUpdates=Qk,VV.findAllNodes=Wk,VV.findBoundingRects=tS,VV.findHostInstance=nZ,VV.findHostInstanceWithNoPortals=VI,VV.findHostInstanceWithWarning=HW,VV.flushControlled=cm,VV.flushPassiveEffects=aY,VV.flushSync=bk,VV.focusWithin=dA,VV.getCurrentUpdatePriority=_F,VV.getFindAllNodesFailureDescription=zS,VV.getPublicRootInstance=GI,VV.injectIntoDevTools=$Z,VV.isAlreadyRendering=TA,VV.observeVisibleRects=wG,VV.registerMutableSourceForHydration=Em,VV.runWithPriority=Sd,VV.shouldError=md,VV.shouldSuspend=LZ,VV.updateContainer=dd,VV}),reactReconciler_development$2.exports}var hasRequiredReactReconciler$2;function requireReactReconciler$2(){return hasRequiredReactReconciler$2||(hasRequiredReactReconciler$2=1,process.env.NODE_ENV==="production"?reactReconciler$2.exports=requireReactReconciler_production_min$2():reactReconciler$2.exports=requireReactReconciler_development$2()),reactReconciler$2.exports}var reactReconcilerExports$1=requireReactReconciler$2();const ReactReconciler=getDefaultExportFromCjs$1(reactReconcilerExports$1);function defineSymbol(lV){return lV}var ac_voltmeter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:.09442299999999992,y:-.1322587999999998},{x:-.004364400000000712,y:.05922830000000001},{x:-.1110211000000012,y:-.1322587999999998}],color:"primary",fill:!1},path17:{type:"path",points:[{x:-.0061693999999994364,y:.1322588},{x:.06546170000000107,y:.10639120000000002}],color:"primary",fill:!1},path18:{type:"path",points:[{x:.06546170000000107,y:.10639120000000002},{x:.13709280000000135,y:.1322588}],color:"primary",fill:!1},path19:{type:"path",points:[{x:-.14943149999999927,y:.1322588},{x:-.07780039999999877,y:.10639120000000002}],color:"primary",fill:!1},path20:{type:"path",points:[{x:-.0778004000000001,y:.10639120000000002},{x:-.006169299999999822,y:.1322588}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.3959705999999994},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.3983547000000005}},refblocks:{left1:{x:-.5446330999999993,y:0},right1:{x:.5381638000000004,y:0}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:-.1322587999999998,maxY:.1322588,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:11102230246251565e-32},circles:{path1:{type:"circle",x:0,y:0,radius:.28854213,color:"primary",fill:!1}}},{paths,bounds,refblocks,circles}=ac_voltmeter_default,ac_voltmeter_horz_default={primitives:[...Object.values(paths),...Object.values(circles),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"}],ports:[{...refblocks.left1,labels:["1"]},{...refblocks.right1,labels:["2"]}],size:{width:bounds.width,height:bounds.height},center:{x:bounds.centerX,y:bounds.centerY}},rotateAnchor=(lV,J="right")=>{switch(J){case"up":switch(lV){case"middle_top":return"middle_left";case"middle_bottom":return"middle_right";case"middle_left":return"middle_bottom";case"middle_right":return"middle_top"}break;case"down":switch(lV){case"middle_top":return"middle_right";case"middle_bottom":return"middle_left";case"middle_left":return"middle_top";case"middle_right":return"middle_bottom"}break;case"left":switch(lV){case"middle_top":return"middle_bottom";case"middle_bottom":return"middle_top";case"middle_left":return"middle_right";case"middle_right":return"middle_left"}break;case"right":return lV}return lV},flipSymbolOverYAxis=(lV,J)=>{const{primitives:VV,center:RV,ports:UV,size:ZV}=lV,WV=transform({a:-1,b:0,c:0,d:1,e:0,f:2*RV.x}),IV=VV.map(CV=>{switch(CV={...CV},CV.type){case"path":return{...CV,points:CV.points.map(gV=>applyToPoint(WV,gV))};case"text":const FV=applyToPoint(WV,{x:CV.x,y:CV.y}),NV={top_left:"top_right",top_right:"top_left",bottom_left:"bottom_right",bottom_right:"bottom_left",center:"center",middle_top:"middle_top",middle_bottom:"middle_bottom",middle_left:"middle_right",middle_right:"middle_left"};return{...CV,x:FV.x,y:FV.y,anchor:NV[CV.anchor]};case"circle":case"box":const eV=applyToPoint(WV,{x:CV.x,y:CV.y});return{...CV,x:eV.x,y:eV.y}}}),dV=UV.map(CV=>({...CV,...applyToPoint(WV,CV)}));return{primitives:IV,center:RV,ports:dV,size:ZV,...J}},rotateSymbol=(lV,J,VV)=>{const RV={up:-Math.PI/2,right:0,down:Math.PI/2,left:-Math.PI},UV=rotate(J?RV[J]:Math.PI/2,lV.center.x,lV.center.y),{primitives:ZV,center:WV,size:IV,ports:dV}=lV,CV=ZV.map(NV=>{switch(NV={...NV},NV.type){case"path":return{...NV,points:NV.points.map(JV=>applyToPoint(UV,JV))};case"text":const eV=applyToPoint(UV,{x:NV.x,y:NV.y});return NV.anchor=rotateAnchor(NV.anchor,J??"right"),{...NV,x:eV.x,y:eV.y};case"circle":const gV=applyToPoint(UV,{x:NV.x,y:NV.y});return{...NV,x:gV.x,y:gV.y};case"box":const nV=applyToPoint(UV,{x:NV.x,y:NV.y});return{...NV,x:nV.x,y:nV.y,width:NV.height,height:NV.width}}}),FV=dV.map(NV=>({...NV,...applyToPoint(UV,NV)}));return{primitives:CV,center:WV,ports:FV,size:{width:J==="up"||J==="down"?IV.width:IV.height,height:J==="up"||J==="down"?IV.height:IV.width},...VV}},{2:letter,3:path1,4:path2$1,5:path3,6:path4,...rest}=ac_voltmeter_horz_default.primitives;function isPrimitive(lV){return typeof lV=="object"}var rotatedSymbol=rotateSymbol({...ac_voltmeter_horz_default,primitives:Object.values(rest).filter(isPrimitive)}),ac_voltmeter_vert_default={...rotatedSymbol,primitives:[...rotatedSymbol.primitives,letter,path1,path2$1,path3,path4]},avalanche_diode_default={paths:{path40:{type:"path",points:[{x:.1413337499999996,y:-.00033784999999975085},{x:-.12324954999999993,y:.1319538500000006}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.12324954999999993,y:-.1326295500000001},{x:.1413337499999996,y:-.00033784999999975085}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.12324954999999993,y:.13195384999999926},{x:-.12324954999999993,y:-.1326295500000001}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.1413337499999996,y:-.1326295500000001},{x:.1413337499999996,y:.13195384999999926}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.12545425,y:-.00033784999999975085},{x:-.52012455,y:-.00033784999999975085}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:.5201245499999998,y:-.00025265000000018745},{x:.14641644999999937,y:-.00025265000000018745}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:.1401360499999995,y:-.13311245000000027},{x:.07443344999999923,y:-.15673055000000047}],color:"primary",fill:!1},"path43-8-3":{type:"path",points:[{x:.20757744999999939,y:.15673055000000025},{x:.1418748499999991,y:.13311245000000005}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.0082802500000001,y:-.2301468499999999},bottom1:{type:"text",text:"{VAL}",x:-.0033669500000002017,y:.31754375}},refblocks:{left1:{x:-.5224022500000005,y:-.0012222500000007575},right1:{x:.5158919499999994,y:-.00019764999999982713}},bounds:{minX:-.52012455,maxX:.5201245499999998,minY:-.15673055000000047,maxY:.15673055000000025,width:1.0402490999999998,height:1,centerX:-11102230246251565e-32,centerY:-11102230246251565e-32},circles:{}},{paths:paths2,texts,bounds:bounds2,refblocks:refblocks2,circles:circles2}=avalanche_diode_default,avalanche_diode_horz_default={primitives:[...Object.values(paths2),...Object.values(circles2),{...texts.top1,anchor:"middle_bottom"},{...texts.bottom1,anchor:"middle_top"}],ports:[{...refblocks2.left1,labels:["1"]},{...refblocks2.right1,labels:["2"]}],size:{width:bounds2.width,height:bounds2.height},center:{x:bounds2.centerX,y:bounds2.centerY}},rotated=rotateSymbol(avalanche_diode_horz_default),ref=rotated.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val=rotated.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref.anchor="middle_left",val.anchor="middle_right";var avalanche_diode_vert_default=rotated,battery_default={paths:{path43:{type:"path",points:[{x:-.05901489999999909,y:-.18831315000000015},{x:-.05869489999999833,y:.11814524999999954}],color:"primary",fill:!1},"path43-6":{type:"path",points:[{x:.015375000000000805,y:-.12533125000000034},{x:.016669000000000933,y:.05562075000000033}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.06443049999999961,y:-.032673549999999496},{x:-.4368029,y:-.032673549999999496}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:.4350822999999997,y:-.03438825000000034},{x:.028285099999999952,y:-.03438825000000034}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.027835099999999446,y:-.26964474999999943},bottom1:{type:"text",text:"{VAL}",x:-.028373699999999502,y:.19564474999999967}},refblocks:{left1:{x:-.4458008,y:-.033557849999999334},right1:{x:.4458008,y:-.03343344999999931}},bounds:{minX:-.473959241,maxX:.473959241,minY:-.3656447499999994,maxY:.27564474999999966,width:.947918482,height:.2912894999999991,centerX:0,centerY:-.04499999999999987},circles:{}},{paths:paths3,texts:texts2,bounds:bounds3,refblocks:refblocks3,circles:circles3}=battery_default,battery_horz_default={primitives:[...Object.values(paths3),...Object.values(circles3),{...texts2.top1,anchor:"middle_bottom"},{...texts2.bottom1,anchor:"middle_top"}],ports:[{...refblocks3.left1,labels:["1"]},{...refblocks3.right1,labels:["2"]}],size:{width:bounds3.width,height:bounds3.height},center:{x:bounds3.centerX,y:bounds3.centerY}},battery_vert_default=rotateSymbol(battery_horz_default),boxresistor_default={paths:{path1:{type:"path",points:[{x:-.511850799999999,y:-.04116140000000179},{x:-.24726749999999953,y:-.04116140000000179}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.2818991000000013,y:-.04116140000000179},{x:.5464825000000006,y:-.04116140000000179}],color:"primary",fill:!1},path3:{type:"path",points:[{x:.0173157000000006,y:-.17345310000000147},{x:.2818990000000001,y:-.17345310000000147},{x:.2818990000000001,y:.09113029999999789},{x:-.24726770000000053,y:.09113029999999789},{x:-.24726770000000053,y:-.17345310000000147},{x:.017315699999998824,y:-.17345310000000147}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.0014247999999992267,y:-.24499800000000072},bottom1:{type:"text",text:"{VAL}",x:-.0004627999999997634,y:.2549980000000005}},refblocks:{left1:{x:-.5337907000000002,y:-.04080519999999943},right1:{x:.5337907000000004,y:-.04025870000000076}},bounds:{minX:-.5619491410000002,maxX:.5619491410000004,minY:-.3449980000000007,maxY:.2549980000000005,width:1.1238982820000005,height:.24999600000000122,centerX:11102230246251565e-32,centerY:-.045000000000000095},circles:{}},{paths:paths4,texts:texts3,bounds:bounds4,refblocks:refblocks4}=boxresistor_default,boxresistor_horz_default={primitives:[...Object.values(paths4),{...texts3.top1,anchor:"middle_bottom"},{...texts3.bottom1,anchor:"middle_top"}],ports:[{...refblocks4.left1,labels:["1"]},{...refblocks4.right1,labels:["2"]}],size:{width:bounds4.width,height:bounds4.height},center:{x:bounds4.centerX,y:bounds4.centerY}},boxresistor_vert_default=rotateSymbol(boxresistor_horz_default),capacitor_default={paths:{path27:{type:"path",points:[{x:.5229378000000002,y:-.012283099999995883},{x:.07314620000000005,y:-.012283099999995883}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-.08560379999999945,y:-.012283099999995883},{x:-.5353954999999999,y:-.012283099999995883}],color:"primary",fill:!1},path29:{type:"path",points:[{x:.07314620000000005,y:-.2768663999999976},{x:.07314620000000005,y:.2523002000000023}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-.0856037999999999,y:-.2768663999999976},{x:-.08560379999999945,y:.2523002000000023}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.012864500000000056,y:-.4150086999999978},bottom1:{type:"text",text:"{VAL}",x:-.003850500000000423,y:.4250087000000011}},refblocks:{left1:{x:-.5512093000000002,y:-.011380399999998403},right1:{x:.5512093,y:-.011926899999997076}},bounds:{minX:-.5793677410000002,maxX:.579367741,minY:-.5150086999999978,maxY:.4250087000000011,width:1.1587354820000002,height:.5900173999999989,centerX:-11102230246251565e-32,centerY:-.04499999999999832},circles:{}},{paths:paths5,bounds:bounds5,refblocks:refblocks5,texts:texts4}=capacitor_default,capacitor_horz_default={primitives:[...Object.values(paths5),{...texts4.top1,anchor:"middle_bottom"},{...texts4.bottom1,anchor:"middle_top"}],ports:[{...refblocks5.left1,labels:["1"]},{...refblocks5.right1,labels:["2"]}],size:{width:bounds5.width,height:bounds5.height},center:{x:bounds5.centerX,y:bounds5.centerY}},capacitor_down_default=rotateSymbol(capacitor_horz_default,"down"),capacitor_left_default=rotateSymbol(capacitor_horz_default,"left"),capacitor_right_default=capacitor_horz_default,capacitor_up_default=rotateSymbol(capacitor_horz_default,"up"),capacitor_vert_default=rotateSymbol(capacitor_horz_default),constant_current_diode_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.2899773000000003,y:-.2633966000000001},{x:.2899773000000003,y:.2633966000000001}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.36197569999999946},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.43234960000000044}},refblocks:{left1:{x:-.5446330999999993,y:.000852800000000542},right1:{x:.5381638000000004,y:-.00014359999999924433}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:-.2633966000000001,maxY:.2633966000000001,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.007128299999999532,radius:.28854213,color:"primary",fill:!1}}},{paths:paths6,texts:texts5,bounds:bounds6,refblocks:refblocks6,circles:circles4}=constant_current_diode_default,constant_current_diode_horz_default={primitives:[...Object.values(paths6),...Object.values(circles4),{...texts5.top1,anchor:"middle_left",x:-.15,y:-.4},{...texts5.bottom1,anchor:"middle_left",x:-.15}],ports:[{...refblocks6.left1,labels:["1"]},{...refblocks6.right1,labels:["2"]}],size:{width:bounds6.width,height:bounds6.height},center:{x:bounds6.centerX,y:bounds6.centerY}},rotatedSymbol2=rotateSymbol(constant_current_diode_horz_default),texts6=rotatedSymbol2.primitives.filter(lV=>lV.type==="text"),val2=texts6.find(lV=>lV.text==="{VAL}");val2.x=-.35,val2.y=0,val2.anchor="middle_right";var ref2=texts6.find(lV=>lV.text==="{REF}");ref2.y=0,ref2.x=.35,ref2.anchor="middle_left";var constant_current_diode_vert_default=rotatedSymbol2,crystal_default={paths:{path27:{type:"path",points:[{x:.5229378000000002,y:-.012283099999995883},{x:.13246630000000037,y:-.012283099999995883}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-.14263049999999966,y:-.012283099999995883},{x:-.5353954999999999,y:-.012283099999995883}],color:"primary",fill:!1},path29:{type:"path",points:[{x:.12606289999999998,y:-.2768663999999976},{x:.12606290000000042,y:.2523002000000023}],color:"primary",fill:!1},"path29-2":{type:"path",points:[{x:.07263109999999973,y:-.27614569999999716},{x:.07263110000000017,y:.253020900000001}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-.13852050000000027,y:-.2768663999999976},{x:-.13852049999999982,y:.2523002000000023}],color:"primary",fill:!1},"path29-5":{type:"path",points:[{x:-.08244070000000026,y:-.27777869999999893},{x:-.08244069999999981,y:.2513879000000028}],color:"primary",fill:!1},"path29-2-7":{type:"path",points:[{x:.07253150000000019,y:-.27761959999999597},{x:-.08185069999999994,y:-.27761959999999597}],color:"primary",fill:!1},"path29-2-7-6":{type:"path",points:[{x:.0721257000000004,y:.255806800000002},{x:-.08225649999999973,y:.255806800000002}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.012864500000000056,y:-.4150086999999978},bottom1:{type:"text",text:"{VAL}",x:-.003850500000000423,y:.4250087000000011}},refblocks:{left1:{x:-.5512093000000002,y:-.011380399999998403},right1:{x:.5512093,y:-.011926899999997076}},bounds:{minX:-.5793677410000002,maxX:.579367741,minY:-.5150086999999978,maxY:.4250087000000011,width:1.1587354820000002,height:1,centerX:-11102230246251565e-32,centerY:-.04499999999999832},circles:{}},{paths:paths7,texts:texts7,bounds:bounds7,refblocks:refblocks7,circles:circles5}=crystal_default,crystal_horz_default={primitives:[...Object.values(paths7),...Object.values(circles5),{type:"text",text:"{REF}",x:-.012864500000000056,y:-.4150086999999978,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:-.003850500000000423,y:.4250087000000011,anchor:"middle_top"}],ports:[{...refblocks7.left1,labels:["1"]},{...refblocks7.right1,labels:["2"]}],size:{width:bounds7.width,height:bounds7.height},center:{x:bounds7.centerX,y:bounds7.centerY}},rotatedSymbol3=rotateSymbol(crystal_horz_default),texts8=rotatedSymbol3.primitives.filter(lV=>lV.type==="text"),ref3=texts8.find(lV=>lV.text==="{REF}"),val3=texts8.find(lV=>lV.text==="{VAL}");val3.x=-.4,ref3.x=.35;var crystal_vert_default=rotatedSymbol3,darlington_pair_transistor_default={paths:{path11:{type:"path",points:[{x:1.9942486145,y:1.6315233295000002},{x:2.0984258145,y:1.6321433295000003}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:2.1030704145000003,y:1.4702420295},{x:2.1026604145,y:1.7934203295}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:2.2218770145,y:1.4862575295},{x:2.1063461145,y:1.5650515295000003}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:2.2286252145,y:1.7712556295000002},{x:2.1136540145000002,y:1.6926424295}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:2.2273251145,y:1.4841963295},{x:2.2284101145,y:1.1411599295000001}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:2.2276017145,y:1.9460598295},{x:2.2281317145,y:1.7781501295000002}],color:"primary",fill:!1},"arrow-2":{type:"path",points:[{x:2.1704797145,y:1.6884541295000002},{x:2.1275815145,y:1.7497189295000002},{x:2.1917009144999997,y:1.7494989295000003},{x:2.1704797145,y:1.6884541295000002}],color:"primary",fill:!0},path1:{type:"path",points:[{x:1.5978828145000001,y:1.4913252295000001},{x:1.8597023145000002,y:1.4928722295}],color:"primary",fill:!1},path2:{type:"path",points:[{x:1.8686937145000002,y:1.3305097295000001},{x:1.8682837145,y:1.6536880295}],color:"primary",fill:!1},path3:{type:"path",points:[{x:1.9875004145000004,y:1.3465253295000001},{x:1.8719693145,y:1.4253192295000001}],color:"primary",fill:!1},path4:{type:"path",points:[{x:1.9942486145,y:1.6315233295000002},{x:1.8792773145000001,y:1.5529101295000003}],color:"primary",fill:!1},"arrow-1":{type:"path",points:[{x:1.9361028144999999,y:1.5487218295000003},{x:1.8932048145,y:1.6099866295000003},{x:1.9573242144999998,y:1.6097666295000004},{x:1.9361028144999999,y:1.5487218295000003}],color:"primary",fill:!0},path9:{type:"path",points:[{x:1.9943087144999998,y:1.3432655295000002},{x:2.2269582145,y:1.3449695295000001}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{VAL}",x:1.8,y:1.8674276295000003},right1:{type:"text",text:"{REF}",x:1.8,y:1.177447295}},refblocks:{right1:{x:2.2278680145,y:1.1297132295},right2:{x:1.5977076145000002,y:1.4920988295000002},right3:{x:2.2278617145000004,y:1.9544573295000003}},bounds:{minX:1.5810976555000003,maxX:2.3461148445,minY:1.0757447295,maxY:1.9710672885000002,width:1,height:1,centerX:1.9636062500000002,centerY:1.5234060090000001},circles:{"path1-0":{type:"circle",x:2.0463372145000003,y:1.5256545295000001,radius:.29977763,color:"primary",fill:!1}}},{paths:paths8,texts:texts9,bounds:bounds8,refblocks:refblocks8,circles:circles6}=darlington_pair_transistor_default,darlington_pair_transistor_horz_default={primitives:[...Object.values(paths8),...Object.values(circles6),{...texts9.bottom1,anchor:"middle_top"},{...texts9.right1,anchor:"middle_bottom"}],ports:[{...refblocks8.right1,labels:["3"]},{...refblocks8.right2,labels:["1"]},{...refblocks8.right3,labels:["2"]}],size:{width:bounds8.width,height:bounds8.height},center:{x:bounds8.centerX,y:bounds8.centerY}},darlington_pair_transistor_vert_default=rotateSymbol(darlington_pair_transistor_horz_default),dc_ammeter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-.12447409999999959,y:.0852510999999998},{x:.11626639999999999,y:.0852510999999998}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.4472267999999995},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.3470985000000004},left1:{type:"text",text:"A",x:0,y:-.1}},refblocks:{left1:{x:-.5446330999999993,y:0},right1:{x:.5381638000000004,y:0}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:-.08525110000000002,maxY:.0852510999999998,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:-11102230246251565e-32},circles:{path1:{type:"circle",x:0,y:0,radius:.28854213,color:"primary",fill:!1}}},{paths:paths9,texts:texts10,bounds:bounds9,refblocks:refblocks9,circles:circles7}=dc_ammeter_default,dc_ammeter_horz_default={primitives:[...Object.values(paths9),...Object.values(circles7),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"},{...texts10.left1,anchor:"center",fontSize:.3}],ports:[{...refblocks9.left1,labels:["1"]},{...refblocks9.right1,labels:["2"]}],size:{width:bounds9.width,height:bounds9.height},center:{x:bounds9.centerX,y:bounds9.centerY}};function isPathPrimitive(lV){return typeof lV=="object"&&lV!==null&&lV.type==="path"&&Array.isArray(lV.points)&&typeof lV.color=="string"}function isTextPrimitive(lV){return typeof lV=="object"&&lV!==null&&lV.type==="text"&&typeof lV.text=="string"&&typeof lV.x=="number"&&typeof lV.y=="number"&&typeof lV.anchor=="string"}var{6:letter2,2:underline,...rest2}=dc_ammeter_horz_default.primitives;isPathPrimitive(underline)&&underline.points.map(lV=>{lV.y+=.05}),isTextPrimitive(letter2)&&(letter2.y+=.025);function isPrimitive2(lV){return typeof lV=="object"}var rotatedSymbol4=rotateSymbol({...dc_ammeter_horz_default,primitives:Object.values(rest2).filter(isPrimitive2)}),dc_ammeter_vert_default={...rotatedSymbol4,primitives:[...rotatedSymbol4.primitives,letter2,underline]},dc_voltmeter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:.09442299999999992,y:-.13438304999999984},{x:-.004364400000000712,y:.05710404999999996},{x:-.1110211000000012,y:-.13438304999999984}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-.12447409999999959,y:.13438304999999984},{x:.11626639999999999,y:.13438304999999984}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.39809484999999944},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.39623045000000046}},refblocks:{left1:{x:-.5446330999999993,y:0},right1:{x:.5381638000000004,y:0}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:-.13438304999999984,maxY:.13438304999999984,width:1.0614356000000003,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0,radius:.28854213,color:"primary",fill:!1}}},{paths:paths10,texts:texts11,bounds:bounds10,refblocks:refblocks10,circles:circles8}=dc_voltmeter_default,dc_voltmeter_horz_default={primitives:[...Object.values(paths10),...Object.values(circles8),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"}],ports:[{...refblocks10.left1,labels:["1"]},{...refblocks10.right1,labels:["2"]}],size:{width:bounds10.width,height:bounds10.height},center:{x:bounds10.centerX,y:bounds10.centerY}},{2:letter3,3:underline2,...rest3}=dc_voltmeter_horz_default.primitives;function isPrimitive3(lV){return typeof lV=="object"}var rotatedSymbol5=rotateSymbol({...dc_voltmeter_horz_default,primitives:Object.values(rest3).filter(isPrimitive3)}),dc_voltmeter_vert_default={...rotatedSymbol5,primitives:[...rotatedSymbol5.primitives,letter3,underline2]},diac_default={paths:{path11:{type:"path",points:[{x:-.5176700499999997,y:-.03674505000000039},{x:-.10888805000000024,y:-.03674505000000039}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.1031184499999993,y:-.03674505000000039},{x:.5246894499999994,y:-.03674505000000039}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-.09343985000000021,y:.15120634999999893},{x:-.0930998500000002,y:-.2533405500000008}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:.08519034999999908,y:.15003384999999914},{x:.08553034999999909,y:-.2545130500000006}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-.08315755000000014,y:-.05093445000000041},{x:-.08415755000000047,y:.15178124999999976},{x:.08653524999999984,y:.05604664999999964},{x:-.08126175000000035,y:-.051477150000000194}],color:"primary",fill:!0},"path11-0-9-0":{type:"path",points:[{x:.07661224999999927,y:-.25165445000000086},{x:.07761224999999983,y:-.04893885000000098},{x:-.0930805500000007,y:-.1446734500000011},{x:.07471644999999949,y:-.2521971500000013}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-.17328624999999964,y:-.41183614999999985},bottom1:{type:"text",text:"{VAL}",x:-.03022294999999975,y:.4218361500000001}},refblocks:{left1:{x:-.54139845,y:-.0358920500000004},right1:{x:.5413984499999995,y:-.03688844999999996}},bounds:{minX:-.569556891,maxX:.5695568909999995,minY:-.5118361499999998,maxY:.4218361500000001,width:1.1391137819999995,height:.5836722999999999,centerX:-2220446049250313e-31,centerY:-.04499999999999987},circles:{path1:{type:"circle",x:-.0037626500000003116,y:-.04387315000000025,radius:.28854213,color:"primary",fill:!1}}},{paths:paths11,texts:texts12,bounds:bounds11,refblocks:refblocks11,circles:circles9}=diac_default,diac_horz_default={primitives:[...Object.values(paths11),...Object.values(circles9),{...texts12.top1,anchor:"middle_bottom"},{...texts12.bottom1,anchor:"middle_top"}],ports:[{...refblocks11.left1,labels:["1"]},{...refblocks11.right1,labels:["2"]}],size:{width:bounds11.width,height:bounds11.height},center:{x:bounds11.centerX,y:bounds11.centerY}},rotatedSymbol6=rotateSymbol(diac_horz_default),texts13=rotatedSymbol6.primitives.filter(lV=>lV.type==="text"),ref4=texts13.find(lV=>lV.text==="{REF}"),val4=texts13.find(lV=>lV.text==="{VAL}");ref4.y=0,val4.y=0;var diac_vert_default=rotatedSymbol6,diode_default={paths:{path40:{type:"path",points:[{x:.14458890000000002,y:-.03903629999999936},{x:-.1199943999999995,y:.09325540000000032}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.1199943999999995,y:-.1713280000000026},{x:.14458890000000002,y:-.03903629999999936}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.1199943999999995,y:.09325539999999677},{x:-.1199943999999995,y:-.1713280000000026}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.14458890000000002,y:-.1713280000000026},{x:.14458890000000002,y:.09325539999999677}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.12219909999999956,y:-.03903629999999936},{x:-.5168693999999996,y:-.03903629999999936}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:.5233797,y:-.038951100000002015},{x:.14967160000000002,y:-.038951100000002015}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.0050250999999996715,y:-.26884529999999884},bottom1:{type:"text",text:"{VAL}",x:-.00011179999999999524,y:.2788453000000004}},refblocks:{left1:{x:-.5191471000000001,y:-.0399206999999997},right1:{x:.5191471000000001,y:-.03889610000000232}},bounds:{minX:-.5473055410000001,maxX:.5473055410000001,minY:-.3688452999999988,maxY:.2788453000000004,width:1.0946110820000001,height:.29769059999999925,centerX:0,centerY:-.04499999999999921},circles:{}},{paths:paths12,texts:texts14,bounds:bounds12,refblocks:refblocks12,circles:circles10}=diode_default,diode_right_default={primitives:[...Object.values(paths12),...Object.values(circles10),{...texts14.top1,anchor:"middle_bottom"},{...texts14.bottom1,anchor:"middle_top"}],ports:[{...refblocks12.left1,labels:["1"]},{...refblocks12.right1,labels:["2"]}],size:{width:bounds12.width,height:bounds12.height},center:{x:bounds12.centerX,y:bounds12.centerY}},diode_down_default=rotateSymbol(diode_right_default,"down"),diode_left_default=rotateSymbol(diode_right_default,"left"),diode_up_default=rotateSymbol(diode_right_default,"up"),dpst_switch_default={paths:{path11:{type:"path",points:[{x:-.3622268000000006,y:-.05787995000000046},{x:-.1357978000000004,y:-.05787995000000046}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-.12009950000000069,y:-.0563494500000008},{x:.10307889999999986,y:-.19603885000000099}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.12795640000000064,y:-.05787995000000046},{x:.36869780000000096,y:-.05787995000000046}],color:"primary",fill:!1},"path11-5":{type:"path",points:[{x:-.3622270999999999,y:.1736642499999992},{x:-.1357980999999997,y:.1736642499999992}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:-.12009979999999998,y:.17519474999999973},{x:.10307860000000058,y:.035505349999999325}],color:"primary",fill:!1},"path12-0":{type:"path",points:[{x:.12795610000000002,y:.1736642499999992},{x:.3686968000000006,y:.1736642499999992}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.1958158999999995,y:-.39216264999999995},bottom1:{type:"text",text:"{VAL}",x:-.029144200000000398,y:.40216264999999995}},refblocks:{bottom1:{x:-.12356020000000001,y:.17845394999999975},bottom2:{x:.1153169000000005,y:.17845394999999975},left1:{x:-.37614279999999956,y:-.057027350000000254},left2:{x:-.12356020000000001,y:-.05309054999999985},left3:{x:-.37614279999999956,y:.17451715000000023},right1:{x:.37614279999999933,y:-.05802374999999982},right2:{x:.1153169000000005,y:-.05309054999999985},right3:{x:.37614279999999933,y:.17352074999999978}},bounds:{minX:-.40430124099999953,maxX:.4043012409999993,minY:-.4921626499999999,maxY:.40216264999999995,width:1,height:1,centerX:-11102230246251565e-32,centerY:-.044999999999999984},circles:{}},{paths:paths13,texts:texts15,bounds:bounds13,refblocks:refblocks13,circles:circles11}=dpst_switch_default,dpst_switch_horz_default={primitives:[...Object.values(paths13),...Object.values(circles11),{...texts15.top1,anchor:"middle_bottom",x:0},{...texts15.bottom1,anchor:"middle_top",x:0}],ports:[{...refblocks13.left1,labels:["1","left1"]},{...refblocks13.left3,labels:["3","left3"]},{...refblocks13.right1,labels:["2","right1"]},{...refblocks13.right3,labels:["4","right3"]}],size:{width:bounds13.width,height:bounds13.height},center:{x:bounds13.centerX,y:bounds13.centerY}},rotatedSymbol7=rotateSymbol(dpst_switch_horz_default),texts16=rotatedSymbol7.primitives.filter(lV=>lV.type==="text"),val5=texts16.find(lV=>lV.text==="{VAL}");val5.anchor="middle_right",val5.x=-.35,val5.y=0;var ref5=texts16.find(lV=>lV.text==="{REF}");ref5.anchor="middle_left",ref5.x=.3,ref5.y=0;var dpst_switch_vert_default=rotatedSymbol7,filled_diode_default={paths:{path11:{type:"path",points:[{x:-.5464958295000011,y:-.03674480953641934},{x:-.22498262950000125,y:-.03674480953641934}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.13950697049999894,y:-.04461410953641942},{x:.45879767049999964,y:-.04461410953641942}],color:"primary",fill:!1},"path12-6":{type:"path",points:[{x:.1346534705000002,y:.1570013904635803},{x:.13354747050000015,y:-.24621560953641985}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-.2177038295000011,y:-.26567520953641943},{x:-.2197708295000007,y:.15700869046358035},{x:.13282137049999876,y:-.0426085095364197},{x:-.21378932950000062,y:-.2668066095364201}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-.2435859295000009,y:-.3777354095364187},bottom1:{type:"text",text:"{VAL}",x:-.07353149016142102,y:.3877354095364185},right1:{type:"text",text:"",x:.5834896704999997,y:.3364777904635812}},refblocks:{left1:{x:-.5653312295,y:-.0358920095364188},right1:{x:.47024967049999944,y:-.044757709536418666}},bounds:{minX:-.5934896705,maxX:.6834896704999996,minY:-.4777354095364187,maxY:.3877354095364185,width:1.2769793409999997,height:1,centerX:.04499999999999982,centerY:-.045000000000000095},circles:{}},{paths:paths14,texts:texts17,bounds:bounds14,refblocks:refblocks14,circles:circles12}=filled_diode_default,filled_diode_horz_default={primitives:[...Object.values(paths14),...Object.values(circles12),{type:"text",text:"{REF}",x:-.1,y:-.38,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:-.1,y:.28,anchor:"middle_top"}],ports:[{...refblocks14.left1,labels:["1"]},{...refblocks14.right1,labels:["2"]}],size:{width:bounds14.width,height:bounds14.height},center:{x:bounds14.centerX,y:bounds14.centerY}},filled_diode_vert_default=rotateSymbol(filled_diode_horz_default),frequency_meter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.36197569999999946},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.43234960000000044},left1:{type:"text",text:"Hz",x:0,y:-.035}},refblocks:{left1:{x:-.5446330999999993,y:.000852800000000542},right1:{x:.5381638000000004,y:-.00014359999999924433}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:0,maxY:0,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.007128299999999532,radius:.28854213,color:"primary",fill:!1}}},{paths:paths15,texts:texts18,bounds:bounds15,refblocks:refblocks15,circles:circles13}=frequency_meter_default,frequency_meter_horz_default={primitives:[...Object.values(paths15),...Object.values(circles13),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"},{...texts18.left1,anchor:"center",fontSize:.2}],ports:[{...refblocks15.left1,labels:["1"]},{...refblocks15.right1,labels:["2"]}],size:{width:bounds15.width,height:bounds15.height},center:{x:bounds15.centerX,y:bounds15.centerY}},{5:letter4,...rest4}=frequency_meter_horz_default.primitives;function isPrimitive4(lV){return typeof lV=="object"}var rotatedSymbol8=rotateSymbol({...frequency_meter_horz_default,primitives:Object.values(rest4).filter(isPrimitive4)}),frequency_meter_vert_default={...rotatedSymbol8,primitives:[...rotatedSymbol8.primitives,letter4]},fuse_default={paths:{path10:{type:"path",points:[{x:-.5283037500000001,y:-.03141365000000107},{x:.5300302500000003,y:-.03141365000000107}],color:"primary",fill:!1},path14:{type:"path",points:[{x:.0008652499999994845,y:-.16370535000000075},{x:.2654482499999995,y:-.16370535000000075},{x:.2654482499999995,y:.10087804999999861},{x:-.2637187499999998,y:.10087804999999861},{x:-.2637187499999998,y:-.16370535000000075},{x:.0008652499999994845,y:-.16370535000000075}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.008263949999999909,y:-.23091725000000096},bottom1:{type:"text",text:"{VAL}",x:-.1716539500000005,y:.24091724999999897}},refblocks:{left1:{x:-.5345548500000001,y:-.03446055000000037},right1:{x:.5345548500000001,y:-.030256149999999593}},bounds:{minX:-.5627132910000001,maxX:.5627132910000001,minY:-.33091725000000094,maxY:.24091724999999897,width:1.1254265820000002,height:.22183449999999993,centerX:0,centerY:-.045000000000000984},circles:{}},{paths:paths16,texts:texts19,bounds:bounds16,refblocks:refblocks16}=fuse_default,fuse_horz_default={primitives:[...Object.values(paths16),{...texts19.top1,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.2,anchor:"middle_top"}],ports:[{...refblocks16.left1,labels:["1"]},{...refblocks16.right1,labels:["2"]}],size:{width:bounds16.width,height:bounds16.height},center:{x:bounds16.centerX,y:bounds16.centerY}},fuse_vert_default=rotateSymbol(fuse_horz_default),ground_default={paths:{path1:{type:"path",points:[{x:-.3449701000000003,y:-.4545300000000001},{x:-.044970100000000235,y:-.4545300000000001}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-.025322899999999926,y:-.25053000000000014},{x:-.025322900000000148,y:-.65053}],color:"primary",fill:!1},path3:{type:"path",points:[{x:.04499999999999993,y:-.3005300000000002},{x:.04499999999999993,y:-.60053}],color:"primary",fill:!1},path4:{type:"path",points:[{x:.14499999999999957,y:-.40053000000000005},{x:.14499999999999957,y:-.5005300000000001}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{REF}",x:-.45500000000000007,y:.6505299999999998},right1:{type:"text",text:"{VAL}",x:.4449999999999996,y:-.35053}},refblocks:{top1:{x:-.3449701000000003,y:-.4545300000000001},top2:{x:.16500000000000004,y:-.4535300000000002}},bounds:{minX:-.45500000000000007,maxX:.5449999999999996,minY:-.65053,maxY:.6505299999999998,width:.9999999999999997,height:.9510599999999999,centerX:.04499999999999976,centerY:-11102230246251565e-32},circles:{}},{paths:paths17,circles:circles14,bounds:bounds17,refblocks:refblocks17}=ground_default,horizontalSymbol={primitives:[...Object.values(paths17),...Object.values(circles14),{type:"text",text:"{REF}",x:-.1,y:-.8,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:-.1,y:-.1,anchor:"middle_top"}],ports:[{...refblocks17.top1,labels:["1"]}],size:{width:bounds17.width,height:bounds17.height},center:{x:bounds17.centerX-.09,y:bounds17.centerY-.45}},ground_horz_default=horizontalSymbol,{paths:paths18,circles:circles15,bounds:bounds18,refblocks:refblocks18}=ground_default,verticalSymbol={primitives:[...Object.values(paths18),...Object.values(circles15),{type:"text",text:"{REF}",x:-.015,y:-.75,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:-.015,y:-.12,anchor:"middle_top"}],ports:[{...refblocks18.top1,labels:["1"]}],size:{width:bounds18.width,height:bounds18.height},center:{x:bounds18.centerX,y:bounds18.centerY-.45}},ground_vert_default=rotateSymbol(verticalSymbol),gunn_diode_default={paths:{path11:{type:"path",points:[{x:-.49895505000000084,y:-.036744850000000495},{x:-.177441850000001,y:-.036744850000000495}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.18704774999999918,y:-.044614150000000574},{x:.5063384499999999,y:-.044614150000000574}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-.3067105499999998,y:-.19992595000000035},{x:-.3084575500000002,y:.10413894999999984},{x:-.01040014999999972,y:-.03945905000000027},{x:-.3034011499999991,y:-.20073985000000039}],color:"primary",fill:!0},"path11-0-9-5":{type:"path",points:[{x:.3324594500000002,y:-.20076375000000035},{x:.33420945000000013,y:.10330114999999984},{x:.03615254999999973,y:-.04029685000000027},{x:.32915344999999974,y:-.20157765000000039}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-.11729224999999999,y:-.37773544999999986},bottom1:{type:"text",text:"{VAL}",x:.030109249999999532,y:.38773544999999987}},refblocks:{left1:{x:-.5177904499999998,y:-.03589204999999995},right1:{x:.5177904499999997,y:-.04475774999999982}},bounds:{minX:-.5459488909999998,maxX:.5459488909999997,minY:-.47773544999999984,maxY:.38773544999999987,width:1.0918977819999993,height:1,centerX:-5551115123125783e-32,centerY:-.044999999999999984},circles:{}},{paths:paths19,texts:texts20,bounds:bounds19,refblocks:refblocks19,circles:circles16}=gunn_diode_default,gunn_diode_horz_default={primitives:[...Object.values(paths19),...Object.values(circles16),{...texts20.top1,anchor:"middle_left"},{type:"text",text:"{VAL}",x:-.11,y:.38773544999999987}],ports:[{...refblocks19.left1,labels:["1"]},{...refblocks19.right1,labels:["2"]}],size:{width:bounds19.width,height:bounds19.height},center:{x:bounds19.centerX,y:bounds19.centerY}},rotatedSymbol9=rotateSymbol(gunn_diode_horz_default),texts21=rotatedSymbol9.primitives.filter(lV=>lV.type==="text"),ref6=texts21.find(lV=>lV.text==="{REF}"),val6=texts21.find(lV=>lV.text==="{VAL}");ref6.x=.25,ref6.y=-.045,val6.x=-.55,val6.y=0;var gunn_diode_vert_default=rotatedSymbol9,igbt_transistor_default={paths:{path11:{type:"path",points:[{x:-.33466555000000053,y:-.0037939000000000167},{x:.04390385000000019,y:-.0011709000000001968}],color:"primary",fill:!1},path40:{type:"path",points:[{x:.12457955000000065,y:-.19306540000000028},{x:.123649550000001,y:.1750840999999994}],color:"primary",fill:!1},path42:{type:"path",points:[{x:.06045334999999952,y:.1174366},{x:.06045334999999952,y:-.14714680000000002}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.33417885,y:.2434666000000001},{x:.33357884999999987,y:.5397975000000004}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:.3346655500000004,y:-.5397975000000003},{x:.33406555000000027,y:-.2706031000000002}],color:"primary",fill:!1},path15:{type:"path",points:[{x:.2236118499999995,y:.21260169999999978},{x:.32845994999999917,y:.22765899999999983},{x:.2828999499999987,y:.13876569999999977}],color:"primary",fill:!0},path17:{type:"path",points:[{x:.12747495000000053,y:.08265219999999984},{x:.2829977500000005,y:.19494979999999984}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.1246791499999993,y:-.11535130000000038},{x:.3341235499999988,y:-.2634207000000004}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.10113134999999929,y:-.3683925999999993},bottom1:{type:"text",text:"{VAL}",x:.08975225000000009,y:.4174267000000007}},refblocks:{top1:{x:.3348183499999997,y:-.5593924999999992},bottom1:{x:.3327607500000005,y:.5538097000000006},left1:{x:-.34858084999999983,y:-.0029410999999994747}},bounds:{minX:-.33466555000000053,maxX:.3346655500000004,minY:-.5397975000000003,maxY:.5397975000000004,width:1,height:1.0795950000000007,centerX:-5551115123125783e-32,centerY:5551115123125783e-32},circles:{path1:{type:"circle",x:.18905494999999983,y:-.010922199999999549,radius:.28854213,color:"primary",fill:!1}}},{paths:paths20,texts:texts22,bounds:bounds20,refblocks:refblocks20,circles:circles17}=igbt_transistor_default,igbt_transistor_horz_default={primitives:[...Object.values(paths20),...Object.values(circles17),{type:"text",text:"{REF}",x:0,y:-.4,anchor:"middle_right"},{type:"text",text:"{VAL}",x:0,y:.4,anchor:"middle_right"}],ports:[{...refblocks20.top1,labels:["1"]},{...refblocks20.bottom1,labels:["2"]},{...refblocks20.left1,labels:["3"]}],size:{width:bounds20.width,height:bounds20.height},center:{x:bounds20.centerX+.06,y:bounds20.centerY}},rotated2=rotateSymbol(igbt_transistor_horz_default),ref7=rotated2.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val7=rotated2.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref7.anchor="middle_left",val7.anchor="middle_right",ref7.x=.45,ref7.y+=.065,val7.y+=.065;var igbt_transistor_vert_default=rotated2,illuminated_push_button_normally_open_default={paths:{"path12-1-8-6-9":{type:"path",points:[{x:.023137150000000162,y:.024940499999996035},{x:.023137150000000162,y:.10494049999999788}],color:"primary",fill:!1},"path12-1-5-6":{type:"path",points:[{x:-.48740694999999956,y:.18801149999999645},{x:-.1731006500000003,y:.18801149999999645}],color:"primary",fill:!1},"path12-1-5-6-8":{type:"path",points:[{x:.023792949999999813,y:-.1693045000000044},{x:.023792949999999813,y:-.1026565000000037}],color:"primary",fill:!1},"path12-1-8-0":{type:"path",points:[{x:-.14922445000000018,y:.035203499999997945},{x:.19549865000000022,y:.18762249999999803}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:.19549885000000078,y:.18762249999999803},{x:.4881437499999999,y:.18762249999999803}],color:"primary",fill:!1},"path12-1-8-6-9-4":{type:"path",points:[{x:.023137150000000162,y:-.11686550000000295},{x:.023137150000000162,y:-.015065500000002174}],color:"primary",fill:!1},"path12-1-8-6-9-4-3":{type:"path",points:[{x:.08312335000000015,y:-.10471550000000285},{x:.08312335000000015,y:-.047931500000004235}],color:"primary",fill:!1},"path12-1-8-6-9-4-3-1":{type:"path",points:[{x:-.03684904999999983,y:-.10471550000000285},{x:-.03684904999999983,y:-.047931500000004235}],color:"primary",fill:!1},"path12-1-8-6-9-4-4":{type:"path",points:[{x:.08312335000000015,y:-.10471550000000285},{x:-.03684904999999983,y:-.10471550000000285}],color:"primary",fill:!1},"path14-5":{type:"path",points:[{x:-.011640198644880861,y:-.2799169119921796},{x:.01182744133211866,y:-.2516822395036833},{x:.035295081309120846,y:-.22344756701517987},{x:.05876272128612037,y:-.19521289452668178}],color:"primary",fill:!0},"path14-5-3":{type:"path",points:[{x:-.011818241440559873,y:-.1952224926985373},{x:.01171692178543804,y:-.22339535480803718},{x:.03525208501144128,y:-.2515682169175424},{x:.058787248237439194,y:-.27974107902703693}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:.010987250000000337,y:-.37833950000000094},bottom1:{type:"text",text:"{VAL}",x:-.1564439499999999,y:.3883394999999972}},refblocks:{left1:{x:-.4717985499999999,y:.18798249999999506},right1:{x:.4717985499999999,y:.1880084999999987}},bounds:{minX:-.4999569909999999,maxX:.4999569909999999,minY:-.4783395000000009,maxY:.3883394999999972,width:.9999139819999998,height:.5166789999999981,centerX:0,centerY:-.04500000000000187},circles:{path9:{type:"circle",x:.02379285000000042,y:-.23747350000000367,radius:.059920847,color:"primary",fill:!1}}},{paths:paths21,texts:texts23,bounds:bounds21,refblocks:refblocks21,circles:circles18}=illuminated_push_button_normally_open_default,illuminated_push_button_normally_open_horz_default={primitives:[...Object.values(paths21),...Object.values(circles18),{...texts23.top1,anchor:"middle_right",x:0,y:-.4},{...texts23.bottom1,anchor:"middle_right",x:0}],ports:[{...refblocks21.left1,labels:["1"]},{...refblocks21.right1,labels:["2"]}],size:{width:bounds21.width,height:bounds21.height},center:{x:bounds21.centerX,y:bounds21.centerY}},rotatedSymbol10=rotateSymbol(illuminated_push_button_normally_open_horz_default),texts24=rotatedSymbol10.primitives.filter(lV=>lV.type==="text"),val8=texts24.find(lV=>lV.text==="{VAL}");val8.x=-.35,val8.y=0,val8.anchor="middle_right";var ref8=texts24.find(lV=>lV.text==="{REF}");ref8.y=0,ref8.x=.35,ref8.anchor="middle_left";var illuminated_push_button_normally_open_vert_default=rotatedSymbol10,inductor_default={paths:{path8698:{type:"path",points:[{x:-.20003504999999944,y:.028826854587890027},{x:-.2033544366666661,y:.022384739650748782},{x:-.20667382333333278,y:.015976838014532466},{x:-.20999320999999949,y:.009636988132081447},{x:-.21331259666666616,y:.003398282866981144},{x:-.21663198333333286,y:-.002707293078776634},{x:-.21995136999999956,y:-.008649213595881871},{x:-.2232707566666662,y:-.014398745618147975},{x:-.2265901433333329,y:-.019929263927997674},{x:-.22990952999999958,y:-.02521654286791855},{x:-.23322891666666629,y:-.030239021761836165},{x:-.23654830333333293,y:-.03497804113839313},{x:-.23986768999999963,y:-.039418047168021914},{x:-.24318707666666634,y:-.04354676207395655},{x:-.246506463333333,y:-.047355318650124094},{x:-.24982584999999968,y:-.05083835741210997},{x:-.25314523666666633,y:-.05399408531679076},{x:-.25646462333333303,y:-.056824295407289886},{x:-.25978400999999973,y:-.05933434716802191},{x:-.26310339666666643,y:-.061533107805059786},{x:-.2664227833333331,y:-.0634328550951695},{x:-.2697421699999998,y:-.06504914286791855},{x:-.2730615566666664,y:-.06640063059466435},{x:-.2763809433333332,y:-.0675088789514813},{x:-.27970032999999983,y:-.06839811359588187},{x:-.28301971666666653,y:-.0690949597454433},{x:-.28633910333333323,y:-.06962815046635218},{x:-.2896584899999999,y:-.07002821186791855},{x:-.2929778766666666,y:-.07032712865213421},{x:-.2962972633333332,y:-.07055799368258454},{x:-.29961664999999993,y:-.07075464541210996},{x:-.30293603333333324,y:-.07055799368258453},{x:-.30625541666666656,y:-.07032712865213421},{x:-.30957479999999993,y:-.07002821186791855},{x:-.31289418333333324,y:-.06962815046635219},{x:-.31621356666666656,y:-.0690949597454433},{x:-.31953294999999987,y:-.06839811359588187},{x:-.32285233333333313,y:-.0675088789514813},{x:-.3261717166666665,y:-.06640063059466433},{x:-.32949109999999976,y:-.06504914286791855},{x:-.33281048333333313,y:-.06343285509516951},{x:-.33612986666666644,y:-.061533107805059786},{x:-.33944924999999976,y:-.05933434716802191},{x:-.3427686333333331,y:-.056824295407289886},{x:-.3460880166666664,y:-.05399408531679075},{x:-.3494073999999997,y:-.05083835741210997},{x:-.352726783333333,y:-.0473553186501241},{x:-.35604616666666633,y:-.04354676207395655},{x:-.35936554999999964,y:-.039418047168021914},{x:-.362684933333333,y:-.03497804113839313},{x:-.36600431666666633,y:-.030239021761836175},{x:-.3693236999999996,y:-.025216542867918555},{x:-.3726430833333329,y:-.01992926392799769},{x:-.3759624666666663,y:-.014398745618147961},{x:-.3792818499999996,y:-.008649213595881871},{x:-.38260123333333285,y:-.0027072930787766323},{x:-.38592061666666616,y:.003398282866981149},{x:-.38923999999999953,y:.009636988132081444},{x:-.39255938333333285,y:.015976838014532466},{x:-.39587876666666616,y:.022384739650748775},{x:-.3991981499999995,y:.028826854587890027}],color:"primary",fill:!1},path8700:{type:"path",points:[{x:-.000872049999999458,y:.028826154587890507},{x:-.004191433333332769,y:.022384036317415937},{x:-.00751081666666608,y:.01597613134786629},{x:-.010830199999999391,y:.009636278132081942},{x:-.014149583333332702,y:.003397569533648309},{x:-.01746896666666601,y:-.0027080097454427934},{x:-.020788349999999324,y:-.008649933595881358},{x:-.02410773333333263,y:-.014399468951480792},{x:-.027427116666665946,y:-.019929990594663816},{x:-.030746499999999254,y:-.025217272867918025},{x:-.03406588333333256,y:-.030239755095168967},{x:-.037385266666665876,y:-.03497877780505925},{x:-.04070464999999919,y:-.03941878716802137},{x:-.0440240333333325,y:-.04354750540728934},{x:-.047343416666665805,y:-.0473560653167902},{x:-.05066279999999912,y:-.05083910741210941},{x:-.053982183333332434,y:-.05399483865012353},{x:-.05730156666666574,y:-.05682505207395598},{x:-.06062094999999905,y:-.05933510716802134},{x:-.06394033333333236,y:-.06153387113839254},{x:-.06725971666666566,y:-.06343362176183558},{x:-.07057909999999898,y:-.06504991286791795},{x:-.0738984833333323,y:-.06640140392799708},{x:-.07721786666666561,y:-.06750965561814737},{x:-.08053724999999892,y:-.06839889359588126},{x:-.08385663333333224,y:-.06909574307877601},{x:-.08717601666666554,y:-.06962893713301824},{x:-.09049539999999885,y:-.07002900186791793},{x:-.09381478333333215,y:-.0703279219854669},{x:-.09713416666666547,y:-.07055879034925058},{x:-.10045354999999878,y:-.07075544541210932},{x:-.10377293666666547,y:-.07055879034925057},{x:-.10709232333333214,y:-.0703279219854669},{x:-.11041170999999883,y:-.07002900186791793},{x:-.1137310966666655,y:-.06962893713301824},{x:-.1170504833333322,y:-.06909574307877601},{x:-.1203698699999989,y:-.06839889359588126},{x:-.12368925666666555,y:-.06750965561814737},{x:-.12700864333333226,y:-.06640140392799707},{x:-.13032802999999893,y:-.06504991286791795},{x:-.13364741666666563,y:-.06343362176183559},{x:-.13696680333333228,y:-.06153387113839254},{x:-.14028618999999898,y:-.05933510716802133},{x:-.14360557666666568,y:-.05682505207395598},{x:-.14692496333333235,y:-.05399483865012352},{x:-.15024434999999903,y:-.05083910741210941},{x:-.1535637366666657,y:-.04735606531679021},{x:-.15688312333333237,y:-.04354750540728934},{x:-.16020250999999908,y:-.03941878716802137},{x:-.16352189666666575,y:-.03497877780505926},{x:-.16684128333333245,y:-.030239755095168977},{x:-.1701606699999991,y:-.025217272867918028},{x:-.1734800566666658,y:-.019929990594663834},{x:-.1767994433333325,y:-.014399468951480778},{x:-.1801188299999992,y:-.008649933595881358},{x:-.18343821666666585,y:-.0027080097454427916},{x:-.18675760333333255,y:.0033975695336483144},{x:-.19007698999999922,y:.009636278132081942},{x:-.19339637666666593,y:.01597613134786629},{x:-.19671576333333257,y:.02238403631741593},{x:-.20003514999999927,y:.028826154587890507}],color:"primary",fill:!1},path8702:{type:"path",points:[{x:.19829105000000036,y:.028826154587890507},{x:.19497166333333366,y:.022384036317415937},{x:.191652276666667,y:.01597613134786629},{x:.1883328900000003,y:.009636278132081942},{x:.18501350333333363,y:.003397569533648309},{x:.18169411666666693,y:-.0027080097454427934},{x:.1783747300000003,y:-.008649933595881358},{x:.17505534333333356,y:-.014399468951480792},{x:.1717359566666669,y:-.019929990594663816},{x:.16841657000000018,y:-.025217272867918025},{x:.16509718333333356,y:-.030239755095168967},{x:.16177779666666683,y:-.03497877780505925},{x:.15845841000000016,y:-.03941878716802137},{x:.15513902333333346,y:-.04354750540728934},{x:.15181963666666679,y:-.0473560653167902},{x:.1485002500000001,y:-.05083910741210941},{x:.14518086333333344,y:-.05399483865012353},{x:.14186147666666676,y:-.05682505207395598},{x:.13854209000000006,y:-.05933510716802134},{x:.1352227033333334,y:-.06153387113839254},{x:.13190331666666671,y:-.06343362176183558},{x:.12858393,y:-.06504991286791795},{x:.12526454333333334,y:-.06640140392799708},{x:.12194515666666664,y:-.06750965561814737},{x:.11862576999999996,y:-.06839889359588126},{x:.11530638333333329,y:-.06909574307877601},{x:.11198699666666659,y:-.06962893713301824},{x:.10866760999999991,y:-.07002900186791793},{x:.10534822333333323,y:-.0703279219854669},{x:.10202883666666655,y:-.07055879034925058},{x:.09870944999999987,y:-.07075544541210932},{x:.09539006666666656,y:-.07055879034925057},{x:.09207068333333325,y:-.0703279219854669},{x:.08875129999999994,y:-.07002900186791793},{x:.08543191666666662,y:-.06962893713301824},{x:.08211253333333332,y:-.06909574307877601},{x:.07879315,y:-.06839889359588126},{x:.07547376666666669,y:-.06750965561814737},{x:.07215438333333338,y:-.06640140392799707},{x:.06883500000000006,y:-.06504991286791795},{x:.06551561666666676,y:-.06343362176183559},{x:.06219623333333345,y:-.06153387113839254},{x:.05887685000000013,y:-.05933510716802133},{x:.055557466666666826,y:-.05682505207395598},{x:.05223808333333351,y:-.05399483865012352},{x:.048918700000000204,y:-.05083910741210941},{x:.045599316666666896,y:-.04735606531679021},{x:.04227993333333358,y:-.04354750540728934},{x:.038960550000000274,y:-.03941878716802137},{x:.03564116666666696,y:-.03497877780505926},{x:.03232178333333365,y:-.030239755095168977},{x:.02900240000000034,y:-.025217272867918028},{x:.025683016666667034,y:-.019929990594663834},{x:.022363633333333712,y:-.014399468951480778},{x:.019044250000000405,y:-.008649933595881358},{x:.015724866666667094,y:-.0027080097454427916},{x:.01240548333333378,y:.0033975695336483144},{x:.009086100000000473,y:.009636278132081942},{x:.0057667166666671614,y:.01597613134786629},{x:.002447333333333852,y:.02238403631741593},{x:-.000872049999999458,y:.028826154587890507}],color:"primary",fill:!1},path8704:{type:"path",points:[{x:.39745405000000034,y:.028826154587890507},{x:.3941346666666671,y:.022384036317415937},{x:.3908152833333337,y:.01597613134786629},{x:.38749590000000045,y:.009636278132081942},{x:.3841765166666671,y:.003397569533648309},{x:.3808571333333338,y:-.0027080097454427934},{x:.3775377500000005,y:-.008649933595881358},{x:.37421836666666713,y:-.014399468951480792},{x:.3708989833333339,y:-.019929990594663816},{x:.3675796000000005,y:-.025217272867918025},{x:.36426021666666725,y:-.030239755095168967},{x:.36094083333333393,y:-.03497877780505925},{x:.35762145000000056,y:-.03941878716802137},{x:.3543020666666673,y:-.04354750540728934},{x:.350982683333334,y:-.0473560653167902},{x:.3476633000000007,y:-.05083910741210941},{x:.34434391666666736,y:-.05399483865012353},{x:.34102453333333405,y:-.05682505207395598},{x:.3377051500000008,y:-.05933510716802134},{x:.3343857666666674,y:-.06153387113839254},{x:.33106638333333416,y:-.06343362176183558},{x:.3277470000000008,y:-.06504991286791795},{x:.32442761666666753,y:-.06640140392799708},{x:.32110823333333416,y:-.06750965561814737},{x:.3177888500000009,y:-.06839889359588126},{x:.31446946666666753,y:-.06909574307877601},{x:.31115008333333427,y:-.06962893713301824},{x:.30783070000000096,y:-.07002900186791793},{x:.30451131666666764,y:-.0703279219854669},{x:.3011919333333343,y:-.07055879034925058},{x:.297872550000001,y:-.07075544541210932},{x:.29455316333333437,y:-.07055879034925057},{x:.29123377666666767,y:-.0703279219854669},{x:.287914390000001,y:-.07002900186791793},{x:.28459500333333426,y:-.06962893713301824},{x:.2812756166666676,y:-.06909574307877601},{x:.2779562300000009,y:-.06839889359588126},{x:.2746368433333342,y:-.06750965561814737},{x:.27131745666666757,y:-.06640140392799707},{x:.26799807000000087,y:-.06504991286791795},{x:.2646786833333342,y:-.06343362176183559},{x:.26135929666666746,y:-.06153387113839254},{x:.2580399100000008,y:-.05933510716802133},{x:.2547205233333341,y:-.05682505207395598},{x:.25140113666666747,y:-.05399483865012352},{x:.24808175000000077,y:-.05083910741210941},{x:.24476236333333407,y:-.04735606531679021},{x:.24144297666666742,y:-.04354750540728934},{x:.23812359000000072,y:-.03941878716802137},{x:.23480420333333404,y:-.03497877780505926},{x:.23148481666666734,y:-.030239755095168977},{x:.22816543000000067,y:-.025217272867918028},{x:.224846043333334,y:-.019929990594663834},{x:.2215266566666673,y:-.014399468951480778},{x:.21820727000000062,y:-.008649933595881358},{x:.21488788333333395,y:-.0027080097454427916},{x:.21156849666666724,y:.0033975695336483144},{x:.20824911000000057,y:.009636278132081942},{x:.2049297233333339,y:.01597613134786629},{x:.2016103366666672,y:.02238403631741593},{x:.19829095000000052,y:.028826154587890507}],color:"primary",fill:!1},path8706:{type:"path",points:[{x:-.4023286499999996,y:.02754405458789022},{x:-.5293590499999994,y:.02754405458789022}],color:"primary",fill:!1},"path8706-5":{type:"path",points:[{x:.5261604500000003,y:.03211105458789021},{x:.39913004999999946,y:.03211105458789021}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.0040821499999992295,y:-.22497364541210985},bottom1:{type:"text",text:"{VAL}",x:-.004252755294839927,y:.23497364541211008}},refblocks:{left1:{x:-.5504428500000003,y:.02627215458789056},right1:{x:.5504428500000005,y:.03152125458789001}},bounds:{minX:-.5786012910000002,maxX:.5786012910000005,minY:-.3249736454121098,maxY:.23497364541211008,width:1.1572025820000007,height:.20994729082421992,centerX:11102230246251565e-32,centerY:-.04499999999999987},circles:{}},{paths:paths22,texts:texts25,bounds:bounds22,refblocks:refblocks22,circles:circles19}=inductor_default,inductor_horz_default={primitives:[...Object.values(paths22),...Object.values(circles19),{...texts25.top1,anchor:"middle_bottom"},{...texts25.bottom1,anchor:"middle_top"}],ports:[{...refblocks22.left1,labels:["1"]},{...refblocks22.right1,labels:["2"]}],size:{width:bounds22.width,height:bounds22.height},center:{x:bounds22.centerX,y:bounds22.centerY}},inductor_vert_default=rotateSymbol(inductor_horz_default),laser_diode_default={paths:{path11:{type:"path",points:[{x:-.5307178000000008,y:.2023617000000002},{x:-.15214840000000018,y:.20498470000000002}],color:"primary",fill:!1},path40:{type:"path",points:[{x:.1289840999999996,y:.19130049999999987},{x:-.13559890000000085,y:.32359219999999955}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.13559890000000085,y:.059008800000000194},{x:.1289840999999996,y:.19130049999999987}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.13559890000000085,y:.3235922000000002},{x:-.13559890000000085,y:.059008800000000194}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.1289840999999996,y:.059008800000000194},{x:.1289840999999996,y:.3235922000000002}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.13259069999999995,y:.1918692999999998},{x:.5307178000000008,y:.20236169999999953}],color:"primary",fill:!1},"path25-0-9-8":{type:"path",points:[{x:-.03268000000000071,y:-.25134120000000015},{x:-.05649420000000016,y:-.3235922000000002},{x:-.08048579999999972,y:-.2514182000000005}],color:"primary",fill:!0},"path78-6-5-5":{type:"path",points:[{x:-.05685430000000058,y:-.13143119999999997},{x:-.056826700000000674,y:-.14405819999999991},{x:-.056536700000000994,y:-.2719202000000003},{x:-.056346700000000416,y:-.2728202000000004}],color:"primary",fill:!1},"path25-0-9-8-2":{type:"path",points:[{x:.06541730000000001,y:-.25134120000000015},{x:.04160310000000034,y:-.3235922000000002},{x:.017611500000001,y:-.2514182000000005}],color:"primary",fill:!0},"path78-6-5-5-7":{type:"path",points:[{x:.04124299999999992,y:-.13143119999999997},{x:.041270600000000046,y:-.14405819999999991},{x:.041560599999999726,y:-.2719202000000003},{x:.041750600000000304,y:-.2728202000000004}],color:"primary",fill:!1},"path43-1":{type:"path",points:[{x:.028013799999999422,y:.08349260000000025},{x:.028013799999999422,y:.30697360000000073}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:.18325689999999928,y:-.23713399999999885},bottom1:{type:"text",text:"{VAL}",x:-.00984920000000078,y:.6347113000000009}},refblocks:{left1:{x:-.5446331000000002,y:.20321450000000074},right1:{x:.5381637999999993,y:.20221810000000118}},bounds:{minX:-.5307178000000008,maxX:.5307178000000008,minY:-.3235922000000002,maxY:.3235922000000002,width:1.0614356000000016,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-.006997300000000539,y:.1952334000000009,radius:.28854213,color:"primary",fill:!1}}},{paths:paths23,texts:texts26,bounds:bounds23,refblocks:refblocks23,circles:circles20}=laser_diode_default,laser_diode_horz_default={primitives:[...Object.values(paths23),...Object.values(circles20),{...texts26.top1,anchor:"middle_left"},{...texts26.bottom1,anchor:"middle_bottom"}],ports:[{...refblocks23.left1,labels:["1"]},{...refblocks23.right1,labels:["2"]}],size:{width:bounds23.width,height:bounds23.height},center:{x:bounds23.centerX,y:bounds23.centerY}},rotatedSymbol11=rotateSymbol(laser_diode_horz_default),texts27=rotatedSymbol11.primitives.filter(lV=>lV.type==="text"),ref9=texts27.find(lV=>lV.text==="{VAL}");ref9.x=-.52,ref9.anchor="middle_right";var laser_diode_vert_default=rotatedSymbol11,led_default={paths:{path45:{type:"path",points:[{x:.13585750000000063,y:.003696399999999045},{x:-.12872579999999934,y:.13598810000000228}],color:"primary",fill:!1},"path1-8":{type:"path",points:[{x:.12763670000000094,y:.003920199999999596},{x:.5265564000000009,y:.003920199999999596}],color:"primary",fill:!1},path46:{type:"path",points:[{x:-.12872579999999934,y:-.12859530000000063},{x:.13585750000000063,y:.003696399999999045}],color:"primary",fill:!1},path47:{type:"path",points:[{x:-.12872579999999934,y:.13598810000000228},{x:-.12872579999999934,y:-.12859530000000063}],color:"primary",fill:!1},path48:{type:"path",points:[{x:.13585750000000063,y:-.12859530000000063},{x:.13585750000000063,y:.13598810000000228}],color:"primary",fill:!1},path49:{type:"path",points:[{x:-.13076959999999938,y:.003696399999999045},{x:-.5256007999999994,y:.003696399999999045}],color:"primary",fill:!1},path25:{type:"path",points:[{x:-.1557438999999996,y:-.28545279999999806},{x:-.2530861999999994,y:-.3023319999999998},{x:-.21878339999999952,y:-.20956920000000068}],color:"primary",fill:!0},path78:{type:"path",points:[{x:-.08000449999999937,y:-.16590799999999817},{x:-.09202799999999911,y:-.1748410000000007},{x:-.2137844999999996,y:-.26529680000000155},{x:-.2144144999999993,y:-.2662468000000011}],color:"primary",fill:!1},"path25-0":{type:"path",points:[{x:.021722400000000697,y:-.30658939999999646},{x:-.07561989999999952,y:-.3234685999999982},{x:-.04131709999999922,y:-.23070579999999907}],color:"primary",fill:!0},"path78-6":{type:"path",points:[{x:.09746180000000093,y:-.18704459999999656},{x:.08543830000000074,y:-.19597759999999909},{x:-.0363181999999993,y:-.28643339999999995},{x:-.03694819999999943,y:-.2873833999999995}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{VAL}",x:-.009561699999999451,y:.3234685999999982},right1:{type:"text",text:"{REF}",x:.31464070000000044,y:-.22386570000000106}},refblocks:{left1:{x:-.5362092999999997,y:.004432900000001183},right1:{x:.5362093000000003,y:.004886400000003732}},bounds:{minX:-.5643677409999996,maxX:.5643677410000003,minY:-.32386570000000103,maxY:.3234685999999982,width:1.128735482,height:.2973342999999993,centerX:33306690738754696e-32,centerY:-.00019855000000140732},circles:{}},{paths:paths24,texts:texts28,bounds:bounds24,refblocks:refblocks24,circles:circles21}=led_default,led_right_default={primitives:[...Object.values(paths24),...Object.values(circles21),{...texts28.bottom1,anchor:"middle_top"},{...texts28.right1,anchor:"middle_bottom"}],ports:[{...refblocks24.left1,labels:["1"]},{...refblocks24.right1,labels:["2"]}],size:{width:bounds24.width,height:bounds24.height},center:{x:bounds24.centerX,y:bounds24.centerY}},led_down_default=rotateSymbol(led_right_default,"down"),led_left_default=flipSymbolOverYAxis(led_right_default),baseSymbol=rotateSymbol(led_right_default,"up"),modifiedSymbol={...baseSymbol,primitives:baseSymbol.primitives.map(lV=>lV.type==="path"&&(lV.points.length===3||lV.points.length===4)?{...lV,points:lV.points.map(J=>({x:J.x,y:-J.y+2*baseSymbol.center.y}))}:lV)},led_up_default=modifiedSymbol,light_dependent_resistor_default={paths:{path11:{type:"path",points:[{x:-.5053201665812097,y:-.010839730805804138},{x:-.1829962316128657,y:-.010839730805804138}],color:"primary",fill:!1},"path11-2":{type:"path",points:[{x:-.1674747072814866,y:-.11471502212593476},{x:-.1674747072814866,y:.07736981415388478}],color:"primary",fill:!1},"path11-5":{type:"path",points:[{x:-.1674747072814866,y:-.11632056223474518},{x:.16018133830019532,y:-.11632056223474518}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:-.1674747072814866,y:.07736981415388478},{x:.16018133830019532,y:.07736981415388478}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.17205869804197382,y:-.010839950577224311},{x:.5116721586832798,y:-.010839950577224311}],color:"primary",fill:!1},"path11-2-1":{type:"path",points:[{x:.16064490317338742,y:-.11622177498145403},{x:.16064490317338742,y:.07727135655772521}],color:"primary",fill:!1},"path25-0-9":{type:"path",points:[{x:-.40391896081308554,y:-.2111951150487743},{x:-.32538818309991635,y:-.1776462385858042},{x:-.33843942905204627,y:-.26928059146906413}],color:"primary",fill:!0},"path78-6-5":{type:"path",points:[{x:-.4470989190253618,y:-.3351265263866847},{x:-.4385525777085817,y:-.32468848279378437},{x:-.3520048317368336,y:-.21897414423109507},{x:-.3516268465799328,y:-.21798517284109487}],color:"primary",fill:!1},"path25-0-9-0":{type:"path",points:[{x:-.30220674110432255,y:-.3403193953841548},{x:-.22367596339115314,y:-.30677051892118534},{x:-.23672720934328306,y:-.3984048718044453}],color:"primary",fill:!0},"path78-6-5-9":{type:"path",points:[{x:-.3453866993165988,y:-.464250806722065},{x:-.3368403579998187,y:-.45381276312916397},{x:-.2502926120280704,y:-.34809842456647466},{x:-.24991462687116983,y:-.34710945317647446}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.1679477702432366,y:-.40859918889256375},bottom1:{type:"text",text:"{VAL}",x:-.006410773639930811,y:.464250806722065}},refblocks:{left1:{x:-.5247194309452994,y:-.009902515585214156},right1:{x:.5247194309452992,y:-.010997416799653603}},bounds:{minX:-.5520103866874645,maxX:.5520103866874643,minY:-.5085991888925637,maxY:.464250806722065,width:1.1040207733749288,height:.6228499956146287,centerX:-11102230246251565e-32,centerY:-.022174191085249373},circles:{path1:{type:"circle",x:-.003646732950281173,y:-.018672603986024328,radius:.2796529289238723,color:"primary",fill:!1}}},{paths:paths25,texts:texts29,bounds:bounds25,refblocks:refblocks25,circles:circles22}=light_dependent_resistor_default,light_dependent_resistor_horz_default={primitives:[...Object.values(paths25),...Object.values(circles22),{...texts29.top1,anchor:"middle_left",x:0},{...texts29.bottom1,anchor:"middle_left",x:0}],ports:[{...refblocks25.left1,labels:["1"]},{...refblocks25.right1,labels:["2"]}],size:{width:bounds25.width,height:bounds25.height},center:{x:bounds25.centerX,y:bounds25.centerY}},rotatedSymbol12=rotateSymbol(light_dependent_resistor_horz_default),texts30=rotatedSymbol12.primitives.filter(lV=>lV.type==="text"),val9=texts30.find(lV=>lV.text==="{VAL}");val9.x=-.35,val9.y=0,val9.anchor="middle_right";var ref10=texts30.find(lV=>lV.text==="{REF}");ref10.y=0,ref10.x=.35,ref10.anchor="middle_left";var light_dependent_resistor_vert_default=rotatedSymbol12,mosfet_depletion_normally_on_default={paths:{path208:{type:"path",points:[{x:.3793021704999999,y:-.13154093999999894},{x:.5115938705000005,y:.13304206000000107}],color:"primary",fill:!1},path209:{type:"path",points:[{x:.24701047050000025,y:.13304206000000107},{x:.3793021704999999,y:-.13154093999999894}],color:"primary",fill:!1},path210:{type:"path",points:[{x:.5115938705000005,y:.13304206000000107},{x:.24701047050000025,y:.13304206000000107}],color:"primary",fill:!1},path211:{type:"path",points:[{x:.24701047050000025,y:-.13154093999999894},{x:.5115938705000005,y:-.13154093999999894}],color:"primary",fill:!1},path212:{type:"path",points:[{x:.11471887050000085,y:.39762406000000006},{x:.3793021704999999,y:.39762406000000006}],color:"primary",fill:!1},path213:{type:"path",points:[{x:.3793021704999999,y:-.39612494},{x:.11471887050000085,y:-.39612494}],color:"primary",fill:!1},path214:{type:"path",points:[{x:.11471887050000085,y:-.5284169399999996},{x:.11471887050000085,y:-.18445994}],color:"primary",fill:!1},path215:{type:"path",points:[{x:.11471887050000085,y:.5299150600000004},{x:.11471887050000085,y:.0007480600000011606}],color:"primary",fill:!1},path216:{type:"path",points:[{x:.3793021704999999,y:.39762469000000067},{x:.3793021704999999,y:-.3961256399999993}],color:"primary",fill:!1},path217:{type:"path",points:[{x:-.1498644295,y:-.2638359399999999},{x:-.1498644295,y:.26533006000000015}],color:"primary",fill:!1},path218:{type:"path",points:[{x:-.22923942949999887,y:.2653310599999994},{x:-.22923942949999887,y:-.26383493999999885}],color:"primary",fill:!1},path219:{type:"path",points:[{x:-.5467394294999997,y:.26533006000000015},{x:-.22923942949999887,y:.2653320600000004}],color:"primary",fill:!1},path220:{type:"path",points:[{x:-.1498644295,y:.18595506000000128},{x:.11471897050000024,y:.18595506000000128}],color:"primary",fill:!1},path221:{type:"path",points:[{x:-.1498644295,y:-.18446093999999924},{x:.11471897050000024,y:-.18446093999999924}],color:"primary",fill:!1},path222:{type:"path",points:[{x:-.07048942950000026,y:.0007480600000011606},{x:.11471887050000085,y:.0007480600000011606}],color:"primary",fill:!1}},texts:{right1:{type:"text",text:"{REF}",x:.5651646705000006,y:-.2085436499999993},right2:{type:"text",text:"{VAL}",x:.5665500705,y:-.02044358999999929}},refblocks:{top1:{x:.11518067050000003,y:-.5432738300000004},bottom1:{x:.11482247050000094,y:.5432738300000004},left1:{x:-.5483916295000002,y:.2663988600000007}},bounds:{minX:-.5765500705000002,maxX:.6665500704999999,minY:-.5714322710000004,maxY:.5714322710000004,width:1.2431001410000002,height:.7928645420000008,centerX:.04499999999999987,centerY:0},circles:{}},{paths:paths26,texts:texts31,bounds:bounds26,refblocks:refblocks26}=mosfet_depletion_normally_on_default,mosfet_depletion_normally_on_horz_default={primitives:[...Object.values(paths26),{...texts31.right1,anchor:"middle_left"},{...texts31.right2,anchor:"middle_left"}],ports:[{...refblocks26.top1,labels:["1"]},{...refblocks26.bottom1,labels:["2"]},{...refblocks26.left1,labels:["3"]}],size:{width:bounds26.width+.4,height:bounds26.height},center:{x:bounds26.centerX+.2,y:bounds26.centerY}},rotated3=rotateSymbol(mosfet_depletion_normally_on_horz_default),ref11=rotated3.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val10=rotated3.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref11.anchor="middle_top",val10.anchor="middle_top",ref11.x=val10.x,val10.y+=.15;var mosfet_depletion_normally_on_vert_default=rotated3,mushroom_head_normally_open_momentary_default={paths:{"path12-1-8-6-9":{type:"path",points:[{x:.005962250000000502,y:-.06421149999999898},{x:.005962250000000502,y:.010086499999999887}],color:"primary",fill:!1},"path12-1-5-6":{type:"path",points:[{x:-.48740705000000073,y:.0979945000000022},{x:-.17310075000000058,y:.0979945000000022}],color:"primary",fill:!1},"path12-1-8-0":{type:"path",points:[{x:-.16008695000000017,y:.015660500000000965},{x:.1719709499999995,y:.015660500000000965}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:.1954987499999996,y:.09760550000000023},{x:.4881436499999996,y:.09760550000000023}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-.09950044999999985,y:-.05339449999999957},{x:-.09950104999999976,y:-.05697449999999904},{x:-.09932044999999956,y:-.06050449999999863},{x:-.09896044999999987,y:-.06401049999999842},{x:-.09860045000000017,y:-.06750049999999774},{x:-.09806045000000019,y:-.07093049999999756},{x:-.09735344999999995,y:-.07429949999999863},{x:-.09663345000000056,y:-.07765949999999933},{x:-.09578045000000035,y:-.080999499999999},{x:-.09475245000000054,y:-.08424949999999853},{x:-.09379245000000047,y:-.08755949999999757},{x:-.09254545000000025,y:-.09067949999999847},{x:-.09120844999999989,y:-.09377950000000013},{x:-.08986644999999971,y:-.09686950000000039},{x:-.08839545000000015,y:-.09992949999999823},{x:-.08675845000000049,y:-.1028394999999982},{x:-.08506245000000057,y:-.10569950000000006},{x:-.08334244999999996,y:-.10860950000000003},{x:-.08146945000000017,y:-.11138949999999781},{x:-.0795824500000002,y:-.11416949999999915},{x:-.07752845000000086,y:-.11680949999999868},{x:-.07546944999999994,y:-.11942949999999897},{x:-.07325945000000011,y:-.12193949999999987},{x:-.07104145000000006,y:-.12444949999999722},{x:-.06867544999999975,y:-.12682949999999948},{x:-.06628845000000005,y:-.12916949999999972},{x:-.06379544999999975,y:-.13141949999999802},{x:-.06114145000000004,y:-.1334894999999996},{x:-.05848745000000033,y:-.135569499999999},{x:-.05584345000000024,y:-.13761949999999956},{x:-.05306845000000049,y:-.13949949999999944},{x:-.05029345000000074,y:-.14139950000000034},{x:-.04738844999999969,y:-.14311950000000095},{x:-.04437445000000029,y:-.14469949999999798},{x:-.04134744999999995,y:-.14631949999999883},{x:-.038316449999999946,y:-.1477594999999976},{x:-.03515645000000056,y:-.14907949999999914},{x:-.03204444999999989,y:-.15036950000000004},{x:-.028770450000000558,y:-.1515594999999994},{x:-.025468450000000864,y:-.1525794999999981},{x:-.02213745000000067,y:-.1536395000000006},{x:-.018790450000000014,y:-.15442949999999733},{x:-.01536325000000005,y:-.15512949999999748},{x:-.011980249999999693,y:-.1558294999999994},{x:-.008442250000000762,y:-.15641949999999838},{x:-.004890650000000107,y:-.15674949999999832},{x:-.0013406500000003874,y:-.15704949999999585},{x:.002252350000000014,y:-.1571494999999974},{x:.005893849999999645,y:-.1571494999999974},{x:.009534849999998762,y:-.1571494999999974},{x:.013136849999999534,y:-.15704949999999585},{x:.016683149999999536,y:-.15674949999999832},{x:.020231149999998976,y:-.15644949999999902},{x:.023727149999999142,y:-.15604949999999818},{x:.02715474999999934,y:-.15512949999999748},{x:.03057874999999921,y:-.15452949999999888},{x:.03395574999999962,y:-.15367949999999908},{x:.03725995000000015,y:-.1525894999999995},{x:.0405679499999998,y:-.15152949999999876},{x:.04379994999999948,y:-.15041949999999815},{x:.04695294999999966,y:-.14909950000000016},{x:.050101949999999285,y:-.14780949999999926},{x:.053191949999999544,y:-.14631949999999883},{x:.05617794999999948,y:-.14473950000000002},{x:.05916694999999983,y:-.14311950000000095},{x:.06206694999999929,y:-.14139950000000034},{x:.06487294999999982,y:-.13955950000000072},{x:.06767095000000012,y:-.13769950000000186},{x:.07038294999999994,y:-.1356995000000012},{x:.07299194999999958,y:-.13357950000000152},{x:.07560095000000011,y:-.13145950000000184},{x:.07809294999999938,y:-.12920950000000175},{x:.08047994999999997,y:-.12687950000000114},{x:.08287894999999956,y:-.12453950000000091},{x:.08515495000000062,y:-.12206950000000028},{x:.08729294999999926,y:-.11951950000000089},{x:.08944594999999911,y:-.11692950000000124},{x:.0914679499999993,y:-.11430950000000095},{x:.09337295000000001,y:-.11152949999999962},{x:.0971669499999992,y:-.1060194999999986},{x:.10043494999999947,y:-.1001245000000015},{x:.10311494999999926,y:-.09390950000000053},{x:.10444094999999987,y:-.09081950000000028},{x:.10564094999999973,y:-.08762950000000025},{x:.10667494999999949,y:-.08435950000000147},{x:.10769994999999977,y:-.08110950000000194},{x:.1085699499999997,y:-.07779950000000291},{x:.10927795000000007,y:-.07442950000000259},{x:.10999794999999946,y:-.0710595000000005},{x:.11051994999999959,y:-.06762950000000068},{x:.11088394999999984,y:-.06413950000000135},{x:.11124394999999954,y:-.06064950000000202},{x:.11142394999999983,y:-.05709950000000141},{x:.11142394999999983,y:-.053543499999999966},{x:.10483595000000001,y:-.05353049999999904},{x:.0982479500000002,y:-.05351650000000063},{x:.09164495000000006,y:-.05351850000000091},{x:.08505695000000024,y:-.05350850000000129},{x:.078453950000001,y:-.05350950000000054},{x:.07186595000000029,y:-.053496499999999614},{x:.06526295000000104,y:-.05349750000000064},{x:.058674950000001225,y:-.053485499999998964},{x:.05208695000000052,y:-.05347349999999906},{x:.04548395000000127,y:-.05347549999999934},{x:.038895950000001456,y:-.05346150000000094},{x:.03230795000000075,y:-.053448499999998234},{x:.025704950000001503,y:-.053453499999998044},{x:.019101950000001366,y:-.053454499999997296},{x:.01251395000000155,y:-.05344149999999637},{x:.005925950000001734,y:-.05342749999999796},{x:-.0006560499999990199,y:-.0534214999999989},{x:-.007240049999999165,y:-.05341449999999881},{x:-.01382404999999931,y:-.05340849999999975},{x:-.020406049999999176,y:-.053402500000000686},{x:-.02699004999999932,y:-.053394500000001344},{x:-.03357404999999947,y:-.05338950000000331},{x:-.04015604999999933,y:-.05338350000000425},{x:-.04674004999999948,y:-.05337450000000388},{x:-.05332205000000023,y:-.053368500000004815},{x:-.05990605000000038,y:-.05336050000000547},{x:-.06649005000000052,y:-.05335550000000566},{x:-.07307205000000039,y:-.0533495000000066},{x:-.07965605000000053,y:-.05334150000000726},{x:-.08624005000000068,y:-.053335500000008196},{x:-.09282205000000143,y:-.05333050000001016}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:.01254745000000046,y:-.26112850000000165},bottom1:{type:"text",text:"{VAL}",x:-.16130964999999975,y:.27112849999999966}},refblocks:{left1:{x:-.4717985499999999,y:.0979675000000011},right1:{x:.4717985499999999,y:.09799250000000015}},bounds:{minX:-.4999569909999999,maxX:.4999569909999999,minY:-.36112850000000163,maxY:.27112849999999966,width:1,height:1,centerX:0,centerY:-.045000000000000984},circles:{}},{paths:paths27,texts:texts32,bounds:bounds27,refblocks:refblocks27,circles:circles23}=mushroom_head_normally_open_momentary_default,mushroom_head_normally_open_momentary_horz_default={primitives:[...Object.values(paths27),...Object.values(circles23),{...texts32.top1,anchor:"middle_bottom",x:0},{...texts32.bottom1,anchor:"middle_top",x:0}],ports:[{...refblocks27.left1,labels:["1"]},{...refblocks27.right1,labels:["2"]}],size:{width:bounds27.width,height:bounds27.height},center:{x:bounds27.centerX+.006,y:bounds27.centerY+.06}},rotated4=rotateSymbol(mushroom_head_normally_open_momentary_horz_default),ref12=rotated4.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val11=rotated4.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref12.anchor="middle_left",val11.anchor="middle_right",ref12.x=ref12.x-.03,ref12.y=ref12.y,val11.x=val11.x,val11.y=0;var mushroom_head_normally_open_momentary_vert_default=rotated4,n_channel_d_mosfet_transistor_default={paths:{path11:{type:"path",points:[{x:-.39274354450000026,y:.10329954999999957},{x:.05111245549999932,y:.1059225499999994}],color:"primary",fill:!1},path40:{type:"path",points:[{x:.09373835550000087,y:-.18559775000000034},{x:.09280835550000122,y:.18255174999999935}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:.30382435550000064,y:-.53233025},{x:.3032243555000005,y:-.10600584999999985}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:.3108281555000003,y:.5323308500000001},{x:.31142815550000025,y:.005876249999999805}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.09383795549999951,y:-.10788365000000044},{x:.31104975549999936,y:-.10659565000000004}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:.09383795549999951,y:.10232114999999986},{x:.31104975549999936,y:.10360915000000026}],color:"primary",fill:!1},path15:{type:"path",points:[{x:.27419885550000034,y:.04077644999999963},{x:.27419885550000034,y:-.030615650000000327},{x:.2024438555000001,y:.004662050000000084}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:.09383795549999951,y:.004018049999999551},{x:.31104975549999936,y:.005306049999999729}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:.05171245550000081,y:-.16715385000000005},{x:.05111245550000065,y:.10592255000000006}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.13197254449999907,y:-.36092494999999936},bottom1:{type:"text",text:"{VAL}",x:.05891105550000031,y:.42489435000000064}},refblocks:{top1:{x:.30397715549999993,y:-.5519248499999992},bottom1:{x:.31067575550000126,y:.5519248499999994},left1:{x:-.41859744450000025,y:.10250625000000024}},bounds:{minX:-.4467558855000002,maxX:.44675588550000006,minY:-.5800832909999992,maxY:.5800832909999993,width:1,height:1.1601665819999987,centerX:-8326672684688674e-32,centerY:5551115123125783e-32},circles:{path1:{type:"circle",x:.15821375550000005,y:-.003454549999999612,radius:.28854213,color:"primary",fill:!1}}},{paths:paths28,texts:texts33,bounds:bounds28,refblocks:refblocks28,circles:circles24}=n_channel_d_mosfet_transistor_default,n_channel_d_mosfet_transistor_horz_default={primitives:[...Object.values(paths28),...Object.values(circles24),{...texts33.top1,anchor:"middle_right",x:0},{...texts33.bottom1,anchor:"middle_right",x:0}],ports:[{...refblocks28.top1,labels:["1","drain"]},{...refblocks28.bottom1,labels:["2","source"]},{...refblocks28.left1,labels:["3","gate"]}],size:{width:bounds28.width,height:bounds28.height},center:{x:bounds28.centerX,y:bounds28.centerY}},rotatedSymbol13=rotateSymbol(n_channel_d_mosfet_transistor_horz_default),texts34=rotatedSymbol13.primitives.filter(lV=>lV.type==="text"),val12=texts34.find(lV=>lV.text==="{VAL}");val12.x=-.35,val12.y=0,val12.anchor="middle_right";var ref13=texts34.find(lV=>lV.text==="{REF}");ref13.y=0,ref13.x=.35,ref13.anchor="middle_left";var n_channel_d_mosfet_transistor_vert_default=rotatedSymbol13,n_channel_e_mosfet_transistor_default={paths:{path11:{type:"path",points:[{x:-.39274354450000026,y:.10329954999999957},{x:.05111245549999932,y:.1059225499999994}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:.30382435550000064,y:-.53233025},{x:.3032243555000005,y:-.10600584999999985}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:.3108281555000003,y:.5323308500000001},{x:.31142815550000025,y:.005876249999999805}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.09383795549999951,y:-.10788365000000044},{x:.31104975549999936,y:-.10659565000000004}],color:"primary",fill:!1},"path2-8-3-7":{type:"path",points:[{x:.09448295549999952,y:-.14677165000000048},{x:.09319295549999951,y:-.06899565000000041}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:.09383795549999951,y:.10232114999999986},{x:.31104975549999936,y:.10360915000000026}],color:"primary",fill:!1},"path2-8-3":{type:"path",points:[{x:.09440455549999993,y:.07703174999999951},{x:.09311455549999992,y:.15480774999999958}],color:"primary",fill:!1},"path2-8-3-2":{type:"path",points:[{x:.09448295549999952,y:-.03486995000000048},{x:.09319295549999951,y:.042906049999999585}],color:"primary",fill:!1},path15:{type:"path",points:[{x:.2741991554999996,y:.040776550000000134},{x:.2741991554999996,y:-.030615549999999825},{x:.2024441554999994,y:.004662350000000037}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:.09383795549999951,y:.004018049999999551},{x:.31104975549999936,y:.005306049999999729}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:.05171245550000081,y:-.10847375000000059},{x:.05111245550000065,y:.1059225499999994}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.13197254449999907,y:-.36092494999999936},bottom1:{type:"text",text:"{VAL}",x:.05891105550000031,y:.42489435000000064}},refblocks:{top1:{x:.30397715549999993,y:-.5519248499999992},bottom1:{x:.31067575550000126,y:.5519248499999994},left1:{x:-.41859744450000025,y:.10250625000000024}},bounds:{minX:-.4467558855000002,maxX:.44675588550000006,minY:-.5800832909999992,maxY:.5800832909999993,width:1,height:1.1601665819999987,centerX:-8326672684688674e-32,centerY:5551115123125783e-32},circles:{path1:{type:"circle",x:.15821375550000005,y:-.003454549999999612,radius:.28854213,color:"primary",fill:!1}}},{paths:paths29,texts:texts35,bounds:bounds29,refblocks:refblocks29,circles:circles25}=n_channel_e_mosfet_transistor_default,n_channel_e_mosfet_transistor_horz_default={primitives:[...Object.values(paths29),...Object.values(circles25),{...texts35.top1,anchor:"middle_right",x:0},{...texts35.bottom1,anchor:"middle_right",x:0}],ports:[{...refblocks29.top1,labels:["1","drain"]},{...refblocks29.bottom1,labels:["2","source"]},{...refblocks29.left1,labels:["3","gate"]}],size:{width:bounds29.width,height:bounds29.height},center:{x:bounds29.centerX,y:bounds29.centerY}},rotatedSymbol14=rotateSymbol(n_channel_e_mosfet_transistor_horz_default),texts36=rotatedSymbol14.primitives.filter(lV=>lV.type==="text"),val13=texts36.find(lV=>lV.text==="{VAL}");val13.x=-.35,val13.y=0,val13.anchor="middle_right";var ref14=texts36.find(lV=>lV.text==="{REF}");ref14.y=0,ref14.x=.35,ref14.anchor="middle_left";var n_channel_e_mosfet_transistor_vert_default=rotatedSymbol14,njfet_transistor_default={paths:{path11:{type:"path",points:[{x:-.38509374449999945,y:.00367374999999992},{x:.05876225550000025,y:.00629674999999974}],color:"primary",fill:!1},path40:{type:"path",points:[{x:.07415065550000066,y:-.18559775000000034},{x:.07322065550000101,y:.18255174999999935}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:.28423665550000043,y:-.53233025},{x:.2836366555000003,y:-.10600584999999985}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:.2912404555000001,y:.5298821500000002},{x:.29184045550000004,y:.10355795000000012}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.07425025549999931,y:-.10788365000000044},{x:.29146205549999915,y:-.10659565000000004}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:.07425025549999931,y:.10232114999999986},{x:.29146205549999915,y:.10360915000000026}],color:"primary",fill:!1},path15:{type:"path",points:[{x:-.0829488445000004,y:-.06153284999999986},{x:-.0829488445000004,y:.06535114999999969},{x:.005945155500000077,y:.0026521499999998532}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-.15156024449999927,y:-.36092494999999936},bottom1:{type:"text",text:"{VAL}",x:.0393233555000001,y:.42489435000000064}},refblocks:{top1:{x:.2843894554999997,y:-.5519248499999992},bottom1:{x:.29108805550000105,y:.5519248499999994},left1:{x:-.3990097444999998,y:.004526550000000462}},bounds:{minX:-.4271681854999998,maxX:.42716818549999985,minY:-.5800832909999992,maxY:.5800832909999993,width:1,height:1.1601665819999987,centerX:27755575615628914e-33,centerY:5551115123125783e-32},circles:{path1:{type:"circle",x:.13862605549999985,y:-.003454549999999612,radius:.28854213,color:"primary",fill:!1}}},{paths:paths30,texts:texts37,bounds:bounds30,refblocks:refblocks30,circles:circles26}=njfet_transistor_default,njfet_transistor_horz_default={primitives:[...Object.values(paths30),...Object.values(circles26),{...texts37.top1,anchor:"middle_right",x:0},{...texts37.bottom1,anchor:"middle_right",x:0}],ports:[{...refblocks30.top1,labels:["1","drain"]},{...refblocks30.bottom1,labels:["2","source"]},{...refblocks30.left1,labels:["3","gate"]}],size:{width:bounds30.width,height:bounds30.height},center:{x:bounds30.centerX,y:bounds30.centerY}},rotatedSymbol15=rotateSymbol(njfet_transistor_horz_default),texts38=rotatedSymbol15.primitives.filter(lV=>lV.type==="text"),val14=texts38.find(lV=>lV.text==="{VAL}");val14.x=-.35,val14.y=0,val14.anchor="middle_right";var ref15=texts38.find(lV=>lV.text==="{REF}");ref15.y=0,ref15.x=.35,ref15.anchor="middle_left";var njfet_transistor_vert_default=rotatedSymbol15,npn_bipolar_transistor_default={paths:{path11:{type:"path",points:[{x:-.3850939444999988,y:.0036735999999999436},{x:.0587620555000008,y:.0062965999999997635}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:.07400475550000118,y:-.2689528999999997},{x:.07335475550000092,y:.2789230000000007}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:.2754149555000005,y:-.24180210000000013},{x:.07955815550000045,y:-.10822479999999968}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:.2868554555000009,y:.24134789999999984},{x:.09194705550000082,y:.10807689999999992}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:.2851204555,y:-.25311099999999964},{x:.2860204555000001,y:-.5377640999999995}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:.2851204555,y:.5376890000000012},{x:.2860204555000001,y:.25303590000000065}],color:"primary",fill:!1},path15:{type:"path",points:[{x:.1882816555000013,y:.10097660000000008},{x:.11555775550000158,y:.20483720000000027},{x:.22425775550000182,y:.20446720000000007}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-.22497334449999973,y:-.3596647999999991},bottom1:{type:"text",text:"{VAL}",x:-.0679100444999996,y:.4129789000000006}},refblocks:{top1:{x:.28556045550000064,y:-.5519250999999994},bottom1:{x:.285560455500002,y:.5519250999999992},left1:{x:-.3990097444999998,y:.004526300000000871}},bounds:{minX:-.4271681854999998,maxX:.4271681855000001,minY:-.5800835409999994,maxY:.5800835409999991,width:1,height:1.1601670819999985,centerX:13877787807814457e-32,centerY:-11102230246251565e-32},circles:{"path1-0":{type:"circle",x:.13862605550000007,y:-.003454799999999203,radius:.28854213,color:"primary",fill:!1}}},{paths:paths31,texts:texts39,bounds:bounds31,refblocks:refblocks31,circles:circles27}=npn_bipolar_transistor_default,npn_bipolar_transistor_horz_default={primitives:[...Object.values(paths31),...Object.values(circles27),{type:"text",text:"{REF}",x:-.07,y:-.3596647999999991,anchor:"middle_right"},{type:"text",text:"{VAL}",x:-.0679100444999996,y:.4129789000000006,anchor:"middle_right"}],ports:[{...refblocks31.top1,labels:["1","collector"]},{...refblocks31.bottom1,labels:["2","emitter"]},{...refblocks31.left1,labels:["3","base"]}],size:{width:bounds31.width,height:bounds31.height},center:{x:bounds31.centerX,y:bounds31.centerY}},rotatedSymbol16=rotateSymbol(npn_bipolar_transistor_horz_default),texts40=rotatedSymbol16.primitives.filter(lV=>lV.type==="text"),ref16=texts40.find(lV=>lV.text==="{REF}");ref16.anchor="middle_left";var npn_bipolar_transistor_vert_default=rotatedSymbol16,p_channel_d_mosfet_transistor_default={paths:{path11:{type:"path",points:[{x:-.39274354450000026,y:.10329954999999957},{x:.05111245549999932,y:.1059225499999994}],color:"primary",fill:!1},path40:{type:"path",points:[{x:.09373835550000087,y:-.18559775000000034},{x:.09280835550000122,y:.18255174999999935}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:.30382435550000064,y:-.53233025},{x:.3032243555000005,y:-.10600584999999985}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:.3108281555000003,y:.5323308500000001},{x:.31142815550000025,y:.005876249999999805}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.09383795549999951,y:-.10788365000000044},{x:.31104975549999936,y:-.10659565000000004}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:.09383795549999951,y:.10232114999999986},{x:.31104975549999936,y:.10360915000000026}],color:"primary",fill:!1},path15:{type:"path",points:[{x:.20244405549999955,y:-.03061555000000049},{x:.20244405549999955,y:.04077654999999947},{x:.2741990554999998,y:.0054987499999992195}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:.09383795549999951,y:.004018049999999551},{x:.31104975549999936,y:.005306049999999729}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:.05171245550000081,y:-.16715385000000005},{x:.05111245550000065,y:.10592255000000006}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.13197254449999907,y:-.36092494999999936},bottom1:{type:"text",text:"{VAL}",x:.05891105550000031,y:.42489435000000064}},refblocks:{top1:{x:.30397715549999993,y:-.5519248499999992},bottom1:{x:.31067575550000126,y:.5519248499999994},left1:{x:-.41859744450000025,y:.10250625000000024}},bounds:{minX:-.4467558855000002,maxX:.44675588550000006,minY:-.5800832909999992,maxY:.5800832909999993,width:1,height:1.1601665819999987,centerX:-8326672684688674e-32,centerY:5551115123125783e-32},circles:{path1:{type:"circle",x:.15821375550000005,y:-.003454549999999612,radius:.28854213,color:"primary",fill:!1}}},{paths:paths32,texts:texts41,bounds:bounds32,refblocks:refblocks32,circles:circles28}=p_channel_d_mosfet_transistor_default,p_channel_d_mosfet_transistor_horz_default={primitives:[...Object.values(paths32),...Object.values(circles28),{...texts41.top1,anchor:"middle_right",x:0},{...texts41.bottom1,anchor:"middle_right",x:0}],ports:[{...refblocks32.top1,labels:["1","drain"]},{...refblocks32.bottom1,labels:["2","source"]},{...refblocks32.left1,labels:["3","gate"]}],size:{width:bounds32.width,height:bounds32.height},center:{x:bounds32.centerX,y:bounds32.centerY}},rotatedSymbol17=rotateSymbol(p_channel_d_mosfet_transistor_horz_default),texts42=rotatedSymbol17.primitives.filter(lV=>lV.type==="text"),val15=texts42.find(lV=>lV.text==="{VAL}");val15.x=-.35,val15.y=0,val15.anchor="middle_right";var ref17=texts42.find(lV=>lV.text==="{REF}");ref17.y=0,ref17.x=.35,ref17.anchor="middle_left";var p_channel_d_mosfet_transistor_vert_default=rotatedSymbol17,p_channel_e_mosfet_transistor_default={paths:{path11:{type:"path",points:[{x:-.39274354450000026,y:.10329954999999957},{x:.05111245549999932,y:.1059225499999994}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:.30382435550000064,y:-.53233025},{x:.3032243555000005,y:-.10600584999999985}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:.3108281555000003,y:.5323308500000001},{x:.31142815550000025,y:.005876249999999805}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.09383795549999951,y:-.10788365000000044},{x:.31104975549999936,y:-.10659565000000004}],color:"primary",fill:!1},"path2-8-3-7":{type:"path",points:[{x:.09448295549999952,y:-.14677165000000048},{x:.09319295549999951,y:-.06899565000000041}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:.09383795549999951,y:.10232114999999986},{x:.31104975549999936,y:.10360915000000026}],color:"primary",fill:!1},"path2-8-3":{type:"path",points:[{x:.09440455549999993,y:.07703174999999951},{x:.09311455549999992,y:.15480774999999958}],color:"primary",fill:!1},"path2-8-3-2":{type:"path",points:[{x:.09448295549999952,y:-.03486995000000048},{x:.09319295549999951,y:.042906049999999585}],color:"primary",fill:!1},path15:{type:"path",points:[{x:.20244405549999955,y:-.03061555000000049},{x:.20244405549999955,y:.04077654999999947},{x:.2741990554999998,y:.0054987499999992195}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:.09383795549999951,y:.004018049999999551},{x:.31104975549999936,y:.005306049999999729}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:.05171245550000081,y:-.10847375000000059},{x:.05111245550000065,y:.1059225499999994}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.13197254449999907,y:-.36092494999999936},bottom1:{type:"text",text:"{VAL}",x:.05891105550000031,y:.42489435000000064}},refblocks:{top1:{x:.30397715549999993,y:-.5519248499999992},bottom1:{x:.31067575550000126,y:.5519248499999994},left1:{x:-.41859744450000025,y:.10250625000000024}},bounds:{minX:-.4467558855000002,maxX:.44675588550000006,minY:-.5800832909999992,maxY:.5800832909999993,width:1,height:1.1601665819999987,centerX:-8326672684688674e-32,centerY:5551115123125783e-32},circles:{path1:{type:"circle",x:.15821375550000005,y:-.003454549999999612,radius:.28854213,color:"primary",fill:!1}}},{paths:paths33,texts:texts43,bounds:bounds33,refblocks:refblocks33,circles:circles29}=p_channel_e_mosfet_transistor_default,p_channel_e_mosfet_transistor_horz_default={primitives:[...Object.values(paths33),...Object.values(circles29),{...texts43.top1,anchor:"middle_right",x:0},{...texts43.bottom1,anchor:"middle_right",x:0}],ports:[{...refblocks33.top1,labels:["1","drain"]},{...refblocks33.bottom1,labels:["2","source"]},{...refblocks33.left1,labels:["3","gate"]}],size:{width:bounds33.width,height:bounds33.height},center:{x:bounds33.centerX,y:bounds33.centerY}},rotatedSymbol18=rotateSymbol(p_channel_e_mosfet_transistor_horz_default),texts44=rotatedSymbol18.primitives.filter(lV=>lV.type==="text"),val16=texts44.find(lV=>lV.text==="{VAL}");val16.x=-.35,val16.y=0,val16.anchor="middle_right";var ref18=texts44.find(lV=>lV.text==="{REF}");ref18.y=0,ref18.x=.35,ref18.anchor="middle_left";var p_channel_e_mosfet_transistor_vert_default=rotatedSymbol18,photodiode_default={paths:{path11:{type:"path",points:[{x:-.5307178000000009,y:.15879225000000008},{x:-.15214840000000018,y:.1614152499999999}],color:"primary",fill:!1},path40:{type:"path",points:[{x:.12898409999999938,y:.14773104999999975},{x:-.13559890000000085,y:.28002274999999943}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.13559890000000085,y:.015439350000000074},{x:.12898409999999938,y:.14773104999999975}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.13559890000000085,y:.2800227500000001},{x:-.13559890000000085,y:.015439350000000074}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.12898409999999938,y:.015439350000000074},{x:.12898409999999938,y:.2800227500000001}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.13259069999999995,y:.14829984999999968},{x:.5307178000000006,y:.1587922499999994}],color:"primary",fill:!1},"path25-0":{type:"path",points:[{x:.19516320000000031,y:-.22938755000000044},{x:.15939019999999982,y:-.13729605000000022},{x:.2571001999999991,y:-.1526013500000003}],color:"primary",fill:!0},"path78-6":{type:"path",points:[{x:.32731219999999994,y:-.2800227500000003},{x:.3161811999999997,y:-.2700010500000003},{x:.20345820000000003,y:-.1685088500000005},{x:.2024082000000007,y:-.16810885000000053}],color:"primary",fill:!1},"path25-0-9":{type:"path",points:[{x:.3425051999999993,y:-.20294964999999987},{x:.306732199999999,y:-.11085814999999966},{x:.4044417999999992,y:-.12616344999999973}],color:"primary",fill:!0},"path78-6-5":{type:"path",points:[{x:.4746538,y:-.25358484999999975},{x:.4635227999999998,y:-.24356314999999973},{x:.3507997999999999,y:-.14207094999999992},{x:.34974980000000055,y:-.14167095000000018}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999987,y:-.20318344999999938},bottom1:{type:"text",text:"{VAL}",x:-.00984920000000078,y:.5911418500000005}},refblocks:{left1:{x:-.5446331000000002,y:.15964505000000062},right1:{x:.5381637999999995,y:.15864865000000083}},bounds:{minX:-.5307178000000009,maxX:.5307178000000006,minY:-.2800227500000003,maxY:.2800227500000001,width:1.0614356000000016,height:1,centerX:-16653345369377348e-32,centerY:-11102230246251565e-32},circles:{path1:{type:"circle",x:-.006997300000000539,y:.15166395000000055,radius:.28854213,color:"primary",fill:!1}}},{paths:paths34,texts:texts45,bounds:bounds34,refblocks:refblocks34,circles:circles30}=photodiode_default,photodiode_horz_default={primitives:[...Object.values(paths34),...Object.values(circles30),{type:"text",text:"{REF}",x:-.15,y:-.20318344999999938,anchor:"middle_right"},{type:"text",text:"{VAL}",x:-.00984920000000078,y:.5,anchor:"middle_top"}],ports:[{...refblocks34.left1,labels:["1"]},{...refblocks34.right1,labels:["2"]}],size:{width:bounds34.width,height:bounds34.height},center:{x:bounds34.centerX,y:bounds34.centerY}},rotatedSymbol19=rotateSymbol(photodiode_horz_default),texts46=rotatedSymbol19.primitives.filter(lV=>lV.type==="text"),ref19=texts46.find(lV=>lV.text==="{REF}");ref19.y=0,ref19.anchor="middle_left";var photodiode_vert_default=rotatedSymbol19,pjfet_transistor_default={paths:{path11:{type:"path",points:[{x:-.38509374449999945,y:.00367374999999992},{x:.05876225550000025,y:.00629674999999974}],color:"primary",fill:!1},path40:{type:"path",points:[{x:.07415065550000066,y:-.18559775000000034},{x:.07322065550000101,y:.18255174999999935}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:.28423665550000043,y:-.53233025},{x:.2836366555000003,y:-.10600584999999985}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:.2912404555000001,y:.5298821500000002},{x:.29184045550000004,y:.10355795000000012}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.07425025549999931,y:-.10788365000000044},{x:.29146205549999915,y:-.10659565000000004}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:.07425025549999931,y:.10232114999999986},{x:.29146205549999915,y:.10360915000000026}],color:"primary",fill:!1},path15:{type:"path",points:[{x:.005945155500000077,y:.06535114999999969},{x:.005945155500000077,y:-.06153284999999986},{x:-.0829488445000004,y:.001166149999999977}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-.15156024449999927,y:-.36092494999999936},bottom1:{type:"text",text:"{VAL}",x:.0393233555000001,y:.42489435000000064}},refblocks:{top1:{x:.2843894554999997,y:-.5519248499999992},bottom1:{x:.29108805550000105,y:.5519248499999994},left1:{x:-.3990097444999998,y:.004526550000000462}},bounds:{minX:-.4271681854999998,maxX:.42716818549999985,minY:-.5800832909999992,maxY:.5800832909999993,width:1,height:1.1601665819999987,centerX:27755575615628914e-33,centerY:5551115123125783e-32},circles:{path1:{type:"circle",x:.13862605549999985,y:-.003454549999999612,radius:.28854213,color:"primary",fill:!1}}},{paths:paths35,texts:texts47,bounds:bounds35,refblocks:refblocks35,circles:circles31}=pjfet_transistor_default,pjfet_transistor_horz_default={primitives:[...Object.values(paths35),...Object.values(circles31),{...texts47.top1,anchor:"middle_right",x:0},{...texts47.bottom1,anchor:"middle_right"}],ports:[{...refblocks35.top1,labels:["1","drain"]},{...refblocks35.bottom1,labels:["2","source"]},{...refblocks35.left1,labels:["3","gate"]}],size:{width:bounds35.width,height:bounds35.height},center:{x:bounds35.centerX,y:bounds35.centerY}},rotatedSymbol20=rotateSymbol(pjfet_transistor_horz_default),texts48=rotatedSymbol20.primitives.filter(lV=>lV.type==="text"),val17=texts48.find(lV=>lV.text==="{VAL}");val17.x=-.35,val17.y=0,val17.anchor="middle_right";var ref20=texts48.find(lV=>lV.text==="{REF}");ref20.y=0,ref20.x=.35,ref20.anchor="middle_left";var pjfet_transistor_vert_default=rotatedSymbol20,pnp_bipolar_transistor_default={paths:{path11:{type:"path",points:[{x:-.3850939444999988,y:.0036735999999999436},{x:.0587620555000008,y:.0062965999999997635}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:.07400475550000118,y:-.2689528999999997},{x:.07335475550000092,y:.2789230000000007}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:.2754149555000005,y:-.24180210000000013},{x:.07955815550000045,y:-.10822479999999968}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:.2868554555000009,y:.24134789999999984},{x:.09194705550000082,y:.10807689999999992}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:.2851204555,y:-.25311099999999964},{x:.2860204555000001,y:-.5377640999999995}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:.2851204555,y:.5376890000000012},{x:.2860204555000001,y:.25303590000000065}],color:"primary",fill:!1},path15:{type:"path",points:[{x:.15155145550000038,y:.2268796000000004},{x:.2242753555000001,y:.12301900000000021},{x:.11557535549999942,y:.12338900000000042}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-.22497334449999973,y:-.3596647999999991},bottom1:{type:"text",text:"{VAL}",x:-.0679100444999996,y:.4129789000000006}},refblocks:{top1:{x:.28556045550000064,y:-.5519250999999994},bottom1:{x:.285560455500002,y:.5519250999999992},left1:{x:-.3990097444999998,y:.004526300000000871}},bounds:{minX:-.4271681854999998,maxX:.4271681855000001,minY:-.5800835409999994,maxY:.5800835409999991,width:1,height:1.1601670819999985,centerX:13877787807814457e-32,centerY:-11102230246251565e-32},circles:{"path1-0":{type:"circle",x:.13862605550000007,y:-.003454799999999203,radius:.28854213,color:"primary",fill:!1}}},{paths:paths36,texts:texts49,bounds:bounds36,refblocks:refblocks36,circles:circles32}=pnp_bipolar_transistor_default,pnp_bipolar_transistor_horz_default={primitives:[...Object.values(paths36),...Object.values(circles32),{type:"text",text:"{REF}",x:-.07,y:-.3596647999999991,anchor:"middle_right"},{type:"text",text:"{VAL}",x:-.0679100444999996,y:.4129789000000006,anchor:"middle_right"}],ports:[{...refblocks36.top1,labels:["1","collector"]},{...refblocks36.bottom1,labels:["2","emitter"]},{...refblocks36.left1,labels:["3","base"]}],size:{width:bounds36.width,height:bounds36.height},center:{x:bounds36.centerX,y:bounds36.centerY}},rotatedSymbol21=rotateSymbol(pnp_bipolar_transistor_horz_default),texts50=rotatedSymbol21.primitives.filter(lV=>lV.type==="text"),ref21=texts50.find(lV=>lV.text==="{REF}");ref21.anchor="middle_left";var pnp_bipolar_transistor_vert_default=rotatedSymbol21,potentiometer_default={paths:{path11:{type:"path",points:[{x:-.5274831500000005,y:-.03018695000000049},{x:-.30105415000000013,y:-.03018695000000049}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2932119499999999,y:-.03018695000000049},{x:.5339524499999997,y:-.03018695000000049}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:.09765764999999949,y:-.12845085000000034},{x:-.0011297500000011507,y:.06303624999999946},{x:-.10778645000000164,y:-.12845085000000034}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-.12123945000000003,y:.14031524999999934},{x:.11950104999999955,y:.14031524999999934}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17328624999999942,y:-.39216264999999995},bottom1:{type:"text",text:"{VAL}",x:-.00661455000000033,y:.40216264999999995}},refblocks:{left1:{x:-.5413984499999998,y:-.029334149999999948},right1:{x:.54139845,y:-.030330549999999734}},bounds:{minX:-.5695568909999997,maxX:.569556891,minY:-.4921626499999999,maxY:.40216264999999995,width:1.1391137819999997,height:.5443252999999999,centerX:11102230246251565e-32,centerY:-.044999999999999984},circles:{path1:{type:"circle",x:-.0037626500000000895,y:-.03731525000000002,radius:.28854213,color:"primary",fill:!1}}},{paths:paths37,texts:texts51,bounds:bounds37,refblocks:refblocks37}=potentiometer_default,potentiometer_horz_default={primitives:[...Object.values(paths37),{...texts51.bottom1,y:.35,anchor:"middle_top"},{...texts51.top1,anchor:"middle_left"}],ports:[{...refblocks37.left1,labels:["1"]},{...refblocks37.right1,labels:["2"]}],size:{width:bounds37.width+.05,height:bounds37.height},center:{x:bounds37.centerX,y:bounds37.centerY}},rotated5=rotateSymbol(potentiometer_horz_default),potentiometer_vert_default=rotated5,potentiometer2_default={paths:{path18:{type:"path",points:[{x:-.53224045,y:.0008545000000008685},{x:-.26765715000000023,y:.0008545000000008685}],color:"primary",fill:!1},path19:{type:"path",points:[{x:.2615098499999995,y:.0008545000000008685},{x:.5260934499999994,y:.0008545000000008685}],color:"primary",fill:!1},path20:{type:"path",points:[{x:-.0030722500000006647,y:-.1314371999999988},{x:.2615107499999998,y:-.1314371999999988},{x:.2615107499999998,y:.13314619999999877},{x:-.26765624999999993,y:.13314619999999877},{x:-.26765624999999993,y:-.1314371999999988},{x:-.0030722499999988884,y:-.1314371999999988}],color:"primary",fill:!1},path23:{type:"path",points:[{x:.2782993499999993,y:.2822274},{x:.17598844999999885,y:.25486950000000164},{x:.25094144999999823,y:.1799165000000027}],color:"primary",fill:!0},path24:{type:"path",points:[{x:.2882692499999995,y:.2921307000000013},{x:.25467554999999953,y:.16634940000000142},{x:.16229264999999948,y:.25853690000000284}],color:"primary",fill:!0},path26:{type:"path",points:[{x:-.2985911500000009,y:-.2921307000000013},{x:.22988164999999938,y:.2328032000000011}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:.055041669999999154,y:-.2009376800000009},bottom1:{type:"text",text:"{VAL}",x:-.10019643000000089,y:.27857531999999985}},refblocks:{left1:{x:-.5346914500000006,y:.0013439000000019519},right1:{x:.5346914500000004,y:.001956599999999753}},bounds:{minX:-.5628498910000006,maxX:.5628498910000004,minY:-.3009376800000009,maxY:.2921307000000013,width:1.125699782000001,height:.2430683800000022,centerX:-11102230246251565e-32,centerY:-.004403489999999788},circles:{}},{paths:paths38,texts:texts52,bounds:bounds38,refblocks:refblocks38}=potentiometer2_default,potentiometer2_horz_default={primitives:[...Object.values(paths38),{...texts52.bottom1,anchor:"middle_top"},{...texts52.top1,anchor:"middle_bottom"}],ports:[{...refblocks38.left1,labels:["1"]},{...refblocks38.right1,labels:["2"]}],size:{width:bounds38.width,height:bounds38.height},center:{x:bounds38.centerX,y:bounds38.centerY}},rotated6=rotateSymbol(potentiometer2_horz_default),texts53=rotated6.primitives.filter(lV=>lV.type==="text"),val18=texts53.find(lV=>lV.text==="{VAL}");val18.anchor="middle_right";var ref22=texts53.find(lV=>lV.text==="{REF}");ref22.anchor="middle_left";var potentiometer2_vert_default=rotated6,power_factor_meter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.16538809999999904,y:-.36705149999999964},bottom1:{type:"text",text:"{VAL}",x:-.0066096999999991635,y:.42330070000000064},left1:{type:"text",text:"COS φ",x:-.14859499999999937,y:.014279000000000375}},refblocks:{left1:{x:-.5446330999999993,y:.000852800000000542},right1:{x:.5381638000000004,y:-.00014359999999924433}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:0,maxY:0,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.007128299999999532,radius:.28854213,color:"primary",fill:!1}}},{paths:paths39,texts:texts54,bounds:bounds39,refblocks:refblocks39,circles:circles33}=power_factor_meter_default,power_factor_meter_horz_default={primitives:[...Object.values(paths39),...Object.values(circles33),{type:"text",text:"{REF}",x:-.15,y:-.42330070000000064,anchor:"middle_left"},{type:"text",text:"{VAL}",x:-.15,y:.42330070000000064,anchor:"middle_left"},{type:"text",text:"COS φ",x:-.14,y:.014279000000000375,anchor:"middle-left"}],ports:[{...refblocks39.left1,labels:["1"]},{...refblocks39.right1,labels:["2"]}],size:{width:bounds39.width,height:bounds39.height},center:{x:bounds39.centerX,y:bounds39.centerY}},rotatedSymbol22=rotateSymbol(power_factor_meter_horz_default),texts55=rotatedSymbol22.primitives.filter(lV=>lV.type==="text"),ref23=texts55.find(lV=>lV.text==="{REF}"),val19=texts55.find(lV=>lV.text==="{VAL}"),text_cos=texts55.find(lV=>lV.text==="COS φ");ref23.x=.35,ref23.y=0,val19.x=-.6,val19.y=0,text_cos.x=-.1,text_cos.y=0;var power_factor_meter_vert_default=rotatedSymbol22,push_button_normally_closed_momentary_default={paths:{"path12-1-8-6-9":{type:"path",points:[{x:.010157449999999457,y:-.07203999999999766},{x:.010157449999999457,y:.04317300000000124}],color:"primary",fill:!1},"path12-1-5-6":{type:"path",points:[{x:-.48740705000000073,y:.024894000000003302},{x:-.17310075000000147,y:.024894000000003302}],color:"primary",fill:!1},"path12-1-8-0":{type:"path",points:[{x:-.17515525000000043,y:.04869000000000234},{x:.1954249499999996,y:.04869000000000234}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:.1954987499999996,y:.02450500000000133},{x:.4881436499999996,y:.02450500000000133}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:.009807749999999338,y:-.252520999999998},bottom1:{type:"text",text:"{VAL}",x:-.157175650000001,y:.26252100000000134}},refblocks:{left1:{x:-.4717985500000008,y:.02486700000000397},right1:{x:.4717985499999999,y:.024892000000003023}},bounds:{minX:-.4999569910000008,maxX:.4999569909999999,minY:-.352520999999998,maxY:.26252100000000134,width:.9999139820000007,height:.26504199999999933,centerX:-4440892098500626e-31,centerY:-.04499999999999832},circles:{}},{paths:paths40,texts:texts56,bounds:bounds40,refblocks:refblocks40}=push_button_normally_closed_momentary_default,push_button_normally_closed_momentary_horz_default={primitives:[...Object.values(paths40),{...texts56.top1,anchor:"middle_bottom"},{...texts56.bottom1,anchor:"middle_top"}],ports:[{...refblocks40.left1,labels:["1"]},{...refblocks40.right1,labels:["2"]}],size:{width:bounds40.width,height:bounds40.height},center:{x:bounds40.centerX,y:bounds40.centerY}},rotated7=rotateSymbol(push_button_normally_closed_momentary_horz_default),ref24=rotated7.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val20=rotated7.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref24.anchor="middle_left",val20.anchor="middle_right",ref24.x=ref24.x-.03,ref24.y=ref24.y,val20.x=val20.x,val20.y=0;var push_button_normally_closed_momentary_vert_default=rotated7,push_button_normally_open_momentary_default={paths:{"path12-1-8-6-9":{type:"path",points:[{x:.005962250000000502,y:-.14781649999999757},{x:.005962250000000502,y:-.03142349999999894}],color:"primary",fill:!1},"path12-1-5-6":{type:"path",points:[{x:-.48740705000000073,y:.05648450000000338},{x:-.17310075000000058,y:.05648450000000338}],color:"primary",fill:!1},"path12-1-8-0":{type:"path",points:[{x:-.16008695000000017,y:-.02584949999999786},{x:.1719709499999995,y:-.02584949999999786}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:.1954987499999996,y:.05609550000000141},{x:.4881436499999996,y:.05609550000000141}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:.006701050000000208,y:-.2196184999999975},bottom1:{type:"text",text:"{VAL}",x:-.16130964999999975,y:.22961850000000084}},refblocks:{left1:{x:-.4717985499999999,y:.05645750000000227},right1:{x:.4717985499999999,y:.05648250000000132}},bounds:{minX:-.4999569909999999,maxX:.4999569909999999,minY:-.3196184999999975,maxY:.22961850000000084,width:.9999139819999998,height:.19923699999999833,centerX:0,centerY:-.04499999999999832},circles:{}},{paths:paths41,texts:texts57,bounds:bounds41,refblocks:refblocks41}=push_button_normally_open_momentary_default,push_button_normally_open_momentary_horz_default={primitives:[...Object.values(paths41),{...texts57.top1,anchor:"middle_bottom"},{...texts57.bottom1,anchor:"middle_top"}],ports:[{...refblocks41.left1,labels:["1"]},{...refblocks41.right1,labels:["2"]}],size:{width:bounds41.width,height:bounds41.height},center:{x:bounds41.centerX,y:bounds41.centerY}},rotated8=rotateSymbol(push_button_normally_open_momentary_horz_default),ref25=rotated8.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val21=rotated8.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref25.anchor="middle_left",val21.anchor="middle_right",ref25.x=ref25.x+.1,ref25.y=ref25.y,val21.x=val21.x,val21.y=0;var push_button_normally_open_momentary_vert_default=rotated8,rectifier_diode_default={paths:{path40:{type:"path",points:[{x:-.19250837381256392,y:-.32749349347032286},{x:-.25568957329611974,y:-.13794979950157282}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.38205206778131373,y:-.26431229398676837},{x:-.19250837381256392,y:-.32749349347032286}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.2556895732961204,y:-.13794979950157416},{x:-.38205206778131373,y:-.26431229398676837}],color:"primary",fill:!1},path43:{type:"path",points:[{x:-.2556896210551609,y:-.39067474071292196},{x:-.12932712656996737,y:-.26431224622772653}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.3199237641156438,y:-.2000781031672434},{x:-.5084145145074668,y:-.011587352775420667}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:-.011560829633404435,y:-.5083596562436202},{x:-.19004023433272543,y:-.3298802515442989}],color:"primary",fill:!1},"path40-4":{type:"path",points:[{x:-.19250813152967883,y:.3220463011874377},{x:-.38205182549842887,y:.2588651017038819}],color:"primary",fill:!1},"path41-1":{type:"path",points:[{x:-.2556893310132333,y:.13250260721868767},{x:-.19250813152967883,y:.3220463011874377}],color:"primary",fill:!1},"path42-7":{type:"path",points:[{x:-.38205182549842753,y:.258865101703881},{x:-.2556893310132333,y:.13250260721868767}],color:"primary",fill:!1},"path43-1":{type:"path",points:[{x:-.12932688428707984,y:.2588650539448407},{x:-.25568937877227516,y:.38522754843003404}],color:"primary",fill:!1},"path44-8":{type:"path",points:[{x:-.3199235218327583,y:.19463091088435758},{x:-.508414272224581,y:.006140160492534852}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:-.011641968756381349,y:.5029938453665972},{x:-.1901213734557028,y:.3245144406672762}],color:"primary",fill:!1},"path40-4-0":{type:"path",points:[{x:.322578868470321,y:-.19315369881256328},{x:.13303517450157099,y:-.2563348982961191}],color:"primary",fill:!1},"path41-1-2":{type:"path",points:[{x:.2593976689867663,y:-.3826973927813131},{x:.322578868470321,y:-.19315369881256328}],color:"primary",fill:!1},"path42-7-1":{type:"path",points:[{x:.13303517450157232,y:-.2563348982961198},{x:.2593976689867663,y:-.3826973927813131}],color:"primary",fill:!1},"path43-1-8":{type:"path",points:[{x:.38576011571292,y:-.2563349460551603},{x:.2593976212277247,y:-.12997245156996673}],color:"primary",fill:!1},"path44-8-7":{type:"path",points:[{x:.19516347816724133,y:-.3205690891156432},{x:.006672727775418608,y:-.509059839507466}],color:"primary",fill:!1},"path44-0-7-1":{type:"path",points:[{x:.5034450312436185,y:-.012206154633403798},{x:.32496562654429706,y:-.19068555933272457}],color:"primary",fill:!1},"path40-4-8":{type:"path",points:[{x:.3220220261874358,y:.19326390652967795},{x:.25884082670387976,y:.382807600498428}],color:"primary",fill:!1},"path41-1-4":{type:"path",points:[{x:.13247833221868577,y:.25644510601323245},{x:.3220220261874358,y:.19326390652967795}],color:"primary",fill:!1},"path42-7-0":{type:"path",points:[{x:.2588408267038793,y:.38280760049842666},{x:.13247833221868577,y:.25644510601323245}],color:"primary",fill:!1},"path43-1-0":{type:"path",points:[{x:.2588407789448386,y:.13008265928707896},{x:.38520327343003213,y:.2564451537722743}],color:"primary",fill:!1},"path44-8-9":{type:"path",points:[{x:.19460663588435567,y:.3206792968327574},{x:.0061158854925329464,y:.5091700472245801}],color:"primary",fill:!1},"path44-0-7-3":{type:"path",points:[{x:.5029695703665951,y:.012397743756380697},{x:.3244901656672745,y:.19087714845570192}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.2872803000000015,y:-.4564494249999992},bottom1:{type:"text",text:"{VAL}",x:-.2872803000000015,y:.4960514750000007}},refblocks:{top1:{x:.0005126999999993664,y:-.5191475},bottom1:{x:-.0005123000000009093,y:.5191475000000001},left1:{x:-.5191472999999998,y:-.0005123250000014234},right1:{x:.5191473000000002,y:.0005123749999977889}},bounds:{minX:-.5473057409999997,maxX:.5473057410000002,minY:-.5564494249999992,maxY:.5473059410000001,width:1.094611482,height:1.1037553659999992,centerX:2220446049250313e-31,centerY:-.004571741999999546},circles:{}},{paths:paths42,texts:texts58,bounds:bounds42,refblocks:refblocks42,circles:circles34}=rectifier_diode_default,rectifier_diode_horz_default={primitives:[...Object.values(paths42),...Object.values(circles34),{...texts58.top1,anchor:"middle_right"},{...texts58.bottom1,anchor:"middle_right"}],ports:[{...refblocks42.top1,labels:["1"]},{...refblocks42.bottom1,labels:["2"]},{...refblocks42.left1,labels:["3"]},{...refblocks42.right1,labels:["4"]}],size:{width:bounds42.width,height:bounds42.height},center:{x:bounds42.centerX,y:bounds42.centerY}},rotated9=rotateSymbol(rectifier_diode_horz_default),ref26=rotated9.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val22=rotated9.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref26.anchor="middle_left",val22.anchor="middle_right";var rectifier_diode_vert_default=rotated9,resonator_default={paths:{path27:{type:"path",points:[{x:.7635944500000007,y:.28495445000000075},{x:.3138028500000005,y:.28495445000000075}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-.301017949999999,y:.02024775000000112},{x:-.7508096499999994,y:.02024775000000112}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-.3010179499999994,y:-.34304865000000007},{x:-.301017949999999,y:.2848310499999993}],color:"primary",fill:!1},"path27-3":{type:"path",points:[{x:.7729788499999999,y:-.34624514999999967},{x:.32318725000000015,y:-.34624514999999967}],color:"primary",fill:!1},"path29-5":{type:"path",points:[{x:-.07279374999999932,y:.28481924999999997},{x:-.2983350499999995,y:.28481924999999997}],color:"primary",fill:!1},"path29-5-7":{type:"path",points:[{x:.33114835000000076,y:.284840449999999},{x:.10560705000000059,y:.284840449999999}],color:"primary",fill:!1},"path29-5-7-6":{type:"path",points:[{x:-.055820049999999455,y:.17265845000000013},{x:-.055820049999999455,y:.39819974999999985}],color:"primary",fill:!1},"path29-5-7-6-6":{type:"path",points:[{x:.09396265000000081,y:.17268285000000105},{x:.09396265000000081,y:.3982241500000008}],color:"primary",fill:!1},"path29-5-9":{type:"path",points:[{x:-.07296184999999955,y:-.3463701499999985},{x:-.2985031499999997,y:-.3463701499999985}],color:"primary",fill:!1},"path29-5-7-2":{type:"path",points:[{x:.33098025000000053,y:-.3463489500000012},{x:.10543895000000036,y:-.3463489500000012}],color:"primary",fill:!1},"path29-5-7-6-0":{type:"path",points:[{x:-.05598814999999968,y:-.4585309500000001},{x:-.05598814999999968,y:-.2329896499999986}],color:"primary",fill:!1},"path29-5-7-6-6-2":{type:"path",points:[{x:.09379455000000014,y:-.45850655000000096},{x:.09379455000000014,y:-.23296525000000123}],color:"primary",fill:!1},"path29-5-92":{type:"path",points:[{x:.3315317500000008,y:-.12063885000000063},{x:.33153175000000035,y:-.34618015000000035}],color:"primary",fill:!1},"path29-5-7-28":{type:"path",points:[{x:.3315105500000004,y:.28330324999999945},{x:.3315105500000004,y:.05776194999999973}],color:"primary",fill:!1},"path29-5-7-6-9":{type:"path",points:[{x:.44369255000000063,y:-.1036651500000012},{x:.21815125000000046,y:-.1036651500000012}],color:"primary",fill:!1},"path29-5-7-6-6-7":{type:"path",points:[{x:.4436681500000006,y:.04611754999999995},{x:.21812685000000043,y:.04611754999999995}],color:"primary",fill:!1},"path29-5-7-6-9-2":{type:"path",points:[{x:.44235445000000073,y:-.06667004999999904},{x:.21681315000000057,y:-.06667004999999904}],color:"primary",fill:!1},"path29-5-7-6-9-2-4":{type:"path",points:[{x:.4429695500000004,y:.007559849999998036},{x:.4430214500000007,y:-.06634914999999886}],color:"primary",fill:!1},"path29-5-7-6-9-2-4-6":{type:"path",points:[{x:.21634305000000031,y:.008546850000001882},{x:.21639495000000064,y:-.06536215000000212}],color:"primary",fill:!1},"path29-5-7-6-9-2-9":{type:"path",points:[{x:.4429537500000005,y:.009130850000000024},{x:.21741245000000076,y:.009130850000000024}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:.01596175000000022,y:-.5308501500000009},bottom1:{type:"text",text:"{VAL}",x:.013116750000000454,y:.5408501499999989}},refblocks:{left1:{x:-.7666234499999998,y:.0211504499999986},right1:{x:.7666234500000004,y:-.344347250000002},right2:{x:.7572390499999999,y:.2868523500000002}},bounds:{minX:-.7947818909999997,maxX:.7947818910000004,minY:-.6308501500000009,maxY:.5408501499999989,width:1.5895637820000001,height:1.1717003,centerX:33306690738754696e-32,centerY:-.045000000000000984},circles:{}},{paths:paths43,texts:texts59,bounds:bounds43,refblocks:refblocks43,circles:circles35}=resonator_default,resonator_horz_default={primitives:[...Object.values(paths43),...Object.values(circles35),{type:"text",text:"{REF}",x:.01596175000000022,y:-.5308501500000009,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:.013116750000000454,y:.5408501499999989,anchor:"middle_top"}],ports:[{...refblocks43.left1,labels:["1"]},{...refblocks43.right1,labels:["2"]},{...refblocks43.right2,labels:["3"]}],size:{width:bounds43.width,height:bounds43.height},center:{x:bounds43.centerX,y:bounds43.centerY}},resonator_vert_default=rotateSymbol(resonator_horz_default),schottky_diode_default={paths:{path40:{type:"path",points:[{x:.14133375000000115,y:.0006371999999998934},{x:-.12324954999999838,y:.13292890000000046}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.12324954999999971,y:-.13165450000000045},{x:.1413337499999998,y:.0006371999999998934}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.12324954999999971,y:.13292890000000046},{x:-.12324954999999971,y:-.1316544999999989}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.14027445000000127,y:-.13377310000000042},{x:.14133345000000053,y:.1329288999999989}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.12545424999999977,y:.0006371999999998934},{x:-.5201245499999998,y:.0006371999999998934}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:.5201245499999998,y:.0007223999999994568},{x:.1464164499999996,y:.0007223999999994568}],color:"primary",fill:!1},"path43-7":{type:"path",points:[{x:.20429785000000056,y:-.13505779999999978},{x:.14015525000000095,y:-.1339758000000002}],color:"primary",fill:!1},"path43-7-9":{type:"path",points:[{x:.20608895000000027,y:-.08549420000000074},{x:.2047149500000005,y:-.13482980000000122}],color:"primary",fill:!1},"path43-7-2":{type:"path",points:[{x:.0765343500000002,y:.1349070999999995},{x:.13988425000000015,y:.1346870999999994}],color:"primary",fill:!1},"path43-7-9-3":{type:"path",points:[{x:.0743883500000011,y:.0857221999999993},{x:.07576235000000087,y:.1350578}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.00828064999999878,y:-.2291716000000008},bottom1:{type:"text",text:"{VAL}",x:-.003367349999999103,y:.31851899999999933}},refblocks:{left1:{x:-.5224026499999993,y:-.0002470999999999446},right1:{x:.5158915500000005,y:.0007775999999992678}},bounds:{minX:-.5201245499999998,maxX:.5201245499999998,minY:-.13505779999999978,maxY:.1350578,width:1.0402490999999996,height:1,centerX:0,centerY:11102230246251565e-32},circles:{}},{paths:paths44,texts:texts60,bounds:bounds44,refblocks:refblocks44,circles:circles36}=schottky_diode_default,schottky_diode_horz_default={primitives:[...Object.values(paths44),...Object.values(circles36),{...texts60.top1,anchor:"middle_bottom"},{...texts60.bottom1,anchor:"middle_top"}],ports:[{...refblocks44.left1,labels:["1"]},{...refblocks44.right1,labels:["2"]}],size:{width:bounds44.width,height:bounds44.height},center:{x:bounds44.centerX,y:bounds44.centerY}},rotated10=rotateSymbol(schottky_diode_horz_default),ref27=rotated10.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val23=rotated10.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref27.anchor="middle_left",val23.anchor="middle_right";var schottky_diode_vert_default=rotated10,silicon_controlled_rectifier_default={paths:{path11:{type:"path",points:[{x:-.49895505000000084,y:-.036744850000000495},{x:-.177441850000001,y:-.036744850000000495}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.18704774999999918,y:-.044614150000000574},{x:.5063384499999999,y:-.044614150000000574}],color:"primary",fill:!1},"path12-6":{type:"path",points:[{x:.18219425000000045,y:.15700134999999915},{x:.1810882500000004,y:-.246215650000001}],color:"primary",fill:!1},"path12-2":{type:"path",points:[{x:.18646324999999986,y:.00021334999999966797},{x:.34602244999999954,y:.14039324999999936}],color:"primary",fill:!1},"path12-2-9":{type:"path",points:[{x:.3463884499999992,y:.14577354999999947},{x:.3447284499999994,y:.3393437499999994}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-.17016305000000087,y:-.2656752500000006},{x:-.17223005000000047,y:.1570086499999992},{x:.180362149999999,y:-.042608550000000855},{x:-.16624855000000038,y:-.26680665000000126}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-.22312565000000006,y:-.37773544999999986},bottom1:{type:"text",text:"{VAL}",x:.030109249999999532,y:.38773544999999987}},refblocks:{bottom1:{x:.3445824499999999,y:.35453845000000017},left1:{x:-.5177904499999998,y:-.03589204999999995},right1:{x:.5177904499999997,y:-.04475774999999982}},bounds:{minX:-.5459488909999998,maxX:.5459488909999997,minY:-.47773544999999984,maxY:.38773544999999987,width:1.0918977819999993,height:1,centerX:-5551115123125783e-32,centerY:-.044999999999999984},circles:{}},{paths:paths45,texts:texts61,bounds:bounds45,refblocks:refblocks45,circles:circles37}=silicon_controlled_rectifier_default,silicon_controlled_rectifier_horz_default={primitives:[...Object.values(paths45),...Object.values(circles37),{...texts61.top1,anchor:"middle_left"},{...texts61.bottom1,anchor:"middle_top"}],ports:[{...refblocks45.left1,labels:["1"]},{...refblocks45.right1,labels:["2"]},{...refblocks45.bottom1,labels:["3"]}],size:{width:bounds45.width,height:bounds45.height},center:{x:bounds45.centerX,y:bounds45.centerY}},rotatedSymbol23=rotateSymbol(silicon_controlled_rectifier_horz_default),texts62=rotatedSymbol23.primitives.filter(lV=>lV.type==="text"),ref28=texts62.find(lV=>lV.text==="{REF}");ref28.y=0,ref28.anchor="middle_left";var silicon_controlled_rectifier_vert_default=rotatedSymbol23,SPDT_switch_default={paths:{path1:{type:"path",points:[{x:-.3543583500000005,y:-.027043850000000758},{x:-.12792935000000005,y:-.027043850000000758}],color:"primary",fill:!1},"path-1-3":{type:"path",points:[{x:-.1133669500000003,y:-.027198750000000382},{x:.11208324999999997,y:-.14100155000000036}],color:"primary",fill:!1},path2:{type:"path",points:[{x:.1043477500000003,y:.06951304999999941},{x:.34508875000000017,y:.06951304999999941}],color:"primary",fill:!1},path3:{type:"path",points:[{x:.12008575000000055,y:-.1671466500000005},{x:.3608267500000004,y:-.1671466500000005}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17853294999999947,y:-.39216264999999995},bottom1:{type:"text",text:"{VAL}",x:-.011861250000000378,y:.40216264999999995}},refblocks:{top1:{x:.10744654999999947,y:-.16714664999999962},left1:{x:-.3682737499999995,y:-.02704385000000009},left2:{x:-.11569114999999996,y:-.02704385000000009},right1:{x:.3682737499999995,y:-.16714664999999962},right2:{x:.3682737499999995,y:.06951305000000008},right3:{x:.10744725000000055,y:.06951305000000008}},bounds:{minX:-.3964321909999995,maxX:.3964321909999995,minY:-.4921626499999999,maxY:.40216264999999995,width:.792864381999999,height:.5443252999999999,centerX:0,centerY:-.044999999999999984},circles:{}},{paths:paths46,texts:texts63,bounds:bounds46,refblocks:refblocks46,circles:circles38}=SPDT_switch_default,SPDT_switch_horz_default={primitives:[...Object.values(paths46),...Object.values(circles38),{...texts63.top1,anchor:"middle_bottom",x:-.01},{...texts63.bottom1,anchor:"middle_top",x:-.01}],ports:[{...refblocks46.left1,labels:["1"]},{...refblocks46.right1,labels:["3"]},{...refblocks46.right2,labels:["2"]}],size:{width:bounds46.width,height:bounds46.height},center:{x:bounds46.centerX,y:bounds46.centerY}},rotatedSymbol24=rotateSymbol(SPDT_switch_horz_default),texts64=rotatedSymbol24.primitives.filter(lV=>lV.type==="text"),val24=texts64.find(lV=>lV.text==="{VAL}");val24.anchor="middle_right",val24.x=-.3,val24.y=0;var ref29=texts64.find(lV=>lV.text==="{REF}");ref29.anchor="middle_left",ref29.x=.3,ref29.y=0;var SPDT_switch_vert_default=rotatedSymbol24,SPST_switch_default={paths:{path11:{type:"path",points:[{x:-.3622273500000006,y:-.029865150000000895},{x:-.13579835000000018,y:-.029865150000000895}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-.12010005000000046,y:-.02833465000000035},{x:.10307834999999987,y:-.16802405000000076}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.12795584999999932,y:-.029865150000000895},{x:.3686967499999996,y:-.029865150000000895}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.1864019499999996,y:-.39216264999999995},bottom1:{type:"text",text:"{VAL}",x:-.019730250000000504,y:.40216264999999995}},refblocks:{left1:{x:-.37614274999999964,y:-.02901224999999985},left2:{x:-.12356015000000009,y:-.025075450000000332},right1:{x:.37614274999999964,y:-.030008650000000303},right2:{x:.11531695000000042,y:-.025075450000000332}},bounds:{minX:-.4043011909999996,maxX:.4043011909999996,minY:-.4921626499999999,maxY:.40216264999999995,width:1,height:1,centerX:0,centerY:-.044999999999999984},circles:{}},{paths:paths47,texts:texts65,bounds:bounds47,refblocks:refblocks47,circles:circles39}=SPST_switch_default,SPST_switch_horz_default={primitives:[...Object.values(paths47),...Object.values(circles39),{...texts65.top1,anchor:"middle_bottom",x:0},{...texts65.bottom1,anchor:"middle_top",x:0}],ports:[{...refblocks47.left1,labels:["1"]},{...refblocks47.right1,labels:["2"]}],size:{width:bounds47.width,height:bounds47.height},center:{x:bounds47.centerX,y:bounds47.centerY}},rotatedSymbol25=rotateSymbol(SPST_switch_horz_default),texts66=rotatedSymbol25.primitives.filter(lV=>lV.type==="text"),val25=texts66.find(lV=>lV.text==="{VAL}");val25.anchor="middle_right",val25.x=-.3,val25.y=0;var ref30=texts66.find(lV=>lV.text==="{REF}");ref30.anchor="middle_left",ref30.x=.3,ref30.y=0;var SPST_switch_vert_default=rotatedSymbol25,step_recovery_diode_default={paths:{path40:{type:"path",points:[{x:.14458890000000002,y:-.03903629999999936},{x:-.1199943999999995,y:.09325540000000032}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.1199943999999995,y:-.1713280000000026},{x:.14458890000000002,y:-.03903629999999936}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.1199943999999995,y:.09325539999999677},{x:-.1199943999999995,y:-.1713280000000026}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.14458890000000002,y:-.1713280000000026},{x:.14458890000000002,y:.09325539999999677}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.12219909999999956,y:-.03903629999999936},{x:-.5168693999999996,y:-.03903629999999936}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:.5233797,y:-.038951100000002015},{x:.14967160000000002,y:-.038951100000002015}],color:"primary",fill:!1},"path43-5":{type:"path",points:[{x:.19156529999999972,y:.09340209999999871},{x:.14591529999999908,y:.0937620999999993}],color:"primary",fill:!1},"path43-5-2":{type:"path",points:[{x:.19233440000000046,y:.1405493999999976},{x:.19197439999999988,y:.09489939999999919}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.0050250999999996715,y:-.26884529999999884},bottom1:{type:"text",text:"{VAL}",x:-.00011179999999999524,y:.2788453000000004}},refblocks:{left1:{x:-.5191471000000001,y:-.0399206999999997},right1:{x:.5191471000000001,y:-.03889610000000232}},bounds:{minX:-.5473055410000001,maxX:.5473055410000001,minY:-.3688452999999988,maxY:.2788453000000004,width:1.0946110820000001,height:1,centerX:0,centerY:-.04499999999999921},circles:{}},{paths:paths48,texts:texts67,bounds:bounds48,refblocks:refblocks48,circles:circles40}=step_recovery_diode_default,step_recovery_diode_horz_default={primitives:[...Object.values(paths48),...Object.values(circles40),{type:"text",text:"{REF}",x:-.0050250999999996715,y:-.26884529999999884,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:-.00011179999999999524,y:.2788453000000004,anchor:"middle_top"}],ports:[{...refblocks48.left1,labels:["1"]},{...refblocks48.right1,labels:["2"]}],size:{width:bounds48.width,height:bounds48.height},center:{x:bounds48.centerX,y:bounds48.centerY}},step_recovery_diode_vert_default=rotateSymbol(step_recovery_diode_horz_default),tachometer_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.36197569999999946},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.43234960000000044},left1:{type:"text",text:"RPM",x:0,y:-.025}},refblocks:{left1:{x:-.5446330999999993,y:.000852800000000542},right1:{x:.5381638000000004,y:-.00014359999999924433}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:0,maxY:0,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.007128299999999532,radius:.28854213,color:"primary",fill:!1}}},{paths:paths49,texts:texts68,bounds:bounds49,refblocks:refblocks49,circles:circles41}=tachometer_default,tachometer_horz_default={primitives:[...Object.values(paths49),...Object.values(circles41),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"},{...texts68.left1,anchor:"center",fontSize:.2}],ports:[{...refblocks49.left1,labels:["1"]},{...refblocks49.right1,labels:["2"]}],size:{width:bounds49.width,height:bounds49.height},center:{x:bounds49.centerX,y:bounds49.centerY}},{5:letter5,...rest5}=tachometer_horz_default.primitives;function isPrimitive5(lV){return typeof lV=="object"}var rotatedSymbol26=rotateSymbol({...tachometer_horz_default,primitives:Object.values(rest5).filter(isPrimitive5)}),tachometer_vert_default={...rotatedSymbol26,primitives:[...rotatedSymbol26.primitives,letter5]},triac_default={paths:{path11:{type:"path",points:[{x:-.5176700499999997,y:-.03674505000000039},{x:-.10888805000000024,y:-.03674505000000039}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.1031184499999993,y:-.03674505000000039},{x:.5246894499999994,y:-.03674505000000039}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-.09343985000000021,y:.15120634999999893},{x:-.0930998500000002,y:-.2533405500000008}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:.08519034999999908,y:.15003384999999914},{x:.08553034999999909,y:-.2545130500000006}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-.08315755000000014,y:-.05093445000000041},{x:-.08415755000000047,y:.15178124999999976},{x:.08653524999999984,y:.05604664999999964},{x:-.08126175000000035,y:-.051477150000000194}],color:"primary",fill:!0},"path11-0-9-0":{type:"path",points:[{x:.07661224999999927,y:-.25165445000000086},{x:.07761224999999983,y:-.04893885000000098},{x:-.0930805500000007,y:-.1446734500000011},{x:.07471644999999949,y:-.2521971500000013}],color:"primary",fill:!0},"path12-2":{type:"path",points:[{x:.09001085000000009,y:.06464874999999926},{x:.2707999499999998,y:.17611474999999932}],color:"primary",fill:!1},"path12-2-9":{type:"path",points:[{x:.27291134999999955,y:.18091894999999947},{x:.27124034999999935,y:.30668314999999935}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17328624999999964,y:-.41183614999999985},bottom1:{type:"text",text:"{VAL}",x:-.03022294999999975,y:.4218361500000001}},refblocks:{bottom1:{x:.27223905000000026,y:.31379625},left1:{x:-.54139845,y:-.0358920500000004},right1:{x:.5413984499999995,y:-.03688844999999996}},bounds:{minX:-.569556891,maxX:.5695568909999995,minY:-.5118361499999998,maxY:.4218361500000001,width:1.1391137819999995,height:.5836722999999999,centerX:-2220446049250313e-31,centerY:-.04499999999999987},circles:{path1:{type:"circle",x:-.0037626500000003116,y:-.04387315000000025,radius:.28854213,color:"primary",fill:!1}}},{paths:paths50,texts:texts69,bounds:bounds50,refblocks:refblocks50,circles:circles42}=triac_default,triac_horz_default={primitives:[...Object.values(paths50),...Object.values(circles42),{...texts69.top1,anchor:"middle_left"},{...texts69.bottom1,anchor:"middle_top"}],ports:[{...refblocks50.left1,labels:["1"]},{...refblocks50.right1,labels:["2"]},{...refblocks50.bottom1,labels:["3"]}],size:{width:bounds50.width,height:bounds50.height},center:{x:bounds50.centerX,y:bounds50.centerY}},rotatedSymbol27=rotateSymbol(triac_horz_default),texts70=rotatedSymbol27.primitives.filter(lV=>lV.type==="text"),ref31=texts70.find(lV=>lV.text==="{REF}"),val26=texts70.find(lV=>lV.text==="{VAL}");ref31.y=0,val26.y=0;var triac_vert_default=rotatedSymbol27,tunnel_diode_default={paths:{path40:{type:"path",points:[{x:.1413337499999996,y:-.00041674999999941065},{x:-.12324954999999993,y:.13187495000000093}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.12324954999999993,y:-.13270844999999976},{x:.1413337499999996,y:-.00041674999999941065}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.12324954999999993,y:.1318749499999996},{x:-.12324954999999993,y:-.13270844999999976}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.1413337499999996,y:-.13270844999999976},{x:.1413337499999996,y:.1318749499999996}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.12545425,y:-.00041674999999941065},{x:-.52012455,y:-.00041674999999941065}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:.5201245499999998,y:-.00033154999999984724},{x:.14641644999999937,y:-.00033154999999984724}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:.1401360499999995,y:-.13319134999999993},{x:.07403164999999912,y:-.13270134999999916}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:.14135174999999967,y:.13270134999999939},{x:.07524734999999927,y:.13319134999999993}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.0082802500000001,y:-.23022574999999956},bottom1:{type:"text",text:"{VAL}",x:-.0033669500000002017,y:.31746485000000035}},refblocks:{left1:{x:-.5224022500000005,y:-.0013011500000004173},right1:{x:.5158919499999994,y:-.00027654999999948693}},bounds:{minX:-.52012455,maxX:.5201245499999998,minY:-.13319134999999993,maxY:.13319134999999993,width:1.0402490999999998,height:1,centerX:-11102230246251565e-32,centerY:0},circles:{}},{paths:paths51,texts:texts71,bounds:bounds51,refblocks:refblocks51,circles:circles43}=tunnel_diode_default,tunnel_diode_horz_default={primitives:[...Object.values(paths51),...Object.values(circles43),{...texts71.top1,anchor:"middle_bottom"},{...texts71.bottom1,anchor:"middle_top"}],ports:[{...refblocks51.left1,labels:["1"]},{...refblocks51.right1,labels:["2"]}],size:{width:bounds51.width,height:bounds51.height},center:{x:bounds51.centerX,y:bounds51.centerY}},rotated11=rotateSymbol(tunnel_diode_horz_default),ref32=rotated11.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val27=rotated11.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref32.anchor="middle_left",val27.anchor="middle_right";var tunnel_diode_vert_default=rotated11,unijunction_transistor_default={paths:{path11:{type:"path",points:[{x:-.3274461945,y:-.20527883627037657},{x:-.021085194500000348,y:-.007570136270376837}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2331163055000003,y:-.1251673362703769},{x:.2320633055000001,y:-.3759855362703768}],color:"primary",fill:!1},"path12-2":{type:"path",points:[{x:.23221610549999938,y:.0818845637296235},{x:.2311631054999992,y:.33270276372962315}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-.013263894499999873,y:.1792007637296229},{x:-.012923894499999866,y:-.2253461362703768}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:.23222970550000066,y:-.12047013627037662},{x:-.011307094499999115,y:-.11996013627037683}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-.1124341944999998,y:-.131359936270377},{x:-.16993279449999954,y:-.039004036270377185},{x:-.05822649449999928,y:-.03212003627037707},{x:-.11133889449999979,y:-.13104553627037707}],color:"primary",fill:!0},"path11-0-3-8":{type:"path",points:[{x:.23230320549999983,y:.08329316372962325},{x:-.011233594499999944,y:.07900616372962332}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.19541139450000045,y:-.389088136270376},bottom1:{type:"text",text:"{VAL}",x:-.031363394499999364,y:.42359956372962415}},refblocks:{top1:{x:.2317438004035266,y:-.3954411227296242},bottom1:{x:.2308431668082036,y:.35215823360635445},left1:{x:-.34055979449999985,y:-.21512343627037622}},bounds:{minX:-.3687182354999998,maxX:.3687182354999999,minY:-.48908813627037595,maxY:.42359956372962415,width:.7374364709999996,height:.5626877000000001,centerX:27755575615628914e-33,centerY:-.0327442862703759},circles:{path1:{type:"circle",x:.08017610549999987,y:-.006746336270376352,radius:.28854213,color:"primary",fill:!1}}},{paths:paths52,texts:texts72,bounds:bounds52,refblocks:refblocks52,circles:circles44}=unijunction_transistor_default,unijunction_transistor_horz_default={primitives:[...Object.values(paths52),...Object.values(circles44),{...texts72.top1,anchor:"middle_left"},{...texts72.bottom1,anchor:"middle_right"}],ports:[{...refblocks52.top1,labels:["1"]},{...refblocks52.bottom1,labels:["2"]},{...refblocks52.left1,labels:["3"]}],size:{width:bounds52.width,height:bounds52.height},center:{x:bounds52.centerX,y:bounds52.centerY}},rotatedSymbol28=rotateSymbol(unijunction_transistor_horz_default),texts73=rotatedSymbol28.primitives.filter(lV=>lV.type==="text"),ref33=texts73.find(lV=>lV.text==="{REF}");ref33.y=.1;var val28=texts73.find(lV=>lV.text==="{VAL}");val28.y=.1,val28.x=-.4;var unijunction_transistor_vert_default=rotatedSymbol28,var_meter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.36197569999999946},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.43234960000000044},left1:{type:"text",text:"Var",x:-.19436529999999896,y:.07249430000000023}},refblocks:{left1:{x:-.5446330999999993,y:.000852800000000542},right1:{x:.5381638000000004,y:-.00014359999999924433}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:0,maxY:0,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.007128299999999532,radius:.28854213,color:"primary",fill:!1}}},{paths:paths53,texts:texts74,bounds:bounds53,refblocks:refblocks53,circles:circles45}=var_meter_default,var_meter_horz_default={primitives:[...Object.values(paths53),...Object.values(circles45),{...texts74.top1,x:0,y:-.3594553499999995,anchor:"middle_bottom"},{...texts74.bottom1,x:0,y:.35,anchor:"middle_top"},{...texts74.left1,x:-.02,y:-.02,fontSize:.2,anchor:"center"}],ports:[{...refblocks53.left1,labels:["1"]},{...refblocks53.right1,labels:["2"]}],size:{width:bounds53.width,height:bounds53.height},center:{x:bounds53.centerX,y:bounds53.centerY}},var_meter_vert_default=rotateSymbol(var_meter_horz_default),varactor_diode_default={paths:{path40:{type:"path",points:[{x:.08035965000000034,y:-.0017977999999994054},{x:-.18422364999999918,y:.13049390000000116}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.18422365000000052,y:-.13408949999999975},{x:.080359649999999,y:-.0017977999999994054}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.18422365000000052,y:.13049390000000116},{x:-.18422365000000052,y:-.1340894999999982}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.09188504999999969,y:-.1326124999999998},{x:.09294404999999917,y:.13408949999999953}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.1984993499999994,y:-.0017977999999994054},{x:-.5222461500000002,y:-.0017977999999994054}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:.5222461500000002,y:-.001712599999999842},{x:.20220525000000067,y:-.001712599999999842}],color:"primary",fill:!1},"path43-6":{type:"path",points:[{x:.18242454999999969,y:-.13264619999999994},{x:.18348354999999894,y:.1340557999999994}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.008090549999999253,y:-.2316066000000001},bottom1:{type:"text",text:"{VAL}",x:-.0031772499999995762,y:.31608400000000003}},refblocks:{left1:{x:-.5222125499999998,y:-.0026820999999992434},right1:{x:.5160816500000001,y:-.001657400000000031}},bounds:{minX:-.5222461500000002,maxX:.5222461500000002,minY:-.13408949999999975,maxY:.13408949999999953,width:1.0444923000000004,height:1,centerX:0,centerY:-11102230246251565e-32},circles:{}},{paths:paths54,texts:texts75,bounds:bounds54,refblocks:refblocks54,circles:circles46}=varactor_diode_default,varactor_diode_horz_default={primitives:[...Object.values(paths54),...Object.values(circles46),{...texts75.top1,anchor:"middle_bottom"},{...texts75.bottom1,anchor:"middle_top"}],ports:[{...refblocks54.left1,labels:["1"]},{...refblocks54.right1,labels:["2"]}],size:{width:bounds54.width,height:bounds54.height},center:{x:bounds54.centerX,y:bounds54.centerY}},rotated12=rotateSymbol(varactor_diode_horz_default),ref34=rotated12.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val29=rotated12.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref34.anchor="middle_left",val29.anchor="middle_right";var varactor_diode_vert_default=rotated12,varistor_default={paths:{path5:{type:"path",points:[{x:-.5245830500000004,y:.00034089999999764586},{x:-.25999975000000086,y:.00034089999999764586}],color:"primary",fill:!1},path6:{type:"path",points:[{x:.2691672500000002,y:.00034089999999764586},{x:.5337505499999997,y:.00034089999999764586}],color:"primary",fill:!1},path7:{type:"path",points:[{x:.2691672500000002,y:.23846589999999956},{x:-.25999974999999953,y:-.2377841000000025}],color:"primary",fill:!1},path8:{type:"path",points:[{x:.37500025000000026,y:.23846589999999956},{x:.2691672500000002,y:.23846589999999956}],color:"primary",fill:!1},path9:{type:"path",points:[{x:.004585150000000482,y:-.13195090000000143},{x:.26916815000000094,y:-.13195090000000143},{x:.26916815000000094,y:.1326324999999997},{x:-.2599988499999988,y:.1326324999999997},{x:-.2599988499999988,y:-.13195090000000143},{x:.004585150000001814,y:-.13195090000000143}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.05849044999999986,y:-.24666550000000065},bottom1:{type:"text",text:"{VAL}",x:.008507150000000685,y:.25666549999999866}},refblocks:{left1:{x:-.5392315500000002,y:.0020305999999994384},right1:{x:.5392315500000002,y:-.00033980000000077837}},bounds:{minX:-.5673899910000002,maxX:.5673899910000002,minY:-.3466655000000006,maxY:.25666549999999866,width:1.1347799820000004,height:.2533309999999993,centerX:0,centerY:-.045000000000000984},circles:{}},{paths:paths55,texts:texts76,bounds:bounds55,refblocks:refblocks55}=varistor_default,varistor_horz_default={primitives:[...Object.values(paths55),{...texts76.top1,anchor:"middle_left"},{...texts76.bottom1,anchor:"middle_right"}],ports:[{...refblocks55.left1,labels:["1","-"]},{...refblocks55.right1,labels:["2","+"]}],size:{width:bounds55.width,height:bounds55.height},center:{x:bounds55.centerX,y:bounds55.centerY}},varistor_vert_default=rotateSymbol(varistor_horz_default),varmeter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.36197569999999946},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.43234960000000044},left1:{type:"text",text:"Var",x:0,y:-.025}},refblocks:{left1:{x:-.5446330999999993,y:.000852800000000542},right1:{x:.5381638000000004,y:-.00014359999999924433}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:0,maxY:0,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.007128299999999532,radius:.28854213,color:"primary",fill:!1}}},{paths:paths56,texts:texts77,bounds:bounds56,refblocks:refblocks56,circles:circles47}=varmeter_default,varmeter_horz_default={primitives:[...Object.values(paths56),...Object.values(circles47),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"},{...texts77.left1,anchor:"center",fontSize:.2}],ports:[{...refblocks56.left1,labels:["1"]},{...refblocks56.right1,labels:["2"]}],size:{width:bounds56.width,height:bounds56.height},center:{x:bounds56.centerX,y:bounds56.centerY}},{5:letter6,...rest6}=varmeter_horz_default.primitives;function isPrimitive6(lV){return typeof lV=="object"}var rotatedSymbol29=rotateSymbol({...varmeter_horz_default,primitives:Object.values(rest6).filter(isPrimitive6)}),varmeter_vert_default={...rotatedSymbol29,primitives:[...rotatedSymbol29.primitives,letter6]},volt_meter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:.002520349999999949},{x:-.3042887999999997,y:.002520349999999949}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:.09442299999999992,y:-.0957435499999999},{x:-.004364400000000712,y:.0957435499999999},{x:-.1110211000000012,y:-.0957435499999999}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:.002520349999999949},{x:.5307178000000001,y:.002520349999999949}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.3594553499999995},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.4348699500000004}},refblocks:{left1:{x:-.5446330999999993,y:.003373150000000491},right1:{x:.5381638000000004,y:.0023767500000007047}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:-.0957435499999999,maxY:.0957435499999999,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.004607949999999583,radius:.28854213,color:"primary",fill:!1}}},{paths:paths57,texts:texts78,bounds:bounds57,circles:circles48,refblocks:refblocks57}=volt_meter_default,volt_meter_horz_default={primitives:[...Object.values(paths57),...Object.values(circles48),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"}],ports:[{...refblocks57.left1,labels:["1"]},{...refblocks57.right1,labels:["2"]}],size:{width:bounds57.width,height:bounds57.height},center:{x:bounds57.centerX,y:bounds57.centerY}},volt_meter_vert_default=rotateSymbol(volt_meter_horz_default),watt_hour_meter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.36197569999999946},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.43234960000000044},left1:{type:"text",text:"Wh",x:0,y:-.025}},refblocks:{left1:{x:-.5446330999999993,y:.000852800000000542},right1:{x:.5381638000000004,y:-.00014359999999924433}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:0,maxY:0,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.007128299999999532,radius:.28854213,color:"primary",fill:!1}}},{paths:paths58,texts:texts79,bounds:bounds58,refblocks:refblocks58,circles:circles49}=watt_hour_meter_default,watt_hour_meter_horz_default={primitives:[...Object.values(paths58),...Object.values(circles49),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"},{...texts79.left1,anchor:"center",fontSize:.2}],ports:[{...refblocks58.left1,labels:["1"]},{...refblocks58.right1,labels:["2"]}],size:{width:bounds58.width,height:bounds58.height},center:{x:bounds58.centerX,y:bounds58.centerY}},{5:letter7,...rest7}=watt_hour_meter_horz_default.primitives;function isPrimitive7(lV){return typeof lV=="object"}var rotatedSymbol30=rotateSymbol({...watt_hour_meter_horz_default,primitives:Object.values(rest7).filter(isPrimitive7)}),watt_hour_meter_vert_default={...rotatedSymbol30,primitives:[...rotatedSymbol30.primitives,letter7]},wattmeter_default={paths:{path11:{type:"path",points:[{x:-.5307178,y:0},{x:-.3042887999999997,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:.2899773000000003,y:0},{x:.5307178000000001,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.17652089999999898,y:-.36197569999999946},bottom1:{type:"text",text:"{VAL}",x:-.009849199999999891,y:.43234960000000044},left1:{type:"text",text:"W",x:0,y:-.025}},refblocks:{left1:{x:-.5446330999999993,y:.000852800000000542},right1:{x:.5381638000000004,y:-.00014359999999924433}},bounds:{minX:-.5307178,maxX:.5307178000000001,minY:0,maxY:0,width:1.0614356000000003,height:1,centerX:5551115123125783e-32,centerY:0},circles:{path1:{type:"circle",x:-.006997299999999651,y:-.007128299999999532,radius:.28854213,color:"primary",fill:!1}}},{paths:paths59,texts:texts80,bounds:bounds59,refblocks:refblocks59,circles:circles50}=wattmeter_default,wattmeter_horz_default={primitives:[...Object.values(paths59),...Object.values(circles50),{type:"text",text:"{REF}",x:0,y:-.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:.35,anchor:"middle_top"},{...texts80.left1,anchor:"center",fontSize:.3}],ports:[{...refblocks59.left1,labels:["1"]},{...refblocks59.right1,labels:["2"]}],size:{width:bounds59.width,height:bounds59.height},center:{x:bounds59.centerX,y:bounds59.centerY}},{5:letter8,...rest8}=wattmeter_horz_default.primitives;function isPrimitive8(lV){return typeof lV=="object"}var rotatedSymbol31=rotateSymbol({...wattmeter_horz_default,primitives:Object.values(rest8).filter(isPrimitive8)}),wattmeter_vert_default={...rotatedSymbol31,primitives:[...rotatedSymbol31.primitives,letter8]},zener_diode_default={paths:{path40:{type:"path",points:[{x:.1413337499999996,y:.00024145000000008743},{x:-.12324954999999993,y:.13253315000000043}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-.12324954999999993,y:-.13205025000000026},{x:.1413337499999996,y:.00024145000000008743}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-.12324954999999993,y:.1325331499999991},{x:-.12324954999999993,y:-.13205025000000026}],color:"primary",fill:!1},path43:{type:"path",points:[{x:.1413337499999996,y:-.13205025000000026},{x:.1413337499999996,y:.1325331499999991}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-.12545425,y:.00024145000000008743},{x:-.52012455,y:.00024145000000008743}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:.5201245499999998,y:.00032664999999965083},{x:.14641644999999937,y:.00032664999999965083}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:.1401360499999995,y:-.13253315000000043},{x:.07403164999999912,y:-.13204314999999966}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-.0082802500000001,y:-.22956755000000006},bottom1:{type:"text",text:"{VAL}",x:-.0033669500000002017,y:.31812304999999985}},refblocks:{left1:{x:-.5224022500000005,y:-.0006429500000009192},right1:{x:.5158919499999994,y:.00038165000000001115}},bounds:{minX:-.52012455,maxX:.5201245499999998,minY:-.13253315000000043,maxY:.13253315000000043,width:1.0402490999999998,height:1,centerX:-11102230246251565e-32,centerY:0},circles:{}},{paths:paths60,texts:texts81,bounds:bounds60,refblocks:refblocks60,circles:circles51}=zener_diode_default,zener_diode_horz_default={primitives:[...Object.values(paths60),...Object.values(circles51),{...texts81.top1,anchor:"middle_bottom"},{...texts81.bottom1,anchor:"middle_top"}],ports:[{...refblocks60.left1,labels:["1"]},{...refblocks60.right1,labels:["2"]}],size:{width:bounds60.width,height:bounds60.height},center:{x:bounds60.centerX,y:bounds60.centerY}},rotated13=rotateSymbol(zener_diode_horz_default),ref35=rotated13.primitives.find(lV=>lV.type==="text"&&lV.text==="{REF}"),val30=rotated13.primitives.find(lV=>lV.type==="text"&&lV.text==="{VAL}");ref35.anchor="middle_left",val30.anchor="middle_right";var zener_diode_vert_default=rotated13,symbols_index_default={ac_voltmeter_horz:ac_voltmeter_horz_default,ac_voltmeter_vert:ac_voltmeter_vert_default,avalanche_diode_horz:avalanche_diode_horz_default,avalanche_diode_vert:avalanche_diode_vert_default,battery_horz:battery_horz_default,battery_vert:battery_vert_default,boxresistor_horz:boxresistor_horz_default,boxresistor_vert:boxresistor_vert_default,capacitor_down:capacitor_down_default,capacitor_horz:capacitor_horz_default,capacitor_left:capacitor_left_default,capacitor_right:capacitor_right_default,capacitor_up:capacitor_up_default,capacitor_vert:capacitor_vert_default,constant_current_diode_horz:constant_current_diode_horz_default,constant_current_diode_vert:constant_current_diode_vert_default,crystal_horz:crystal_horz_default,crystal_vert:crystal_vert_default,darlington_pair_transistor_horz:darlington_pair_transistor_horz_default,darlington_pair_transistor_vert:darlington_pair_transistor_vert_default,dc_ammeter_horz:dc_ammeter_horz_default,dc_ammeter_vert:dc_ammeter_vert_default,dc_voltmeter_horz:dc_voltmeter_horz_default,dc_voltmeter_vert:dc_voltmeter_vert_default,diac_horz:diac_horz_default,diac_vert:diac_vert_default,diode_down:diode_down_default,diode_left:diode_left_default,diode_right:diode_right_default,diode_up:diode_up_default,dpst_switch_horz:dpst_switch_horz_default,dpst_switch_vert:dpst_switch_vert_default,filled_diode_horz:filled_diode_horz_default,filled_diode_vert:filled_diode_vert_default,frequency_meter_horz:frequency_meter_horz_default,frequency_meter_vert:frequency_meter_vert_default,fuse_horz:fuse_horz_default,fuse_vert:fuse_vert_default,ground_horz:ground_horz_default,ground_vert:ground_vert_default,gunn_diode_horz:gunn_diode_horz_default,gunn_diode_vert:gunn_diode_vert_default,igbt_transistor_horz:igbt_transistor_horz_default,igbt_transistor_vert:igbt_transistor_vert_default,illuminated_push_button_normally_open_horz:illuminated_push_button_normally_open_horz_default,illuminated_push_button_normally_open_vert:illuminated_push_button_normally_open_vert_default,inductor_horz:inductor_horz_default,inductor_vert:inductor_vert_default,laser_diode_horz:laser_diode_horz_default,laser_diode_vert:laser_diode_vert_default,led_down:led_down_default,led_left:led_left_default,led_right:led_right_default,led_up:led_up_default,light_dependent_resistor_horz:light_dependent_resistor_horz_default,light_dependent_resistor_vert:light_dependent_resistor_vert_default,mosfet_depletion_normally_on_horz:mosfet_depletion_normally_on_horz_default,mosfet_depletion_normally_on_vert:mosfet_depletion_normally_on_vert_default,mushroom_head_normally_open_momentary_horz:mushroom_head_normally_open_momentary_horz_default,mushroom_head_normally_open_momentary_vert:mushroom_head_normally_open_momentary_vert_default,n_channel_d_mosfet_transistor_horz:n_channel_d_mosfet_transistor_horz_default,n_channel_d_mosfet_transistor_vert:n_channel_d_mosfet_transistor_vert_default,n_channel_e_mosfet_transistor_horz:n_channel_e_mosfet_transistor_horz_default,n_channel_e_mosfet_transistor_vert:n_channel_e_mosfet_transistor_vert_default,njfet_transistor_horz:njfet_transistor_horz_default,njfet_transistor_vert:njfet_transistor_vert_default,npn_bipolar_transistor_horz:npn_bipolar_transistor_horz_default,npn_bipolar_transistor_vert:npn_bipolar_transistor_vert_default,p_channel_d_mosfet_transistor_horz:p_channel_d_mosfet_transistor_horz_default,p_channel_d_mosfet_transistor_vert:p_channel_d_mosfet_transistor_vert_default,p_channel_e_mosfet_transistor_horz:p_channel_e_mosfet_transistor_horz_default,p_channel_e_mosfet_transistor_vert:p_channel_e_mosfet_transistor_vert_default,photodiode_horz:photodiode_horz_default,photodiode_vert:photodiode_vert_default,pjfet_transistor_horz:pjfet_transistor_horz_default,pjfet_transistor_vert:pjfet_transistor_vert_default,pnp_bipolar_transistor_horz:pnp_bipolar_transistor_horz_default,pnp_bipolar_transistor_vert:pnp_bipolar_transistor_vert_default,potentiometer_horz:potentiometer_horz_default,potentiometer_vert:potentiometer_vert_default,potentiometer2_horz:potentiometer2_horz_default,potentiometer2_vert:potentiometer2_vert_default,power_factor_meter_horz:power_factor_meter_horz_default,power_factor_meter_vert:power_factor_meter_vert_default,push_button_normally_closed_momentary_horz:push_button_normally_closed_momentary_horz_default,push_button_normally_closed_momentary_vert:push_button_normally_closed_momentary_vert_default,push_button_normally_open_momentary_horz:push_button_normally_open_momentary_horz_default,push_button_normally_open_momentary_vert:push_button_normally_open_momentary_vert_default,rectifier_diode_horz:rectifier_diode_horz_default,rectifier_diode_vert:rectifier_diode_vert_default,resonator_horz:resonator_horz_default,resonator_vert:resonator_vert_default,schottky_diode_horz:schottky_diode_horz_default,schottky_diode_vert:schottky_diode_vert_default,silicon_controlled_rectifier_horz:silicon_controlled_rectifier_horz_default,silicon_controlled_rectifier_vert:silicon_controlled_rectifier_vert_default,SPDT_switch_horz:SPDT_switch_horz_default,SPDT_switch_vert:SPDT_switch_vert_default,SPST_switch_horz:SPST_switch_horz_default,SPST_switch_vert:SPST_switch_vert_default,step_recovery_diode_horz:step_recovery_diode_horz_default,step_recovery_diode_vert:step_recovery_diode_vert_default,tachometer_horz:tachometer_horz_default,tachometer_vert:tachometer_vert_default,triac_horz:triac_horz_default,triac_vert:triac_vert_default,tunnel_diode_horz:tunnel_diode_horz_default,tunnel_diode_vert:tunnel_diode_vert_default,unijunction_transistor_horz:unijunction_transistor_horz_default,unijunction_transistor_vert:unijunction_transistor_vert_default,var_meter_horz:var_meter_horz_default,var_meter_vert:var_meter_vert_default,varactor_diode_horz:varactor_diode_horz_default,varactor_diode_vert:varactor_diode_vert_default,varistor_horz:varistor_horz_default,varistor_vert:varistor_vert_default,varmeter_horz:varmeter_horz_default,varmeter_vert:varmeter_vert_default,volt_meter_horz:volt_meter_horz_default,volt_meter_vert:volt_meter_vert_default,watt_hour_meter_horz:watt_hour_meter_horz_default,watt_hour_meter_vert:watt_hour_meter_vert_default,wattmeter_horz:wattmeter_horz_default,wattmeter_vert:wattmeter_vert_default,zener_diode_horz:zener_diode_horz_default,zener_diode_vert:zener_diode_vert_default};Object.fromEntries(Object.keys(symbols_index_default).map(lV=>[lV,lV]));var lodash__objecttypes,hasRequiredLodash__objecttypes;function requireLodash__objecttypes(){if(hasRequiredLodash__objecttypes)return lodash__objecttypes;hasRequiredLodash__objecttypes=1;var lV={boolean:!1,function:!0,object:!0,number:!1,string:!1,undefined:!1};return lodash__objecttypes=lV,lodash__objecttypes}var lodash_isobject,hasRequiredLodash_isobject;function requireLodash_isobject(){if(hasRequiredLodash_isobject)return lodash_isobject;hasRequiredLodash_isobject=1;var lV=requireLodash__objecttypes();function J(VV){return!!(VV&&lV[typeof VV])}return lodash_isobject=J,lodash_isobject}var lodash__renative,hasRequiredLodash__renative;function requireLodash__renative(){if(hasRequiredLodash__renative)return lodash__renative;hasRequiredLodash__renative=1;var lV=Object.prototype,J=lV.toString,VV=RegExp("^"+String(J).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$");return lodash__renative=VV,lodash__renative}var lodash__shimkeys,hasRequiredLodash__shimkeys;function requireLodash__shimkeys(){if(hasRequiredLodash__shimkeys)return lodash__shimkeys;hasRequiredLodash__shimkeys=1;var lV=requireLodash__objecttypes(),J=Object.prototype,VV=J.hasOwnProperty,RV=function(UV){var ZV,WV=UV,IV=[];if(!WV||!lV[typeof UV])return IV;for(ZV in WV)VV.call(WV,ZV)&&IV.push(ZV);return IV};return lodash__shimkeys=RV,lodash__shimkeys}var lodash_keys,hasRequiredLodash_keys;function requireLodash_keys(){if(hasRequiredLodash_keys)return lodash_keys;hasRequiredLodash_keys=1;var lV=requireLodash_isobject(),J=requireLodash__renative(),VV=requireLodash__shimkeys(),RV=J.test(RV=Object.keys)&&RV,UV=RV?function(ZV){return lV(ZV)?RV(ZV):[]}:VV;return lodash_keys=UV,lodash_keys}var lodash_noop,hasRequiredLodash_noop;function requireLodash_noop(){if(hasRequiredLodash_noop)return lodash_noop;hasRequiredLodash_noop=1;function lV(){}return lodash_noop=lV,lodash_noop}var lodash__basecreate,hasRequiredLodash__basecreate;function requireLodash__basecreate(){if(hasRequiredLodash__basecreate)return lodash__basecreate;hasRequiredLodash__basecreate=1;var lV={process:{env:{}}},J=requireLodash_isobject();requireLodash_noop();var VV=requireLodash__renative(),RV=VV.test(RV=Object.create)&&RV;function UV(ZV,WV){return J(ZV)?RV(ZV):{}}return RV||(UV=function(){function ZV(){}return function(WV){if(J(WV)){ZV.prototype=WV;var IV=new ZV;ZV.prototype=null}return IV||lV.Object()}}()),lodash__basecreate=UV,lodash__basecreate}var lodash__setbinddata,hasRequiredLodash__setbinddata;function requireLodash__setbinddata(){if(hasRequiredLodash__setbinddata)return lodash__setbinddata;hasRequiredLodash__setbinddata=1;var lV=requireLodash_noop(),J=requireLodash__renative(),VV={configurable:!1,enumerable:!1,value:null,writable:!1},RV=function(){try{var ZV={},WV=J.test(WV=Object.defineProperty)&&WV,IV=WV(ZV,ZV,ZV)&&WV}catch{}return IV}(),UV=RV?function(ZV,WV){VV.value=WV,RV(ZV,"__bindData__",VV)}:lV;return lodash__setbinddata=UV,lodash__setbinddata}var lodash__basebind,hasRequiredLodash__basebind;function requireLodash__basebind(){if(hasRequiredLodash__basebind)return lodash__basebind;hasRequiredLodash__basebind=1;var lV=requireLodash__basecreate(),J=requireLodash_isobject(),VV=requireLodash__setbinddata(),RV=[],UV=RV.push;function ZV(WV){var IV=WV[0],dV=WV[2],CV=WV[4];function FV(){if(dV){var NV=dV.slice();UV.apply(NV,arguments)}if(this instanceof FV){var eV=lV(IV.prototype),gV=IV.apply(eV,NV||arguments);return J(gV)?gV:eV}return IV.apply(CV,NV||arguments)}return VV(FV,WV),FV}return lodash__basebind=ZV,lodash__basebind}var lodash__slice,hasRequiredLodash__slice;function requireLodash__slice(){if(hasRequiredLodash__slice)return lodash__slice;hasRequiredLodash__slice=1;function lV(J,VV,RV){VV||(VV=0),typeof RV>"u"&&(RV=J?J.length:0);for(var UV=-1,ZV=RV-VV||0,WV=Array(ZV<0?0:ZV);++UV<ZV;)WV[UV]=J[VV+UV];return WV}return lodash__slice=lV,lodash__slice}var lodash__basecreatewrapper,hasRequiredLodash__basecreatewrapper;function requireLodash__basecreatewrapper(){if(hasRequiredLodash__basecreatewrapper)return lodash__basecreatewrapper;hasRequiredLodash__basecreatewrapper=1;var lV=requireLodash__basecreate(),J=requireLodash_isobject(),VV=requireLodash__setbinddata(),RV=requireLodash__slice(),UV=[],ZV=UV.push;function WV(IV){var dV=IV[0],CV=IV[1],FV=IV[2],NV=IV[3],eV=IV[4],gV=IV[5],nV=CV&1,JV=CV&2,aV=CV&4,GV=CV&8,YV=dV;function tV(){var kV=nV?eV:this;if(FV){var AV=FV.slice();ZV.apply(AV,arguments)}if((NV||aV)&&(AV||(AV=RV(arguments)),NV&&ZV.apply(AV,NV),aV&&AV.length<gV))return CV|=16,WV([dV,GV?CV:CV&-4,AV,null,eV,gV]);if(AV||(AV=arguments),JV&&(dV=kV[YV]),this instanceof tV){kV=lV(dV.prototype);var XV=dV.apply(kV,AV);return J(XV)?XV:kV}return dV.apply(kV,AV)}return VV(tV,IV),tV}return lodash__basecreatewrapper=WV,lodash__basecreatewrapper}var lodash_isfunction,hasRequiredLodash_isfunction;function requireLodash_isfunction(){if(hasRequiredLodash_isfunction)return lodash_isfunction;hasRequiredLodash_isfunction=1;function lV(J){return typeof J=="function"}return lodash_isfunction=lV,lodash_isfunction}var lodash__createwrapper,hasRequiredLodash__createwrapper;function requireLodash__createwrapper(){if(hasRequiredLodash__createwrapper)return lodash__createwrapper;hasRequiredLodash__createwrapper=1;var lV=requireLodash__basebind(),J=requireLodash__basecreatewrapper(),VV=requireLodash_isfunction(),RV=[],UV=RV.push;function ZV(WV,IV,dV,CV,FV,NV){var eV=IV&1,gV=IV&2,nV=IV&4,JV=IV&16,aV=IV&32;if(!gV&&!VV(WV))throw new TypeError;JV&&!dV.length&&(IV&=-17,JV=dV=!1),aV&&!CV.length&&(IV&=-33,aV=CV=!1);var GV=WV&&WV.__bindData__;if(GV&&GV!==!0)return GV=GV.slice(),eV&&!(GV[1]&1)&&(GV[4]=FV),!eV&&GV[1]&1&&(IV|=8),nV&&!(GV[1]&4)&&(GV[5]=NV),JV&&UV.apply(GV[2]||(GV[2]=[]),dV),aV&&UV.apply(GV[3]||(GV[3]=[]),CV),GV[1]|=IV,ZV.apply(null,GV);var YV=IV==1||IV===17?lV:J;return YV([WV,IV,dV,CV,FV,NV])}return lodash__createwrapper=ZV,lodash__createwrapper}var lodash_bind,hasRequiredLodash_bind;function requireLodash_bind(){if(hasRequiredLodash_bind)return lodash_bind;hasRequiredLodash_bind=1;var lV=requireLodash__createwrapper();requireLodash__renative();var J=requireLodash__slice();function VV(RV,UV){return arguments.length>2?lV(RV,17,J(arguments,2),null,UV):lV(RV,1,null,null,UV)}return lodash_bind=VV,lodash_bind}var lodash_identity,hasRequiredLodash_identity;function requireLodash_identity(){if(hasRequiredLodash_identity)return lodash_identity;hasRequiredLodash_identity=1;function lV(J){return J}return lodash_identity=lV,lodash_identity}var lodash_support,hasRequiredLodash_support;function requireLodash_support(){if(hasRequiredLodash_support)return lodash_support;hasRequiredLodash_support=1;var lV={process:{env:{}}},J=requireLodash__renative(),VV=/\bthis\b/,RV={};return RV.funcDecomp=!J.test(lV.WinRTError)&&VV.test(function(){return this}),RV.funcNames=typeof Function.name=="string",lodash_support=RV,lodash_support}var lodash__basecreatecallback,hasRequiredLodash__basecreatecallback;function requireLodash__basecreatecallback(){if(hasRequiredLodash__basecreatecallback)return lodash__basecreatecallback;hasRequiredLodash__basecreatecallback=1;var lV=requireLodash_bind(),J=requireLodash_identity(),VV=requireLodash__setbinddata(),RV=requireLodash_support(),UV=/^\s*function[ \n\r\t]+\w/,ZV=/\bthis\b/,WV=Function.prototype.toString;function IV(dV,CV,FV){if(typeof dV!="function")return J;if(typeof CV>"u"||!("prototype"in dV))return dV;var NV=dV.__bindData__;if(typeof NV>"u"&&(RV.funcNames&&(NV=!dV.name),NV=NV||!RV.funcDecomp,!NV)){var eV=WV.call(dV);RV.funcNames||(NV=!UV.test(eV)),NV||(NV=ZV.test(eV),VV(dV,NV))}if(NV===!1||NV!==!0&&NV[1]&1)return dV;switch(FV){case 1:return function(gV){return dV.call(CV,gV)};case 2:return function(gV,nV){return dV.call(CV,gV,nV)};case 3:return function(gV,nV,JV){return dV.call(CV,gV,nV,JV)};case 4:return function(gV,nV,JV,aV){return dV.call(CV,gV,nV,JV,aV)}}return lV(dV,CV)}return lodash__basecreatecallback=IV,lodash__basecreatecallback}var lodash_forown,hasRequiredLodash_forown;function requireLodash_forown(){if(hasRequiredLodash_forown)return lodash_forown;hasRequiredLodash_forown=1;var lV=requireLodash__basecreatecallback(),J=requireLodash_keys(),VV=requireLodash__objecttypes(),RV=function(UV,ZV,WV){var IV,dV=UV,CV=dV;if(!dV||!VV[typeof dV])return CV;ZV=ZV&&typeof WV>"u"?ZV:lV(ZV,WV,3);for(var FV=-1,NV=VV[typeof dV]&&J(dV),eV=NV?NV.length:0;++FV<eV;)if(IV=NV[FV],ZV(dV[IV],IV,UV)===!1)return CV;return CV};return lodash_forown=RV,lodash_forown}var lodash_foreach,hasRequiredLodash_foreach;function requireLodash_foreach(){if(hasRequiredLodash_foreach)return lodash_foreach;hasRequiredLodash_foreach=1;var lV=requireLodash__basecreatecallback(),J=requireLodash_forown();function VV(RV,UV,ZV){var WV=-1,IV=RV?RV.length:0;if(UV=UV&&typeof ZV>"u"?UV:lV(UV,ZV,3),typeof IV=="number")for(;++WV<IV&&UV(RV[WV],WV,RV)!==!1;);else J(RV,UV);return RV}return lodash_foreach=VV,lodash_foreach}var length$2,hasRequiredLength$3;function requireLength$3(){if(hasRequiredLength$3)return length$2;hasRequiredLength$3=1;var lV,J;return lV={mm:{name:{singular:"Millimeter",plural:"Millimeters"},to_anchor:1/1e3},cm:{name:{singular:"Centimeter",plural:"Centimeters"},to_anchor:1/100},m:{name:{singular:"Meter",plural:"Meters"},to_anchor:1},km:{name:{singular:"Kilometer",plural:"Kilometers"},to_anchor:1e3}},J={in:{name:{singular:"Inch",plural:"Inches"},to_anchor:1/12},yd:{name:{singular:"Yard",plural:"Yards"},to_anchor:3},"ft-us":{name:{singular:"US Survey Foot",plural:"US Survey Feet"},to_anchor:1.000002},ft:{name:{singular:"Foot",plural:"Feet"},to_anchor:1},mi:{name:{singular:"Mile",plural:"Miles"},to_anchor:5280}},length$2={metric:lV,imperial:J,_anchors:{metric:{unit:"m",ratio:3.28084},imperial:{unit:"ft",ratio:1/3.28084}}},length$2}var area$1,hasRequiredArea$1;function requireArea$1(){if(hasRequiredArea$1)return area$1;hasRequiredArea$1=1;var lV,J;return lV={mm2:{name:{singular:"Square Millimeter",plural:"Square Millimeters"},to_anchor:1/1e6},cm2:{name:{singular:"Centimeter",plural:"Centimeters"},to_anchor:1/1e4},m2:{name:{singular:"Square Meter",plural:"Square Meters"},to_anchor:1},ha:{name:{singular:"Hectare",plural:"Hectares"},to_anchor:1e4},km2:{name:{singular:"Square Kilometer",plural:"Square Kilometers"},to_anchor:1e6}},J={in2:{name:{singular:"Square Inch",plural:"Square Inches"},to_anchor:1/144},yd2:{name:{singular:"Square Yard",plural:"Square Yards"},to_anchor:9},ft2:{name:{singular:"Square Foot",plural:"Square Feet"},to_anchor:1},ac:{name:{singular:"Acre",plural:"Acres"},to_anchor:43560},mi2:{name:{singular:"Square Mile",plural:"Square Miles"},to_anchor:27878400}},area$1={metric:lV,imperial:J,_anchors:{metric:{unit:"m2",ratio:10.7639},imperial:{unit:"ft2",ratio:1/10.7639}}},area$1}var mass,hasRequiredMass;function requireMass(){if(hasRequiredMass)return mass;hasRequiredMass=1;var lV,J;return lV={mcg:{name:{singular:"Microgram",plural:"Micrograms"},to_anchor:1/1e6},mg:{name:{singular:"Milligram",plural:"Milligrams"},to_anchor:1/1e3},g:{name:{singular:"Gram",plural:"Grams"},to_anchor:1},kg:{name:{singular:"Kilogram",plural:"Kilograms"},to_anchor:1e3},mt:{name:{singular:"Metric Tonne",plural:"Metric Tonnes"},to_anchor:1e6}},J={oz:{name:{singular:"Ounce",plural:"Ounces"},to_anchor:1/16},lb:{name:{singular:"Pound",plural:"Pounds"},to_anchor:1},t:{name:{singular:"Ton",plural:"Tons"},to_anchor:2e3}},mass={metric:lV,imperial:J,_anchors:{metric:{unit:"g",ratio:1/453.592},imperial:{unit:"lb",ratio:453.592}}},mass}var volume,hasRequiredVolume$1;function requireVolume$1(){if(hasRequiredVolume$1)return volume;hasRequiredVolume$1=1;var lV,J;return lV={mm3:{name:{singular:"Cubic Millimeter",plural:"Cubic Millimeters"},to_anchor:1/1e6},cm3:{name:{singular:"Cubic Centimeter",plural:"Cubic Centimeters"},to_anchor:1/1e3},ml:{name:{singular:"Millilitre",plural:"Millilitres"},to_anchor:1/1e3},cl:{name:{singular:"Centilitre",plural:"Centilitres"},to_anchor:1/100},dl:{name:{singular:"Decilitre",plural:"Decilitres"},to_anchor:1/10},l:{name:{singular:"Litre",plural:"Litres"},to_anchor:1},kl:{name:{singular:"Kilolitre",plural:"Kilolitres"},to_anchor:1e3},m3:{name:{singular:"Cubic meter",plural:"Cubic meters"},to_anchor:1e3},km3:{name:{singular:"Cubic kilometer",plural:"Cubic kilometers"},to_anchor:1e12},krm:{name:{singular:"Matsked",plural:"Matskedar"},to_anchor:1/1e3},tsk:{name:{singular:"Tesked",plural:"Teskedar"},to_anchor:5/1e3},msk:{name:{singular:"Matsked",plural:"Matskedar"},to_anchor:15/1e3},kkp:{name:{singular:"Kaffekopp",plural:"Kaffekoppar"},to_anchor:150/1e3},glas:{name:{singular:"Glas",plural:"Glas"},to_anchor:200/1e3},kanna:{name:{singular:"Kanna",plural:"Kannor"},to_anchor:2.617}},J={tsp:{name:{singular:"Teaspoon",plural:"Teaspoons"},to_anchor:1/6},Tbs:{name:{singular:"Tablespoon",plural:"Tablespoons"},to_anchor:1/2},in3:{name:{singular:"Cubic inch",plural:"Cubic inches"},to_anchor:.55411},"fl-oz":{name:{singular:"Fluid Ounce",plural:"Fluid Ounces"},to_anchor:1},cup:{name:{singular:"Cup",plural:"Cups"},to_anchor:8},pnt:{name:{singular:"Pint",plural:"Pints"},to_anchor:16},qt:{name:{singular:"Quart",plural:"Quarts"},to_anchor:32},gal:{name:{singular:"Gallon",plural:"Gallons"},to_anchor:128},ft3:{name:{singular:"Cubic foot",plural:"Cubic feet"},to_anchor:957.506},yd3:{name:{singular:"Cubic yard",plural:"Cubic yards"},to_anchor:25852.7}},volume={metric:lV,imperial:J,_anchors:{metric:{unit:"l",ratio:33.8140226},imperial:{unit:"fl-oz",ratio:1/33.8140226}}},volume}var each$1,hasRequiredEach;function requireEach(){if(hasRequiredEach)return each$1;hasRequiredEach=1;var lV;return lV={ea:{name:{singular:"Each",plural:"Each"},to_anchor:1},dz:{name:{singular:"Dozen",plural:"Dozens"},to_anchor:12}},each$1={metric:lV,imperial:{},_anchors:{metric:{unit:"ea",ratio:1}}},each$1}var temperature,hasRequiredTemperature;function requireTemperature(){if(hasRequiredTemperature)return temperature;hasRequiredTemperature=1;var lV,J;return lV={C:{name:{singular:"degree Celsius",plural:"degrees Celsius"},to_anchor:1,anchor_shift:0},K:{name:{singular:"degree Kelvin",plural:"degrees Kelvin"},to_anchor:1,anchor_shift:273.15}},J={F:{name:{singular:"degree Fahrenheit",plural:"degrees Fahrenheit"},to_anchor:1},R:{name:{singular:"degree Rankine",plural:"degrees Rankine"},to_anchor:1,anchor_shift:459.67}},temperature={metric:lV,imperial:J,_anchors:{metric:{unit:"C",transform:function(VV){return VV/(5/9)+32}},imperial:{unit:"F",transform:function(VV){return(VV-32)*(5/9)}}}},temperature}var time_1,hasRequiredTime;function requireTime(){if(hasRequiredTime)return time_1;hasRequiredTime=1;var lV,J=365.25;return lV={ns:{name:{singular:"Nanosecond",plural:"Nanoseconds"},to_anchor:1/1e9},mu:{name:{singular:"Microsecond",plural:"Microseconds"},to_anchor:1/1e6},ms:{name:{singular:"Millisecond",plural:"Milliseconds"},to_anchor:1/1e3},s:{name:{singular:"Second",plural:"Seconds"},to_anchor:1},min:{name:{singular:"Minute",plural:"Minutes"},to_anchor:60},h:{name:{singular:"Hour",plural:"Hours"},to_anchor:60*60},d:{name:{singular:"Day",plural:"Days"},to_anchor:60*60*24},week:{name:{singular:"Week",plural:"Weeks"},to_anchor:60*60*24*7},month:{name:{singular:"Month",plural:"Months"},to_anchor:60*60*24*J/12},year:{name:{singular:"Year",plural:"Years"},to_anchor:60*60*24*J}},time_1={metric:lV,_anchors:{metric:{unit:"s",ratio:1}}},time_1}var digital,hasRequiredDigital;function requireDigital(){if(hasRequiredDigital)return digital;hasRequiredDigital=1;var lV,J;return lV={b:{name:{singular:"Bit",plural:"Bits"},to_anchor:1},Kb:{name:{singular:"Kilobit",plural:"Kilobits"},to_anchor:1024},Mb:{name:{singular:"Megabit",plural:"Megabits"},to_anchor:1048576},Gb:{name:{singular:"Gigabit",plural:"Gigabits"},to_anchor:1073741824},Tb:{name:{singular:"Terabit",plural:"Terabits"},to_anchor:1099511627776}},J={B:{name:{singular:"Byte",plural:"Bytes"},to_anchor:1},KB:{name:{singular:"Kilobyte",plural:"Kilobytes"},to_anchor:1024},MB:{name:{singular:"Megabyte",plural:"Megabytes"},to_anchor:1048576},GB:{name:{singular:"Gigabyte",plural:"Gigabytes"},to_anchor:1073741824},TB:{name:{singular:"Terabyte",plural:"Terabytes"},to_anchor:1099511627776}},digital={bits:lV,bytes:J,_anchors:{bits:{unit:"b",ratio:1/8},bytes:{unit:"B",ratio:8}}},digital}var partsPer,hasRequiredPartsPer;function requirePartsPer(){if(hasRequiredPartsPer)return partsPer;hasRequiredPartsPer=1;var lV;return lV={ppm:{name:{singular:"Part-per Million",plural:"Parts-per Million"},to_anchor:1},ppb:{name:{singular:"Part-per Billion",plural:"Parts-per Billion"},to_anchor:.001},ppt:{name:{singular:"Part-per Trillion",plural:"Parts-per Trillion"},to_anchor:1e-6},ppq:{name:{singular:"Part-per Quadrillion",plural:"Parts-per Quadrillion"},to_anchor:1e-9}},partsPer={metric:lV,imperial:{},_anchors:{metric:{unit:"ppm",ratio:1e-6}}},partsPer}var speed,hasRequiredSpeed;function requireSpeed(){if(hasRequiredSpeed)return speed;hasRequiredSpeed=1;var lV,J;return lV={"m/s":{name:{singular:"Metre per second",plural:"Metres per second"},to_anchor:3.6},"km/h":{name:{singular:"Kilometre per hour",plural:"Kilometres per hour"},to_anchor:1}},J={"m/h":{name:{singular:"Mile per hour",plural:"Miles per hour"},to_anchor:1},knot:{name:{singular:"Knot",plural:"Knots"},to_anchor:1.150779},"ft/s":{name:{singular:"Foot per second",plural:"Feet per second"},to_anchor:.681818}},speed={metric:lV,imperial:J,_anchors:{metric:{unit:"km/h",ratio:1/1.609344},imperial:{unit:"m/h",ratio:1.609344}}},speed}var pace,hasRequiredPace;function requirePace(){if(hasRequiredPace)return pace;hasRequiredPace=1;var lV,J;return lV={"min/km":{name:{singular:"Minute per kilometre",plural:"Minutes per kilometre"},to_anchor:.06},"s/m":{name:{singular:"Second per metre",plural:"Seconds per metre"},to_anchor:1}},J={"min/mi":{name:{singular:"Minute per mile",plural:"Minutes per mile"},to_anchor:.0113636},"s/ft":{name:{singular:"Second per foot",plural:"Seconds per foot"},to_anchor:1}},pace={metric:lV,imperial:J,_anchors:{metric:{unit:"s/m",ratio:.3048},imperial:{unit:"s/ft",ratio:1/.3048}}},pace}var pressure,hasRequiredPressure;function requirePressure(){if(hasRequiredPressure)return pressure;hasRequiredPressure=1;var lV,J;return lV={Pa:{name:{singular:"pascal",plural:"pascals"},to_anchor:1/1e3},kPa:{name:{singular:"kilopascal",plural:"kilopascals"},to_anchor:1},MPa:{name:{singular:"megapascal",plural:"megapascals"},to_anchor:1e3},hPa:{name:{singular:"hectopascal",plural:"hectopascals"},to_anchor:1/10},bar:{name:{singular:"bar",plural:"bar"},to_anchor:100},torr:{name:{singular:"torr",plural:"torr"},to_anchor:101325/76e4}},J={psi:{name:{singular:"pound per square inch",plural:"pounds per square inch"},to_anchor:1/1e3},ksi:{name:{singular:"kilopound per square inch",plural:"kilopound per square inch"},to_anchor:1}},pressure={metric:lV,imperial:J,_anchors:{metric:{unit:"kPa",ratio:.00014503768078},imperial:{unit:"psi",ratio:1/.00014503768078}}},pressure}var current_1,hasRequiredCurrent;function requireCurrent(){if(hasRequiredCurrent)return current_1;hasRequiredCurrent=1;var lV;return lV={A:{name:{singular:"Ampere",plural:"Amperes"},to_anchor:1},mA:{name:{singular:"Milliampere",plural:"Milliamperes"},to_anchor:.001},kA:{name:{singular:"Kiloampere",plural:"Kiloamperes"},to_anchor:1e3}},current_1={metric:lV,_anchors:{metric:{unit:"A",ratio:1}}},current_1}var voltage_1,hasRequiredVoltage;function requireVoltage(){if(hasRequiredVoltage)return voltage_1;hasRequiredVoltage=1;var lV;return lV={V:{name:{singular:"Volt",plural:"Volts"},to_anchor:1},mV:{name:{singular:"Millivolt",plural:"Millivolts"},to_anchor:.001},kV:{name:{singular:"Kilovolt",plural:"Kilovolts"},to_anchor:1e3}},voltage_1={metric:lV,_anchors:{metric:{unit:"V",ratio:1}}},voltage_1}var power_1,hasRequiredPower;function requirePower(){if(hasRequiredPower)return power_1;hasRequiredPower=1;var lV;return lV={W:{name:{singular:"Watt",plural:"Watts"},to_anchor:1},mW:{name:{singular:"Milliwatt",plural:"Milliwatts"},to_anchor:.001},kW:{name:{singular:"Kilowatt",plural:"Kilowatts"},to_anchor:1e3},MW:{name:{singular:"Megawatt",plural:"Megawatts"},to_anchor:1e6},GW:{name:{singular:"Gigawatt",plural:"Gigawatts"},to_anchor:1e9}},power_1={metric:lV,_anchors:{metric:{unit:"W",ratio:1}}},power_1}var reactivePower_1,hasRequiredReactivePower;function requireReactivePower(){if(hasRequiredReactivePower)return reactivePower_1;hasRequiredReactivePower=1;var lV;return lV={VAR:{name:{singular:"Volt-Ampere Reactive",plural:"Volt-Amperes Reactive"},to_anchor:1},mVAR:{name:{singular:"Millivolt-Ampere Reactive",plural:"Millivolt-Amperes Reactive"},to_anchor:.001},kVAR:{name:{singular:"Kilovolt-Ampere Reactive",plural:"Kilovolt-Amperes Reactive"},to_anchor:1e3},MVAR:{name:{singular:"Megavolt-Ampere Reactive",plural:"Megavolt-Amperes Reactive"},to_anchor:1e6},GVAR:{name:{singular:"Gigavolt-Ampere Reactive",plural:"Gigavolt-Amperes Reactive"},to_anchor:1e9}},reactivePower_1={metric:lV,_anchors:{metric:{unit:"VAR",ratio:1}}},reactivePower_1}var apparentPower_1,hasRequiredApparentPower;function requireApparentPower(){if(hasRequiredApparentPower)return apparentPower_1;hasRequiredApparentPower=1;var lV;return lV={VA:{name:{singular:"Volt-Ampere",plural:"Volt-Amperes"},to_anchor:1},mVA:{name:{singular:"Millivolt-Ampere",plural:"Millivolt-Amperes"},to_anchor:.001},kVA:{name:{singular:"Kilovolt-Ampere",plural:"Kilovolt-Amperes"},to_anchor:1e3},MVA:{name:{singular:"Megavolt-Ampere",plural:"Megavolt-Amperes"},to_anchor:1e6},GVA:{name:{singular:"Gigavolt-Ampere",plural:"Gigavolt-Amperes"},to_anchor:1e9}},apparentPower_1={metric:lV,_anchors:{metric:{unit:"VA",ratio:1}}},apparentPower_1}var energy_1,hasRequiredEnergy;function requireEnergy(){if(hasRequiredEnergy)return energy_1;hasRequiredEnergy=1;var lV;return lV={Wh:{name:{singular:"Watt-hour",plural:"Watt-hours"},to_anchor:3600},mWh:{name:{singular:"Milliwatt-hour",plural:"Milliwatt-hours"},to_anchor:3.6},kWh:{name:{singular:"Kilowatt-hour",plural:"Kilowatt-hours"},to_anchor:36e5},MWh:{name:{singular:"Megawatt-hour",plural:"Megawatt-hours"},to_anchor:36e8},GWh:{name:{singular:"Gigawatt-hour",plural:"Gigawatt-hours"},to_anchor:36e11},J:{name:{singular:"Joule",plural:"Joules"},to_anchor:1},kJ:{name:{singular:"Kilojoule",plural:"Kilojoules"},to_anchor:1e3}},energy_1={metric:lV,_anchors:{metric:{unit:"J",ratio:1}}},energy_1}var reactiveEnergy_1,hasRequiredReactiveEnergy;function requireReactiveEnergy(){if(hasRequiredReactiveEnergy)return reactiveEnergy_1;hasRequiredReactiveEnergy=1;var lV;return lV={VARh:{name:{singular:"Volt-Ampere Reactive Hour",plural:"Volt-Amperes Reactive Hour"},to_anchor:1},mVARh:{name:{singular:"Millivolt-Ampere Reactive Hour",plural:"Millivolt-Amperes Reactive Hour"},to_anchor:.001},kVARh:{name:{singular:"Kilovolt-Ampere Reactive Hour",plural:"Kilovolt-Amperes Reactive Hour"},to_anchor:1e3},MVARh:{name:{singular:"Megavolt-Ampere Reactive Hour",plural:"Megavolt-Amperes Reactive Hour"},to_anchor:1e6},GVARh:{name:{singular:"Gigavolt-Ampere Reactive Hour",plural:"Gigavolt-Amperes Reactive Hour"},to_anchor:1e9}},reactiveEnergy_1={metric:lV,_anchors:{metric:{unit:"VARh",ratio:1}}},reactiveEnergy_1}var volumeFlowRate,hasRequiredVolumeFlowRate;function requireVolumeFlowRate(){if(hasRequiredVolumeFlowRate)return volumeFlowRate;hasRequiredVolumeFlowRate=1;var lV,J;return lV={"mm3/s":{name:{singular:"Cubic Millimeter per second",plural:"Cubic Millimeters per second"},to_anchor:1/1e6},"cm3/s":{name:{singular:"Cubic Centimeter per second",plural:"Cubic Centimeters per second"},to_anchor:1/1e3},"ml/s":{name:{singular:"Millilitre per second",plural:"Millilitres per second"},to_anchor:1/1e3},"cl/s":{name:{singular:"Centilitre per second",plural:"Centilitres per second"},to_anchor:1/100},"dl/s":{name:{singular:"Decilitre per second",plural:"Decilitres per second"},to_anchor:1/10},"l/s":{name:{singular:"Litre per second",plural:"Litres per second"},to_anchor:1},"l/min":{name:{singular:"Litre per minute",plural:"Litres per minute"},to_anchor:1/60},"l/h":{name:{singular:"Litre per hour",plural:"Litres per hour"},to_anchor:1/3600},"kl/s":{name:{singular:"Kilolitre per second",plural:"Kilolitres per second"},to_anchor:1e3},"kl/min":{name:{singular:"Kilolitre per minute",plural:"Kilolitres per minute"},to_anchor:50/3},"kl/h":{name:{singular:"Kilolitre per hour",plural:"Kilolitres per hour"},to_anchor:5/18},"m3/s":{name:{singular:"Cubic meter per second",plural:"Cubic meters per second"},to_anchor:1e3},"m3/min":{name:{singular:"Cubic meter per minute",plural:"Cubic meters per minute"},to_anchor:50/3},"m3/h":{name:{singular:"Cubic meter per hour",plural:"Cubic meters per hour"},to_anchor:5/18},"km3/s":{name:{singular:"Cubic kilometer per second",plural:"Cubic kilometers per second"},to_anchor:1e12}},J={"tsp/s":{name:{singular:"Teaspoon per second",plural:"Teaspoons per second"},to_anchor:1/6},"Tbs/s":{name:{singular:"Tablespoon per second",plural:"Tablespoons per second"},to_anchor:1/2},"in3/s":{name:{singular:"Cubic inch per second",plural:"Cubic inches per second"},to_anchor:.55411},"in3/min":{name:{singular:"Cubic inch per minute",plural:"Cubic inches per minute"},to_anchor:.55411/60},"in3/h":{name:{singular:"Cubic inch per hour",plural:"Cubic inches per hour"},to_anchor:.55411/3600},"fl-oz/s":{name:{singular:"Fluid Ounce per second",plural:"Fluid Ounces per second"},to_anchor:1},"fl-oz/min":{name:{singular:"Fluid Ounce per minute",plural:"Fluid Ounces per minute"},to_anchor:1/60},"fl-oz/h":{name:{singular:"Fluid Ounce per hour",plural:"Fluid Ounces per hour"},to_anchor:1/3600},"cup/s":{name:{singular:"Cup per second",plural:"Cups per second"},to_anchor:8},"pnt/s":{name:{singular:"Pint per second",plural:"Pints per second"},to_anchor:16},"pnt/min":{name:{singular:"Pint per minute",plural:"Pints per minute"},to_anchor:4/15},"pnt/h":{name:{singular:"Pint per hour",plural:"Pints per hour"},to_anchor:1/225},"qt/s":{name:{singular:"Quart per second",plural:"Quarts per second"},to_anchor:32},"gal/s":{name:{singular:"Gallon per second",plural:"Gallons per second"},to_anchor:128},"gal/min":{name:{singular:"Gallon per minute",plural:"Gallons per minute"},to_anchor:32/15},"gal/h":{name:{singular:"Gallon per hour",plural:"Gallons per hour"},to_anchor:8/225},"ft3/s":{name:{singular:"Cubic foot per second",plural:"Cubic feet per second"},to_anchor:957.506},"ft3/min":{name:{singular:"Cubic foot per minute",plural:"Cubic feet per minute"},to_anchor:957.506/60},"ft3/h":{name:{singular:"Cubic foot per hour",plural:"Cubic feet per hour"},to_anchor:957.506/3600},"yd3/s":{name:{singular:"Cubic yard per second",plural:"Cubic yards per second"},to_anchor:25852.7},"yd3/min":{name:{singular:"Cubic yard per minute",plural:"Cubic yards per minute"},to_anchor:25852.7/60},"yd3/h":{name:{singular:"Cubic yard per hour",plural:"Cubic yards per hour"},to_anchor:25852.7/3600}},volumeFlowRate={metric:lV,imperial:J,_anchors:{metric:{unit:"l/s",ratio:33.8140227},imperial:{unit:"fl-oz/s",ratio:1/33.8140227}}},volumeFlowRate}var illuminance,hasRequiredIlluminance;function requireIlluminance(){if(hasRequiredIlluminance)return illuminance;hasRequiredIlluminance=1;var lV,J;return lV={lx:{name:{singular:"Lux",plural:"Lux"},to_anchor:1}},J={"ft-cd":{name:{singular:"Foot-candle",plural:"Foot-candles"},to_anchor:1}},illuminance={metric:lV,imperial:J,_anchors:{metric:{unit:"lx",ratio:1/10.76391},imperial:{unit:"ft-cd",ratio:10.76391}}},illuminance}var frequency_1,hasRequiredFrequency;function requireFrequency(){if(hasRequiredFrequency)return frequency_1;hasRequiredFrequency=1;var lV;return lV={mHz:{name:{singular:"millihertz",plural:"millihertz"},to_anchor:1/1e3},Hz:{name:{singular:"hertz",plural:"hertz"},to_anchor:1},kHz:{name:{singular:"kilohertz",plural:"kilohertz"},to_anchor:1e3},MHz:{name:{singular:"megahertz",plural:"megahertz"},to_anchor:1e3*1e3},GHz:{name:{singular:"gigahertz",plural:"gigahertz"},to_anchor:1e3*1e3*1e3},THz:{name:{singular:"terahertz",plural:"terahertz"},to_anchor:1e3*1e3*1e3*1e3},rpm:{name:{singular:"rotation per minute",plural:"rotations per minute"},to_anchor:1/60},"deg/s":{name:{singular:"degree per second",plural:"degrees per second"},to_anchor:1/360},"rad/s":{name:{singular:"radian per second",plural:"radians per second"},to_anchor:1/(Math.PI*2)}},frequency_1={metric:lV,_anchors:{frequency:{unit:"hz",ratio:1}}},frequency_1}var angle_1$1,hasRequiredAngle$2;function requireAngle$2(){if(hasRequiredAngle$2)return angle_1$1;hasRequiredAngle$2=1;var lV;return lV={rad:{name:{singular:"radian",plural:"radians"},to_anchor:180/Math.PI},deg:{name:{singular:"degree",plural:"degrees"},to_anchor:1},grad:{name:{singular:"gradian",plural:"gradians"},to_anchor:9/10},arcmin:{name:{singular:"arcminute",plural:"arcminutes"},to_anchor:1/60},arcsec:{name:{singular:"arcsecond",plural:"arcseconds"},to_anchor:1/3600}},angle_1$1={metric:lV,_anchors:{metric:{unit:"deg",ratio:1}}},angle_1$1}var lib$1,hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var lV,J=requireLodash_keys(),VV=requireLodash_foreach(),RV={length:requireLength$3(),area:requireArea$1(),mass:requireMass(),volume:requireVolume$1(),each:requireEach(),temperature:requireTemperature(),time:requireTime(),digital:requireDigital(),partsPer:requirePartsPer(),speed:requireSpeed(),pace:requirePace(),pressure:requirePressure(),current:requireCurrent(),voltage:requireVoltage(),power:requirePower(),reactivePower:requireReactivePower(),apparentPower:requireApparentPower(),energy:requireEnergy(),reactiveEnergy:requireReactiveEnergy(),volumeFlowRate:requireVolumeFlowRate(),illuminance:requireIlluminance(),frequency:requireFrequency(),angle:requireAngle$2()},UV;UV=function(WV,IV){IV?this.val=WV/IV:this.val=WV},UV.prototype.from=function(WV){if(this.destination)throw new Error(".from must be called before .to");return this.origin=this.getUnit(WV),this.origin||this.throwUnsupportedUnitError(WV),this},UV.prototype.to=function(WV){if(!this.origin)throw new Error(".to must be called after .from");this.destination=this.getUnit(WV);var IV,dV;if(this.destination||this.throwUnsupportedUnitError(WV),this.origin.abbr===this.destination.abbr)return this.val;if(this.destination.measure!=this.origin.measure)throw new Error("Cannot convert incompatible measures of "+this.destination.measure+" and "+this.origin.measure);return IV=this.val*this.origin.unit.to_anchor,this.origin.unit.anchor_shift&&(IV-=this.origin.unit.anchor_shift),this.origin.system!=this.destination.system&&(dV=RV[this.origin.measure]._anchors[this.origin.system].transform,typeof dV=="function"?IV=dV(IV):IV*=RV[this.origin.measure]._anchors[this.origin.system].ratio),this.destination.unit.anchor_shift&&(IV+=this.destination.unit.anchor_shift),IV/this.destination.unit.to_anchor},UV.prototype.toBest=function(IV){if(!this.origin)throw new Error(".toBest must be called after .from");var IV=Object.assign({exclude:[],cutOffNumber:1},IV),dV;return VV(this.possibilities(),(function(CV){var FV=this.describe(CV),NV=IV.exclude.indexOf(CV)===-1;if(NV&&FV.system===this.origin.system){var eV=this.to(CV);(!dV||eV>=IV.cutOffNumber&&eV<dV.val)&&(dV={val:eV,unit:CV,singular:FV.singular,plural:FV.plural})}}).bind(this)),dV},UV.prototype.getUnit=function(WV){var IV;return VV(RV,function(dV,CV){if(VV(dV,function(FV,NV){if(NV=="_anchors"||(VV(FV,function(eV,gV){if(gV==WV)return IV={abbr:WV,measure:CV,system:NV,unit:eV},!1}),IV))return!1}),IV)return!1}),IV};var ZV=function(WV){return{abbr:WV.abbr,measure:WV.measure,system:WV.system,singular:WV.unit.name.singular,plural:WV.unit.name.plural}};return UV.prototype.describe=function(WV){var IV=UV.prototype.getUnit(WV),dV=null;try{dV=ZV(IV)}catch{this.throwUnsupportedUnitError(WV)}return dV},UV.prototype.list=function(WV){var IV=[];return VV(RV,function(dV,CV){WV&&WV!==CV||VV(dV,function(FV,NV){if(NV=="_anchors")return!1;VV(FV,function(eV,gV){IV=IV.concat(ZV({abbr:gV,measure:CV,system:NV,unit:eV}))})})}),IV},UV.prototype.throwUnsupportedUnitError=function(WV){var IV=[];throw VV(RV,function(dV,CV){VV(dV,function(FV,NV){if(NV=="_anchors")return!1;IV=IV.concat(J(FV))})}),new Error("Unsupported unit "+WV+", use one of: "+IV.join(", "))},UV.prototype.possibilities=function(WV){var IV=[];return!this.origin&&!WV?VV(J(RV),function(dV){VV(RV[dV],function(CV,FV){if(FV=="_anchors")return!1;IV=IV.concat(J(CV))})}):(WV=WV||this.origin.measure,VV(RV[WV],function(dV,CV){if(CV=="_anchors")return!1;IV=IV.concat(J(dV))})),IV},UV.prototype.measures=function(){return J(RV)},lV=function(WV){return new UV(WV)},lib$1=lV,lib$1}const urlAlphabet$1="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let random=lV=>crypto.getRandomValues(new Uint8Array(lV)),customRandom=(lV,J,VV)=>{let RV=(2<<Math.log2(lV.length-1))-1,UV=-~(1.6*RV*J/lV.length);return(ZV=J)=>{let WV="";for(;;){let IV=VV(UV),dV=UV|0;for(;dV--;)if(WV+=lV[IV[dV]&RV]||"",WV.length>=ZV)return WV}}},customAlphabet=(lV,J=21)=>customRandom(lV,J|0,random),nanoid$2=(lV=21)=>{let J="",VV=crypto.getRandomValues(new Uint8Array(lV|=0));for(;lV--;)J+=urlAlphabet$1[VV[lV]&63];return J};const index_browser=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet,customRandom,nanoid:nanoid$2,random,urlAlphabet:urlAlphabet$1},Symbol.toStringTag,{value:"Module"})),require$$2$2=getAugmentedNamespace(index_browser);var dist$a,hasRequiredDist$7;function requireDist$7(){if(hasRequiredDist$7)return dist$a;hasRequiredDist$7=1;var lV=Object.create,J=Object.defineProperty,VV=Object.getOwnPropertyDescriptor,RV=Object.getOwnPropertyNames,UV=Object.getPrototypeOf,ZV=Object.prototype.hasOwnProperty,WV=(KZ,XI)=>{for(var DW in XI)J(KZ,DW,{get:XI[DW],enumerable:!0})},IV=(KZ,XI,DW,yI)=>{if(XI&&typeof XI=="object"||typeof XI=="function")for(let CI of RV(XI))!ZV.call(KZ,CI)&&CI!==DW&&J(KZ,CI,{get:()=>XI[CI],enumerable:!(yI=VV(XI,CI))||yI.enumerable});return KZ},dV=(KZ,XI,DW)=>(DW=KZ!=null?lV(UV(KZ)):{},IV(!KZ||!KZ.__esModule?J(DW,"default",{value:KZ,enumerable:!0}):DW,KZ)),CV=KZ=>IV(J({},"__esModule",{value:!0}),KZ),FV={};WV(FV,{all_layers:()=>iW,any_circuit_element:()=>vU,any_soup_element:()=>TW,any_source_component:()=>mR,cad_component:()=>DU,capacitance:()=>tV,current:()=>xV,distance:()=>MV,inductance:()=>kV,layer_ref:()=>KW,layer_string:()=>_W,length:()=>XV,pcb_board:()=>_Z,pcb_component:()=>BU,pcb_fabrication_note_path:()=>nI,pcb_fabrication_note_text:()=>pW,pcb_hole:()=>_l,pcb_keepout:()=>jU,pcb_placement_error:()=>sZ,pcb_plated_hole:()=>yR,pcb_port:()=>uU,pcb_port_not_matched_error:()=>YU,pcb_route_hint:()=>JW,pcb_route_hints:()=>cW,pcb_silkscreen_circle:()=>DZ,pcb_silkscreen_line:()=>RW,pcb_silkscreen_oval:()=>bW,pcb_silkscreen_path:()=>gI,pcb_silkscreen_rect:()=>lZ,pcb_silkscreen_text:()=>aU,pcb_smtpad:()=>PU,pcb_text:()=>QZ,pcb_trace:()=>dW,pcb_trace_error:()=>YZ,pcb_trace_hint:()=>wZ,pcb_via:()=>ZZ,point:()=>yV,point3:()=>al,position:()=>ll,position3:()=>el,resistance:()=>YV,rotation:()=>wV,route_hint_point:()=>CZ,schematic_box:()=>vl,schematic_component:()=>RU,schematic_error:()=>hW,schematic_line:()=>FR,schematic_net_label:()=>MW,schematic_path:()=>iR,schematic_pin_styles:()=>PR,schematic_port:()=>OZ,schematic_text:()=>MZ,schematic_trace:()=>NU,size:()=>fV,source_component_base:()=>Bl,source_group:()=>KR,source_led:()=>tR,source_net:()=>eU,source_port:()=>XR,source_simple_bug:()=>Ol,source_simple_capacitor:()=>kl,source_simple_chip:()=>hR,source_simple_diode:()=>Pl,source_simple_ground:()=>Tl,source_simple_power_source:()=>MR,source_simple_resistor:()=>xl,source_trace:()=>sU,supplier_name:()=>Il,time:()=>uV,visible_layer:()=>hZ,voltage:()=>AV}),dist$a=CV(FV);var NV=dV(requireLib$1()),eV={tera:1e13,T:1e13,giga:1e10,G:1e10,mega:1e7,M:1e7,kilo:1e4,k:1e4,deci:1,d:1,centi:.1,c:.1,milli:.01,m:.01,micro:1e-5,u:1e-5,µ:1e-5,nano:1e-8,n:1e-8,pico:1e-11,p:1e-11},gV=Object.keys(eV),nV={mass:"g",length:"mm",time:"ms",volume:"ml",angle:"deg"};function JV(KZ){for(const XI of gV)if(KZ.startsWith(XI))return eV[XI];return 1}var aV=KZ=>{var FI,rd;if(typeof KZ>"u")return{unit:null,value:null};if(typeof KZ=="string"&&KZ.match(/^[\d\.]+$/))return{value:parseFloat(KZ),unit:null};if(typeof KZ=="number")return{value:KZ,unit:null};if(typeof KZ=="object"&&"x"in KZ&&"y"in KZ)return{unit:aV(KZ.x).unit,value:{x:aV(KZ.x).value,y:aV(KZ.y).value}};const XI=(FI=KZ.split("").reverse().join("").match(/[a-zA-Z]+/))==null?void 0:FI[0];if(!XI)throw new Error(`Could not determine unit: "${KZ}"`);const DW=XI.split("").reverse().join(""),yI=KZ.slice(0,-DW.length);let CI;try{CI=(rd=(0,NV.default)().describe(DW))==null?void 0:rd.measure}catch{}if(CI){const Nd=nV[CI];if(!Nd)throw new Error(`Could not determine target unit for measure: "${CI}"`);return{unit:DW,value:(0,NV.default)(parseFloat(yI)).from(DW).to(Nd)}}else return{unit:DW,value:JV(DW)*parseFloat(yI)}},GV=requireLib$2(),YV=GV.z.string().or(GV.z.number()).transform(KZ=>aV(KZ).value),tV=GV.z.string().or(GV.z.number()).transform(KZ=>aV(KZ).value),kV=GV.z.string().or(GV.z.number()).transform(KZ=>aV(KZ).value),AV=GV.z.string().or(GV.z.number()).transform(KZ=>aV(KZ).value),XV=GV.z.string().or(GV.z.number()).transform(KZ=>aV(KZ).value),MV=XV,xV=GV.z.string().or(GV.z.number()).transform(KZ=>aV(KZ).value),uV=GV.z.string().or(GV.z.number()).transform(KZ=>aV(KZ).value),wV=GV.z.string().or(GV.z.number()).transform(KZ=>typeof KZ=="number"?KZ:KZ.endsWith("deg")?Number.parseFloat(KZ.split("deg")[0]):KZ.endsWith("rad")?Number.parseFloat(KZ.split("rad")[0])*180/Math.PI:Number.parseFloat(KZ)),vV=requireLib$2(),yV=vV.z.object({x:MV,y:MV}),ll=yV,Nl=requireLib$2(),al=Nl.z.object({x:MV,y:MV,z:MV}),el=al,qV=requireLib$2(),fV=qV.z.object({width:qV.z.number(),height:qV.z.number()}),Ul=requireLib$2(),Cl=requireLib$2(),Il=Cl.z.enum(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),Jl=requireLib$2(),Bl=Jl.z.object({type:Jl.z.literal("source_component"),ftype:Jl.z.string().optional(),source_component_id:Jl.z.string(),name:Jl.z.string(),manufacturer_part_number:Jl.z.string().optional(),supplier_part_numbers:Jl.z.record(Il,Jl.z.array(Jl.z.string())).optional()}),kl=Bl.extend({ftype:Ul.z.literal("simple_capacitor"),capacitance:tV}),ol=requireLib$2(),xl=Bl.extend({ftype:ol.z.literal("simple_resistor"),resistance:YV}),wl=requireLib$2(),Pl=Bl.extend({ftype:wl.z.literal("simple_diode")}),zl=requireLib$2(),Tl=Bl.extend({ftype:zl.z.literal("simple_ground")}),Al=requireLib$2(),Ol=Bl.extend({ftype:Al.z.literal("simple_bug")}).describe("@deprecated"),RR=requireLib$2(),hR=Bl.extend({ftype:RR.z.literal("simple_chip")}),gR=requireLib$2();Bl.extend({ftype:gR.z.literal("simple_inductor"),inductance:kV});var sR=requireLib$2(),tR=Pl.extend({ftype:sR.z.literal("led")}),pR=requireLib$2(),MR=Bl.extend({ftype:pR.z.literal("simple_power_source"),voltage:AV}),cR=requireLib$2(),mR=cR.z.union([xl,kl,Pl,Tl,hR,Ol,tR,MR]),zR=requireLib$2(),XR=zR.z.object({type:zR.z.literal("source_port"),pin_number:zR.z.number().optional(),port_hints:zR.z.array(zR.z.string()).optional(),name:zR.z.string(),source_port_id:zR.z.string(),source_component_id:zR.z.string()}),ZU=requireLib$2(),sU=ZU.z.object({type:ZU.z.literal("source_trace"),source_trace_id:ZU.z.string(),connected_source_port_ids:ZU.z.array(ZU.z.string()),connected_source_net_ids:ZU.z.array(ZU.z.string())}),rU=requireLib$2(),KR=rU.z.object({type:rU.z.literal("source_group"),source_group_id:rU.z.string(),name:rU.z.string().optional()}),HR=requireLib$2(),eU=HR.z.object({type:HR.z.literal("source_net"),source_net_id:HR.z.string(),name:HR.z.string(),member_source_group_ids:HR.z.array(HR.z.string()),is_power:HR.z.boolean().optional(),is_ground:HR.z.boolean().optional(),is_digital_signal:HR.z.boolean().optional(),is_analog_signal:HR.z.boolean().optional(),trace_width:HR.z.number().optional()}),BR=requireLib$2(),vl=BR.z.object({type:BR.z.literal("schematic_box"),schematic_component_id:BR.z.string(),width:MV,height:MV,x:MV,y:MV}).describe("Draws a box on the schematic"),ER=requireLib$2(),iR=ER.z.object({type:ER.z.literal("schematic_path"),schematic_component_id:ER.z.string(),fill_color:ER.z.enum(["red","blue"]).optional(),is_filled:ER.z.boolean().optional(),points:ER.z.array(yV)}),TR=requireLib$2(),PR=TR.z.record(TR.z.object({left_margin:XV.optional(),right_margin:XV.optional(),top_margin:XV.optional(),bottom_margin:XV.optional()})),RU=TR.z.object({type:TR.z.literal("schematic_component"),rotation:wV.default(0),size:fV,center:yV,source_component_id:TR.z.string(),schematic_component_id:TR.z.string(),pin_spacing:XV.optional(),pin_styles:PR.optional(),box_width:XV.optional(),symbol_name:TR.z.string().optional(),port_arrangement:TR.z.union([TR.z.object({left_size:TR.z.number(),right_size:TR.z.number(),top_size:TR.z.number().optional(),bottom_size:TR.z.number().optional()}),TR.z.object({left_side:TR.z.object({pins:TR.z.array(TR.z.number()),direction:TR.z.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:TR.z.object({pins:TR.z.array(TR.z.number()),direction:TR.z.enum(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:TR.z.object({pins:TR.z.array(TR.z.number()),direction:TR.z.enum(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:TR.z.object({pins:TR.z.array(TR.z.number()),direction:TR.z.enum(["left-to-right","right-to-left"]).optional()}).optional()})]).optional(),port_labels:TR.z.record(TR.z.string()).optional()}),nU=requireLib$2(),FR=nU.z.object({type:nU.z.literal("schematic_line"),schematic_component_id:nU.z.string(),x1:MV,x2:MV,y1:MV,y2:MV}),dU=requireLib$2(),NU=dU.z.object({type:dU.z.literal("schematic_trace"),schematic_trace_id:dU.z.string(),source_trace_id:dU.z.string(),edges:dU.z.array(dU.z.object({from:dU.z.object({x:dU.z.number(),y:dU.z.number()}),to:dU.z.object({x:dU.z.number(),y:dU.z.number()}),from_schematic_port_id:dU.z.string().optional(),to_schematic_port_id:dU.z.string().optional()}))}),OU=requireLib$2(),MZ=OU.z.object({type:OU.z.literal("schematic_text"),schematic_component_id:OU.z.string(),schematic_text_id:OU.z.string(),text:OU.z.string(),position:OU.z.object({x:MV,y:MV}),rotation:OU.z.number().default(0),anchor:OU.z.enum(["center","left","right","top","bottom"]).default("center")}),jZ=requireLib$2(),OZ=jZ.z.object({type:jZ.z.literal("schematic_port"),schematic_port_id:jZ.z.string(),source_port_id:jZ.z.string(),schematic_component_id:jZ.z.string().optional(),center:yV,facing_direction:jZ.z.enum(["up","down","left","right"]).optional()}).describe("Defines a port on a schematic component"),oZ=requireLib$2(),MW=oZ.z.object({type:oZ.z.literal("schematic_net_label"),source_net_id:oZ.z.string(),center:yV,anchor_side:oZ.z.enum(["top","bottom","left","right"]),text:oZ.z.string()}),LU=requireLib$2(),hW=LU.z.object({schematic_error_id:LU.z.string(),type:LU.z.literal("schematic_error"),error_type:LU.z.literal("schematic_port_not_found"),message:LU.z.string()}).describe("Defines a schematic error on the schematic"),CW=requireLib$2(),iW=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6"],_W=CW.z.enum(iW),KW=_W.or(CW.z.object({name:_W})).transform(KZ=>typeof KZ=="string"?KZ:KZ.name),hZ=CW.z.enum(["top","bottom"]),nW=requireLib$2(),JW=nW.z.object({x:MV,y:MV,via:nW.z.boolean().optional(),via_to_layer:KW.optional()}),cW=nW.z.array(JW),oW=requireLib$2(),CZ=oW.z.object({x:MV,y:MV,via:oW.z.boolean().optional(),to_layer:KW.optional(),trace_width:MV.optional()}),IU=requireLib$2(),wR=requireLib$2(),JU=require$$2$2,uR=KZ=>wR.z.string().optional().default(()=>`${KZ}_${(0,JU.nanoid)(10)}`),BU=IU.z.object({type:IU.z.literal("pcb_component"),pcb_component_id:uR("pcb_component"),source_component_id:IU.z.string(),center:yV,layer:KW,rotation:wV,width:XV,height:XV}).describe("Defines a component on the PCB"),KU=requireLib$2(),_l=KU.z.object({pcb_hole_id:KU.z.string(),type:KU.z.literal("pcb_hole"),hole_shape:KU.z.enum(["circle","square","round"]).default("circle").transform(KZ=>KZ==="round"?"circle":KZ),hole_diameter:KU.z.number(),x:MV,y:MV}).or(KU.z.object({pcb_hole_id:KU.z.string(),type:KU.z.literal("pcb_hole"),hole_shape:KU.z.literal("oval"),hole_width:KU.z.number(),hole_height:KU.z.number(),x:MV,y:MV})).describe("Defines a hole on the PCB"),ql=requireLib$2(),yR=ql.z.object({type:ql.z.literal("pcb_plated_hole"),shape:ql.z.literal("circle"),outer_diameter:ql.z.number(),hole_diameter:ql.z.number(),x:MV,y:MV,layers:ql.z.array(KW),port_hints:ql.z.array(ql.z.string()).optional(),pcb_component_id:ql.z.string().optional(),pcb_port_id:ql.z.string().optional(),pcb_plated_hole_id:ql.z.string()}).or(ql.z.object({type:ql.z.literal("pcb_plated_hole"),shape:ql.z.enum(["oval","pill"]),outer_width:ql.z.number(),outer_height:ql.z.number(),hole_width:ql.z.number(),hole_height:ql.z.number(),x:MV,y:MV,layers:ql.z.array(KW),port_hints:ql.z.array(ql.z.string()).optional(),pcb_component_id:ql.z.string().optional(),pcb_port_id:ql.z.string().optional(),pcb_plated_hole_id:ql.z.string()})).describe("Defines a plated hole on the PCB"),GU=requireLib$2(),uU=GU.z.object({type:GU.z.literal("pcb_port"),pcb_port_id:GU.z.string(),source_port_id:GU.z.string(),pcb_component_id:GU.z.string(),x:MV,y:MV,layers:GU.z.array(KW)}).describe("Defines a port on the PCB"),_U=requireLib$2(),PU=_U.z.union([_U.z.object({pcb_smtpad_id:_U.z.string(),type:_U.z.literal("pcb_smtpad"),shape:_U.z.literal("circle"),x:MV,y:MV,radius:_U.z.number(),layer:KW,port_hints:_U.z.array(_U.z.string()).optional(),pcb_component_id:_U.z.string().optional(),pcb_port_id:_U.z.string().optional()}),_U.z.object({pcb_smtpad_id:_U.z.string(),type:_U.z.literal("pcb_smtpad"),shape:_U.z.literal("rect"),x:MV,y:MV,width:_U.z.number(),height:_U.z.number(),layer:KW,port_hints:_U.z.array(_U.z.string()).optional(),pcb_component_id:_U.z.string().optional(),pcb_port_id:_U.z.string().optional()})]).describe("Defines an SMT pad on the PCB"),FW=requireLib$2(),QZ=FW.z.object({type:FW.z.literal("pcb_text"),text:FW.z.string(),x:MV,y:MV,align:FW.z.enum(["bottom-left"]),width:MV,height:MV,lines:FW.z.number()}).describe("Defines text on the PCB"),HZ=requireLib$2(),dW=HZ.z.object({type:HZ.z.literal("pcb_trace"),source_trace_id:HZ.z.string().optional(),pcb_component_id:HZ.z.string().optional(),pcb_trace_id:HZ.z.string(),route_thickness_mode:HZ.z.enum(["constant","interpolated"]).default("constant").optional(),should_round_corners:HZ.z.boolean().optional(),route:HZ.z.array(HZ.z.union([HZ.z.object({route_type:HZ.z.literal("wire"),x:MV,y:MV,width:MV,start_pcb_port_id:HZ.z.string().optional(),end_pcb_port_id:HZ.z.string().optional(),layer:KW}),HZ.z.object({route_type:HZ.z.literal("via"),x:MV,y:MV,from_layer:HZ.z.string(),to_layer:HZ.z.string()})]))}),tW=requireLib$2(),YZ=tW.z.object({pcb_error_id:tW.z.string(),type:tW.z.literal("pcb_error"),error_type:tW.z.literal("pcb_trace_error"),message:tW.z.string(),center:yV.optional(),pcb_trace_id:tW.z.string(),source_trace_id:tW.z.string(),pcb_component_ids:tW.z.array(tW.z.string()),pcb_port_ids:tW.z.array(tW.z.string())}).describe("Defines a trace error on the PCB"),bR=requireLib$2(),YU=bR.z.object({pcb_error_id:bR.z.string(),type:bR.z.literal("pcb_error"),error_type:bR.z.literal("pcb_port_not_matched_error"),message:bR.z.string(),pcb_component_ids:bR.z.array(bR.z.string())}).describe("Defines a trace error on the PCB"),bU=requireLib$2(),ZZ=bU.z.object({type:bU.z.literal("pcb_via"),x:MV,y:MV,outer_diameter:MV.default("0.6mm"),hole_diameter:MV.default("0.25mm"),from_layer:KW.optional(),to_layer:KW.optional(),layers:bU.z.array(KW)}).describe("Defines a via on the PCB"),mZ=requireLib$2(),_Z=mZ.z.object({type:mZ.z.literal("pcb_board"),pcb_board_id:mZ.z.string().default("pcb_board_0").optional(),width:XV,height:XV,center:yV,outline:mZ.z.array(yV).optional()}).describe("Defines the board outline of the PCB"),YW=requireLib$2(),sZ=YW.z.object({pcb_error_id:YW.z.string(),type:YW.z.literal("pcb_error"),error_type:YW.z.literal("pcb_placement_error"),message:YW.z.string()}).describe("Defines a placement error on the PCB"),$U=requireLib$2(),wZ=$U.z.object({pcb_trace_hint_id:$U.z.string(),type:$U.z.literal("pcb_trace_hint"),pcb_port_id:$U.z.string(),pcb_component_id:$U.z.string(),route:$U.z.array(CZ.optional())}).describe("A hint that can be used to generate a PCB trace"),gW=requireLib$2(),RW=gW.z.object({type:gW.z.literal("pcb_silkscreen_line"),pcb_silkscreen_line_id:gW.z.string(),pcb_component_id:gW.z.string(),stroke_width:MV.default("0.1mm"),x1:MV,y1:MV,x2:MV,y2:MV,layer:hZ}).describe("Defines a silkscreen line on the PCB"),SW=requireLib$2(),gI=SW.z.object({type:SW.z.literal("pcb_silkscreen_path"),pcb_silkscreen_path_id:SW.z.string(),pcb_component_id:SW.z.string(),layer:hZ,route:SW.z.array(yV),stroke_width:XV}).describe("Defines a silkscreen path on the PCB"),TU=requireLib$2(),aU=TU.z.object({type:TU.z.literal("pcb_silkscreen_text"),font:TU.z.literal("tscircuit2024").default("tscircuit2024"),font_size:MV.default("0.2mm"),pcb_component_id:TU.z.string(),text:TU.z.string(),layer:hZ,anchor_position:yV.default({x:0,y:0}),anchor_alignment:TU.z.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center")}).describe("Defines silkscreen text on the PCB"),AU=requireLib$2(),lZ=AU.z.object({type:AU.z.literal("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:AU.z.string(),pcb_component_id:AU.z.string(),center:yV,width:MV,height:MV,layer:hZ}).describe("Defines a silkscreen rect on the PCB"),xZ=requireLib$2(),DZ=xZ.z.object({type:xZ.z.literal("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:xZ.z.string(),pcb_component_id:xZ.z.string(),center:yV,radius:MV,layer:hZ}).describe("Defines a silkscreen circle on the PCB"),rW=requireLib$2(),bW=rW.z.object({type:rW.z.literal("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:rW.z.string(),pcb_component_id:rW.z.string(),center:yV,radius_x:MV,radius_y:MV,layer:hZ}).describe("Defines a silkscreen oval on the PCB"),II=requireLib$2(),pW=II.z.object({type:II.z.literal("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:uR("pcb_fabrication_note_text"),font:II.z.literal("tscircuit2024").default("tscircuit2024"),font_size:MV.default("1mm"),pcb_component_id:II.z.string(),text:II.z.string(),layer:hZ,anchor_position:yV.default({x:0,y:0}),anchor_alignment:II.z.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:II.z.string().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),iI=requireLib$2(),nI=iI.z.object({type:iI.z.literal("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:uR("pcb_fabrication_note_path"),pcb_component_id:iI.z.string(),layer:hZ,route:iI.z.array(yV),stroke_width:XV,color:iI.z.string().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),sI=requireLib$2(),jU=sI.z.object({type:sI.z.literal("pcb_keepout"),shape:sI.z.literal("rect"),center:yV,width:MV,height:MV,pcb_keepout_id:sI.z.string(),layers:sI.z.array(sI.z.string()),description:sI.z.string().optional()}).or(sI.z.object({type:sI.z.literal("pcb_keepout"),shape:sI.z.literal("circle"),center:yV,radius:MV,pcb_keepout_id:sI.z.string(),layers:sI.z.array(sI.z.string()),description:sI.z.string().optional()})),MU=requireLib$2(),DU=MU.z.object({type:MU.z.literal("cad_component"),cad_component_id:MU.z.string(),pcb_component_id:MU.z.string(),source_component_id:MU.z.string(),position:al,rotation:al.optional(),size:al.optional(),layer:KW.optional(),footprinter_string:MU.z.string().optional(),model_obj_url:MU.z.string().optional(),model_stl_url:MU.z.string().optional(),model_3mf_url:MU.z.string().optional(),model_jscad:MU.z.any().optional()}).describe("Defines a component on the PCB"),RZ=requireLib$2(),vU=RZ.z.union([sU,XR,mR,tR,eU,KR,Ol,hR,kl,Pl,xl,MR,BU,_l,yR,jU,uU,QZ,dW,ZZ,PU,_Z,wZ,RW,gI,aU,lZ,DZ,bW,YZ,sZ,YU,nI,pW,vl,MZ,FR,RU,OZ,NU,iR,hW,MW,DU]),TW=vU;return dist$a}const require$$2$1=getAugmentedNamespace(parsel);var dist$9,hasRequiredDist$6;function requireDist$6(){if(hasRequiredDist$6)return dist$9;hasRequiredDist$6=1;var lV=Object.create,J=Object.defineProperty,VV=Object.getOwnPropertyDescriptor,RV=Object.getOwnPropertyNames,UV=Object.getPrototypeOf,ZV=Object.prototype.hasOwnProperty,WV=(Jl,Bl)=>{for(var kl in Bl)J(Jl,kl,{get:Bl[kl],enumerable:!0})},IV=(Jl,Bl,kl,ol)=>{if(Bl&&typeof Bl=="object"||typeof Bl=="function")for(let xl of RV(Bl))!ZV.call(Jl,xl)&&xl!==kl&&J(Jl,xl,{get:()=>Bl[xl],enumerable:!(ol=VV(Bl,xl))||ol.enumerable});return Jl},dV=(Jl,Bl,kl)=>(kl=Jl!=null?lV(UV(Jl)):{},IV(J(kl,"default",{value:Jl,enumerable:!0}),Jl)),CV=Jl=>IV(J({},"__esModule",{value:!0}),Jl),FV={};WV(FV,{applySelector:()=>ll,applySelectorAST:()=>al,directionToVec:()=>JV,getElementById:()=>qV,getElementId:()=>el,getReadableNameForElement:()=>Il,getReadableNameForPcbPort:()=>Ul,getReadableNameForPcbSmtpad:()=>Cl,getReadableNameForPcbTrace:()=>fV,oppositeDirection:()=>kV,oppositeSide:()=>AV,rotateClockwise:()=>GV,rotateCounterClockwise:()=>YV,rotateDirection:()=>tV,su:()=>gV,transformPCBElement:()=>xV,transformPCBElements:()=>uV,transformSchematicElement:()=>XV,transformSchematicElements:()=>MV,vecToDirection:()=>aV}),dist$9=CV(FV);var NV=dV(requireDist$7()),eV=(Jl,Bl={})=>{let kl=Jl._internal_store;if(!kl){kl={counts:{}},Jl._internal_store=kl;for(const xl of Jl){const wl=xl.type,Pl=xl[`${wl}_id`];if(!Pl)continue;const zl=Number.parseInt(Pl.split("_").pop());Number.isNaN(zl)||(kl.counts[wl]=Math.max(kl.counts[wl]??0,zl))}}return new Proxy({},{get:(xl,wl)=>wl==="toArray"?()=>Jl:{get:Pl=>Jl.find(zl=>zl.type===wl&&zl[`${wl}_id`]===Pl),getUsing:Pl=>{const zl=Object.keys(Pl);if(zl.length!==1)throw new Error("getUsing requires exactly one key, e.g. { pcb_component_id }");const Tl=zl[0],Al=Tl.replace("_id",""),Ol=Jl.find(RR=>RR.type===Al&&RR[Tl]===Pl[Tl]);return Ol?Jl.find(RR=>RR.type===wl&&RR[`${wl}_id`]===Ol[`${wl}_id`]):null},getWhere:Pl=>{const zl=Object.keys(Pl);return Jl.find(Tl=>Tl.type===wl&&zl.every(Al=>Tl[Al]===Pl[Al]))},list:Pl=>{const zl=Pl?Object.keys(Pl):[];return Jl.filter(Tl=>Tl.type===wl&&zl.every(Al=>Tl[Al]===Pl[Al]))},insert:Pl=>{var Al;(Al=kl.counts)[wl]??(Al[wl]=-1),kl.counts[wl]++;const zl=kl.counts[wl],Tl={type:wl,[`${wl}_id`]:`${wl}_${zl}`,...Pl};return Bl.validateInserts&&(NV[wl]??NV.any_soup_element).parse(Tl),Jl.push(Tl),Tl},delete:Pl=>{const zl=Jl.find(Tl=>Tl[`${wl}_id`]===Pl);zl&&Jl.splice(Jl.indexOf(zl),1)},update:(Pl,zl)=>{const Tl=Jl.find(Al=>Al[`${wl}_id`]===Pl);if(Tl)return Object.assign(Tl,zl),Tl},select:Pl=>{if(wl==="source_component")return Jl.find(zl=>zl.type==="source_component"&&zl.name===Pl.replace(/\./g,""));if(wl==="pcb_port"||wl==="source_port"||wl==="schematic_port"){const[zl,Tl]=Pl.replace(/\./g,"").split(/[\s\>]+/),Al=Jl.find(RR=>RR.type==="source_component"&&RR.name===zl);if(!Al)return null;const Ol=Jl.find(RR=>RR.type==="source_port"&&RR.source_component_id===Al.source_component_id&&(RR.name===Tl||(RR.port_hints??[]).includes(Tl)));if(!Ol)return null;if(wl==="source_port")return Ol;if(wl==="pcb_port")return Jl.find(RR=>RR.type==="pcb_port"&&RR.source_port_id===Ol.source_port_id);if(wl==="schematic_port")return Jl.find(RR=>RR.type==="schematic_port"&&RR.source_port_id===Ol.source_port_id)}}}})};eV.unparsed=eV;var gV=eV,nV=require$$0,JV=Jl=>{if(Jl==="up")return{x:0,y:1};if(Jl==="down")return{x:0,y:-1};if(Jl==="left")return{x:-1,y:0};if(Jl==="right")return{x:1,y:0};throw new Error("Invalid direction")},aV=({x:Jl,y:Bl})=>{if(Jl>Bl&&(Bl=0),Bl>Jl&&(Jl=0),Jl>0&&Bl===0)return"right";if(Jl<0&&Bl===0)return"left";if(Jl===0&&Bl>0)return"up";if(Jl===0&&Bl<0)return"down";throw new Error(`Invalid vector for direction conversion (${Jl}, ${Bl})`)},GV=Jl=>{if(Jl==="up")return"right";if(Jl==="right")return"down";if(Jl==="down")return"left";if(Jl==="left")return"up";throw new Error(`Invalid direction: ${Jl}`)},YV=Jl=>{if(Jl==="up")return"left";if(Jl==="left")return"down";if(Jl==="down")return"right";if(Jl==="right")return"up";throw new Error(`Invalid direction: ${Jl}`)},tV=(Jl,Bl)=>{for(;Bl>0;)Jl=GV(Jl),Bl--;for(;Bl<0;)Jl=YV(Jl),Bl++;return Jl},kV=Jl=>{if(Jl==="up")return"down";if(Jl==="down")return"up";if(Jl==="left")return"right";if(Jl==="right")return"left";throw new Error(`Invalid direction: ${Jl}`)},AV=Jl=>{if(Jl==="top"||Jl==="up")return"bottom";if(Jl==="bottom"||Jl==="down")return"top";if(Jl==="left")return"right";if(Jl==="right")return"left";throw new Error(`Invalid sideOrDir: ${Jl}`)},XV=(Jl,Bl)=>{if(Jl.type==="schematic_component")Jl.center=(0,nV.applyToPoint)(Bl,Jl.center);else if(Jl.type==="schematic_port")Jl.center=(0,nV.applyToPoint)(Bl,Jl.center),Jl.facing_direction&&(Jl.facing_direction=tV(Jl.facing_direction,-(Math.atan2(Bl.b,Bl.a)/Math.PI)*2));else if(Jl.type==="schematic_text")Jl.position=(0,nV.applyToPoint)(Bl,Jl.position);else if(Jl.type!=="schematic_trace"){if(Jl.type==="schematic_box"){const{x:kl,y:ol}=(0,nV.applyToPoint)(Bl,{x:Jl.x,y:Jl.y});Jl.x=kl,Jl.y=ol}else if(Jl.type==="schematic_line"){const{x:kl,y:ol}=(0,nV.applyToPoint)(Bl,{x:Jl.x1,y:Jl.y1}),{x:xl,y:wl}=(0,nV.applyToPoint)(Bl,{x:Jl.x2,y:Jl.y2});Jl.x1=kl,Jl.y1=ol,Jl.x2=xl,Jl.y2=wl}}return Jl},MV=(Jl,Bl)=>Jl.map(kl=>XV(kl,Bl)),xV=(Jl,Bl)=>{if(Jl.type==="pcb_plated_hole"||Jl.type==="pcb_hole"||Jl.type==="pcb_via"||Jl.type==="pcb_smtpad"||Jl.type==="pcb_port"){const{x:kl,y:ol}=(0,nV.applyToPoint)(Bl,{x:Jl.x,y:Jl.y});Jl.x=kl,Jl.y=ol}else if(Jl.type==="pcb_keepout")Jl.center=(0,nV.applyToPoint)(Bl,Jl.center);else if(Jl.type==="pcb_silkscreen_text"||Jl.type==="pcb_fabrication_note_text")Jl.anchor_position=(0,nV.applyToPoint)(Bl,Jl.anchor_position);else if(Jl.type==="pcb_silkscreen_circle"||Jl.type==="pcb_silkscreen_rect"||Jl.type==="pcb_component")Jl.center=(0,nV.applyToPoint)(Bl,Jl.center);else if(Jl.type==="pcb_silkscreen_path"||Jl.type==="pcb_trace"||Jl.type==="pcb_fabrication_note_path")Jl.route=Jl.route.map(kl=>{const ol=(0,nV.applyToPoint)(Bl,kl);return kl.x=ol.x,kl.y=ol.y,kl});else if(Jl.type==="pcb_silkscreen_line"){const kl={x:Jl.x1,y:Jl.y1},ol={x:Jl.x2,y:Jl.y2},xl=(0,nV.applyToPoint)(Bl,kl),wl=(0,nV.applyToPoint)(Bl,ol);Jl.x1=xl.x,Jl.y1=xl.y,Jl.x2=wl.x,Jl.y2=wl.y}else if(Jl.type==="cad_component"){const kl=(0,nV.applyToPoint)(Bl,{x:Jl.position.x,y:Jl.position.y});Jl.position.x=kl.x,Jl.position.y=kl.y}return Jl},uV=(Jl,Bl)=>{const kl=(0,nV.decomposeTSR)(Bl),ol=Math.round(kl.rotation.angle/(Math.PI/2))%2===1;let xl=Jl.map(wl=>xV(wl,Bl));return ol&&(xl=xl.map(wl=>(wl.type==="pcb_smtpad"&&wl.shape==="rect"&&([wl.width,wl.height]=[wl.height,wl.width]),wl))),xl},wV=dV(require$$2$1),vV=Jl=>{switch(Jl){case"port":return"source_port";case"net":return"source_net";case"power":return"simple_power_source"}return Jl},yV=(Jl,Bl)=>(Bl=vV(Bl),Jl.filter(kl=>"ftype"in kl&&kl.ftype===Bl||kl.type===Bl)),ll=(Jl,Bl)=>{const kl=wV.parse(Bl);return al(Jl,kl)},Nl=(Jl,Bl)=>{var kl;return"name"in Jl&&Jl.name===Bl||"port_hints"in Jl&&((kl=Jl.port_hints)==null?void 0:kl.includes(Bl))},al=(Jl,Bl)=>{switch(Bl.type){case"complex":{switch(Bl.combinator){case" ":case">":{const{left:kl,right:ol}=Bl;if(kl.type==="class"||kl.type==="type"){let xl;kl.type==="class"?xl=Jl.filter(Pl=>Nl(Pl,kl.name)):kl.type==="type"?xl=yV(Jl,kl.name):xl=[];const wl=xl.flatMap(Pl=>Jl.filter(zl=>zl[`${Pl.type}_id`]===Pl[`${Pl.type}_id`]&&zl!==Pl));return al(wl,ol)}else throw new Error(`unsupported selector type "${kl.type}" `)}default:throw new Error(`Couldn't apply selector AST for complex combinator "${Bl.combinator}"`)}return[]}case"compound":{const kl=Bl.list.map(ol=>{switch(ol.type){case"class":return xl=>Nl(xl,ol.name);case"type":{const xl=vV(ol.name);return wl=>wl.type===xl}}});return Jl.filter(ol=>kl.every(xl=>xl==null?void 0:xl(ol)))}case"type":return yV(Jl,Bl.name);case"class":return Jl.filter(kl=>Nl(kl,Bl.name));default:throw new Error(`Couldn't apply selector AST for type: "${Bl.type}" ${JSON.stringify(Bl,null," ")}`)}},el=Jl=>{const Bl=Jl.type;return Jl[`${Bl}_id`]},qV=(Jl,Bl)=>Jl.find(kl=>el(kl)===Bl)??null;function fV(Jl,Bl){const kl=eV(Jl).pcb_trace.get(Bl);if(!kl)return`trace[${Bl}]`;const ol=kl.route.flatMap(Pl=>[Pl.start_pcb_port_id,Pl.end_pcb_port_id]).filter(Boolean);if(ol.length===0)return`trace[${Bl}]`;function xl(Pl){const zl=eV(Jl).pcb_port.get(Pl);if(!zl)return null;const Tl=eV(Jl).pcb_component.get(zl.pcb_component_id);if(!Tl)return null;const Al=eV(Jl).source_component.get(Tl.source_component_id);if(!Al)return null;const Ol=eV(Jl).source_port.get(zl.source_port_id),RR=Ol!=null&&Ol.port_hints?Ol.port_hints[1]:"";return{componentName:Al.name,portHint:RR}}return`trace[${ol.map(Pl=>{const zl=xl(Pl);return zl?`.${zl.componentName} > port.${zl.portHint}`:`port[${Pl}]`}).join(", ")}]`}var Ul=(Jl,Bl)=>{const kl=eV(Jl).pcb_port.get(Bl);if(!kl)return`pcb_port[#${Bl}]`;const ol=eV(Jl).pcb_component.get(kl==null?void 0:kl.pcb_component_id);if(!ol)return`pcb_port[#${Bl}]`;const xl=eV(Jl).source_component.get(ol.source_component_id);if(!xl)return`pcb_port[#${Bl}]`;const wl=eV(Jl).source_port.get(kl.source_port_id);if(!wl)return`pcb_port[#${Bl}]`;let Pl;return wl!=null&&wl.port_hints&&wl.port_hints.length>0||wl.port_hints&&wl.port_hints.length>0?Pl=wl.port_hints[0]:Pl=Bl,`pcb_port[.${xl.name} > .${Pl}]`};function Cl(Jl,Bl){const kl=eV(Jl).pcb_smtpad.get(Bl);return!kl||!kl.pcb_port_id?`smtpad[${Bl}]`:Ul(Jl,kl.pcb_port_id)}var Il=(Jl,Bl)=>{if(typeof Bl=="string"){const kl=qV(Jl,Bl);return Il(Jl,kl)}switch(Bl.type){case"pcb_port":return Ul(Jl,Bl.pcb_port_id);case"pcb_smtpad":return Cl(Jl,Bl.pcb_smtpad_id);case"pcb_trace":return fV(Jl,Bl.pcb_trace_id);case"source_component":return`source_component[${Bl.name}]`;default:return`${Bl.type}[#${el(Bl)}]`}};return dist$9}var distExports$4=requireDist$6(),performanceNow$1={exports:{}},performanceNow=performanceNow$1.exports,hasRequiredPerformanceNow;function requirePerformanceNow(){return hasRequiredPerformanceNow||(hasRequiredPerformanceNow=1,(function(){var lV,J,VV,RV,UV,ZV;typeof performance<"u"&&performance!==null&&performance.now?performanceNow$1.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(performanceNow$1.exports=function(){return(lV()-UV)/1e6},J=process.hrtime,lV=function(){var WV;return WV=J(),WV[0]*1e9+WV[1]},RV=lV(),ZV=process.uptime()*1e9,UV=RV-ZV):Date.now?(performanceNow$1.exports=function(){return Date.now()-VV},VV=Date.now()):(performanceNow$1.exports=function(){return new Date().getTime()-VV},VV=new Date().getTime())}).call(performanceNow)),performanceNow$1.exports}requirePerformanceNow();function doesLineIntersectLine$1([lV,J],[VV,RV],{lineThickness:UV=0}={}){return UV===0?doSegmentsIntersect$1(lV,J,VV,RV):segmentsDistance$1(lV,J,VV,RV)<=UV}function doSegmentsIntersect$1(lV,J,VV,RV){const UV=orientation$1(lV,J,VV),ZV=orientation$1(lV,J,RV),WV=orientation$1(VV,RV,lV),IV=orientation$1(VV,RV,J);return!!(UV!==ZV&&WV!==IV||UV===0&&onSegment$2(lV,VV,J)||ZV===0&&onSegment$2(lV,RV,J)||WV===0&&onSegment$2(VV,lV,RV)||IV===0&&onSegment$2(VV,J,RV))}function orientation$1(lV,J,VV){const RV=(J.y-lV.y)*(VV.x-J.x)-(J.x-lV.x)*(VV.y-J.y);return RV===0?0:RV>0?1:2}function onSegment$2(lV,J,VV){return J.x<=Math.max(lV.x,VV.x)&&J.x>=Math.min(lV.x,VV.x)&&J.y<=Math.max(lV.y,VV.y)&&J.y>=Math.min(lV.y,VV.y)}function segmentsDistance$1(lV,J,VV,RV){if(lV.x===J.x&&lV.y===J.y)return pointToSegmentDistance$1(lV,VV,RV);if(VV.x===RV.x&&VV.y===RV.y)return pointToSegmentDistance$1(VV,lV,J);if(doSegmentsIntersect$1(lV,J,VV,RV))return 0;const UV=[pointToSegmentDistance$1(lV,VV,RV),pointToSegmentDistance$1(J,VV,RV),pointToSegmentDistance$1(VV,lV,J),pointToSegmentDistance$1(RV,lV,J)];return Math.min(...UV)}function pointToSegmentDistance$1(lV,J,VV){const RV=(VV.x-J.x)**2+(VV.y-J.y)**2;if(RV===0)return distance$2(lV,J);let UV=((lV.x-J.x)*(VV.x-J.x)+(lV.y-J.y)*(VV.y-J.y))/RV;UV=Math.max(0,Math.min(1,UV));const ZV={x:J.x+UV*(VV.x-J.x),y:J.y+UV*(VV.y-J.y)};return distance$2(lV,ZV)}function distance$2(lV,J){const VV=lV.x-J.x,RV=lV.y-J.y;return Math.sqrt(VV*VV+RV*RV)}function findConnectedNetworks$1(lV){const J=new Map;let VV=0;function RV(UV){for(const[,WV]of J)if(WV.has(UV))return WV;const ZV=new Set;return J.set(`connectivity_net${VV++}`,ZV),ZV}for(const UV of lV){let ZV=null;for(const WV of UV){if(!ZV)ZV=RV(WV);else if(!ZV.has(WV)){const IV=RV(WV);if(IV!==ZV){for(const dV of IV)ZV.add(dV);J.delete(Array.from(J.entries()).find(([,dV])=>dV===IV)[0])}}ZV.add(WV)}}return Object.fromEntries(Array.from(J.entries()).map(([UV,ZV])=>[UV,Array.from(ZV)]))}var ConnectivityMap$1=class{constructor(J){Fd(this,"netMap");Fd(this,"idToNetMap");this.netMap=J,this.idToNetMap={};for(const[VV,RV]of Object.entries(J))for(const UV of RV)this.idToNetMap[UV]=VV}addConnections(J){for(const VV of J){const RV=new Set;for(const ZV of VV){const WV=this.idToNetMap[ZV];WV&&RV.add(WV)}let UV;if(RV.size===0)UV=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[UV]=[];else if(RV.size===1)UV=RV.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{UV=RV.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(const ZV of RV)if(ZV!==UV){this.netMap[UV].push(...this.netMap[ZV]),this.netMap[ZV]=this.netMap[UV];for(const WV of this.netMap[UV])this.idToNetMap[WV]=UV}}for(const ZV of VV)this.netMap[UV].includes(ZV)||this.netMap[UV].push(ZV),this.idToNetMap[ZV]=UV}}getIdsConnectedToNet(J){return this.netMap[J]||[]}getNetConnectedToId(J){return this.idToNetMap[J]}areIdsConnected(J,VV){const RV=this.getNetConnectedToId(J),UV=this.getNetConnectedToId(VV);return RV===UV||UV===J||UV===J}areAllIdsConnected(J){const VV=this.getNetConnectedToId(J[0]);for(const RV of J){const UV=this.getNetConnectedToId(RV);if(UV===void 0||UV!==VV)return!1}return!0}},getSourcePortConnectivityMapFromCircuitJson=lV=>{const J=[];for(const RV of lV)RV.type==="source_trace"&&J.push([...RV.connected_source_port_ids??[],...RV.connected_source_net_ids??[]]);const VV=findConnectedNetworks$1(J);return new ConnectivityMap$1(VV)},getFullConnectivityMapFromCircuitJson$1=lV=>{const J=[];for(const RV of lV)if(RV.type==="source_trace")J.push([RV.source_trace_id,...RV.connected_source_port_ids??[],...RV.connected_source_net_ids??[]].filter(Boolean));else if(RV.type==="pcb_port"){const{pcb_port_id:UV,source_port_id:ZV}=RV;ZV&&UV&&J.push([ZV,UV])}else if(RV.type==="pcb_smtpad"){const{pcb_smtpad_id:UV,pcb_port_id:ZV}=RV;ZV&&UV&&J.push([UV,ZV])}else if(RV.type==="pcb_plated_hole"){const{pcb_plated_hole_id:UV,pcb_port_id:ZV}=RV;ZV&&UV&&J.push([UV,ZV])}else if(RV.type==="pcb_trace"){const{pcb_trace_id:UV,source_trace_id:ZV}=RV;ZV&&UV&&J.push([UV,ZV])}const VV=findConnectedNetworks$1(J);return new ConnectivityMap$1(VV)},PcbConnectivityMap=class{constructor(lV){Fd(this,"circuitJson");Fd(this,"traceIdToElm");Fd(this,"portIdToElm");Fd(this,"connMap");this.circuitJson=lV||[],this.traceIdToElm=new Map,this.portIdToElm=new Map,lV?(this._buildTraceMap(),this._buildPortMap(),this.connMap=this._buildTraceConnectivityMap()):this.connMap=new ConnectivityMap$1({})}_buildPortMap(){for(const lV of this.circuitJson)lV.type==="pcb_port"&&this.portIdToElm.set(lV.pcb_port_id,lV)}_buildTraceMap(){for(const lV of this.circuitJson)lV.type==="pcb_trace"&&this.traceIdToElm.set(lV.pcb_trace_id,lV)}_buildTraceConnectivityMap(){const lV=[],J=Array.from(this.traceIdToElm.keys());for(let VV=0;VV<J.length;VV++)for(let RV=VV+1;RV<J.length;RV++){const UV=this.traceIdToElm.get(J[VV]),ZV=this.traceIdToElm.get(J[RV]);this._arePcbTracesConnected(UV,ZV)&&lV.push([J[VV],J[RV]])}for(const VV of this.portIdToElm.values())for(const RV of this.traceIdToElm.values())for(const UV of RV.route)UV.route_type==="wire"&&(UV.start_pcb_port_id===VV.pcb_port_id?lV.push([VV.pcb_port_id,RV.pcb_trace_id]):UV.end_pcb_port_id===VV.pcb_port_id&&lV.push([RV.pcb_trace_id,VV.pcb_port_id]));return new ConnectivityMap$1(findConnectedNetworks$1(lV))}addTrace(lV){this.traceIdToElm.set(lV.pcb_trace_id,lV);const J=[];for(const VV of lV.route)VV.route_type==="wire"&&(VV.start_pcb_port_id&&J.push([VV.start_pcb_port_id,lV.pcb_trace_id]),VV.end_pcb_port_id&&J.push([VV.end_pcb_port_id,lV.pcb_trace_id]));this.connMap.addConnections(J)}_arePcbTracesConnected(lV,J){for(let VV=0;VV<lV.route.length-1;VV++){const RV=lV.route[VV],UV=lV.route[VV+1];if(RV.route_type==="wire"&&UV.route_type==="wire")for(let ZV=0;ZV<J.route.length-1;ZV++){const WV=J.route[ZV],IV=J.route[ZV+1];if(WV.route_type!=="wire"||IV.route_type!=="wire")continue;if(doesLineIntersectLine$1([RV,UV],[WV,IV],{lineThickness:(RV.width+WV.width)/2}))return!0}}return!1}areTracesConnected(lV,J){return this.connMap.areIdsConnected(lV,J)}getAllTracesConnectedToTrace(lV){const J=this.connMap.getNetConnectedToId(lV);return J?this.connMap.getIdsConnectedToNet(J).filter(VV=>this.traceIdToElm.has(VV)).map(VV=>this.traceIdToElm.get(VV)):[]}getAllTracesConnectedToPort(lV){const J=this.connMap.getNetConnectedToId(lV);return J?this.connMap.getIdsConnectedToNet(J).filter(VV=>this.traceIdToElm.has(VV)).map(VV=>this.traceIdToElm.get(VV)):[]}};const dist$8=Object.freeze(Object.defineProperty({__proto__:null,ConnectivityMap:ConnectivityMap$1,PcbConnectivityMap,findConnectedNetworks:findConnectedNetworks$1,getFullConnectivityMapFromCircuitJson:getFullConnectivityMapFromCircuitJson$1,getSourcePortConnectivityMapFromCircuitJson},Symbol.toStringTag,{value:"Module"}));function getBoundingBox(lV){const J=lV.width/2,VV=lV.height/2;return{minX:lV.center.x-J,maxX:lV.center.x+J,minY:lV.center.y-VV,maxY:lV.center.y+VV}}function computeDistanceBetweenBoxes(lV,J){const VV=getBoundingBox(lV),RV=getBoundingBox(J),UV=Math.max(VV.minX-RV.maxX,RV.minX-VV.maxX,0),ZV=Math.max(VV.minY-RV.maxY,RV.minY-VV.maxY,0),WV={x:0,y:0},IV={x:0,y:0};return UV===0&&ZV===0?{distance:0,pointA:lV.center,pointB:J.center}:(WV.x=clamp$7(lV.center.x,RV.minX,RV.maxX),WV.y=clamp$7(lV.center.y,RV.minY,RV.maxY),IV.x=clamp$7(J.center.x,VV.minX,VV.maxX),IV.y=clamp$7(J.center.y,VV.minY,VV.maxY),{distance:Math.hypot(WV.x-IV.x,WV.y-IV.y),pointA:WV,pointB:IV})}function clamp$7(lV,J,VV){return Math.max(J,Math.min(VV,lV))}function findNearestPointsBetweenBoxSets(lV,J){let VV=Number.POSITIVE_INFINITY,RV={x:0,y:0},UV={x:0,y:0};for(const ZV of lV)for(const WV of J){const{distance:IV,pointA:dV,pointB:CV}=computeDistanceBetweenBoxes(ZV,WV);IV<VV&&(VV=IV,RV=dV,UV=CV)}return{pointA:RV,pointB:UV,distance:VV}}let nanoid$1=(lV=21)=>crypto.getRandomValues(new Uint8Array(lV)).reduce((J,VV)=>(VV&=63,VV<36?J+=VV.toString(36):VV<62?J+=(VV-26).toString(36).toUpperCase():VV>62?J+="-":J+="_",J),"");var manDist=(lV,J)=>Math.abs(lV.x-J.x)+Math.abs(lV.y-J.y),dirFromAToB=(lV,J)=>{const VV=J.x-lV.x,RV=J.y-lV.y;return Math.abs(VV)>Math.abs(RV)?{dx:Math.sign(VV),dy:0}:{dx:0,dy:Math.sign(RV)}},distAlongDir=(lV,J,VV)=>Math.abs(lV.x-J.x)*Math.abs(VV.dx)+Math.abs(lV.y-J.y)*Math.abs(VV.dy),nodeName=(lV,J=.1)=>`${Math.round(lV.x/J)},${Math.round(lV.y/J)}`,isCloseTo=(lV,J)=>Math.abs(lV-J)<1e-4,getObstaclesFromRoute=(lV,J,{viaDiameter:VV=.5}={})=>{const RV=[];for(let UV=0;UV<lV.length-1;UV++){const[ZV,WV]=[lV[UV],lV[UV+1]],IV=UV-1>=0?lV[UV-1]:null,dV=isCloseTo(ZV.y,WV.y),CV=isCloseTo(ZV.x,WV.x);if(!dV&&!CV)throw new Error(`getObstaclesFromTrace currently only supports horizontal and vertical traces (not diagonals) Conflicting trace: ${J}, start: (${ZV.x}, ${ZV.y}), end: (${WV.x}, ${WV.y})`);const FV={type:"rect",layers:[ZV.layer],center:{x:(ZV.x+WV.x)/2,y:(ZV.y+WV.y)/2},width:dV?Math.abs(ZV.x-WV.x):.1,height:CV?Math.abs(ZV.y-WV.y):.1,connectedTo:[J]};if(RV.push(FV),IV&&IV.layer===ZV.layer&&ZV.layer!==WV.layer){const NV={type:"rect",layers:[ZV.layer,WV.layer],center:{x:ZV.x,y:ZV.y},connectedTo:[J],width:VV,height:VV};RV.push(NV)}}return RV},ObstacleList=class{constructor(lV){Fd(this,"obstacles");Fd(this,"GRID_STEP",.1);this.obstacles=lV.map(J=>({...J,left:J.center.x-J.width/2,right:J.center.x+J.width/2,top:J.center.y+J.height/2,bottom:J.center.y-J.height/2}))}getObstacleAt(lV,J,VV){VV??(VV=this.GRID_STEP);for(const RV of this.obstacles){const UV=RV.width/2+VV,ZV=RV.height/2+VV;if(lV>=RV.center.x-UV&&lV<=RV.center.x+UV&&J>=RV.center.y-ZV&&J<=RV.center.y+ZV)return RV}return null}isObstacleAt(lV,J,VV){return this.getObstacleAt(lV,J,VV)!==null}getDirectionDistancesToNearestObstacle(lV,J){const{GRID_STEP:VV}=this,RV={left:1/0,top:1/0,bottom:1/0,right:1/0};for(const UV of this.obstacles)if(UV.type==="rect"){const ZV=UV.center.x-UV.width/2-VV,WV=UV.center.x+UV.width/2+VV,IV=UV.center.y+UV.height/2+VV,dV=UV.center.y-UV.height/2-VV;J>=dV&&J<=IV&&lV>ZV&&(RV.left=Math.min(RV.left,lV-WV)),J>=dV&&J<=IV&&lV<WV&&(RV.right=Math.min(RV.right,ZV-lV)),lV>=ZV&&lV<=WV&&J<IV&&(RV.top=Math.min(RV.top,dV-J)),lV>=ZV&&lV<=WV&&J>dV&&(RV.bottom=Math.min(RV.bottom,J-IV))}return RV}getOrthoDirectionCollisionInfo(lV,J,{margin:VV=0}={}){const{x:RV,y:UV}=lV,{dx:ZV,dy:WV}=J;let IV=1/0,dV=null;for(const CV of this.obstacles){const FV=CV.left-VV,NV=CV.right+VV,eV=CV.top+VV,gV=CV.bottom-VV;let nV=null;ZV===1&&WV===0?UV>gV&&UV<eV&&RV<CV.left&&(nV=CV.left-RV):ZV===-1&&WV===0?UV>gV&&UV<eV&&RV>CV.right&&(nV=RV-CV.right):ZV===0&&WV===1?RV>FV&&RV<NV&&UV<CV.bottom&&(nV=CV.bottom-UV):ZV===0&&WV===-1&&RV>FV&&RV<NV&&UV>CV.top&&(nV=UV-CV.top),nV!==null&&nV<IV&&(IV=nV,dV=CV)}return{dx:ZV,dy:WV,wallDistance:IV,obstacle:dV}}getObstaclesOverlappingRegion(lV){const J=[];for(const VV of this.obstacles){const{left:RV,right:UV,top:ZV,bottom:WV}=VV;RV>=lV.minX&&UV<=lV.maxX&&ZV>=lV.minY&&WV<=lV.maxY&&J.push(VV)}return J}};function removePathLoops(lV){if(lV.length<4)return lV;const J=[{...lV[0]}];let VV=lV[0].layer;for(let RV=1;RV<lV.length;RV++){const UV={start:lV[RV-1],end:lV[RV]},ZV=lV[RV].route_type==="via"||lV[RV-1].route_type==="via";if(lV[RV].layer!==VV||ZV){J.push({...lV[RV]}),VV=lV[RV].layer;continue}let WV=!1,IV=null,dV=-1;for(let FV=0;FV<J.length-1;FV++){const NV={start:J[FV],end:J[FV+1]};if(NV.start.layer===UV.start.layer&&NV.start.layer===UV.start.layer){const eV=findIntersection(NV,UV);if(eV){WV=!0,IV={...eV,layer:VV},dV=FV;break}}}WV&&IV&&(J.splice(dV+1),J.push(IV));const CV=J[J.length-1];(CV.x!==lV[RV].x||CV.y!==lV[RV].y)&&J.push(lV[RV])}return J}function findIntersection(lV,J){if(lV.start.x===lV.end.x&&J.start.x===J.end.x||lV.start.y===lV.end.y&&J.start.y===J.end.y)return null;let VV;if(lV.start.x===lV.end.x){const RV=lV.start.x,UV=J.start.y;VV={...lV.start,x:RV,y:UV}}else{const RV=J.start.x,UV=lV.start.y;VV={...lV.start,x:RV,y:UV}}return isPointInSegment(VV,lV)&&isPointInSegment(VV,J)?VV:null}function isPointInSegment(lV,J){return lV.x>=Math.min(J.start.x,J.end.x)&&lV.x<=Math.max(J.start.x,J.end.x)&&lV.y>=Math.min(J.start.y,J.end.y)&&lV.y<=Math.max(J.start.y,J.end.y)}function addViasWhenLayerChanges(lV){const J=[lV[0]];for(let VV=1;VV<lV.length-1;VV++){const[RV,UV,ZV]=[lV[VV-1],lV[VV],lV[VV+1]];J.push(UV),!(UV.route_type!=="wire"||RV.route_type!=="wire"||ZV.route_type!=="wire")&&RV.layer===UV.layer&&UV.layer!==ZV.layer&&J.push({route_type:"via",from_layer:UV.layer,to_layer:ZV.layer,x:UV.x,y:UV.y})}return J.push(lV[lV.length-1]),J}var debug$1=Debug4("autorouting-dataset:astar"),GeneralizedAstarAutorouter=class{constructor(lV){Fd(this,"openSet",[]);Fd(this,"closedSet",new Set);Fd(this,"debug",!1);Fd(this,"debugSolutions");Fd(this,"debugMessage",null);Fd(this,"debugTraceCount",0);Fd(this,"input");Fd(this,"obstacles");Fd(this,"allObstacles");Fd(this,"startNode");Fd(this,"goalPoint");Fd(this,"GRID_STEP");Fd(this,"OBSTACLE_MARGIN");Fd(this,"MAX_ITERATIONS");Fd(this,"isRemovePathLoopsEnabled");Fd(this,"GREEDY_MULTIPLIER",1.1);Fd(this,"iterations",-1);this.input=lV.input,this.allObstacles=lV.input.obstacles,this.startNode=lV.startNode,this.goalPoint=lV.goalPoint?{l:0,...lV.goalPoint}:void 0,this.GRID_STEP=lV.GRID_STEP??.1,this.OBSTACLE_MARGIN=lV.OBSTACLE_MARGIN??.15,this.MAX_ITERATIONS=lV.MAX_ITERATIONS??100,this.debug=lV.debug??debug$1.enabled,this.isRemovePathLoopsEnabled=lV.isRemovePathLoopsEnabled??!1,this.debug&&(debug$1.enabled=!0),debug$1.enabled&&(this.debugSolutions={},this.debugMessage="")}getNeighbors(lV){return[]}isSameNode(lV,J){return manDist(lV,J)<this.GRID_STEP}computeG(lV,J){return lV.g+manDist(lV,J)}computeH(lV){return manDist(lV,this.goalPoint)}getNodeName(lV){return nodeName(lV,this.GRID_STEP)}solveOneStep(){this.iterations+=1;const{openSet:lV,closedSet:J,GRID_STEP:VV,goalPoint:RV}=this;lV.sort((IV,dV)=>IV.f-dV.f);const UV=lV.shift();if(this.computeH(UV)<=VV*2)return{solved:!0,current:UV,newNeighbors:[]};this.closedSet.add(this.getNodeName(UV));let WV=[];for(const IV of this.getNeighbors(UV)){if(J.has(this.getNodeName(IV)))continue;const dV=this.computeG(UV,IV),CV=this.openSet.find(FV=>this.isSameNode(FV,IV));if(!CV||dV<CV.g){const FV=this.computeH(IV),NV=dV+FV*this.GREEDY_MULTIPLIER,eV={...IV,g:dV,h:FV,f:NV,obstacleHit:IV.obstacleHit??void 0,manDistFromParent:manDist(UV,IV),nodesInPath:UV.nodesInPath+1,parent:UV,enterMarginCost:IV.enterMarginCost,travelMarginCostFactor:IV.travelMarginCostFactor};lV.push(eV),WV.push(eV)}}return debug$1.enabled&&(lV.sort((IV,dV)=>IV.f-dV.f),this.drawDebugSolution({current:UV,newNeighbors:WV})),{solved:!1,current:UV,newNeighbors:WV}}getStartNode(lV){return{x:lV.pointsToConnect[0].x,y:lV.pointsToConnect[0].y,manDistFromParent:0,f:0,g:0,h:0,nodesInPath:0,parent:null}}layerToIndex(lV){return 0}indexToLayer(lV){return"top"}preprocessConnectionBeforeSolving(lV){return lV}solveConnection(lV){if(lV.pointsToConnect.length>2)throw new Error("GeneralizedAstarAutorouter doesn't currently support 2+ points in a connection");lV=this.preprocessConnectionBeforeSolving(lV);const{pointsToConnect:J}=lV;for(this.iterations=0,this.closedSet=new Set,this.startNode=this.getStartNode(lV),this.goalPoint={...J[J.length-1],l:this.layerToIndex(J[J.length-1].layer)},this.openSet=[this.startNode];this.iterations<this.MAX_ITERATIONS;){const{solved:VV,current:RV}=this.solveOneStep();if(VV){let UV=[],ZV=RV;for(;ZV;){const WV=ZV.l;UV.unshift({x:ZV.x,y:ZV.y,layer:WV!==void 0?this.indexToLayer(WV):J[0].layer}),ZV=ZV.parent}return debug$1.enabled&&(this.debugMessage+=`t${this.debugTraceCount}: ${this.iterations} iterations
|
|
397
397
|
`),this.isRemovePathLoopsEnabled&&(UV=removePathLoops(UV)),{solved:!0,route:UV,connectionName:lV.name}}if(this.openSet.length===0)break}return debug$1.enabled&&(this.debugMessage+=`t${this.debugTraceCount}: ${this.iterations} iterations (failed)
|
|
398
398
|
`),{solved:!1,connectionName:lV.name}}createObstacleList({dominantLayer:lV,connection:J,obstaclesFromTraces:VV}){return new ObstacleList(this.allObstacles.filter(RV=>!RV.connectedTo.includes(J.name)).filter(RV=>RV.layers.includes(lV)).concat(VV??[]))}postprocessConnectionSolveResult(lV,J){return J}solve(){const lV=[],J=[];this.debugTraceCount=0;for(const VV of this.input.connections){const RV=VV.pointsToConnect[0].layer??"top";this.debugTraceCount+=1,this.obstacles=this.createObstacleList({dominantLayer:RV,connection:VV,obstaclesFromTraces:J});let UV=this.solveConnection(VV);UV=this.postprocessConnectionSolveResult(VV,UV),lV.push(UV),debug$1.enabled&&this.drawDebugTraceObstacles(J),UV.solved&&J.push(...getObstaclesFromRoute(UV.route.map(ZV=>({x:ZV.x,y:ZV.y,layer:ZV.layer??RV})),VV.name))}return lV}solveAndMapToTraces(){return this.solve().flatMap(J=>J.solved?[{type:"pcb_trace",pcb_trace_id:`pcb_trace_for_${J.connectionName}`,route:addViasWhenLayerChanges(J.route.map(VV=>({route_type:"wire",x:VV.x,y:VV.y,width:this.input.minTraceWidth,layer:VV.layer})))}]:[])}getDebugGroup(){const lV=`t${this.debugTraceCount}_iter[${this.iterations-1}]`;return this.iterations<30||this.iterations<100&&this.iterations%10===0||this.iterations<1e3&&this.iterations%100===0||!this.debugSolutions?lV:null}drawDebugTraceObstacles(lV){const{debugTraceCount:J,debugSolutions:VV}=this;for(const RV in VV)RV.startsWith(`t${J}_`)&&VV[RV].push(...lV.map((UV,ZV)=>({type:"pcb_smtpad",pcb_component_id:"",layer:UV.layers[0],width:UV.width,shape:"rect",x:UV.center.x,y:UV.center.y,pcb_smtpad_id:`trace_obstacle_${ZV}`,height:UV.height})))}drawDebugSolution({current:lV,newNeighbors:J}){const VV=this.getDebugGroup();if(!VV)return;const{openSet:RV,debugTraceCount:UV,debugSolutions:ZV}=this;ZV[VV]??(ZV[VV]=[]);const WV=ZV[VV];WV.push({type:"pcb_fabrication_note_text",pcb_fabrication_note_text_id:`debug_note_${lV.x}_${lV.y}`,font:"tscircuit2024",font_size:.25,text:"X"+(lV.l!==void 0?lV.l:""),pcb_component_id:"",layer:"top",anchor_position:{x:lV.x,y:lV.y},anchor_alignment:"center"});for(let IV=0;IV<RV.length;IV++){const dV=RV[IV];WV.push({type:"pcb_fabrication_note_path",pcb_component_id:"",pcb_fabrication_note_path_id:`note_path_${dV.x}_${dV.y}`,layer:"top",route:[[0,.05],[.05,0],[0,-.05],[-.05,0],[0,.05]].map(([CV,FV])=>({x:dV.x+CV,y:dV.y+FV})),stroke_width:.01}),WV.push({type:"pcb_fabrication_note_text",pcb_fabrication_note_text_id:`debug_note_${dV.x}_${dV.y}`,font:"tscircuit2024",font_size:.03,text:IV.toString(),pcb_component_id:"",layer:"top",anchor_position:{x:dV.x,y:dV.y},anchor_alignment:"center"})}if(lV.parent){const IV=[];let dV=lV;for(;dV;)IV.unshift(dV),dV=dV.parent;WV.push({type:"pcb_fabrication_note_path",pcb_component_id:"",pcb_fabrication_note_path_id:`note_path_${lV.x}_${lV.y}`,layer:"top",route:IV,stroke_width:.01})}}},debug2$1=Debug4("autorouting-dataset:infinite-grid-ijump-astar:get-distance-to-overcome-obstacle");function getDistanceToOvercomeObstacle({node:lV,travelDir:J,wallDir:VV,obstacle:RV,obstacles:UV,obstaclesInRow:ZV=0,OBSTACLE_MARGIN:WV=.15,SHOULD_DETECT_CONJOINED_OBSTACLES:IV=!1,MAX_CONJOINED_OBSTACLES:dV=20}){let CV;if(J.dx===0?J.dy>0?CV=RV.center.y+RV.height/2-lV.y:CV=lV.y-(RV.center.y-RV.height/2):J.dx>0?CV=RV.center.x+RV.width/2-lV.x:CV=lV.x-(RV.center.x-RV.width/2),CV+=WV,IV&&ZV<dV){const FV=UV.getObstacleAt(lV.x+J.dx*CV+VV.dx*(VV.wallDistance+.001),lV.y+J.dy*CV+VV.dy*(VV.wallDistance+.001));if(FV===RV)return CV;if(FV&&FV.type==="rect"){const NV=J.dy===0,eV=NV?RV.height:RV.width;if((NV?FV.height:FV.width)>eV)return debug2$1("next obstacle on path is bigger, not trying to overcome it"),CV;const nV=getDistanceToOvercomeObstacle({node:{x:lV.x+J.dx*CV,y:lV.y+J.dy*CV},travelDir:J,wallDir:VV,obstacle:FV,obstacles:UV,obstaclesInRow:ZV+1,SHOULD_DETECT_CONJOINED_OBSTACLES:IV,MAX_CONJOINED_OBSTACLES:dV,OBSTACLE_MARGIN:WV});CV+=nV}}return CV}var IJumpAutorouter=class extends GeneralizedAstarAutorouter{constructor(){super(...arguments);Fd(this,"MAX_ITERATIONS",200)}getNeighbors(J){const VV=this.obstacles,RV=this.goalPoint;let UV;J.parent?UV=dirFromAToB(J.parent,J):UV=dirFromAToB(J,RV);const ZV=[{dx:0,dy:1},{dx:1,dy:0},{dx:0,dy:-1},{dx:-1,dy:0}].filter(IV=>{var dV;return IV.dx===UV.dx*-1&&IV.dy===UV.dy*-1?!1:!(IV.dx===UV.dx&&IV.dy===UV.dy&&((dV=J.parent)!=null&&dV.obstacleHit))}).map(IV=>VV.getOrthoDirectionCollisionInfo(J,IV,{margin:this.OBSTACLE_MARGIN})).filter(IV=>IV.wallDistance>=this.OBSTACLE_MARGIN),WV=[];for(const IV of ZV){let dV=null;J!=null&&J.obstacleHit&&(dV=getDistanceToOvercomeObstacle({node:J,travelDir:IV,wallDir:{...UV,wallDistance:this.OBSTACLE_MARGIN},obstacle:J.obstacleHit,obstacles:VV,OBSTACLE_MARGIN:this.OBSTACLE_MARGIN,SHOULD_DETECT_CONJOINED_OBSTACLES:!0}));const CV=distAlongDir(J,RV,IV),FV=(IV.dx===0||Math.sign(RV.x-J.x)===IV.dx)&&(IV.dy===0||Math.sign(RV.y-J.y)===IV.dy);CV<IV.wallDistance&&CV>0&&FV?WV.push({...IV,travelDistance:CV}):dV!==null&&dV<IV.wallDistance?WV.push({...IV,travelDistance:dV}):IV.wallDistance!==1/0&&WV.push({...IV,travelDistance:IV.wallDistance-this.OBSTACLE_MARGIN})}return WV.filter(IV=>!VV.isObstacleAt(J.x+IV.dx*IV.travelDistance,J.y+IV.dy*IV.travelDistance)).map(IV=>({x:J.x+IV.dx*IV.travelDistance,y:J.y+IV.dy*IV.travelDistance,obstacleHit:IV.obstacle}))}};function generateApproximatingRects(lV,J=4){const{center:VV,width:RV,height:UV,rotation:ZV}=lV,WV=[],IV=ZV*Math.PI/180,dV=Math.cos(IV),CV=Math.sin(IV),FV=(ZV%360+360)%360;if(UV<=RV?FV>=45&&FV<135||FV>=225&&FV<315:FV>=135&&FV<225||FV>=315||FV<45){const eV=RV/J;for(let gV=0;gV<J;gV++){const nV=(gV-J/2+.5)*eV,JV=-nV*dV,aV=-nV*CV,GV=eV*1.1,YV=Math.abs(UV*dV)+Math.abs(eV*CV);WV.push({center:{x:VV.x+JV,y:VV.y+aV},width:GV,height:YV})}}else{const eV=UV/J;for(let gV=0;gV<J;gV++){const nV=(gV-J/2+.5)*eV,JV=-nV*CV,aV=nV*dV,GV=Math.abs(RV*dV)+Math.abs(eV*CV),YV=eV*1.1;WV.push({center:{x:VV.x+JV,y:VV.y+aV},width:GV,height:YV})}}return WV}var EVERY_LAYER=["top","inner1","inner2","bottom"],getObstaclesFromCircuitJson=(lV,J)=>{const VV=UV=>J?UV.concat(UV.map(ZV=>J==null?void 0:J.getNetConnectedToId(ZV)).filter(Boolean)):UV,RV=[];for(const UV of lV)if(UV.type==="pcb_smtpad"){if(UV.shape==="circle")RV.push({type:"oval",layers:[UV.layer],center:{x:UV.x,y:UV.y},width:UV.radius*2,height:UV.radius*2,connectedTo:VV([UV.pcb_smtpad_id])});else if(UV.shape==="rect")RV.push({type:"rect",layers:[UV.layer],center:{x:UV.x,y:UV.y},width:UV.width,height:UV.height,connectedTo:VV([UV.pcb_smtpad_id])});else if(UV.shape==="rotated_rect"){const ZV={center:{x:UV.x,y:UV.y},width:UV.width,height:UV.height,rotation:UV.ccw_rotation},WV=generateApproximatingRects(ZV);for(const IV of WV)RV.push({type:"rect",layers:[UV.layer],center:IV.center,width:IV.width,height:IV.height,connectedTo:VV([UV.pcb_smtpad_id])})}}else if(UV.type==="pcb_keepout")UV.shape==="circle"?RV.push({type:"oval",layers:UV.layers,center:{x:UV.center.x,y:UV.center.y},width:UV.radius*2,height:UV.radius*2,connectedTo:[]}):UV.shape==="rect"&&RV.push({type:"rect",layers:UV.layers,center:{x:UV.center.x,y:UV.center.y},width:UV.width,height:UV.height,connectedTo:[]});else if(UV.type==="pcb_hole")UV.hole_shape==="oval"?RV.push({type:"oval",center:{x:UV.x,y:UV.y},width:UV.hole_width,height:UV.hole_height,connectedTo:[]}):UV.hole_shape==="square"?RV.push({type:"rect",layers:EVERY_LAYER,center:{x:UV.x,y:UV.y},width:UV.hole_diameter,height:UV.hole_diameter,connectedTo:[]}):(UV.hole_shape==="round"||UV.hole_shape==="circle")&&RV.push({type:"rect",layers:EVERY_LAYER,center:{x:UV.x,y:UV.y},width:UV.hole_diameter,height:UV.hole_diameter,connectedTo:[]});else if(UV.type==="pcb_plated_hole")UV.shape==="circle"?RV.push({type:"oval",layers:EVERY_LAYER,center:{x:UV.x,y:UV.y},width:UV.outer_diameter,height:UV.outer_diameter,connectedTo:VV([UV.pcb_plated_hole_id])}):(UV.shape==="oval"||UV.shape==="pill")&&RV.push({type:"oval",layers:EVERY_LAYER,center:{x:UV.x,y:UV.y},width:UV.outer_width,height:UV.outer_height,connectedTo:VV([UV.pcb_plated_hole_id])});else if(UV.type==="pcb_trace"){const ZV=getObstaclesFromRoute(UV.route.map(WV=>({x:WV.x,y:WV.y,layer:"layer"in WV?WV.layer:WV.from_layer})),UV.source_trace_id);RV.push(...ZV)}else UV.type==="pcb_via"&&RV.push({type:"rect",layers:UV.layers,center:{x:UV.x,y:UV.y},connectedTo:[],width:UV.outer_diameter,height:UV.outer_diameter});return RV};function getAlternativeGoalBoxes(lV){const{pcbConnMap:J,goalElementId:VV}=lV;if(!VV.startsWith("pcb_port_"))throw new Error(`Currently alternative goal boxes must have a goal id with prefix "pcb_port_" (got ${VV})`);const RV=J.getAllTracesConnectedToPort(VV);return getObstaclesFromCircuitJson(RV).map(UV=>({...UV,connectedTo:[VV]}))}var getConnectionWithAlternativeGoalBoxes=lV=>{let{connection:J,pcbConnMap:VV}=lV;if(J.pointsToConnect.length!==2)throw new Error(`Connection must have exactly 2 points for alternative goal boxes (got ${J.pointsToConnect.length})`);const[RV,UV]=J.pointsToConnect;if(!RV.pcb_port_id||!UV.pcb_port_id)throw new Error(`Connection points must have pcb_port_id for alternative goal box calculation (got ${RV.pcb_port_id} and ${UV.pcb_port_id})`);const ZV=getAlternativeGoalBoxes({goalElementId:RV.pcb_port_id,pcbConnMap:VV}).concat([{center:RV,width:.01,height:.01,connectedTo:[RV.pcb_port_id],layers:[RV.layer],type:"rect"}]),WV=getAlternativeGoalBoxes({goalElementId:UV.pcb_port_id,pcbConnMap:VV}).concat([{center:UV,width:.01,height:.01,connectedTo:[UV.pcb_port_id],layers:[UV.layer],type:"rect"}]);if(ZV.length<=1&&WV.length<=1)return{...J,startPoint:RV,endPoint:UV,goalBoxes:[]};const IV=findNearestPointsBetweenBoxSets(ZV,WV);let dV,CV,FV;return ZV.length>=WV.length?(dV={...UV,...IV.pointB},CV={...RV,...IV.pointA},FV=ZV):(dV={...RV,...IV.pointA},CV={...UV,...IV.pointB},FV=WV),{startPoint:dV,endPoint:CV,goalBoxes:FV,name:J.name,pointsToConnect:[dV,CV]}},getSimpleRouteJson=(lV,J={})=>{const VV={minTraceWidth:.1};VV.layerCount=J.layerCount??1,VV.obstacles=getObstaclesFromCircuitJson(lV,J.connMap),VV.connections=[];for(const UV of lV)if(UV.type==="source_trace"){let ZV={name:UV.source_trace_id,pointsToConnect:UV.connected_source_port_ids.map(WV=>{var dV;const IV=distExports$4.su(lV).pcb_port.getWhere({source_port_id:WV});if(!IV)throw new Error(`Could not find pcb_port for source_port_id "${WV}"`);return{x:IV.x,y:IV.y,layer:((dV=IV.layers)==null?void 0:dV[0])??"top",pcb_port_id:IV.pcb_port_id}})};if(J.optimizeWithGoalBoxes){const WV=new PcbConnectivityMap(lV);ZV=getConnectionWithAlternativeGoalBoxes({connection:ZV,pcbConnMap:WV})}VV.connections.push(ZV),markObstaclesAsConnected(VV.obstacles,ZV.pointsToConnect,ZV.name)}const RV={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};for(const UV of VV.obstacles)RV.minX=Math.min(RV.minX,UV.center.x-UV.width/2),RV.maxX=Math.max(RV.maxX,UV.center.x+UV.width/2),RV.minY=Math.min(RV.minY,UV.center.y-UV.height/2),RV.maxY=Math.max(RV.maxY,UV.center.y+UV.height/2);for(const UV of VV.connections)for(const ZV of UV.pointsToConnect)RV.minX=Math.min(RV.minX,ZV.x),RV.maxX=Math.max(RV.maxX,ZV.x),RV.minY=Math.min(RV.minY,ZV.y),RV.maxY=Math.max(RV.maxY,ZV.y);return VV.bounds=RV,VV},markObstaclesAsConnected=(lV,J,VV)=>{for(const RV of J)for(const UV of lV)isPointInsideObstacle(RV,UV)&&UV.connectedTo.push(VV)};function isPointInsideObstacle(lV,J){const VV=J.width/2,RV=J.height/2;if(J.type==="rect")return lV.x>=J.center.x-VV&&lV.x<=J.center.x+VV&&lV.y>=J.center.y-RV&&lV.y<=J.center.y+RV;if(J.type==="oval"){const UV=(lV.x-J.center.x)/VV,ZV=(lV.y-J.center.y)/RV;return UV*UV+ZV*ZV<=1}return!1}function dirFromAToB2(lV,J){const VV=J.x>lV.x?1:J.x<lV.x?-1:0,RV=J.y>lV.y?1:J.y<lV.y?-1:0,UV=J.l>lV.l?1:J.l<lV.l?-1:0;return{dx:VV,dy:RV,dl:UV}}var LAYER_COUNT_INDEX_MAP={1:["top"],2:["top","bottom"],4:["top","inner1","inner2","bottom"]},getLayerNamesForLayerCount=lV=>LAYER_COUNT_INDEX_MAP[lV];function getLayerIndex(lV,J){const RV=LAYER_COUNT_INDEX_MAP[lV].indexOf(J);if(RV===-1)throw new Error(`Invalid layer for getLayerIndex (for layerCount === ${lV}): "${J}"`);return RV}function indexToLayer(lV,J){const RV=LAYER_COUNT_INDEX_MAP[lV][J];if(!RV)throw new Error(`Invalid index for indexToLayer (for layerCount === ${lV}): "${J}"`);return RV}var ObstacleList3d=class extends ObstacleList{constructor(J,VV){super([]);Fd(this,"obstacles");Fd(this,"GRID_STEP",.1);Fd(this,"layerCount");this.layerCount=J;const RV=getLayerNamesForLayerCount(J);this.obstacles=VV.flatMap(UV=>UV.layers.filter(ZV=>RV.includes(ZV)).map(ZV=>({...UV,left:UV.center.x-UV.width/2,right:UV.center.x+UV.width/2,top:UV.center.y+UV.height/2,bottom:UV.center.y-UV.height/2,l:getLayerIndex(J,ZV)})))}getObstacleAt(J,VV,RV,UV){UV??(UV=this.GRID_STEP);for(const ZV of this.obstacles){if(ZV.l!==RV)continue;const WV=ZV.width/2+UV,IV=ZV.height/2+UV;if(J>=ZV.center.x-WV&&J<=ZV.center.x+WV&&VV>=ZV.center.y-IV&&VV<=ZV.center.y+IV)return ZV}return null}isObstacleAt(J,VV,RV,UV){return this.getObstacleAt(J,VV,RV,UV)!==null}getDirectionDistancesToNearestObstacle3d(J,VV,RV){const{GRID_STEP:UV}=this,ZV={left:1/0,top:1/0,bottom:1/0,right:1/0};for(const WV of this.obstacles)if(WV.l===RV&&WV.type==="rect"){const IV=WV.center.x-WV.width/2-UV,dV=WV.center.x+WV.width/2+UV,CV=WV.center.y+WV.height/2+UV,FV=WV.center.y-WV.height/2-UV;VV>=FV&&VV<=CV&&J>IV&&(ZV.left=Math.min(ZV.left,J-dV)),VV>=FV&&VV<=CV&&J<dV&&(ZV.right=Math.min(ZV.right,IV-J)),J>=IV&&J<=dV&&VV<CV&&(ZV.top=Math.min(ZV.top,FV-VV)),J>=IV&&J<=dV&&VV>FV&&(ZV.bottom=Math.min(ZV.bottom,VV-CV))}return ZV}getOrthoDirectionCollisionInfo(J,VV,{margin:RV=0}={}){const{x:UV,y:ZV,l:WV}=J,{dx:IV,dy:dV,dl:CV}=VV;let FV=1/0,NV=null;if(CV!==0){const eV=WV+CV;return this.isObstacleAt(UV,ZV,eV,RV)?(FV=1,NV=this.getObstacleAt(UV,ZV,eV,RV)):FV=1,{dx:IV,dy:dV,dl:CV,wallDistance:FV,obstacle:NV}}else{for(const eV of this.obstacles){if(eV.l!==WV)continue;const gV=eV.left-RV,nV=eV.right+RV,JV=eV.top+RV,aV=eV.bottom-RV;let GV=null;IV===1&&dV===0?ZV>aV&&ZV<JV&&UV<eV.left&&(GV=eV.left-UV):IV===-1&&dV===0?ZV>aV&&ZV<JV&&UV>eV.right&&(GV=UV-eV.right):IV===0&&dV===1?UV>gV&&UV<nV&&ZV<eV.bottom&&(GV=eV.bottom-ZV):IV===0&&dV===-1&&UV>gV&&UV<nV&&ZV>eV.top&&(GV=ZV-eV.top),GV!==null&&GV<FV&&(FV=GV,NV=eV)}return{dx:IV,dy:dV,dl:0,wallDistance:FV,obstacle:NV}}}getObstaclesOverlappingRegion(J){const VV=[];for(const RV of this.obstacles){if(RV.l!==J.l)continue;const{left:UV,right:ZV,top:WV,bottom:IV}=RV;UV<=J.maxX&&ZV>=J.minX&&WV>=J.minY&&IV<=J.maxY&&VV.push(RV)}return VV}},MultilayerIjump=class extends GeneralizedAstarAutorouter{constructor(J){super(J);Fd(this,"MAX_ITERATIONS",500);Fd(this,"VIA_COST",4);Fd(this,"VIA_DIAMETER",.5);Fd(this,"allowLayerChange",!0);Fd(this,"layerCount");Fd(this,"obstacles");Fd(this,"optimizeWithGoalBoxes");Fd(this,"connMap");Fd(this,"pcbConnMap");Fd(this,"GOAL_RUSH_FACTOR",1.1);Fd(this,"defaultGoalViaMargin",.5);Fd(this,"marginsWithCosts");this.layerCount=J.input.layerCount??2,this.VIA_COST=J.VIA_COST??this.VIA_COST,this.connMap=J.connMap,this.pcbConnMap=J.pcbConnMap??new PcbConnectivityMap,this.optimizeWithGoalBoxes=J.optimizeWithGoalBoxes??!1,this.obstacles=null,this.marginsWithCosts=[{margin:1,enterCost:0,travelCostFactor:1},{margin:this.OBSTACLE_MARGIN,enterCost:10,travelCostFactor:2}]}get largestMargin(){return this.marginsWithCosts[0].margin}preprocessConnectionBeforeSolving(J){return this.optimizeWithGoalBoxes?getConnectionWithAlternativeGoalBoxes({connection:J,pcbConnMap:this.pcbConnMap}):J}postprocessConnectionSolveResult(J,VV){if(!VV.solved)return VV;if(this.optimizeWithGoalBoxes){const RV=VV.route.map(UV=>({x:UV.x,y:UV.y,route_type:"wire",layer:UV.layer,width:this.input.minTraceWidth}));RV[0].start_pcb_port_id=J.pointsToConnect[0].pcb_port_id,RV[RV.length-1].end_pcb_port_id=J.pointsToConnect[1].pcb_port_id,this.pcbConnMap.addTrace({type:"pcb_trace",pcb_trace_id:`postprocess_trace_${nanoid$1(8)}`,route:RV})}return VV}createObstacleList({dominantLayer:J,connection:VV,obstaclesFromTraces:RV}){const UV=this.connMap?this.connMap.getNetConnectedToId(VV.name):VV.name;if(!UV)throw new Error(`The connection.name "${VV.name}" wasn't present in the full connectivity map`);return new ObstacleList3d(this.layerCount,this.allObstacles.filter(ZV=>!ZV.connectedTo.includes(UV)).concat(RV??[]))}computeG(J,VV){let RV=J.g+manDist(J,VV)*(J.travelMarginCostFactor??1)+(VV.enterMarginCost??0);return(VV.l??J.l!==-1??-1)&&(RV+=this.VIA_COST),RV}computeH(J){const VV=Math.abs(J.x-this.goalPoint.x),RV=Math.abs(J.y-this.goalPoint.y),UV=Math.abs(J.l-this.goalPoint.l);return(VV+RV)**this.GOAL_RUSH_FACTOR+UV*this.VIA_COST}getStartNode(J){return{...super.getStartNode(J),l:this.layerToIndex(J.pointsToConnect[0].layer)}}layerToIndex(J){return getLayerIndex(this.layerCount,J)}indexToLayer(J){return indexToLayer(this.layerCount,J)}getNodeName(J){return`${nodeName(J,this.GRID_STEP)}-${J.l??0}`}hasSpaceForVia(J,VV){return J.every(RV=>this.obstacles.getObstaclesOverlappingRegion({minX:VV.x-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,minY:VV.y-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,maxX:VV.x+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,maxY:VV.y+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,l:RV}).length===0)}getNeighborsSurroundingGoal(J){this.obstacles;const VV=this.goalPoint,RV=[],UV=[{dx:1,dy:0,dl:0},{dx:-1,dy:0,dl:0},{dx:0,dy:1,dl:0},{dx:0,dy:-1,dl:0}],ZV=this.VIA_DIAMETER+this.OBSTACLE_MARGIN+this.defaultGoalViaMargin;for(const WV of UV){const IV={x:J.x+WV.dx*ZV,y:J.y+WV.dy*ZV,l:J.l+WV.dl,obstacleHit:null};this.hasSpaceForVia([J.l,VV.l],IV)&&RV.push(IV)}return RV}getNeighbors(J){const VV=this.obstacles,RV=this.goalPoint,UV=manDist(J,RV);if(UV<=this.OBSTACLE_MARGIN)return this.getNeighborsSurroundingGoal(J);let ZV;J.parent?ZV=dirFromAToB2(J.parent,J):ZV=dirFromAToB2(J,RV);const WV=[{dx:0,dy:1,dl:0},{dx:1,dy:0,dl:0},{dx:0,dy:-1,dl:0},{dx:-1,dy:0,dl:0}],IV=UV>this.VIA_DIAMETER+this.OBSTACLE_MARGIN,dV=manDist(J,this.startNode)>this.VIA_DIAMETER+this.OBSTACLE_MARGIN;this.allowLayerChange&&IV&&dV&&(J.l<this.layerCount-1&&WV.push({dx:0,dy:0,dl:1}),J.l>0&&WV.push({dx:0,dy:0,dl:-1}));const CV=WV.filter(NV=>{var eV;return NV.dx===ZV.dx*-1&&NV.dy===ZV.dy*-1&&NV.dl===ZV.dl*-1?!1:!(NV.dx===ZV.dx&&NV.dy===ZV.dy&&NV.dl===ZV.dl&&((eV=J.parent)!=null&&eV.obstacleHit))}).map(NV=>VV.getOrthoDirectionCollisionInfo(J,NV,{margin:this.OBSTACLE_MARGIN})).filter(NV=>!(NV.wallDistance<this.OBSTACLE_MARGIN)),FV=[];for(const NV of CV){const eV=NV.dx===0&&NV.dy===0&&NV.dl===1,gV=NV.dx===0&&NV.dy===0&&NV.dl===-1;if((eV||gV)&&![J.l,J.l+NV.dl].every(YV=>VV.getObstaclesOverlappingRegion({minX:J.x-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,minY:J.y-this.VIA_DIAMETER/2-this.OBSTACLE_MARGIN,maxX:J.x+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,maxY:J.y+this.VIA_DIAMETER/2+this.OBSTACLE_MARGIN,l:YV}).length===0))continue;if(eV){J.l<this.layerCount-1&&FV.push({...NV,travelDistance:0,enterMarginCost:0,travelMarginCostFactor:1});continue}if(gV){J.l>0&&FV.push({...NV,travelDistance:0,enterMarginCost:0,travelMarginCostFactor:1});continue}let nV=null;J!=null&&J.obstacleHit&&(nV=getDistanceToOvercomeObstacle({node:J,travelDir:NV,wallDir:{...ZV,wallDistance:this.OBSTACLE_MARGIN},obstacle:J.obstacleHit,obstacles:VV,OBSTACLE_MARGIN:this.OBSTACLE_MARGIN,SHOULD_DETECT_CONJOINED_OBSTACLES:!0}));const JV=distAlongDir(J,RV,NV),aV=(NV.dx===0||Math.sign(RV.x-J.x)===NV.dx)&&(NV.dy===0||Math.sign(RV.y-J.y)===NV.dy);if(JV<NV.wallDistance&&JV>0&&aV){const GV=J.l===RV.l;let YV=0;!GV&&Math.abs(JV-UV)<this.GRID_STEP&&(YV=this.VIA_DIAMETER+this.OBSTACLE_MARGIN+this.defaultGoalViaMargin),FV.push({...NV,travelDistance:JV-YV,enterMarginCost:0,travelMarginCostFactor:1})}else if(nV!==null&&nV<NV.wallDistance){for(const{margin:GV,enterCost:YV,travelCostFactor:tV}of this.marginsWithCosts)nV-this.OBSTACLE_MARGIN+GV*2<NV.wallDistance&&FV.push({...NV,travelDistance:nV-this.OBSTACLE_MARGIN+GV,enterMarginCost:YV,travelMarginCostFactor:tV});if(NV.wallDistance===1/0)FV.push({...NV,travelDistance:JV,enterMarginCost:0,travelMarginCostFactor:1});else if(NV.wallDistance>this.largestMargin)for(const{margin:GV,enterCost:YV,travelCostFactor:tV}of this.marginsWithCosts)NV.wallDistance>this.largestMargin+GV&&FV.push({...NV,travelDistance:NV.wallDistance-GV,enterMarginCost:YV,travelMarginCostFactor:tV})}else if(NV.wallDistance!==1/0)for(const{margin:GV,enterCost:YV,travelCostFactor:tV}of this.marginsWithCosts)NV.wallDistance>GV&&FV.push({...NV,travelDistance:NV.wallDistance-GV,enterMarginCost:YV,travelMarginCostFactor:tV})}return FV.map(NV=>({x:J.x+NV.dx*NV.travelDistance,y:J.y+NV.dy*NV.travelDistance,l:J.l+NV.dl,obstacleHit:NV.obstacle,travelMarginCostFactor:NV.travelMarginCostFactor,enterMarginCost:NV.enterMarginCost}))}};function autoroute2(lV){const J=getSimpleRouteJson(lV),VV=new IJumpAutorouter({input:J});return{solution:VV.solveAndMapToTraces(),debugSolutions:VV.debugSolutions,debugMessage:VV.debugMessage}}var getObstaclesFromSoup=getObstaclesFromCircuitJson,direction$1=z$1.enum(["up","down","left","right"]);z$1.enum(["top-to-bottom","left-to-right","bottom-to-top","right-to-left"]);var portHints=z$1.array(z$1.string().or(z$1.number())),point3$1=z$1.object({x:distance$3,y:distance$3,z:distance$3}),rotationPoint3=z$1.object({x:z$1.union([z$1.number(),z$1.string()]),y:z$1.union([z$1.number(),z$1.string()]),z:z$1.union([z$1.number(),z$1.string()])}),cadModelBase=z$1.object({rotationOffset:z$1.number().or(rotationPoint3).optional(),positionOffset:point3$1.optional(),size:point3$1.optional()}),cadModelStl=cadModelBase.extend({stlUrl:z$1.string()}),cadModelObj=cadModelBase.extend({objUrl:z$1.string(),mtlUrl:z$1.string().optional()}),cadModelJscad=cadModelBase.extend({jscad:z$1.record(z$1.any())}),cadModelProp=z$1.union([z$1.string(),cadModelStl,cadModelObj,cadModelJscad]),footprintProp=z$1.custom(lV=>!0),pcbLayoutProps=z$1.object({pcbX:distance$3.optional(),pcbY:distance$3.optional(),pcbRotation:rotation$3.optional(),layer:layer_ref$1.optional()}),commonLayoutProps=z$1.object({pcbX:distance$3.optional(),pcbY:distance$3.optional(),pcbRotation:rotation$3.optional(),schX:distance$3.optional(),schY:distance$3.optional(),schRotation:rotation$3.optional(),layer:layer_ref$1.optional(),footprint:footprintProp.optional()}),supplierProps=z$1.object({supplierPartNumbers:z$1.record(supplier_name$1,z$1.array(z$1.string())).optional()}),commonComponentProps=commonLayoutProps.merge(supplierProps).extend({key:z$1.any().optional(),name:z$1.string(),cadModel:cadModelProp.optional(),children:z$1.any().optional(),symbolName:z$1.string().optional()}),lrPins=["pin1","left","pin2","right"],lrPolarPins=["pin1","left","anode","pos","pin2","right","cathode","neg"];distance$3.or(z$1.enum(["2x","3x","4x"]));var explicitPinSideDefinition=z$1.object({pins:z$1.array(z$1.union([z$1.number(),z$1.string()])),direction:z$1.union([z$1.literal("top-to-bottom"),z$1.literal("left-to-right"),z$1.literal("bottom-to-top"),z$1.literal("right-to-left")])}),schematicPortArrangement=z$1.object({leftSize:z$1.number().optional().describe("@deprecated, use leftPinCount"),topSize:z$1.number().optional().describe("@deprecated, use topPinCount"),rightSize:z$1.number().optional().describe("@deprecated, use rightPinCount"),bottomSize:z$1.number().optional().describe("@deprecated, use bottomPinCount"),leftPinCount:z$1.number().optional(),rightPinCount:z$1.number().optional(),topPinCount:z$1.number().optional(),bottomPinCount:z$1.number().optional(),leftSide:explicitPinSideDefinition.optional(),rightSide:explicitPinSideDefinition.optional(),topSide:explicitPinSideDefinition.optional(),bottomSide:explicitPinSideDefinition.optional()}),schematicPinStyle=z$1.record(z$1.object({leftMargin:distance$3.optional(),rightMargin:distance$3.optional(),topMargin:distance$3.optional(),bottomMargin:distance$3.optional()})),point$1=z$1.object({x:distance$3,y:distance$3}),autorouterConfig=z$1.object({serverUrl:z$1.string().optional(),inputFormat:z$1.enum(["simplified","circuit-json"]).optional(),serverMode:z$1.enum(["job","solve-endpoint"]).optional(),cache:z$1.custom(lV=>!0).optional()}),autorouterProp=z$1.union([autorouterConfig,z$1.literal("sequential-trace"),z$1.literal("subcircuit"),z$1.literal("auto"),z$1.literal("auto-local"),z$1.literal("auto-cloud")]),baseGroupProps=commonLayoutProps.extend({name:z$1.string().optional(),children:z$1.any().optional()}),subcircuitGroupProps=baseGroupProps.extend({layout:z$1.custom(lV=>!0).optional(),manualEdits:z$1.custom(lV=>!0).optional(),schAutoLayoutEnabled:z$1.boolean().optional(),routingDisabled:z$1.boolean().optional(),defaultTraceWidth:length$3.optional(),minTraceWidth:length$3.optional(),partsEngine:z$1.custom(lV=>"findPart"in lV).optional(),pcbRouteCache:z$1.custom(lV=>!0).optional(),autorouter:autorouterProp.optional()}),subcircuitGroupPropsWithBool=subcircuitGroupProps.extend({subcircuit:z$1.literal(!0)}),groupProps=z$1.discriminatedUnion("subcircuit",[baseGroupProps.extend({subcircuit:z$1.literal(!1).optional()}),subcircuitGroupPropsWithBool]),boardProps=subcircuitGroupProps.extend({width:distance$3.optional(),height:distance$3.optional(),outline:z$1.array(point$1).optional()});z$1.record(z$1.number().or(z$1.string()),z$1.string().or(z$1.array(z$1.string()).readonly()).or(z$1.array(z$1.string())));var chipProps=commonComponentProps.extend({manufacturerPartNumber:z$1.string().optional(),pinLabels:z$1.record(z$1.number().or(z$1.string()),z$1.string().or(z$1.array(z$1.string()).readonly())).optional(),schPortArrangement:schematicPortArrangement.optional(),schPinStyle:schematicPinStyle.optional(),schPinSpacing:distance$3.optional(),schWidth:distance$3.optional(),schHeight:distance$3.optional()}),jumperProps=commonComponentProps.extend({manufacturerPartNumber:z$1.string().optional(),pinLabels:z$1.record(z$1.number().or(z$1.string()),z$1.string().or(z$1.array(z$1.string()))).optional(),schPinStyle:schematicPinStyle.optional(),schPinSpacing:distance$3.optional(),schWidth:distance$3.optional(),schHeight:distance$3.optional(),schDirection:z$1.enum(["left","right"]).optional(),schPortArrangement:schematicPortArrangement.optional()}),platedHoleProps=z$1.discriminatedUnion("shape",[pcbLayoutProps.omit({pcbRotation:!0,layer:!0}).extend({name:z$1.string().optional(),shape:z$1.literal("circle"),holeDiameter:distance$3,outerDiameter:distance$3,portHints:portHints.optional()}),pcbLayoutProps.omit({pcbRotation:!0,layer:!0}).extend({name:z$1.string().optional(),shape:z$1.literal("oval"),outerWidth:distance$3,outerHeight:distance$3,innerWidth:distance$3,innerHeight:distance$3,portHints:portHints.optional()}),pcbLayoutProps.omit({pcbRotation:!0,layer:!0}).extend({name:z$1.string().optional(),shape:z$1.literal("pill"),outerWidth:distance$3,outerHeight:distance$3,innerWidth:distance$3,innerHeight:distance$3,portHints:portHints.optional()})]),resistorProps=commonComponentProps.extend({resistance:resistance$1,pullupFor:z$1.string().optional(),pullupTo:z$1.string().optional(),pulldownFor:z$1.string().optional(),pulldownTo:z$1.string().optional()}),resistorPins=lrPins,potentiometerProps=commonComponentProps.extend({maxResistance:resistance$1}),crystalProps=commonComponentProps.extend({frequency,loadCapacitance:capacitance$1}),capacitorProps=commonComponentProps.extend({capacitance:capacitance$1,polarized:z$1.boolean().optional().default(!1),decouplingFor:z$1.string().optional(),decouplingTo:z$1.string().optional(),bypassFor:z$1.string().optional(),bypassTo:z$1.string().optional()}),capacitorPins=lrPolarPins;z$1.object({name:z$1.string()}),z$1.object({name:z$1.string().optional(),pcbOnly:z$1.boolean().optional(),schOnly:z$1.boolean().optional()});var pcbXDistConstraintProps=z$1.object({pcb:z$1.literal(!0).optional(),xDist:distance$3,left:z$1.string(),right:z$1.string(),edgeToEdge:z$1.literal(!0).optional(),centerToCenter:z$1.literal(!0).optional()}),pcbYDistConstraintProps=z$1.object({pcb:z$1.literal(!0).optional(),yDist:distance$3,top:z$1.string(),bottom:z$1.string(),edgeToEdge:z$1.literal(!0).optional(),centerToCenter:z$1.literal(!0).optional()}),pcbSameYConstraintProps=z$1.object({pcb:z$1.literal(!0).optional(),sameY:z$1.literal(!0).optional(),for:z$1.array(z$1.string())}),pcbSameXConstraintProps=z$1.object({pcb:z$1.literal(!0).optional(),sameX:z$1.literal(!0).optional(),for:z$1.array(z$1.string())}),constraintProps=z$1.union([pcbXDistConstraintProps,pcbYDistConstraintProps,pcbSameYConstraintProps,pcbSameXConstraintProps]),rectSmtPadProps=pcbLayoutProps.omit({pcbRotation:!0}).extend({shape:z$1.literal("rect"),width:distance$3,height:distance$3,portHints:portHints.optional()}),rotatedRectSmtPadProps=pcbLayoutProps.omit({pcbRotation:!0}).extend({shape:z$1.literal("rotated_rect"),width:distance$3,height:distance$3,ccwRotation:z$1.number(),portHints:portHints.optional()}),circleSmtPadProps=pcbLayoutProps.omit({pcbRotation:!0}).extend({shape:z$1.literal("circle"),radius:distance$3,portHints:portHints.optional()}),smtPadProps=z$1.union([circleSmtPadProps,rectSmtPadProps,rotatedRectSmtPadProps]),rectSolderPasteProps=pcbLayoutProps.omit({pcbRotation:!0}).extend({shape:z$1.literal("rect"),width:distance$3,height:distance$3}),circleSolderPasteProps=pcbLayoutProps.omit({pcbRotation:!0}).extend({shape:z$1.literal("circle"),radius:distance$3});z$1.union([circleSolderPasteProps,rectSolderPasteProps]);var holeProps=pcbLayoutProps.omit({pcbRotation:!0}).extend({name:z$1.string().optional(),diameter:distance$3.optional(),radius:distance$3.optional()}).transform(lV=>({...lV,diameter:lV.diameter??2*lV.radius,radius:lV.radius??lV.diameter/2})),portRef=z$1.union([z$1.string(),z$1.custom(lV=>!!lV.getPortSelector)]),baseTraceProps=z$1.object({key:z$1.string().optional(),thickness:distance$3.optional(),schematicRouteHints:z$1.array(point$1).optional(),pcbRouteHints:z$1.array(route_hint_point$1).optional(),schDisplayLabel:z$1.string().optional()}),traceProps=z$1.union([baseTraceProps.extend({path:z$1.array(portRef)}),baseTraceProps.extend({from:portRef,to:portRef})]),footprintProps=z$1.object({originalLayer:layer_ref$1.default("top").optional()}),capacity=z$1.number().or(z$1.string().endsWith("mAh")).transform(lV=>{if(typeof lV=="string"){const J=lV.replace("mAh",""),VV=Number.parseFloat(J);if(Number.isNaN(VV))throw new Error("Invalid capacity");return VV}return lV}).describe("Battery capacity in mAh"),batteryProps=commonComponentProps.extend({capacity:capacity.optional()}),pinHeaderProps=commonComponentProps.extend({pinCount:z$1.number(),pitch:distance$3.optional(),gender:z$1.enum(["male","female"]).optional().default("male"),showSilkscreenPinLabels:z$1.boolean().optional(),doubleRow:z$1.boolean().optional(),holeDiameter:distance$3.optional(),platedDiameter:distance$3.optional(),pinLabels:z$1.array(z$1.string()).optional(),facingDirection:z$1.enum(["left","right"]).optional()}),netAliasProps=z$1.object({net:z$1.string().optional(),schX:distance$3.optional(),schY:distance$3.optional(),schRotation:rotation$3.optional(),anchorSide:z$1.enum(["left","up","right","down"]).optional()}),pushButtonProps=commonComponentProps.extend({}),inductorProps=commonComponentProps.extend({inductance:inductance$1}),diodeProps=commonComponentProps.extend({}),diodePins=lrPolarPins,ledProps=commonComponentProps.extend({color:z$1.string().optional()}),ledPins=lrPolarPins;commonComponentProps.extend({ftype:z$1.literal("switch"),switchType:z$1.enum(["spst"]).default("spst"),isNormallyClosed:z$1.boolean().default(!1)}),distance$3.or(z$1.enum(["2x","3x","4x"]));var viaProps=commonLayoutProps.extend({fromLayer:layer_ref$1,toLayer:layer_ref$1,holeDiameter:distance$3,outerDiameter:distance$3}),pcbKeepoutProps=z$1.union([pcbLayoutProps.omit({pcbRotation:!0}).extend({shape:z$1.literal("circle"),radius:distance$3}),pcbLayoutProps.extend({shape:z$1.literal("rect"),width:distance$3,height:distance$3})]);z$1.object({schX:distance$3,schY:distance$3,width:distance$3,height:distance$3}),z$1.object({schX:distance$3,schY:distance$3,text:z$1.string()}),z$1.object({x1:distance$3,y1:distance$3,x2:distance$3,y2:distance$3}),z$1.object({points:z$1.array(point$2),isFilled:z$1.boolean().optional().default(!1),fillColor:z$1.enum(["red","blue"]).optional()});var powerSourceProps=commonComponentProps.extend({voltage:voltage$1});commonLayoutProps.extend({name:z$1.string(),pinNumber:z$1.number().optional(),aliases:z$1.array(z$1.string()).optional(),direction:direction$1});var silkscreenTextProps=pcbLayoutProps.extend({text:z$1.string(),anchorAlignment:z$1.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),font:z$1.enum(["tscircuit2024"]).optional(),fontSize:length$3.optional()}),silkscreenPathProps=pcbLayoutProps.omit({pcbX:!0,pcbY:!0,pcbRotation:!0}).extend({route:z$1.array(route_hint_point$1),strokeWidth:length$3.optional()});pcbLayoutProps.omit({pcbX:!0,pcbY:!0,pcbRotation:!0}).extend({strokeWidth:distance$3,x1:distance$3,y1:distance$3,x2:distance$3,y2:distance$3});var silkscreenRectProps=pcbLayoutProps.omit({pcbRotation:!0}).extend({isFilled:z$1.boolean().optional(),isOutline:z$1.boolean().optional(),strokeWidth:distance$3.optional(),width:distance$3,height:distance$3}),silkscreenCircleProps=pcbLayoutProps.omit({pcbRotation:!0}).extend({isFilled:z$1.boolean().optional(),isOutline:z$1.boolean().optional(),strokeWidth:distance$3.optional(),radius:distance$3}),routeHintPointProps=z$1.object({x:distance$3,y:distance$3,via:z$1.boolean().optional(),toLayer:layer_ref$1.optional()}),traceHintProps=z$1.object({for:z$1.string().optional().describe("Selector for the port you're targeting, not required if you're inside a trace"),order:z$1.number().optional(),offset:route_hint_point$1.or(routeHintPointProps).optional(),offsets:z$1.array(route_hint_point$1).or(z$1.array(routeHintPointProps)).optional(),traceWidth:z$1.number().optional()});z$1.object({layer:z$1.string().optional(),thickness:distance$3.optional(),route:z$1.array(route_hint_point$1)});var fabricationNoteTextProps=pcbLayoutProps.extend({text:z$1.string(),anchorAlignment:z$1.enum(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),font:z$1.enum(["tscircuit2024"]).optional(),fontSize:length$3.optional(),color:z$1.string().optional()}),fabricationNotePathProps=pcbLayoutProps.omit({pcbX:!0,pcbY:!0,pcbRotation:!0}).extend({route:z$1.array(route_hint_point$1),strokeWidth:length$3.optional(),color:z$1.string().optional()});function createMap(){return new IndexedMap}class IndexedMap{constructor(){Fd(this,"index",{});Fd(this,"array",[])}size(){return this.array.length}empty(){return this.array.length===0}itemAt(J){return this.array[J]}contains(J){return this.index[J.id()]!==void 0}find(J){const VV=this.index[J.id()];return VV===void 0?void 0:this.array[VV]}setDefault(J,VV){const RV=this.index[J.id()];if(RV===void 0){const UV=new Pair(J,VV());return this.index[J.id()]=this.array.length,this.array.push(UV),UV}else return this.array[RV]}insert(J,VV){const RV=new Pair(J,VV),UV=this.index[J.id()];return UV===void 0?(this.index[J.id()]=this.array.length,this.array.push(RV)):this.array[UV]=RV,RV}erase(J){const VV=this.index[J.id()];if(VV===void 0)return;this.index[J.id()]=void 0;const RV=this.array[VV],UV=this.array.pop();return RV!==UV&&(this.array[VV]=UV,this.index[UV.first.id()]=VV),RV}copy(){const J=new IndexedMap;for(let VV=0;VV<this.array.length;VV++){const RV=this.array[VV].copy();J.array[VV]=RV,J.index[RV.first.id()]=VV}return J}}class Pair{constructor(J,VV){Fd(this,"first");Fd(this,"second");this.first=J,this.second=VV}copy(){return new Pair(this.first,this.second)}}class Variable{constructor(J=""){Fd(this,"_name");Fd(this,"_value",0);Fd(this,"_context",null);Fd(this,"_id",VarId++);this._name=J}id(){return this._id}name(){return this._name}setName(J){this._name=J}context(){return this._context}setContext(J){this._context=J}value(){return this._value}setValue(J){this._value=J}plus(J){return new Expression(this,J)}minus(J){return new Expression(this,typeof J=="number"?-J:[-1,J])}multiply(J){return new Expression([J,this])}divide(J){return new Expression([1/J,this])}toJSON(){return{name:this._name,value:this._value}}toString(){return this._context+"["+this._name+":"+this._value+"]"}}let VarId=0;class Expression{constructor(){Fd(this,"_terms");Fd(this,"_constant");let J=parseArgs(arguments);this._terms=J.terms,this._constant=J.constant}terms(){return this._terms}constant(){return this._constant}value(){let J=this._constant;for(let VV=0,RV=this._terms.size();VV<RV;VV++){let UV=this._terms.itemAt(VV);J+=UV.first.value()*UV.second}return J}plus(J){return new Expression(this,J)}minus(J){return new Expression(this,typeof J=="number"?-J:[-1,J])}multiply(J){return new Expression([J,this])}divide(J){return new Expression([1/J,this])}isConstant(){return this._terms.size()==0}toString(){let J=this._terms.array.map(function(VV){return VV.second+"*"+VV.first.toString()}).join(" + ");return!this.isConstant()&&this._constant!==0&&(J+=" + "),J+=this._constant,J}}function parseArgs(lV){let J=0,VV=()=>0,RV=createMap();for(let UV=0,ZV=lV.length;UV<ZV;++UV){let WV=lV[UV];if(typeof WV=="number")J+=WV;else if(WV instanceof Variable)RV.setDefault(WV,VV).second+=1;else if(WV instanceof Expression){J+=WV.constant();let IV=WV.terms();for(let dV=0,CV=IV.size();dV<CV;dV++){let FV=IV.itemAt(dV);RV.setDefault(FV.first,VV).second+=FV.second}}else if(WV instanceof Array){if(WV.length!==2)throw new Error("array must have length 2");let IV=WV[0],dV=WV[1];if(typeof IV!="number")throw new Error("array item 0 must be a number");if(dV instanceof Variable)RV.setDefault(dV,VV).second+=IV;else if(dV instanceof Expression){J+=dV.constant()*IV;let CV=dV.terms();for(let FV=0,NV=CV.size();FV<NV;FV++){let eV=CV.itemAt(FV);RV.setDefault(eV.first,VV).second+=eV.second*IV}}else throw new Error("array item 1 must be a variable or expression")}else throw new Error("invalid Expression argument: "+WV)}return{terms:RV,constant:J}}const qk=class qk{static create(J,VV,RV,UV=1){let ZV=0;return ZV+=Math.max(0,Math.min(1e3,J*UV))*1e6,ZV+=Math.max(0,Math.min(1e3,VV*UV))*1e3,ZV+=Math.max(0,Math.min(1e3,RV*UV)),ZV}static clip(J){return Math.max(0,Math.min(qk.required,J))}};Fd(qk,"required",qk.create(1e3,1e3,1e3)),Fd(qk,"strong",qk.create(1,0,0)),Fd(qk,"medium",qk.create(0,1,0)),Fd(qk,"weak",qk.create(0,0,1));let Strength=qk;var Operator;(function(lV){lV[lV.Le=0]="Le",lV[lV.Ge=1]="Ge",lV[lV.Eq=2]="Eq"})(Operator||(Operator={}));class Constraint{constructor(J,VV,RV,UV=Strength.required){Fd(this,"_expression");Fd(this,"_operator");Fd(this,"_strength");Fd(this,"_id",CnId++);this._operator=VV,this._strength=Strength.clip(UV),RV===void 0&&J instanceof Expression?this._expression=J:this._expression=J.minus(RV)}id(){return this._id}expression(){return this._expression}op(){return this._operator}strength(){return this._strength}toString(){return this._expression.toString()+" "+["<=",">=","="][this._operator]+" 0 ("+this._strength.toString()+")"}}let CnId=0;class Solver{constructor(){Fd(this,"maxIterations",1e3);Fd(this,"_cnMap",createCnMap());Fd(this,"_rowMap",createRowMap());Fd(this,"_varMap",createVarMap());Fd(this,"_editMap",createEditMap());Fd(this,"_infeasibleRows",[]);Fd(this,"_objective",new Row$1);Fd(this,"_artificial",null);Fd(this,"_idTick",0)}createConstraint(J,VV,RV,UV=Strength.required){let ZV=new Constraint(J,VV,RV,UV);return this.addConstraint(ZV),ZV}addConstraint(J){if(this._cnMap.find(J)!==void 0)throw new Error("duplicate constraint");let RV=this._createRow(J),UV=RV.row,ZV=RV.tag,WV=this._chooseSubject(UV,ZV);if(WV.type()===SymbolType.Invalid&&UV.allDummies())if(nearZero(UV.constant()))WV=ZV.marker;else throw new Error("unsatisfiable constraint");if(WV.type()===SymbolType.Invalid){if(!this._addWithArtificialVariable(UV))throw new Error("unsatisfiable constraint")}else UV.solveFor(WV),this._substitute(WV,UV),this._rowMap.insert(WV,UV);this._cnMap.insert(J,ZV),this._optimize(this._objective)}removeConstraint(J){let VV=this._cnMap.erase(J);if(VV===void 0)throw new Error("unknown constraint");this._removeConstraintEffects(J,VV.second);let RV=VV.second.marker,UV=this._rowMap.erase(RV);if(UV===void 0){let ZV=this._getMarkerLeavingSymbol(RV);if(ZV.type()===SymbolType.Invalid)throw new Error("failed to find leaving row");UV=this._rowMap.erase(ZV),UV.second.solveForEx(ZV,RV),this._substitute(RV,UV.second)}this._optimize(this._objective)}hasConstraint(J){return this._cnMap.contains(J)}getConstraints(){return this._cnMap.array.map(({first:J})=>J)}addEditVariable(J,VV){if(this._editMap.find(J)!==void 0)throw new Error("duplicate edit variable");if(VV=Strength.clip(VV),VV===Strength.required)throw new Error("bad required strength");let UV=new Expression(J),ZV=new Constraint(UV,Operator.Eq,void 0,VV);this.addConstraint(ZV);let IV={tag:this._cnMap.find(ZV).second,constraint:ZV,constant:0};this._editMap.insert(J,IV)}removeEditVariable(J){let VV=this._editMap.erase(J);if(VV===void 0)throw new Error("unknown edit variable");this.removeConstraint(VV.second.constraint)}hasEditVariable(J){return this._editMap.contains(J)}suggestValue(J,VV){let RV=this._editMap.find(J);if(RV===void 0)throw new Error("unknown edit variable");let UV=this._rowMap,ZV=RV.second,WV=VV-ZV.constant;ZV.constant=VV;let IV=ZV.tag.marker,dV=UV.find(IV);if(dV!==void 0){dV.second.add(-WV)<0&&this._infeasibleRows.push(IV),this._dualOptimize();return}let CV=ZV.tag.other;if(dV=UV.find(CV),dV!==void 0){dV.second.add(WV)<0&&this._infeasibleRows.push(CV),this._dualOptimize();return}for(let FV=0,NV=UV.size();FV<NV;++FV){let eV=UV.itemAt(FV),gV=eV.second,nV=gV.coefficientFor(IV);nV!==0&&gV.add(WV*nV)<0&&eV.first.type()!==SymbolType.External&&this._infeasibleRows.push(eV.first)}this._dualOptimize()}updateVariables(){let J=this._varMap,VV=this._rowMap;for(let RV=0,UV=J.size();RV<UV;++RV){let ZV=J.itemAt(RV),WV=VV.find(ZV.second);WV!==void 0?ZV.first.setValue(WV.second.constant()):ZV.first.setValue(0)}}_getVarSymbol(J){let VV=()=>this._makeSymbol(SymbolType.External);return this._varMap.setDefault(J,VV).second}_createRow(J){let VV=J.expression(),RV=new Row$1(VV.constant()),UV=VV.terms();for(let dV=0,CV=UV.size();dV<CV;++dV){let FV=UV.itemAt(dV);if(!nearZero(FV.second)){let NV=this._getVarSymbol(FV.first),eV=this._rowMap.find(NV);eV!==void 0?RV.insertRow(eV.second,FV.second):RV.insertSymbol(NV,FV.second)}}let ZV=this._objective,WV=J.strength(),IV={marker:INVALID_SYMBOL,other:INVALID_SYMBOL};switch(J.op()){case Operator.Le:case Operator.Ge:{let dV=J.op()===Operator.Le?1:-1,CV=this._makeSymbol(SymbolType.Slack);if(IV.marker=CV,RV.insertSymbol(CV,dV),WV<Strength.required){let FV=this._makeSymbol(SymbolType.Error);IV.other=FV,RV.insertSymbol(FV,-dV),ZV.insertSymbol(FV,WV)}break}case Operator.Eq:{if(WV<Strength.required){let dV=this._makeSymbol(SymbolType.Error),CV=this._makeSymbol(SymbolType.Error);IV.marker=dV,IV.other=CV,RV.insertSymbol(dV,-1),RV.insertSymbol(CV,1),ZV.insertSymbol(dV,WV),ZV.insertSymbol(CV,WV)}else{let dV=this._makeSymbol(SymbolType.Dummy);IV.marker=dV,RV.insertSymbol(dV)}break}}return RV.constant()<0&&RV.reverseSign(),{row:RV,tag:IV}}_chooseSubject(J,VV){let RV=J.cells();for(let ZV=0,WV=RV.size();ZV<WV;++ZV){let IV=RV.itemAt(ZV);if(IV.first.type()===SymbolType.External)return IV.first}let UV=VV.marker.type();return(UV===SymbolType.Slack||UV===SymbolType.Error)&&J.coefficientFor(VV.marker)<0?VV.marker:(UV=VV.other.type(),(UV===SymbolType.Slack||UV===SymbolType.Error)&&J.coefficientFor(VV.other)<0?VV.other:INVALID_SYMBOL)}_addWithArtificialVariable(J){let VV=this._makeSymbol(SymbolType.Slack);this._rowMap.insert(VV,J.copy()),this._artificial=J.copy(),this._optimize(this._artificial);let RV=nearZero(this._artificial.constant());this._artificial=null;let UV=this._rowMap.erase(VV);if(UV!==void 0){let WV=UV.second;if(WV.isConstant())return RV;let IV=this._anyPivotableSymbol(WV);if(IV.type()===SymbolType.Invalid)return!1;WV.solveForEx(VV,IV),this._substitute(IV,WV),this._rowMap.insert(IV,WV)}let ZV=this._rowMap;for(let WV=0,IV=ZV.size();WV<IV;++WV)ZV.itemAt(WV).second.removeSymbol(VV);return this._objective.removeSymbol(VV),RV}_substitute(J,VV){let RV=this._rowMap;for(let UV=0,ZV=RV.size();UV<ZV;++UV){let WV=RV.itemAt(UV);WV.second.substitute(J,VV),WV.second.constant()<0&&WV.first.type()!==SymbolType.External&&this._infeasibleRows.push(WV.first)}this._objective.substitute(J,VV),this._artificial&&this._artificial.substitute(J,VV)}_optimize(J){let VV=0;for(;VV<this.maxIterations;){let RV=this._getEnteringSymbol(J);if(RV.type()===SymbolType.Invalid)return;let UV=this._getLeavingSymbol(RV);if(UV.type()===SymbolType.Invalid)throw new Error("the objective is unbounded");let ZV=this._rowMap.erase(UV).second;ZV.solveForEx(UV,RV),this._substitute(RV,ZV),this._rowMap.insert(RV,ZV),VV++}throw new Error("solver iterations exceeded")}_dualOptimize(){let J=this._rowMap,VV=this._infeasibleRows;for(;VV.length!==0;){let RV=VV.pop(),UV=J.find(RV);if(UV!==void 0&&UV.second.constant()<0){let ZV=this._getDualEnteringSymbol(UV.second);if(ZV.type()===SymbolType.Invalid)throw new Error("dual optimize failed");let WV=UV.second;J.erase(RV),WV.solveForEx(RV,ZV),this._substitute(ZV,WV),J.insert(ZV,WV)}}}_getEnteringSymbol(J){let VV=J.cells();for(let RV=0,UV=VV.size();RV<UV;++RV){let ZV=VV.itemAt(RV),WV=ZV.first;if(ZV.second<0&&WV.type()!==SymbolType.Dummy)return WV}return INVALID_SYMBOL}_getDualEnteringSymbol(J){let VV=Number.MAX_VALUE,RV=INVALID_SYMBOL,UV=J.cells();for(let ZV=0,WV=UV.size();ZV<WV;++ZV){let IV=UV.itemAt(ZV),dV=IV.first,CV=IV.second;if(CV>0&&dV.type()!==SymbolType.Dummy){let NV=this._objective.coefficientFor(dV)/CV;NV<VV&&(VV=NV,RV=dV)}}return RV}_getLeavingSymbol(J){let VV=Number.MAX_VALUE,RV=INVALID_SYMBOL,UV=this._rowMap;for(let ZV=0,WV=UV.size();ZV<WV;++ZV){let IV=UV.itemAt(ZV),dV=IV.first;if(dV.type()!==SymbolType.External){let CV=IV.second,FV=CV.coefficientFor(J);if(FV<0){let NV=-CV.constant()/FV;NV<VV&&(VV=NV,RV=dV)}}}return RV}_getMarkerLeavingSymbol(J){let VV=Number.MAX_VALUE,RV=VV,UV=VV,ZV=INVALID_SYMBOL,WV=ZV,IV=ZV,dV=ZV,CV=this._rowMap;for(let FV=0,NV=CV.size();FV<NV;++FV){let eV=CV.itemAt(FV),gV=eV.second,nV=gV.coefficientFor(J);if(nV===0)continue;let JV=eV.first;if(JV.type()===SymbolType.External)dV=JV;else if(nV<0){let aV=-gV.constant()/nV;aV<RV&&(RV=aV,WV=JV)}else{let aV=gV.constant()/nV;aV<UV&&(UV=aV,IV=JV)}}return WV!==ZV?WV:IV!==ZV?IV:dV}_removeConstraintEffects(J,VV){VV.marker.type()===SymbolType.Error&&this._removeMarkerEffects(VV.marker,J.strength()),VV.other.type()===SymbolType.Error&&this._removeMarkerEffects(VV.other,J.strength())}_removeMarkerEffects(J,VV){let RV=this._rowMap.find(J);RV!==void 0?this._objective.insertRow(RV.second,-VV):this._objective.insertSymbol(J,-VV)}_anyPivotableSymbol(J){let VV=J.cells();for(let RV=0,UV=VV.size();RV<UV;++RV){let ZV=VV.itemAt(RV),WV=ZV.first.type();if(WV===SymbolType.Slack||WV===SymbolType.Error)return ZV.first}return INVALID_SYMBOL}_makeSymbol(J){return new Symbol$1(J,this._idTick++)}}function nearZero(lV){let J=1e-8;return lV<0?-lV<J:lV<J}function createCnMap(){return createMap()}function createRowMap(){return createMap()}function createVarMap(){return createMap()}function createEditMap(){return createMap()}var SymbolType;(function(lV){lV[lV.Invalid=0]="Invalid",lV[lV.External=1]="External",lV[lV.Slack=2]="Slack",lV[lV.Error=3]="Error",lV[lV.Dummy=4]="Dummy"})(SymbolType||(SymbolType={}));let Symbol$1=class{constructor(J,VV){Fd(this,"_id");Fd(this,"_type");this._id=VV,this._type=J}id(){return this._id}type(){return this._type}},INVALID_SYMBOL=new Symbol$1(SymbolType.Invalid,-1),Row$1=class e2{constructor(J=0){Fd(this,"_cellMap",createMap());Fd(this,"_constant");this._constant=J}cells(){return this._cellMap}constant(){return this._constant}isConstant(){return this._cellMap.empty()}allDummies(){let J=this._cellMap;for(let VV=0,RV=J.size();VV<RV;++VV)if(J.itemAt(VV).first.type()!==SymbolType.Dummy)return!1;return!0}copy(){let J=new e2(this._constant);return J._cellMap=this._cellMap.copy(),J}add(J){return this._constant+=J}insertSymbol(J,VV=1){let RV=this._cellMap.setDefault(J,()=>0);nearZero(RV.second+=VV)&&this._cellMap.erase(J)}insertRow(J,VV=1){this._constant+=J._constant*VV;let RV=J._cellMap;for(let UV=0,ZV=RV.size();UV<ZV;++UV){let WV=RV.itemAt(UV);this.insertSymbol(WV.first,WV.second*VV)}}removeSymbol(J){this._cellMap.erase(J)}reverseSign(){this._constant=-this._constant;let J=this._cellMap;for(let VV=0,RV=J.size();VV<RV;++VV){let UV=J.itemAt(VV);UV.second=-UV.second}}solveFor(J){let VV=this._cellMap,UV=-1/VV.erase(J).second;this._constant*=UV;for(let ZV=0,WV=VV.size();ZV<WV;++ZV)VV.itemAt(ZV).second*=UV}solveForEx(J,VV){this.insertSymbol(J,-1),this.solveFor(VV)}coefficientFor(J){let VV=this._cellMap.find(J);return VV!==void 0?VV.second:0}substitute(J,VV){let RV=this._cellMap.erase(J);RV!==void 0&&this.insertRow(VV,RV.second)}};function findConnectedNetworks(lV){const J=new Map;let VV=0;function RV(UV){for(const[,WV]of J)if(WV.has(UV))return WV;const ZV=new Set;return J.set(`connectivity_net${VV++}`,ZV),ZV}for(const UV of lV){let ZV=null;for(const WV of UV){if(!ZV)ZV=RV(WV);else if(!ZV.has(WV)){const IV=RV(WV);if(IV!==ZV){for(const dV of IV)ZV.add(dV);J.delete(Array.from(J.entries()).find(([,dV])=>dV===IV)[0])}}ZV.add(WV)}}return Object.fromEntries(Array.from(J.entries()).map(([UV,ZV])=>[UV,Array.from(ZV)]))}var ConnectivityMap=class{constructor(lV){Fd(this,"netMap");Fd(this,"idToNetMap");this.netMap=lV,this.idToNetMap={};for(const[J,VV]of Object.entries(lV))for(const RV of VV)this.idToNetMap[RV]=J}addConnections(lV){for(const J of lV){const VV=new Set;for(const UV of J){const ZV=this.idToNetMap[UV];ZV&&VV.add(ZV)}let RV;if(VV.size===0)RV=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[RV]=[];else if(VV.size===1)RV=VV.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{RV=VV.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(const UV of VV)if(UV!==RV){this.netMap[RV].push(...this.netMap[UV]),this.netMap[UV]=this.netMap[RV];for(const ZV of this.netMap[RV])this.idToNetMap[ZV]=RV}}for(const UV of J)this.netMap[RV].includes(UV)||this.netMap[RV].push(UV),this.idToNetMap[UV]=RV}}getIdsConnectedToNet(lV){return this.netMap[lV]||[]}getNetConnectedToId(lV){return this.idToNetMap[lV]}areIdsConnected(lV,J){const VV=this.getNetConnectedToId(lV),RV=this.getNetConnectedToId(J);return VV===RV||RV===lV||RV===lV}areAllIdsConnected(lV){const J=this.getNetConnectedToId(lV[0]);for(const VV of lV){const RV=this.getNetConnectedToId(VV);if(RV===void 0||RV!==J)return!1}return!0}},getFullConnectivityMapFromCircuitJson=lV=>{const J=[];for(const RV of lV)if(RV.type==="source_trace")J.push([RV.source_trace_id,...RV.connected_source_port_ids??[],...RV.connected_source_net_ids??[]].filter(Boolean));else if(RV.type==="pcb_port"){const{pcb_port_id:UV,source_port_id:ZV}=RV;ZV&&UV&&J.push([ZV,UV])}else if(RV.type==="pcb_smtpad"){const{pcb_smtpad_id:UV,pcb_port_id:ZV}=RV;ZV&&UV&&J.push([UV,ZV])}else if(RV.type==="pcb_plated_hole"){const{pcb_plated_hole_id:UV,pcb_port_id:ZV}=RV;ZV&&UV&&J.push([UV,ZV])}else if(RV.type==="pcb_trace"){const{pcb_trace_id:UV,source_trace_id:ZV}=RV;ZV&&UV&&J.push([UV,ZV])}const VV=findConnectedNetworks(J);return new ConnectivityMap(VV)},getUnitVectorFromPointAToB=(lV,J)=>{const VV={x:J.x-lV.x,y:J.y-lV.y},RV=Math.sqrt(VV.x**2+VV.y**2);return{x:VV.x/RV,y:VV.y/RV}};function doesLineIntersectLine([lV,J],[VV,RV],{lineThickness:UV=0}={}){return UV===0?doSegmentsIntersect(lV,J,VV,RV):segmentsDistance(lV,J,VV,RV)<=UV}function doSegmentsIntersect(lV,J,VV,RV){const UV=orientation(lV,J,VV),ZV=orientation(lV,J,RV),WV=orientation(VV,RV,lV),IV=orientation(VV,RV,J);return!!(UV!==ZV&&WV!==IV||UV===0&&onSegment$1(lV,VV,J)||ZV===0&&onSegment$1(lV,RV,J)||WV===0&&onSegment$1(VV,lV,RV)||IV===0&&onSegment$1(VV,J,RV))}function orientation(lV,J,VV){const RV=(J.y-lV.y)*(VV.x-J.x)-(J.x-lV.x)*(VV.y-J.y);return RV===0?0:RV>0?1:2}function onSegment$1(lV,J,VV){return J.x<=Math.max(lV.x,VV.x)&&J.x>=Math.min(lV.x,VV.x)&&J.y<=Math.max(lV.y,VV.y)&&J.y>=Math.min(lV.y,VV.y)}function segmentsDistance(lV,J,VV,RV){if(lV.x===J.x&&lV.y===J.y)return pointToSegmentDistance(lV,VV,RV);if(VV.x===RV.x&&VV.y===RV.y)return pointToSegmentDistance(VV,lV,J);if(doSegmentsIntersect(lV,J,VV,RV))return 0;const UV=[pointToSegmentDistance(lV,VV,RV),pointToSegmentDistance(J,VV,RV),pointToSegmentDistance(VV,lV,J),pointToSegmentDistance(RV,lV,J)];return Math.min(...UV)}function pointToSegmentDistance(lV,J,VV){const RV=(VV.x-J.x)**2+(VV.y-J.y)**2;if(RV===0)return distance$1(lV,J);let UV=((lV.x-J.x)*(VV.x-J.x)+(lV.y-J.y)*(VV.y-J.y))/RV;UV=Math.max(0,Math.min(1,UV));const ZV={x:J.x+UV*(VV.x-J.x),y:J.y+UV*(VV.y-J.y)};return distance$1(lV,ZV)}function distance$1(lV,J){const VV=lV.x-J.x,RV=lV.y-J.y;return Math.sqrt(VV*VV+RV*RV)}var SI_PREFIXES=[{value:1e12,symbol:"T"},{value:1e9,symbol:"G"},{value:1e6,symbol:"M"},{value:1e3,symbol:"k"},{value:1,symbol:""},{value:.001,symbol:"m"},{value:1e-6,symbol:"µ"},{value:1e-9,symbol:"n"},{value:1e-12,symbol:"p"}];function formatSiUnit(lV){if(lV==null)return"";if(lV===0)return"0";const J=SI_PREFIXES.find(UV=>Math.abs(lV)>=UV.value)||SI_PREFIXES[SI_PREFIXES.length-1];return`${(lV/J.value).toPrecision(3).replace(/\.?0+$/,"")}${J.symbol}`}var su$2=(lV,J={})=>{let VV=lV._internal_store;if(!VV){VV={counts:{}},lV._internal_store=VV;for(const UV of lV){const ZV=UV.type,WV=UV[`${ZV}_id`];if(!WV)continue;const IV=Number.parseInt(WV.split("_").pop());Number.isNaN(IV)||(VV.counts[ZV]=Math.max(VV.counts[ZV]??0,IV))}}return new Proxy({},{get:(UV,ZV)=>ZV==="toArray"?()=>lV:{get:WV=>lV.find(IV=>IV.type===ZV&&IV[`${ZV}_id`]===WV),getUsing:WV=>{const IV=Object.keys(WV);if(IV.length!==1)throw new Error("getUsing requires exactly one key, e.g. { pcb_component_id }");const dV=IV[0],CV=dV.replace("_id",""),FV=lV.find(NV=>NV.type===CV&&NV[dV]===WV[dV]);return FV?lV.find(NV=>NV.type===ZV&&NV[`${ZV}_id`]===FV[`${ZV}_id`]):null},getWhere:WV=>{const IV=Object.keys(WV);return lV.find(dV=>dV.type===ZV&&IV.every(CV=>dV[CV]===WV[CV]))},list:WV=>{const IV=WV?Object.keys(WV):[];return lV.filter(dV=>dV.type===ZV&&IV.every(CV=>dV[CV]===WV[CV]))},insert:WV=>{var CV;(CV=VV.counts)[ZV]??(CV[ZV]=-1),VV.counts[ZV]++;const IV=VV.counts[ZV],dV={type:ZV,[`${ZV}_id`]:`${ZV}_${IV}`,...WV};return J.validateInserts&&(Soup[ZV]??any_soup_element).parse(dV),lV.push(dV),dV},delete:WV=>{const IV=lV.find(dV=>dV[`${ZV}_id`]===WV);IV&&lV.splice(lV.indexOf(IV),1)},update:(WV,IV)=>{const dV=lV.find(CV=>CV.type===ZV&&CV[`${ZV}_id`]===WV);if(dV)return Object.assign(dV,IV),dV},select:WV=>{if(ZV==="source_component")return lV.find(IV=>IV.type==="source_component"&&IV.name===WV.replace(/\./g,""));if(ZV==="pcb_port"||ZV==="source_port"||ZV==="schematic_port"){const[IV,dV]=WV.replace(/\./g,"").split(/[\s\>]+/),CV=lV.find(NV=>NV.type==="source_component"&&NV.name===IV);if(!CV)return null;const FV=lV.find(NV=>NV.type==="source_port"&&NV.source_component_id===CV.source_component_id&&(NV.name===dV||(NV.port_hints??[]).includes(dV)));if(!FV)return null;if(ZV==="source_port")return FV;if(ZV==="pcb_port")return lV.find(NV=>NV.type==="pcb_port"&&NV.source_port_id===FV.source_port_id);if(ZV==="schematic_port")return lV.find(NV=>NV.type==="schematic_port"&&NV.source_port_id===FV.source_port_id)}}}})};su$2.unparsed=su$2;var su_default$2=su$2,__defProp$n=Object.defineProperty,__export$3=(lV,J)=>{for(var VV in J)__defProp$n(lV,VV,{get:J[VV],enumerable:!0})},components_exports={};__export$3(components_exports,{Battery:()=>Battery,Board:()=>Board,Capacitor:()=>Capacitor,Chip:()=>Chip,Constraint:()=>Constraint2,Crystal:()=>Crystal,Diode:()=>Diode,FabricationNotePath:()=>FabricationNotePath,FabricationNoteText:()=>FabricationNoteText,Footprint:()=>Footprint,Group:()=>Group$2,Hole:()=>Hole,Inductor:()=>Inductor,Jumper:()=>Jumper,Keepout:()=>Keepout,Led:()=>Led,Net:()=>Net,NetAlias:()=>NetAlias,NormalComponent:()=>NormalComponent,PinHeader:()=>PinHeader,PlatedHole:()=>PlatedHole,Port:()=>Port,Potentiometer:()=>Potentiometer,PowerSource:()=>PowerSource,PrimitiveComponent:()=>PrimitiveComponent,PushButton:()=>PushButton,Renderable:()=>Renderable,Resistor:()=>Resistor,SilkscreenCircle:()=>SilkscreenCircle,SilkscreenPath:()=>SilkscreenPath,SilkscreenRect:()=>SilkscreenRect,SilkscreenText:()=>SilkscreenText,SmtPad:()=>SmtPad,Subcircuit:()=>Subcircuit,Trace:()=>Trace,TraceHint:()=>TraceHint,Via:()=>Via});var orderedRenderPhases=["ReactSubtreesRender","InitializePortsFromChildren","CreateNetsFromProps","CreateTracesFromProps","CreateTraceHintsFromProps","SourceRender","SourceParentAttachment","PortDiscovery","PortMatching","SourceTraceRender","SourceAddConnectivityMapKey","SchematicComponentRender","SchematicPortRender","SchematicLayout","SchematicTraceRender","PcbComponentRender","PcbPrimitiveRender","PcbFootprintLayout","PcbPortRender","PcbPortAttachment","PcbLayout","PcbComponentSizeCalculation","PcbTraceRender","PcbTraceHintRender","PcbRouteNetIslands","CadModelRender","PartsEngineRender"],globalRenderCounter=0,Renderable=class{constructor(lV){Fd(this,"renderPhaseStates");Fd(this,"shouldBeRemoved",!1);Fd(this,"children");Fd(this,"isPcbPrimitive",!1);Fd(this,"isSchematicPrimitive",!1);Fd(this,"_renderId");Fd(this,"_currentRenderPhase",null);Fd(this,"_asyncEffects",[]);this._renderId=`${globalRenderCounter++}`,this.children=[],this.renderPhaseStates={};for(const J of orderedRenderPhases)this.renderPhaseStates[J]={initialized:!1,dirty:!1}}_markDirty(lV){this.renderPhaseStates[lV].dirty=!0;const J=orderedRenderPhases.indexOf(lV);for(let VV=J+1;VV<orderedRenderPhases.length;VV++)this.renderPhaseStates[orderedRenderPhases[VV]].dirty=!0}_queueAsyncEffect(lV,J){const VV={promise:J(),phase:this._currentRenderPhase,effectName:lV,complete:!1};this._asyncEffects.push(VV),VV.promise.then(()=>{VV.complete=!0,"root"in this&&this.root&&this.root.emit("asyncEffectComplete",{effectName:lV,componentDisplayName:this.getString(),phase:VV.phase})}).catch(RV=>{console.error(`Async effect error in ${VV.phase} "${lV}":
|
|
399
399
|
${RV.stack}`),VV.complete=!0,"root"in this&&this.root&&this.root.emit("asyncEffectComplete",{effectName:lV,componentDisplayName:this.getString(),phase:VV.phase,error:RV.toString()})})}_emitRenderLifecycleEvent(lV,J){const VV={renderId:this._renderId,componentDisplayName:this.getString()},RV=`renderable:renderLifecycle:${lV}:${J}`;"root"in this&&this.root&&(this.root.emit(RV,{...VV,type:RV}),this.root.emit("renderable:renderLifecycle:anyEvent",{...VV,type:RV}))}getString(){return this.constructor.name}_hasIncompleteAsyncEffects(){return this._asyncEffects.some(lV=>!lV.complete)}getCurrentRenderPhase(){return this._currentRenderPhase}getRenderGraph(){return{id:this._renderId,currentPhase:this._currentRenderPhase,renderPhaseStates:this.renderPhaseStates,shouldBeRemoved:this.shouldBeRemoved,children:this.children.map(lV=>lV.getRenderGraph())}}runRenderCycle(){for(const lV of orderedRenderPhases)this.runRenderPhaseForChildren(lV),this.runRenderPhase(lV)}runRenderPhase(lV){var ZV,WV,IV;this._currentRenderPhase=lV;const J=this.renderPhaseStates[lV],VV=J.initialized,RV=J.dirty;if(!VV&&this.shouldBeRemoved)return;if(this.shouldBeRemoved&&VV){this._emitRenderLifecycleEvent(lV,"start"),(ZV=this==null?void 0:this[`remove${lV}`])==null||ZV.call(this),J.initialized=!1,J.dirty=!1,this._emitRenderLifecycleEvent(lV,"end");return}const UV=orderedRenderPhases.indexOf(lV)-1;if(UV>=0){const dV=orderedRenderPhases[UV];if(this._asyncEffects.filter(FV=>FV.phase===dV).some(FV=>!FV.complete))return}if(this._emitRenderLifecycleEvent(lV,"start"),VV){RV&&((WV=this==null?void 0:this[`update${lV}`])==null||WV.call(this),J.dirty=!1),this._emitRenderLifecycleEvent(lV,"end");return}J.dirty=!1,(IV=this==null?void 0:this[`doInitial${lV}`])==null||IV.call(this),J.initialized=!0,this._emitRenderLifecycleEvent(lV,"end")}runRenderPhaseForChildren(lV){for(const J of this.children)J.runRenderPhaseForChildren(lV),J.runRenderPhase(lV)}renderError(lV){throw typeof lV=="string"?new Error(lV):new Error(JSON.stringify(lV,null,2))}},catalogue$1={},extendCatalogue=lV=>{const J=Object.fromEntries(Object.entries(lV).map(([VV,RV])=>[VV.toLowerCase(),RV]));Object.assign(catalogue$1,lV),Object.assign(catalogue$1,J)};function prepare$1(lV,J){const VV=lV;return VV.__tsci={...J},lV}var hostConfig={supportsMutation:!0,createInstance(lV,J){const VV=catalogue$1[lV];if(!VV)throw Object.keys(catalogue$1).length===0?new Error("No components registered in catalogue, did you forget to import lib/register-catalogue in your test file?"):new Error(`Unsupported component type (not registered in @tscircuit/core catalogue): "${lV}" See CREATING_NEW_COMPONENTS.md`);return prepare$1(new VV(J),{})},createTextInstance(){return{}},appendInitialChild(lV,J){lV.add(J)},appendChild(lV,J){lV.add(J)},appendChildToContainer(lV,J){lV.add(J)},finalizeInitialChildren(){return!1},prepareUpdate(){return null},shouldSetTextContent(){return!1},getRootHostContext(){return{}},getChildHostContext(){return{}},prepareForCommit(){return null},resetAfterCommit(){},commitMount(){},commitUpdate(){},removeChild(){},clearContainer(){},supportsPersistence:!1,getPublicInstance(lV){return lV},preparePortalMount(lV){throw new Error("Function not implemented.")},scheduleTimeout(lV,J){throw new Error("Function not implemented.")},cancelTimeout(lV){throw new Error("Function not implemented.")},noTimeout:void 0,isPrimaryRenderer:!1,getCurrentEventPriority(){throw new Error("Function not implemented.")},getInstanceFromNode(lV){throw new Error("Function not implemented.")},beforeActiveInstanceBlur(){throw new Error("Function not implemented.")},afterActiveInstanceBlur(){throw new Error("Function not implemented.")},prepareScopeUpdate:(lV,J)=>{throw new Error("Function not implemented.")},getInstanceFromScope:lV=>{throw new Error("Function not implemented.")},detachDeletedInstance:lV=>{throw new Error("Function not implemented.")},supportsHydration:!1},reconciler$1=ReactReconciler(hostConfig),createInstanceFromReactElement=lV=>{const J={children:[],props:{name:"$root"},add(UV){UV.parent=this,this.children.push(UV)},computePcbGlobalTransform(){return identity$4()}},VV=reconciler$1.createContainer(J,0,null,!1,null,"tsci",UV=>{console.log("Error in createContainer"),console.error(UV)},null);reconciler$1.updateContainer(lV,VV,null,()=>{});const RV=reconciler$1.getPublicRootInstance(VV);return RV||J.children[0]},underscorifyPinStyles=lV=>{if(!lV)return;const J={};for(const[VV,RV]of Object.entries(lV))J[VV]={bottom_margin:RV.bottomMargin,left_margin:RV.leftMargin,right_margin:RV.rightMargin,top_margin:RV.topMargin};return J},underscorifyPortArrangement=lV=>{if(lV){if("leftSide"in lV||"rightSide"in lV||"topSide"in lV||"bottomSide"in lV)return{left_side:lV.leftSide,right_side:lV.rightSide,top_side:lV.topSide,bottom_side:lV.bottomSide};if("leftPinCount"in lV||"rightPinCount"in lV||"topPinCount"in lV||"bottomPinCount"in lV)return{left_size:lV.leftPinCount,right_size:lV.rightPinCount,top_size:lV.topPinCount,bottom_size:lV.bottomPinCount};if("leftSize"in lV||"rightSize"in lV||"topSize"in lV||"bottomSize"in lV)return{left_size:lV.leftSize,right_size:lV.rightSize,top_size:lV.topSize,bottom_size:lV.bottomSize}}},InvalidProps=class extends Error{constructor(lV,J,VV){let RV;const ZV=Object.keys(VV).filter(WV=>WV!=="_errors").map(WV=>VV[WV]._errors[0]?`${WV} (${VV[WV]._errors[0]})`:`${WV} (${JSON.stringify(VV[WV])})`).join(", ");"name"in J?RV=`Invalid props for ${lV} "${J.name}": ${ZV}`:"footprint"in J&&typeof J.footprint=="string"?RV=`Invalid props for ${lV} (unnamed ${J.footprint} component): ${ZV}`:RV=`Invalid props for ${lV} (unnamed): ${ZV}`,super(RV),this.componentName=lV,this.originalProps=J,this.formattedError=VV}};function isMatchingSelector(lV,J){const VV=J.match(/^#(\w+)/);if(VV)return lV.props.id===VV[1];const RV=J.match(/^\.(\w+)/);if(RV)return lV.isMatchingNameOrAlias(RV[1]);let[UV,...ZV]=J.split(/(?=[#.[])/);return UV==="pin"&&(UV="port"),UV&&UV!=="*"&&lV.lowercaseComponentName!==UV.toLowerCase()?!1:ZV.every(WV=>{if(WV.startsWith("#"))return lV.props.id===WV.slice(1);if(WV.startsWith("."))return lV.isMatchingNameOrAlias(WV.slice(1));const IV=WV.match(/\[(\w+)=['"]?(.+?)['"]?\]/);if(!IV)return!0;const[,dV,CV]=IV;return lV.props[dV].toString()===CV})}var debugSelectAll=Debug4("tscircuit:primitive-component:selectAll"),PrimitiveComponent=class extends Renderable{constructor(J){super(J);Fd(this,"parent",null);Fd(this,"children");Fd(this,"childrenPendingRemoval");Fd(this,"props");Fd(this,"_parsedProps");Fd(this,"externallyAddedAliases");Fd(this,"isPrimitiveContainer",!1);Fd(this,"source_group_id",null);Fd(this,"source_component_id",null);Fd(this,"schematic_component_id",null);Fd(this,"pcb_component_id",null);Fd(this,"cad_component_id",null);this.children=[],this.childrenPendingRemoval=[],this.props=J??{},this.externallyAddedAliases=[];const VV=this.config.zodProps.safeParse(J??{});if(VV.success)this._parsedProps=VV.data;else throw new InvalidProps(this.lowercaseComponentName,this.props,VV.error.format())}get config(){return{componentName:"",zodProps:z$1.object({}).passthrough()}}get componentName(){return this.config.componentName}getInheritedProperty(J){let VV=this;for(;VV;){if(VV._parsedProps&&J in VV._parsedProps)return VV._parsedProps[J];VV=VV.parent}}get lowercaseComponentName(){return this.componentName.toLowerCase()}get isSubcircuit(){var J;return!!this.props.subcircuit||this.lowercaseComponentName==="group"&&((J=this==null?void 0:this.parent)==null?void 0:J.isRoot)}get isGroup(){return this.lowercaseComponentName==="group"}setProps(J){var UV,ZV;const VV=this.config.zodProps.parse({...this.props,...J}),RV=this.props;this.props=VV,this._parsedProps=this.config.zodProps.parse(J),this.onPropsChange({oldProps:RV,newProps:VV,changedProps:Object.keys(J)}),(ZV=(UV=this.parent)==null?void 0:UV.onChildChanged)==null||ZV.call(UV,this)}computePcbPropsTransform(){const{_parsedProps:J}=this;return compose(translate(J.pcbX??0,J.pcbY??0),rotate((J.pcbRotation??0)*Math.PI/180))}_computePcbGlobalTransformBeforeLayout(){var RV,UV,ZV;const{_parsedProps:J}=this,VV=this.getSubcircuit()._getManualPlacementForComponent(this);if(VV&&this.props.pcbX===void 0&&this.props.pcbY===void 0)return compose(((RV=this.parent)==null?void 0:RV._computePcbGlobalTransformBeforeLayout())??identity$4(),compose(translate(VV.x,VV.y),rotate((J.pcbRotation??0)*Math.PI/180)));if(this.isPcbPrimitive){const WV=this.getPrimitiveContainer();if(WV){const IV=WV._parsedProps.layer==="bottom",dV=WV._getGlobalPcbPositionBeforeLayout();if(IV)return compose(translate(dV.x,dV.y),flipY(),translate(-dV.x,-dV.y)),compose(((UV=this.parent)==null?void 0:UV._computePcbGlobalTransformBeforeLayout())??identity$4(),flipY(),this.computePcbPropsTransform())}}return compose(((ZV=this.parent)==null?void 0:ZV._computePcbGlobalTransformBeforeLayout())??identity$4(),this.computePcbPropsTransform())}getPrimitiveContainer(){var J,VV;return this.isPrimitiveContainer?this:((VV=(J=this.parent)==null?void 0:J.getPrimitiveContainer)==null?void 0:VV.call(J))??null}_getPcbCircuitJsonBounds(){return{center:{x:0,y:0},bounds:{left:0,top:0,right:0,bottom:0},width:0,height:0}}_getPcbPrimitiveFlippedHelpers(){const J=this.getPrimitiveContainer(),VV=J?J._parsedProps.layer==="bottom":!1;return{isFlipped:VV,maybeFlipLayer:UV=>VV?UV==="top"?"bottom":"top":UV}}_setPositionFromLayout(J){throw new Error(`_setPositionFromLayout not implemented for ${this.componentName}`)}computeSchematicPropsTransform(){return compose(translate(this.props.schX??0,this.props.schY??0))}computeSchematicGlobalTransform(){var J,VV;return compose(((VV=(J=this.parent)==null?void 0:J.computeSchematicGlobalTransform)==null?void 0:VV.call(J))??identity$4(),this.computeSchematicPropsTransform())}_getSchematicSymbolName(){const{_parsedProps:J}=this,VV=this.config.schematicSymbolName,RV=`${VV}_horz`,UV=`${VV}_vert`,ZV=`${VV}_up`,WV=`${VV}_down`,IV=`${VV}_left`,dV=`${VV}_right`;if(dV in symbols_index_default&&(J.schRotation===void 0||J.schRotation===0))return dV;if(ZV in symbols_index_default&&J.schRotation===90)return ZV;if(IV in symbols_index_default&&J.schRotation===180)return IV;if(WV in symbols_index_default&&J.schRotation===270)return WV;if(RV in symbols_index_default&&(J.schRotation===0||J.schRotation===void 0||J.schRotation===180))return RV;if(UV in symbols_index_default&&(J.schRotation===90||J.schRotation===270))return UV;if(VV in symbols_index_default)return VV}_getSchematicSymbolNameOrThrow(){const J=this._getSchematicSymbolName();if(!J)throw new Error(`No schematic symbol found (given: "${this.config.schematicSymbolName}")`);return J}getSchematicSymbol(){const J=this._getSchematicSymbolName();return J?symbols_index_default[J]??null:null}_getManualPlacementForComponent(J){var ZV;if(!this.isSubcircuit)return null;const VV=this.props.layout,RV=this.props.manualEdits;if(!VV&&!RV)return null;const UV=((ZV=VV==null?void 0:VV.manual_pcb_placement_config)==null?void 0:ZV.positions)||(RV==null?void 0:RV.pcb_placements);if(!UV)return null;for(const WV of UV)if(VV&&isMatchingSelector(J,WV.selector)||J.props.name===WV.selector){const IV=applyToPoint(this._computePcbGlobalTransformBeforeLayout(),WV.center);return Array.isArray(IV)?{x:IV[0],y:IV[1]}:IV}return null}_getGlobalPcbPositionBeforeLayout(){return applyToPoint(this._computePcbGlobalTransformBeforeLayout(),{x:0,y:0})}_getGlobalSchematicPositionBeforeLayout(){return applyToPoint(this.computeSchematicGlobalTransform(),{x:0,y:0})}get root(){var J;return((J=this.parent)==null?void 0:J.root)??null}onAddToParent(J){this.parent=J}onPropsChange(J){}onChildChanged(J){var VV,RV;(RV=(VV=this.parent)==null?void 0:VV.onChildChanged)==null||RV.call(VV,J)}add(J){J.onAddToParent(this),J.parent=this,this.children.push(J)}addAll(J){for(const VV of J)this.add(VV)}remove(J){this.children=this.children.filter(VV=>VV!==J),this.childrenPendingRemoval.push(J),J.shouldBeRemoved=!0}getSubcircuitSelector(){const J=this._parsedProps.name,VV=J?`${this.lowercaseComponentName}.${J}`:this.lowercaseComponentName;return!this.parent||this.parent.isSubcircuit?VV:`${this.parent.getSubcircuitSelector()} > ${VV}`}getFullPathSelector(){var UV,ZV;const J=this._parsedProps.name,VV=J?`${this.lowercaseComponentName}.${J}`:this.lowercaseComponentName,RV=(ZV=(UV=this.parent)==null?void 0:UV.getFullPathSelector)==null?void 0:ZV.call(UV);return RV?`${RV} > ${VV}`:VV}getNameAndAliases(){return[this._parsedProps.name,...this._parsedProps.portHints??[]].filter(Boolean)}isMatchingNameOrAlias(J){return this.getNameAndAliases().includes(J)}isMatchingAnyOf(J){return this.getNameAndAliases().some(VV=>J.map(RV=>RV.toString()).includes(VV))}getPcbSize(){throw new Error(`getPcbSize not implemented for ${this.componentName}`)}doesSelectorMatch(J){const VV=[this.componentName,this.lowercaseComponentName],RV=[this._parsedProps.name].filter(Boolean),UV=J.trim().split(/\> /)[0],ZV=UV[0];return UV.length>1?!1:!!(J==="*"||J[0]==="#"&&J.slice(1)===this.props.id||J[0]==="."&&RV.includes(J.slice(1))||/^[a-zA-Z0-9_]/.test(ZV)&&VV.includes(ZV))}getSubcircuit(){var VV,RV;if(this.isSubcircuit)return this;const J=(RV=(VV=this.parent)==null?void 0:VV.getSubcircuit)==null?void 0:RV.call(VV);if(!J)throw new Error("Component is not inside an opaque group (no board?)");return J}selectAll(J){debugSelectAll(`selectAll: "${J}"`);const VV=J.trim().split(/\s+/);let RV=VV[0]===">"?this.children:this.getSelectableDescendants(),UV=[],ZV=!1,WV=-1;for(const IV of VV)if(WV++,debugSelectAll(`
|
|
@@ -10569,7 +10569,7 @@ IncidentLight directLight;
|
|
|
10569
10569
|
`,nV),aV>0?nV=aV+2:(aV=gV.indexOf("\r",nV),aV>0?nV=aV+1:nV=gV.indexOf(`
|
|
10570
10570
|
`,nV)+1)}else break}return gV.substr(nV)}},{key:"_isBinary",value:function(gV){var nV=new DataView(gV),JV=32/8*3+32/8*3*3+16/8,aV=nV.getUint32(80,!0),GV=80+32/8+aV*JV;if(GV===nV.byteLength)return!0;var YV=nV.byteLength;for(let tV=0;tV<YV;tV++)if(nV.getUint8(tV,!1)>127)return!0;return!1}},{key:"_ensureBinary",value:function(gV){if(typeof gV=="string"){var nV=new Uint8Array(gV.length);for(let JV=0;JV<gV.length;JV++)nV[JV]=gV.charCodeAt(JV)&255;return nV.buffer||nV}else return gV}},{key:"_ensureString",value:function(gV){return typeof gV!="string"?VV.decodeText(new Uint8Array(gV)):gV}},{key:"parse",value:function(gV,nV){var JV=this._ensureBinary(gV);return this._data=this._ensureString(gV),this.onLoad=nV,this._isBinary(JV)?this._parseBinary(JV):this._parseASCII()}},{key:"_parseBinary",value:function(gV){return this._parseASCII(VV.decodeText(new Uint8Array(gV)))}},{key:"_parseASCII",value:function(){var gV;this.resourcePath!==""?gV=this.resourcePath:this.path!==""?gV=this.path:gV=J.LoaderUtils.extractUrlBase(this.url),this.texloader.setPath(gV).setCrossOrigin(this.crossOrigin);var nV=16;this.Hierarchies.children=[],this._hierarchieParse(this.Hierarchies,nV),this._changeRoot(),this._currentObject=this.Hierarchies.children.shift(),this._mainloop()}},{key:"_hierarchieParse",value:function(gV,nV){for(var JV=nV;;){var aV=this._data.indexOf("{",JV)+1,GV=this._data.indexOf("}",JV),YV=this._data.indexOf("{",aV)+1;if(aV>0&&GV>aV){var tV={};tV.children=[];var kV=this._readLine(this._data.substr(JV,aV-JV-1)).trim(),AV=kV.split(/ /g);if(AV.length>0?(tV.type=AV[0],AV.length>=2?tV.name=AV[1]:tV.name=AV[0]+this.Hierarchies.children.length):(tV.name=kV,tV.type=""),tV.type==="Animation"){tV.data=this._data.substr(YV,GV-YV).trim();var XV=this._hierarchieParse(tV,GV+1);JV=XV.end,tV.children=XV.parent.children}else{var MV=this._data.lastIndexOf(";",YV>0?Math.min(YV,GV):GV);if(tV.data=this._data.substr(aV,MV-aV).trim(),YV<=0||GV<YV)JV=GV+1;else{var xV=Math.max(MV+1,aV),uV=this._hierarchieParse(tV,xV);JV=uV.end,tV.children=uV.parent.children}}tV.parent=gV,tV.type!="template"&&gV.children.push(tV)}else{JV=aV===-1?this._data.length:GV+1;break}}return{parent:gV,end:JV}}},{key:"_mainloop",value:function(){var gV=this;this._mainProc(),this._currentObject.parent||this._currentObject.children.length>0||!this._currentObject.worked?setTimeout(function(){gV._mainloop()},1):setTimeout(function(){gV.onLoad({models:gV.Meshes,animations:gV.animations})},1)}},{key:"_mainProc",value:function(){for(var gV=!1;;){if(!this._currentObject.worked){switch(this._currentObject.type){case"template":break;case"AnimTicksPerSecond":this.animTicksPerSecond=parseInt(this._currentObject.data);break;case"Frame":this._setFrame();break;case"FrameTransformMatrix":this._setFrameTransformMatrix();break;case"Mesh":this._changeRoot(),this._currentGeo={},this._currentGeo.name=this._currentObject.name.trim(),this._currentGeo.parentName=this._getParentName(this._currentObject).trim(),this._currentGeo.VertexSetedBoneCount=[],this._currentGeo.GeometryData={vertices:[],normals:[],uvs:[],skinIndices:[],skinWeights:[],indices:[],materialIndices:[]},this._currentGeo.Materials=[],this._currentGeo.normalVectors=[],this._currentGeo.BoneInfs=[],this._currentGeo.baseFrame=this._currentFrame,this._makeBoneFrom_CurrentFrame(),this._readVertexDatas(),gV=!0;break;case"MeshNormals":this._readVertexDatas();break;case"MeshTextureCoords":this._setMeshTextureCoords();break;case"VertexDuplicationIndices":break;case"MeshMaterialList":this._setMeshMaterialList();break;case"Material":this._setMaterial();break;case"SkinWeights":this._setSkinWeights();break;case"AnimationSet":this._changeRoot(),this._currentAnime={},this._currentAnime.name=this._currentObject.name.trim(),this._currentAnime.AnimeFrames=[];break;case"Animation":this._currentAnimeFrames&&this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=new IV,this._currentAnimeFrames.boneName=this._currentObject.data.trim();break;case"AnimationKey":this._readAnimationKey(),gV=!0;break}this._currentObject.worked=!0}if(this._currentObject.children.length>0){if(this._currentObject=this._currentObject.children.shift(),this.debug&&console.log("processing "+this._currentObject.name),gV)break}else if(this._currentObject.worked&&this._currentObject.parent&&!this._currentObject.parent.parent&&this._changeRoot(),this._currentObject.parent?this._currentObject=this._currentObject.parent:gV=!0,gV)break}}},{key:"_changeRoot",value:function(){this._currentGeo!=null&&this._currentGeo.name&&this._makeOutputGeometry(),this._currentGeo={},this._currentAnime!=null&&this._currentAnime.name&&(this._currentAnimeFrames&&(this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=null),this._makeOutputAnimation()),this._currentAnime={}}},{key:"_getParentName",value:function(gV){return gV.parent?gV.parent.name?gV.parent.name:this._getParentName(gV.parent):""}},{key:"_setFrame",value:function(){this._nowFrameName=this._currentObject.name.trim(),this._currentFrame={},this._currentFrame.name=this._nowFrameName,this._currentFrame.children=[],this._currentObject.parent&&this._currentObject.parent.name&&(this._currentFrame.parentName=this._currentObject.parent.name),this.frameHierarchie.push(this._nowFrameName),this.HieStack[this._nowFrameName]=this._currentFrame}},{key:"_setFrameTransformMatrix",value:function(){this._currentFrame.FrameTransformMatrix=new J.Matrix4;var gV=this._currentObject.data.split(",");this._ParseMatrixData(this._currentFrame.FrameTransformMatrix,gV),this._makeBoneFrom_CurrentFrame()}},{key:"_makeBoneFrom_CurrentFrame",value:function(){if(this._currentFrame.FrameTransformMatrix){var gV=new J.Bone;if(gV.name=this._currentFrame.name,gV.applyMatrix4(this._currentFrame.FrameTransformMatrix),gV.matrixWorld=gV.matrix,gV.FrameTransformMatrix=this._currentFrame.FrameTransformMatrix,this._currentFrame.putBone=gV,this._currentFrame.parentName)for(let nV in this.HieStack)this.HieStack[nV].name===this._currentFrame.parentName&&this.HieStack[nV].putBone.add(this._currentFrame.putBone)}}},{key:"_readVertexDatas",value:function(){for(var gV=0,nV=0,JV=0,aV=0;;){var GV=!1;if(JV===0){var YV=this._readInt1(gV);gV=YV.endRead,JV=1,aV=this._currentObject.data.indexOf(";;",gV)+1,aV<=0&&(aV=this._currentObject.data.length)}else{var tV=0;switch(nV){case 0:tV=this._currentObject.data.indexOf(",",gV)+1;break;case 1:tV=this._currentObject.data.indexOf(";,",gV)+1;break}switch((tV===0||tV>aV)&&(tV=aV,JV=0,GV=!0),this._currentObject.type){case"Mesh":switch(nV){case 0:this._readVertex1(this._currentObject.data.substr(gV,tV-gV));break;case 1:this._readFace1(this._currentObject.data.substr(gV,tV-gV));break}break;case"MeshNormals":switch(nV){case 0:this._readNormalVector1(this._currentObject.data.substr(gV,tV-gV));break}break}gV=tV+1,GV&&nV++}if(gV>=this._currentObject.data.length)break}}},{key:"_readInt1",value:function(gV){var nV=this._currentObject.data.indexOf(";",gV);return{refI:parseInt(this._currentObject.data.substr(gV,nV-gV)),endRead:nV+1}}},{key:"_readVertex1",value:function(gV){var nV=this._readLine(gV.trim()).substr(0,gV.length-2).split(";");this._currentGeo.GeometryData.vertices.push(parseFloat(nV[0]),parseFloat(nV[1]),parseFloat(nV[2])),this._currentGeo.GeometryData.skinIndices.push(0,0,0,0),this._currentGeo.GeometryData.skinWeights.push(1,0,0,0),this._currentGeo.VertexSetedBoneCount.push(0)}},{key:"_readFace1",value:function(gV){var nV=this._readLine(gV.trim()).substr(2,gV.length-4).split(",");this._currentGeo.GeometryData.indices.push(parseInt(nV[0],10),parseInt(nV[1],10),parseInt(nV[2],10))}},{key:"_readNormalVector1",value:function(gV){var nV=this._readLine(gV.trim()).substr(0,gV.length-2).split(";");this._currentGeo.GeometryData.normals.push(parseFloat(nV[0]),parseFloat(nV[1]),parseFloat(nV[2]))}},{key:"_buildGeometry",value:function(){var gV=new J.BufferGeometry,nV=[],JV=[],aV=[],GV=[],YV=[],tV=this._currentGeo.GeometryData;for(let MV=0,xV=tV.indices.length;MV<xV;MV++){var kV=tV.indices[MV]*2,AV=tV.indices[MV]*3,XV=tV.indices[MV]*4;nV.push(tV.vertices[AV],tV.vertices[AV+1],tV.vertices[AV+2]),JV.push(tV.normals[AV],tV.normals[AV+1],tV.normals[AV+2]),GV.push(tV.skinIndices[XV],tV.skinIndices[XV+1],tV.skinIndices[XV+2],tV.skinIndices[XV+3]),YV.push(tV.skinWeights[XV],tV.skinWeights[XV+1],tV.skinWeights[XV+2],tV.skinWeights[XV+3]),aV.push(tV.uvs[kV],tV.uvs[kV+1])}return gV.setAttribute("position",new J.Float32BufferAttribute(nV,3)),gV.setAttribute("normal",new J.Float32BufferAttribute(JV,3)),gV.setAttribute("uv",new J.Float32BufferAttribute(aV,2)),gV.setAttribute("skinIndex",new J.Uint16BufferAttribute(GV,4)),gV.setAttribute("skinWeight",new J.Float32BufferAttribute(YV,4)),this._computeGroups(gV,tV.materialIndices),gV}},{key:"_computeGroups",value:function(gV,nV){var JV,aV=[],GV=void 0;for(let tV=0;tV<nV.length;tV++){var YV=nV[tV];YV!==GV&&(GV=YV,JV!==void 0&&(JV.count=tV*3-JV.start,aV.push(JV)),JV={start:tV*3,materialIndex:GV})}JV!==void 0&&(JV.count=i*3-JV.start,aV.push(JV)),gV.groups=aV}},{key:"_setMeshTextureCoords",value:function(){for(var gV=0,nV=0,JV=0;;){switch(nV){case 0:if(JV===0){var aV=this._readInt1(0);gV=aV.endRead,JV=1}else{var GV=this._currentObject.data.indexOf(",",gV)+1;GV===0&&(GV=this._currentObject.data.length,nV=2,JV=0);var YV=this._currentObject.data.substr(gV,GV-gV),tV=this._readLine(YV.trim()).split(";");this.IsUvYReverse?this._currentGeo.GeometryData.uvs.push(parseFloat(tV[0]),1-parseFloat(tV[1])):this._currentGeo.GeometryData.uvs.push(parseFloat(tV[0]),parseFloat(tV[1])),gV=GV+1}break}if(gV>=this._currentObject.data.length)break}}},{key:"_setMeshMaterialList",value:function(){for(var gV=0,nV=0,JV=0;;){if(JV<2){var aV=this._readInt1(gV);gV=aV.endRead,JV++}else{var GV=this._currentObject.data.indexOf(";",gV);GV===-1&&(GV=this._currentObject.data.length,nV=3,JV=0);var YV=this._currentObject.data.substr(gV,GV-gV),tV=this._readLine(YV.trim()).split(",");for(let kV=0;kV<tV.length;kV++)this._currentGeo.GeometryData.materialIndices[kV]=parseInt(tV[kV]);gV=this._currentObject.data.length}if(gV>=this._currentObject.data.length||nV>=3)break}}},{key:"_setMaterial",value:function(){var gV=new J.MeshPhongMaterial({color:Math.random()*16777215});gV.side=J.FrontSide,gV.name=this._currentObject.name;var nV=0,JV=this._currentObject.data.indexOf(";;",nV),aV=this._currentObject.data.substr(nV,JV-nV),GV=this._readLine(aV.trim()).split(";");gV.color.r=parseFloat(GV[0]),gV.color.g=parseFloat(GV[1]),gV.color.b=parseFloat(GV[2]),nV=JV+2,JV=this._currentObject.data.indexOf(";",nV),aV=this._currentObject.data.substr(nV,JV-nV),gV.shininess=parseFloat(this._readLine(aV)),nV=JV+1,JV=this._currentObject.data.indexOf(";;",nV),aV=this._currentObject.data.substr(nV,JV-nV);var YV=this._readLine(aV.trim()).split(";");gV.specular.r=parseFloat(YV[0]),gV.specular.g=parseFloat(YV[1]),gV.specular.b=parseFloat(YV[2]),nV=JV+2,JV=this._currentObject.data.indexOf(";;",nV),JV===-1&&(JV=this._currentObject.data.length),aV=this._currentObject.data.substr(nV,JV-nV);var tV=this._readLine(aV.trim()).split(";");gV.emissive.r=parseFloat(tV[0]),gV.emissive.g=parseFloat(tV[1]),gV.emissive.b=parseFloat(tV[2]);for(var kV=null;this._currentObject.children.length>0;){kV=this._currentObject.children.shift(),this.debug&&console.log("processing "+kV.name);var AV=kV.data.substr(1,kV.data.length-2);switch(kV.type){case"TextureFilename":gV.map=this.texloader.load(AV);break;case"BumpMapFilename":gV.bumpMap=this.texloader.load(AV),gV.bumpScale=.05;break;case"NormalMapFilename":gV.normalMap=this.texloader.load(AV),gV.normalScale=new J.Vector2(2,2);break;case"EmissiveMapFilename":gV.emissiveMap=this.texloader.load(AV);break;case"LightMapFilename":gV.lightMap=this.texloader.load(AV);break}}this._currentGeo.Materials.push(gV)}},{key:"_setSkinWeights",value:function(){var gV=new WV,nV=0,JV=this._currentObject.data.indexOf(";",nV),aV=this._currentObject.data.substr(nV,JV-nV);nV=JV+1,gV.boneName=aV.substr(1,aV.length-2),gV.BoneIndex=this._currentGeo.BoneInfs.length,JV=this._currentObject.data.indexOf(";",nV),nV=JV+1,JV=this._currentObject.data.indexOf(";",nV),aV=this._currentObject.data.substr(nV,JV-nV);var GV=this._readLine(aV.trim()).split(",");for(let kV=0;kV<GV.length;kV++)gV.Indeces.push(parseInt(GV[kV]));nV=JV+1,JV=this._currentObject.data.indexOf(";",nV),aV=this._currentObject.data.substr(nV,JV-nV);var YV=this._readLine(aV.trim()).split(",");for(let kV=0;kV<YV.length;kV++)gV.Weights.push(parseFloat(YV[kV]));nV=JV+1,JV=this._currentObject.data.indexOf(";",nV),JV<=0&&(JV=this._currentObject.data.length),aV=this._currentObject.data.substr(nV,JV-nV);var tV=this._readLine(aV.trim()).split(",");gV.OffsetMatrix=new J.Matrix4,this._ParseMatrixData(gV.OffsetMatrix,tV),this._currentGeo.BoneInfs.push(gV)}},{key:"_makePutBoneList",value:function(gV,nV){var JV=!1;for(let GV in this.HieStack)if(this.HieStack[GV].name===gV||JV){JV=!0;var aV=new J.Bone;if(aV.name=this.HieStack[GV].name,aV.applyMatrix4(this.HieStack[GV].FrameTransformMatrix),aV.matrixWorld=aV.matrix,aV.FrameTransformMatrix=this.HieStack[GV].FrameTransformMatrix,aV.pos=new J.Vector3().setFromMatrixPosition(aV.FrameTransformMatrix).toArray(),aV.rotq=new J.Quaternion().setFromRotationMatrix(aV.FrameTransformMatrix).toArray(),aV.scl=new J.Vector3().setFromMatrixScale(aV.FrameTransformMatrix).toArray(),this.HieStack[GV].parentName&&this.HieStack[GV].parentName.length>0){for(let YV=0;YV<nV.length;YV++)if(this.HieStack[GV].parentName===nV[YV].name){nV[YV].add(aV),aV.parent=YV;break}}nV.push(aV)}}},{key:"_makeOutputGeometry",value:function(){var gV=null;if(this._currentGeo.BoneInfs.length>0){var nV=[];this._makePutBoneList(this._currentGeo.baseFrame.parentName,nV);for(let xV=0;xV<this._currentGeo.BoneInfs.length;xV++){var JV=0;for(let uV=0;uV<nV.length;uV++)if(nV[uV].name===this._currentGeo.BoneInfs[xV].boneName){JV=uV,nV[uV].OffsetMatrix=new J.Matrix4,nV[uV].OffsetMatrix.copy(this._currentGeo.BoneInfs[xV].OffsetMatrix);break}for(let uV=0;uV<this._currentGeo.BoneInfs[xV].Indeces.length;uV++){var aV=this._currentGeo.BoneInfs[xV].Indeces[uV],GV=this._currentGeo.BoneInfs[xV].Weights[uV],YV=aV*4;switch(this._currentGeo.VertexSetedBoneCount[aV]){case 0:this._currentGeo.GeometryData.skinIndices[YV]=JV,this._currentGeo.GeometryData.skinWeights[YV]=GV;break;case 1:this._currentGeo.GeometryData.skinIndices[YV+1]=JV,this._currentGeo.GeometryData.skinWeights[YV+1]=GV;break;case 2:this._currentGeo.GeometryData.skinIndices[YV+2]=JV,this._currentGeo.GeometryData.skinWeights[YV+2]=GV;break;case 3:this._currentGeo.GeometryData.skinIndices[YV+3]=JV,this._currentGeo.GeometryData.skinWeights[YV+3]=GV;break}this._currentGeo.VertexSetedBoneCount[aV]++,this._currentGeo.VertexSetedBoneCount[aV]>4&&console.log("warn! over 4 bone weight! :"+aV)}}for(let xV=0;xV<this._currentGeo.Materials.length;xV++)this._currentGeo.Materials[xV].skinning=!0;var tV=[];for(let xV=0;xV<nV.length;xV++)nV[xV].OffsetMatrix?tV.push(nV[xV].OffsetMatrix):tV.push(new J.Matrix4);var kV=this._buildGeometry();gV=new J.SkinnedMesh(kV,this._currentGeo.Materials.length===1?this._currentGeo.Materials[0]:this._currentGeo.Materials),this._initSkeleton(gV,nV,tV)}else{var AV=this._buildGeometry();gV=new J.Mesh(AV,this._currentGeo.Materials.length===1?this._currentGeo.Materials[0]:this._currentGeo.Materials)}gV.name=this._currentGeo.name;var XV=new J.Matrix4,MV=this._currentGeo.baseFrame.putBone;if(MV&&MV.parent){for(;MV=MV.parent,MV;)XV.multiply(MV.FrameTransformMatrix);gV.applyMatrix4(XV)}this.Meshes.push(gV)}},{key:"_initSkeleton",value:function(gV,nV,JV){var aV=[],GV,YV,tV,kV;for(tV=0,kV=nV.length;tV<kV;tV++)YV=nV[tV],GV=new J.Bone,aV.push(GV),GV.name=YV.name,GV.position.fromArray(YV.pos),GV.quaternion.fromArray(YV.rotq),YV.scl!==void 0&&GV.scale.fromArray(YV.scl);for(tV=0,kV=nV.length;tV<kV;tV++)YV=nV[tV],YV.parent!==-1&&YV.parent!==null&&aV[YV.parent]!==void 0?aV[YV.parent].add(aV[tV]):gV.add(aV[tV]);gV.updateMatrixWorld(!0);var AV=new J.Skeleton(aV,JV);gV.bind(AV,gV.matrixWorld)}},{key:"_readAnimationKey",value:function(){var gV=0,nV=this._currentObject.data.indexOf(";",gV),JV=this._currentObject.data.substr(gV,nV-gV);gV=nV+1;var aV=parseInt(this._readLine(JV));nV=this._currentObject.data.indexOf(";",gV),gV=nV+1,JV=this._currentObject.data.substr(gV);var GV=this._readLine(JV.trim()).split(";;,");for(let XV=0;XV<GV.length;XV++){var YV=GV[XV].split(";"),tV=new CV;if(tV.type=aV,tV.Frame=parseInt(YV[0]),tV.index=this._currentAnimeFrames.keyFrames.length,tV.time=tV.Frame,aV!=4){var kV=!1;for(let MV=0;MV<this._currentAnimeFrames.keyFrames.length;MV++)if(this._currentAnimeFrames.keyFrames[MV].Frame===tV.Frame){tV=this._currentAnimeFrames.keyFrames[MV],kV=!0;break}var AV=YV[2].split(",");switch(aV){case 0:tV.rot=new J.Quaternion(parseFloat(AV[1]),parseFloat(AV[2]),parseFloat(AV[3]),parseFloat(AV[0])*-1);break;case 1:tV.scl=new J.Vector3(parseFloat(AV[0]),parseFloat(AV[1]),parseFloat(AV[2]));break;case 2:tV.pos=new J.Vector3(parseFloat(AV[0]),parseFloat(AV[1]),parseFloat(AV[2]));break}kV||this._currentAnimeFrames.keyFrames.push(tV)}else tV.matrix=new J.Matrix4,this._ParseMatrixData(tV.matrix,YV[2].split(",")),this._currentAnimeFrames.keyFrames.push(tV)}}},{key:"_makeOutputAnimation",value:function(){var gV=new dV(this.options);gV.fps=this.animTicksPerSecond,gV.name=this._currentAnime.name,gV.make(this._currentAnime.AnimeFrames),this.animations.push(gV)}},{key:"assignAnimation",value:function(gV,nV){var JV=gV,aV=nV;if(JV||(JV=this.Meshes[0]),aV||(aV=this.animations[0]),!JV||!aV)return null;var GV={};GV.fps=aV.fps,GV.name=aV.name,GV.length=aV.length,GV.hierarchy=[];for(let AV=0;AV<JV.skeleton.bones.length;AV++){var YV=!1;for(let XV=0;XV<aV.hierarchy.length;XV++)if(JV.skeleton.bones[AV].name===aV.hierarchy[XV].name){YV=!0;var tV=aV.hierarchy[XV].copy();if(tV.parent=-1,JV.skeleton.bones[AV].parent&&JV.skeleton.bones[AV].parent.type==="Bone")for(let MV=0;MV<GV.hierarchy.length;MV++)GV.hierarchy[MV].name===JV.skeleton.bones[AV].parent.name&&(tV.parent=MV,tV.parentName=JV.skeleton.bones[AV].parent.name);GV.hierarchy.push(tV);break}if(!YV){var kV=aV.hierarchy[0].copy();kV.name=JV.skeleton.bones[AV].name,kV.parent=-1;for(let XV=0;XV<kV.keys.length;XV++)kV.keys[XV].pos&&kV.keys[XV].pos.set(0,0,0),kV.keys[XV].scl&&kV.keys[XV].scl.set(1,1,1),kV.keys[XV].rot&&kV.keys[XV].rot.set(0,0,0,1);GV.hierarchy.push(kV)}}return JV.geometry.animations||(JV.geometry.animations=[]),JV.geometry.animations.push(J.AnimationClip.parseAnimation(GV,JV.skeleton.bones)),JV.animationMixer||(JV.animationMixer=new J.AnimationMixer(JV)),GV}},{key:"_ParseMatrixData",value:function(gV,nV){gV.set(parseFloat(nV[0]),parseFloat(nV[4]),parseFloat(nV[8]),parseFloat(nV[12]),parseFloat(nV[1]),parseFloat(nV[5]),parseFloat(nV[9]),parseFloat(nV[13]),parseFloat(nV[2]),parseFloat(nV[6]),parseFloat(nV[10]),parseFloat(nV[14]),parseFloat(nV[3]),parseFloat(nV[7]),parseFloat(nV[11]),parseFloat(nV[15]))}}]),NV}();return FV}();lV.XLoader=RV}(XLoader)),XLoader}var BVHLoader={},hasRequiredBVHLoader;function requireBVHLoader(){return hasRequiredBVHLoader||(hasRequiredBVHLoader=1,function(lV){Object.defineProperty(lV,Symbol.toStringTag,{value:"Module"});const J=requireThree();class VV extends J.Loader{constructor(UV){super(UV),this.animateBonePositions=!0,this.animateBoneRotations=!0}load(UV,ZV,WV,IV){const dV=this,CV=new J.FileLoader(dV.manager);CV.setPath(dV.path),CV.setRequestHeader(dV.requestHeader),CV.setWithCredentials(dV.withCredentials),CV.load(UV,function(FV){try{ZV(dV.parse(FV))}catch(NV){IV?IV(NV):console.error(NV),dV.manager.itemError(UV)}},WV,IV)}parse(UV){function ZV(aV){FV(aV)!=="HIERARCHY"&&console.error("THREE.BVHLoader: HIERARCHY expected.");const GV=[],YV=IV(aV,FV(aV),GV);FV(aV)!=="MOTION"&&console.error("THREE.BVHLoader: MOTION expected.");let tV=FV(aV).split(/[\s]+/);const kV=parseInt(tV[1]);isNaN(kV)&&console.error("THREE.BVHLoader: Failed to read number of frames."),tV=FV(aV).split(/[\s]+/);const AV=parseFloat(tV[2]);isNaN(AV)&&console.error("THREE.BVHLoader: Failed to read frame time.");for(let XV=0;XV<kV;XV++)tV=FV(aV).split(/[\s]+/),WV(tV,XV*AV,YV);return GV}function WV(aV,GV,YV){if(YV.type==="ENDSITE")return;const tV={time:GV,position:new J.Vector3,rotation:new J.Quaternion};YV.frames.push(tV);const kV=new J.Quaternion,AV=new J.Vector3(1,0,0),XV=new J.Vector3(0,1,0),MV=new J.Vector3(0,0,1);for(let xV=0;xV<YV.channels.length;xV++)switch(YV.channels[xV]){case"Xposition":tV.position.x=parseFloat(aV.shift().trim());break;case"Yposition":tV.position.y=parseFloat(aV.shift().trim());break;case"Zposition":tV.position.z=parseFloat(aV.shift().trim());break;case"Xrotation":kV.setFromAxisAngle(AV,parseFloat(aV.shift().trim())*Math.PI/180),tV.rotation.multiply(kV);break;case"Yrotation":kV.setFromAxisAngle(XV,parseFloat(aV.shift().trim())*Math.PI/180),tV.rotation.multiply(kV);break;case"Zrotation":kV.setFromAxisAngle(MV,parseFloat(aV.shift().trim())*Math.PI/180),tV.rotation.multiply(kV);break;default:console.warn("THREE.BVHLoader: Invalid channel type.")}for(let xV=0;xV<YV.children.length;xV++)WV(aV,GV,YV.children[xV])}function IV(aV,GV,YV){const tV={name:"",type:"",frames:[]};YV.push(tV);let kV=GV.split(/[\s]+/);kV[0].toUpperCase()==="END"&&kV[1].toUpperCase()==="SITE"?(tV.type="ENDSITE",tV.name="ENDSITE"):(tV.name=kV[1],tV.type=kV[0].toUpperCase()),FV(aV)!=="{"&&console.error("THREE.BVHLoader: Expected opening { after type & name"),kV=FV(aV).split(/[\s]+/),kV[0]!=="OFFSET"&&console.error("THREE.BVHLoader: Expected OFFSET but got: "+kV[0]),kV.length!==4&&console.error("THREE.BVHLoader: Invalid number of values for OFFSET.");const AV=new J.Vector3(parseFloat(kV[1]),parseFloat(kV[2]),parseFloat(kV[3]));if((isNaN(AV.x)||isNaN(AV.y)||isNaN(AV.z))&&console.error("THREE.BVHLoader: Invalid values of OFFSET."),tV.offset=AV,tV.type!=="ENDSITE"){kV=FV(aV).split(/[\s]+/),kV[0]!=="CHANNELS"&&console.error("THREE.BVHLoader: Expected CHANNELS definition.");const XV=parseInt(kV[1]);tV.channels=kV.splice(2,XV),tV.children=[]}for(;;){const XV=FV(aV);if(XV==="}")return tV;tV.children.push(IV(aV,XV,YV))}}function dV(aV,GV){const YV=new J.Bone;if(GV.push(YV),YV.position.add(aV.offset),YV.name=aV.name,aV.type!=="ENDSITE")for(let tV=0;tV<aV.children.length;tV++)YV.add(dV(aV.children[tV],GV));return YV}function CV(aV){const GV=[];for(let YV=0;YV<aV.length;YV++){const tV=aV[YV];if(tV.type==="ENDSITE")continue;const kV=[],AV=[],XV=[];for(let MV=0;MV<tV.frames.length;MV++){const xV=tV.frames[MV];kV.push(xV.time),AV.push(xV.position.x+tV.offset.x),AV.push(xV.position.y+tV.offset.y),AV.push(xV.position.z+tV.offset.z),XV.push(xV.rotation.x),XV.push(xV.rotation.y),XV.push(xV.rotation.z),XV.push(xV.rotation.w)}NV.animateBonePositions&&GV.push(new J.VectorKeyframeTrack(".bones["+tV.name+"].position",kV,AV)),NV.animateBoneRotations&&GV.push(new J.QuaternionKeyframeTrack(".bones["+tV.name+"].quaternion",kV,XV))}return new J.AnimationClip("animation",-1,GV)}function FV(aV){let GV;for(;(GV=aV.shift().trim()).length===0;);return GV}const NV=this,eV=UV.split(/[\r\n]+/g),gV=ZV(eV),nV=[];dV(gV[0],nV);const JV=CV(gV);return{skeleton:new J.Skeleton(nV),clip:JV}}}lV.BVHLoader=VV}(BVHLoader)),BVHLoader}var KMZLoader={},ColladaLoader={},hasRequiredColladaLoader;function requireColladaLoader(){return hasRequiredColladaLoader||(hasRequiredColladaLoader=1,function(lV){Object.defineProperty(lV,Symbol.toStringTag,{value:"Module"});const J=requireThree(),VV=requireTGALoader(),RV=requireUv1();class UV extends J.Loader{constructor(WV){super(WV)}load(WV,IV,dV,CV){const FV=this,NV=FV.path===""?J.LoaderUtils.extractUrlBase(WV):FV.path,eV=new J.FileLoader(FV.manager);eV.setPath(FV.path),eV.setRequestHeader(FV.requestHeader),eV.setWithCredentials(FV.withCredentials),eV.load(WV,function(gV){try{IV(FV.parse(gV,NV))}catch(nV){CV?CV(nV):console.error(nV),FV.manager.itemError(WV)}},dV,CV)}parse(WV,IV){function dV(jU,MU){const DU=[],RZ=jU.childNodes;for(let vU=0,TW=RZ.length;vU<TW;vU++){const KZ=RZ[vU];KZ.nodeName===MU&&DU.push(KZ)}return DU}function CV(jU){if(jU.length===0)return[];const MU=jU.trim().split(/\s+/),DU=new Array(MU.length);for(let RZ=0,vU=MU.length;RZ<vU;RZ++)DU[RZ]=MU[RZ];return DU}function FV(jU){if(jU.length===0)return[];const MU=jU.trim().split(/\s+/),DU=new Array(MU.length);for(let RZ=0,vU=MU.length;RZ<vU;RZ++)DU[RZ]=parseFloat(MU[RZ]);return DU}function NV(jU){if(jU.length===0)return[];const MU=jU.trim().split(/\s+/),DU=new Array(MU.length);for(let RZ=0,vU=MU.length;RZ<vU;RZ++)DU[RZ]=parseInt(MU[RZ]);return DU}function eV(jU){return jU.substring(1)}function gV(){return"three_default_"+iI++}function nV(jU){return Object.keys(jU).length===0}function JV(jU){return{unit:aV(dV(jU,"unit")[0]),upAxis:GV(dV(jU,"up_axis")[0])}}function aV(jU){return jU!==void 0&&jU.hasAttribute("meter")===!0?parseFloat(jU.getAttribute("meter")):1}function GV(jU){return jU!==void 0?jU.textContent:"Y_UP"}function YV(jU,MU,DU,RZ){const vU=dV(jU,MU)[0];if(vU!==void 0){const TW=dV(vU,DU);for(let KZ=0;KZ<TW.length;KZ++)RZ(TW[KZ])}}function tV(jU,MU){for(const DU in jU){const RZ=jU[DU];RZ.build=MU(jU[DU])}}function kV(jU,MU){return jU.build!==void 0||(jU.build=MU(jU)),jU.build}function AV(jU){const MU={sources:{},samplers:{},channels:{}};let DU=!1;for(let RZ=0,vU=jU.childNodes.length;RZ<vU;RZ++){const TW=jU.childNodes[RZ];if(TW.nodeType!==1)continue;let KZ;switch(TW.nodeName){case"source":KZ=TW.getAttribute("id"),MU.sources[KZ]=MW(TW);break;case"sampler":KZ=TW.getAttribute("id"),MU.samplers[KZ]=XV(TW);break;case"channel":KZ=TW.getAttribute("target"),MU.channels[KZ]=MV(TW);break;case"animation":AV(TW),DU=!0;break;default:console.log(TW)}}DU===!1&&(nI.animations[jU.getAttribute("id")||J.MathUtils.generateUUID()]=MU)}function XV(jU){const MU={inputs:{}};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"input":const TW=eV(vU.getAttribute("source")),KZ=vU.getAttribute("semantic");MU.inputs[KZ]=TW;break}}return MU}function MV(jU){const MU={};let RZ=jU.getAttribute("target").split("/");const vU=RZ.shift();let TW=RZ.shift();const KZ=TW.indexOf("(")!==-1,XI=TW.indexOf(".")!==-1;if(XI)RZ=TW.split("."),TW=RZ.shift(),MU.member=RZ.shift();else if(KZ){const DW=TW.split("(");TW=DW.shift();for(let yI=0;yI<DW.length;yI++)DW[yI]=parseInt(DW[yI].replace(/\)/,""));MU.indices=DW}return MU.id=vU,MU.sid=TW,MU.arraySyntax=KZ,MU.memberSyntax=XI,MU.sampler=eV(jU.getAttribute("source")),MU}function xV(jU){const MU=[],DU=jU.channels,RZ=jU.samplers,vU=jU.sources;for(const TW in DU)if(DU.hasOwnProperty(TW)){const KZ=DU[TW],XI=RZ[KZ.sampler],DW=XI.inputs.INPUT,yI=XI.inputs.OUTPUT,CI=vU[DW],FI=vU[yI],rd=wV(KZ,CI,FI);al(rd,MU)}return MU}function uV(jU){return kV(nI.animations[jU],xV)}function wV(jU,MU,DU){const RZ=nI.nodes[jU.id],vU=sZ(RZ.id),TW=RZ.transforms[jU.sid],KZ=RZ.matrix.clone().transpose();let XI,DW,yI,CI,FI,rd;const Nd={};switch(TW){case"matrix":for(yI=0,CI=MU.array.length;yI<CI;yI++)if(XI=MU.array[yI],DW=yI*DU.stride,Nd[XI]===void 0&&(Nd[XI]={}),jU.arraySyntax===!0){const zd=DU.array[DW],UC=jU.indices[0]+4*jU.indices[1];Nd[XI][UC]=zd}else for(FI=0,rd=DU.stride;FI<rd;FI++)Nd[XI][FI]=DU.array[DW+FI];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',TW);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',TW);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',TW);break}const WC=vV(Nd,KZ);return{name:vU.uuid,keyframes:WC}}function vV(jU,MU){const DU=[];for(const vU in jU)DU.push({time:parseFloat(vU),value:jU[vU]});DU.sort(RZ);for(let vU=0;vU<16;vU++)el(DU,vU,MU.elements[vU]);return DU;function RZ(vU,TW){return vU.time-TW.time}}const yV=new J.Vector3,ll=new J.Vector3,Nl=new J.Quaternion;function al(jU,MU){const DU=jU.keyframes,RZ=jU.name,vU=[],TW=[],KZ=[],XI=[];for(let DW=0,yI=DU.length;DW<yI;DW++){const CI=DU[DW],FI=CI.time,rd=CI.value;HZ.fromArray(rd).transpose(),HZ.decompose(yV,Nl,ll),vU.push(FI),TW.push(yV.x,yV.y,yV.z),KZ.push(Nl.x,Nl.y,Nl.z,Nl.w),XI.push(ll.x,ll.y,ll.z)}return TW.length>0&&MU.push(new J.VectorKeyframeTrack(RZ+".position",vU,TW)),KZ.length>0&&MU.push(new J.QuaternionKeyframeTrack(RZ+".quaternion",vU,KZ)),XI.length>0&&MU.push(new J.VectorKeyframeTrack(RZ+".scale",vU,XI)),MU}function el(jU,MU,DU){let RZ,vU=!0,TW,KZ;for(TW=0,KZ=jU.length;TW<KZ;TW++)RZ=jU[TW],RZ.value[MU]===void 0?RZ.value[MU]=null:vU=!1;if(vU===!0)for(TW=0,KZ=jU.length;TW<KZ;TW++)RZ=jU[TW],RZ.value[MU]=DU;else qV(jU,MU)}function qV(jU,MU){let DU,RZ;for(let vU=0,TW=jU.length;vU<TW;vU++){const KZ=jU[vU];if(KZ.value[MU]===null){if(DU=fV(jU,vU,MU),RZ=Ul(jU,vU,MU),DU===null){KZ.value[MU]=RZ.value[MU];continue}if(RZ===null){KZ.value[MU]=DU.value[MU];continue}Cl(KZ,DU,RZ,MU)}}}function fV(jU,MU,DU){for(;MU>=0;){const RZ=jU[MU];if(RZ.value[DU]!==null)return RZ;MU--}return null}function Ul(jU,MU,DU){for(;MU<jU.length;){const RZ=jU[MU];if(RZ.value[DU]!==null)return RZ;MU++}return null}function Cl(jU,MU,DU,RZ){if(DU.time-MU.time===0){jU.value[RZ]=MU.value[RZ];return}jU.value[RZ]=(jU.time-MU.time)*(DU.value[RZ]-MU.value[RZ])/(DU.time-MU.time)+MU.value[RZ]}function Il(jU){const MU={name:jU.getAttribute("id")||"default",start:parseFloat(jU.getAttribute("start")||0),end:parseFloat(jU.getAttribute("end")||0),animations:[]};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"instance_animation":MU.animations.push(eV(vU.getAttribute("url")));break}}nI.clips[jU.getAttribute("id")]=MU}function Jl(jU){const MU=[],DU=jU.name,RZ=jU.end-jU.start||-1,vU=jU.animations;for(let TW=0,KZ=vU.length;TW<KZ;TW++){const XI=uV(vU[TW]);for(let DW=0,yI=XI.length;DW<yI;DW++)MU.push(XI[DW])}return new J.AnimationClip(DU,RZ,MU)}function Bl(jU){return kV(nI.clips[jU],Jl)}function kl(jU){const MU={};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"skin":MU.id=eV(vU.getAttribute("source")),MU.skin=ol(vU);break;case"morph":MU.id=eV(vU.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}nI.controllers[jU.getAttribute("id")]=MU}function ol(jU){const MU={sources:{}};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"bind_shape_matrix":MU.bindShapeMatrix=FV(vU.textContent);break;case"source":const TW=vU.getAttribute("id");MU.sources[TW]=MW(vU);break;case"joints":MU.joints=xl(vU);break;case"vertex_weights":MU.vertexWeights=wl(vU);break}}return MU}function xl(jU){const MU={inputs:{}};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"input":const TW=vU.getAttribute("semantic"),KZ=eV(vU.getAttribute("source"));MU.inputs[TW]=KZ;break}}return MU}function wl(jU){const MU={inputs:{}};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"input":const TW=vU.getAttribute("semantic"),KZ=eV(vU.getAttribute("source")),XI=parseInt(vU.getAttribute("offset"));MU.inputs[TW]={id:KZ,offset:XI};break;case"vcount":MU.vcount=NV(vU.textContent);break;case"v":MU.v=NV(vU.textContent);break}}return MU}function Pl(jU){const MU={id:jU.id},DU=nI.geometries[MU.id];return jU.skin!==void 0&&(MU.skin=zl(jU.skin),DU.sources.skinIndices=MU.skin.indices,DU.sources.skinWeights=MU.skin.weights),MU}function zl(jU){const DU={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},RZ=jU.sources,vU=jU.vertexWeights,TW=vU.vcount,KZ=vU.v,XI=vU.inputs.JOINT.offset,DW=vU.inputs.WEIGHT.offset,yI=jU.sources[jU.joints.inputs.JOINT],CI=jU.sources[jU.joints.inputs.INV_BIND_MATRIX],FI=RZ[vU.inputs.WEIGHT.id].array;let rd=0,Nd,WC,kd;for(Nd=0,kd=TW.length;Nd<kd;Nd++){const UC=TW[Nd],bd=[];for(WC=0;WC<UC;WC++){const Id=KZ[rd+XI],EC=KZ[rd+DW],ZF=FI[EC];bd.push({index:Id,weight:ZF}),rd+=2}for(bd.sort(zd),WC=0;WC<4;WC++){const Id=bd[WC];Id!==void 0?(DU.indices.array.push(Id.index),DU.weights.array.push(Id.weight)):(DU.indices.array.push(0),DU.weights.array.push(0))}}for(jU.bindShapeMatrix?DU.bindMatrix=new J.Matrix4().fromArray(jU.bindShapeMatrix).transpose():DU.bindMatrix=new J.Matrix4().identity(),Nd=0,kd=yI.array.length;Nd<kd;Nd++){const UC=yI.array[Nd],bd=new J.Matrix4().fromArray(CI.array,Nd*CI.stride).transpose();DU.joints.push({name:UC,boneInverse:bd})}return DU;function zd(UC,bd){return bd.weight-UC.weight}}function Tl(jU){return kV(nI.controllers[jU],Pl)}function Al(jU){const MU={init_from:dV(jU,"init_from")[0].textContent};nI.images[jU.getAttribute("id")]=MU}function Ol(jU){return jU.build!==void 0?jU.build:jU.init_from}function RR(jU){const MU=nI.images[jU];return MU!==void 0?kV(MU,Ol):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",jU),null)}function hR(jU){const MU={};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"profile_COMMON":MU.profile=gR(vU);break}}nI.effects[jU.getAttribute("id")]=MU}function gR(jU){const MU={surfaces:{},samplers:{}};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"newparam":sR(vU,MU);break;case"technique":MU.technique=MR(vU);break;case"extra":MU.extra=sU(vU);break}}return MU}function sR(jU,MU){const DU=jU.getAttribute("sid");for(let RZ=0,vU=jU.childNodes.length;RZ<vU;RZ++){const TW=jU.childNodes[RZ];if(TW.nodeType===1)switch(TW.nodeName){case"surface":MU.surfaces[DU]=tR(TW);break;case"sampler2D":MU.samplers[DU]=pR(TW);break}}}function tR(jU){const MU={};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"init_from":MU.init_from=vU.textContent;break}}return MU}function pR(jU){const MU={};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"source":MU.source=vU.textContent;break}}return MU}function MR(jU){const MU={};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"constant":case"lambert":case"blinn":case"phong":MU.type=vU.nodeName,MU.parameters=cR(vU);break;case"extra":MU.extra=sU(vU);break}}return MU}function cR(jU){const MU={};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":MU[vU.nodeName]=mR(vU);break;case"transparent":MU[vU.nodeName]={opaque:vU.hasAttribute("opaque")?vU.getAttribute("opaque"):"A_ONE",data:mR(vU)};break}}return MU}function mR(jU){const MU={};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"color":MU[vU.nodeName]=FV(vU.textContent);break;case"float":MU[vU.nodeName]=parseFloat(vU.textContent);break;case"texture":MU[vU.nodeName]={id:vU.getAttribute("texture"),extra:zR(vU)};break}}return MU}function zR(jU){const MU={technique:{}};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"extra":XR(vU,MU);break}}return MU}function XR(jU,MU){for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"technique":ZU(vU,MU);break}}}function ZU(jU,MU){for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":MU.technique[vU.nodeName]=parseFloat(vU.textContent);break;case"wrapU":case"wrapV":vU.textContent.toUpperCase()==="TRUE"?MU.technique[vU.nodeName]=1:vU.textContent.toUpperCase()==="FALSE"?MU.technique[vU.nodeName]=0:MU.technique[vU.nodeName]=parseInt(vU.textContent);break;case"bump":MU[vU.nodeName]=KR(vU);break}}}function sU(jU){const MU={};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"technique":MU.technique=rU(vU);break}}return MU}function rU(jU){const MU={};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"double_sided":MU[vU.nodeName]=parseInt(vU.textContent);break;case"bump":MU[vU.nodeName]=KR(vU);break}}return MU}function KR(jU){for(var MU={},DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){var vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"texture":MU[vU.nodeName]={id:vU.getAttribute("texture"),texcoord:vU.getAttribute("texcoord"),extra:zR(vU)};break}}return MU}function HR(jU){return jU}function eU(jU){return kV(nI.effects[jU],HR)}function BR(jU){const MU={name:jU.getAttribute("name")};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"instance_effect":MU.url=eV(vU.getAttribute("url"));break}}nI.materials[jU.getAttribute("id")]=MU}function vl(jU){let MU,DU=jU.slice((jU.lastIndexOf(".")-1>>>0)+2);switch(DU=DU.toLowerCase(),DU){case"tga":MU=bW;break;default:MU=rW}return MU}function ER(jU){const MU=eU(jU.url),DU=MU.profile.technique;let RZ;switch(DU.type){case"phong":case"blinn":RZ=new J.MeshPhongMaterial;break;case"lambert":RZ=new J.MeshLambertMaterial;break;default:RZ=new J.MeshBasicMaterial;break}RZ.name=jU.name||"";function vU(DW){const yI=MU.profile.samplers[DW.id];let CI=null;if(yI!==void 0){const FI=MU.profile.surfaces[yI.source];CI=RR(FI.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),CI=RR(DW.id);if(CI!==null){const FI=vl(CI);if(FI!==void 0){const rd=FI.load(CI),Nd=DW.extra;if(Nd!==void 0&&Nd.technique!==void 0&&nV(Nd.technique)===!1){const WC=Nd.technique;rd.wrapS=WC.wrapU?J.RepeatWrapping:J.ClampToEdgeWrapping,rd.wrapT=WC.wrapV?J.RepeatWrapping:J.ClampToEdgeWrapping,rd.offset.set(WC.offsetU||0,WC.offsetV||0),rd.repeat.set(WC.repeatU||1,WC.repeatV||1)}else rd.wrapS=J.RepeatWrapping,rd.wrapT=J.RepeatWrapping;return rd}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",CI),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",DW.id),null}const TW=DU.parameters;for(const DW in TW){const yI=TW[DW];switch(DW){case"diffuse":yI.color&&RZ.color.fromArray(yI.color),yI.texture&&(RZ.map=vU(yI.texture));break;case"specular":yI.color&&RZ.specular&&RZ.specular.fromArray(yI.color),yI.texture&&(RZ.specularMap=vU(yI.texture));break;case"bump":yI.texture&&(RZ.normalMap=vU(yI.texture));break;case"ambient":yI.texture&&(RZ.lightMap=vU(yI.texture));break;case"shininess":yI.float&&RZ.shininess&&(RZ.shininess=yI.float);break;case"emission":yI.color&&RZ.emissive&&RZ.emissive.fromArray(yI.color),yI.texture&&(RZ.emissiveMap=vU(yI.texture));break}}let KZ=TW.transparent,XI=TW.transparency;if(XI===void 0&&KZ&&(XI={float:1}),KZ===void 0&&XI&&(KZ={opaque:"A_ONE",data:{color:[1,1,1,1]}}),KZ&&XI)if(KZ.data.texture)RZ.transparent=!0;else{const DW=KZ.data.color;switch(KZ.opaque){case"A_ONE":RZ.opacity=DW[3]*XI.float;break;case"RGB_ZERO":RZ.opacity=1-DW[0]*XI.float;break;case"A_ZERO":RZ.opacity=1-DW[3]*XI.float;break;case"RGB_ONE":RZ.opacity=DW[0]*XI.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',KZ.opaque)}RZ.opacity<1&&(RZ.transparent=!0)}if(DU.extra!==void 0&&DU.extra.technique!==void 0){const DW=DU.extra.technique;for(const yI in DW){const CI=DW[yI];switch(yI){case"double_sided":RZ.side=CI===1?J.DoubleSide:J.FrontSide;break;case"bump":RZ.normalMap=vU(CI.texture),RZ.normalScale=new J.Vector2(1,1);break}}}return RZ}function iR(jU){return kV(nI.materials[jU],ER)}function TR(jU){const MU={name:jU.getAttribute("name")};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"optics":MU.optics=PR(vU);break}}nI.cameras[jU.getAttribute("id")]=MU}function PR(jU){for(let MU=0;MU<jU.childNodes.length;MU++){const DU=jU.childNodes[MU];switch(DU.nodeName){case"technique_common":return RU(DU)}}return{}}function RU(jU){const MU={};for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];switch(RZ.nodeName){case"perspective":case"orthographic":MU.technique=RZ.nodeName,MU.parameters=nU(RZ);break}}return MU}function nU(jU){const MU={};for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];switch(RZ.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":MU[RZ.nodeName]=parseFloat(RZ.textContent);break}}return MU}function FR(jU){let MU;switch(jU.optics.technique){case"perspective":MU=new J.PerspectiveCamera(jU.optics.parameters.yfov,jU.optics.parameters.aspect_ratio,jU.optics.parameters.znear,jU.optics.parameters.zfar);break;case"orthographic":let DU=jU.optics.parameters.ymag,RZ=jU.optics.parameters.xmag;const vU=jU.optics.parameters.aspect_ratio;RZ=RZ===void 0?DU*vU:RZ,DU=DU===void 0?RZ/vU:DU,RZ*=.5,DU*=.5,MU=new J.OrthographicCamera(-RZ,RZ,DU,-DU,jU.optics.parameters.znear,jU.optics.parameters.zfar);break;default:MU=new J.PerspectiveCamera;break}return MU.name=jU.name||"",MU}function dU(jU){const MU=nI.cameras[jU];return MU!==void 0?kV(MU,FR):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",jU),null)}function NU(jU){let MU={};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"technique_common":MU=OU(vU);break}}nI.lights[jU.getAttribute("id")]=MU}function OU(jU){const MU={};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"directional":case"point":case"spot":case"ambient":MU.technique=vU.nodeName,MU.parameters=MZ(vU)}}return MU}function MZ(jU){const MU={};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"color":const TW=FV(vU.textContent);MU.color=new J.Color().fromArray(TW);break;case"falloff_angle":MU.falloffAngle=parseFloat(vU.textContent);break;case"quadratic_attenuation":const KZ=parseFloat(vU.textContent);MU.distance=KZ?Math.sqrt(1/KZ):0;break}}return MU}function jZ(jU){let MU;switch(jU.technique){case"directional":MU=new J.DirectionalLight;break;case"point":MU=new J.PointLight;break;case"spot":MU=new J.SpotLight;break;case"ambient":MU=new J.AmbientLight;break}return jU.parameters.color&&MU.color.copy(jU.parameters.color),jU.parameters.distance&&(MU.distance=jU.parameters.distance),MU}function OZ(jU){const MU=nI.lights[jU];return MU!==void 0?kV(MU,jZ):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",jU),null)}function oZ(jU){const MU={name:jU.getAttribute("name"),sources:{},vertices:{},primitives:[]},DU=dV(jU,"mesh")[0];if(DU!==void 0){for(let RZ=0;RZ<DU.childNodes.length;RZ++){const vU=DU.childNodes[RZ];if(vU.nodeType!==1)continue;const TW=vU.getAttribute("id");switch(vU.nodeName){case"source":MU.sources[TW]=MW(vU);break;case"vertices":MU.vertices=LU(vU);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",vU.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":MU.primitives.push(hW(vU));break;default:console.log(vU)}}nI.geometries[jU.getAttribute("id")]=MU}}function MW(jU){const MU={array:[],stride:3};for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];if(RZ.nodeType===1)switch(RZ.nodeName){case"float_array":MU.array=FV(RZ.textContent);break;case"Name_array":MU.array=CV(RZ.textContent);break;case"technique_common":const vU=dV(RZ,"accessor")[0];vU!==void 0&&(MU.stride=parseInt(vU.getAttribute("stride")));break}}return MU}function LU(jU){const MU={};for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];RZ.nodeType===1&&(MU[RZ.getAttribute("semantic")]=eV(RZ.getAttribute("source")))}return MU}function hW(jU){const MU={type:jU.nodeName,material:jU.getAttribute("material"),count:parseInt(jU.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let DU=0,RZ=jU.childNodes.length;DU<RZ;DU++){const vU=jU.childNodes[DU];if(vU.nodeType===1)switch(vU.nodeName){case"input":const TW=eV(vU.getAttribute("source")),KZ=vU.getAttribute("semantic"),XI=parseInt(vU.getAttribute("offset")),DW=parseInt(vU.getAttribute("set")),yI=DW>0?KZ+DW:KZ;MU.inputs[yI]={id:TW,offset:XI},MU.stride=Math.max(MU.stride,XI+1),KZ==="TEXCOORD"&&(MU.hasUV=!0);break;case"vcount":MU.vcount=NV(vU.textContent);break;case"p":MU.p=NV(vU.textContent);break}}return MU}function CW(jU){const MU={};for(let DU=0;DU<jU.length;DU++){const RZ=jU[DU];MU[RZ.type]===void 0&&(MU[RZ.type]=[]),MU[RZ.type].push(RZ)}return MU}function iW(jU){let MU=0;for(let DU=0,RZ=jU.length;DU<RZ;DU++)jU[DU].hasUV===!0&&MU++;MU>0&&MU<jU.length&&(jU.uvsNeedsFix=!0)}function _W(jU){const MU={},DU=jU.sources,RZ=jU.vertices,vU=jU.primitives;if(vU.length===0)return{};const TW=CW(vU);for(const KZ in TW){const XI=TW[KZ];iW(XI),MU[KZ]=KW(XI,DU,RZ)}return MU}function KW(jU,MU,DU){const RZ={},vU={array:[],stride:0},TW={array:[],stride:0},KZ={array:[],stride:0},XI={array:[],stride:0},DW={array:[],stride:0},yI={array:[],stride:4},CI={array:[],stride:4},FI=new J.BufferGeometry,rd=[];let Nd=0;for(let WC=0;WC<jU.length;WC++){const kd=jU[WC],zd=kd.inputs;let UC=0;switch(kd.type){case"lines":case"linestrips":UC=kd.count*2;break;case"triangles":UC=kd.count*3;break;case"polylist":for(let bd=0;bd<kd.count;bd++){const Id=kd.vcount[bd];switch(Id){case 3:UC+=3;break;case 4:UC+=6;break;default:UC+=(Id-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknow primitive type:",kd.type)}FI.addGroup(Nd,UC,WC),Nd+=UC,kd.material&&rd.push(kd.material);for(const bd in zd){const Id=zd[bd];switch(bd){case"VERTEX":for(const EC in DU){const ZF=DU[EC];switch(EC){case"POSITION":const YN=vU.array.length;if(hZ(kd,MU[ZF],Id.offset,vU.array),vU.stride=MU[ZF].stride,MU.skinWeights&&MU.skinIndices&&(hZ(kd,MU.skinIndices,Id.offset,yI.array),hZ(kd,MU.skinWeights,Id.offset,CI.array)),kd.hasUV===!1&&jU.uvsNeedsFix===!0){const WF=(vU.array.length-YN)/vU.stride;for(let ON=0;ON<WF;ON++)KZ.array.push(0,0)}break;case"NORMAL":hZ(kd,MU[ZF],Id.offset,TW.array),TW.stride=MU[ZF].stride;break;case"COLOR":hZ(kd,MU[ZF],Id.offset,DW.array),DW.stride=MU[ZF].stride;break;case"TEXCOORD":hZ(kd,MU[ZF],Id.offset,KZ.array),KZ.stride=MU[ZF].stride;break;case"TEXCOORD1":hZ(kd,MU[ZF],Id.offset,XI.array),KZ.stride=MU[ZF].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',EC)}}break;case"NORMAL":hZ(kd,MU[Id.id],Id.offset,TW.array),TW.stride=MU[Id.id].stride;break;case"COLOR":hZ(kd,MU[Id.id],Id.offset,DW.array),DW.stride=MU[Id.id].stride;break;case"TEXCOORD":hZ(kd,MU[Id.id],Id.offset,KZ.array),KZ.stride=MU[Id.id].stride;break;case"TEXCOORD1":hZ(kd,MU[Id.id],Id.offset,XI.array),XI.stride=MU[Id.id].stride;break}}}return vU.array.length>0&&FI.setAttribute("position",new J.Float32BufferAttribute(vU.array,vU.stride)),TW.array.length>0&&FI.setAttribute("normal",new J.Float32BufferAttribute(TW.array,TW.stride)),DW.array.length>0&&FI.setAttribute("color",new J.Float32BufferAttribute(DW.array,DW.stride)),KZ.array.length>0&&FI.setAttribute("uv",new J.Float32BufferAttribute(KZ.array,KZ.stride)),XI.array.length>0&&FI.setAttribute(RV.UV1,new J.Float32BufferAttribute(XI.array,XI.stride)),yI.array.length>0&&FI.setAttribute("skinIndex",new J.Float32BufferAttribute(yI.array,yI.stride)),CI.array.length>0&&FI.setAttribute("skinWeight",new J.Float32BufferAttribute(CI.array,CI.stride)),RZ.data=FI,RZ.type=jU[0].type,RZ.materialKeys=rd,RZ}function hZ(jU,MU,DU,RZ){const vU=jU.p,TW=jU.stride,KZ=jU.vcount;function XI(CI){let FI=vU[CI+DU]*yI;const rd=FI+yI;for(;FI<rd;FI++)RZ.push(DW[FI])}const DW=MU.array,yI=MU.stride;if(jU.vcount!==void 0){let CI=0;for(let FI=0,rd=KZ.length;FI<rd;FI++){const Nd=KZ[FI];if(Nd===4){const WC=CI+TW*0,kd=CI+TW*1,zd=CI+TW*2,UC=CI+TW*3;XI(WC),XI(kd),XI(UC),XI(kd),XI(zd),XI(UC)}else if(Nd===3){const WC=CI+TW*0,kd=CI+TW*1,zd=CI+TW*2;XI(WC),XI(kd),XI(zd)}else if(Nd>4)for(let WC=1,kd=Nd-2;WC<=kd;WC++){const zd=CI+TW*0,UC=CI+TW*WC,bd=CI+TW*(WC+1);XI(zd),XI(UC),XI(bd)}CI+=TW*Nd}}else for(let CI=0,FI=vU.length;CI<FI;CI+=TW)XI(CI)}function nW(jU){return kV(nI.geometries[jU],_W)}function JW(jU){const MU={name:jU.getAttribute("name")||"",joints:{},links:[]};for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];if(RZ.nodeType===1)switch(RZ.nodeName){case"technique_common":CZ(RZ,MU);break}}nI.kinematicsModels[jU.getAttribute("id")]=MU}function cW(jU){return jU.build!==void 0?jU.build:jU}function oW(jU){return kV(nI.kinematicsModels[jU],cW)}function CZ(jU,MU){for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];if(RZ.nodeType===1)switch(RZ.nodeName){case"joint":MU.joints[RZ.getAttribute("sid")]=IU(RZ);break;case"link":MU.links.push(JU(RZ));break}}}function IU(jU){let MU;for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];if(RZ.nodeType===1)switch(RZ.nodeName){case"prismatic":case"revolute":MU=wR(RZ);break}}return MU}function wR(jU){const MU={sid:jU.getAttribute("sid"),name:jU.getAttribute("name")||"",axis:new J.Vector3,limits:{min:0,max:0},type:jU.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];if(RZ.nodeType===1)switch(RZ.nodeName){case"axis":const vU=FV(RZ.textContent);MU.axis.fromArray(vU);break;case"limits":const TW=RZ.getElementsByTagName("max")[0],KZ=RZ.getElementsByTagName("min")[0];MU.limits.max=parseFloat(TW.textContent),MU.limits.min=parseFloat(KZ.textContent);break}}return MU.limits.min>=MU.limits.max&&(MU.static=!0),MU.middlePosition=(MU.limits.min+MU.limits.max)/2,MU}function JU(jU){const MU={sid:jU.getAttribute("sid"),name:jU.getAttribute("name")||"",attachments:[],transforms:[]};for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];if(RZ.nodeType===1)switch(RZ.nodeName){case"attachment_full":MU.attachments.push(uR(RZ));break;case"matrix":case"translate":case"rotate":MU.transforms.push(BU(RZ));break}}return MU}function uR(jU){const MU={joint:jU.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];if(RZ.nodeType===1)switch(RZ.nodeName){case"link":MU.links.push(JU(RZ));break;case"matrix":case"translate":case"rotate":MU.transforms.push(BU(RZ));break}}return MU}function BU(jU){const MU={type:jU.nodeName},DU=FV(jU.textContent);switch(MU.type){case"matrix":MU.obj=new J.Matrix4,MU.obj.fromArray(DU).transpose();break;case"translate":MU.obj=new J.Vector3,MU.obj.fromArray(DU);break;case"rotate":MU.obj=new J.Vector3,MU.obj.fromArray(DU),MU.angle=J.MathUtils.degToRad(DU[3]);break}return MU}function KU(jU){const MU={name:jU.getAttribute("name")||"",rigidBodies:{}};for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];if(RZ.nodeType===1)switch(RZ.nodeName){case"rigid_body":MU.rigidBodies[RZ.getAttribute("name")]={},_l(RZ,MU.rigidBodies[RZ.getAttribute("name")]);break}}nI.physicsModels[jU.getAttribute("id")]=MU}function _l(jU,MU){for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];if(RZ.nodeType===1)switch(RZ.nodeName){case"technique_common":ql(RZ,MU);break}}}function ql(jU,MU){for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];if(RZ.nodeType===1)switch(RZ.nodeName){case"inertia":MU.inertia=FV(RZ.textContent);break;case"mass":MU.mass=FV(RZ.textContent)[0];break}}}function yR(jU){const MU={bindJointAxis:[]};for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];if(RZ.nodeType===1)switch(RZ.nodeName){case"bind_joint_axis":MU.bindJointAxis.push(GU(RZ));break}}nI.kinematicsScenes[eV(jU.getAttribute("url"))]=MU}function GU(jU){const MU={target:jU.getAttribute("target").split("/").pop()};for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];if(RZ.nodeType===1)switch(RZ.nodeName){case"axis":const vU=RZ.getElementsByTagName("param")[0];MU.axis=vU.textContent;const TW=MU.axis.split("inst_").pop().split("axis")[0];MU.jointIndex=TW.substr(0,TW.length-1);break}}return MU}function uU(jU){return jU.build!==void 0?jU.build:jU}function _U(jU){return kV(nI.kinematicsScenes[jU],uU)}function PU(){const jU=Object.keys(nI.kinematicsModels)[0],MU=Object.keys(nI.kinematicsScenes)[0],DU=Object.keys(nI.visualScenes)[0];if(jU===void 0||MU===void 0)return;const RZ=oW(jU),vU=_U(MU),TW=RW(DU),KZ=vU.bindJointAxis,XI={};for(let CI=0,FI=KZ.length;CI<FI;CI++){const rd=KZ[CI],Nd=AU.querySelector('[sid="'+rd.target+'"]');if(Nd){const WC=Nd.parentElement;DW(rd.jointIndex,WC)}}function DW(CI,FI){const rd=FI.getAttribute("name"),Nd=RZ.joints[CI];TW.traverse(function(WC){WC.name===rd&&(XI[CI]={object:WC,transforms:FW(FI),joint:Nd,position:Nd.zeroPosition})})}const yI=new J.Matrix4;pW={joints:RZ&&RZ.joints,getJointValue:function(CI){const FI=XI[CI];if(FI)return FI.position;console.warn("THREE.ColladaLoader: Joint "+CI+" doesn't exist.")},setJointValue:function(CI,FI){const rd=XI[CI];if(rd){const Nd=rd.joint;if(FI>Nd.limits.max||FI<Nd.limits.min)console.warn("THREE.ColladaLoader: Joint "+CI+" value "+FI+" outside of limits (min: "+Nd.limits.min+", max: "+Nd.limits.max+").");else if(Nd.static)console.warn("THREE.ColladaLoader: Joint "+CI+" is static.");else{const WC=rd.object,kd=Nd.axis,zd=rd.transforms;HZ.identity();for(let UC=0;UC<zd.length;UC++){const bd=zd[UC];if(bd.sid&&bd.sid.indexOf(CI)!==-1)switch(Nd.type){case"revolute":HZ.multiply(yI.makeRotationAxis(kd,J.MathUtils.degToRad(FI)));break;case"prismatic":HZ.multiply(yI.makeTranslation(kd.x*FI,kd.y*FI,kd.z*FI));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+Nd.type);break}else switch(bd.type){case"matrix":HZ.multiply(bd.obj);break;case"translate":HZ.multiply(yI.makeTranslation(bd.obj.x,bd.obj.y,bd.obj.z));break;case"scale":HZ.scale(bd.obj);break;case"rotate":HZ.multiply(yI.makeRotationAxis(bd.obj,bd.angle));break}}WC.matrix.copy(HZ),WC.matrix.decompose(WC.position,WC.quaternion,WC.scale),XI[CI].position=FI}}else console.log("THREE.ColladaLoader: "+CI+" does not exist.")}}}function FW(jU){const MU=[],DU=AU.querySelector('[id="'+jU.id+'"]');for(let RZ=0;RZ<DU.childNodes.length;RZ++){const vU=DU.childNodes[RZ];if(vU.nodeType!==1)continue;let TW,KZ;switch(vU.nodeName){case"matrix":TW=FV(vU.textContent);const XI=new J.Matrix4().fromArray(TW).transpose();MU.push({sid:vU.getAttribute("sid"),type:vU.nodeName,obj:XI});break;case"translate":case"scale":TW=FV(vU.textContent),KZ=new J.Vector3().fromArray(TW),MU.push({sid:vU.getAttribute("sid"),type:vU.nodeName,obj:KZ});break;case"rotate":TW=FV(vU.textContent),KZ=new J.Vector3().fromArray(TW);const DW=J.MathUtils.degToRad(TW[3]);MU.push({sid:vU.getAttribute("sid"),type:vU.nodeName,obj:KZ,angle:DW});break}}return MU}function QZ(jU){const MU=jU.getElementsByTagName("node");for(let DU=0;DU<MU.length;DU++){const RZ=MU[DU];RZ.hasAttribute("id")===!1&&RZ.setAttribute("id",gV())}}const HZ=new J.Matrix4,dW=new J.Vector3;function tW(jU){const MU={name:jU.getAttribute("name")||"",type:jU.getAttribute("type"),id:jU.getAttribute("id"),sid:jU.getAttribute("sid"),matrix:new J.Matrix4,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];if(RZ.nodeType!==1)continue;let vU;switch(RZ.nodeName){case"node":MU.nodes.push(RZ.getAttribute("id")),tW(RZ);break;case"instance_camera":MU.instanceCameras.push(eV(RZ.getAttribute("url")));break;case"instance_controller":MU.instanceControllers.push(YZ(RZ));break;case"instance_light":MU.instanceLights.push(eV(RZ.getAttribute("url")));break;case"instance_geometry":MU.instanceGeometries.push(YZ(RZ));break;case"instance_node":MU.instanceNodes.push(eV(RZ.getAttribute("url")));break;case"matrix":vU=FV(RZ.textContent),MU.matrix.multiply(HZ.fromArray(vU).transpose()),MU.transforms[RZ.getAttribute("sid")]=RZ.nodeName;break;case"translate":vU=FV(RZ.textContent),dW.fromArray(vU),MU.matrix.multiply(HZ.makeTranslation(dW.x,dW.y,dW.z)),MU.transforms[RZ.getAttribute("sid")]=RZ.nodeName;break;case"rotate":vU=FV(RZ.textContent);const TW=J.MathUtils.degToRad(vU[3]);MU.matrix.multiply(HZ.makeRotationAxis(dW.fromArray(vU),TW)),MU.transforms[RZ.getAttribute("sid")]=RZ.nodeName;break;case"scale":vU=FV(RZ.textContent),MU.matrix.scale(dW.fromArray(vU)),MU.transforms[RZ.getAttribute("sid")]=RZ.nodeName;break;case"extra":break;default:console.log(RZ)}}return YW(MU.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",MU.id):nI.nodes[MU.id]=MU,MU}function YZ(jU){const MU={id:eV(jU.getAttribute("url")),materials:{},skeletons:[]};for(let DU=0;DU<jU.childNodes.length;DU++){const RZ=jU.childNodes[DU];switch(RZ.nodeName){case"bind_material":const vU=RZ.getElementsByTagName("instance_material");for(let TW=0;TW<vU.length;TW++){const KZ=vU[TW],XI=KZ.getAttribute("symbol"),DW=KZ.getAttribute("target");MU.materials[XI]=eV(DW)}break;case"skeleton":MU.skeletons.push(eV(RZ.textContent));break}}return MU}function bR(jU,MU){const DU=[],RZ=[];let vU,TW,KZ;for(vU=0;vU<jU.length;vU++){const yI=jU[vU];let CI;if(YW(yI))CI=sZ(yI),YU(CI,MU,DU);else if(gW(yI)){const rd=nI.visualScenes[yI].children;for(let Nd=0;Nd<rd.length;Nd++){const WC=rd[Nd];if(WC.type==="JOINT"){const kd=sZ(WC.id);YU(kd,MU,DU)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",yI)}for(vU=0;vU<MU.length;vU++)for(TW=0;TW<DU.length;TW++)if(KZ=DU[TW],KZ.bone.name===MU[vU].name){RZ[vU]=KZ,KZ.processed=!0;break}for(vU=0;vU<DU.length;vU++)KZ=DU[vU],KZ.processed===!1&&(RZ.push(KZ),KZ.processed=!0);const XI=[],DW=[];for(vU=0;vU<RZ.length;vU++)KZ=RZ[vU],XI.push(KZ.bone),DW.push(KZ.boneInverse);return new J.Skeleton(XI,DW)}function YU(jU,MU,DU){jU.traverse(function(RZ){if(RZ.isBone===!0){let vU;for(let TW=0;TW<MU.length;TW++){const KZ=MU[TW];if(KZ.name===RZ.name){vU=KZ.boneInverse;break}}vU===void 0&&(vU=new J.Matrix4),DU.push({bone:RZ,boneInverse:vU,processed:!1})}})}function bU(jU){const MU=[],DU=jU.matrix,RZ=jU.nodes,vU=jU.type,TW=jU.instanceCameras,KZ=jU.instanceControllers,XI=jU.instanceLights,DW=jU.instanceGeometries,yI=jU.instanceNodes;for(let FI=0,rd=RZ.length;FI<rd;FI++)MU.push(sZ(RZ[FI]));for(let FI=0,rd=TW.length;FI<rd;FI++){const Nd=dU(TW[FI]);Nd!==null&&MU.push(Nd.clone())}for(let FI=0,rd=KZ.length;FI<rd;FI++){const Nd=KZ[FI],WC=Tl(Nd.id),kd=nW(WC.id),zd=_Z(kd,Nd.materials),UC=Nd.skeletons,bd=WC.skin.joints,Id=bR(UC,bd);for(let EC=0,ZF=zd.length;EC<ZF;EC++){const YN=zd[EC];YN.isSkinnedMesh&&(YN.bind(Id,WC.skin.bindMatrix),YN.normalizeSkinWeights()),MU.push(YN)}}for(let FI=0,rd=XI.length;FI<rd;FI++){const Nd=OZ(XI[FI]);Nd!==null&&MU.push(Nd.clone())}for(let FI=0,rd=DW.length;FI<rd;FI++){const Nd=DW[FI],WC=nW(Nd.id),kd=_Z(WC,Nd.materials);for(let zd=0,UC=kd.length;zd<UC;zd++)MU.push(kd[zd])}for(let FI=0,rd=yI.length;FI<rd;FI++)MU.push(sZ(yI[FI]).clone());let CI;if(RZ.length===0&&MU.length===1)CI=MU[0];else{CI=vU==="JOINT"?new J.Bone:new J.Group;for(let FI=0;FI<MU.length;FI++)CI.add(MU[FI])}return CI.name=vU==="JOINT"?jU.sid:jU.name,CI.matrix.copy(DU),CI.matrix.decompose(CI.position,CI.quaternion,CI.scale),CI}const ZZ=new J.MeshBasicMaterial({color:16711935});function mZ(jU,MU){const DU=[];for(let RZ=0,vU=jU.length;RZ<vU;RZ++){const TW=MU[jU[RZ]];TW===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",jU[RZ]),DU.push(ZZ)):DU.push(iR(TW))}return DU}function _Z(jU,MU){const DU=[];for(const RZ in jU){const vU=jU[RZ],TW=mZ(vU.materialKeys,MU);TW.length===0&&(RZ==="lines"||RZ==="linestrips"?TW.push(new J.LineBasicMaterial):TW.push(new J.MeshPhongMaterial));const KZ=vU.data.attributes.skinIndex!==void 0,XI=TW.length===1?TW[0]:TW;let DW;switch(RZ){case"lines":DW=new J.LineSegments(vU.data,XI);break;case"linestrips":DW=new J.Line(vU.data,XI);break;case"triangles":case"polylist":KZ?DW=new J.SkinnedMesh(vU.data,XI):DW=new J.Mesh(vU.data,XI);break}DU.push(DW)}return DU}function YW(jU){return nI.nodes[jU]!==void 0}function sZ(jU){return kV(nI.nodes[jU],bU)}function $U(jU){const MU={name:jU.getAttribute("name"),children:[]};QZ(jU);const DU=dV(jU,"node");for(let RZ=0;RZ<DU.length;RZ++)MU.children.push(tW(DU[RZ]));nI.visualScenes[jU.getAttribute("id")]=MU}function wZ(jU){const MU=new J.Group;MU.name=jU.name;const DU=jU.children;for(let RZ=0;RZ<DU.length;RZ++){const vU=DU[RZ];MU.add(sZ(vU.id))}return MU}function gW(jU){return nI.visualScenes[jU]!==void 0}function RW(jU){return kV(nI.visualScenes[jU],wZ)}function SW(jU){const MU=dV(jU,"instance_visual_scene")[0];return RW(eV(MU.getAttribute("url")))}function gI(){const jU=nI.clips;if(nV(jU)===!0){if(nV(nI.animations)===!1){const MU=[];for(const DU in nI.animations){const RZ=uV(DU);for(let vU=0,TW=RZ.length;vU<TW;vU++)MU.push(RZ[vU])}II.push(new J.AnimationClip("default",-1,MU))}}else for(const MU in jU)II.push(Bl(MU))}function TU(jU){let MU="";const DU=[jU];for(;DU.length;){const RZ=DU.shift();RZ.nodeType===Node.TEXT_NODE?MU+=RZ.textContent:(MU+=`
|
|
10571
10571
|
`,DU.push.apply(DU,RZ.childNodes))}return MU.trim()}if(WV.length===0)return{scene:new J.Scene};const aU=new DOMParser().parseFromString(WV,"application/xml"),AU=dV(aU,"COLLADA")[0],lZ=aU.getElementsByTagName("parsererror")[0];if(lZ!==void 0){const jU=dV(lZ,"div")[0];let MU;return jU?MU=jU.textContent:MU=TU(lZ),console.error(`THREE.ColladaLoader: Failed to parse collada file.
|
|
10572
|
-
`,MU),null}const xZ=AU.getAttribute("version");console.log("THREE.ColladaLoader: File version",xZ);const DZ=JV(dV(AU,"asset")[0]),rW=new J.TextureLoader(this.manager);rW.setPath(this.resourcePath||IV).setCrossOrigin(this.crossOrigin);let bW;VV.TGALoader&&(bW=new VV.TGALoader(this.manager),bW.setPath(this.resourcePath||IV));const II=[];let pW={},iI=0;const nI={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};YV(AU,"library_animations","animation",AV),YV(AU,"library_animation_clips","animation_clip",Il),YV(AU,"library_controllers","controller",kl),YV(AU,"library_images","image",Al),YV(AU,"library_effects","effect",hR),YV(AU,"library_materials","material",BR),YV(AU,"library_cameras","camera",TR),YV(AU,"library_lights","light",NU),YV(AU,"library_geometries","geometry",oZ),YV(AU,"library_nodes","node",tW),YV(AU,"library_visual_scenes","visual_scene",$U),YV(AU,"library_kinematics_models","kinematics_model",JW),YV(AU,"library_physics_models","physics_model",KU),YV(AU,"scene","instance_kinematics_scene",yR),tV(nI.animations,xV),tV(nI.clips,Jl),tV(nI.controllers,Pl),tV(nI.images,Ol),tV(nI.effects,HR),tV(nI.materials,ER),tV(nI.cameras,FR),tV(nI.lights,jZ),tV(nI.geometries,_W),tV(nI.visualScenes,wZ),gI(),PU();const sI=SW(dV(AU,"scene")[0]);return sI.animations=II,DZ.upAxis==="Z_UP"&&sI.quaternion.setFromEuler(new J.Euler(-Math.PI/2,0,0)),sI.scale.multiplyScalar(DZ.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),II},kinematics:pW,library:nI,scene:sI}}}lV.ColladaLoader=UV}(ColladaLoader)),ColladaLoader}var hasRequiredKMZLoader;function requireKMZLoader(){return hasRequiredKMZLoader||(hasRequiredKMZLoader=1,function(lV){Object.defineProperty(lV,Symbol.toStringTag,{value:"Module"});const J=requireThree(),VV=requireColladaLoader(),RV=requireLib();class UV extends J.Loader{constructor(WV){super(WV)}load(WV,IV,dV,CV){const FV=this,NV=new J.FileLoader(FV.manager);NV.setPath(FV.path),NV.setResponseType("arraybuffer"),NV.setRequestHeader(FV.requestHeader),NV.setWithCredentials(FV.withCredentials),NV.load(WV,function(eV){try{IV(FV.parse(eV))}catch(gV){CV?CV(gV):console.error(gV),FV.manager.itemError(WV)}},dV,CV)}parse(WV){function IV(FV){for(const NV in CV)if(NV.substr(-FV.length)===FV)return CV[NV]}const dV=new J.LoadingManager;dV.setURLModifier(function(FV){const NV=IV(FV);if(NV){console.log("Loading",FV);const eV=new Blob([NV.buffer],{type:"application/octet-stream"});return URL.createObjectURL(eV)}return FV});const CV=RV.unzipSync(new Uint8Array(WV));if(CV["doc.kml"]){const NV=new DOMParser().parseFromString(fflate.strFromU8(CV["doc.kml"]),"application/xml").querySelector("Placemark Model Link href");if(NV)return new VV.ColladaLoader(dV).parse(fflate.strFromU8(CV[NV.textContent]))}else{console.warn("KMZLoader: Missing doc.kml file.");for(const FV in CV)if(FV.split(".").pop().toLowerCase()==="dae")return new VV.ColladaLoader(dV).parse(fflate.strFromU8(CV[FV]))}return console.error("KMZLoader: Couldn't find .dae file."),{scene:new J.Group}}}lV.KMZLoader=UV}(KMZLoader)),KMZLoader}var VRMLoader={},hasRequiredVRMLoader;function requireVRMLoader(){return hasRequiredVRMLoader||(hasRequiredVRMLoader=1,function(lV){Object.defineProperty(lV,Symbol.toStringTag,{value:"Module"});const J=requireThree(),VV=requireGLTFLoader();class RV extends J.Loader{constructor(ZV){super(ZV),this.gltfLoader=new VV.GLTFLoader(ZV)}load(ZV,WV,IV,dV){const CV=this;this.gltfLoader.load(ZV,function(FV){try{CV.parse(FV,WV)}catch(NV){dV?dV(NV):console.error(NV),CV.manager.itemError(ZV)}},IV,dV)}setDRACOLoader(ZV){return this.gltfLoader.setDRACOLoader(ZV),this}parse(ZV,WV){WV(ZV)}}lV.VRMLoader=RV}(VRMLoader)),VRMLoader}var VRMLLoader={},chevrotain={exports:{}};chevrotain.exports;var hasRequiredChevrotain;function requireChevrotain(){return hasRequiredChevrotain||(hasRequiredChevrotain=1,function(lV,J){var VV={};Object.defineProperty(J,Symbol.toStringTag,{value:"Module"});const{CstParser:RV,Lexer:UV,createToken:ZV}=(()=>{var WV=typeof VV=="object"&&VV&&VV.Object===Object&&VV;const IV=WV;var dV=typeof self=="object"&&self&&self.Object===Object&&self,CV=IV||dV||Function("return this")();const FV=CV;var NV=FV.Symbol;const eV=NV;var gV=Object.prototype,nV=gV.hasOwnProperty,JV=gV.toString,aV=eV?eV.toStringTag:void 0;function GV(Ql){var cl=nV.call(Ql,aV),$l=Ql[aV];try{Ql[aV]=void 0;var DR=!0}catch{}var kU=JV.call(Ql);return DR&&(cl?Ql[aV]=$l:delete Ql[aV]),kU}var YV=Object.prototype,tV=YV.toString;function kV(Ql){return tV.call(Ql)}var AV="[object Null]",XV="[object Undefined]",MV=eV?eV.toStringTag:void 0;function xV(Ql){return Ql==null?Ql===void 0?XV:AV:MV&&MV in Object(Ql)?GV(Ql):kV(Ql)}function uV(Ql){return Ql!=null&&typeof Ql=="object"}var wV="[object Symbol]";function vV(Ql){return typeof Ql=="symbol"||uV(Ql)&&xV(Ql)==wV}function yV(Ql,cl){for(var $l=-1,DR=Ql==null?0:Ql.length,kU=Array(DR);++$l<DR;)kU[$l]=cl(Ql[$l],$l,Ql);return kU}var ll=Array.isArray;const Nl=ll;var al=1/0,el=eV?eV.prototype:void 0,qV=el?el.toString:void 0;function fV(Ql){if(typeof Ql=="string")return Ql;if(Nl(Ql))return yV(Ql,fV)+"";if(vV(Ql))return qV?qV.call(Ql):"";var cl=Ql+"";return cl=="0"&&1/Ql==-al?"-0":cl}var Ul=/\s/;function Cl(Ql){for(var cl=Ql.length;cl--&&Ul.test(Ql.charAt(cl)););return cl}var Il=/^\s+/;function Jl(Ql){return Ql&&Ql.slice(0,Cl(Ql)+1).replace(Il,"")}function Bl(Ql){var cl=typeof Ql;return Ql!=null&&(cl=="object"||cl=="function")}var kl=NaN,ol=/^[-+]0x[0-9a-f]+$/i,xl=/^0b[01]+$/i,wl=/^0o[0-7]+$/i,Pl=parseInt;function zl(Ql){if(typeof Ql=="number")return Ql;if(vV(Ql))return kl;if(Bl(Ql)){var cl=typeof Ql.valueOf=="function"?Ql.valueOf():Ql;Ql=Bl(cl)?cl+"":cl}if(typeof Ql!="string")return Ql===0?Ql:+Ql;Ql=Jl(Ql);var $l=xl.test(Ql);return $l||wl.test(Ql)?Pl(Ql.slice(2),$l?2:8):ol.test(Ql)?kl:+Ql}var Tl=1/0,Al=17976931348623157e292;function Ol(Ql){if(!Ql)return Ql===0?Ql:0;if(Ql=zl(Ql),Ql===Tl||Ql===-Tl){var cl=Ql<0?-1:1;return cl*Al}return Ql===Ql?Ql:0}function RR(Ql){var cl=Ol(Ql),$l=cl%1;return cl===cl?$l?cl-$l:cl:0}function hR(Ql){return Ql}var gR="[object AsyncFunction]",sR="[object Function]",tR="[object GeneratorFunction]",pR="[object Proxy]";function MR(Ql){if(!Bl(Ql))return!1;var cl=xV(Ql);return cl==sR||cl==tR||cl==gR||cl==pR}var cR=FV["__core-js_shared__"];const mR=cR;var zR=function(){var Ql=/[^.]+$/.exec(mR&&mR.keys&&mR.keys.IE_PROTO||"");return Ql?"Symbol(src)_1."+Ql:""}();function XR(Ql){return!!zR&&zR in Ql}var ZU=Function.prototype,sU=ZU.toString;function rU(Ql){if(Ql!=null){try{return sU.call(Ql)}catch{}try{return Ql+""}catch{}}return""}var KR=/[\\^$.*+?()[\]{}|]/g,HR=/^\[object .+?Constructor\]$/,eU=Function.prototype,BR=Object.prototype,vl=eU.toString,ER=BR.hasOwnProperty,iR=RegExp("^"+vl.call(ER).replace(KR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function TR(Ql){if(!Bl(Ql)||XR(Ql))return!1;var cl=MR(Ql)?iR:HR;return cl.test(rU(Ql))}function PR(Ql,cl){return Ql==null?void 0:Ql[cl]}function RU(Ql,cl){var $l=PR(Ql,cl);return TR($l)?$l:void 0}var nU=RU(FV,"WeakMap");const FR=nU;var dU=Object.create,NU=function(){function Ql(){}return function(cl){if(!Bl(cl))return{};if(dU)return dU(cl);Ql.prototype=cl;var $l=new Ql;return Ql.prototype=void 0,$l}}();const OU=NU;function MZ(Ql,cl,$l){switch($l.length){case 0:return Ql.call(cl);case 1:return Ql.call(cl,$l[0]);case 2:return Ql.call(cl,$l[0],$l[1]);case 3:return Ql.call(cl,$l[0],$l[1],$l[2])}return Ql.apply(cl,$l)}function jZ(){}function OZ(Ql,cl){var $l=-1,DR=Ql.length;for(cl||(cl=Array(DR));++$l<DR;)cl[$l]=Ql[$l];return cl}var oZ=800,MW=16,LU=Date.now;function hW(Ql){var cl=0,$l=0;return function(){var DR=LU(),kU=MW-(DR-$l);if($l=DR,kU>0){if(++cl>=oZ)return arguments[0]}else cl=0;return Ql.apply(void 0,arguments)}}function CW(Ql){return function(){return Ql}}var iW=function(){try{var Ql=RU(Object,"defineProperty");return Ql({},"",{}),Ql}catch{}}();const _W=iW;var KW=_W?function(Ql,cl){return _W(Ql,"toString",{configurable:!0,enumerable:!1,value:CW(cl),writable:!0})}:hR,nW=hW(KW);const JW=nW;function cW(Ql,cl){for(var $l=-1,DR=Ql==null?0:Ql.length;++$l<DR&&cl(Ql[$l],$l,Ql)!==!1;);return Ql}function oW(Ql,cl,$l,DR){for(var kU=Ql.length,FZ=$l+-1;++FZ<kU;)if(cl(Ql[FZ],FZ,Ql))return FZ;return-1}function CZ(Ql){return Ql!==Ql}function IU(Ql,cl,$l){for(var DR=$l-1,kU=Ql.length;++DR<kU;)if(Ql[DR]===cl)return DR;return-1}function wR(Ql,cl,$l){return cl===cl?IU(Ql,cl,$l):oW(Ql,CZ,$l)}function JU(Ql,cl){var $l=Ql==null?0:Ql.length;return!!$l&&wR(Ql,cl,0)>-1}var uR=9007199254740991,BU=/^(?:0|[1-9]\d*)$/;function KU(Ql,cl){var $l=typeof Ql;return cl=cl??uR,!!cl&&($l=="number"||$l!="symbol"&&BU.test(Ql))&&Ql>-1&&Ql%1==0&&Ql<cl}function _l(Ql,cl,$l){cl=="__proto__"&&_W?_W(Ql,cl,{configurable:!0,enumerable:!0,value:$l,writable:!0}):Ql[cl]=$l}function ql(Ql,cl){return Ql===cl||Ql!==Ql&&cl!==cl}var yR=Object.prototype,GU=yR.hasOwnProperty;function uU(Ql,cl,$l){var DR=Ql[cl];(!(GU.call(Ql,cl)&&ql(DR,$l))||$l===void 0&&!(cl in Ql))&&_l(Ql,cl,$l)}function _U(Ql,cl,$l,DR){var kU=!$l;$l||($l={});for(var FZ=-1,rZ=cl.length;++FZ<rZ;){var IW=cl[FZ],AW=void 0;AW===void 0&&(AW=Ql[IW]),kU?_l($l,IW,AW):uU($l,IW,AW)}return $l}var PU=Math.max;function FW(Ql,cl,$l){return cl=PU(cl===void 0?Ql.length-1:cl,0),function(){for(var DR=arguments,kU=-1,FZ=PU(DR.length-cl,0),rZ=Array(FZ);++kU<FZ;)rZ[kU]=DR[cl+kU];kU=-1;for(var IW=Array(cl+1);++kU<cl;)IW[kU]=DR[kU];return IW[cl]=$l(rZ),MZ(Ql,this,IW)}}function QZ(Ql,cl){return JW(FW(Ql,cl,hR),Ql+"")}var HZ=9007199254740991;function dW(Ql){return typeof Ql=="number"&&Ql>-1&&Ql%1==0&&Ql<=HZ}function tW(Ql){return Ql!=null&&dW(Ql.length)&&!MR(Ql)}function YZ(Ql,cl,$l){if(!Bl($l))return!1;var DR=typeof cl;return(DR=="number"?tW($l)&&KU(cl,$l.length):DR=="string"&&cl in $l)?ql($l[cl],Ql):!1}function bR(Ql){return QZ(function(cl,$l){var DR=-1,kU=$l.length,FZ=kU>1?$l[kU-1]:void 0,rZ=kU>2?$l[2]:void 0;for(FZ=Ql.length>3&&typeof FZ=="function"?(kU--,FZ):void 0,rZ&&YZ($l[0],$l[1],rZ)&&(FZ=kU<3?void 0:FZ,kU=1),cl=Object(cl);++DR<kU;){var IW=$l[DR];IW&&Ql(cl,IW,DR,FZ)}return cl})}var YU=Object.prototype;function bU(Ql){var cl=Ql&&Ql.constructor,$l=typeof cl=="function"&&cl.prototype||YU;return Ql===$l}function ZZ(Ql,cl){for(var $l=-1,DR=Array(Ql);++$l<Ql;)DR[$l]=cl($l);return DR}var mZ="[object Arguments]";function _Z(Ql){return uV(Ql)&&xV(Ql)==mZ}var YW=Object.prototype,sZ=YW.hasOwnProperty,$U=YW.propertyIsEnumerable,wZ=_Z(function(){return arguments}())?_Z:function(Ql){return uV(Ql)&&sZ.call(Ql,"callee")&&!$U.call(Ql,"callee")};const gW=wZ;function RW(){return!1}var SW=J&&!J.nodeType&&J,gI=SW&&!0&&lV&&!lV.nodeType&&lV,TU=gI&&gI.exports===SW,aU=TU?FV.Buffer:void 0,AU=aU?aU.isBuffer:void 0,lZ=AU||RW;const xZ=lZ;var DZ="[object Arguments]",rW="[object Array]",bW="[object Boolean]",II="[object Date]",pW="[object Error]",iI="[object Function]",nI="[object Map]",sI="[object Number]",jU="[object Object]",MU="[object RegExp]",DU="[object Set]",RZ="[object String]",vU="[object WeakMap]",TW="[object ArrayBuffer]",KZ="[object DataView]",XI="[object Float32Array]",DW="[object Float64Array]",yI="[object Int8Array]",CI="[object Int16Array]",FI="[object Int32Array]",rd="[object Uint8Array]",Nd="[object Uint8ClampedArray]",WC="[object Uint16Array]",kd="[object Uint32Array]",zd={};zd[XI]=zd[DW]=zd[yI]=zd[CI]=zd[FI]=zd[rd]=zd[Nd]=zd[WC]=zd[kd]=!0,zd[DZ]=zd[rW]=zd[TW]=zd[bW]=zd[KZ]=zd[II]=zd[pW]=zd[iI]=zd[nI]=zd[sI]=zd[jU]=zd[MU]=zd[DU]=zd[RZ]=zd[vU]=!1;function UC(Ql){return uV(Ql)&&dW(Ql.length)&&!!zd[xV(Ql)]}function bd(Ql){return function(cl){return Ql(cl)}}var Id=J&&!J.nodeType&&J,EC=Id&&!0&&lV&&!lV.nodeType&&lV,ZF=EC&&EC.exports===Id,YN=ZF&&IV.process,WF=function(){try{var Ql=EC&&EC.require&&EC.require("util").types;return Ql||YN&&YN.binding&&YN.binding("util")}catch{}}();const ON=WF;var OF=ON&&ON.isTypedArray,AR=OF?bd(OF):UC;const zU=AR;var BZ=Object.prototype,lW=BZ.hasOwnProperty;function BW(Ql,cl){var $l=Nl(Ql),DR=!$l&&gW(Ql),kU=!$l&&!DR&&xZ(Ql),FZ=!$l&&!DR&&!kU&&zU(Ql),rZ=$l||DR||kU||FZ,IW=rZ?ZZ(Ql.length,String):[],AW=IW.length;for(var ZI in Ql)(cl||lW.call(Ql,ZI))&&!(rZ&&(ZI=="length"||kU&&(ZI=="offset"||ZI=="parent")||FZ&&(ZI=="buffer"||ZI=="byteLength"||ZI=="byteOffset")||KU(ZI,AW)))&&IW.push(ZI);return IW}function xI(Ql,cl){return function($l){return Ql(cl($l))}}var JI=xI(Object.keys,Object);const Vd=JI;var Cd=Object.prototype,wd=Cd.hasOwnProperty;function sC(Ql){if(!bU(Ql))return Vd(Ql);var cl=[];for(var $l in Object(Ql))wd.call(Ql,$l)&&$l!="constructor"&&cl.push($l);return cl}function ud(Ql){return tW(Ql)?BW(Ql):sC(Ql)}var _C=Object.prototype,SC=_C.hasOwnProperty,XC=bR(function(Ql,cl){if(bU(cl)||tW(cl)){_U(cl,ud(cl),Ql);return}for(var $l in cl)SC.call(cl,$l)&&uU(Ql,$l,cl[$l])});const FC=XC;function og(Ql){var cl=[];if(Ql!=null)for(var $l in Object(Ql))cl.push($l);return cl}var rF=Object.prototype,XG=rF.hasOwnProperty;function wJ(Ql){if(!Bl(Ql))return og(Ql);var cl=bU(Ql),$l=[];for(var DR in Ql)DR=="constructor"&&(cl||!XG.call(Ql,DR))||$l.push(DR);return $l}function VG(Ql){return tW(Ql)?BW(Ql,!0):wJ(Ql)}var _G=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M1=/^\w*$/;function JZ(Ql,cl){if(Nl(Ql))return!1;var $l=typeof Ql;return $l=="number"||$l=="symbol"||$l=="boolean"||Ql==null||vV(Ql)?!0:M1.test(Ql)||!_G.test(Ql)||cl!=null&&Ql in Object(cl)}var a1=RU(Object,"create");const v0=a1;function Q1(){this.__data__=v0?v0(null):{},this.size=0}function Ra(Ql){var cl=this.has(Ql)&&delete this.__data__[Ql];return this.size-=cl?1:0,cl}var CG="__lodash_hash_undefined__",b1=Object.prototype,iJ=b1.hasOwnProperty;function N0(Ql){var cl=this.__data__;if(v0){var $l=cl[Ql];return $l===CG?void 0:$l}return iJ.call(cl,Ql)?cl[Ql]:void 0}var BG=Object.prototype,TJ=BG.hasOwnProperty;function dg(Ql){var cl=this.__data__;return v0?cl[Ql]!==void 0:TJ.call(cl,Ql)}var u0="__lodash_hash_undefined__";function NJ(Ql,cl){var $l=this.__data__;return this.size+=this.has(Ql)?0:1,$l[Ql]=v0&&cl===void 0?u0:cl,this}function Hg(Ql){var cl=-1,$l=Ql==null?0:Ql.length;for(this.clear();++cl<$l;){var DR=Ql[cl];this.set(DR[0],DR[1])}}Hg.prototype.clear=Q1,Hg.prototype.delete=Ra,Hg.prototype.get=N0,Hg.prototype.has=dg,Hg.prototype.set=NJ;function sN(){this.__data__=[],this.size=0}function jN(Ql,cl){for(var $l=Ql.length;$l--;)if(ql(Ql[$l][0],cl))return $l;return-1}var _g=Array.prototype,RJ=_g.splice;function wN(Ql){var cl=this.__data__,$l=jN(cl,Ql);if($l<0)return!1;var DR=cl.length-1;return $l==DR?cl.pop():RJ.call(cl,$l,1),--this.size,!0}function qF(Ql){var cl=this.__data__,$l=jN(cl,Ql);return $l<0?void 0:cl[$l][1]}function uN(Ql){return jN(this.__data__,Ql)>-1}function Mg(Ql,cl){var $l=this.__data__,DR=jN($l,Ql);return DR<0?(++this.size,$l.push([Ql,cl])):$l[DR][1]=cl,this}function lg(Ql){var cl=-1,$l=Ql==null?0:Ql.length;for(this.clear();++cl<$l;){var DR=Ql[cl];this.set(DR[0],DR[1])}}lg.prototype.clear=sN,lg.prototype.delete=wN,lg.prototype.get=qF,lg.prototype.has=uN,lg.prototype.set=Mg;var e0=RU(FV,"Map");const FG=e0;function ug(){this.size=0,this.__data__={hash:new Hg,map:new(FG||lg),string:new Hg}}function g0(Ql){var cl=typeof Ql;return cl=="string"||cl=="number"||cl=="symbol"||cl=="boolean"?Ql!=="__proto__":Ql===null}function D0(Ql,cl){var $l=Ql.__data__;return g0(cl)?$l[typeof cl=="string"?"string":"hash"]:$l.map}function SG(Ql){var cl=D0(this,Ql).delete(Ql);return this.size-=cl?1:0,cl}function Eg(Ql){return D0(this,Ql).get(Ql)}function Rg(Ql){return D0(this,Ql).has(Ql)}function qg(Ql,cl){var $l=D0(this,Ql),DR=$l.size;return $l.set(Ql,cl),this.size+=$l.size==DR?0:1,this}function jd(Ql){var cl=-1,$l=Ql==null?0:Ql.length;for(this.clear();++cl<$l;){var DR=Ql[cl];this.set(DR[0],DR[1])}}jd.prototype.clear=ug,jd.prototype.delete=SG,jd.prototype.get=Eg,jd.prototype.has=Rg,jd.prototype.set=qg;var EJ="Expected a function";function mJ(Ql,cl){if(typeof Ql!="function"||cl!=null&&typeof cl!="function")throw new TypeError(EJ);var $l=function(){var DR=arguments,kU=cl?cl.apply(this,DR):DR[0],FZ=$l.cache;if(FZ.has(kU))return FZ.get(kU);var rZ=Ql.apply(this,DR);return $l.cache=FZ.set(kU,rZ)||FZ,rZ};return $l.cache=new(mJ.Cache||jd),$l}mJ.Cache=jd;var qC=500;function fg(Ql){var cl=mJ(Ql,function(DR){return $l.size===qC&&$l.clear(),DR}),$l=cl.cache;return cl}var EI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,IC=/\\(\\)?/g,tC=fg(function(Ql){var cl=[];return Ql.charCodeAt(0)===46&&cl.push(""),Ql.replace(EI,function($l,DR,kU,FZ){cl.push(kU?FZ.replace(IC,"$1"):DR||$l)}),cl});const p0=tC;function rI(Ql){return Ql==null?"":fV(Ql)}function yd(Ql,cl){return Nl(Ql)?Ql:JZ(Ql,cl)?[Ql]:p0(rI(Ql))}var uJ=1/0;function AC(Ql){if(typeof Ql=="string"||vV(Ql))return Ql;var cl=Ql+"";return cl=="0"&&1/Ql==-uJ?"-0":cl}function KN(Ql,cl){cl=yd(cl,Ql);for(var $l=0,DR=cl.length;Ql!=null&&$l<DR;)Ql=Ql[AC(cl[$l++])];return $l&&$l==DR?Ql:void 0}function vC(Ql,cl,$l){var DR=Ql==null?void 0:KN(Ql,cl);return DR===void 0?$l:DR}function jF(Ql,cl){for(var $l=-1,DR=cl.length,kU=Ql.length;++$l<DR;)Ql[kU+$l]=cl[$l];return Ql}var IF=eV?eV.isConcatSpreadable:void 0;function ag(Ql){return Nl(Ql)||gW(Ql)||!!(IF&&Ql&&Ql[IF])}function MC(Ql,cl,$l,DR,kU){var FZ=-1,rZ=Ql.length;for($l||($l=ag),kU||(kU=[]);++FZ<rZ;){var IW=Ql[FZ];$l(IW)?jF(kU,IW):DR||(kU[kU.length]=IW)}return kU}function Od(Ql){var cl=Ql==null?0:Ql.length;return cl?MC(Ql):[]}var pd=xI(Object.getPrototypeOf,Object);const sd=pd;function wC(Ql,cl,$l){var DR=-1,kU=Ql.length;cl<0&&(cl=-cl>kU?0:kU+cl),$l=$l>kU?kU:$l,$l<0&&($l+=kU),kU=cl>$l?0:$l-cl>>>0,cl>>>=0;for(var FZ=Array(kU);++DR<kU;)FZ[DR]=Ql[DR+cl];return FZ}function AF(Ql,cl,$l,DR){var kU=-1,FZ=Ql==null?0:Ql.length;for(DR&&FZ&&($l=Ql[++kU]);++kU<FZ;)$l=cl($l,Ql[kU],kU,Ql);return $l}function zg(){this.__data__=new lg,this.size=0}function oJ(Ql){var cl=this.__data__,$l=cl.delete(Ql);return this.size=cl.size,$l}function Pd(Ql){return this.__data__.get(Ql)}function DJ(Ql){return this.__data__.has(Ql)}var dN=200;function kN(Ql,cl){var $l=this.__data__;if($l instanceof lg){var DR=$l.__data__;if(!FG||DR.length<dN-1)return DR.push([Ql,cl]),this.size=++$l.size,this;$l=this.__data__=new jd(DR)}return $l.set(Ql,cl),this.size=$l.size,this}function eF(Ql){var cl=this.__data__=new lg(Ql);this.size=cl.size}eF.prototype.clear=zg,eF.prototype.delete=oJ,eF.prototype.get=Pd,eF.prototype.has=DJ,eF.prototype.set=kN;function EN(Ql,cl){return Ql&&_U(cl,ud(cl),Ql)}var XN=J&&!J.nodeType&&J,Dg=XN&&!0&&lV&&!lV.nodeType&&lV,KF=Dg&&Dg.exports===XN,UJ=KF?FV.Buffer:void 0,HI=UJ?UJ.allocUnsafe:void 0;function VC(Ql,cl){var $l=Ql.length,DR=HI?HI($l):new Ql.constructor($l);return Ql.copy(DR),DR}function tZ(Ql,cl){for(var $l=-1,DR=Ql==null?0:Ql.length,kU=0,FZ=[];++$l<DR;){var rZ=Ql[$l];cl(rZ,$l,Ql)&&(FZ[kU++]=rZ)}return FZ}function Zd(){return[]}var yC=Object.prototype,rC=yC.propertyIsEnumerable,Cg=Object.getOwnPropertySymbols,BN=Cg?function(Ql){return Ql==null?[]:(Ql=Object(Ql),tZ(Cg(Ql),function(cl){return rC.call(Ql,cl)}))}:Zd;const UW=BN;function h0(Ql,cl){return _U(Ql,UW(Ql),cl)}var sW=Object.getOwnPropertySymbols,bF=sW?function(Ql){for(var cl=[];Ql;)jF(cl,UW(Ql)),Ql=sd(Ql);return cl}:Zd;const XW=bF;function QI(Ql,cl,$l){var DR=cl(Ql);return Nl(Ql)?DR:jF(DR,$l(Ql))}function Jd(Ql){return QI(Ql,ud,UW)}function NC(Ql){return QI(Ql,VG,XW)}var CN=RU(FV,"DataView");const mg=CN;var hg=RU(FV,"Promise");const xg=hg;var Y0=RU(FV,"Set");const yJ=Y0;var s0="[object Map]",n0="[object Object]",X0="[object Promise]",qG="[object Set]",yG="[object WeakMap]",c0="[object DataView]",f0=rU(mg),HJ=rU(FG),m0=rU(xg),oG=rU(yJ),QC=rU(FR),kJ=xV;(mg&&kJ(new mg(new ArrayBuffer(1)))!=c0||FG&&kJ(new FG)!=s0||xg&&kJ(xg.resolve())!=X0||yJ&&kJ(new yJ)!=qG||FR&&kJ(new FR)!=yG)&&(kJ=function(Ql){var cl=xV(Ql),$l=cl==n0?Ql.constructor:void 0,DR=$l?rU($l):"";if(DR)switch(DR){case f0:return c0;case HJ:return s0;case m0:return X0;case oG:return qG;case QC:return yG}return cl});const gg=kJ;var HG=Object.prototype,lG=HG.hasOwnProperty;function zJ(Ql){var cl=Ql.length,$l=new Ql.constructor(cl);return cl&&typeof Ql[0]=="string"&&lG.call(Ql,"index")&&($l.index=Ql.index,$l.input=Ql.input),$l}var PC=FV.Uint8Array;const vN=PC;function xJ(Ql){var cl=new Ql.constructor(Ql.byteLength);return new vN(cl).set(new vN(Ql)),cl}function eJ(Ql,cl){var $l=Ql.buffer;return new Ql.constructor($l,Ql.byteOffset,Ql.byteLength)}var SJ=/\w*$/;function AJ(Ql){var cl=new Ql.constructor(Ql.source,SJ.exec(Ql));return cl.lastIndex=Ql.lastIndex,cl}var B0=eV?eV.prototype:void 0,Lg=B0?B0.valueOf:void 0;function Yg(Ql){return Lg?Object(Lg.call(Ql)):{}}function gJ(Ql,cl){var $l=Ql.buffer;return new Ql.constructor($l,Ql.byteOffset,Ql.length)}var JC="[object Boolean]",gF="[object Date]",Xd="[object Map]",PF="[object Number]",hF="[object RegExp]",VF="[object Set]",DN="[object String]",Qg="[object Symbol]",OG="[object ArrayBuffer]",vF="[object DataView]",OJ="[object Float32Array]",FN="[object Float64Array]",KJ="[object Int8Array]",fN="[object Int16Array]",L0="[object Int32Array]",$g="[object Uint8Array]",AG="[object Uint8ClampedArray]",cN="[object Uint16Array]",KG="[object Uint32Array]";function _J(Ql,cl,$l){var DR=Ql.constructor;switch(cl){case OG:return xJ(Ql);case JC:case gF:return new DR(+Ql);case vF:return eJ(Ql);case OJ:case FN:case KJ:case fN:case L0:case $g:case AG:case cN:case KG:return gJ(Ql);case Xd:return new DR;case PF:case DN:return new DR(Ql);case hF:return AJ(Ql);case VF:return new DR;case Qg:return Yg(Ql)}}function yg(Ql){return typeof Ql.constructor=="function"&&!bU(Ql)?OU(sd(Ql)):{}}var o0="[object Map]";function fF(Ql){return uV(Ql)&&gg(Ql)==o0}var Fg=ON&&ON.isMap,ed=Fg?bd(Fg):fF;const IN=ed;var _I="[object Set]";function Yd(Ql){return uV(Ql)&&gg(Ql)==_I}var Gd=ON&&ON.isSet,ZJ=Gd?bd(Gd):Yd;const HN=ZJ;var tN="[object Arguments]",ad="[object Array]",nN="[object Boolean]",oN="[object Date]",I0="[object Error]",oC="[object Function]",HC="[object GeneratorFunction]",MJ="[object Map]",OW="[object Number]",zN="[object Object]",Dd="[object RegExp]",qJ="[object Set]",Og="[object String]",$J="[object Symbol]",P0="[object WeakMap]",_F="[object ArrayBuffer]",wF="[object DataView]",Sd="[object Float32Array]",cg="[object Float64Array]",k0="[object Int8Array]",p1="[object Int16Array]",LN="[object Int32Array]",SN="[object Uint8Array]",kg="[object Uint8ClampedArray]",JN="[object Uint16Array]",dF="[object Uint32Array]",MI={};MI[tN]=MI[ad]=MI[_F]=MI[wF]=MI[nN]=MI[oN]=MI[Sd]=MI[cg]=MI[k0]=MI[p1]=MI[LN]=MI[MJ]=MI[OW]=MI[zN]=MI[Dd]=MI[qJ]=MI[Og]=MI[$J]=MI[SN]=MI[kg]=MI[JN]=MI[dF]=!0,MI[I0]=MI[oC]=MI[P0]=!1;function GN(Ql,cl,$l,DR,kU,FZ){var rZ;if(rZ!==void 0)return rZ;if(!Bl(Ql))return Ql;var IW=Nl(Ql);if(IW)return rZ=zJ(Ql),OZ(Ql,rZ);var AW=gg(Ql),ZI=AW==oC||AW==HC;if(xZ(Ql))return VC(Ql);if(AW==zN||AW==tN||ZI&&!kU)return rZ=ZI?{}:yg(Ql),h0(Ql,EN(rZ,Ql));if(!MI[AW])return kU?Ql:{};rZ=_J(Ql,AW),FZ||(FZ=new eF);var Td=FZ.get(Ql);if(Td)return Td;FZ.set(Ql,rZ),HN(Ql)?Ql.forEach(function(ZN){rZ.add(GN(ZN,cl,$l,ZN,Ql,FZ))}):IN(Ql)&&Ql.forEach(function(ZN,WN){rZ.set(WN,GN(ZN,cl,$l,WN,Ql,FZ))});var Ld=Jd,NF=IW?void 0:Ld(Ql);return cW(NF||Ql,function(ZN,WN){NF&&(WN=ZN,ZN=Ql[WN]),uU(rZ,WN,GN(ZN,cl,$l,WN,Ql,FZ))}),rZ}var GC=4;function Bd(Ql){return GN(Ql,GC)}function PN(Ql){for(var cl=-1,$l=Ql==null?0:Ql.length,DR=0,kU=[];++cl<$l;){var FZ=Ql[cl];FZ&&(kU[DR++]=FZ)}return kU}var bg="__lodash_hash_undefined__";function zG(Ql){return this.__data__.set(Ql,bg),this}function WJ(Ql){return this.__data__.has(Ql)}function dC(Ql){var cl=-1,$l=Ql==null?0:Ql.length;for(this.__data__=new jd;++cl<$l;)this.add(Ql[cl])}dC.prototype.add=dC.prototype.push=zG,dC.prototype.has=WJ;function UI(Ql,cl){for(var $l=-1,DR=Ql==null?0:Ql.length;++$l<DR;)if(cl(Ql[$l],$l,Ql))return!0;return!1}function Wd(Ql,cl){return Ql.has(cl)}var jI=1,IJ=2;function pg(Ql,cl,$l,DR,kU,FZ){var rZ=$l&jI,IW=Ql.length,AW=cl.length;if(IW!=AW&&!(rZ&&AW>IW))return!1;var ZI=FZ.get(Ql),Td=FZ.get(cl);if(ZI&&Td)return ZI==cl&&Td==Ql;var Ld=-1,NF=!0,ZN=$l&IJ?new dC:void 0;for(FZ.set(Ql,cl),FZ.set(cl,Ql);++Ld<IW;){var WN=Ql[Ld],$N=cl[Ld];if(DR)var G0=rZ?DR($N,WN,Ld,cl,Ql,FZ):DR(WN,$N,Ld,Ql,cl,FZ);if(G0!==void 0){if(G0)continue;NF=!1;break}if(ZN){if(!UI(cl,function(bN,pN){if(!Wd(ZN,pN)&&(WN===bN||kU(WN,bN,$l,DR,FZ)))return ZN.push(pN)})){NF=!1;break}}else if(!(WN===$N||kU(WN,$N,$l,DR,FZ))){NF=!1;break}}return FZ.delete(Ql),FZ.delete(cl),NF}function Kg(Ql){var cl=-1,$l=Array(Ql.size);return Ql.forEach(function(DR,kU){$l[++cl]=[kU,DR]}),$l}function $F(Ql){var cl=-1,$l=Array(Ql.size);return Ql.forEach(function(DR){$l[++cl]=DR}),$l}var nJ=1,eC=2,Ug="[object Boolean]",sF="[object Date]",wg="[object Error]",vJ="[object Map]",CF="[object Number]",_d="[object RegExp]",zC="[object Set]",$d="[object String]",NN="[object Symbol]",oF="[object ArrayBuffer]",tF="[object DataView]",VN=eV?eV.prototype:void 0,d0=VN?VN.valueOf:void 0;function yN(Ql,cl,$l,DR,kU,FZ,rZ){switch($l){case tF:if(Ql.byteLength!=cl.byteLength||Ql.byteOffset!=cl.byteOffset)return!1;Ql=Ql.buffer,cl=cl.buffer;case oF:return!(Ql.byteLength!=cl.byteLength||!FZ(new vN(Ql),new vN(cl)));case Ug:case sF:case CF:return ql(+Ql,+cl);case wg:return Ql.name==cl.name&&Ql.message==cl.message;case _d:case $d:return Ql==cl+"";case vJ:var IW=Kg;case zC:var AW=DR&nJ;if(IW||(IW=$F),Ql.size!=cl.size&&!AW)return!1;var ZI=rZ.get(Ql);if(ZI)return ZI==cl;DR|=eC,rZ.set(Ql,cl);var Td=pg(IW(Ql),IW(cl),DR,kU,FZ,rZ);return rZ.delete(Ql),Td;case NN:if(d0)return d0.call(Ql)==d0.call(cl)}return!1}var Sg=1,ng=Object.prototype,S0=ng.hasOwnProperty;function mN(Ql,cl,$l,DR,kU,FZ){var rZ=$l&Sg,IW=Jd(Ql),AW=IW.length,ZI=Jd(cl),Td=ZI.length;if(AW!=Td&&!rZ)return!1;for(var Ld=AW;Ld--;){var NF=IW[Ld];if(!(rZ?NF in cl:S0.call(cl,NF)))return!1}var ZN=FZ.get(Ql),WN=FZ.get(cl);if(ZN&&WN)return ZN==cl&&WN==Ql;var $N=!0;FZ.set(Ql,cl),FZ.set(cl,Ql);for(var G0=rZ;++Ld<AW;){NF=IW[Ld];var bN=Ql[NF],pN=cl[NF];if(DR)var zF=rZ?DR(pN,bN,NF,cl,Ql,FZ):DR(bN,pN,NF,Ql,cl,FZ);if(!(zF===void 0?bN===pN||kU(bN,pN,$l,DR,FZ):zF)){$N=!1;break}G0||(G0=NF=="constructor")}if($N&&!G0){var aN=Ql.constructor,K0=cl.constructor;aN!=K0&&"constructor"in Ql&&"constructor"in cl&&!(typeof aN=="function"&&aN instanceof aN&&typeof K0=="function"&&K0 instanceof K0)&&($N=!1)}return FZ.delete(Ql),FZ.delete(cl),$N}var V0=1,JJ="[object Arguments]",iC="[object Array]",fC="[object Object]",YF=Object.prototype,pF=YF.hasOwnProperty;function Ng(Ql,cl,$l,DR,kU,FZ){var rZ=Nl(Ql),IW=Nl(cl),AW=rZ?iC:gg(Ql),ZI=IW?iC:gg(cl);AW=AW==JJ?fC:AW,ZI=ZI==JJ?fC:ZI;var Td=AW==fC,Ld=ZI==fC,NF=AW==ZI;if(NF&&xZ(Ql)){if(!xZ(cl))return!1;rZ=!0,Td=!1}if(NF&&!Td)return FZ||(FZ=new eF),rZ||zU(Ql)?pg(Ql,cl,$l,DR,kU,FZ):yN(Ql,cl,AW,$l,DR,kU,FZ);if(!($l&V0)){var ZN=Td&&pF.call(Ql,"__wrapped__"),WN=Ld&&pF.call(cl,"__wrapped__");if(ZN||WN){var $N=ZN?Ql.value():Ql,G0=WN?cl.value():cl;return FZ||(FZ=new eF),kU($N,G0,$l,DR,FZ)}}return NF?(FZ||(FZ=new eF),mN(Ql,cl,$l,DR,kU,FZ)):!1}function sg(Ql,cl,$l,DR,kU){return Ql===cl?!0:Ql==null||cl==null||!uV(Ql)&&!uV(cl)?Ql!==Ql&&cl!==cl:Ng(Ql,cl,$l,DR,sg,kU)}var VJ=1,FF=2;function QF(Ql,cl,$l,DR){var kU=$l.length,FZ=kU;if(Ql==null)return!FZ;for(Ql=Object(Ql);kU--;){var rZ=$l[kU];if(rZ[2]?rZ[1]!==Ql[rZ[0]]:!(rZ[0]in Ql))return!1}for(;++kU<FZ;){rZ=$l[kU];var IW=rZ[0],AW=Ql[IW],ZI=rZ[1];if(rZ[2]){if(AW===void 0&&!(IW in Ql))return!1}else{var Td=new eF,Ld;if(!(Ld===void 0?sg(ZI,AW,VJ|FF,DR,Td):Ld))return!1}}return!0}function Ag(Ql){return Ql===Ql&&!Bl(Ql)}function SI(Ql){for(var cl=ud(Ql),$l=cl.length;$l--;){var DR=cl[$l],kU=Ql[DR];cl[$l]=[DR,kU,Ag(kU)]}return cl}function GJ(Ql,cl){return function($l){return $l==null?!1:$l[Ql]===cl&&(cl!==void 0||Ql in Object($l))}}function Zl(Ql){var cl=SI(Ql);return cl.length==1&&cl[0][2]?GJ(cl[0][0],cl[0][1]):function($l){return $l===Ql||QF($l,Ql,cl)}}function il(Ql,cl){return Ql!=null&&cl in Object(Ql)}function Sl(Ql,cl,$l){cl=yd(cl,Ql);for(var DR=-1,kU=cl.length,FZ=!1;++DR<kU;){var rZ=AC(cl[DR]);if(!(FZ=Ql!=null&&$l(Ql,rZ)))break;Ql=Ql[rZ]}return FZ||++DR!=kU?FZ:(kU=Ql==null?0:Ql.length,!!kU&&dW(kU)&&KU(rZ,kU)&&(Nl(Ql)||gW(Ql)))}function Kl(Ql,cl){return Ql!=null&&Sl(Ql,cl,il)}var NR=1,QR=2;function tU(Ql,cl){return JZ(Ql)&&Ag(cl)?GJ(AC(Ql),cl):function($l){var DR=vC($l,Ql);return DR===void 0&&DR===cl?Kl($l,Ql):sg(cl,DR,NR|QR)}}function yU(Ql){return function(cl){return cl==null?void 0:cl[Ql]}}function QU(Ql){return function(cl){return KN(cl,Ql)}}function qZ(Ql){return JZ(Ql)?yU(AC(Ql)):QU(Ql)}function PZ(Ql){return typeof Ql=="function"?Ql:Ql==null?hR:typeof Ql=="object"?Nl(Ql)?tU(Ql[0],Ql[1]):Zl(Ql):qZ(Ql)}function lI(Ql,cl,$l,DR){for(var kU=-1,FZ=Ql==null?0:Ql.length;++kU<FZ;){var rZ=Ql[kU];cl(DR,rZ,$l(rZ),Ql)}return DR}function WW(Ql){return function(cl,$l,DR){for(var kU=-1,FZ=Object(cl),rZ=DR(cl),IW=rZ.length;IW--;){var AW=rZ[++kU];if($l(FZ[AW],AW,FZ)===!1)break}return cl}}var WI=WW();const Kd=WI;function BC(Ql,cl){return Ql&&Kd(Ql,cl,ud)}function od(Ql,cl){return function($l,DR){if($l==null)return $l;if(!tW($l))return Ql($l,DR);for(var kU=$l.length,FZ=-1,rZ=Object($l);++FZ<kU&&DR(rZ[FZ],FZ,rZ)!==!1;);return $l}}var Hd=od(BC);const gC=Hd;function hC(Ql,cl,$l,DR){return gC(Ql,function(kU,FZ,rZ){cl(DR,kU,$l(kU),rZ)}),DR}function dJ(Ql,cl){return function($l,DR){var kU=Nl($l)?lI:hC,FZ={};return kU($l,Ql,PZ(DR),FZ)}}var lF=Object.prototype,fJ=lF.hasOwnProperty,YC=QZ(function(Ql,cl){Ql=Object(Ql);var $l=-1,DR=cl.length,kU=DR>2?cl[2]:void 0;for(kU&&YZ(cl[0],cl[1],kU)&&(DR=1);++$l<DR;)for(var FZ=cl[$l],rZ=VG(FZ),IW=-1,AW=rZ.length;++IW<AW;){var ZI=rZ[IW],Td=Ql[ZI];(Td===void 0||ql(Td,lF[ZI])&&!fJ.call(Ql,ZI))&&(Ql[ZI]=FZ[ZI])}return Ql});const OC=YC;function Ed(Ql){return uV(Ql)&&tW(Ql)}var AN=200;function KC(Ql,cl,$l,DR){var kU=-1,FZ=JU,rZ=!0,IW=Ql.length,AW=[],ZI=cl.length;if(!IW)return AW;cl.length>=AN&&(FZ=Wd,rZ=!1,cl=new dC(cl));V:for(;++kU<IW;){var Td=Ql[kU],Ld=Td;if(Td=Td!==0?Td:0,rZ&&Ld===Ld){for(var NF=ZI;NF--;)if(cl[NF]===Ld)continue V;AW.push(Td)}else FZ(cl,Ld,DR)||AW.push(Td)}return AW}var iN=QZ(function(Ql,cl){return Ed(Ql)?KC(Ql,MC(cl,1,Ed,!0)):[]});const eg=iN;function tg(Ql){var cl=Ql==null?0:Ql.length;return cl?Ql[cl-1]:void 0}function xN(Ql,cl,$l){var DR=Ql==null?0:Ql.length;return DR?(cl=cl===void 0?1:RR(cl),wC(Ql,cl<0?0:cl,DR)):[]}function CJ(Ql,cl,$l){var DR=Ql==null?0:Ql.length;return DR?(cl=cl===void 0?1:RR(cl),cl=DR-cl,wC(Ql,0,cl<0?0:cl)):[]}function MN(Ql){return typeof Ql=="function"?Ql:hR}function mC(Ql,cl){var $l=Nl(Ql)?cW:gC;return $l(Ql,MN(cl))}function l0(Ql,cl){for(var $l=-1,DR=Ql==null?0:Ql.length;++$l<DR;)if(!cl(Ql[$l],$l,Ql))return!1;return!0}function EF(Ql,cl){var $l=!0;return gC(Ql,function(DR,kU,FZ){return $l=!!cl(DR,kU,FZ),$l}),$l}function VR(Ql,cl,$l){var DR=Nl(Ql)?l0:EF;return DR(Ql,PZ(cl))}function UU(Ql,cl){var $l=[];return gC(Ql,function(DR,kU,FZ){cl(DR,kU,FZ)&&$l.push(DR)}),$l}function OR(Ql,cl){var $l=Nl(Ql)?tZ:UU;return $l(Ql,PZ(cl))}function iU(Ql){return function(cl,$l,DR){var kU=Object(cl);if(!tW(cl)){var FZ=PZ($l);cl=ud(cl),$l=function(IW){return FZ(kU[IW],IW,kU)}}var rZ=Ql(cl,$l,DR);return rZ>-1?kU[FZ?cl[rZ]:rZ]:void 0}}var oR=Math.max;function Vl(Ql,cl,$l){var DR=Ql==null?0:Ql.length;if(!DR)return-1;var kU=$l==null?0:RR($l);return kU<0&&(kU=oR(DR+kU,0)),oW(Ql,PZ(cl),kU)}var Wl=iU(Vl);const pl=Wl;function Dl(Ql){return Ql&&Ql.length?Ql[0]:void 0}function aR(Ql,cl){var $l=-1,DR=tW(Ql)?Array(Ql.length):[];return gC(Ql,function(kU,FZ,rZ){DR[++$l]=cl(kU,FZ,rZ)}),DR}function kR(Ql,cl){var $l=Nl(Ql)?yV:aR;return $l(Ql,PZ(cl))}function XU(Ql,cl){return MC(kR(Ql,cl))}var EZ=Object.prototype,pV=EZ.hasOwnProperty,oV=dJ(function(Ql,cl,$l){pV.call(Ql,$l)?Ql[$l].push(cl):_l(Ql,$l,[cl])});const QV=oV;var zV=Object.prototype,$V=zV.hasOwnProperty;function Gl(Ql,cl){return Ql!=null&&$V.call(Ql,cl)}function bl(Ql,cl){return Ql!=null&&Sl(Ql,cl,Gl)}var JR="[object String]";function $R(Ql){return typeof Ql=="string"||!Nl(Ql)&&uV(Ql)&&xV(Ql)==JR}function EU(Ql,cl){return yV(cl,function($l){return Ql[$l]})}function SU(Ql){return Ql==null?[]:EU(Ql,ud(Ql))}var kZ=Math.max;function NZ(Ql,cl,$l,DR){Ql=tW(Ql)?Ql:SU(Ql),$l=$l&&!DR?RR($l):0;var kU=Ql.length;return $l<0&&($l=kZ(kU+$l,0)),$R(Ql)?$l<=kU&&Ql.indexOf(cl,$l)>-1:!!kU&&wR(Ql,cl,$l)>-1}function jW(Ql,cl,$l){var DR=Ql==null?0:Ql.length;if(!DR)return-1;var kU=0;return wR(Ql,cl,kU)}var zW="[object Map]",wI="[object Set]",bI=Object.prototype,aZ=bI.hasOwnProperty;function qU(Ql){if(Ql==null)return!0;if(tW(Ql)&&(Nl(Ql)||typeof Ql=="string"||typeof Ql.splice=="function"||xZ(Ql)||zU(Ql)||gW(Ql)))return!Ql.length;var cl=gg(Ql);if(cl==zW||cl==wI)return!Ql.size;if(bU(Ql))return!sC(Ql).length;for(var $l in Ql)if(aZ.call(Ql,$l))return!1;return!0}var fU="[object RegExp]";function bZ(Ql){return uV(Ql)&&xV(Ql)==fU}var NW=ON&&ON.isRegExp,PW=NW?bd(NW):bZ;const hI=PW;function OI(Ql){return Ql===void 0}var CC="Expected a function";function gd(Ql){if(typeof Ql!="function")throw new TypeError(CC);return function(){var cl=arguments;switch(cl.length){case 0:return!Ql.call(this);case 1:return!Ql.call(this,cl[0]);case 2:return!Ql.call(this,cl[0],cl[1]);case 3:return!Ql.call(this,cl[0],cl[1],cl[2])}return!Ql.apply(this,cl)}}function nF(Ql,cl,$l,DR){if(!Bl(Ql))return Ql;cl=yd(cl,Ql);for(var kU=-1,FZ=cl.length,rZ=FZ-1,IW=Ql;IW!=null&&++kU<FZ;){var AW=AC(cl[kU]),ZI=$l;if(AW==="__proto__"||AW==="constructor"||AW==="prototype")return Ql;if(kU!=rZ){var Td=IW[AW];ZI=void 0,ZI===void 0&&(ZI=Bl(Td)?Td:KU(cl[kU+1])?[]:{})}uU(IW,AW,ZI),IW=IW[AW]}return Ql}function lN(Ql,cl,$l){for(var DR=-1,kU=cl.length,FZ={};++DR<kU;){var rZ=cl[DR],IW=KN(Ql,rZ);$l(IW,rZ)&&nF(FZ,yd(rZ,Ql),IW)}return FZ}function _N(Ql,cl){if(Ql==null)return{};var $l=yV(NC(Ql),function(DR){return[DR]});return cl=PZ(cl),lN(Ql,$l,function(DR,kU){return cl(DR,kU[0])})}function rJ(Ql,cl,$l,DR,kU){return kU(Ql,function(FZ,rZ,IW){$l=DR?(DR=!1,FZ):cl($l,FZ,rZ,IW)}),$l}function H0(Ql,cl,$l){var DR=Nl(Ql)?AF:rJ,kU=arguments.length<3;return DR(Ql,PZ(cl),$l,kU,gC)}function RG(Ql,cl){var $l=Nl(Ql)?tZ:UU;return $l(Ql,gd(PZ(cl)))}function t0(Ql,cl){var $l;return gC(Ql,function(DR,kU,FZ){return $l=cl(DR,kU,FZ),!$l}),!!$l}function _0(Ql,cl,$l){var DR=Nl(Ql)?UI:t0;return DR(Ql,PZ(cl))}var IY=1/0,s1=yJ&&1/$F(new yJ([,-0]))[1]==IY?function(Ql){return new yJ(Ql)}:jZ;const $h=s1;var JG=200;function GG(Ql,cl,$l){var DR=-1,kU=JU,FZ=Ql.length,rZ=!0,IW=[],AW=IW;if(FZ>=JG){var ZI=$h(Ql);if(ZI)return $F(ZI);rZ=!1,kU=Wd,AW=new dC}else AW=IW;V:for(;++DR<FZ;){var Td=Ql[DR],Ld=Td;if(Td=Td!==0?Td:0,rZ&&Ld===Ld){for(var NF=AW.length;NF--;)if(AW[NF]===Ld)continue V;IW.push(Td)}else kU(AW,Ld,$l)||(AW!==IW&&AW.push(Ld),IW.push(Td))}return IW}function LC(Ql){return Ql&&Ql.length?GG(Ql):[]}function O1(Ql){console&&console.error&&console.error(`Error: ${Ql}`)}function Fc(Ql){console&&console.warn&&console.warn(`Warning: ${Ql}`)}function oT(Ql){const cl=new Date().getTime(),$l=Ql();return{time:new Date().getTime()-cl,value:$l}}function wc(Ql){function cl(){}cl.prototype=Ql;const $l=new cl;function DR(){return typeof $l.bar}return DR(),DR(),Ql}function hc(Ql){return qY(Ql)?Ql.LABEL:Ql.name}function qY(Ql){return $R(Ql.LABEL)&&Ql.LABEL!==""}class tY{get definition(){return this._definition}set definition(cl){this._definition=cl}constructor(cl){this._definition=cl}accept(cl){cl.visit(this),mC(this.definition,$l=>{$l.accept(cl)})}}class dY extends tY{constructor(cl){super([]),this.idx=1,FC(this,_N(cl,$l=>$l!==void 0))}set definition(cl){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(cl){cl.visit(this)}}class W1 extends tY{constructor(cl){super(cl.definition),this.orgText="",FC(this,_N(cl,$l=>$l!==void 0))}}class h1 extends tY{constructor(cl){super(cl.definition),this.ignoreAmbiguities=!1,FC(this,_N(cl,$l=>$l!==void 0))}}class $G extends tY{constructor(cl){super(cl.definition),this.idx=1,FC(this,_N(cl,$l=>$l!==void 0))}}class K1 extends tY{constructor(cl){super(cl.definition),this.idx=1,FC(this,_N(cl,$l=>$l!==void 0))}}class rg extends tY{constructor(cl){super(cl.definition),this.idx=1,FC(this,_N(cl,$l=>$l!==void 0))}}class mF extends tY{constructor(cl){super(cl.definition),this.idx=1,FC(this,_N(cl,$l=>$l!==void 0))}}class QJ extends tY{constructor(cl){super(cl.definition),this.idx=1,FC(this,_N(cl,$l=>$l!==void 0))}}class bJ extends tY{get definition(){return this._definition}set definition(cl){this._definition=cl}constructor(cl){super(cl.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,FC(this,_N(cl,$l=>$l!==void 0))}}class jJ{constructor(cl){this.idx=1,FC(this,_N(cl,$l=>$l!==void 0))}accept(cl){cl.visit(this)}}function Sa(Ql){return kR(Ql,HT)}function HT(Ql){function cl($l){return kR($l,HT)}if(Ql instanceof dY){const $l={type:"NonTerminal",name:Ql.nonTerminalName,idx:Ql.idx};return $R(Ql.label)&&($l.label=Ql.label),$l}else{if(Ql instanceof h1)return{type:"Alternative",definition:cl(Ql.definition)};if(Ql instanceof $G)return{type:"Option",idx:Ql.idx,definition:cl(Ql.definition)};if(Ql instanceof K1)return{type:"RepetitionMandatory",idx:Ql.idx,definition:cl(Ql.definition)};if(Ql instanceof rg)return{type:"RepetitionMandatoryWithSeparator",idx:Ql.idx,separator:HT(new jJ({terminalType:Ql.separator})),definition:cl(Ql.definition)};if(Ql instanceof QJ)return{type:"RepetitionWithSeparator",idx:Ql.idx,separator:HT(new jJ({terminalType:Ql.separator})),definition:cl(Ql.definition)};if(Ql instanceof mF)return{type:"Repetition",idx:Ql.idx,definition:cl(Ql.definition)};if(Ql instanceof bJ)return{type:"Alternation",idx:Ql.idx,definition:cl(Ql.definition)};if(Ql instanceof jJ){const $l={type:"Terminal",name:Ql.terminalType.name,label:hc(Ql.terminalType),idx:Ql.idx};$R(Ql.label)&&($l.terminalLabel=Ql.label);const DR=Ql.terminalType.PATTERN;return Ql.terminalType.PATTERN&&($l.pattern=hI(DR)?DR.source:DR),$l}else{if(Ql instanceof W1)return{type:"Rule",name:Ql.name,orgText:Ql.orgText,definition:cl(Ql.definition)};throw Error("non exhaustive match")}}}class HY{visit(cl){const $l=cl;switch($l.constructor){case dY:return this.visitNonTerminal($l);case h1:return this.visitAlternative($l);case $G:return this.visitOption($l);case K1:return this.visitRepetitionMandatory($l);case rg:return this.visitRepetitionMandatoryWithSeparator($l);case QJ:return this.visitRepetitionWithSeparator($l);case mF:return this.visitRepetition($l);case bJ:return this.visitAlternation($l);case jJ:return this.visitTerminal($l);case W1:return this.visitRule($l);default:throw Error("non exhaustive match")}}visitNonTerminal(cl){}visitAlternative(cl){}visitOption(cl){}visitRepetition(cl){}visitRepetitionMandatory(cl){}visitRepetitionMandatoryWithSeparator(cl){}visitRepetitionWithSeparator(cl){}visitAlternation(cl){}visitTerminal(cl){}visitRule(cl){}}function ZE(Ql){return Ql instanceof h1||Ql instanceof $G||Ql instanceof mF||Ql instanceof K1||Ql instanceof rg||Ql instanceof QJ||Ql instanceof jJ||Ql instanceof W1}function Vm(Ql,cl=[]){return Ql instanceof $G||Ql instanceof mF||Ql instanceof QJ?!0:Ql instanceof bJ?_0(Ql.definition,DR=>Vm(DR,cl)):Ql instanceof dY&&NZ(cl,Ql)?!1:Ql instanceof tY?(Ql instanceof dY&&cl.push(Ql),VR(Ql.definition,DR=>Vm(DR,cl))):!1}function zT(Ql){return Ql instanceof bJ}function $Y(Ql){if(Ql instanceof dY)return"SUBRULE";if(Ql instanceof $G)return"OPTION";if(Ql instanceof bJ)return"OR";if(Ql instanceof K1)return"AT_LEAST_ONE";if(Ql instanceof rg)return"AT_LEAST_ONE_SEP";if(Ql instanceof QJ)return"MANY_SEP";if(Ql instanceof mF)return"MANY";if(Ql instanceof jJ)return"CONSUME";throw Error("non exhaustive match")}class _m{walk(cl,$l=[]){mC(cl.definition,(DR,kU)=>{const FZ=xN(cl.definition,kU+1);if(DR instanceof dY)this.walkProdRef(DR,FZ,$l);else if(DR instanceof jJ)this.walkTerminal(DR,FZ,$l);else if(DR instanceof h1)this.walkFlat(DR,FZ,$l);else if(DR instanceof $G)this.walkOption(DR,FZ,$l);else if(DR instanceof K1)this.walkAtLeastOne(DR,FZ,$l);else if(DR instanceof rg)this.walkAtLeastOneSep(DR,FZ,$l);else if(DR instanceof QJ)this.walkManySep(DR,FZ,$l);else if(DR instanceof mF)this.walkMany(DR,FZ,$l);else if(DR instanceof bJ)this.walkOr(DR,FZ,$l);else throw Error("non exhaustive match")})}walkTerminal(cl,$l,DR){}walkProdRef(cl,$l,DR){}walkFlat(cl,$l,DR){const kU=$l.concat(DR);this.walk(cl,kU)}walkOption(cl,$l,DR){const kU=$l.concat(DR);this.walk(cl,kU)}walkAtLeastOne(cl,$l,DR){const kU=[new $G({definition:cl.definition})].concat($l,DR);this.walk(cl,kU)}walkAtLeastOneSep(cl,$l,DR){const kU=Bk(cl,$l,DR);this.walk(cl,kU)}walkMany(cl,$l,DR){const kU=[new $G({definition:cl.definition})].concat($l,DR);this.walk(cl,kU)}walkManySep(cl,$l,DR){const kU=Bk(cl,$l,DR);this.walk(cl,kU)}walkOr(cl,$l,DR){const kU=$l.concat(DR);mC(cl.definition,FZ=>{const rZ=new h1({definition:[FZ]});this.walk(rZ,kU)})}}function Bk(Ql,cl,$l){return[new $G({definition:[new jJ({terminalType:Ql.separator})].concat(Ql.definition)})].concat(cl,$l)}function iY(Ql){if(Ql instanceof dY)return iY(Ql.referencedRule);if(Ql instanceof jJ)return uF(Ql);if(ZE(Ql))return i0(Ql);if(zT(Ql))return aG(Ql);throw Error("non exhaustive match")}function i0(Ql){let cl=[];const $l=Ql.definition;let DR=0,kU=$l.length>DR,FZ,rZ=!0;for(;kU&&rZ;)FZ=$l[DR],rZ=Vm(FZ),cl=cl.concat(iY(FZ)),DR=DR+1,kU=$l.length>DR;return LC(cl)}function aG(Ql){const cl=kR(Ql.definition,$l=>iY($l));return LC(Od(cl))}function uF(Ql){return[Ql.terminalType]}const z0="_~IN~_";class y0 extends _m{constructor(cl){super(),this.topProd=cl,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(cl,$l,DR){}walkProdRef(cl,$l,DR){const kU=CY(cl.referencedRule,cl.idx)+this.topProd.name,FZ=$l.concat(DR),rZ=new h1({definition:FZ}),IW=iY(rZ);this.follows[kU]=IW}}function r1(Ql){const cl={};return mC(Ql,$l=>{const DR=new y0($l).startWalking();FC(cl,DR)}),cl}function CY(Ql,cl){return Ql.name+cl+z0}function MF(Ql){return Ql.charCodeAt(0)}function TY(Ql,cl){Array.isArray(Ql)?Ql.forEach(function($l){cl.push($l)}):cl.push(Ql)}function Aa(Ql,cl){if(Ql[cl]===!0)throw"duplicate flag "+cl;Ql[cl],Ql[cl]=!0}function nT(Ql){if(Ql===void 0)throw Error("Internal Error - Should never get here!");return!0}function WE(){throw Error("Internal Error - Should never get here!")}function IE(Ql){return Ql.type==="Character"}const Nc=[];for(let Ql=MF("0");Ql<=MF("9");Ql++)Nc.push(Ql);const Ma=[MF("_")].concat(Nc);for(let Ql=MF("a");Ql<=MF("z");Ql++)Ma.push(Ql);for(let Ql=MF("A");Ql<=MF("Z");Ql++)Ma.push(Ql);const dE=[MF(" "),MF("\f"),MF(`
|
|
10572
|
+
`,MU),null}const xZ=AU.getAttribute("version");console.log("THREE.ColladaLoader: File version",xZ);const DZ=JV(dV(AU,"asset")[0]),rW=new J.TextureLoader(this.manager);rW.setPath(this.resourcePath||IV).setCrossOrigin(this.crossOrigin);let bW;VV.TGALoader&&(bW=new VV.TGALoader(this.manager),bW.setPath(this.resourcePath||IV));const II=[];let pW={},iI=0;const nI={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};YV(AU,"library_animations","animation",AV),YV(AU,"library_animation_clips","animation_clip",Il),YV(AU,"library_controllers","controller",kl),YV(AU,"library_images","image",Al),YV(AU,"library_effects","effect",hR),YV(AU,"library_materials","material",BR),YV(AU,"library_cameras","camera",TR),YV(AU,"library_lights","light",NU),YV(AU,"library_geometries","geometry",oZ),YV(AU,"library_nodes","node",tW),YV(AU,"library_visual_scenes","visual_scene",$U),YV(AU,"library_kinematics_models","kinematics_model",JW),YV(AU,"library_physics_models","physics_model",KU),YV(AU,"scene","instance_kinematics_scene",yR),tV(nI.animations,xV),tV(nI.clips,Jl),tV(nI.controllers,Pl),tV(nI.images,Ol),tV(nI.effects,HR),tV(nI.materials,ER),tV(nI.cameras,FR),tV(nI.lights,jZ),tV(nI.geometries,_W),tV(nI.visualScenes,wZ),gI(),PU();const sI=SW(dV(AU,"scene")[0]);return sI.animations=II,DZ.upAxis==="Z_UP"&&sI.quaternion.setFromEuler(new J.Euler(-Math.PI/2,0,0)),sI.scale.multiplyScalar(DZ.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),II},kinematics:pW,library:nI,scene:sI}}}lV.ColladaLoader=UV}(ColladaLoader)),ColladaLoader}var hasRequiredKMZLoader;function requireKMZLoader(){return hasRequiredKMZLoader||(hasRequiredKMZLoader=1,function(lV){Object.defineProperty(lV,Symbol.toStringTag,{value:"Module"});const J=requireThree(),VV=requireColladaLoader(),RV=requireLib();class UV extends J.Loader{constructor(WV){super(WV)}load(WV,IV,dV,CV){const FV=this,NV=new J.FileLoader(FV.manager);NV.setPath(FV.path),NV.setResponseType("arraybuffer"),NV.setRequestHeader(FV.requestHeader),NV.setWithCredentials(FV.withCredentials),NV.load(WV,function(eV){try{IV(FV.parse(eV))}catch(gV){CV?CV(gV):console.error(gV),FV.manager.itemError(WV)}},dV,CV)}parse(WV){function IV(FV){for(const NV in CV)if(NV.substr(-FV.length)===FV)return CV[NV]}const dV=new J.LoadingManager;dV.setURLModifier(function(FV){const NV=IV(FV);if(NV){console.log("Loading",FV);const eV=new Blob([NV.buffer],{type:"application/octet-stream"});return URL.createObjectURL(eV)}return FV});const CV=RV.unzipSync(new Uint8Array(WV));if(CV["doc.kml"]){const NV=new DOMParser().parseFromString(fflate.strFromU8(CV["doc.kml"]),"application/xml").querySelector("Placemark Model Link href");if(NV)return new VV.ColladaLoader(dV).parse(fflate.strFromU8(CV[NV.textContent]))}else{console.warn("KMZLoader: Missing doc.kml file.");for(const FV in CV)if(FV.split(".").pop().toLowerCase()==="dae")return new VV.ColladaLoader(dV).parse(fflate.strFromU8(CV[FV]))}return console.error("KMZLoader: Couldn't find .dae file."),{scene:new J.Group}}}lV.KMZLoader=UV}(KMZLoader)),KMZLoader}var VRMLoader={},hasRequiredVRMLoader;function requireVRMLoader(){return hasRequiredVRMLoader||(hasRequiredVRMLoader=1,function(lV){Object.defineProperty(lV,Symbol.toStringTag,{value:"Module"});const J=requireThree(),VV=requireGLTFLoader();class RV extends J.Loader{constructor(ZV){super(ZV),this.gltfLoader=new VV.GLTFLoader(ZV)}load(ZV,WV,IV,dV){const CV=this;this.gltfLoader.load(ZV,function(FV){try{CV.parse(FV,WV)}catch(NV){dV?dV(NV):console.error(NV),CV.manager.itemError(ZV)}},IV,dV)}setDRACOLoader(ZV){return this.gltfLoader.setDRACOLoader(ZV),this}parse(ZV,WV){WV(ZV)}}lV.VRMLoader=RV}(VRMLoader)),VRMLoader}var VRMLLoader={},chevrotain={exports:{}};chevrotain.exports;var hasRequiredChevrotain;function requireChevrotain(){return hasRequiredChevrotain||(hasRequiredChevrotain=1,function(lV,J){var VV={process:{env:{}}};Object.defineProperty(J,Symbol.toStringTag,{value:"Module"});const{CstParser:RV,Lexer:UV,createToken:ZV}=(()=>{var WV=typeof VV=="object"&&VV&&VV.Object===Object&&VV;const IV=WV;var dV=typeof self=="object"&&self&&self.Object===Object&&self,CV=IV||dV||Function("return this")();const FV=CV;var NV=FV.Symbol;const eV=NV;var gV=Object.prototype,nV=gV.hasOwnProperty,JV=gV.toString,aV=eV?eV.toStringTag:void 0;function GV(Ql){var cl=nV.call(Ql,aV),$l=Ql[aV];try{Ql[aV]=void 0;var DR=!0}catch{}var kU=JV.call(Ql);return DR&&(cl?Ql[aV]=$l:delete Ql[aV]),kU}var YV=Object.prototype,tV=YV.toString;function kV(Ql){return tV.call(Ql)}var AV="[object Null]",XV="[object Undefined]",MV=eV?eV.toStringTag:void 0;function xV(Ql){return Ql==null?Ql===void 0?XV:AV:MV&&MV in Object(Ql)?GV(Ql):kV(Ql)}function uV(Ql){return Ql!=null&&typeof Ql=="object"}var wV="[object Symbol]";function vV(Ql){return typeof Ql=="symbol"||uV(Ql)&&xV(Ql)==wV}function yV(Ql,cl){for(var $l=-1,DR=Ql==null?0:Ql.length,kU=Array(DR);++$l<DR;)kU[$l]=cl(Ql[$l],$l,Ql);return kU}var ll=Array.isArray;const Nl=ll;var al=1/0,el=eV?eV.prototype:void 0,qV=el?el.toString:void 0;function fV(Ql){if(typeof Ql=="string")return Ql;if(Nl(Ql))return yV(Ql,fV)+"";if(vV(Ql))return qV?qV.call(Ql):"";var cl=Ql+"";return cl=="0"&&1/Ql==-al?"-0":cl}var Ul=/\s/;function Cl(Ql){for(var cl=Ql.length;cl--&&Ul.test(Ql.charAt(cl)););return cl}var Il=/^\s+/;function Jl(Ql){return Ql&&Ql.slice(0,Cl(Ql)+1).replace(Il,"")}function Bl(Ql){var cl=typeof Ql;return Ql!=null&&(cl=="object"||cl=="function")}var kl=NaN,ol=/^[-+]0x[0-9a-f]+$/i,xl=/^0b[01]+$/i,wl=/^0o[0-7]+$/i,Pl=parseInt;function zl(Ql){if(typeof Ql=="number")return Ql;if(vV(Ql))return kl;if(Bl(Ql)){var cl=typeof Ql.valueOf=="function"?Ql.valueOf():Ql;Ql=Bl(cl)?cl+"":cl}if(typeof Ql!="string")return Ql===0?Ql:+Ql;Ql=Jl(Ql);var $l=xl.test(Ql);return $l||wl.test(Ql)?Pl(Ql.slice(2),$l?2:8):ol.test(Ql)?kl:+Ql}var Tl=1/0,Al=17976931348623157e292;function Ol(Ql){if(!Ql)return Ql===0?Ql:0;if(Ql=zl(Ql),Ql===Tl||Ql===-Tl){var cl=Ql<0?-1:1;return cl*Al}return Ql===Ql?Ql:0}function RR(Ql){var cl=Ol(Ql),$l=cl%1;return cl===cl?$l?cl-$l:cl:0}function hR(Ql){return Ql}var gR="[object AsyncFunction]",sR="[object Function]",tR="[object GeneratorFunction]",pR="[object Proxy]";function MR(Ql){if(!Bl(Ql))return!1;var cl=xV(Ql);return cl==sR||cl==tR||cl==gR||cl==pR}var cR=FV["__core-js_shared__"];const mR=cR;var zR=function(){var Ql=/[^.]+$/.exec(mR&&mR.keys&&mR.keys.IE_PROTO||"");return Ql?"Symbol(src)_1."+Ql:""}();function XR(Ql){return!!zR&&zR in Ql}var ZU=Function.prototype,sU=ZU.toString;function rU(Ql){if(Ql!=null){try{return sU.call(Ql)}catch{}try{return Ql+""}catch{}}return""}var KR=/[\\^$.*+?()[\]{}|]/g,HR=/^\[object .+?Constructor\]$/,eU=Function.prototype,BR=Object.prototype,vl=eU.toString,ER=BR.hasOwnProperty,iR=RegExp("^"+vl.call(ER).replace(KR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function TR(Ql){if(!Bl(Ql)||XR(Ql))return!1;var cl=MR(Ql)?iR:HR;return cl.test(rU(Ql))}function PR(Ql,cl){return Ql==null?void 0:Ql[cl]}function RU(Ql,cl){var $l=PR(Ql,cl);return TR($l)?$l:void 0}var nU=RU(FV,"WeakMap");const FR=nU;var dU=Object.create,NU=function(){function Ql(){}return function(cl){if(!Bl(cl))return{};if(dU)return dU(cl);Ql.prototype=cl;var $l=new Ql;return Ql.prototype=void 0,$l}}();const OU=NU;function MZ(Ql,cl,$l){switch($l.length){case 0:return Ql.call(cl);case 1:return Ql.call(cl,$l[0]);case 2:return Ql.call(cl,$l[0],$l[1]);case 3:return Ql.call(cl,$l[0],$l[1],$l[2])}return Ql.apply(cl,$l)}function jZ(){}function OZ(Ql,cl){var $l=-1,DR=Ql.length;for(cl||(cl=Array(DR));++$l<DR;)cl[$l]=Ql[$l];return cl}var oZ=800,MW=16,LU=Date.now;function hW(Ql){var cl=0,$l=0;return function(){var DR=LU(),kU=MW-(DR-$l);if($l=DR,kU>0){if(++cl>=oZ)return arguments[0]}else cl=0;return Ql.apply(void 0,arguments)}}function CW(Ql){return function(){return Ql}}var iW=function(){try{var Ql=RU(Object,"defineProperty");return Ql({},"",{}),Ql}catch{}}();const _W=iW;var KW=_W?function(Ql,cl){return _W(Ql,"toString",{configurable:!0,enumerable:!1,value:CW(cl),writable:!0})}:hR,nW=hW(KW);const JW=nW;function cW(Ql,cl){for(var $l=-1,DR=Ql==null?0:Ql.length;++$l<DR&&cl(Ql[$l],$l,Ql)!==!1;);return Ql}function oW(Ql,cl,$l,DR){for(var kU=Ql.length,FZ=$l+-1;++FZ<kU;)if(cl(Ql[FZ],FZ,Ql))return FZ;return-1}function CZ(Ql){return Ql!==Ql}function IU(Ql,cl,$l){for(var DR=$l-1,kU=Ql.length;++DR<kU;)if(Ql[DR]===cl)return DR;return-1}function wR(Ql,cl,$l){return cl===cl?IU(Ql,cl,$l):oW(Ql,CZ,$l)}function JU(Ql,cl){var $l=Ql==null?0:Ql.length;return!!$l&&wR(Ql,cl,0)>-1}var uR=9007199254740991,BU=/^(?:0|[1-9]\d*)$/;function KU(Ql,cl){var $l=typeof Ql;return cl=cl??uR,!!cl&&($l=="number"||$l!="symbol"&&BU.test(Ql))&&Ql>-1&&Ql%1==0&&Ql<cl}function _l(Ql,cl,$l){cl=="__proto__"&&_W?_W(Ql,cl,{configurable:!0,enumerable:!0,value:$l,writable:!0}):Ql[cl]=$l}function ql(Ql,cl){return Ql===cl||Ql!==Ql&&cl!==cl}var yR=Object.prototype,GU=yR.hasOwnProperty;function uU(Ql,cl,$l){var DR=Ql[cl];(!(GU.call(Ql,cl)&&ql(DR,$l))||$l===void 0&&!(cl in Ql))&&_l(Ql,cl,$l)}function _U(Ql,cl,$l,DR){var kU=!$l;$l||($l={});for(var FZ=-1,rZ=cl.length;++FZ<rZ;){var IW=cl[FZ],AW=void 0;AW===void 0&&(AW=Ql[IW]),kU?_l($l,IW,AW):uU($l,IW,AW)}return $l}var PU=Math.max;function FW(Ql,cl,$l){return cl=PU(cl===void 0?Ql.length-1:cl,0),function(){for(var DR=arguments,kU=-1,FZ=PU(DR.length-cl,0),rZ=Array(FZ);++kU<FZ;)rZ[kU]=DR[cl+kU];kU=-1;for(var IW=Array(cl+1);++kU<cl;)IW[kU]=DR[kU];return IW[cl]=$l(rZ),MZ(Ql,this,IW)}}function QZ(Ql,cl){return JW(FW(Ql,cl,hR),Ql+"")}var HZ=9007199254740991;function dW(Ql){return typeof Ql=="number"&&Ql>-1&&Ql%1==0&&Ql<=HZ}function tW(Ql){return Ql!=null&&dW(Ql.length)&&!MR(Ql)}function YZ(Ql,cl,$l){if(!Bl($l))return!1;var DR=typeof cl;return(DR=="number"?tW($l)&&KU(cl,$l.length):DR=="string"&&cl in $l)?ql($l[cl],Ql):!1}function bR(Ql){return QZ(function(cl,$l){var DR=-1,kU=$l.length,FZ=kU>1?$l[kU-1]:void 0,rZ=kU>2?$l[2]:void 0;for(FZ=Ql.length>3&&typeof FZ=="function"?(kU--,FZ):void 0,rZ&&YZ($l[0],$l[1],rZ)&&(FZ=kU<3?void 0:FZ,kU=1),cl=Object(cl);++DR<kU;){var IW=$l[DR];IW&&Ql(cl,IW,DR,FZ)}return cl})}var YU=Object.prototype;function bU(Ql){var cl=Ql&&Ql.constructor,$l=typeof cl=="function"&&cl.prototype||YU;return Ql===$l}function ZZ(Ql,cl){for(var $l=-1,DR=Array(Ql);++$l<Ql;)DR[$l]=cl($l);return DR}var mZ="[object Arguments]";function _Z(Ql){return uV(Ql)&&xV(Ql)==mZ}var YW=Object.prototype,sZ=YW.hasOwnProperty,$U=YW.propertyIsEnumerable,wZ=_Z(function(){return arguments}())?_Z:function(Ql){return uV(Ql)&&sZ.call(Ql,"callee")&&!$U.call(Ql,"callee")};const gW=wZ;function RW(){return!1}var SW=J&&!J.nodeType&&J,gI=SW&&!0&&lV&&!lV.nodeType&&lV,TU=gI&&gI.exports===SW,aU=TU?FV.Buffer:void 0,AU=aU?aU.isBuffer:void 0,lZ=AU||RW;const xZ=lZ;var DZ="[object Arguments]",rW="[object Array]",bW="[object Boolean]",II="[object Date]",pW="[object Error]",iI="[object Function]",nI="[object Map]",sI="[object Number]",jU="[object Object]",MU="[object RegExp]",DU="[object Set]",RZ="[object String]",vU="[object WeakMap]",TW="[object ArrayBuffer]",KZ="[object DataView]",XI="[object Float32Array]",DW="[object Float64Array]",yI="[object Int8Array]",CI="[object Int16Array]",FI="[object Int32Array]",rd="[object Uint8Array]",Nd="[object Uint8ClampedArray]",WC="[object Uint16Array]",kd="[object Uint32Array]",zd={};zd[XI]=zd[DW]=zd[yI]=zd[CI]=zd[FI]=zd[rd]=zd[Nd]=zd[WC]=zd[kd]=!0,zd[DZ]=zd[rW]=zd[TW]=zd[bW]=zd[KZ]=zd[II]=zd[pW]=zd[iI]=zd[nI]=zd[sI]=zd[jU]=zd[MU]=zd[DU]=zd[RZ]=zd[vU]=!1;function UC(Ql){return uV(Ql)&&dW(Ql.length)&&!!zd[xV(Ql)]}function bd(Ql){return function(cl){return Ql(cl)}}var Id=J&&!J.nodeType&&J,EC=Id&&!0&&lV&&!lV.nodeType&&lV,ZF=EC&&EC.exports===Id,YN=ZF&&IV.process,WF=function(){try{var Ql=EC&&EC.require&&EC.require("util").types;return Ql||YN&&YN.binding&&YN.binding("util")}catch{}}();const ON=WF;var OF=ON&&ON.isTypedArray,AR=OF?bd(OF):UC;const zU=AR;var BZ=Object.prototype,lW=BZ.hasOwnProperty;function BW(Ql,cl){var $l=Nl(Ql),DR=!$l&&gW(Ql),kU=!$l&&!DR&&xZ(Ql),FZ=!$l&&!DR&&!kU&&zU(Ql),rZ=$l||DR||kU||FZ,IW=rZ?ZZ(Ql.length,String):[],AW=IW.length;for(var ZI in Ql)(cl||lW.call(Ql,ZI))&&!(rZ&&(ZI=="length"||kU&&(ZI=="offset"||ZI=="parent")||FZ&&(ZI=="buffer"||ZI=="byteLength"||ZI=="byteOffset")||KU(ZI,AW)))&&IW.push(ZI);return IW}function xI(Ql,cl){return function($l){return Ql(cl($l))}}var JI=xI(Object.keys,Object);const Vd=JI;var Cd=Object.prototype,wd=Cd.hasOwnProperty;function sC(Ql){if(!bU(Ql))return Vd(Ql);var cl=[];for(var $l in Object(Ql))wd.call(Ql,$l)&&$l!="constructor"&&cl.push($l);return cl}function ud(Ql){return tW(Ql)?BW(Ql):sC(Ql)}var _C=Object.prototype,SC=_C.hasOwnProperty,XC=bR(function(Ql,cl){if(bU(cl)||tW(cl)){_U(cl,ud(cl),Ql);return}for(var $l in cl)SC.call(cl,$l)&&uU(Ql,$l,cl[$l])});const FC=XC;function og(Ql){var cl=[];if(Ql!=null)for(var $l in Object(Ql))cl.push($l);return cl}var rF=Object.prototype,XG=rF.hasOwnProperty;function wJ(Ql){if(!Bl(Ql))return og(Ql);var cl=bU(Ql),$l=[];for(var DR in Ql)DR=="constructor"&&(cl||!XG.call(Ql,DR))||$l.push(DR);return $l}function VG(Ql){return tW(Ql)?BW(Ql,!0):wJ(Ql)}var _G=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M1=/^\w*$/;function JZ(Ql,cl){if(Nl(Ql))return!1;var $l=typeof Ql;return $l=="number"||$l=="symbol"||$l=="boolean"||Ql==null||vV(Ql)?!0:M1.test(Ql)||!_G.test(Ql)||cl!=null&&Ql in Object(cl)}var a1=RU(Object,"create");const v0=a1;function Q1(){this.__data__=v0?v0(null):{},this.size=0}function Ra(Ql){var cl=this.has(Ql)&&delete this.__data__[Ql];return this.size-=cl?1:0,cl}var CG="__lodash_hash_undefined__",b1=Object.prototype,iJ=b1.hasOwnProperty;function N0(Ql){var cl=this.__data__;if(v0){var $l=cl[Ql];return $l===CG?void 0:$l}return iJ.call(cl,Ql)?cl[Ql]:void 0}var BG=Object.prototype,TJ=BG.hasOwnProperty;function dg(Ql){var cl=this.__data__;return v0?cl[Ql]!==void 0:TJ.call(cl,Ql)}var u0="__lodash_hash_undefined__";function NJ(Ql,cl){var $l=this.__data__;return this.size+=this.has(Ql)?0:1,$l[Ql]=v0&&cl===void 0?u0:cl,this}function Hg(Ql){var cl=-1,$l=Ql==null?0:Ql.length;for(this.clear();++cl<$l;){var DR=Ql[cl];this.set(DR[0],DR[1])}}Hg.prototype.clear=Q1,Hg.prototype.delete=Ra,Hg.prototype.get=N0,Hg.prototype.has=dg,Hg.prototype.set=NJ;function sN(){this.__data__=[],this.size=0}function jN(Ql,cl){for(var $l=Ql.length;$l--;)if(ql(Ql[$l][0],cl))return $l;return-1}var _g=Array.prototype,RJ=_g.splice;function wN(Ql){var cl=this.__data__,$l=jN(cl,Ql);if($l<0)return!1;var DR=cl.length-1;return $l==DR?cl.pop():RJ.call(cl,$l,1),--this.size,!0}function qF(Ql){var cl=this.__data__,$l=jN(cl,Ql);return $l<0?void 0:cl[$l][1]}function uN(Ql){return jN(this.__data__,Ql)>-1}function Mg(Ql,cl){var $l=this.__data__,DR=jN($l,Ql);return DR<0?(++this.size,$l.push([Ql,cl])):$l[DR][1]=cl,this}function lg(Ql){var cl=-1,$l=Ql==null?0:Ql.length;for(this.clear();++cl<$l;){var DR=Ql[cl];this.set(DR[0],DR[1])}}lg.prototype.clear=sN,lg.prototype.delete=wN,lg.prototype.get=qF,lg.prototype.has=uN,lg.prototype.set=Mg;var e0=RU(FV,"Map");const FG=e0;function ug(){this.size=0,this.__data__={hash:new Hg,map:new(FG||lg),string:new Hg}}function g0(Ql){var cl=typeof Ql;return cl=="string"||cl=="number"||cl=="symbol"||cl=="boolean"?Ql!=="__proto__":Ql===null}function D0(Ql,cl){var $l=Ql.__data__;return g0(cl)?$l[typeof cl=="string"?"string":"hash"]:$l.map}function SG(Ql){var cl=D0(this,Ql).delete(Ql);return this.size-=cl?1:0,cl}function Eg(Ql){return D0(this,Ql).get(Ql)}function Rg(Ql){return D0(this,Ql).has(Ql)}function qg(Ql,cl){var $l=D0(this,Ql),DR=$l.size;return $l.set(Ql,cl),this.size+=$l.size==DR?0:1,this}function jd(Ql){var cl=-1,$l=Ql==null?0:Ql.length;for(this.clear();++cl<$l;){var DR=Ql[cl];this.set(DR[0],DR[1])}}jd.prototype.clear=ug,jd.prototype.delete=SG,jd.prototype.get=Eg,jd.prototype.has=Rg,jd.prototype.set=qg;var EJ="Expected a function";function mJ(Ql,cl){if(typeof Ql!="function"||cl!=null&&typeof cl!="function")throw new TypeError(EJ);var $l=function(){var DR=arguments,kU=cl?cl.apply(this,DR):DR[0],FZ=$l.cache;if(FZ.has(kU))return FZ.get(kU);var rZ=Ql.apply(this,DR);return $l.cache=FZ.set(kU,rZ)||FZ,rZ};return $l.cache=new(mJ.Cache||jd),$l}mJ.Cache=jd;var qC=500;function fg(Ql){var cl=mJ(Ql,function(DR){return $l.size===qC&&$l.clear(),DR}),$l=cl.cache;return cl}var EI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,IC=/\\(\\)?/g,tC=fg(function(Ql){var cl=[];return Ql.charCodeAt(0)===46&&cl.push(""),Ql.replace(EI,function($l,DR,kU,FZ){cl.push(kU?FZ.replace(IC,"$1"):DR||$l)}),cl});const p0=tC;function rI(Ql){return Ql==null?"":fV(Ql)}function yd(Ql,cl){return Nl(Ql)?Ql:JZ(Ql,cl)?[Ql]:p0(rI(Ql))}var uJ=1/0;function AC(Ql){if(typeof Ql=="string"||vV(Ql))return Ql;var cl=Ql+"";return cl=="0"&&1/Ql==-uJ?"-0":cl}function KN(Ql,cl){cl=yd(cl,Ql);for(var $l=0,DR=cl.length;Ql!=null&&$l<DR;)Ql=Ql[AC(cl[$l++])];return $l&&$l==DR?Ql:void 0}function vC(Ql,cl,$l){var DR=Ql==null?void 0:KN(Ql,cl);return DR===void 0?$l:DR}function jF(Ql,cl){for(var $l=-1,DR=cl.length,kU=Ql.length;++$l<DR;)Ql[kU+$l]=cl[$l];return Ql}var IF=eV?eV.isConcatSpreadable:void 0;function ag(Ql){return Nl(Ql)||gW(Ql)||!!(IF&&Ql&&Ql[IF])}function MC(Ql,cl,$l,DR,kU){var FZ=-1,rZ=Ql.length;for($l||($l=ag),kU||(kU=[]);++FZ<rZ;){var IW=Ql[FZ];$l(IW)?jF(kU,IW):DR||(kU[kU.length]=IW)}return kU}function Od(Ql){var cl=Ql==null?0:Ql.length;return cl?MC(Ql):[]}var pd=xI(Object.getPrototypeOf,Object);const sd=pd;function wC(Ql,cl,$l){var DR=-1,kU=Ql.length;cl<0&&(cl=-cl>kU?0:kU+cl),$l=$l>kU?kU:$l,$l<0&&($l+=kU),kU=cl>$l?0:$l-cl>>>0,cl>>>=0;for(var FZ=Array(kU);++DR<kU;)FZ[DR]=Ql[DR+cl];return FZ}function AF(Ql,cl,$l,DR){var kU=-1,FZ=Ql==null?0:Ql.length;for(DR&&FZ&&($l=Ql[++kU]);++kU<FZ;)$l=cl($l,Ql[kU],kU,Ql);return $l}function zg(){this.__data__=new lg,this.size=0}function oJ(Ql){var cl=this.__data__,$l=cl.delete(Ql);return this.size=cl.size,$l}function Pd(Ql){return this.__data__.get(Ql)}function DJ(Ql){return this.__data__.has(Ql)}var dN=200;function kN(Ql,cl){var $l=this.__data__;if($l instanceof lg){var DR=$l.__data__;if(!FG||DR.length<dN-1)return DR.push([Ql,cl]),this.size=++$l.size,this;$l=this.__data__=new jd(DR)}return $l.set(Ql,cl),this.size=$l.size,this}function eF(Ql){var cl=this.__data__=new lg(Ql);this.size=cl.size}eF.prototype.clear=zg,eF.prototype.delete=oJ,eF.prototype.get=Pd,eF.prototype.has=DJ,eF.prototype.set=kN;function EN(Ql,cl){return Ql&&_U(cl,ud(cl),Ql)}var XN=J&&!J.nodeType&&J,Dg=XN&&!0&&lV&&!lV.nodeType&&lV,KF=Dg&&Dg.exports===XN,UJ=KF?FV.Buffer:void 0,HI=UJ?UJ.allocUnsafe:void 0;function VC(Ql,cl){var $l=Ql.length,DR=HI?HI($l):new Ql.constructor($l);return Ql.copy(DR),DR}function tZ(Ql,cl){for(var $l=-1,DR=Ql==null?0:Ql.length,kU=0,FZ=[];++$l<DR;){var rZ=Ql[$l];cl(rZ,$l,Ql)&&(FZ[kU++]=rZ)}return FZ}function Zd(){return[]}var yC=Object.prototype,rC=yC.propertyIsEnumerable,Cg=Object.getOwnPropertySymbols,BN=Cg?function(Ql){return Ql==null?[]:(Ql=Object(Ql),tZ(Cg(Ql),function(cl){return rC.call(Ql,cl)}))}:Zd;const UW=BN;function h0(Ql,cl){return _U(Ql,UW(Ql),cl)}var sW=Object.getOwnPropertySymbols,bF=sW?function(Ql){for(var cl=[];Ql;)jF(cl,UW(Ql)),Ql=sd(Ql);return cl}:Zd;const XW=bF;function QI(Ql,cl,$l){var DR=cl(Ql);return Nl(Ql)?DR:jF(DR,$l(Ql))}function Jd(Ql){return QI(Ql,ud,UW)}function NC(Ql){return QI(Ql,VG,XW)}var CN=RU(FV,"DataView");const mg=CN;var hg=RU(FV,"Promise");const xg=hg;var Y0=RU(FV,"Set");const yJ=Y0;var s0="[object Map]",n0="[object Object]",X0="[object Promise]",qG="[object Set]",yG="[object WeakMap]",c0="[object DataView]",f0=rU(mg),HJ=rU(FG),m0=rU(xg),oG=rU(yJ),QC=rU(FR),kJ=xV;(mg&&kJ(new mg(new ArrayBuffer(1)))!=c0||FG&&kJ(new FG)!=s0||xg&&kJ(xg.resolve())!=X0||yJ&&kJ(new yJ)!=qG||FR&&kJ(new FR)!=yG)&&(kJ=function(Ql){var cl=xV(Ql),$l=cl==n0?Ql.constructor:void 0,DR=$l?rU($l):"";if(DR)switch(DR){case f0:return c0;case HJ:return s0;case m0:return X0;case oG:return qG;case QC:return yG}return cl});const gg=kJ;var HG=Object.prototype,lG=HG.hasOwnProperty;function zJ(Ql){var cl=Ql.length,$l=new Ql.constructor(cl);return cl&&typeof Ql[0]=="string"&&lG.call(Ql,"index")&&($l.index=Ql.index,$l.input=Ql.input),$l}var PC=FV.Uint8Array;const vN=PC;function xJ(Ql){var cl=new Ql.constructor(Ql.byteLength);return new vN(cl).set(new vN(Ql)),cl}function eJ(Ql,cl){var $l=Ql.buffer;return new Ql.constructor($l,Ql.byteOffset,Ql.byteLength)}var SJ=/\w*$/;function AJ(Ql){var cl=new Ql.constructor(Ql.source,SJ.exec(Ql));return cl.lastIndex=Ql.lastIndex,cl}var B0=eV?eV.prototype:void 0,Lg=B0?B0.valueOf:void 0;function Yg(Ql){return Lg?Object(Lg.call(Ql)):{}}function gJ(Ql,cl){var $l=Ql.buffer;return new Ql.constructor($l,Ql.byteOffset,Ql.length)}var JC="[object Boolean]",gF="[object Date]",Xd="[object Map]",PF="[object Number]",hF="[object RegExp]",VF="[object Set]",DN="[object String]",Qg="[object Symbol]",OG="[object ArrayBuffer]",vF="[object DataView]",OJ="[object Float32Array]",FN="[object Float64Array]",KJ="[object Int8Array]",fN="[object Int16Array]",L0="[object Int32Array]",$g="[object Uint8Array]",AG="[object Uint8ClampedArray]",cN="[object Uint16Array]",KG="[object Uint32Array]";function _J(Ql,cl,$l){var DR=Ql.constructor;switch(cl){case OG:return xJ(Ql);case JC:case gF:return new DR(+Ql);case vF:return eJ(Ql);case OJ:case FN:case KJ:case fN:case L0:case $g:case AG:case cN:case KG:return gJ(Ql);case Xd:return new DR;case PF:case DN:return new DR(Ql);case hF:return AJ(Ql);case VF:return new DR;case Qg:return Yg(Ql)}}function yg(Ql){return typeof Ql.constructor=="function"&&!bU(Ql)?OU(sd(Ql)):{}}var o0="[object Map]";function fF(Ql){return uV(Ql)&&gg(Ql)==o0}var Fg=ON&&ON.isMap,ed=Fg?bd(Fg):fF;const IN=ed;var _I="[object Set]";function Yd(Ql){return uV(Ql)&&gg(Ql)==_I}var Gd=ON&&ON.isSet,ZJ=Gd?bd(Gd):Yd;const HN=ZJ;var tN="[object Arguments]",ad="[object Array]",nN="[object Boolean]",oN="[object Date]",I0="[object Error]",oC="[object Function]",HC="[object GeneratorFunction]",MJ="[object Map]",OW="[object Number]",zN="[object Object]",Dd="[object RegExp]",qJ="[object Set]",Og="[object String]",$J="[object Symbol]",P0="[object WeakMap]",_F="[object ArrayBuffer]",wF="[object DataView]",Sd="[object Float32Array]",cg="[object Float64Array]",k0="[object Int8Array]",p1="[object Int16Array]",LN="[object Int32Array]",SN="[object Uint8Array]",kg="[object Uint8ClampedArray]",JN="[object Uint16Array]",dF="[object Uint32Array]",MI={};MI[tN]=MI[ad]=MI[_F]=MI[wF]=MI[nN]=MI[oN]=MI[Sd]=MI[cg]=MI[k0]=MI[p1]=MI[LN]=MI[MJ]=MI[OW]=MI[zN]=MI[Dd]=MI[qJ]=MI[Og]=MI[$J]=MI[SN]=MI[kg]=MI[JN]=MI[dF]=!0,MI[I0]=MI[oC]=MI[P0]=!1;function GN(Ql,cl,$l,DR,kU,FZ){var rZ;if(rZ!==void 0)return rZ;if(!Bl(Ql))return Ql;var IW=Nl(Ql);if(IW)return rZ=zJ(Ql),OZ(Ql,rZ);var AW=gg(Ql),ZI=AW==oC||AW==HC;if(xZ(Ql))return VC(Ql);if(AW==zN||AW==tN||ZI&&!kU)return rZ=ZI?{}:yg(Ql),h0(Ql,EN(rZ,Ql));if(!MI[AW])return kU?Ql:{};rZ=_J(Ql,AW),FZ||(FZ=new eF);var Td=FZ.get(Ql);if(Td)return Td;FZ.set(Ql,rZ),HN(Ql)?Ql.forEach(function(ZN){rZ.add(GN(ZN,cl,$l,ZN,Ql,FZ))}):IN(Ql)&&Ql.forEach(function(ZN,WN){rZ.set(WN,GN(ZN,cl,$l,WN,Ql,FZ))});var Ld=Jd,NF=IW?void 0:Ld(Ql);return cW(NF||Ql,function(ZN,WN){NF&&(WN=ZN,ZN=Ql[WN]),uU(rZ,WN,GN(ZN,cl,$l,WN,Ql,FZ))}),rZ}var GC=4;function Bd(Ql){return GN(Ql,GC)}function PN(Ql){for(var cl=-1,$l=Ql==null?0:Ql.length,DR=0,kU=[];++cl<$l;){var FZ=Ql[cl];FZ&&(kU[DR++]=FZ)}return kU}var bg="__lodash_hash_undefined__";function zG(Ql){return this.__data__.set(Ql,bg),this}function WJ(Ql){return this.__data__.has(Ql)}function dC(Ql){var cl=-1,$l=Ql==null?0:Ql.length;for(this.__data__=new jd;++cl<$l;)this.add(Ql[cl])}dC.prototype.add=dC.prototype.push=zG,dC.prototype.has=WJ;function UI(Ql,cl){for(var $l=-1,DR=Ql==null?0:Ql.length;++$l<DR;)if(cl(Ql[$l],$l,Ql))return!0;return!1}function Wd(Ql,cl){return Ql.has(cl)}var jI=1,IJ=2;function pg(Ql,cl,$l,DR,kU,FZ){var rZ=$l&jI,IW=Ql.length,AW=cl.length;if(IW!=AW&&!(rZ&&AW>IW))return!1;var ZI=FZ.get(Ql),Td=FZ.get(cl);if(ZI&&Td)return ZI==cl&&Td==Ql;var Ld=-1,NF=!0,ZN=$l&IJ?new dC:void 0;for(FZ.set(Ql,cl),FZ.set(cl,Ql);++Ld<IW;){var WN=Ql[Ld],$N=cl[Ld];if(DR)var G0=rZ?DR($N,WN,Ld,cl,Ql,FZ):DR(WN,$N,Ld,Ql,cl,FZ);if(G0!==void 0){if(G0)continue;NF=!1;break}if(ZN){if(!UI(cl,function(bN,pN){if(!Wd(ZN,pN)&&(WN===bN||kU(WN,bN,$l,DR,FZ)))return ZN.push(pN)})){NF=!1;break}}else if(!(WN===$N||kU(WN,$N,$l,DR,FZ))){NF=!1;break}}return FZ.delete(Ql),FZ.delete(cl),NF}function Kg(Ql){var cl=-1,$l=Array(Ql.size);return Ql.forEach(function(DR,kU){$l[++cl]=[kU,DR]}),$l}function $F(Ql){var cl=-1,$l=Array(Ql.size);return Ql.forEach(function(DR){$l[++cl]=DR}),$l}var nJ=1,eC=2,Ug="[object Boolean]",sF="[object Date]",wg="[object Error]",vJ="[object Map]",CF="[object Number]",_d="[object RegExp]",zC="[object Set]",$d="[object String]",NN="[object Symbol]",oF="[object ArrayBuffer]",tF="[object DataView]",VN=eV?eV.prototype:void 0,d0=VN?VN.valueOf:void 0;function yN(Ql,cl,$l,DR,kU,FZ,rZ){switch($l){case tF:if(Ql.byteLength!=cl.byteLength||Ql.byteOffset!=cl.byteOffset)return!1;Ql=Ql.buffer,cl=cl.buffer;case oF:return!(Ql.byteLength!=cl.byteLength||!FZ(new vN(Ql),new vN(cl)));case Ug:case sF:case CF:return ql(+Ql,+cl);case wg:return Ql.name==cl.name&&Ql.message==cl.message;case _d:case $d:return Ql==cl+"";case vJ:var IW=Kg;case zC:var AW=DR&nJ;if(IW||(IW=$F),Ql.size!=cl.size&&!AW)return!1;var ZI=rZ.get(Ql);if(ZI)return ZI==cl;DR|=eC,rZ.set(Ql,cl);var Td=pg(IW(Ql),IW(cl),DR,kU,FZ,rZ);return rZ.delete(Ql),Td;case NN:if(d0)return d0.call(Ql)==d0.call(cl)}return!1}var Sg=1,ng=Object.prototype,S0=ng.hasOwnProperty;function mN(Ql,cl,$l,DR,kU,FZ){var rZ=$l&Sg,IW=Jd(Ql),AW=IW.length,ZI=Jd(cl),Td=ZI.length;if(AW!=Td&&!rZ)return!1;for(var Ld=AW;Ld--;){var NF=IW[Ld];if(!(rZ?NF in cl:S0.call(cl,NF)))return!1}var ZN=FZ.get(Ql),WN=FZ.get(cl);if(ZN&&WN)return ZN==cl&&WN==Ql;var $N=!0;FZ.set(Ql,cl),FZ.set(cl,Ql);for(var G0=rZ;++Ld<AW;){NF=IW[Ld];var bN=Ql[NF],pN=cl[NF];if(DR)var zF=rZ?DR(pN,bN,NF,cl,Ql,FZ):DR(bN,pN,NF,Ql,cl,FZ);if(!(zF===void 0?bN===pN||kU(bN,pN,$l,DR,FZ):zF)){$N=!1;break}G0||(G0=NF=="constructor")}if($N&&!G0){var aN=Ql.constructor,K0=cl.constructor;aN!=K0&&"constructor"in Ql&&"constructor"in cl&&!(typeof aN=="function"&&aN instanceof aN&&typeof K0=="function"&&K0 instanceof K0)&&($N=!1)}return FZ.delete(Ql),FZ.delete(cl),$N}var V0=1,JJ="[object Arguments]",iC="[object Array]",fC="[object Object]",YF=Object.prototype,pF=YF.hasOwnProperty;function Ng(Ql,cl,$l,DR,kU,FZ){var rZ=Nl(Ql),IW=Nl(cl),AW=rZ?iC:gg(Ql),ZI=IW?iC:gg(cl);AW=AW==JJ?fC:AW,ZI=ZI==JJ?fC:ZI;var Td=AW==fC,Ld=ZI==fC,NF=AW==ZI;if(NF&&xZ(Ql)){if(!xZ(cl))return!1;rZ=!0,Td=!1}if(NF&&!Td)return FZ||(FZ=new eF),rZ||zU(Ql)?pg(Ql,cl,$l,DR,kU,FZ):yN(Ql,cl,AW,$l,DR,kU,FZ);if(!($l&V0)){var ZN=Td&&pF.call(Ql,"__wrapped__"),WN=Ld&&pF.call(cl,"__wrapped__");if(ZN||WN){var $N=ZN?Ql.value():Ql,G0=WN?cl.value():cl;return FZ||(FZ=new eF),kU($N,G0,$l,DR,FZ)}}return NF?(FZ||(FZ=new eF),mN(Ql,cl,$l,DR,kU,FZ)):!1}function sg(Ql,cl,$l,DR,kU){return Ql===cl?!0:Ql==null||cl==null||!uV(Ql)&&!uV(cl)?Ql!==Ql&&cl!==cl:Ng(Ql,cl,$l,DR,sg,kU)}var VJ=1,FF=2;function QF(Ql,cl,$l,DR){var kU=$l.length,FZ=kU;if(Ql==null)return!FZ;for(Ql=Object(Ql);kU--;){var rZ=$l[kU];if(rZ[2]?rZ[1]!==Ql[rZ[0]]:!(rZ[0]in Ql))return!1}for(;++kU<FZ;){rZ=$l[kU];var IW=rZ[0],AW=Ql[IW],ZI=rZ[1];if(rZ[2]){if(AW===void 0&&!(IW in Ql))return!1}else{var Td=new eF,Ld;if(!(Ld===void 0?sg(ZI,AW,VJ|FF,DR,Td):Ld))return!1}}return!0}function Ag(Ql){return Ql===Ql&&!Bl(Ql)}function SI(Ql){for(var cl=ud(Ql),$l=cl.length;$l--;){var DR=cl[$l],kU=Ql[DR];cl[$l]=[DR,kU,Ag(kU)]}return cl}function GJ(Ql,cl){return function($l){return $l==null?!1:$l[Ql]===cl&&(cl!==void 0||Ql in Object($l))}}function Zl(Ql){var cl=SI(Ql);return cl.length==1&&cl[0][2]?GJ(cl[0][0],cl[0][1]):function($l){return $l===Ql||QF($l,Ql,cl)}}function il(Ql,cl){return Ql!=null&&cl in Object(Ql)}function Sl(Ql,cl,$l){cl=yd(cl,Ql);for(var DR=-1,kU=cl.length,FZ=!1;++DR<kU;){var rZ=AC(cl[DR]);if(!(FZ=Ql!=null&&$l(Ql,rZ)))break;Ql=Ql[rZ]}return FZ||++DR!=kU?FZ:(kU=Ql==null?0:Ql.length,!!kU&&dW(kU)&&KU(rZ,kU)&&(Nl(Ql)||gW(Ql)))}function Kl(Ql,cl){return Ql!=null&&Sl(Ql,cl,il)}var NR=1,QR=2;function tU(Ql,cl){return JZ(Ql)&&Ag(cl)?GJ(AC(Ql),cl):function($l){var DR=vC($l,Ql);return DR===void 0&&DR===cl?Kl($l,Ql):sg(cl,DR,NR|QR)}}function yU(Ql){return function(cl){return cl==null?void 0:cl[Ql]}}function QU(Ql){return function(cl){return KN(cl,Ql)}}function qZ(Ql){return JZ(Ql)?yU(AC(Ql)):QU(Ql)}function PZ(Ql){return typeof Ql=="function"?Ql:Ql==null?hR:typeof Ql=="object"?Nl(Ql)?tU(Ql[0],Ql[1]):Zl(Ql):qZ(Ql)}function lI(Ql,cl,$l,DR){for(var kU=-1,FZ=Ql==null?0:Ql.length;++kU<FZ;){var rZ=Ql[kU];cl(DR,rZ,$l(rZ),Ql)}return DR}function WW(Ql){return function(cl,$l,DR){for(var kU=-1,FZ=Object(cl),rZ=DR(cl),IW=rZ.length;IW--;){var AW=rZ[++kU];if($l(FZ[AW],AW,FZ)===!1)break}return cl}}var WI=WW();const Kd=WI;function BC(Ql,cl){return Ql&&Kd(Ql,cl,ud)}function od(Ql,cl){return function($l,DR){if($l==null)return $l;if(!tW($l))return Ql($l,DR);for(var kU=$l.length,FZ=-1,rZ=Object($l);++FZ<kU&&DR(rZ[FZ],FZ,rZ)!==!1;);return $l}}var Hd=od(BC);const gC=Hd;function hC(Ql,cl,$l,DR){return gC(Ql,function(kU,FZ,rZ){cl(DR,kU,$l(kU),rZ)}),DR}function dJ(Ql,cl){return function($l,DR){var kU=Nl($l)?lI:hC,FZ={};return kU($l,Ql,PZ(DR),FZ)}}var lF=Object.prototype,fJ=lF.hasOwnProperty,YC=QZ(function(Ql,cl){Ql=Object(Ql);var $l=-1,DR=cl.length,kU=DR>2?cl[2]:void 0;for(kU&&YZ(cl[0],cl[1],kU)&&(DR=1);++$l<DR;)for(var FZ=cl[$l],rZ=VG(FZ),IW=-1,AW=rZ.length;++IW<AW;){var ZI=rZ[IW],Td=Ql[ZI];(Td===void 0||ql(Td,lF[ZI])&&!fJ.call(Ql,ZI))&&(Ql[ZI]=FZ[ZI])}return Ql});const OC=YC;function Ed(Ql){return uV(Ql)&&tW(Ql)}var AN=200;function KC(Ql,cl,$l,DR){var kU=-1,FZ=JU,rZ=!0,IW=Ql.length,AW=[],ZI=cl.length;if(!IW)return AW;cl.length>=AN&&(FZ=Wd,rZ=!1,cl=new dC(cl));V:for(;++kU<IW;){var Td=Ql[kU],Ld=Td;if(Td=Td!==0?Td:0,rZ&&Ld===Ld){for(var NF=ZI;NF--;)if(cl[NF]===Ld)continue V;AW.push(Td)}else FZ(cl,Ld,DR)||AW.push(Td)}return AW}var iN=QZ(function(Ql,cl){return Ed(Ql)?KC(Ql,MC(cl,1,Ed,!0)):[]});const eg=iN;function tg(Ql){var cl=Ql==null?0:Ql.length;return cl?Ql[cl-1]:void 0}function xN(Ql,cl,$l){var DR=Ql==null?0:Ql.length;return DR?(cl=cl===void 0?1:RR(cl),wC(Ql,cl<0?0:cl,DR)):[]}function CJ(Ql,cl,$l){var DR=Ql==null?0:Ql.length;return DR?(cl=cl===void 0?1:RR(cl),cl=DR-cl,wC(Ql,0,cl<0?0:cl)):[]}function MN(Ql){return typeof Ql=="function"?Ql:hR}function mC(Ql,cl){var $l=Nl(Ql)?cW:gC;return $l(Ql,MN(cl))}function l0(Ql,cl){for(var $l=-1,DR=Ql==null?0:Ql.length;++$l<DR;)if(!cl(Ql[$l],$l,Ql))return!1;return!0}function EF(Ql,cl){var $l=!0;return gC(Ql,function(DR,kU,FZ){return $l=!!cl(DR,kU,FZ),$l}),$l}function VR(Ql,cl,$l){var DR=Nl(Ql)?l0:EF;return DR(Ql,PZ(cl))}function UU(Ql,cl){var $l=[];return gC(Ql,function(DR,kU,FZ){cl(DR,kU,FZ)&&$l.push(DR)}),$l}function OR(Ql,cl){var $l=Nl(Ql)?tZ:UU;return $l(Ql,PZ(cl))}function iU(Ql){return function(cl,$l,DR){var kU=Object(cl);if(!tW(cl)){var FZ=PZ($l);cl=ud(cl),$l=function(IW){return FZ(kU[IW],IW,kU)}}var rZ=Ql(cl,$l,DR);return rZ>-1?kU[FZ?cl[rZ]:rZ]:void 0}}var oR=Math.max;function Vl(Ql,cl,$l){var DR=Ql==null?0:Ql.length;if(!DR)return-1;var kU=$l==null?0:RR($l);return kU<0&&(kU=oR(DR+kU,0)),oW(Ql,PZ(cl),kU)}var Wl=iU(Vl);const pl=Wl;function Dl(Ql){return Ql&&Ql.length?Ql[0]:void 0}function aR(Ql,cl){var $l=-1,DR=tW(Ql)?Array(Ql.length):[];return gC(Ql,function(kU,FZ,rZ){DR[++$l]=cl(kU,FZ,rZ)}),DR}function kR(Ql,cl){var $l=Nl(Ql)?yV:aR;return $l(Ql,PZ(cl))}function XU(Ql,cl){return MC(kR(Ql,cl))}var EZ=Object.prototype,pV=EZ.hasOwnProperty,oV=dJ(function(Ql,cl,$l){pV.call(Ql,$l)?Ql[$l].push(cl):_l(Ql,$l,[cl])});const QV=oV;var zV=Object.prototype,$V=zV.hasOwnProperty;function Gl(Ql,cl){return Ql!=null&&$V.call(Ql,cl)}function bl(Ql,cl){return Ql!=null&&Sl(Ql,cl,Gl)}var JR="[object String]";function $R(Ql){return typeof Ql=="string"||!Nl(Ql)&&uV(Ql)&&xV(Ql)==JR}function EU(Ql,cl){return yV(cl,function($l){return Ql[$l]})}function SU(Ql){return Ql==null?[]:EU(Ql,ud(Ql))}var kZ=Math.max;function NZ(Ql,cl,$l,DR){Ql=tW(Ql)?Ql:SU(Ql),$l=$l&&!DR?RR($l):0;var kU=Ql.length;return $l<0&&($l=kZ(kU+$l,0)),$R(Ql)?$l<=kU&&Ql.indexOf(cl,$l)>-1:!!kU&&wR(Ql,cl,$l)>-1}function jW(Ql,cl,$l){var DR=Ql==null?0:Ql.length;if(!DR)return-1;var kU=0;return wR(Ql,cl,kU)}var zW="[object Map]",wI="[object Set]",bI=Object.prototype,aZ=bI.hasOwnProperty;function qU(Ql){if(Ql==null)return!0;if(tW(Ql)&&(Nl(Ql)||typeof Ql=="string"||typeof Ql.splice=="function"||xZ(Ql)||zU(Ql)||gW(Ql)))return!Ql.length;var cl=gg(Ql);if(cl==zW||cl==wI)return!Ql.size;if(bU(Ql))return!sC(Ql).length;for(var $l in Ql)if(aZ.call(Ql,$l))return!1;return!0}var fU="[object RegExp]";function bZ(Ql){return uV(Ql)&&xV(Ql)==fU}var NW=ON&&ON.isRegExp,PW=NW?bd(NW):bZ;const hI=PW;function OI(Ql){return Ql===void 0}var CC="Expected a function";function gd(Ql){if(typeof Ql!="function")throw new TypeError(CC);return function(){var cl=arguments;switch(cl.length){case 0:return!Ql.call(this);case 1:return!Ql.call(this,cl[0]);case 2:return!Ql.call(this,cl[0],cl[1]);case 3:return!Ql.call(this,cl[0],cl[1],cl[2])}return!Ql.apply(this,cl)}}function nF(Ql,cl,$l,DR){if(!Bl(Ql))return Ql;cl=yd(cl,Ql);for(var kU=-1,FZ=cl.length,rZ=FZ-1,IW=Ql;IW!=null&&++kU<FZ;){var AW=AC(cl[kU]),ZI=$l;if(AW==="__proto__"||AW==="constructor"||AW==="prototype")return Ql;if(kU!=rZ){var Td=IW[AW];ZI=void 0,ZI===void 0&&(ZI=Bl(Td)?Td:KU(cl[kU+1])?[]:{})}uU(IW,AW,ZI),IW=IW[AW]}return Ql}function lN(Ql,cl,$l){for(var DR=-1,kU=cl.length,FZ={};++DR<kU;){var rZ=cl[DR],IW=KN(Ql,rZ);$l(IW,rZ)&&nF(FZ,yd(rZ,Ql),IW)}return FZ}function _N(Ql,cl){if(Ql==null)return{};var $l=yV(NC(Ql),function(DR){return[DR]});return cl=PZ(cl),lN(Ql,$l,function(DR,kU){return cl(DR,kU[0])})}function rJ(Ql,cl,$l,DR,kU){return kU(Ql,function(FZ,rZ,IW){$l=DR?(DR=!1,FZ):cl($l,FZ,rZ,IW)}),$l}function H0(Ql,cl,$l){var DR=Nl(Ql)?AF:rJ,kU=arguments.length<3;return DR(Ql,PZ(cl),$l,kU,gC)}function RG(Ql,cl){var $l=Nl(Ql)?tZ:UU;return $l(Ql,gd(PZ(cl)))}function t0(Ql,cl){var $l;return gC(Ql,function(DR,kU,FZ){return $l=cl(DR,kU,FZ),!$l}),!!$l}function _0(Ql,cl,$l){var DR=Nl(Ql)?UI:t0;return DR(Ql,PZ(cl))}var IY=1/0,s1=yJ&&1/$F(new yJ([,-0]))[1]==IY?function(Ql){return new yJ(Ql)}:jZ;const $h=s1;var JG=200;function GG(Ql,cl,$l){var DR=-1,kU=JU,FZ=Ql.length,rZ=!0,IW=[],AW=IW;if(FZ>=JG){var ZI=$h(Ql);if(ZI)return $F(ZI);rZ=!1,kU=Wd,AW=new dC}else AW=IW;V:for(;++DR<FZ;){var Td=Ql[DR],Ld=Td;if(Td=Td!==0?Td:0,rZ&&Ld===Ld){for(var NF=AW.length;NF--;)if(AW[NF]===Ld)continue V;IW.push(Td)}else kU(AW,Ld,$l)||(AW!==IW&&AW.push(Ld),IW.push(Td))}return IW}function LC(Ql){return Ql&&Ql.length?GG(Ql):[]}function O1(Ql){console&&console.error&&console.error(`Error: ${Ql}`)}function Fc(Ql){console&&console.warn&&console.warn(`Warning: ${Ql}`)}function oT(Ql){const cl=new Date().getTime(),$l=Ql();return{time:new Date().getTime()-cl,value:$l}}function wc(Ql){function cl(){}cl.prototype=Ql;const $l=new cl;function DR(){return typeof $l.bar}return DR(),DR(),Ql}function hc(Ql){return qY(Ql)?Ql.LABEL:Ql.name}function qY(Ql){return $R(Ql.LABEL)&&Ql.LABEL!==""}class tY{get definition(){return this._definition}set definition(cl){this._definition=cl}constructor(cl){this._definition=cl}accept(cl){cl.visit(this),mC(this.definition,$l=>{$l.accept(cl)})}}class dY extends tY{constructor(cl){super([]),this.idx=1,FC(this,_N(cl,$l=>$l!==void 0))}set definition(cl){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(cl){cl.visit(this)}}class W1 extends tY{constructor(cl){super(cl.definition),this.orgText="",FC(this,_N(cl,$l=>$l!==void 0))}}class h1 extends tY{constructor(cl){super(cl.definition),this.ignoreAmbiguities=!1,FC(this,_N(cl,$l=>$l!==void 0))}}class $G extends tY{constructor(cl){super(cl.definition),this.idx=1,FC(this,_N(cl,$l=>$l!==void 0))}}class K1 extends tY{constructor(cl){super(cl.definition),this.idx=1,FC(this,_N(cl,$l=>$l!==void 0))}}class rg extends tY{constructor(cl){super(cl.definition),this.idx=1,FC(this,_N(cl,$l=>$l!==void 0))}}class mF extends tY{constructor(cl){super(cl.definition),this.idx=1,FC(this,_N(cl,$l=>$l!==void 0))}}class QJ extends tY{constructor(cl){super(cl.definition),this.idx=1,FC(this,_N(cl,$l=>$l!==void 0))}}class bJ extends tY{get definition(){return this._definition}set definition(cl){this._definition=cl}constructor(cl){super(cl.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,FC(this,_N(cl,$l=>$l!==void 0))}}class jJ{constructor(cl){this.idx=1,FC(this,_N(cl,$l=>$l!==void 0))}accept(cl){cl.visit(this)}}function Sa(Ql){return kR(Ql,HT)}function HT(Ql){function cl($l){return kR($l,HT)}if(Ql instanceof dY){const $l={type:"NonTerminal",name:Ql.nonTerminalName,idx:Ql.idx};return $R(Ql.label)&&($l.label=Ql.label),$l}else{if(Ql instanceof h1)return{type:"Alternative",definition:cl(Ql.definition)};if(Ql instanceof $G)return{type:"Option",idx:Ql.idx,definition:cl(Ql.definition)};if(Ql instanceof K1)return{type:"RepetitionMandatory",idx:Ql.idx,definition:cl(Ql.definition)};if(Ql instanceof rg)return{type:"RepetitionMandatoryWithSeparator",idx:Ql.idx,separator:HT(new jJ({terminalType:Ql.separator})),definition:cl(Ql.definition)};if(Ql instanceof QJ)return{type:"RepetitionWithSeparator",idx:Ql.idx,separator:HT(new jJ({terminalType:Ql.separator})),definition:cl(Ql.definition)};if(Ql instanceof mF)return{type:"Repetition",idx:Ql.idx,definition:cl(Ql.definition)};if(Ql instanceof bJ)return{type:"Alternation",idx:Ql.idx,definition:cl(Ql.definition)};if(Ql instanceof jJ){const $l={type:"Terminal",name:Ql.terminalType.name,label:hc(Ql.terminalType),idx:Ql.idx};$R(Ql.label)&&($l.terminalLabel=Ql.label);const DR=Ql.terminalType.PATTERN;return Ql.terminalType.PATTERN&&($l.pattern=hI(DR)?DR.source:DR),$l}else{if(Ql instanceof W1)return{type:"Rule",name:Ql.name,orgText:Ql.orgText,definition:cl(Ql.definition)};throw Error("non exhaustive match")}}}class HY{visit(cl){const $l=cl;switch($l.constructor){case dY:return this.visitNonTerminal($l);case h1:return this.visitAlternative($l);case $G:return this.visitOption($l);case K1:return this.visitRepetitionMandatory($l);case rg:return this.visitRepetitionMandatoryWithSeparator($l);case QJ:return this.visitRepetitionWithSeparator($l);case mF:return this.visitRepetition($l);case bJ:return this.visitAlternation($l);case jJ:return this.visitTerminal($l);case W1:return this.visitRule($l);default:throw Error("non exhaustive match")}}visitNonTerminal(cl){}visitAlternative(cl){}visitOption(cl){}visitRepetition(cl){}visitRepetitionMandatory(cl){}visitRepetitionMandatoryWithSeparator(cl){}visitRepetitionWithSeparator(cl){}visitAlternation(cl){}visitTerminal(cl){}visitRule(cl){}}function ZE(Ql){return Ql instanceof h1||Ql instanceof $G||Ql instanceof mF||Ql instanceof K1||Ql instanceof rg||Ql instanceof QJ||Ql instanceof jJ||Ql instanceof W1}function Vm(Ql,cl=[]){return Ql instanceof $G||Ql instanceof mF||Ql instanceof QJ?!0:Ql instanceof bJ?_0(Ql.definition,DR=>Vm(DR,cl)):Ql instanceof dY&&NZ(cl,Ql)?!1:Ql instanceof tY?(Ql instanceof dY&&cl.push(Ql),VR(Ql.definition,DR=>Vm(DR,cl))):!1}function zT(Ql){return Ql instanceof bJ}function $Y(Ql){if(Ql instanceof dY)return"SUBRULE";if(Ql instanceof $G)return"OPTION";if(Ql instanceof bJ)return"OR";if(Ql instanceof K1)return"AT_LEAST_ONE";if(Ql instanceof rg)return"AT_LEAST_ONE_SEP";if(Ql instanceof QJ)return"MANY_SEP";if(Ql instanceof mF)return"MANY";if(Ql instanceof jJ)return"CONSUME";throw Error("non exhaustive match")}class _m{walk(cl,$l=[]){mC(cl.definition,(DR,kU)=>{const FZ=xN(cl.definition,kU+1);if(DR instanceof dY)this.walkProdRef(DR,FZ,$l);else if(DR instanceof jJ)this.walkTerminal(DR,FZ,$l);else if(DR instanceof h1)this.walkFlat(DR,FZ,$l);else if(DR instanceof $G)this.walkOption(DR,FZ,$l);else if(DR instanceof K1)this.walkAtLeastOne(DR,FZ,$l);else if(DR instanceof rg)this.walkAtLeastOneSep(DR,FZ,$l);else if(DR instanceof QJ)this.walkManySep(DR,FZ,$l);else if(DR instanceof mF)this.walkMany(DR,FZ,$l);else if(DR instanceof bJ)this.walkOr(DR,FZ,$l);else throw Error("non exhaustive match")})}walkTerminal(cl,$l,DR){}walkProdRef(cl,$l,DR){}walkFlat(cl,$l,DR){const kU=$l.concat(DR);this.walk(cl,kU)}walkOption(cl,$l,DR){const kU=$l.concat(DR);this.walk(cl,kU)}walkAtLeastOne(cl,$l,DR){const kU=[new $G({definition:cl.definition})].concat($l,DR);this.walk(cl,kU)}walkAtLeastOneSep(cl,$l,DR){const kU=Bk(cl,$l,DR);this.walk(cl,kU)}walkMany(cl,$l,DR){const kU=[new $G({definition:cl.definition})].concat($l,DR);this.walk(cl,kU)}walkManySep(cl,$l,DR){const kU=Bk(cl,$l,DR);this.walk(cl,kU)}walkOr(cl,$l,DR){const kU=$l.concat(DR);mC(cl.definition,FZ=>{const rZ=new h1({definition:[FZ]});this.walk(rZ,kU)})}}function Bk(Ql,cl,$l){return[new $G({definition:[new jJ({terminalType:Ql.separator})].concat(Ql.definition)})].concat(cl,$l)}function iY(Ql){if(Ql instanceof dY)return iY(Ql.referencedRule);if(Ql instanceof jJ)return uF(Ql);if(ZE(Ql))return i0(Ql);if(zT(Ql))return aG(Ql);throw Error("non exhaustive match")}function i0(Ql){let cl=[];const $l=Ql.definition;let DR=0,kU=$l.length>DR,FZ,rZ=!0;for(;kU&&rZ;)FZ=$l[DR],rZ=Vm(FZ),cl=cl.concat(iY(FZ)),DR=DR+1,kU=$l.length>DR;return LC(cl)}function aG(Ql){const cl=kR(Ql.definition,$l=>iY($l));return LC(Od(cl))}function uF(Ql){return[Ql.terminalType]}const z0="_~IN~_";class y0 extends _m{constructor(cl){super(),this.topProd=cl,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(cl,$l,DR){}walkProdRef(cl,$l,DR){const kU=CY(cl.referencedRule,cl.idx)+this.topProd.name,FZ=$l.concat(DR),rZ=new h1({definition:FZ}),IW=iY(rZ);this.follows[kU]=IW}}function r1(Ql){const cl={};return mC(Ql,$l=>{const DR=new y0($l).startWalking();FC(cl,DR)}),cl}function CY(Ql,cl){return Ql.name+cl+z0}function MF(Ql){return Ql.charCodeAt(0)}function TY(Ql,cl){Array.isArray(Ql)?Ql.forEach(function($l){cl.push($l)}):cl.push(Ql)}function Aa(Ql,cl){if(Ql[cl]===!0)throw"duplicate flag "+cl;Ql[cl],Ql[cl]=!0}function nT(Ql){if(Ql===void 0)throw Error("Internal Error - Should never get here!");return!0}function WE(){throw Error("Internal Error - Should never get here!")}function IE(Ql){return Ql.type==="Character"}const Nc=[];for(let Ql=MF("0");Ql<=MF("9");Ql++)Nc.push(Ql);const Ma=[MF("_")].concat(Nc);for(let Ql=MF("a");Ql<=MF("z");Ql++)Ma.push(Ql);for(let Ql=MF("A");Ql<=MF("Z");Ql++)Ma.push(Ql);const dE=[MF(" "),MF("\f"),MF(`
|
|
10573
10573
|
`),MF("\r"),MF(" "),MF("\v"),MF(" "),MF(" "),MF(" "),MF(" "),MF(" "),MF(" "),MF(" "),MF(" "),MF(" "),MF(" "),MF(" "),MF(" "),MF(" "),MF(" "),MF("\u2028"),MF("\u2029"),MF(" "),MF(" "),MF(" "),MF("\uFEFF")],Yc=/[0-9a-fA-F]/,zY=/[0-9]/,pE=/[1-9]/;class EY{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(cl){this.idx=cl.idx,this.input=cl.input,this.groupIdx=cl.groupIdx}pattern(cl){this.idx=0,this.input=cl,this.groupIdx=0,this.consumeChar("/");const $l=this.disjunction();this.consumeChar("/");const DR={type:"Flags",loc:{begin:this.idx,end:cl.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Aa(DR,"global");break;case"i":Aa(DR,"ignoreCase");break;case"m":Aa(DR,"multiLine");break;case"u":Aa(DR,"unicode");break;case"y":Aa(DR,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:DR,value:$l,loc:this.loc(0)}}disjunction(){const cl=[],$l=this.idx;for(cl.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),cl.push(this.alternative());return{type:"Disjunction",value:cl,loc:this.loc($l)}}alternative(){const cl=[],$l=this.idx;for(;this.isTerm();)cl.push(this.term());return{type:"Alternative",value:cl,loc:this.loc($l)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const cl=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(cl)};case"$":return{type:"EndAnchor",loc:this.loc(cl)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(cl)};case"B":return{type:"NonWordBoundary",loc:this.loc(cl)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let $l;switch(this.popChar()){case"=":$l="Lookahead";break;case"!":$l="NegativeLookahead";break}nT($l);const DR=this.disjunction();return this.consumeChar(")"),{type:$l,value:DR,loc:this.loc(cl)}}return WE()}quantifier(cl=!1){let $l;const DR=this.idx;switch(this.popChar()){case"*":$l={atLeast:0,atMost:1/0};break;case"+":$l={atLeast:1,atMost:1/0};break;case"?":$l={atLeast:0,atMost:1};break;case"{":const kU=this.integerIncludingZero();switch(this.popChar()){case"}":$l={atLeast:kU,atMost:kU};break;case",":let FZ;this.isDigit()?(FZ=this.integerIncludingZero(),$l={atLeast:kU,atMost:FZ}):$l={atLeast:kU,atMost:1/0},this.consumeChar("}");break}if(cl===!0&&$l===void 0)return;nT($l);break}if(!(cl===!0&&$l===void 0)&&nT($l))return this.peekChar(0)==="?"?(this.consumeChar("?"),$l.greedy=!1):$l.greedy=!0,$l.type="Quantifier",$l.loc=this.loc(DR),$l}atom(){let cl;const $l=this.idx;switch(this.peekChar()){case".":cl=this.dotAll();break;case"\\":cl=this.atomEscape();break;case"[":cl=this.characterClass();break;case"(":cl=this.group();break}if(cl===void 0&&this.isPatternCharacter()&&(cl=this.patternCharacter()),nT(cl))return cl.loc=this.loc($l),this.isQuantifier()&&(cl.quantifier=this.quantifier()),cl}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[MF(`
|
|
10574
10574
|
`),MF("\r"),MF("\u2028"),MF("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let cl,$l=!1;switch(this.popChar()){case"d":cl=Nc;break;case"D":cl=Nc,$l=!0;break;case"s":cl=dE;break;case"S":cl=dE,$l=!0;break;case"w":cl=Ma;break;case"W":cl=Ma,$l=!0;break}if(nT(cl))return{type:"Set",value:cl,complement:$l}}controlEscapeAtom(){let cl;switch(this.popChar()){case"f":cl=MF("\f");break;case"n":cl=MF(`
|
|
10575
10575
|
`);break;case"r":cl=MF("\r");break;case"t":cl=MF(" ");break;case"v":cl=MF("\v");break}if(nT(cl))return{type:"Character",value:cl}}controlLetterEscapeAtom(){this.consumeChar("c");const cl=this.popChar();if(/[a-zA-Z]/.test(cl)===!1)throw Error("Invalid ");return{type:"Character",value:cl.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:MF("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const cl=this.popChar();return{type:"Character",value:MF(cl)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
@@ -22407,7 +22407,7 @@ void main() {
|
|
|
22407
22407
|
[zustand devtools middleware] Unsupported __setState action format.
|
|
22408
22408
|
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
|
22409
22409
|
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
|
22410
|
-
`);const YV=GV.state[IV];if(YV==null)return;JSON.stringify(UV.getState())!==JSON.stringify(YV)&&gV(YV);return}UV.dispatchFromDevtools&&typeof UV.dispatch=="function"&&UV.dispatch(GV)});case"DISPATCH":switch(JV.payload.type){case"RESET":return gV(nV),IV===void 0?FV==null?void 0:FV.init(UV.getState()):FV==null?void 0:FV.init(getTrackedConnectionState(dV.name));case"COMMIT":if(IV===void 0){FV==null||FV.init(UV.getState());return}return FV==null?void 0:FV.init(getTrackedConnectionState(dV.name));case"ROLLBACK":return parseJsonThen(JV.state,GV=>{if(IV===void 0){gV(GV),FV==null||FV.init(UV.getState());return}gV(GV[IV]),FV==null||FV.init(getTrackedConnectionState(dV.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return parseJsonThen(JV.state,GV=>{if(IV===void 0){gV(GV);return}JSON.stringify(UV.getState())!==JSON.stringify(GV[IV])&&gV(GV[IV])});case"IMPORT_STATE":{const{nextLiftedState:GV}=JV.payload,YV=(aV=GV.computedStates.slice(-1)[0])==null?void 0:aV.state;if(!YV)return;gV(IV===void 0?YV:YV[IV]),FV==null||FV.send(null,GV);return}case"PAUSE_RECORDING":return eV=!eV}return}}),nV},devtools=devtoolsImpl,parseJsonThen=(lV,J)=>{let VV;try{VV=JSON.parse(lV)}catch(RV){console.error("[zustand devtools middleware] Could not parse the received json",RV)}VV!==void 0&&J(VV)},API_BASE=window.API_BASE_URL??"/api";async function upsertFileApi(lV,J){return(await(await fetch(`${API_BASE}/files/upsert`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:lV,text_content:J})})).json()).file}async function getFileApi(lV){return(await(await fetch(`${API_BASE}/files/get?file_path=${encodeURIComponent(lV)}`)).json()).file}async function getEvents(lV){const J=lV?`${API_BASE}/events/list?since=${encodeURIComponent(lV)}`:`${API_BASE}/events/list`;return(await(await fetch(J)).json()).event_list}const useRunFrameStore=create$1()(devtools((lV,J)=>({fsMap:new Map,lastEventTime:null,isPolling:!1,error:null,upsertFile:async(VV,RV)=>{try{const UV=await upsertFileApi(VV,RV);lV(ZV=>({fsMap:new Map(ZV.fsMap).set(UV.file_path,UV.text_content)}))}catch(UV){lV({error:UV})}},getFile:async VV=>{try{const RV=await getFileApi(VV);lV(UV=>({fsMap:new Map(UV.fsMap).set(RV.file_path,RV.text_content)}))}catch(RV){lV({error:RV})}},startPolling:()=>{const VV=async()=>{const RV=J();if(RV.isPolling){try{const UV=await getEvents(RV.lastEventTime);if(UV.length>0){const ZV=UV[UV.length-1].created_at,WV=new Map(RV.fsMap);for(const IV of UV)if(IV.event_type==="FILE_UPDATED"){const dV=await getFileApi(IV.file_path);WV.set(dV.file_path,dV.text_content)}lV({fsMap:WV,lastEventTime:ZV})}}catch(UV){lV({error:UV})}setTimeout(VV,1e3)}};lV({isPolling:!0}),VV()},stopPolling:()=>{lV({isPolling:!1})}}),{name:"run-frame-store"})),selectCurrentFileMap=lV=>Object.fromEntries(lV.fsMap.entries()),guessEntrypoint=lV=>lV.find(J=>J.endsWith(".tsx")),RunFrameWithApi=({apiBaseUrl:lV})=>{const{startPolling:J,stopPolling:VV}=useRunFrameStore(),RV=useRunFrameStore(selectCurrentFileMap);reactExports.useEffect(()=>{lV&&(window.API_BASE_URL=lV)},[lV]),reactExports.useEffect(()=>(J(),()=>VV()),[J,VV]);const UV=guessEntrypoint(Object.keys(RV));return UV?jsxRuntimeExports.jsx(RunFrame,{fsMap:RV,entrypoint:UV,onError:ZV=>{console.error("RunFrame error:",ZV)}}):jsxRuntimeExports.jsx("div",{children:"No entrypoint found for Run Frame!"})},root=clientExports.createRoot(document.getElementById("root"));root.render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx("div",{style:{width:"100vw",height:"100vh"},children:jsxRuntimeExports.jsx(RunFrameWithApi,{})})}));var su=(lV,J={})=>{let VV=lV._internal_store;if(!VV){VV={counts:{}},lV._internal_store=VV;for(const UV of lV){const ZV=UV.type,WV=UV[`${ZV}_id`];if(!WV)continue;const IV=Number.parseInt(WV.split("_").pop());Number.isNaN(IV)||(VV.counts[ZV]=Math.max(VV.counts[ZV]??0,IV))}}return new Proxy({},{get:(UV,ZV)=>ZV==="toArray"?()=>lV:{get:WV=>lV.find(IV=>IV.type===ZV&&IV[`${ZV}_id`]===WV),getUsing:WV=>{const IV=Object.keys(WV);if(IV.length!==1)throw new Error("getUsing requires exactly one key, e.g. { pcb_component_id }");const dV=IV[0],CV=dV.replace("_id",""),FV=lV.find(NV=>NV.type===CV&&NV[dV]===WV[dV]);return FV?lV.find(NV=>NV.type===ZV&&NV[`${ZV}_id`]===FV[`${ZV}_id`]):null},getWhere:WV=>{const IV=Object.keys(WV);return lV.find(dV=>dV.type===ZV&&IV.every(CV=>dV[CV]===WV[CV]))},list:WV=>{const IV=WV?Object.keys(WV):[];return lV.filter(dV=>dV.type===ZV&&IV.every(CV=>dV[CV]===WV[CV]))},insert:WV=>{var CV;(CV=VV.counts)[ZV]??(CV[ZV]=-1),VV.counts[ZV]++;const IV=VV.counts[ZV],dV={type:ZV,[`${ZV}_id`]:`${ZV}_${IV}`,...WV};return J.validateInserts&&(Soup[ZV]??any_soup_element).parse(dV),lV.push(dV),dV},delete:WV=>{const IV=lV.find(dV=>dV[`${ZV}_id`]===WV);IV&&lV.splice(lV.indexOf(IV),1)},update:(WV,IV)=>{const dV=lV.find(CV=>CV.type===ZV&&CV[`${ZV}_id`]===WV);if(dV)return Object.assign(dV,IV),dV},select:WV=>{if(ZV==="source_component")return lV.find(IV=>IV.type==="source_component"&&IV.name===WV.replace(/\./g,""));if(ZV==="pcb_port"||ZV==="source_port"||ZV==="schematic_port"){const[IV,dV]=WV.replace(/\./g,"").split(/[\s\>]+/),CV=lV.find(NV=>NV.type==="source_component"&&NV.name===IV);if(!CV)return null;const FV=lV.find(NV=>NV.type==="source_port"&&NV.source_component_id===CV.source_component_id&&(NV.name===dV||(NV.port_hints??[]).includes(dV)));if(!FV)return null;if(ZV==="source_port")return FV;if(ZV==="pcb_port")return lV.find(NV=>NV.type==="pcb_port"&&NV.source_port_id===FV.source_port_id);if(ZV==="schematic_port")return lV.find(NV=>NV.type==="schematic_port"&&NV.source_port_id===FV.source_port_id)}}}})};su.unparsed=su;var su_default=su;function createSvgObjectsFromPcbTraceError(lV,J,VV,RV){if(!RV)return[];const{pcb_port_ids:UV}=lV,ZV=VV.find(NV=>NV.type==="pcb_port"&&NV.pcb_port_id===(UV==null?void 0:UV[0])),WV=VV.find(NV=>NV.type==="pcb_port"&&NV.pcb_port_id===(UV==null?void 0:UV[1]));if(!ZV||!WV)return[];const IV=applyToPoint(J,{x:ZV.x,y:ZV.y}),dV=applyToPoint(J,{x:WV.x,y:WV.y}),CV={x:(IV.x+dV.x)/2,y:(IV.y+dV.y)/2};return isNaN(IV.x)||isNaN(IV.y)||isNaN(dV.x)||isNaN(dV.y)||isNaN(CV.x)||isNaN(CV.y)?[]:[{name:"line",type:"element",attributes:{x1:IV.x.toString(),y1:IV.y.toString(),x2:CV.x.toString(),y2:CV.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""},{name:"line",type:"element",attributes:{x1:CV.x.toString(),y1:CV.y.toString(),x2:dV.x.toString(),y2:dV.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""},{name:"rect",type:"element",attributes:{x:(CV.x-5).toString(),y:(CV.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${CV.x} ${CV.y})`},children:[],value:""},{name:"text",type:"element",attributes:{x:CV.x.toString(),y:(CV.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:lV.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}]}function createSvgObjectsFromPcbFabricationNotePath(lV,J){if(!lV.route||!Array.isArray(lV.route))return[];const VV=lV.route[0],RV=lV.route[lV.route.length-1],UV=VV.x===RV.x&&VV.y===RV.y,ZV=lV.route.slice(0,UV?-1:void 0).map((WV,IV)=>{const[dV,CV]=applyToPoint(J,[WV.x,WV.y]);return IV===0?`M ${dV} ${CV}`:`L ${dV} ${CV}`}).join(" ")+(UV?" Z":"");return[{name:"path",type:"element",attributes:{class:"pcb-fabrication-note-path",stroke:lV.color||"rgba(255,255,255,0.5)",fill:"none",d:ZV,"stroke-width":(lV.stroke_width*Math.abs(J.a)).toString(),"data-pcb-component-id":lV.pcb_component_id,"data-pcb-fabrication-note-path-id":lV.pcb_fabrication_note_path_id},value:"",children:[]}]}function createSvgObjectsFromPcbFabricationNoteText(lV,J){const{anchor_position:VV,anchor_alignment:RV,text:UV,font_size:ZV=1,layer:WV="top",color:IV}=lV;if(!VV||typeof VV.x!="number"||typeof VV.y!="number")return console.error("Invalid anchor_position:",VV),[];const[dV,CV]=applyToPoint(J,[VV.x,VV.y]),FV=ZV*Math.abs(J.a),NV=compose(translate(dV,CV),rotate(Math.PI/180));return[{name:"text",type:"element",attributes:{x:"0",y:"0","font-family":"Arial, sans-serif","font-size":FV.toString(),"text-anchor":"middle","dominant-baseline":"central",transform:toString(NV),class:"pcb-fabrication-note-text",fill:IV||"rgba(255,255,255,0.5)"},children:[{type:"text",value:UV,name:"",attributes:{},children:[]}],value:""}]}function createSvgObjectsFromPcbPlatedHole(lV,J){const[VV,RV]=applyToPoint(J,[lV.x,lV.y]);if(lV.shape==="pill"){const UV=lV.outer_width*Math.abs(J.a),ZV=lV.outer_height*Math.abs(J.a),WV=lV.hole_width*Math.abs(J.a),IV=lV.hole_height*Math.abs(J.a),dV=UV/2,CV=WV/2,FV=ZV-UV;return[{name:"g",type:"element",children:[{name:"path",type:"element",attributes:{class:"pcb-hole-outer",d:`M${VV-dV},${RV-FV/2} v${FV} a${dV},${dV} 0 0 0 ${UV},0 v-${FV} a${dV},${dV} 0 0 0 -${UV},0 z`},value:"",children:[]},{name:"path",type:"element",attributes:{class:"pcb-hole-inner",d:`M${VV-CV},${RV-(IV-WV)/2} v${IV-WV} a${CV},${CV} 0 0 0 ${WV},0 v-${IV-WV} a${CV},${CV} 0 0 0 -${WV},0 z`},value:"",children:[]}],value:"",attributes:{}}]}if(lV.shape==="circle"){const UV=lV.outer_diameter*Math.abs(J.a),ZV=lV.outer_diameter*Math.abs(J.a),WV=lV.hole_diameter*Math.abs(J.a),IV=lV.hole_diameter*Math.abs(J.a),dV=Math.min(UV,ZV)/2,CV=Math.min(WV,IV)/2;return[{name:"g",type:"element",children:[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer",cx:VV.toString(),cy:RV.toString(),r:dV.toString()},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",cx:VV.toString(),cy:RV.toString(),r:CV.toString()},value:"",children:[]}],value:"",attributes:{}}]}return[]}function createSvgObjectsFromPcbSilkscreenPath(lV,J){if(!lV.route||!Array.isArray(lV.route))return[];let VV=lV.route.map((ZV,WV)=>{const[IV,dV]=applyToPoint(J,[ZV.x,ZV.y]);return WV===0?`M ${IV} ${dV}`:`L ${IV} ${dV}`}).join(" ");const RV=lV.route[0],UV=lV.route[lV.route.length-1];return RV&&UV&&RV.x===UV.x&&RV.y===UV.y&&(VV+=" Z"),[{name:"path",type:"element",attributes:{class:`pcb-silkscreen pcb-silkscreen-${lV.layer}`,d:VV,"stroke-width":(lV.stroke_width*Math.abs(J.a)).toString(),"data-pcb-component-id":lV.pcb_component_id,"data-pcb-silkscreen-path-id":lV.pcb_silkscreen_path_id},value:"",children:[]}]}function createSvgObjectsFromPcbSilkscreenText(lV,J){const{anchor_position:VV,text:RV,font_size:UV=1,layer:ZV="top"}=lV;if(!VV||typeof VV.x!="number"||typeof VV.y!="number")return console.error("Invalid anchor_position:",VV),[];const[WV,IV]=applyToPoint(J,[VV.x,VV.y]),dV=UV*Math.abs(J.a),CV=compose(translate(WV,IV),rotate(Math.PI/180));return[{name:"text",type:"element",attributes:{x:"0",y:"0","font-family":"Arial, sans-serif","font-size":dV.toString(),"text-anchor":"middle","dominant-baseline":"central",transform:toString(CV),class:`pcb-silkscreen-text pcb-silkscreen-${ZV}`,"data-pcb-silkscreen-text-id":lV.pcb_component_id},children:[{type:"text",value:RV,name:"",attributes:{},children:[]}],value:""}]}function pairs(lV){const J=[];for(let VV=0;VV<lV.length-1;VV++)J.push([lV[VV],lV[VV+1]]);return J}var LAYER_NAME_TO_COLOR={top:"rgb(200, 52, 52)",bottom:"rgb(77, 127, 196)"};function layerNameToColor(lV){return LAYER_NAME_TO_COLOR[lV]??"white"}function createSvgObjectsFromPcbTrace(lV,J){if(!lV.route||!Array.isArray(lV.route)||lV.route.length<2)return[];const VV=pairs(lV.route),RV=[];for(const[UV,ZV]of VV){const WV=applyToPoint(J,[UV.x,UV.y]),IV=applyToPoint(J,[ZV.x,ZV.y]),dV="layer"in UV?UV.layer:"layer"in ZV?ZV.layer:null;if(!dV)continue;const CV=LAYER_NAME_TO_COLOR[dV]??"white",FV="width"in UV?UV.width:"width"in ZV?ZV.width:null;RV.push({name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-trace",stroke:CV,d:`M ${WV[0]} ${WV[1]} L ${IV[0]} ${IV[1]}`,"stroke-width":FV?(FV*Math.abs(J.a)).toString():"0.3","stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"crispEdges"}})}return RV}function createSvgObjectsFromSmtPad(lV,J){const[VV,RV]=applyToPoint(J,[lV.x,lV.y]);if(lV.shape==="rect"||lV.shape==="rotated_rect"){const UV=lV.width*Math.abs(J.a),ZV=lV.height*Math.abs(J.d);return lV.shape==="rotated_rect"&&lV.ccw_rotation?[{name:"rect",type:"element",attributes:{class:"pcb-pad",fill:layerNameToColor(lV.layer),x:(-UV/2).toString(),y:(-ZV/2).toString(),width:UV.toString(),height:ZV.toString(),transform:`translate(${VV} ${RV}) rotate(${-lV.ccw_rotation})`}}]:[{name:"rect",type:"element",attributes:{class:"pcb-pad",fill:layerNameToColor(lV.layer),x:(VV-UV/2).toString(),y:(RV-ZV/2).toString(),width:UV.toString(),height:ZV.toString()}}]}return[]}function createSvgObjectsFromPcbBoard(lV,J){const{width:VV,height:RV,center:UV,outline:ZV}=lV;let WV;if(ZV&&Array.isArray(ZV)&&ZV.length>=3)WV=ZV.map((IV,dV)=>{const[CV,FV]=applyToPoint(J,[IV.x,IV.y]);return dV===0?`M ${CV} ${FV}`:`L ${CV} ${FV}`}).join(" ");else{const IV=VV/2,dV=RV/2,CV=applyToPoint(J,[UV.x-IV,UV.y-dV]),FV=applyToPoint(J,[UV.x+IV,UV.y-dV]),NV=applyToPoint(J,[UV.x+IV,UV.y+dV]),eV=applyToPoint(J,[UV.x-IV,UV.y+dV]);WV=`M ${CV[0]} ${CV[1]} L ${FV[0]} ${FV[1]} L ${NV[0]} ${NV[1]} L ${eV[0]} ${eV[1]}`}return WV+=" Z",[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board",d:WV,stroke:"rgba(255, 255, 255, 0.5)","stroke-width":(.1*Math.abs(J.a)).toString()}}]}function createSvgObjectsFromPcbVia(lV,J){const[VV,RV]=applyToPoint(J,[lV.x,lV.y]),UV=lV.outer_diameter*Math.abs(J.a),ZV=lV.outer_diameter*Math.abs(J.a),WV=lV.hole_diameter*Math.abs(J.a),IV=lV.hole_diameter*Math.abs(J.a),dV=Math.min(UV,ZV)/2,CV=Math.min(WV,IV)/2;return{name:"g",type:"element",children:[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer",cx:VV.toString(),cy:RV.toString(),r:dV.toString()}},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",cx:VV.toString(),cy:RV.toString(),r:CV.toString()}}]}}var HOLE_COLOR="#FF26E2";function createSvgObjectsFromPcbHole(lV,J){const[VV,RV]=applyToPoint(J,[lV.x,lV.y]);if(lV.hole_shape==="circle"||lV.hole_shape==="square"){const UV=lV.hole_diameter*Math.abs(J.a),ZV=UV/2;return lV.hole_shape==="circle"?[{name:"circle",type:"element",attributes:{class:"pcb-hole",cx:VV.toString(),cy:RV.toString(),r:ZV.toString(),fill:HOLE_COLOR},children:[],value:""}]:[{name:"rect",type:"element",attributes:{class:"pcb-hole",x:(VV-ZV).toString(),y:(RV-ZV).toString(),width:UV.toString(),height:UV.toString(),fill:HOLE_COLOR},children:[],value:""}]}if(lV.hole_shape==="oval"){const UV=lV.hole_width*Math.abs(J.a),ZV=lV.hole_height*Math.abs(J.a),WV=UV/2,IV=ZV/2;return[{name:"ellipse",type:"element",attributes:{class:"pcb-hole",cx:VV.toString(),cy:RV.toString(),rx:WV.toString(),ry:IV.toString(),fill:HOLE_COLOR},children:[],value:""}]}return[]}var OBJECT_ORDER=["pcb_trace_error","pcb_plated_hole","pcb_fabrication_note_text","pcb_fabrication_note_path","pcb_silkscreen_text","pcb_silkscreen_path","pcb_via","pcb_trace","pcb_smtpad","pcb_component","pcb_board"];function convertCircuitJsonToPcbSvg(lV,J){let VV=Number.POSITIVE_INFINITY,RV=Number.POSITIVE_INFINITY,UV=Number.NEGATIVE_INFINITY,ZV=Number.NEGATIVE_INFINITY;for(const MV of lV)MV.type==="pcb_board"?MV.outline&&Array.isArray(MV.outline)&&MV.outline.length>=3?AV(MV.outline):"center"in MV&&"width"in MV&&"height"in MV&&kV(MV.center,MV.width,MV.height):"x"in MV&&"y"in MV?kV({x:MV.x,y:MV.y},0,0):"route"in MV&&XV(MV.route);const WV=1,IV=UV-VV+2*WV,dV=ZV-RV+2*WV,CV=(J==null?void 0:J.width)??800,FV=(J==null?void 0:J.height)??600,NV=[];for(const MV of lV)"route"in MV&&MV.route!==void 0&&NV.push(MV.route);const eV=CV/IV,gV=FV/dV,nV=Math.min(eV,gV),JV=(CV-IV*nV)/2,aV=(FV-dV*nV)/2,GV=compose(translate(JV-VV*nV+WV*nV,FV-aV+RV*nV-WV*nV),scale$2(nV,-nV)),YV=lV.sort((MV,xV)=>(OBJECT_ORDER.indexOf(xV.type)??9999)-(OBJECT_ORDER.indexOf(MV.type)??9999)).flatMap(MV=>createSvgObjects(MV,GV,lV,J==null?void 0:J.shouldDrawErrors));for(const MV of lV)if("stroke_width"in MV){String(nV*MV.stroke_width);break}const tV={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:CV.toString(),height:FV.toString()},value:"",children:[{name:"style",type:"element",children:[{type:"text",value:`
|
|
22410
|
+
`);const YV=GV.state[IV];if(YV==null)return;JSON.stringify(UV.getState())!==JSON.stringify(YV)&&gV(YV);return}UV.dispatchFromDevtools&&typeof UV.dispatch=="function"&&UV.dispatch(GV)});case"DISPATCH":switch(JV.payload.type){case"RESET":return gV(nV),IV===void 0?FV==null?void 0:FV.init(UV.getState()):FV==null?void 0:FV.init(getTrackedConnectionState(dV.name));case"COMMIT":if(IV===void 0){FV==null||FV.init(UV.getState());return}return FV==null?void 0:FV.init(getTrackedConnectionState(dV.name));case"ROLLBACK":return parseJsonThen(JV.state,GV=>{if(IV===void 0){gV(GV),FV==null||FV.init(UV.getState());return}gV(GV[IV]),FV==null||FV.init(getTrackedConnectionState(dV.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return parseJsonThen(JV.state,GV=>{if(IV===void 0){gV(GV);return}JSON.stringify(UV.getState())!==JSON.stringify(GV[IV])&&gV(GV[IV])});case"IMPORT_STATE":{const{nextLiftedState:GV}=JV.payload,YV=(aV=GV.computedStates.slice(-1)[0])==null?void 0:aV.state;if(!YV)return;gV(IV===void 0?YV:YV[IV]),FV==null||FV.send(null,GV);return}case"PAUSE_RECORDING":return eV=!eV}return}}),nV},devtools=devtoolsImpl,parseJsonThen=(lV,J)=>{let VV;try{VV=JSON.parse(lV)}catch(RV){console.error("[zustand devtools middleware] Could not parse the received json",RV)}VV!==void 0&&J(VV)},API_BASE=window.API_BASE_URL??"/api";async function upsertFileApi(lV,J){return(await(await fetch(`${API_BASE}/files/upsert`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:lV,text_content:J})})).json()).file}async function getFileApi(lV){return(await(await fetch(`${API_BASE}/files/get?file_path=${encodeURIComponent(lV)}`)).json()).file}async function getEvents(lV){const J=lV?`${API_BASE}/events/list?since=${encodeURIComponent(lV)}`:`${API_BASE}/events/list`;return(await(await fetch(J)).json()).event_list}const useRunFrameStore=create$1()(devtools((lV,J)=>({fsMap:new Map,lastEventTime:null,isPolling:!1,error:null,upsertFile:async(VV,RV)=>{try{const UV=await upsertFileApi(VV,RV);lV(ZV=>({fsMap:new Map(ZV.fsMap).set(UV.file_path,UV.text_content)}))}catch(UV){lV({error:UV})}},getFile:async VV=>{try{const RV=await getFileApi(VV);lV(UV=>({fsMap:new Map(UV.fsMap).set(RV.file_path,RV.text_content)}))}catch(RV){lV({error:RV})}},startPolling:()=>{const VV=async()=>{const RV=J();if(RV.isPolling){try{const UV=await getEvents(RV.lastEventTime);if(UV.length>0){const ZV=UV[UV.length-1].created_at,WV=new Map(RV.fsMap);for(const IV of UV)if(IV.event_type==="FILE_UPDATED"){const dV=await getFileApi(IV.file_path);WV.set(dV.file_path,dV.text_content)}lV({fsMap:WV,lastEventTime:ZV})}}catch(UV){lV({error:UV})}setTimeout(VV,1e3)}};lV({isPolling:!0}),VV()},stopPolling:()=>{lV({isPolling:!1})}}),{name:"run-frame-store"})),selectCurrentFileMap=lV=>Object.fromEntries(lV.fsMap.entries()),guessEntrypoint=lV=>lV.find(J=>J.includes("entrypoint."))??lV.find(J=>J.includes("index."))??lV.find(J=>J.includes("main."))??lV.find(J=>J.endsWith(".tsx")),RunFrameWithApi=({apiBaseUrl:lV})=>{const{startPolling:J,stopPolling:VV}=useRunFrameStore(),RV=useRunFrameStore(selectCurrentFileMap);reactExports.useEffect(()=>{lV&&(window.API_BASE_URL=lV)},[lV]),reactExports.useEffect(()=>(J(),()=>VV()),[J,VV]);const UV=guessEntrypoint(Object.keys(RV))??"entrypoint.tsx";return RV[UV]?jsxRuntimeExports.jsx(RunFrame,{fsMap:RV,entrypoint:UV,onError:ZV=>{console.error("RunFrame error:",ZV)}}):jsxRuntimeExports.jsx("div",{children:"No entrypoint found for Run Frame!"})},root=clientExports.createRoot(document.getElementById("root"));root.render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx("div",{style:{width:"100vw",height:"100vh"},children:jsxRuntimeExports.jsx(RunFrameWithApi,{})})}));var su=(lV,J={})=>{let VV=lV._internal_store;if(!VV){VV={counts:{}},lV._internal_store=VV;for(const UV of lV){const ZV=UV.type,WV=UV[`${ZV}_id`];if(!WV)continue;const IV=Number.parseInt(WV.split("_").pop());Number.isNaN(IV)||(VV.counts[ZV]=Math.max(VV.counts[ZV]??0,IV))}}return new Proxy({},{get:(UV,ZV)=>ZV==="toArray"?()=>lV:{get:WV=>lV.find(IV=>IV.type===ZV&&IV[`${ZV}_id`]===WV),getUsing:WV=>{const IV=Object.keys(WV);if(IV.length!==1)throw new Error("getUsing requires exactly one key, e.g. { pcb_component_id }");const dV=IV[0],CV=dV.replace("_id",""),FV=lV.find(NV=>NV.type===CV&&NV[dV]===WV[dV]);return FV?lV.find(NV=>NV.type===ZV&&NV[`${ZV}_id`]===FV[`${ZV}_id`]):null},getWhere:WV=>{const IV=Object.keys(WV);return lV.find(dV=>dV.type===ZV&&IV.every(CV=>dV[CV]===WV[CV]))},list:WV=>{const IV=WV?Object.keys(WV):[];return lV.filter(dV=>dV.type===ZV&&IV.every(CV=>dV[CV]===WV[CV]))},insert:WV=>{var CV;(CV=VV.counts)[ZV]??(CV[ZV]=-1),VV.counts[ZV]++;const IV=VV.counts[ZV],dV={type:ZV,[`${ZV}_id`]:`${ZV}_${IV}`,...WV};return J.validateInserts&&(Soup[ZV]??any_soup_element).parse(dV),lV.push(dV),dV},delete:WV=>{const IV=lV.find(dV=>dV[`${ZV}_id`]===WV);IV&&lV.splice(lV.indexOf(IV),1)},update:(WV,IV)=>{const dV=lV.find(CV=>CV.type===ZV&&CV[`${ZV}_id`]===WV);if(dV)return Object.assign(dV,IV),dV},select:WV=>{if(ZV==="source_component")return lV.find(IV=>IV.type==="source_component"&&IV.name===WV.replace(/\./g,""));if(ZV==="pcb_port"||ZV==="source_port"||ZV==="schematic_port"){const[IV,dV]=WV.replace(/\./g,"").split(/[\s\>]+/),CV=lV.find(NV=>NV.type==="source_component"&&NV.name===IV);if(!CV)return null;const FV=lV.find(NV=>NV.type==="source_port"&&NV.source_component_id===CV.source_component_id&&(NV.name===dV||(NV.port_hints??[]).includes(dV)));if(!FV)return null;if(ZV==="source_port")return FV;if(ZV==="pcb_port")return lV.find(NV=>NV.type==="pcb_port"&&NV.source_port_id===FV.source_port_id);if(ZV==="schematic_port")return lV.find(NV=>NV.type==="schematic_port"&&NV.source_port_id===FV.source_port_id)}}}})};su.unparsed=su;var su_default=su;function createSvgObjectsFromPcbTraceError(lV,J,VV,RV){if(!RV)return[];const{pcb_port_ids:UV}=lV,ZV=VV.find(NV=>NV.type==="pcb_port"&&NV.pcb_port_id===(UV==null?void 0:UV[0])),WV=VV.find(NV=>NV.type==="pcb_port"&&NV.pcb_port_id===(UV==null?void 0:UV[1]));if(!ZV||!WV)return[];const IV=applyToPoint(J,{x:ZV.x,y:ZV.y}),dV=applyToPoint(J,{x:WV.x,y:WV.y}),CV={x:(IV.x+dV.x)/2,y:(IV.y+dV.y)/2};return isNaN(IV.x)||isNaN(IV.y)||isNaN(dV.x)||isNaN(dV.y)||isNaN(CV.x)||isNaN(CV.y)?[]:[{name:"line",type:"element",attributes:{x1:IV.x.toString(),y1:IV.y.toString(),x2:CV.x.toString(),y2:CV.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""},{name:"line",type:"element",attributes:{x1:CV.x.toString(),y1:CV.y.toString(),x2:dV.x.toString(),y2:dV.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""},{name:"rect",type:"element",attributes:{x:(CV.x-5).toString(),y:(CV.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${CV.x} ${CV.y})`},children:[],value:""},{name:"text",type:"element",attributes:{x:CV.x.toString(),y:(CV.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:lV.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}]}function createSvgObjectsFromPcbFabricationNotePath(lV,J){if(!lV.route||!Array.isArray(lV.route))return[];const VV=lV.route[0],RV=lV.route[lV.route.length-1],UV=VV.x===RV.x&&VV.y===RV.y,ZV=lV.route.slice(0,UV?-1:void 0).map((WV,IV)=>{const[dV,CV]=applyToPoint(J,[WV.x,WV.y]);return IV===0?`M ${dV} ${CV}`:`L ${dV} ${CV}`}).join(" ")+(UV?" Z":"");return[{name:"path",type:"element",attributes:{class:"pcb-fabrication-note-path",stroke:lV.color||"rgba(255,255,255,0.5)",fill:"none",d:ZV,"stroke-width":(lV.stroke_width*Math.abs(J.a)).toString(),"data-pcb-component-id":lV.pcb_component_id,"data-pcb-fabrication-note-path-id":lV.pcb_fabrication_note_path_id},value:"",children:[]}]}function createSvgObjectsFromPcbFabricationNoteText(lV,J){const{anchor_position:VV,anchor_alignment:RV,text:UV,font_size:ZV=1,layer:WV="top",color:IV}=lV;if(!VV||typeof VV.x!="number"||typeof VV.y!="number")return console.error("Invalid anchor_position:",VV),[];const[dV,CV]=applyToPoint(J,[VV.x,VV.y]),FV=ZV*Math.abs(J.a),NV=compose(translate(dV,CV),rotate(Math.PI/180));return[{name:"text",type:"element",attributes:{x:"0",y:"0","font-family":"Arial, sans-serif","font-size":FV.toString(),"text-anchor":"middle","dominant-baseline":"central",transform:toString(NV),class:"pcb-fabrication-note-text",fill:IV||"rgba(255,255,255,0.5)"},children:[{type:"text",value:UV,name:"",attributes:{},children:[]}],value:""}]}function createSvgObjectsFromPcbPlatedHole(lV,J){const[VV,RV]=applyToPoint(J,[lV.x,lV.y]);if(lV.shape==="pill"){const UV=lV.outer_width*Math.abs(J.a),ZV=lV.outer_height*Math.abs(J.a),WV=lV.hole_width*Math.abs(J.a),IV=lV.hole_height*Math.abs(J.a),dV=UV/2,CV=WV/2,FV=ZV-UV;return[{name:"g",type:"element",children:[{name:"path",type:"element",attributes:{class:"pcb-hole-outer",d:`M${VV-dV},${RV-FV/2} v${FV} a${dV},${dV} 0 0 0 ${UV},0 v-${FV} a${dV},${dV} 0 0 0 -${UV},0 z`},value:"",children:[]},{name:"path",type:"element",attributes:{class:"pcb-hole-inner",d:`M${VV-CV},${RV-(IV-WV)/2} v${IV-WV} a${CV},${CV} 0 0 0 ${WV},0 v-${IV-WV} a${CV},${CV} 0 0 0 -${WV},0 z`},value:"",children:[]}],value:"",attributes:{}}]}if(lV.shape==="circle"){const UV=lV.outer_diameter*Math.abs(J.a),ZV=lV.outer_diameter*Math.abs(J.a),WV=lV.hole_diameter*Math.abs(J.a),IV=lV.hole_diameter*Math.abs(J.a),dV=Math.min(UV,ZV)/2,CV=Math.min(WV,IV)/2;return[{name:"g",type:"element",children:[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer",cx:VV.toString(),cy:RV.toString(),r:dV.toString()},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",cx:VV.toString(),cy:RV.toString(),r:CV.toString()},value:"",children:[]}],value:"",attributes:{}}]}return[]}function createSvgObjectsFromPcbSilkscreenPath(lV,J){if(!lV.route||!Array.isArray(lV.route))return[];let VV=lV.route.map((ZV,WV)=>{const[IV,dV]=applyToPoint(J,[ZV.x,ZV.y]);return WV===0?`M ${IV} ${dV}`:`L ${IV} ${dV}`}).join(" ");const RV=lV.route[0],UV=lV.route[lV.route.length-1];return RV&&UV&&RV.x===UV.x&&RV.y===UV.y&&(VV+=" Z"),[{name:"path",type:"element",attributes:{class:`pcb-silkscreen pcb-silkscreen-${lV.layer}`,d:VV,"stroke-width":(lV.stroke_width*Math.abs(J.a)).toString(),"data-pcb-component-id":lV.pcb_component_id,"data-pcb-silkscreen-path-id":lV.pcb_silkscreen_path_id},value:"",children:[]}]}function createSvgObjectsFromPcbSilkscreenText(lV,J){const{anchor_position:VV,text:RV,font_size:UV=1,layer:ZV="top"}=lV;if(!VV||typeof VV.x!="number"||typeof VV.y!="number")return console.error("Invalid anchor_position:",VV),[];const[WV,IV]=applyToPoint(J,[VV.x,VV.y]),dV=UV*Math.abs(J.a),CV=compose(translate(WV,IV),rotate(Math.PI/180));return[{name:"text",type:"element",attributes:{x:"0",y:"0","font-family":"Arial, sans-serif","font-size":dV.toString(),"text-anchor":"middle","dominant-baseline":"central",transform:toString(CV),class:`pcb-silkscreen-text pcb-silkscreen-${ZV}`,"data-pcb-silkscreen-text-id":lV.pcb_component_id},children:[{type:"text",value:RV,name:"",attributes:{},children:[]}],value:""}]}function pairs(lV){const J=[];for(let VV=0;VV<lV.length-1;VV++)J.push([lV[VV],lV[VV+1]]);return J}var LAYER_NAME_TO_COLOR={top:"rgb(200, 52, 52)",bottom:"rgb(77, 127, 196)"};function layerNameToColor(lV){return LAYER_NAME_TO_COLOR[lV]??"white"}function createSvgObjectsFromPcbTrace(lV,J){if(!lV.route||!Array.isArray(lV.route)||lV.route.length<2)return[];const VV=pairs(lV.route),RV=[];for(const[UV,ZV]of VV){const WV=applyToPoint(J,[UV.x,UV.y]),IV=applyToPoint(J,[ZV.x,ZV.y]),dV="layer"in UV?UV.layer:"layer"in ZV?ZV.layer:null;if(!dV)continue;const CV=LAYER_NAME_TO_COLOR[dV]??"white",FV="width"in UV?UV.width:"width"in ZV?ZV.width:null;RV.push({name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-trace",stroke:CV,d:`M ${WV[0]} ${WV[1]} L ${IV[0]} ${IV[1]}`,"stroke-width":FV?(FV*Math.abs(J.a)).toString():"0.3","stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"crispEdges"}})}return RV}function createSvgObjectsFromSmtPad(lV,J){const[VV,RV]=applyToPoint(J,[lV.x,lV.y]);if(lV.shape==="rect"||lV.shape==="rotated_rect"){const UV=lV.width*Math.abs(J.a),ZV=lV.height*Math.abs(J.d);return lV.shape==="rotated_rect"&&lV.ccw_rotation?[{name:"rect",type:"element",attributes:{class:"pcb-pad",fill:layerNameToColor(lV.layer),x:(-UV/2).toString(),y:(-ZV/2).toString(),width:UV.toString(),height:ZV.toString(),transform:`translate(${VV} ${RV}) rotate(${-lV.ccw_rotation})`}}]:[{name:"rect",type:"element",attributes:{class:"pcb-pad",fill:layerNameToColor(lV.layer),x:(VV-UV/2).toString(),y:(RV-ZV/2).toString(),width:UV.toString(),height:ZV.toString()}}]}return[]}function createSvgObjectsFromPcbBoard(lV,J){const{width:VV,height:RV,center:UV,outline:ZV}=lV;let WV;if(ZV&&Array.isArray(ZV)&&ZV.length>=3)WV=ZV.map((IV,dV)=>{const[CV,FV]=applyToPoint(J,[IV.x,IV.y]);return dV===0?`M ${CV} ${FV}`:`L ${CV} ${FV}`}).join(" ");else{const IV=VV/2,dV=RV/2,CV=applyToPoint(J,[UV.x-IV,UV.y-dV]),FV=applyToPoint(J,[UV.x+IV,UV.y-dV]),NV=applyToPoint(J,[UV.x+IV,UV.y+dV]),eV=applyToPoint(J,[UV.x-IV,UV.y+dV]);WV=`M ${CV[0]} ${CV[1]} L ${FV[0]} ${FV[1]} L ${NV[0]} ${NV[1]} L ${eV[0]} ${eV[1]}`}return WV+=" Z",[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board",d:WV,stroke:"rgba(255, 255, 255, 0.5)","stroke-width":(.1*Math.abs(J.a)).toString()}}]}function createSvgObjectsFromPcbVia(lV,J){const[VV,RV]=applyToPoint(J,[lV.x,lV.y]),UV=lV.outer_diameter*Math.abs(J.a),ZV=lV.outer_diameter*Math.abs(J.a),WV=lV.hole_diameter*Math.abs(J.a),IV=lV.hole_diameter*Math.abs(J.a),dV=Math.min(UV,ZV)/2,CV=Math.min(WV,IV)/2;return{name:"g",type:"element",children:[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer",cx:VV.toString(),cy:RV.toString(),r:dV.toString()}},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",cx:VV.toString(),cy:RV.toString(),r:CV.toString()}}]}}var HOLE_COLOR="#FF26E2";function createSvgObjectsFromPcbHole(lV,J){const[VV,RV]=applyToPoint(J,[lV.x,lV.y]);if(lV.hole_shape==="circle"||lV.hole_shape==="square"){const UV=lV.hole_diameter*Math.abs(J.a),ZV=UV/2;return lV.hole_shape==="circle"?[{name:"circle",type:"element",attributes:{class:"pcb-hole",cx:VV.toString(),cy:RV.toString(),r:ZV.toString(),fill:HOLE_COLOR},children:[],value:""}]:[{name:"rect",type:"element",attributes:{class:"pcb-hole",x:(VV-ZV).toString(),y:(RV-ZV).toString(),width:UV.toString(),height:UV.toString(),fill:HOLE_COLOR},children:[],value:""}]}if(lV.hole_shape==="oval"){const UV=lV.hole_width*Math.abs(J.a),ZV=lV.hole_height*Math.abs(J.a),WV=UV/2,IV=ZV/2;return[{name:"ellipse",type:"element",attributes:{class:"pcb-hole",cx:VV.toString(),cy:RV.toString(),rx:WV.toString(),ry:IV.toString(),fill:HOLE_COLOR},children:[],value:""}]}return[]}var OBJECT_ORDER=["pcb_trace_error","pcb_plated_hole","pcb_fabrication_note_text","pcb_fabrication_note_path","pcb_silkscreen_text","pcb_silkscreen_path","pcb_via","pcb_trace","pcb_smtpad","pcb_component","pcb_board"];function convertCircuitJsonToPcbSvg(lV,J){let VV=Number.POSITIVE_INFINITY,RV=Number.POSITIVE_INFINITY,UV=Number.NEGATIVE_INFINITY,ZV=Number.NEGATIVE_INFINITY;for(const MV of lV)MV.type==="pcb_board"?MV.outline&&Array.isArray(MV.outline)&&MV.outline.length>=3?AV(MV.outline):"center"in MV&&"width"in MV&&"height"in MV&&kV(MV.center,MV.width,MV.height):"x"in MV&&"y"in MV?kV({x:MV.x,y:MV.y},0,0):"route"in MV&&XV(MV.route);const WV=1,IV=UV-VV+2*WV,dV=ZV-RV+2*WV,CV=(J==null?void 0:J.width)??800,FV=(J==null?void 0:J.height)??600,NV=[];for(const MV of lV)"route"in MV&&MV.route!==void 0&&NV.push(MV.route);const eV=CV/IV,gV=FV/dV,nV=Math.min(eV,gV),JV=(CV-IV*nV)/2,aV=(FV-dV*nV)/2,GV=compose(translate(JV-VV*nV+WV*nV,FV-aV+RV*nV-WV*nV),scale$2(nV,-nV)),YV=lV.sort((MV,xV)=>(OBJECT_ORDER.indexOf(xV.type)??9999)-(OBJECT_ORDER.indexOf(MV.type)??9999)).flatMap(MV=>createSvgObjects(MV,GV,lV,J==null?void 0:J.shouldDrawErrors));for(const MV of lV)if("stroke_width"in MV){String(nV*MV.stroke_width);break}const tV={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:CV.toString(),height:FV.toString()},value:"",children:[{name:"style",type:"element",children:[{type:"text",value:`
|
|
22411
22411
|
.boundary { fill: #000; }
|
|
22412
22412
|
.pcb-board { fill: none; }
|
|
22413
22413
|
.pcb-trace { fill: none; }
|
|
@@ -22419,7 +22419,16 @@ void main() {
|
|
|
22419
22419
|
.pcb-silkscreen-top { stroke: #f2eda1; }
|
|
22420
22420
|
.pcb-silkscreen-bottom { stroke: #f2eda1; }
|
|
22421
22421
|
.pcb-silkscreen-text { fill: #f2eda1; }
|
|
22422
|
-
`}]},{name:"rect",type:"element",attributes:{class:"boundary",x:"0",y:"0",width:CV.toString(),height:FV.toString()}},createSvgObjectFromPcbBoundary(GV,VV,RV,UV,ZV),...YV].filter(MV=>MV!==null)};try{return stringify(tV)}catch(MV){throw console.error("Error stringifying SVG object:",MV),MV}function kV(MV,xV,uV){const wV=xV/2,vV=uV/2;VV=Math.min(VV,MV.x-wV),RV=Math.min(RV,MV.y-vV),UV=Math.max(UV,MV.x+wV),ZV=Math.max(ZV,MV.y+vV)}function AV(MV){for(const xV of MV)VV=Math.min(VV,xV.x),RV=Math.min(RV,xV.y),UV=Math.max(UV,xV.x),ZV=Math.max(ZV,xV.y)}function XV(MV){for(const xV of MV)VV=Math.min(VV,xV.x),RV=Math.min(RV,xV.y),UV=Math.max(UV,xV.x),ZV=Math.max(ZV,xV.y)}}function createSvgObjects(lV,J,VV,RV){switch(lV.type){case"pcb_trace_error":return createSvgObjectsFromPcbTraceError(lV,J,VV,RV).filter(Boolean);case"pcb_component":return[createSvgObjectsFromPcbComponent(lV,J)].filter(Boolean);case"pcb_trace":return createSvgObjectsFromPcbTrace(lV,J);case"pcb_plated_hole":return createSvgObjectsFromPcbPlatedHole(lV,J).filter(Boolean);case"pcb_hole":return createSvgObjectsFromPcbHole(lV,J);case"pcb_smtpad":return createSvgObjectsFromSmtPad(lV,J);case"pcb_silkscreen_text":return createSvgObjectsFromPcbSilkscreenText(lV,J);case"pcb_fabrication_note_path":return createSvgObjectsFromPcbFabricationNotePath(lV,J);case"pcb_fabrication_note_text":return createSvgObjectsFromPcbFabricationNoteText(lV,J);case"pcb_silkscreen_path":return createSvgObjectsFromPcbSilkscreenPath(lV,J);case"pcb_board":return createSvgObjectsFromPcbBoard(lV,J);case"pcb_via":return createSvgObjectsFromPcbVia(lV,J);default:return[]}}function createSvgObjectsFromPcbComponent(lV,J){const{center:VV,width:RV,height:UV,rotation:ZV=0}=lV,[WV,IV]=applyToPoint(J,[VV.x,VV.y]),dV=RV*Math.abs(J.a),CV=UV*Math.abs(J.d);return{name:"g",type:"element",attributes:{transform:`translate(${WV}, ${IV}) rotate(${-ZV}) scale(1, -1)`},children:[{name:"rect",type:"element",attributes:{class:"pcb-component",x:(-dV/2).toString(),y:(-CV/2).toString(),width:dV.toString(),height:CV.toString()}},{name:"rect",type:"element",attributes:{class:"pcb-component-outline",x:(-dV/2).toString(),y:(-CV/2).toString(),width:dV.toString(),height:CV.toString()}}]}}function createSvgObjectFromPcbBoundary(lV,J,VV,RV,UV){const[ZV,WV]=applyToPoint(lV,[J,VV]),[IV,dV]=applyToPoint(lV,[RV,UV]),CV=Math.abs(IV-ZV),FV=Math.abs(dV-WV),NV=Math.min(ZV,IV),eV=Math.min(WV,dV);return{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-boundary",x:NV.toString(),y:eV.toString(),width:CV.toString(),height:FV.toString()}}}var circuitJsonToPcbSvg=convertCircuitJsonToPcbSvg,colorMap={"3d_viewer":{background_bottom:"rgb(102, 102, 128)",background_top:"rgb(204, 204, 230)",board:"rgb(51, 43, 23)",copper:"rgb(179, 156, 0)",silkscreen_bottom:"rgb(230, 230, 230)",silkscreen_top:"rgb(230, 230, 230)",soldermask:"rgb(20, 51, 36)",solderpaste:"rgb(128, 128, 128)"},board:{anchor:"rgb(255, 38, 226)",aux_items:"rgb(255, 255, 255)",b_adhes:"rgb(0, 0, 132)",b_crtyd:"rgb(255, 38, 226)",b_fab:"rgb(88, 93, 132)",b_mask:"rgba(2, 255, 238, 0.400)",b_paste:"rgb(0, 194, 194)",b_silks:"rgb(232, 178, 167)",background:"rgb(0, 16, 35)",cmts_user:"rgb(89, 148, 220)",copper:{b:"rgb(77, 127, 196)",f:"rgb(200, 52, 52)",in1:"rgb(127, 200, 127)",in10:"rgb(237, 124, 51)",in11:"rgb(91, 195, 235)",in12:"rgb(247, 111, 142)",in13:"rgb(167, 165, 198)",in14:"rgb(40, 204, 217)",in15:"rgb(232, 178, 167)",in16:"rgb(242, 237, 161)",in17:"rgb(237, 124, 51)",in18:"rgb(91, 195, 235)",in19:"rgb(247, 111, 142)",in2:"rgb(206, 125, 44)",in20:"rgb(167, 165, 198)",in21:"rgb(40, 204, 217)",in22:"rgb(232, 178, 167)",in23:"rgb(242, 237, 161)",in24:"rgb(237, 124, 51)",in25:"rgb(91, 195, 235)",in26:"rgb(247, 111, 142)",in27:"rgb(167, 165, 198)",in28:"rgb(40, 204, 217)",in29:"rgb(232, 178, 167)",in3:"rgb(79, 203, 203)",in30:"rgb(242, 237, 161)",in4:"rgb(219, 98, 139)",in5:"rgb(167, 165, 198)",in6:"rgb(40, 204, 217)",in7:"rgb(232, 178, 167)",in8:"rgb(242, 237, 161)",in9:"rgb(141, 203, 129)"},cursor:"rgb(255, 255, 255)",drc:"rgb(194, 194, 194)",drc_error:"rgba(215, 91, 107, 0.800)",drc_exclusion:"rgb(255, 255, 255)",drc_warning:"rgba(255, 208, 66, 0.902)",dwgs_user:"rgb(194, 194, 194)",eco1_user:"rgb(180, 219, 210)",eco2_user:"rgb(216, 200, 82)",edge_cuts:"rgb(208, 210, 205)",f_adhes:"rgb(132, 0, 132)",f_crtyd:"rgb(255, 0, 245)",f_fab:"rgb(175, 175, 175)",f_mask:"rgba(216, 100, 255, 0.400)",f_paste:"rgba(180, 160, 154, 0.902)",f_silks:"rgb(242, 237, 161)",footprint_text_back:"rgb(0, 0, 132)",footprint_text_front:"rgb(194, 194, 194)",footprint_text_invisible:"rgb(132, 132, 132)",grid:"rgb(132, 132, 132)",grid_axes:"rgb(194, 194, 194)",margin:"rgb(255, 38, 226)",microvia:"rgb(0, 132, 132)",no_connect:"rgb(0, 0, 132)",pad_back:"rgb(77, 127, 196)",pad_front:"rgb(200, 52, 52)",pad_plated_hole:"rgb(194, 194, 0)",pad_through_hole:"rgb(227, 183, 46)",plated_hole:"rgb(26, 196, 210)",ratsnest:"rgba(245, 255, 213, 0.702)",select_overlay:"rgb(4, 255, 67)",through_via:"rgb(236, 236, 236)",user_1:"rgb(194, 194, 194)",user_2:"rgb(89, 148, 220)",user_3:"rgb(180, 219, 210)",user_4:"rgb(216, 200, 82)",user_5:"rgb(194, 194, 194)",user_6:"rgb(89, 148, 220)",user_7:"rgb(180, 219, 210)",user_8:"rgb(216, 200, 82)",user_9:"rgb(232, 178, 167)",via_blind_buried:"rgb(187, 151, 38)",via_hole:"rgb(227, 183, 46)",via_micro:"rgb(0, 132, 132)",via_through:"rgb(236, 236, 236)",worksheet:"rgb(200, 114, 171)"},gerbview:{axes:"rgb(0, 0, 132)",background:"rgb(0, 0, 0)",dcodes:"rgb(255, 255, 255)",grid:"rgb(132, 132, 132)",layers:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)"],negative_objects:"rgb(132, 132, 132)",worksheet:"rgb(0, 0, 132)"},meta:{filename:"kicad_2020",name:"KiCad 2020",version:2},palette:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)"],schematic:{aux_items:"rgb(46, 46, 46)",background:"rgb(245, 241, 237)",brightened:"rgb(255, 0, 255)",bus:"rgb(0, 0, 132)",bus_junction:"rgb(0, 0, 132)",component_body:"rgb(255, 255, 194)",component_outline:"rgb(132, 0, 0)",cursor:"rgb(15, 15, 15)",erc_error:"rgba(230, 9, 13, 0.800)",erc_warning:"rgba(209, 146, 0, 0.800)",fields:"rgb(132, 0, 132)",grid:"rgb(181, 181, 181)",grid_axes:"rgb(0, 0, 132)",hidden:"rgb(194, 194, 194)",junction:"rgb(0, 150, 0)",label_global:"rgb(132, 0, 0)",label_hier:"rgb(114, 86, 0)",label_local:"rgb(15, 15, 15)",net_name:"rgb(132, 132, 132)",no_connect:"rgb(0, 0, 132)",note:"rgb(0, 0, 194)",override_item_colors:!1,pin:"rgb(132, 0, 0)",pin_name:"rgb(0, 100, 100)",pin_number:"rgb(169, 0, 0)",reference:"rgb(0, 100, 100)",shadow:"rgba(102, 179, 255, 0.800)",sheet:"rgb(132, 0, 0)",sheet_background:"rgba(253, 255, 231, 0.000)",sheet_fields:"rgb(132, 0, 132)",sheet_filename:"rgb(114, 86, 0)",sheet_label:"rgb(0, 100, 100)",sheet_name:"rgb(0, 100, 100)",value:"rgb(0, 100, 100)",wire:"rgb(0, 150, 0)",wire_crossing:"rgb(30, 180, 30)",worksheet:"rgb(132, 0, 0)"}};function drawSchematicGrid(lV){const{minX:J,minY:VV,maxX:RV,maxY:UV}=lV.bounds,ZV=lV.cellSize??1,WV=lV.labelCells??!1,IV=[],dV=(CV,FV)=>{const[NV,eV]=applyToPoint(lV.transform,[CV,FV]);return{x:NV,y:eV}};for(let CV=Math.floor(J);CV<=Math.ceil(RV);CV+=ZV){const FV=dV(CV,VV),NV=dV(CV,UV);IV.push({name:"line",type:"element",attributes:{x1:FV.x.toString(),y1:FV.y.toString(),x2:NV.x.toString(),y2:NV.y.toString(),stroke:colorMap.schematic.grid,"stroke-width":(.01*Math.abs(lV.transform.a)).toString(),"stroke-opacity":"0.5"}})}for(let CV=Math.floor(VV);CV<=Math.ceil(UV);CV+=ZV){const FV=dV(J,CV),NV=dV(RV,CV);IV.push({name:"line",type:"element",attributes:{x1:FV.x.toString(),y1:FV.y.toString(),x2:NV.x.toString(),y2:NV.y.toString(),stroke:colorMap.schematic.grid,"stroke-width":(.01*Math.abs(lV.transform.a)).toString(),"stroke-opacity":"0.5"}})}if(WV){const CV=(FV,NV)=>ZV<=.1?`${FV.toFixed(1)},${NV.toFixed(1)}`:`${FV},${NV}`;for(let FV=Math.floor(J);FV<=Math.ceil(RV);FV+=ZV)for(let NV=Math.floor(VV);NV<=Math.ceil(UV);NV+=ZV){const eV=dV(FV,NV);IV.push({name:"text",type:"element",attributes:{x:(eV.x-2.5).toString(),y:(eV.y-5).toString(),fill:colorMap.schematic.grid,"font-size":(ZV/5*Math.abs(lV.transform.a)).toString(),"fill-opacity":"0.5","text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif"},children:[{type:"text",value:CV(FV,NV),name:"",attributes:{},children:[]}]})}}return{name:"g",value:"",type:"element",attributes:{class:"grid"},children:IV}}function drawSchematicLabeledPoints(lV){const{points:J,transform:VV}=lV,RV=[];for(const UV of J){const[ZV,WV]=applyToPoint(VV,[UV.x-.1,UV.y-.1]),[IV,dV]=applyToPoint(VV,[UV.x+.1,UV.y+.1]),[CV,FV]=applyToPoint(VV,[UV.x-.1,UV.y+.1]),[NV,eV]=applyToPoint(VV,[UV.x+.1,UV.y-.1]);RV.push({name:"path",type:"element",attributes:{d:`M${ZV},${WV} L${IV},${dV} M${CV},${FV} L${NV},${eV}`,stroke:colorMap.schematic.grid,"stroke-width":(.02*Math.abs(VV.a)).toString(),"stroke-opacity":"0.7"}});const[gV,nV]=applyToPoint(VV,[UV.x+.15,UV.y-.15]);RV.push({name:"text",type:"element",attributes:{x:gV.toString(),y:nV.toString(),fill:colorMap.schematic.grid,"font-size":(.1*Math.abs(VV.a)).toString(),"fill-opacity":"0.7","text-anchor":"start","font-family":"sans-serif","dominant-baseline":"middle"},children:[{type:"text",value:UV.label||`(${UV.x},${UV.y})`,name:"",attributes:{},children:[]}]})}return{name:"g",value:"",type:"element",attributes:{class:"labeled-points"},children:RV}}function getSchematicBoundsFromCircuitJson(lV,J=.5){let VV=Number.POSITIVE_INFINITY,RV=Number.POSITIVE_INFINITY,UV=Number.NEGATIVE_INFINITY,ZV=Number.NEGATIVE_INFINITY;const WV=.2;for(const dV of lV)if(dV.type==="schematic_component")IV(dV.center,dV.size,dV.rotation||0);else if(dV.type==="schematic_port")IV(dV.center,{width:WV,height:WV},0);else if(dV.type==="schematic_debug_object")dV.shape==="rect"?IV(dV.center,dV.size,0):dV.shape==="line"&&(IV(dV.start,{width:.1,height:.1},0),IV(dV.end,{width:.1,height:.1},0));else if(dV.type==="schematic_net_label")IV(dV.center,{width:1,height:1},0);else if(dV.type==="schematic_trace")for(const CV of dV.edges)IV(CV.from,{width:.1,height:.1},0),IV(CV.to,{width:.1,height:.1},0);else dV.type==="schematic_text"?IV(dV.position,{width:.1,height:.1},0):dV.type==="schematic_voltage_probe"&&IV(dV.position,{width:.2,height:.4},0);return VV-=J,RV-=J,UV+=J,ZV+=J,{minX:VV,minY:RV,maxX:UV,maxY:ZV};function IV(dV,CV,FV){const NV=[{x:-CV.width/2,y:-CV.height/2},{x:CV.width/2,y:-CV.height/2},{x:CV.width/2,y:CV.height/2},{x:-CV.width/2,y:CV.height/2}];for(const eV of NV){const gV=eV.x*Math.cos(FV)-eV.y*Math.sin(FV)+dV.x,nV=eV.x*Math.sin(FV)+eV.y*Math.cos(FV)+dV.y;VV=Math.min(VV,gV),RV=Math.min(RV,nV),UV=Math.max(UV,gV),ZV=Math.max(ZV,nV)}}}var getSchStrokeSize=lV=>Math.abs(lV.a)*.02,getAngularDifference=(lV,J)=>{const VV=lV<0?lV+2*Math.PI:lV,RV=J<0?J+2*Math.PI:J;let UV=Math.abs(VV-RV);return UV>Math.PI&&(UV=2*Math.PI-UV),UV},matchSchPortsToSymbolPorts=({schPorts:lV,symbol:J,schComponent:VV})=>{const RV=lV.map(IV=>{const dV=IV.center.x-VV.center.x,CV=IV.center.y-VV.center.y;return{port:IV,angle:Math.atan2(CV,dV)}}),UV=J.ports.map(IV=>{const dV=IV.x-J.center.x,CV=IV.y-J.center.y;return{port:IV,angle:Math.atan2(CV,dV)}});RV.sort((IV,dV)=>IV.angle-dV.angle),UV.sort((IV,dV)=>IV.angle-dV.angle);const ZV=[],WV=new Set;for(const IV of RV){let dV=null;for(const CV of UV){if(WV.has(CV.port))continue;const FV=getAngularDifference(IV.angle,CV.angle);(dV===null||FV<dV.angleDiff)&&(dV={symbolPort:CV.port,angleDiff:FV})}dV&&dV.angleDiff<Math.PI/4&&(ZV.push({schPort:IV.port,symbolPort:dV.symbolPort}),WV.add(dV.symbolPort))}return ZV};function pointPairsToMatrix(lV,J,VV,RV){const UV=J.x-lV.x,ZV=J.y-lV.y,WV=Math.sqrt((VV.x-lV.x)**2+(VV.y-lV.y)**2),dV=Math.sqrt((RV.x-J.x)**2+(RV.y-J.y)**2)/WV,CV=translate(UV,ZV),FV=scale$2(dV,dV);return compose(CV,FV)}var getSchMmFontSize=lV=>lV==="error"?.05:lV==="pin_number"?.15:.18,getSchScreenFontSize=(lV,J)=>Math.abs(lV.a)*getSchMmFontSize(J),createSvgSchErrorText=({text:lV,realCenter:J,realToScreenTransform:VV})=>{const RV=applyToPoint(VV,J);return{type:"element",name:"text",value:"",attributes:{x:RV.x.toString(),y:RV.y.toString(),fill:"red","text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif","font-size":`${getSchScreenFontSize(VV,"error")}px`},children:[{type:"text",value:lV,name:"",attributes:{},children:[]}]}},ninePointAnchorToTextAnchor={top_left:"start",top_right:"end",middle_left:"start",middle_right:"end",bottom_left:"start",bottom_right:"end",center:"middle",middle_top:"middle",middle_bottom:"middle"},ninePointAnchorToDominantBaseline={top_left:"auto",top_right:"auto",bottom_left:"hanging",bottom_right:"hanging",center:"auto",middle_left:"middle",middle_right:"middle",middle_top:"auto",middle_bottom:"hanging"},createSvgObjectsFromSchematicComponentWithSymbol=({component:lV,transform:J,circuitJson:VV})=>{var AV,XV;const RV=[],UV=symbols_index_default[lV.symbol_name];if(!UV)return[createSvgSchErrorText({text:`Symbol not found: ${lV.symbol_name}`,realCenter:lV.center,realToScreenTransform:J})];const ZV=su_default(VV).schematic_port.list({schematic_component_id:lV.schematic_component_id}),WV=su_default(VV).source_component.get(lV.source_component_id),IV=matchSchPortsToSymbolPorts({schPorts:ZV,symbol:UV,schComponent:lV});if(!IV[0])return[createSvgSchErrorText({text:`Could not match ports for symbol ${lV.symbol_name}`,realCenter:lV.center,realToScreenTransform:J})];const dV=pointPairsToMatrix(((AV=IV[1])==null?void 0:AV.symbolPort)??UV.center,((XV=IV[1])==null?void 0:XV.schPort.center)??lV.center,IV[0].symbolPort,IV[0].schPort.center),CV=UV.primitives.filter(MV=>MV.type==="path"),FV=UV.primitives.filter(MV=>MV.type==="text");UV.primitives.filter(MV=>MV.type==="circle");const NV=UV.primitives.filter(MV=>MV.type==="box"),eV={minX:Math.min(...CV.flatMap(MV=>MV.points.map(xV=>xV.x))),maxX:Math.max(...CV.flatMap(MV=>MV.points.map(xV=>xV.x))),minY:Math.min(...CV.flatMap(MV=>MV.points.map(xV=>xV.y))),maxY:Math.max(...CV.flatMap(MV=>MV.points.map(xV=>xV.y)))},[gV,nV]=applyToPoint(compose(J,dV),[eV.minX,eV.minY]),[JV,aV]=applyToPoint(compose(J,dV),[eV.maxX,eV.maxY]),GV=Math.abs(aV-nV),YV=Math.min(nV,aV),tV=Math.abs(JV-gV),kV=Math.min(gV,JV);RV.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay",x:kV.toString(),y:YV.toString(),width:tV.toString(),height:GV.toString(),fill:"transparent"},children:[]});for(const MV of CV){const{points:xV,color:uV,closed:wV,fill:vV}=MV;RV.push({type:"element",name:"path",attributes:{d:xV.map((yV,ll)=>{const[Nl,al]=applyToPoint(compose(J,dV),[yV.x,yV.y]);return`${ll===0?"M":"L"} ${Nl} ${al}`}).join(" ")+(wV?" Z":""),stroke:colorMap.schematic.component_outline,fill:"none","stroke-width":`${getSchStrokeSize(J)}px`},value:"",children:[]})}for(const MV of FV){const xV=applyToPoint(compose(J,dV),MV);let uV="";MV.text==="{REF}"?uV=(WV==null?void 0:WV.name)??"":MV.text==="{VAL}"&&(uV=lV.symbol_display_value??""),RV.push({name:"text",type:"element",attributes:{x:xV.x.toString(),y:xV.y.toString(),"dominant-baseline":ninePointAnchorToDominantBaseline[MV.anchor],"text-anchor":ninePointAnchorToTextAnchor[MV.anchor],"font-family":"sans-serif","font-size":`${getSchScreenFontSize(J,"reference_designator")}px`},value:"",children:[{type:"text",value:uV,name:"",attributes:{},children:[]}]})}for(const MV of NV){const xV=applyToPoint(compose(J,dV),MV),uV=compose(J,dV).a;RV.push({name:"rect",type:"element",attributes:{x:xV.x.toString(),y:xV.y.toString(),width:(MV.width*uV).toString(),height:(MV.height*uV).toString(),fill:"red"},value:"",children:[]})}for(const MV of UV.ports){const xV=applyToPoint(compose(J,dV),MV);RV.push({type:"element",name:"circle",attributes:{cx:xV.x.toString(),cy:xV.y.toString(),r:`${Math.abs(J.a)*.02}px`,"stroke-width":`${getSchStrokeSize(J)}px`,fill:"none",stroke:colorMap.schematic.component_outline},value:"",children:[]})}return RV},PIN_CIRCLE_RADIUS_MM=.02,createSvgObjectsForSchPortBoxLine=({schPort:lV,schComponent:J,transform:VV,circuitJson:RV})=>{const UV=[];su_default(RV).source_port.get(lV.source_port_id);const ZV={x:lV.center.x,y:lV.center.y},WV=lV.distance_from_component_edge??.4;switch(lV.side_of_component){case"left":ZV.x+=WV;break;case"right":ZV.x-=WV;break;case"top":ZV.y-=WV;break;case"bottom":ZV.y+=WV;break}const IV=applyToPoint(VV,lV.center),dV=applyToPoint(VV,ZV),CV={...lV.center};switch(lV.side_of_component){case"left":CV.x+=PIN_CIRCLE_RADIUS_MM;break;case"right":CV.x-=PIN_CIRCLE_RADIUS_MM;break;case"top":CV.y-=PIN_CIRCLE_RADIUS_MM;break;case"bottom":CV.y+=PIN_CIRCLE_RADIUS_MM;break}const FV=applyToPoint(VV,CV);return UV.push({name:"line",type:"element",attributes:{class:"component-pin",x1:FV.x.toString(),y1:FV.y.toString(),x2:dV.x.toString(),y2:dV.y.toString(),"stroke-width":`${getSchStrokeSize(VV)}px`},value:"",children:[]}),UV.push({name:"circle",type:"element",attributes:{class:"component-pin",cx:IV.x.toString(),cy:IV.y.toString(),r:(Math.abs(VV.a)*PIN_CIRCLE_RADIUS_MM).toString(),"stroke-width":`${getSchStrokeSize(VV)}px`},value:"",children:[]}),UV},getUnitVectorFromOutsideToEdge=lV=>{switch(lV){case"top":return{x:0,y:-1};case"bottom":return{x:0,y:1};case"left":return{x:1,y:0};case"right":return{x:-1,y:0}}throw new Error(`Invalid side: ${lV}`)},createSvgObjectsForSchPortPinNumberText=lV=>{var FV;const J=[],{schPort:VV,schComponent:RV,transform:UV,circuitJson:ZV}=lV,WV={x:VV.center.x,y:VV.center.y};if(!VV.side_of_component)return[];const IV=getUnitVectorFromOutsideToEdge(VV.side_of_component),dV=VV.distance_from_component_edge??.4;WV.x+=IV.x*dV/2,WV.y+=IV.y*dV/2,VV.side_of_component==="top"||VV.side_of_component==="bottom"?WV.x-=.02:WV.y+=.02;const CV=applyToPoint(UV,WV);return J.push({name:"text",type:"element",attributes:{class:"pin-number",x:CV.x.toString(),y:CV.y.toString(),style:"font-family: sans-serif;",fill:colorMap.schematic.pin_number,"text-anchor":"middle","dominant-baseline":"auto","font-size":`${getSchScreenFontSize(UV,"pin_number")}px`,transform:VV.side_of_component==="top"||VV.side_of_component==="bottom"?`rotate(-90 ${CV.x} ${CV.y})`:""},children:[{type:"text",value:((FV=VV.pin_number)==null?void 0:FV.toString())||"",name:"",attributes:{},children:[]}],value:""}),J},LABEL_DIST_FROM_EDGE_MM=.1,createSvgObjectsForSchPortPinLabel=lV=>{var NV;const J=[],{schPort:VV,schComponent:RV,transform:UV,circuitJson:ZV}=lV,WV={x:VV.center.x,y:VV.center.y};if(!VV.side_of_component)return[];const IV=getUnitVectorFromOutsideToEdge(VV.side_of_component),dV=VV.distance_from_component_edge??.4;WV.x+=IV.x*(dV+LABEL_DIST_FROM_EDGE_MM),WV.y+=IV.y*(dV+LABEL_DIST_FROM_EDGE_MM);const CV=applyToPoint(UV,WV),FV=VV.display_pin_label??((NV=RV.port_labels)==null?void 0:NV[`${VV.pin_number}`]);return FV?(J.push({name:"text",type:"element",attributes:{class:"pin-number",x:CV.x.toString(),y:CV.y.toString(),style:"font-family: sans-serif;",fill:colorMap.schematic.pin_number,"text-anchor":VV.side_of_component==="left"||VV.side_of_component==="bottom"?"start":"end","dominant-baseline":"middle","font-size":`${getSchScreenFontSize(UV,"pin_number")}px`,transform:VV.side_of_component==="top"||VV.side_of_component==="bottom"?`rotate(-90 ${CV.x} ${CV.y})`:""},children:[{type:"text",value:FV||"",name:"",attributes:{},children:[]}],value:""}),J):[]},createSvgObjectsFromSchPortOnBox=lV=>{const J=[];return J.push(...createSvgObjectsForSchPortBoxLine(lV)),J.push(...createSvgObjectsForSchPortPinNumberText(lV)),J.push(...createSvgObjectsForSchPortPinLabel(lV)),J},createSvgObjectsFromSchematicComponentWithBox=({component:lV,transform:J,circuitJson:VV})=>{const RV=[],UV=applyToPoint(J,{x:lV.center.x-lV.size.width/2,y:lV.center.y+lV.size.height/2}),ZV=applyToPoint(J,{x:lV.center.x+lV.size.width/2,y:lV.center.y-lV.size.height/2}),WV=ZV.x-UV.x,IV=ZV.y-UV.y;RV.push({name:"rect",type:"element",value:"",attributes:{class:"component chip",x:UV.x.toString(),y:UV.y.toString(),width:WV.toString(),height:IV.toString(),"stroke-width":`${getSchStrokeSize(J)}px`,fill:colorMap.schematic.component_body,stroke:colorMap.schematic.component_outline},children:[]}),RV.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay",x:UV.x.toString(),y:UV.y.toString(),width:WV.toString(),height:IV.toString(),fill:"transparent"},children:[]});const dV=su_default(VV).schematic_port.list({schematic_component_id:lV.schematic_component_id});for(const CV of dV)RV.push(...createSvgObjectsFromSchPortOnBox({schPort:CV,schComponent:lV,transform:J,circuitJson:VV}));return RV};function createSvgObjectsFromSchematicComponent(lV){const{component:J}=lV,VV=J.symbol_name?createSvgObjectsFromSchematicComponentWithSymbol(lV):createSvgObjectsFromSchematicComponentWithBox(lV);return[{type:"element",name:"g",attributes:{"data-circuit-json-type":"schematic_component","data-schematic-component-id":J.schematic_component_id},children:VV,value:""}]}function createSvgObjectsFromSchVoltageProbe(lV,J){const[VV,RV]=applyToPoint(J,[lV.position.x,lV.position.y]),UV=Math.abs(J.a)*.6,ZV=Math.abs(J.a)*.28,WV=VV+UV*Math.cos(-50*Math.PI/180),IV=RV+UV*Math.sin(-50*Math.PI/180),dV=VV,CV=RV;return[{name:"path",type:"element",attributes:{d:[`M ${WV},${IV}`,`L ${dV},${CV}`,`M ${dV},${CV}`,`L ${dV-ZV*Math.cos(100*Math.PI/180)},${CV-ZV*Math.sin(100*Math.PI/180)}`,`L ${dV-ZV*Math.cos(160*Math.PI/180)},${CV-ZV*Math.sin(160*Math.PI/180)}`,"Z"].join(" "),stroke:colorMap.schematic.reference,fill:colorMap.schematic.reference,"stroke-width":`${getSchStrokeSize(J)}px`},value:"",children:[]},{type:"element",name:"text",value:"",attributes:{x:(WV+8-(WV-WV)).toString(),y:(IV-10+(IV-IV)).toString(),fill:colorMap.schematic.reference,"text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif","font-size":`${getSchScreenFontSize(J,"reference_designator")}px`,"font-weight":"bold","data-schematic-voltage-probe-id":lV.schematic_voltage_probe_id},children:[{type:"text",value:lV.voltage?`${lV.voltage}V`:"",name:"",attributes:{},children:[]}]}]}function createSvgObjectsFromSchDebugObject(lV,J){if(lV.shape==="rect"){let[VV,RV]=applyToPoint(J,[lV.center.x-lV.size.width/2,lV.center.y-lV.size.height/2]),[UV,ZV]=applyToPoint(J,[lV.center.x+lV.size.width/2,lV.center.y+lV.size.height/2]);[RV,ZV]=[Math.min(RV,ZV),Math.max(RV,ZV)];const WV=Math.abs(UV-VV),IV=Math.abs(ZV-RV),[dV,CV]=applyToPoint(J,[lV.center.x,lV.center.y]);return[{name:"rect",type:"element",value:"",attributes:{x:VV.toString(),y:RV.toString(),width:WV.toString(),height:IV.toString(),fill:"none",stroke:"red","stroke-width":(.02*Math.abs(J.a)).toString(),"stroke-dasharray":"5,5"},children:lV.label?[{name:"text",type:"element",value:"",attributes:{x:dV.toString(),y:(CV-10).toString(),"text-anchor":"middle","font-size":(.2*Math.abs(J.a)).toString(),fill:"red"},children:[{type:"text",value:lV.label,name:"",attributes:{},children:[]}]}]:[]}]}if(lV.shape==="line"){const[VV,RV]=applyToPoint(J,[lV.start.x,lV.start.y]),[UV,ZV]=applyToPoint(J,[lV.end.x,lV.end.y]),WV=(VV+UV)/2,IV=(RV+ZV)/2;return[{name:"line",type:"element",value:"",attributes:{x1:VV.toString(),y1:RV.toString(),x2:UV.toString(),y2:ZV.toString(),stroke:"red","stroke-width":(.02*Math.abs(J.a)).toString(),"stroke-dasharray":"5,5"},children:lV.label?[{name:"text",type:"element",value:"",attributes:{x:WV.toString(),y:(IV-10).toString(),"text-anchor":"middle","font-size":(.2*Math.abs(J.a)).toString(),fill:"red"},children:[{type:"text",value:lV.label,name:"",attributes:{},children:[]}]}]:[]}]}return[]}function createSchematicTrace(lV,J){var ZV;const VV=lV.edges;if(VV.length===0)return[];const RV=[];let UV="";for(let WV=0;WV<VV.length;WV++){const IV=VV[WV];if(IV.is_crossing)continue;const[dV,CV]=applyToPoint(J,[IV.from.x,IV.from.y]),[FV,NV]=applyToPoint(J,[IV.to.x,IV.to.y]);WV===0||(ZV=VV[WV-1])!=null&&ZV.is_crossing?UV+=`M ${dV} ${CV} L ${FV} ${NV}`:UV+=` L ${FV} ${NV}`}for(const WV of VV){if(!WV.is_crossing)continue;const[IV,dV]=applyToPoint(J,[WV.from.x,WV.from.y]),[CV,FV]=applyToPoint(J,[WV.to.x,WV.to.y]),NV=(IV+CV)/2,eV=(dV+FV)/2,gV=CV-IV,nV=FV-dV,JV=Math.sqrt(gV*gV+nV*nV),aV=JV*.7,GV=-nV/JV*aV,YV=gV/JV*aV,tV=NV+GV,kV=eV-Math.abs(YV);RV.push({name:"path",type:"element",attributes:{class:"trace-crossing-outline",d:`M ${IV} ${dV} Q ${tV} ${kV} ${CV} ${FV}`,stroke:colorMap.schematic.background,fill:"none","stroke-width":`${getSchStrokeSize(J)*1.5}px`,"stroke-linecap":"round"},value:"",children:[]}),RV.push({name:"path",type:"element",attributes:{d:`M ${IV} ${dV} Q ${tV} ${kV} ${CV} ${FV}`,stroke:colorMap.schematic.wire,fill:"none","stroke-width":`${getSchStrokeSize(J)}px`,"stroke-linecap":"round"},value:"",children:[]})}if(UV&&(RV.push({name:"path",type:"element",attributes:{d:UV,class:"trace-invisible-hover-outline",stroke:colorMap.schematic.wire,fill:"none","stroke-width":`${getSchStrokeSize(J)*8}px`,"stroke-linecap":"round",opacity:"0","stroke-linejoin":"round"},value:"",children:[]}),RV.push({name:"path",type:"element",attributes:{d:UV,stroke:colorMap.schematic.wire,fill:"none","stroke-width":`${getSchStrokeSize(J)}px`,"stroke-linecap":"round","stroke-linejoin":"round"},value:"",children:[]})),lV.junctions)for(const WV of lV.junctions){const[IV,dV]=applyToPoint(J,[WV.x,WV.y]);RV.push({name:"circle",type:"element",attributes:{cx:IV.toString(),cy:dV.toString(),r:(Math.abs(J.a)*.03).toString(),fill:colorMap.schematic.junction},value:"",children:[]})}return[{name:"g",type:"element",value:"",attributes:{class:"trace"},children:RV}]}var arialTextMetrics={0:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},1:{width:13,height:27,ascent:22,descent:5,left:-3,right:9},2:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},3:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},4:{width:13,height:27,ascent:22,descent:5,left:0,right:12},5:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},6:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},7:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},8:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},9:{width:13,height:27,ascent:22,descent:5,left:-1,right:12}," ":{width:7,height:27,ascent:22,descent:5,left:0,right:0},"!":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},'"':{width:9,height:27,ascent:22,descent:5,left:-1,right:7},"#":{width:13,height:27,ascent:22,descent:5,left:0,right:13},$:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"%":{width:21,height:27,ascent:22,descent:5,left:-1,right:20},"&":{width:16,height:27,ascent:22,descent:5,left:-1,right:15},"'":{width:5,height:27,ascent:22,descent:5,left:-1,right:3},"(":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},")":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"*":{width:9,height:27,ascent:22,descent:5,left:-1,right:8},"+":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},",":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"-":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},".":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"/":{width:7,height:27,ascent:22,descent:5,left:0,right:7},":":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},";":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"<":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},"=":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},">":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},"?":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"@":{width:24,height:27,ascent:22,descent:5,left:-1,right:23},A:{width:16,height:27,ascent:22,descent:5,left:0,right:16},B:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},C:{width:17,height:27,ascent:22,descent:5,left:-1,right:16},D:{width:17,height:27,ascent:22,descent:5,left:-2,right:16},E:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},F:{width:15,height:27,ascent:22,descent:5,left:-2,right:14},G:{width:19,height:27,ascent:22,descent:5,left:-1,right:17},H:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},I:{width:7,height:27,ascent:22,descent:5,left:-2,right:5},J:{width:12,height:27,ascent:22,descent:5,left:-1,right:10},K:{width:16,height:27,ascent:22,descent:5,left:-2,right:16},L:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},M:{width:20,height:27,ascent:22,descent:5,left:-2,right:18},N:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},O:{width:19,height:27,ascent:22,descent:5,left:-1,right:18},P:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},Q:{width:19,height:27,ascent:22,descent:5,left:-1,right:18},R:{width:17,height:27,ascent:22,descent:5,left:-2,right:17},S:{width:16,height:27,ascent:22,descent:5,left:-1,right:15},T:{width:15,height:27,ascent:22,descent:5,left:-1,right:14},U:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},V:{width:16,height:27,ascent:22,descent:5,left:0,right:16},W:{width:23,height:27,ascent:22,descent:5,left:0,right:22},X:{width:16,height:27,ascent:22,descent:5,left:0,right:16},Y:{width:16,height:27,ascent:22,descent:5,left:0,right:16},Z:{width:15,height:27,ascent:22,descent:5,left:0,right:14},"[":{width:7,height:27,ascent:22,descent:5,left:-2,right:6},"\\":{width:7,height:27,ascent:22,descent:5,left:0,right:7},"]":{width:7,height:27,ascent:22,descent:5,left:0,right:5},"^":{width:11,height:27,ascent:22,descent:5,left:-1,right:11},_:{width:13,height:27,ascent:22,descent:5,left:0,right:14},"`":{width:8,height:27,ascent:22,descent:5,left:-1,right:5},a:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},b:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},c:{width:12,height:27,ascent:22,descent:5,left:-1,right:12},d:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},e:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},f:{width:7,height:27,ascent:22,descent:5,left:0,right:8},g:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},h:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},i:{width:5,height:27,ascent:22,descent:5,left:-2,right:4},j:{width:5,height:27,ascent:22,descent:5,left:1,right:4},k:{width:12,height:27,ascent:22,descent:5,left:-2,right:12},l:{width:5,height:27,ascent:22,descent:5,left:-2,right:4},m:{width:20,height:27,ascent:22,descent:5,left:-2,right:18},n:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},o:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},p:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},q:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},r:{width:8,height:27,ascent:22,descent:5,left:-2,right:8},s:{width:12,height:27,ascent:22,descent:5,left:-1,right:11},t:{width:7,height:27,ascent:22,descent:5,left:0,right:6},u:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},v:{width:12,height:27,ascent:22,descent:5,left:0,right:12},w:{width:17,height:27,ascent:22,descent:5,left:0,right:17},x:{width:12,height:27,ascent:22,descent:5,left:0,right:12},y:{width:12,height:27,ascent:22,descent:5,left:0,right:12},z:{width:12,height:27,ascent:22,descent:5,left:0,right:11},"{":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"|":{width:6,height:27,ascent:22,descent:5,left:-2,right:4},"}":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"~":{width:14,height:27,ascent:22,descent:5,left:-1,right:13}},estimateTextWidth=lV=>{if(!lV)return 0;let J=0;for(const VV of lV){const RV=arialTextMetrics[VV];RV?J+=RV.width:J+=arialTextMetrics["?"].width}return J/27},ARROW_POINT_WIDTH_FSR=.3,END_PADDING_FSR=.3,END_PADDING_EXTRA_PER_CHARACTER_FSR=.06,createSvgObjectsForSchNetLabel=(lV,J)=>{if(!lV.text)return[];const VV=[],RV=getSchScreenFontSize(J,"net_label"),UV=getSchMmFontSize("net_label"),ZV=estimateTextWidth(lV.text||""),WV=applyToPoint(J,lV.center),IV=getUnitVectorFromOutsideToEdge(lV.anchor_side),dV={...IV};dV.y*=-1;const CV=ZV+ARROW_POINT_WIDTH_FSR*2+END_PADDING_EXTRA_PER_CHARACTER_FSR*lV.text.length+END_PADDING_FSR,FV=lV.anchor_position?applyToPoint(J,lV.anchor_position):{x:WV.x-dV.x*CV*RV/2,y:WV.y-dV.y*CV*RV/2},NV=lV.anchor_position??{x:lV.center.x-IV.x*CV*UV/2,y:lV.center.y-IV.y*CV*UV/2},eV={left:0,top:-90,bottom:90,right:180}[lV.anchor_side],gV=[{x:0,y:0},{x:ARROW_POINT_WIDTH_FSR,y:.6},{x:ARROW_POINT_WIDTH_FSR*2+END_PADDING_FSR+END_PADDING_EXTRA_PER_CHARACTER_FSR*lV.text.length+ZV,y:.6},{x:ARROW_POINT_WIDTH_FSR*2+END_PADDING_FSR+END_PADDING_EXTRA_PER_CHARACTER_FSR*lV.text.length+ZV,y:-.6},{x:ARROW_POINT_WIDTH_FSR,y:-.6}].map(YV=>applyToPoint(compose(J,translate(NV.x,NV.y),scale$2(UV),rotate(eV/180*Math.PI)),YV)),nV=`
|
|
22422
|
+
`}]},{name:"rect",type:"element",attributes:{class:"boundary",x:"0",y:"0",width:CV.toString(),height:FV.toString()}},createSvgObjectFromPcbBoundary(GV,VV,RV,UV,ZV),...YV].filter(MV=>MV!==null)};try{return stringify(tV)}catch(MV){throw console.error("Error stringifying SVG object:",MV),MV}function kV(MV,xV,uV){const wV=xV/2,vV=uV/2;VV=Math.min(VV,MV.x-wV),RV=Math.min(RV,MV.y-vV),UV=Math.max(UV,MV.x+wV),ZV=Math.max(ZV,MV.y+vV)}function AV(MV){for(const xV of MV)VV=Math.min(VV,xV.x),RV=Math.min(RV,xV.y),UV=Math.max(UV,xV.x),ZV=Math.max(ZV,xV.y)}function XV(MV){for(const xV of MV)VV=Math.min(VV,xV.x),RV=Math.min(RV,xV.y),UV=Math.max(UV,xV.x),ZV=Math.max(ZV,xV.y)}}function createSvgObjects(lV,J,VV,RV){switch(lV.type){case"pcb_trace_error":return createSvgObjectsFromPcbTraceError(lV,J,VV,RV).filter(Boolean);case"pcb_component":return[createSvgObjectsFromPcbComponent(lV,J)].filter(Boolean);case"pcb_trace":return createSvgObjectsFromPcbTrace(lV,J);case"pcb_plated_hole":return createSvgObjectsFromPcbPlatedHole(lV,J).filter(Boolean);case"pcb_hole":return createSvgObjectsFromPcbHole(lV,J);case"pcb_smtpad":return createSvgObjectsFromSmtPad(lV,J);case"pcb_silkscreen_text":return createSvgObjectsFromPcbSilkscreenText(lV,J);case"pcb_fabrication_note_path":return createSvgObjectsFromPcbFabricationNotePath(lV,J);case"pcb_fabrication_note_text":return createSvgObjectsFromPcbFabricationNoteText(lV,J);case"pcb_silkscreen_path":return createSvgObjectsFromPcbSilkscreenPath(lV,J);case"pcb_board":return createSvgObjectsFromPcbBoard(lV,J);case"pcb_via":return createSvgObjectsFromPcbVia(lV,J);default:return[]}}function createSvgObjectsFromPcbComponent(lV,J){const{center:VV,width:RV,height:UV,rotation:ZV=0}=lV,[WV,IV]=applyToPoint(J,[VV.x,VV.y]),dV=RV*Math.abs(J.a),CV=UV*Math.abs(J.d);return{name:"g",type:"element",attributes:{transform:`translate(${WV}, ${IV}) rotate(${-ZV}) scale(1, -1)`},children:[{name:"rect",type:"element",attributes:{class:"pcb-component",x:(-dV/2).toString(),y:(-CV/2).toString(),width:dV.toString(),height:CV.toString()}},{name:"rect",type:"element",attributes:{class:"pcb-component-outline",x:(-dV/2).toString(),y:(-CV/2).toString(),width:dV.toString(),height:CV.toString()}}]}}function createSvgObjectFromPcbBoundary(lV,J,VV,RV,UV){const[ZV,WV]=applyToPoint(lV,[J,VV]),[IV,dV]=applyToPoint(lV,[RV,UV]),CV=Math.abs(IV-ZV),FV=Math.abs(dV-WV),NV=Math.min(ZV,IV),eV=Math.min(WV,dV);return{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-boundary",x:NV.toString(),y:eV.toString(),width:CV.toString(),height:FV.toString()}}}var circuitJsonToPcbSvg=convertCircuitJsonToPcbSvg,DEFAULT_BOARD_STYLE={fill:"none",stroke:"rgb(0,0,0)",strokeOpacity:"0.8",strokeWidthFactor:.2};function createSvgObjectsFromAssemblyBoard(lV,J,VV={}){const{width:RV,height:UV,center:ZV,outline:WV}=lV;let IV;if(WV&&Array.isArray(WV)&&WV.length>=3)IV=WV.map((dV,CV)=>{const[FV,NV]=applyToPoint(J,[dV.x,dV.y]);return CV===0?`M ${FV} ${NV}`:`L ${FV} ${NV}`}).join(" ");else{const dV=RV/2,CV=UV/2,FV=applyToPoint(J,[ZV.x-dV,ZV.y-CV]),NV=applyToPoint(J,[ZV.x+dV,ZV.y-CV]),eV=applyToPoint(J,[ZV.x+dV,ZV.y+CV]),gV=applyToPoint(J,[ZV.x-dV,ZV.y+CV]);IV=`M ${FV[0]} ${FV[1]} L ${NV[0]} ${NV[1]} L ${eV[0]} ${eV[1]} L ${gV[0]} ${gV[1]}`}return IV+=" Z",[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board",d:IV,fill:VV.fill??DEFAULT_BOARD_STYLE.fill,stroke:VV.stroke??DEFAULT_BOARD_STYLE.stroke,"stroke-opacity":VV.strokeOpacity??DEFAULT_BOARD_STYLE.strokeOpacity,"stroke-width":((VV.strokeWidthFactor??DEFAULT_BOARD_STYLE.strokeWidthFactor)*Math.abs(J.a)).toString()}}]}var getSchMmFontSize=lV=>lV==="error"?.05:lV==="pin_number"?.15:.18,getSchScreenFontSize=(lV,J)=>Math.abs(lV.a)*getSchMmFontSize(J);function createSvgObjectsFromAssemblyComponent(lV,J,VV,RV){const{center:UV,width:ZV,height:WV,rotation:IV=0}=lV,[dV,CV]=applyToPoint(J,[UV.x,UV.y]),[FV,NV]=applyToPoint(J,[VV.x,VV.y]),eV=ZV*Math.abs(J.a),gV=WV*Math.abs(J.d);return{name:"g",type:"element",value:"",attributes:{transform:`translate(${dV}, ${CV}) rotate(${-IV}) scale(1, -1)`},children:[createComponentPath(eV,gV,dV,CV,FV,NV,IV),createComponentLabel(eV,gV,RV??"",J)]}}function createComponentPath(lV,J,VV,RV,UV,ZV,WV){const IV=lV/2,dV=J/2,CV=Math.min(IV,dV)*.3,FV=ZV>RV,NV=UV<VV;return{name:"path",type:"element",attributes:{class:"assembly-component",d:getComponentPathData(IV,dV,CV,FV,NV,WV)},value:"",children:[]}}function createComponentLabel(lV,J,VV,RV){const UV=Math.min(lV,J)*.4,ZV=getSchScreenFontSize(RV,"net_label")*(UV/2.5),WV=UV<25?ZV:ZV*.6;return{name:"text",type:"element",attributes:{x:"0",y:`${0+WV/8}`,class:"assembly-component-label","text-anchor":"middle","dominant-baseline":"middle","font-size":`${WV}px`,transform:"scale(1, -1)"},children:[{type:"text",value:VV||"",name:"",attributes:{},children:[]}],value:""}}function getComponentPathData(lV,J,VV,RV,UV,ZV){const WV=(FV,NV,eV)=>{const gV=Math.PI/180*eV,nV=Math.cos(gV),JV=Math.sin(gV);return[FV*nV-NV*JV,FV*JV+NV*nV]};let IV;return RV&&UV?IV=[[-lV,-J+VV],[-lV+VV,-J],[lV,-J],[lV,J],[-lV,J]]:RV&&!UV?IV=[[-lV,-J],[lV-VV,-J],[lV,-J+VV],[lV,J],[-lV,J]]:!RV&&UV?IV=[[-lV,-J],[lV,-J],[lV,J],[-lV+VV,J],[-lV,J-VV]]:IV=[[-lV,-J],[lV,-J],[lV,J-VV],[lV-VV,J],[-lV,J]],`${IV.map(([FV,NV])=>WV(FV,NV,ZV)).map(([FV,NV],eV)=>eV===0?`M${FV},${NV}`:`L${FV},${NV}`).join(" ")} Z`}var OBJECT_ORDER2=["pcb_board","pcb_component"];function convertCircuitJsonToAssemblySvg(lV,J){let VV=Number.POSITIVE_INFINITY,RV=Number.POSITIVE_INFINITY,UV=Number.NEGATIVE_INFINITY,ZV=Number.NEGATIVE_INFINITY;for(const tV of lV)if(tV.type==="pcb_board"){const kV=tV.center,AV=tV.width||0,XV=tV.height||0;VV=Math.min(VV,kV.x-AV/2),RV=Math.min(RV,kV.y-XV/2),UV=Math.max(UV,kV.x+AV/2),ZV=Math.max(ZV,kV.y+XV/2)}const WV=1,IV=UV-VV+2*WV,dV=ZV-RV+2*WV,CV=(J==null?void 0:J.width)??800,FV=(J==null?void 0:J.height)??600,NV=CV/IV,eV=FV/dV,gV=Math.min(NV,eV),nV=(CV-IV*gV)/2,JV=(FV-dV*gV)/2,aV=compose(translate(nV-VV*gV+WV*gV,FV-JV+RV*gV-WV*gV),scale$2(gV,-gV)),GV=lV.sort((tV,kV)=>(OBJECT_ORDER2.indexOf(kV.type)??9999)-(OBJECT_ORDER2.indexOf(tV.type)??9999)).flatMap(tV=>createSvgObjects2(tV,aV,lV)),YV={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:CV.toString(),height:FV.toString()},value:"",children:[{name:"style",type:"element",children:[{type:"text",value:`
|
|
22423
|
+
.assembly-component { fill: #fff; stroke: #000; stroke-width: 3; }
|
|
22424
|
+
.assembly-board { fill: #f2f2f2; stroke: rgb(0,0,0); stroke-opacity: 0.8; }
|
|
22425
|
+
.assembly-component-label {
|
|
22426
|
+
fill: #000;
|
|
22427
|
+
font-family: Arial, serif;
|
|
22428
|
+
font-weight: bold;
|
|
22429
|
+
}
|
|
22430
|
+
.assembly-boundary { fill: none; stroke: #fff; stroke-width: 0.3; }
|
|
22431
|
+
`,name:"",attributes:{},children:[]}],value:"",attributes:{}},{name:"rect",type:"element",attributes:{fill:"#fff",x:"0",y:"0",width:CV.toString(),height:FV.toString()},value:"",children:[]},createSvgObjectFromAssemblyBoundary(aV,VV,RV,UV,ZV),...GV].filter(tV=>tV!==null)};return stringify(YV)}function createSvgObjects2(lV,J,VV){const RV=su_default(VV).source_component.list();switch(lV.type){case"pcb_board":return createSvgObjectsFromAssemblyBoard(lV,J);case"pcb_component":{const UV=RV.find(IV=>IV.source_component_id===lV.source_component_id),WV=su_default(VV).pcb_port.list().filter(IV=>IV.pcb_component_id===lV.pcb_component_id)[0];return UV&&WV?[createSvgObjectsFromAssemblyComponent(lV,J,{x:WV.x,y:WV.y},UV.name)].filter(Boolean):[]}default:return[]}}function createSvgObjectFromAssemblyBoundary(lV,J,VV,RV,UV){const[ZV,WV]=applyToPoint(lV,[J,VV]),[IV,dV]=applyToPoint(lV,[RV,UV]),CV=Math.abs(IV-ZV),FV=Math.abs(dV-WV),NV=Math.min(ZV,IV),eV=Math.min(WV,dV);return{name:"rect",type:"element",value:"",children:[],attributes:{class:"assembly-boundary",x:NV.toString(),y:eV.toString(),width:CV.toString(),height:FV.toString()}}}var colorMap={"3d_viewer":{background_bottom:"rgb(102, 102, 128)",background_top:"rgb(204, 204, 230)",board:"rgb(51, 43, 23)",copper:"rgb(179, 156, 0)",silkscreen_bottom:"rgb(230, 230, 230)",silkscreen_top:"rgb(230, 230, 230)",soldermask:"rgb(20, 51, 36)",solderpaste:"rgb(128, 128, 128)"},board:{anchor:"rgb(255, 38, 226)",aux_items:"rgb(255, 255, 255)",b_adhes:"rgb(0, 0, 132)",b_crtyd:"rgb(255, 38, 226)",b_fab:"rgb(88, 93, 132)",b_mask:"rgba(2, 255, 238, 0.400)",b_paste:"rgb(0, 194, 194)",b_silks:"rgb(232, 178, 167)",background:"rgb(0, 16, 35)",cmts_user:"rgb(89, 148, 220)",copper:{b:"rgb(77, 127, 196)",f:"rgb(200, 52, 52)",in1:"rgb(127, 200, 127)",in10:"rgb(237, 124, 51)",in11:"rgb(91, 195, 235)",in12:"rgb(247, 111, 142)",in13:"rgb(167, 165, 198)",in14:"rgb(40, 204, 217)",in15:"rgb(232, 178, 167)",in16:"rgb(242, 237, 161)",in17:"rgb(237, 124, 51)",in18:"rgb(91, 195, 235)",in19:"rgb(247, 111, 142)",in2:"rgb(206, 125, 44)",in20:"rgb(167, 165, 198)",in21:"rgb(40, 204, 217)",in22:"rgb(232, 178, 167)",in23:"rgb(242, 237, 161)",in24:"rgb(237, 124, 51)",in25:"rgb(91, 195, 235)",in26:"rgb(247, 111, 142)",in27:"rgb(167, 165, 198)",in28:"rgb(40, 204, 217)",in29:"rgb(232, 178, 167)",in3:"rgb(79, 203, 203)",in30:"rgb(242, 237, 161)",in4:"rgb(219, 98, 139)",in5:"rgb(167, 165, 198)",in6:"rgb(40, 204, 217)",in7:"rgb(232, 178, 167)",in8:"rgb(242, 237, 161)",in9:"rgb(141, 203, 129)"},cursor:"rgb(255, 255, 255)",drc:"rgb(194, 194, 194)",drc_error:"rgba(215, 91, 107, 0.800)",drc_exclusion:"rgb(255, 255, 255)",drc_warning:"rgba(255, 208, 66, 0.902)",dwgs_user:"rgb(194, 194, 194)",eco1_user:"rgb(180, 219, 210)",eco2_user:"rgb(216, 200, 82)",edge_cuts:"rgb(208, 210, 205)",f_adhes:"rgb(132, 0, 132)",f_crtyd:"rgb(255, 0, 245)",f_fab:"rgb(175, 175, 175)",f_mask:"rgba(216, 100, 255, 0.400)",f_paste:"rgba(180, 160, 154, 0.902)",f_silks:"rgb(242, 237, 161)",footprint_text_back:"rgb(0, 0, 132)",footprint_text_front:"rgb(194, 194, 194)",footprint_text_invisible:"rgb(132, 132, 132)",grid:"rgb(132, 132, 132)",grid_axes:"rgb(194, 194, 194)",margin:"rgb(255, 38, 226)",microvia:"rgb(0, 132, 132)",no_connect:"rgb(0, 0, 132)",pad_back:"rgb(77, 127, 196)",pad_front:"rgb(200, 52, 52)",pad_plated_hole:"rgb(194, 194, 0)",pad_through_hole:"rgb(227, 183, 46)",plated_hole:"rgb(26, 196, 210)",ratsnest:"rgba(245, 255, 213, 0.702)",select_overlay:"rgb(4, 255, 67)",through_via:"rgb(236, 236, 236)",user_1:"rgb(194, 194, 194)",user_2:"rgb(89, 148, 220)",user_3:"rgb(180, 219, 210)",user_4:"rgb(216, 200, 82)",user_5:"rgb(194, 194, 194)",user_6:"rgb(89, 148, 220)",user_7:"rgb(180, 219, 210)",user_8:"rgb(216, 200, 82)",user_9:"rgb(232, 178, 167)",via_blind_buried:"rgb(187, 151, 38)",via_hole:"rgb(227, 183, 46)",via_micro:"rgb(0, 132, 132)",via_through:"rgb(236, 236, 236)",worksheet:"rgb(200, 114, 171)"},gerbview:{axes:"rgb(0, 0, 132)",background:"rgb(0, 0, 0)",dcodes:"rgb(255, 255, 255)",grid:"rgb(132, 132, 132)",layers:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)"],negative_objects:"rgb(132, 132, 132)",worksheet:"rgb(0, 0, 132)"},meta:{filename:"kicad_2020",name:"KiCad 2020",version:2},palette:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)"],schematic:{aux_items:"rgb(46, 46, 46)",background:"rgb(245, 241, 237)",brightened:"rgb(255, 0, 255)",bus:"rgb(0, 0, 132)",bus_junction:"rgb(0, 0, 132)",component_body:"rgb(255, 255, 194)",component_outline:"rgb(132, 0, 0)",cursor:"rgb(15, 15, 15)",erc_error:"rgba(230, 9, 13, 0.800)",erc_warning:"rgba(209, 146, 0, 0.800)",fields:"rgb(132, 0, 132)",grid:"rgb(181, 181, 181)",grid_axes:"rgb(0, 0, 132)",hidden:"rgb(194, 194, 194)",junction:"rgb(0, 150, 0)",label_global:"rgb(132, 0, 0)",label_hier:"rgb(114, 86, 0)",label_local:"rgb(15, 15, 15)",net_name:"rgb(132, 132, 132)",no_connect:"rgb(0, 0, 132)",note:"rgb(0, 0, 194)",override_item_colors:!1,pin:"rgb(132, 0, 0)",pin_name:"rgb(0, 100, 100)",pin_number:"rgb(169, 0, 0)",reference:"rgb(0, 100, 100)",shadow:"rgba(102, 179, 255, 0.800)",sheet:"rgb(132, 0, 0)",sheet_background:"rgba(253, 255, 231, 0.000)",sheet_fields:"rgb(132, 0, 132)",sheet_filename:"rgb(114, 86, 0)",sheet_label:"rgb(0, 100, 100)",sheet_name:"rgb(0, 100, 100)",value:"rgb(0, 100, 100)",wire:"rgb(0, 150, 0)",wire_crossing:"rgb(30, 180, 30)",worksheet:"rgb(132, 0, 0)"}};function drawSchematicGrid(lV){const{minX:J,minY:VV,maxX:RV,maxY:UV}=lV.bounds,ZV=lV.cellSize??1,WV=lV.labelCells??!1,IV=[],dV=(CV,FV)=>{const[NV,eV]=applyToPoint(lV.transform,[CV,FV]);return{x:NV,y:eV}};for(let CV=Math.floor(J);CV<=Math.ceil(RV);CV+=ZV){const FV=dV(CV,VV),NV=dV(CV,UV);IV.push({name:"line",type:"element",attributes:{x1:FV.x.toString(),y1:FV.y.toString(),x2:NV.x.toString(),y2:NV.y.toString(),stroke:colorMap.schematic.grid,"stroke-width":(.01*Math.abs(lV.transform.a)).toString(),"stroke-opacity":"0.5"}})}for(let CV=Math.floor(VV);CV<=Math.ceil(UV);CV+=ZV){const FV=dV(J,CV),NV=dV(RV,CV);IV.push({name:"line",type:"element",attributes:{x1:FV.x.toString(),y1:FV.y.toString(),x2:NV.x.toString(),y2:NV.y.toString(),stroke:colorMap.schematic.grid,"stroke-width":(.01*Math.abs(lV.transform.a)).toString(),"stroke-opacity":"0.5"}})}if(WV){const CV=(FV,NV)=>ZV<=.1?`${FV.toFixed(1)},${NV.toFixed(1)}`:`${FV},${NV}`;for(let FV=Math.floor(J);FV<=Math.ceil(RV);FV+=ZV)for(let NV=Math.floor(VV);NV<=Math.ceil(UV);NV+=ZV){const eV=dV(FV,NV);IV.push({name:"text",type:"element",attributes:{x:(eV.x-2.5).toString(),y:(eV.y-5).toString(),fill:colorMap.schematic.grid,"font-size":(ZV/5*Math.abs(lV.transform.a)).toString(),"fill-opacity":"0.5","text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif"},children:[{type:"text",value:CV(FV,NV),name:"",attributes:{},children:[]}]})}}return{name:"g",value:"",type:"element",attributes:{class:"grid"},children:IV}}function drawSchematicLabeledPoints(lV){const{points:J,transform:VV}=lV,RV=[];for(const UV of J){const[ZV,WV]=applyToPoint(VV,[UV.x-.1,UV.y-.1]),[IV,dV]=applyToPoint(VV,[UV.x+.1,UV.y+.1]),[CV,FV]=applyToPoint(VV,[UV.x-.1,UV.y+.1]),[NV,eV]=applyToPoint(VV,[UV.x+.1,UV.y-.1]);RV.push({name:"path",type:"element",attributes:{d:`M${ZV},${WV} L${IV},${dV} M${CV},${FV} L${NV},${eV}`,stroke:colorMap.schematic.grid,"stroke-width":(.02*Math.abs(VV.a)).toString(),"stroke-opacity":"0.7"}});const[gV,nV]=applyToPoint(VV,[UV.x+.15,UV.y-.15]);RV.push({name:"text",type:"element",attributes:{x:gV.toString(),y:nV.toString(),fill:colorMap.schematic.grid,"font-size":(.1*Math.abs(VV.a)).toString(),"fill-opacity":"0.7","text-anchor":"start","font-family":"sans-serif","dominant-baseline":"middle"},children:[{type:"text",value:UV.label||`(${UV.x},${UV.y})`,name:"",attributes:{},children:[]}]})}return{name:"g",value:"",type:"element",attributes:{class:"labeled-points"},children:RV}}function getSchematicBoundsFromCircuitJson(lV,J=.5){let VV=Number.POSITIVE_INFINITY,RV=Number.POSITIVE_INFINITY,UV=Number.NEGATIVE_INFINITY,ZV=Number.NEGATIVE_INFINITY;const WV=.2;for(const dV of lV)if(dV.type==="schematic_component")IV(dV.center,dV.size,dV.rotation||0);else if(dV.type==="schematic_port")IV(dV.center,{width:WV,height:WV},0);else if(dV.type==="schematic_debug_object")dV.shape==="rect"?IV(dV.center,dV.size,0):dV.shape==="line"&&(IV(dV.start,{width:.1,height:.1},0),IV(dV.end,{width:.1,height:.1},0));else if(dV.type==="schematic_net_label")IV(dV.center,{width:1,height:1},0);else if(dV.type==="schematic_trace")for(const CV of dV.edges)IV(CV.from,{width:.1,height:.1},0),IV(CV.to,{width:.1,height:.1},0);else dV.type==="schematic_text"?IV(dV.position,{width:.1,height:.1},0):dV.type==="schematic_voltage_probe"&&IV(dV.position,{width:.2,height:.4},0);return VV-=J,RV-=J,UV+=J,ZV+=J,{minX:VV,minY:RV,maxX:UV,maxY:ZV};function IV(dV,CV,FV){const NV=[{x:-CV.width/2,y:-CV.height/2},{x:CV.width/2,y:-CV.height/2},{x:CV.width/2,y:CV.height/2},{x:-CV.width/2,y:CV.height/2}];for(const eV of NV){const gV=eV.x*Math.cos(FV)-eV.y*Math.sin(FV)+dV.x,nV=eV.x*Math.sin(FV)+eV.y*Math.cos(FV)+dV.y;VV=Math.min(VV,gV),RV=Math.min(RV,nV),UV=Math.max(UV,gV),ZV=Math.max(ZV,nV)}}}var getSchStrokeSize=lV=>Math.abs(lV.a)*.02,getAngularDifference=(lV,J)=>{const VV=lV<0?lV+2*Math.PI:lV,RV=J<0?J+2*Math.PI:J;let UV=Math.abs(VV-RV);return UV>Math.PI&&(UV=2*Math.PI-UV),UV},matchSchPortsToSymbolPorts=({schPorts:lV,symbol:J,schComponent:VV})=>{const RV=lV.map(IV=>{const dV=IV.center.x-VV.center.x,CV=IV.center.y-VV.center.y;return{port:IV,angle:Math.atan2(CV,dV)}}),UV=J.ports.map(IV=>{const dV=IV.x-J.center.x,CV=IV.y-J.center.y;return{port:IV,angle:Math.atan2(CV,dV)}});RV.sort((IV,dV)=>IV.angle-dV.angle),UV.sort((IV,dV)=>IV.angle-dV.angle);const ZV=[],WV=new Set;for(const IV of RV){let dV=null;for(const CV of UV){if(WV.has(CV.port))continue;const FV=getAngularDifference(IV.angle,CV.angle);(dV===null||FV<dV.angleDiff)&&(dV={symbolPort:CV.port,angleDiff:FV})}dV&&dV.angleDiff<Math.PI/4&&(ZV.push({schPort:IV.port,symbolPort:dV.symbolPort}),WV.add(dV.symbolPort))}return ZV};function pointPairsToMatrix(lV,J,VV,RV){const UV=J.x-lV.x,ZV=J.y-lV.y,WV=Math.sqrt((VV.x-lV.x)**2+(VV.y-lV.y)**2),dV=Math.sqrt((RV.x-J.x)**2+(RV.y-J.y)**2)/WV,CV=translate(UV,ZV),FV=scale$2(dV,dV);return compose(CV,FV)}var createSvgSchErrorText=({text:lV,realCenter:J,realToScreenTransform:VV})=>{const RV=applyToPoint(VV,J);return{type:"element",name:"text",value:"",attributes:{x:RV.x.toString(),y:RV.y.toString(),fill:"red","text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif","font-size":`${getSchScreenFontSize(VV,"error")}px`},children:[{type:"text",value:lV,name:"",attributes:{},children:[]}]}},ninePointAnchorToTextAnchor={top_left:"start",top_right:"end",middle_left:"start",middle_right:"end",bottom_left:"start",bottom_right:"end",center:"middle",middle_top:"middle",middle_bottom:"middle"},ninePointAnchorToDominantBaseline={top_left:"auto",top_right:"auto",bottom_left:"hanging",bottom_right:"hanging",center:"auto",middle_left:"middle",middle_right:"middle",middle_top:"auto",middle_bottom:"hanging"},createSvgObjectsFromSchematicComponentWithSymbol=({component:lV,transform:J,circuitJson:VV})=>{var AV,XV;const RV=[],UV=symbols_index_default[lV.symbol_name];if(!UV)return[createSvgSchErrorText({text:`Symbol not found: ${lV.symbol_name}`,realCenter:lV.center,realToScreenTransform:J})];const ZV=su_default(VV).schematic_port.list({schematic_component_id:lV.schematic_component_id}),WV=su_default(VV).source_component.get(lV.source_component_id),IV=matchSchPortsToSymbolPorts({schPorts:ZV,symbol:UV,schComponent:lV});if(!IV[0])return[createSvgSchErrorText({text:`Could not match ports for symbol ${lV.symbol_name}`,realCenter:lV.center,realToScreenTransform:J})];const dV=pointPairsToMatrix(((AV=IV[1])==null?void 0:AV.symbolPort)??UV.center,((XV=IV[1])==null?void 0:XV.schPort.center)??lV.center,IV[0].symbolPort,IV[0].schPort.center),CV=UV.primitives.filter(MV=>MV.type==="path"),FV=UV.primitives.filter(MV=>MV.type==="text");UV.primitives.filter(MV=>MV.type==="circle");const NV=UV.primitives.filter(MV=>MV.type==="box"),eV={minX:Math.min(...CV.flatMap(MV=>MV.points.map(xV=>xV.x))),maxX:Math.max(...CV.flatMap(MV=>MV.points.map(xV=>xV.x))),minY:Math.min(...CV.flatMap(MV=>MV.points.map(xV=>xV.y))),maxY:Math.max(...CV.flatMap(MV=>MV.points.map(xV=>xV.y)))},[gV,nV]=applyToPoint(compose(J,dV),[eV.minX,eV.minY]),[JV,aV]=applyToPoint(compose(J,dV),[eV.maxX,eV.maxY]),GV=Math.abs(aV-nV),YV=Math.min(nV,aV),tV=Math.abs(JV-gV),kV=Math.min(gV,JV);RV.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay",x:kV.toString(),y:YV.toString(),width:tV.toString(),height:GV.toString(),fill:"transparent"},children:[]});for(const MV of CV){const{points:xV,color:uV,closed:wV,fill:vV}=MV;RV.push({type:"element",name:"path",attributes:{d:xV.map((yV,ll)=>{const[Nl,al]=applyToPoint(compose(J,dV),[yV.x,yV.y]);return`${ll===0?"M":"L"} ${Nl} ${al}`}).join(" ")+(wV?" Z":""),stroke:colorMap.schematic.component_outline,fill:"none","stroke-width":`${getSchStrokeSize(J)}px`},value:"",children:[]})}for(const MV of FV){const xV=applyToPoint(compose(J,dV),MV);let uV="";MV.text==="{REF}"?uV=(WV==null?void 0:WV.name)??"":MV.text==="{VAL}"&&(uV=lV.symbol_display_value??""),RV.push({name:"text",type:"element",attributes:{x:xV.x.toString(),y:xV.y.toString(),"dominant-baseline":ninePointAnchorToDominantBaseline[MV.anchor],"text-anchor":ninePointAnchorToTextAnchor[MV.anchor],"font-family":"sans-serif","font-size":`${getSchScreenFontSize(J,"reference_designator")}px`},value:"",children:[{type:"text",value:uV,name:"",attributes:{},children:[]}]})}for(const MV of NV){const xV=applyToPoint(compose(J,dV),MV),uV=compose(J,dV).a;RV.push({name:"rect",type:"element",attributes:{x:xV.x.toString(),y:xV.y.toString(),width:(MV.width*uV).toString(),height:(MV.height*uV).toString(),fill:"red"},value:"",children:[]})}for(const MV of UV.ports){const xV=applyToPoint(compose(J,dV),MV);RV.push({type:"element",name:"circle",attributes:{cx:xV.x.toString(),cy:xV.y.toString(),r:`${Math.abs(J.a)*.02}px`,"stroke-width":`${getSchStrokeSize(J)}px`,fill:"none",stroke:colorMap.schematic.component_outline},value:"",children:[]})}return RV},PIN_CIRCLE_RADIUS_MM=.02,createSvgObjectsForSchPortBoxLine=({schPort:lV,schComponent:J,transform:VV,circuitJson:RV})=>{const UV=[];su_default(RV).source_port.get(lV.source_port_id);const ZV={x:lV.center.x,y:lV.center.y},WV=lV.distance_from_component_edge??.4;switch(lV.side_of_component){case"left":ZV.x+=WV;break;case"right":ZV.x-=WV;break;case"top":ZV.y-=WV;break;case"bottom":ZV.y+=WV;break}const IV=applyToPoint(VV,lV.center),dV=applyToPoint(VV,ZV),CV={...lV.center};switch(lV.side_of_component){case"left":CV.x+=PIN_CIRCLE_RADIUS_MM;break;case"right":CV.x-=PIN_CIRCLE_RADIUS_MM;break;case"top":CV.y-=PIN_CIRCLE_RADIUS_MM;break;case"bottom":CV.y+=PIN_CIRCLE_RADIUS_MM;break}const FV=applyToPoint(VV,CV);return UV.push({name:"line",type:"element",attributes:{class:"component-pin",x1:FV.x.toString(),y1:FV.y.toString(),x2:dV.x.toString(),y2:dV.y.toString(),"stroke-width":`${getSchStrokeSize(VV)}px`},value:"",children:[]}),UV.push({name:"circle",type:"element",attributes:{class:"component-pin",cx:IV.x.toString(),cy:IV.y.toString(),r:(Math.abs(VV.a)*PIN_CIRCLE_RADIUS_MM).toString(),"stroke-width":`${getSchStrokeSize(VV)}px`},value:"",children:[]}),UV},getUnitVectorFromOutsideToEdge=lV=>{switch(lV){case"top":return{x:0,y:-1};case"bottom":return{x:0,y:1};case"left":return{x:1,y:0};case"right":return{x:-1,y:0}}throw new Error(`Invalid side: ${lV}`)},createSvgObjectsForSchPortPinNumberText=lV=>{var FV;const J=[],{schPort:VV,schComponent:RV,transform:UV,circuitJson:ZV}=lV,WV={x:VV.center.x,y:VV.center.y};if(!VV.side_of_component)return[];const IV=getUnitVectorFromOutsideToEdge(VV.side_of_component),dV=VV.distance_from_component_edge??.4;WV.x+=IV.x*dV/2,WV.y+=IV.y*dV/2,VV.side_of_component==="top"||VV.side_of_component==="bottom"?WV.x-=.02:WV.y+=.02;const CV=applyToPoint(UV,WV);return J.push({name:"text",type:"element",attributes:{class:"pin-number",x:CV.x.toString(),y:CV.y.toString(),style:"font-family: sans-serif;",fill:colorMap.schematic.pin_number,"text-anchor":"middle","dominant-baseline":"auto","font-size":`${getSchScreenFontSize(UV,"pin_number")}px`,transform:VV.side_of_component==="top"||VV.side_of_component==="bottom"?`rotate(-90 ${CV.x} ${CV.y})`:""},children:[{type:"text",value:((FV=VV.pin_number)==null?void 0:FV.toString())||"",name:"",attributes:{},children:[]}],value:""}),J},LABEL_DIST_FROM_EDGE_MM=.1,createSvgObjectsForSchPortPinLabel=lV=>{var NV;const J=[],{schPort:VV,schComponent:RV,transform:UV,circuitJson:ZV}=lV,WV={x:VV.center.x,y:VV.center.y};if(!VV.side_of_component)return[];const IV=getUnitVectorFromOutsideToEdge(VV.side_of_component),dV=VV.distance_from_component_edge??.4;WV.x+=IV.x*(dV+LABEL_DIST_FROM_EDGE_MM),WV.y+=IV.y*(dV+LABEL_DIST_FROM_EDGE_MM);const CV=applyToPoint(UV,WV),FV=VV.display_pin_label??((NV=RV.port_labels)==null?void 0:NV[`${VV.pin_number}`]);return FV?(J.push({name:"text",type:"element",attributes:{class:"pin-number",x:CV.x.toString(),y:CV.y.toString(),style:"font-family: sans-serif;",fill:colorMap.schematic.pin_number,"text-anchor":VV.side_of_component==="left"||VV.side_of_component==="bottom"?"start":"end","dominant-baseline":"middle","font-size":`${getSchScreenFontSize(UV,"pin_number")}px`,transform:VV.side_of_component==="top"||VV.side_of_component==="bottom"?`rotate(-90 ${CV.x} ${CV.y})`:""},children:[{type:"text",value:FV||"",name:"",attributes:{},children:[]}],value:""}),J):[]},createSvgObjectsFromSchPortOnBox=lV=>{const J=[];return J.push(...createSvgObjectsForSchPortBoxLine(lV)),J.push(...createSvgObjectsForSchPortPinNumberText(lV)),J.push(...createSvgObjectsForSchPortPinLabel(lV)),J},createSvgObjectsFromSchematicComponentWithBox=({component:lV,transform:J,circuitJson:VV})=>{const RV=[],UV=applyToPoint(J,{x:lV.center.x-lV.size.width/2,y:lV.center.y+lV.size.height/2}),ZV=applyToPoint(J,{x:lV.center.x+lV.size.width/2,y:lV.center.y-lV.size.height/2}),WV=ZV.x-UV.x,IV=ZV.y-UV.y;RV.push({name:"rect",type:"element",value:"",attributes:{class:"component chip",x:UV.x.toString(),y:UV.y.toString(),width:WV.toString(),height:IV.toString(),"stroke-width":`${getSchStrokeSize(J)}px`,fill:colorMap.schematic.component_body,stroke:colorMap.schematic.component_outline},children:[]}),RV.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay",x:UV.x.toString(),y:UV.y.toString(),width:WV.toString(),height:IV.toString(),fill:"transparent"},children:[]});const dV=su_default(VV).schematic_port.list({schematic_component_id:lV.schematic_component_id});for(const CV of dV)RV.push(...createSvgObjectsFromSchPortOnBox({schPort:CV,schComponent:lV,transform:J,circuitJson:VV}));return RV};function createSvgObjectsFromSchematicComponent(lV){const{component:J}=lV,VV=J.symbol_name?createSvgObjectsFromSchematicComponentWithSymbol(lV):createSvgObjectsFromSchematicComponentWithBox(lV);return[{type:"element",name:"g",attributes:{"data-circuit-json-type":"schematic_component","data-schematic-component-id":J.schematic_component_id},children:VV,value:""}]}function createSvgObjectsFromSchVoltageProbe(lV,J){const[VV,RV]=applyToPoint(J,[lV.position.x,lV.position.y]),UV=Math.abs(J.a)*.6,ZV=Math.abs(J.a)*.28,WV=VV+UV*Math.cos(-50*Math.PI/180),IV=RV+UV*Math.sin(-50*Math.PI/180),dV=VV,CV=RV;return[{name:"path",type:"element",attributes:{d:[`M ${WV},${IV}`,`L ${dV},${CV}`,`M ${dV},${CV}`,`L ${dV-ZV*Math.cos(100*Math.PI/180)},${CV-ZV*Math.sin(100*Math.PI/180)}`,`L ${dV-ZV*Math.cos(160*Math.PI/180)},${CV-ZV*Math.sin(160*Math.PI/180)}`,"Z"].join(" "),stroke:colorMap.schematic.reference,fill:colorMap.schematic.reference,"stroke-width":`${getSchStrokeSize(J)}px`},value:"",children:[]},{type:"element",name:"text",value:"",attributes:{x:(WV+8-(WV-WV)).toString(),y:(IV-10+(IV-IV)).toString(),fill:colorMap.schematic.reference,"text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif","font-size":`${getSchScreenFontSize(J,"reference_designator")}px`,"font-weight":"bold","data-schematic-voltage-probe-id":lV.schematic_voltage_probe_id},children:[{type:"text",value:lV.voltage?`${lV.voltage}V`:"",name:"",attributes:{},children:[]}]}]}function createSvgObjectsFromSchDebugObject(lV,J){if(lV.shape==="rect"){let[VV,RV]=applyToPoint(J,[lV.center.x-lV.size.width/2,lV.center.y-lV.size.height/2]),[UV,ZV]=applyToPoint(J,[lV.center.x+lV.size.width/2,lV.center.y+lV.size.height/2]);[RV,ZV]=[Math.min(RV,ZV),Math.max(RV,ZV)];const WV=Math.abs(UV-VV),IV=Math.abs(ZV-RV),[dV,CV]=applyToPoint(J,[lV.center.x,lV.center.y]);return[{name:"rect",type:"element",value:"",attributes:{x:VV.toString(),y:RV.toString(),width:WV.toString(),height:IV.toString(),fill:"none",stroke:"red","stroke-width":(.02*Math.abs(J.a)).toString(),"stroke-dasharray":"5,5"},children:lV.label?[{name:"text",type:"element",value:"",attributes:{x:dV.toString(),y:(CV-10).toString(),"text-anchor":"middle","font-size":(.2*Math.abs(J.a)).toString(),fill:"red"},children:[{type:"text",value:lV.label,name:"",attributes:{},children:[]}]}]:[]}]}if(lV.shape==="line"){const[VV,RV]=applyToPoint(J,[lV.start.x,lV.start.y]),[UV,ZV]=applyToPoint(J,[lV.end.x,lV.end.y]),WV=(VV+UV)/2,IV=(RV+ZV)/2;return[{name:"line",type:"element",value:"",attributes:{x1:VV.toString(),y1:RV.toString(),x2:UV.toString(),y2:ZV.toString(),stroke:"red","stroke-width":(.02*Math.abs(J.a)).toString(),"stroke-dasharray":"5,5"},children:lV.label?[{name:"text",type:"element",value:"",attributes:{x:WV.toString(),y:(IV-10).toString(),"text-anchor":"middle","font-size":(.2*Math.abs(J.a)).toString(),fill:"red"},children:[{type:"text",value:lV.label,name:"",attributes:{},children:[]}]}]:[]}]}return[]}function createSchematicTrace(lV,J){var ZV;const VV=lV.edges;if(VV.length===0)return[];const RV=[];let UV="";for(let WV=0;WV<VV.length;WV++){const IV=VV[WV];if(IV.is_crossing)continue;const[dV,CV]=applyToPoint(J,[IV.from.x,IV.from.y]),[FV,NV]=applyToPoint(J,[IV.to.x,IV.to.y]);WV===0||(ZV=VV[WV-1])!=null&&ZV.is_crossing?UV+=`M ${dV} ${CV} L ${FV} ${NV}`:UV+=` L ${FV} ${NV}`}for(const WV of VV){if(!WV.is_crossing)continue;const[IV,dV]=applyToPoint(J,[WV.from.x,WV.from.y]),[CV,FV]=applyToPoint(J,[WV.to.x,WV.to.y]),NV=(IV+CV)/2,eV=(dV+FV)/2,gV=CV-IV,nV=FV-dV,JV=Math.sqrt(gV*gV+nV*nV),aV=JV*.7,GV=-nV/JV*aV,YV=gV/JV*aV,tV=NV+GV,kV=eV-Math.abs(YV);RV.push({name:"path",type:"element",attributes:{class:"trace-crossing-outline",d:`M ${IV} ${dV} Q ${tV} ${kV} ${CV} ${FV}`,stroke:colorMap.schematic.background,fill:"none","stroke-width":`${getSchStrokeSize(J)*1.5}px`,"stroke-linecap":"round"},value:"",children:[]}),RV.push({name:"path",type:"element",attributes:{d:`M ${IV} ${dV} Q ${tV} ${kV} ${CV} ${FV}`,stroke:colorMap.schematic.wire,fill:"none","stroke-width":`${getSchStrokeSize(J)}px`,"stroke-linecap":"round"},value:"",children:[]})}if(UV&&(RV.push({name:"path",type:"element",attributes:{d:UV,class:"trace-invisible-hover-outline",stroke:colorMap.schematic.wire,fill:"none","stroke-width":`${getSchStrokeSize(J)*8}px`,"stroke-linecap":"round",opacity:"0","stroke-linejoin":"round"},value:"",children:[]}),RV.push({name:"path",type:"element",attributes:{d:UV,stroke:colorMap.schematic.wire,fill:"none","stroke-width":`${getSchStrokeSize(J)}px`,"stroke-linecap":"round","stroke-linejoin":"round"},value:"",children:[]})),lV.junctions)for(const WV of lV.junctions){const[IV,dV]=applyToPoint(J,[WV.x,WV.y]);RV.push({name:"circle",type:"element",attributes:{cx:IV.toString(),cy:dV.toString(),r:(Math.abs(J.a)*.03).toString(),fill:colorMap.schematic.junction},value:"",children:[]})}return[{name:"g",type:"element",value:"",attributes:{class:"trace"},children:RV}]}var arialTextMetrics={0:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},1:{width:13,height:27,ascent:22,descent:5,left:-3,right:9},2:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},3:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},4:{width:13,height:27,ascent:22,descent:5,left:0,right:12},5:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},6:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},7:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},8:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},9:{width:13,height:27,ascent:22,descent:5,left:-1,right:12}," ":{width:7,height:27,ascent:22,descent:5,left:0,right:0},"!":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},'"':{width:9,height:27,ascent:22,descent:5,left:-1,right:7},"#":{width:13,height:27,ascent:22,descent:5,left:0,right:13},$:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"%":{width:21,height:27,ascent:22,descent:5,left:-1,right:20},"&":{width:16,height:27,ascent:22,descent:5,left:-1,right:15},"'":{width:5,height:27,ascent:22,descent:5,left:-1,right:3},"(":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},")":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"*":{width:9,height:27,ascent:22,descent:5,left:-1,right:8},"+":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},",":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"-":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},".":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"/":{width:7,height:27,ascent:22,descent:5,left:0,right:7},":":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},";":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"<":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},"=":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},">":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},"?":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"@":{width:24,height:27,ascent:22,descent:5,left:-1,right:23},A:{width:16,height:27,ascent:22,descent:5,left:0,right:16},B:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},C:{width:17,height:27,ascent:22,descent:5,left:-1,right:16},D:{width:17,height:27,ascent:22,descent:5,left:-2,right:16},E:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},F:{width:15,height:27,ascent:22,descent:5,left:-2,right:14},G:{width:19,height:27,ascent:22,descent:5,left:-1,right:17},H:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},I:{width:7,height:27,ascent:22,descent:5,left:-2,right:5},J:{width:12,height:27,ascent:22,descent:5,left:-1,right:10},K:{width:16,height:27,ascent:22,descent:5,left:-2,right:16},L:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},M:{width:20,height:27,ascent:22,descent:5,left:-2,right:18},N:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},O:{width:19,height:27,ascent:22,descent:5,left:-1,right:18},P:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},Q:{width:19,height:27,ascent:22,descent:5,left:-1,right:18},R:{width:17,height:27,ascent:22,descent:5,left:-2,right:17},S:{width:16,height:27,ascent:22,descent:5,left:-1,right:15},T:{width:15,height:27,ascent:22,descent:5,left:-1,right:14},U:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},V:{width:16,height:27,ascent:22,descent:5,left:0,right:16},W:{width:23,height:27,ascent:22,descent:5,left:0,right:22},X:{width:16,height:27,ascent:22,descent:5,left:0,right:16},Y:{width:16,height:27,ascent:22,descent:5,left:0,right:16},Z:{width:15,height:27,ascent:22,descent:5,left:0,right:14},"[":{width:7,height:27,ascent:22,descent:5,left:-2,right:6},"\\":{width:7,height:27,ascent:22,descent:5,left:0,right:7},"]":{width:7,height:27,ascent:22,descent:5,left:0,right:5},"^":{width:11,height:27,ascent:22,descent:5,left:-1,right:11},_:{width:13,height:27,ascent:22,descent:5,left:0,right:14},"`":{width:8,height:27,ascent:22,descent:5,left:-1,right:5},a:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},b:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},c:{width:12,height:27,ascent:22,descent:5,left:-1,right:12},d:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},e:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},f:{width:7,height:27,ascent:22,descent:5,left:0,right:8},g:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},h:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},i:{width:5,height:27,ascent:22,descent:5,left:-2,right:4},j:{width:5,height:27,ascent:22,descent:5,left:1,right:4},k:{width:12,height:27,ascent:22,descent:5,left:-2,right:12},l:{width:5,height:27,ascent:22,descent:5,left:-2,right:4},m:{width:20,height:27,ascent:22,descent:5,left:-2,right:18},n:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},o:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},p:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},q:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},r:{width:8,height:27,ascent:22,descent:5,left:-2,right:8},s:{width:12,height:27,ascent:22,descent:5,left:-1,right:11},t:{width:7,height:27,ascent:22,descent:5,left:0,right:6},u:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},v:{width:12,height:27,ascent:22,descent:5,left:0,right:12},w:{width:17,height:27,ascent:22,descent:5,left:0,right:17},x:{width:12,height:27,ascent:22,descent:5,left:0,right:12},y:{width:12,height:27,ascent:22,descent:5,left:0,right:12},z:{width:12,height:27,ascent:22,descent:5,left:0,right:11},"{":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"|":{width:6,height:27,ascent:22,descent:5,left:-2,right:4},"}":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"~":{width:14,height:27,ascent:22,descent:5,left:-1,right:13}},estimateTextWidth=lV=>{if(!lV)return 0;let J=0;for(const VV of lV){const RV=arialTextMetrics[VV];RV?J+=RV.width:J+=arialTextMetrics["?"].width}return J/27},ARROW_POINT_WIDTH_FSR=.3,END_PADDING_FSR=.3,END_PADDING_EXTRA_PER_CHARACTER_FSR=.06,createSvgObjectsForSchNetLabel=(lV,J)=>{if(!lV.text)return[];const VV=[],RV=getSchScreenFontSize(J,"net_label"),UV=getSchMmFontSize("net_label"),ZV=estimateTextWidth(lV.text||""),WV=applyToPoint(J,lV.center),IV=getUnitVectorFromOutsideToEdge(lV.anchor_side),dV={...IV};dV.y*=-1;const CV=ZV+ARROW_POINT_WIDTH_FSR*2+END_PADDING_EXTRA_PER_CHARACTER_FSR*lV.text.length+END_PADDING_FSR,FV=lV.anchor_position?applyToPoint(J,lV.anchor_position):{x:WV.x-dV.x*CV*RV/2,y:WV.y-dV.y*CV*RV/2},NV=lV.anchor_position??{x:lV.center.x-IV.x*CV*UV/2,y:lV.center.y-IV.y*CV*UV/2},eV={left:0,top:-90,bottom:90,right:180}[lV.anchor_side],gV=[{x:0,y:0},{x:ARROW_POINT_WIDTH_FSR,y:.6},{x:ARROW_POINT_WIDTH_FSR*2+END_PADDING_FSR+END_PADDING_EXTRA_PER_CHARACTER_FSR*lV.text.length+ZV,y:.6},{x:ARROW_POINT_WIDTH_FSR*2+END_PADDING_FSR+END_PADDING_EXTRA_PER_CHARACTER_FSR*lV.text.length+ZV,y:-.6},{x:ARROW_POINT_WIDTH_FSR,y:-.6}].map(YV=>applyToPoint(compose(J,translate(NV.x,NV.y),scale$2(UV),rotate(eV/180*Math.PI)),YV)),nV=`
|
|
22423
22432
|
M ${gV[0].x},${gV[0].y}
|
|
22424
22433
|
L ${gV[1].x},${gV[1].y}
|
|
22425
22434
|
L ${gV[2].x},${gV[2].y}
|
|
@@ -22442,7 +22451,7 @@ void main() {
|
|
|
22442
22451
|
.pin-number { fill: ${colorMap.schematic.pin_number}; }
|
|
22443
22452
|
.port-label { fill: ${colorMap.schematic.reference}; }
|
|
22444
22453
|
.component-name { fill: ${colorMap.schematic.reference}; }
|
|
22445
|
-
`,name:"",attributes:{},children:[]}],value:"",attributes:{}},...NV],value:""};return stringify(YV)}var circuitJsonToSchematicSvg=convertCircuitJsonToSchematicSvg;const index=Object.freeze(Object.defineProperty({__proto__:null,circuitJsonToPcbSvg,circuitJsonToSchematicSvg,convertCircuitJsonToPcbSvg,convertCircuitJsonToSchematicSvg},Symbol.toStringTag,{value:"Module"}));var t=typeof self<"u"?self:{};function e(lV,J){V:{for(var VV=["CLOSURE_FLAGS"],RV=t,UV=0;UV<VV.length;UV++)if((RV=RV[VV[UV]])==null){VV=null;break V}VV=RV}return(lV=VV&&VV[lV])!=null?lV:J}function n(){throw Error("Invalid UTF8")}function r(lV,J){return J=String.fromCharCode.apply(null,J),lV==null?J:lV+J}let i$1,s;const o=typeof TextDecoder<"u";let a;const h=typeof TextEncoder<"u";function c(lV){if(h)lV=(a||(a=new TextEncoder)).encode(lV);else{let VV=0;const RV=new Uint8Array(3*lV.length);for(let UV=0;UV<lV.length;UV++){var J=lV.charCodeAt(UV);if(J<128)RV[VV++]=J;else{if(J<2048)RV[VV++]=J>>6|192;else{if(J>=55296&&J<=57343){if(J<=56319&&UV<lV.length){const ZV=lV.charCodeAt(++UV);if(ZV>=56320&&ZV<=57343){J=1024*(J-55296)+ZV-56320+65536,RV[VV++]=J>>18|240,RV[VV++]=J>>12&63|128,RV[VV++]=J>>6&63|128,RV[VV++]=63&J|128;continue}UV--}J=65533}RV[VV++]=J>>12|224,RV[VV++]=J>>6&63|128}RV[VV++]=63&J|128}}lV=VV===RV.length?RV:RV.subarray(0,VV)}return lV}var u,l=e(610401301,!1),f=e(653718497,e(1,!0)),d=e(660014094,!1);const p=t.navigator;function g(lV){return!!l&&!!u&&u.brands.some(({brand:J})=>J&&J.indexOf(lV)!=-1)}function m(lV){var J;return(J=t.navigator)&&(J=J.userAgent)||(J=""),J.indexOf(lV)!=-1}function y(){return!!l&&!!u&&u.brands.length>0}function _(){return y()?g("Chromium"):(m("Chrome")||m("CriOS"))&&!(!y()&&m("Edge"))||m("Silk")}function v(lV){return v[" "](lV),lV}u=p&&p.userAgentData||null,v[" "]=function(){};var E=!y()&&(m("Trident")||m("MSIE"));!m("Android")||_(),_(),m("Safari")&&(_()||!y()&&m("Coast")||!y()&&m("Opera")||!y()&&m("Edge")||(y()?g("Microsoft Edge"):m("Edg/"))||y()&&g("Opera"));var w={},T=null;function A(lV){var J=lV.length,VV=3*J/4;VV%3?VV=Math.floor(VV):"=.".indexOf(lV[J-1])!=-1&&(VV="=.".indexOf(lV[J-2])!=-1?VV-2:VV-1);var RV=new Uint8Array(VV),UV=0;return function(ZV,WV){function IV(gV){for(;dV<ZV.length;){var nV=ZV.charAt(dV++),JV=T[nV];if(JV!=null)return JV;if(!/^[\s\xa0]*$/.test(nV))throw Error("Unknown base64 encoding at char: "+nV)}return gV}b();for(var dV=0;;){var CV=IV(-1),FV=IV(0),NV=IV(64),eV=IV(64);if(eV===64&&CV===-1)break;WV(CV<<2|FV>>4),NV!=64&&(WV(FV<<4&240|NV>>2),eV!=64&&WV(NV<<6&192|eV))}}(lV,function(ZV){RV[UV++]=ZV}),UV!==VV?RV.subarray(0,UV):RV}function b(){if(!T){T={};for(var lV="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),J=["+/=","+/","-_=","-_.","-_"],VV=0;VV<5;VV++){var RV=lV.concat(J[VV].split(""));w[VV]=RV;for(var UV=0;UV<RV.length;UV++){var ZV=RV[UV];T[ZV]===void 0&&(T[ZV]=UV)}}}}var k=typeof Uint8Array<"u",S=!E&&typeof btoa=="function";function x(lV){if(!S){var J;J===void 0&&(J=0),b(),J=w[J];var VV=Array(Math.floor(lV.length/3)),RV=J[64]||"";let dV=0,CV=0;for(;dV<lV.length-2;dV+=3){var UV=lV[dV],ZV=lV[dV+1],WV=lV[dV+2],IV=J[UV>>2];UV=J[(3&UV)<<4|ZV>>4],ZV=J[(15&ZV)<<2|WV>>6],WV=J[63&WV],VV[CV++]=IV+UV+ZV+WV}switch(IV=0,WV=RV,lV.length-dV){case 2:WV=J[(15&(IV=lV[dV+1]))<<2]||RV;case 1:lV=lV[dV],VV[CV]=J[lV>>2]+J[(3&lV)<<4|IV>>4]+WV+RV}return VV.join("")}for(J="",VV=0,RV=lV.length-10240;VV<RV;)J+=String.fromCharCode.apply(null,lV.subarray(VV,VV+=10240));return J+=String.fromCharCode.apply(null,VV?lV.subarray(VV):lV),btoa(J)}const L=/[-_.]/g,R={"-":"+",_:"/",".":"="};function F(lV){return R[lV]||""}function M(lV){if(!S)return A(lV);L.test(lV)&&(lV=lV.replace(L,F)),lV=atob(lV);const J=new Uint8Array(lV.length);for(let VV=0;VV<lV.length;VV++)J[VV]=lV.charCodeAt(VV);return J}function I(lV){return k&&lV!=null&&lV instanceof Uint8Array}var P={};let O;function C(lV){if(lV!==P)throw Error("illegal external caller")}function N(){return O||(O=new D(null,P))}function U(lV){C(P);var J=lV.ba;return(J=J==null||I(J)?J:typeof J=="string"?M(J):null)==null?J:lV.ba=J}var D=class{constructor(lV,J){if(C(J),this.ba=lV,lV!=null&&lV.length===0)throw Error("ByteString should be constructed with non-empty values")}ua(){return new Uint8Array(U(this)||0)}};function B(lV,J){lV.__closure__error__context__984382||(lV.__closure__error__context__984382={}),lV.__closure__error__context__984382.severity=J}let G;function j(){const lV=Error();B(lV,"incident"),function(J){t.setTimeout(()=>{throw J},0)}(lV)}function V(lV){return B(lV=Error(lV),"warning"),lV}function X(){return typeof BigInt=="function"}function H(lV){return Array.prototype.slice.call(lV)}var W=typeof Symbol=="function"&&typeof Symbol()=="symbol";function z(lV){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol():lV}var K=z(),Y=z("0di"),$=z("2ex"),q=z("1oa"),Z=W?(lV,J)=>{lV[K]|=J}:(lV,J)=>{lV.G!==void 0?lV.G|=J:Object.defineProperties(lV,{G:{value:J,configurable:!0,writable:!0,enumerable:!1}})},Q=W?(lV,J)=>{lV[K]&=~J}:(lV,J)=>{lV.G!==void 0&&(lV.G&=~J)},tt=W?lV=>0|lV[K]:lV=>0|lV.G,et=W?lV=>lV[K]:lV=>lV.G,nt=W?(lV,J)=>{lV[K]=J}:(lV,J)=>{lV.G!==void 0?lV.G=J:Object.defineProperties(lV,{G:{value:J,configurable:!0,writable:!0,enumerable:!1}})};function rt(lV){return Z(lV,34),lV}function it(lV,J){nt(J,-14591&(0|lV))}function st(lV,J){nt(J,-14557&(34|lV))}var ot,at={},ht={};function ct(lV){return!(!lV||typeof lV!="object"||lV.La!==ht)}function ut(lV){return lV!==null&&typeof lV=="object"&&!Array.isArray(lV)&&lV.constructor===Object}function lt(lV,J,VV){if(lV!=null){if(typeof lV=="string")lV=lV?new D(lV,P):N();else if(lV.constructor!==D)if(I(lV))lV=lV.length?new D(VV?lV:new Uint8Array(lV),P):N();else{if(!J)throw Error();lV=void 0}}return lV}function ft(lV){return!(!Array.isArray(lV)||lV.length)&&!!(1&tt(lV))}const dt=[];function pt(lV){if(2&lV)throw Error()}nt(dt,55),ot=Object.freeze(dt);class gt{constructor(J,VV,RV){this.l=0,this.g=J,this.h=VV,this.m=RV}next(){if(this.l<this.g.length){const J=this.g[this.l++];return{done:!1,value:this.h?this.h.call(this.m,J):J}}return{done:!0,value:void 0}}[Symbol.iterator](){return new gt(this.g,this.h,this.m)}}let mt;function yt(lV,J){(J=mt?J[mt]:void 0)&&(lV[mt]=H(J))}var _t=Object.freeze({}),vt=Object.freeze({});function Et(lV){return lV.Sa=!0,lV}var wt=Et(lV=>typeof lV=="number"),Tt=Et(lV=>typeof lV=="string"),At=Et(lV=>typeof lV=="boolean"),bt=typeof t.BigInt=="function"&&typeof t.BigInt(0)=="bigint",kt=Et(lV=>bt?lV>=xt&&lV<=Rt:lV[0]==="-"?Ft(lV,St):Ft(lV,Lt));const St=Number.MIN_SAFE_INTEGER.toString(),xt=bt?BigInt(Number.MIN_SAFE_INTEGER):void 0,Lt=Number.MAX_SAFE_INTEGER.toString(),Rt=bt?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Ft(lV,J){if(lV.length>J.length)return!1;if(lV.length<J.length||lV===J)return!0;for(let VV=0;VV<lV.length;VV++){const RV=lV[VV],UV=J[VV];if(RV>UV)return!1;if(RV<UV)return!0}}const Mt=typeof Uint8Array.prototype.slice=="function";let It,Pt=0,Ot=0;function Ct(lV){const J=lV>>>0;Pt=J,Ot=(lV-J)/4294967296>>>0}function Nt(lV){if(lV<0){Ct(-lV);const[J,VV]=Xt(Pt,Ot);Pt=J>>>0,Ot=VV>>>0}else Ct(lV)}function Ut(lV){const J=It||(It=new DataView(new ArrayBuffer(8)));J.setFloat32(0,+lV,!0),Ot=0,Pt=J.getUint32(0,!0)}function Dt(lV,J){return 4294967296*J+(lV>>>0)}function Bt(lV,J){const VV=2147483648&J;return VV&&(J=~J>>>0,(lV=1+~lV>>>0)==0&&(J=J+1>>>0)),lV=Dt(lV,J),VV?-lV:lV}function Gt(lV,J){if(lV>>>=0,(J>>>=0)<=2097151)var VV=""+(4294967296*J+lV);else X()?VV=""+(BigInt(J)<<BigInt(32)|BigInt(lV)):(lV=(16777215&lV)+6777216*(VV=16777215&(lV>>>24|J<<8))+6710656*(J=J>>16&65535),VV+=8147497*J,J*=2,lV>=1e7&&(VV+=lV/1e7>>>0,lV%=1e7),VV>=1e7&&(J+=VV/1e7>>>0,VV%=1e7),VV=J+jt(VV)+jt(lV));return VV}function jt(lV){return lV=String(lV),"0000000".slice(lV.length)+lV}function Vt(lV){if(lV.length<16)Nt(Number(lV));else if(X())lV=BigInt(lV),Pt=Number(lV&BigInt(4294967295))>>>0,Ot=Number(lV>>BigInt(32)&BigInt(4294967295));else{const J=+(lV[0]==="-");Ot=Pt=0;const VV=lV.length;for(let RV=J,UV=(VV-J)%6+J;UV<=VV;RV=UV,UV+=6){const ZV=Number(lV.slice(RV,UV));Ot*=1e6,Pt=1e6*Pt+ZV,Pt>=4294967296&&(Ot+=Math.trunc(Pt/4294967296),Ot>>>=0,Pt>>>=0)}if(J){const[RV,UV]=Xt(Pt,Ot);Pt=RV,Ot=UV}}}function Xt(lV,J){return J=~J,lV?lV=1+~lV:J+=1,[lV,J]}function Ht(lV){return lV==null||typeof lV=="number"?lV:lV==="NaN"||lV==="Infinity"||lV==="-Infinity"?Number(lV):void 0}function Wt(lV){return lV==null||typeof lV=="boolean"?lV:typeof lV=="number"?!!lV:void 0}const zt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Kt(lV){const J=typeof lV;switch(J){case"bigint":return!0;case"number":return Number.isFinite(lV)}return J==="string"&&zt.test(lV)}function Yt(lV){if(lV==null)return lV;if(typeof lV=="string"){if(!lV)return;lV=+lV}return typeof lV=="number"&&Number.isFinite(lV)?0|lV:void 0}function $t(lV){if(lV==null)return lV;if(typeof lV=="string"){if(!lV)return;lV=+lV}return typeof lV=="number"&&Number.isFinite(lV)?lV>>>0:void 0}function qt(lV){return lV[0]!=="-"&&(lV.length<20||lV.length===20&&Number(lV.substring(0,6))<184467)}function Jt(lV){return lV=Math.trunc(lV),Number.isSafeInteger(lV)||(Nt(lV),lV=Bt(Pt,Ot)),lV}function Zt(lV){var J=Math.trunc(Number(lV));if(Number.isSafeInteger(J))return String(J);if((J=lV.indexOf("."))!==-1&&(lV=lV.substring(0,J)),!(lV[0]==="-"?lV.length<20||lV.length===20&&Number(lV.substring(0,7))>-922337:lV.length<19||lV.length===19&&Number(lV.substring(0,6))<922337))if(Vt(lV),lV=Pt,2147483648&(J=Ot))if(X())lV=""+(BigInt(0|J)<<BigInt(32)|BigInt(lV>>>0));else{const[VV,RV]=Xt(lV,J);lV="-"+Gt(VV,RV)}else lV=Gt(lV,J);return lV}function Qt(lV){return lV==null?lV:typeof lV=="bigint"?(kt(lV)?lV=Number(lV):(lV=BigInt.asIntN(64,lV),lV=kt(lV)?Number(lV):String(lV)),lV):Kt(lV)?typeof lV=="number"?Jt(lV):Zt(lV):void 0}function te(lV){if(lV==null)return lV;var J=typeof lV;if(J==="bigint")return String(BigInt.asUintN(64,lV));if(Kt(lV)){if(J==="string")return J=Math.trunc(Number(lV)),Number.isSafeInteger(J)&&J>=0?lV=String(J):((J=lV.indexOf("."))!==-1&&(lV=lV.substring(0,J)),qt(lV)||(Vt(lV),lV=Gt(Pt,Ot))),lV;if(J==="number")return(lV=Math.trunc(lV))>=0&&Number.isSafeInteger(lV)?lV:function(VV){if(VV<0){Nt(VV);const RV=Gt(Pt,Ot);return VV=Number(RV),Number.isSafeInteger(VV)?VV:RV}return qt(String(VV))?VV:(Nt(VV),Dt(Pt,Ot))}(lV)}}function ee(lV){if(typeof lV!="string")throw Error();return lV}function ne(lV){if(lV!=null&&typeof lV!="string")throw Error();return lV}function re(lV){return lV==null||typeof lV=="string"?lV:void 0}function ie(lV,J,VV,RV){if(lV!=null&&typeof lV=="object"&&lV.Y===at)return lV;if(!Array.isArray(lV))return VV?2&RV?(lV=J[Y])?J=lV:(rt((lV=new J).u),J=J[Y]=lV):J=new J:J=void 0,J;let UV=VV=tt(lV);return UV===0&&(UV|=32&RV),UV|=2&RV,UV!==VV&&nt(lV,UV),new J(lV)}function se(lV,J,VV){if(J)V:{if(!Kt(J=lV))throw V("int64");switch(typeof J){case"string":J=Zt(J);break V;case"bigint":if(lV=J=BigInt.asIntN(64,J),Tt(lV)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(lV))throw Error(String(lV))}else if(wt(lV)&&!Number.isSafeInteger(lV))throw Error(String(lV));J=bt?BigInt(J):At(J)?J?"1":"0":Tt(J)?J.trim()||"0":String(J);break V;default:J=Jt(J)}}else J=Qt(lV);return typeof(VV=(lV=J)==null?VV?0:void 0:lV)=="string"&&(J=+VV,Number.isSafeInteger(J))?J:VV}function oe(lV){if(ce===void 0&&(ce=typeof Proxy=="function"?ye(Proxy):null),!ce||!me())return lV;let J=ae==null?void 0:ae.get(lV);return J||(Math.random()>.01?lV:(function(VV){if(le===void 0){const RV=new ce([],{});le=Array.prototype.concat.call([],RV).length===1}le&&typeof Symbol=="function"&&Symbol.isConcatSpreadable&&(VV[Symbol.isConcatSpreadable]=!0)}(lV),J=new ce(lV,{set:(VV,RV,UV)=>(j(),VV[RV]=UV,!0)}),function(VV,RV){(ae||(ae=new ue)).set(VV,RV),(he||(he=new ue)).set(RV,VV)}(lV,J),J))}let ae,he,ce,ue,le,fe,de,pe,ge;function me(){return ue===void 0&&(ue=typeof WeakMap=="function"?ye(WeakMap):null),ue}function ye(lV){try{return lV.toString().indexOf("[native code]")!==-1?lV:null}catch{return null}}function _e(lV,J,VV){var WV;if(f&&me()){if((WV=fe==null?void 0:fe.get(J))!=null&&WV.get(lV)){if(VV)return}else if(Math.random()>.01)return;var RV=lV.length;VV={length:RV};for(var UV=0;UV<Math.min(RV,10);UV++){if(RV<=10)var ZV=UV;else{ZV=RV/10;const IV=Math.floor(UV*ZV);ZV=IV+Math.floor(Math.random()*(Math.floor((UV+1)*ZV)-IV))}VV[ZV]=lV[ZV]}Ee(lV,VV)?((UV=(RV=fe||(fe=new ue)).get(J))||(UV=new ue,RV.set(J,UV)),UV.set(lV,VV)):(j(),Te(lV,J))}}function ve(lV,J){var RV;const VV=(RV=fe==null?void 0:fe.get(J))==null?void 0:RV.get(lV);VV&&!Ee(lV,VV)&&(j(),Te(lV,J))}function Ee(lV,J){if(lV.length!==J.length)return!1;for(const UV in J){var VV,RV=Number(UV);if((VV=Number.isInteger(RV))&&(VV=lV[RV],RV=J[RV],VV=!(Number.isNaN(VV)?Number.isNaN(RV):VV===RV)),VV)return!1}return!0}function we(lV){if(lV&&(fe!=null&&fe.has(lV))){var J=lV.u;if(J)for(let VV=0;VV<J.length;VV++){const RV=J[VV];if(VV===J.length-1&&ut(RV))for(const UV in RV){const ZV=RV[UV];Array.isArray(ZV)&&ve(ZV,lV)}else Array.isArray(RV)&&ve(RV,lV)}}}function Te(lV,J){var VV;(VV=fe==null?void 0:fe.get(J))==null||VV.delete(lV)}function Ae(lV,J){return lV=be(lV,J[0],J[1]),Z(lV,16384),lV}function be(lV,J,VV){if(lV==null&&(lV=de),de=void 0,lV==null){var RV=96;VV?(lV=[VV],RV|=512):lV=[],J&&(RV=-33521665&RV|(1023&J)<<15)}else{if(!Array.isArray(lV))throw Error("narr");if(2048&(RV=tt(lV)))throw Error("farr");if(64&RV)return lV;if(RV|=64,VV&&(RV|=512,VV!==lV[0]))throw Error("mid");V:{const UV=(VV=lV).length;if(UV){const ZV=UV-1;if(ut(VV[ZV])){if((J=ZV-(+!!(512&(RV|=256))-1))>=1024)throw Error("pvtlmt");RV=-33521665&RV|(1023&J)<<15;break V}}if(J){if((J=Math.max(J,UV-(+!!(512&RV)-1)))>1024)throw Error("spvt");RV=-33521665&RV|(1023&J)<<15}}}return nt(lV,RV),lV}const ke={};let Se=function(){try{return v(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class xe{constructor(){this.g=new Map}get(J){return this.g.get(J)}set(J,VV){return this.g.set(J,VV),this.size=this.g.size,this}delete(J){return J=this.g.delete(J),this.size=this.g.size,J}clear(){this.g.clear(),this.size=this.g.size}has(J){return this.g.has(J)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(J,VV){return this.g.forEach(J,VV)}[Symbol.iterator](){return this.entries()}}const Le=Se?(Object.setPrototypeOf(xe.prototype,Map.prototype),Object.defineProperties(xe.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),xe):class extends Map{constructor(){super()}};function Re(lV){return lV}function Fe(lV){if(2&lV.M)throw Error("Cannot mutate an immutable Map")}var Me=class extends Le{constructor(lV,J,VV=Re,RV=Re){super();let UV=tt(lV);UV|=64,nt(lV,UV),this.M=UV,this.U=J,this.T=VV,this.aa=this.U?Ie:RV;for(let ZV=0;ZV<lV.length;ZV++){const WV=lV[ZV],IV=VV(WV[0],!1,!0);let dV=WV[1];J?dV===void 0&&(dV=null):dV=RV(WV[1],!1,!0,void 0,void 0,UV),super.set(IV,dV)}}pa(lV=Pe){if(this.size!==0)return this.Z(lV)}Z(lV=Pe){const J=[],VV=super.entries();for(var RV;!(RV=VV.next()).done;)(RV=RV.value)[0]=lV(RV[0]),RV[1]=lV(RV[1]),J.push(RV);return J}clear(){Fe(this),super.clear()}delete(lV){return Fe(this),super.delete(this.T(lV,!0,!1))}entries(){var lV=this.oa();return new gt(lV,Oe,this)}keys(){return this.Ka()}values(){var lV=this.oa();return new gt(lV,Me.prototype.get,this)}forEach(lV,J){super.forEach((VV,RV)=>{lV.call(J,this.get(RV),RV,this)})}set(lV,J){return Fe(this),(lV=this.T(lV,!0,!1))==null?this:J==null?(super.delete(lV),this):super.set(lV,this.aa(J,!0,!0,this.U,!1,this.M))}Qa(lV){const J=this.T(lV[0],!1,!0);lV=lV[1],lV=this.U?lV===void 0?null:lV:this.aa(lV,!1,!0,void 0,!1,this.M),super.set(J,lV)}has(lV){return super.has(this.T(lV,!1,!1))}get(lV){lV=this.T(lV,!1,!1);const J=super.get(lV);if(J!==void 0){var VV=this.U;return VV?((VV=this.aa(J,!1,!0,VV,this.va,this.M))!==J&&super.set(lV,VV),VV):J}}oa(){return Array.from(super.keys())}Ka(){return super.keys()}[Symbol.iterator](){return this.entries()}};function Ie(lV,J,VV,RV,UV,ZV){return lV=ie(lV,RV,VV,ZV),UV&&(lV=He(lV)),lV}function Pe(lV){return lV}function Oe(lV){return[lV,this.get(lV)]}let Ce;function Ne(){return Ce||(Ce=new Me(rt([]),void 0,void 0,void 0,ke))}function Ue(lV,J,VV,RV,UV){if(lV!=null){if(Array.isArray(lV))lV=ft(lV)?void 0:UV&&2&tt(lV)?lV:De(lV,J,VV,RV!==void 0,UV);else if(ut(lV)){const ZV={};for(let WV in lV)ZV[WV]=Ue(lV[WV],J,VV,RV,UV);lV=ZV}else lV=J(lV,RV);return lV}}function De(lV,J,VV,RV,UV){const ZV=RV||VV?tt(lV):0;RV=RV?!!(32&ZV):void 0;const WV=H(lV);for(let IV=0;IV<WV.length;IV++)WV[IV]=Ue(WV[IV],J,VV,RV,UV);return VV&&(yt(WV,lV),VV(ZV,WV)),WV}function Be(lV){return Ue(lV,Ge,void 0,void 0,!1)}function Ge(lV){return lV.Y===at?lV.toJSON():lV instanceof Me?lV.pa(Be):function(J){switch(typeof J){case"number":return isFinite(J)?J:String(J);case"bigint":return kt(J)?Number(J):String(J);case"boolean":return J?1:0;case"object":if(J)if(Array.isArray(J)){if(ft(J))return}else{if(I(J))return x(J);if(J instanceof D){const VV=J.ba;return VV==null?"":typeof VV=="string"?VV:J.ba=x(VV)}if(J instanceof Me)return J.pa()}}return J}(lV)}function je(lV,J,VV=st){if(lV!=null){if(k&&lV instanceof Uint8Array)return J?lV:new Uint8Array(lV);if(Array.isArray(lV)){var RV=tt(lV);return 2&RV?lV:(J&&(J=RV===0||!!(32&RV)&&!(64&RV||!(16&RV))),J?(nt(lV,-12293&(34|RV)),lV):De(lV,je,4&RV?st:VV,!0,!0))}return lV.Y===at?(VV=lV.u,lV=2&(RV=et(VV))?lV:Ve(lV,VV,RV,!0)):lV instanceof Me&&!(2&lV.M)&&(VV=rt(lV.Z(je)),lV=new Me(VV,lV.U,lV.T,lV.aa)),lV}}function Ve(lV,J,VV,RV){return we(lV),lV=lV.constructor,de=J=Xe(J,VV,RV),J=new lV(J),de=void 0,J}function Xe(lV,J,VV){const RV=VV||2&J?st:it,UV=!!(32&J);return lV=function(ZV,WV,IV){const dV=H(ZV);var CV=dV.length;const FV=256&WV?dV[CV-1]:void 0;for(CV+=FV?-1:0,WV=512&WV?1:0;WV<CV;WV++)dV[WV]=IV(dV[WV]);if(FV){WV=dV[WV]={};for(const NV in FV)WV[NV]=IV(FV[NV])}return yt(dV,ZV),dV}(lV,J,ZV=>je(ZV,UV,RV)),Z(lV,32|(VV?2:0)),lV}function He(lV){const J=lV.u,VV=et(J);return 2&VV?Ve(lV,J,VV,!1):lV}function We(lV,J,VV,RV){return!(4&J)||VV!=null}function ze(lV,J){return Ye(lV=lV.u,et(lV),J)}function Ke(lV,J,VV,RV){if(!((J=RV+(+!!(512&J)-1))<0||J>=lV.length||J>=VV))return lV[J]}function Ye(lV,J,VV,RV){if(VV===-1)return null;const UV=J>>15&1023||536870912;if(!(VV>=UV)){var ZV=lV.length;return RV&&256&J&&(RV=lV[ZV-1][VV])!=null?(Ke(lV,J,UV,VV)&&$!=null&&((J=(lV=G??(G={}))[$]||0)>=4||(lV[$]=J+1,j())),RV):Ke(lV,J,UV,VV)}return 256&J?lV[lV.length-1][VV]:void 0}function $e(lV,J,VV){const RV=lV.u;let UV=et(RV);return pt(UV),qe(RV,UV,J,VV),lV}function qe(lV,J,VV,RV){const UV=J>>15&1023||536870912;if(VV>=UV){let ZV,WV=J;if(256&J)ZV=lV[lV.length-1];else{if(RV==null)return WV;ZV=lV[UV+(+!!(512&J)-1)]={},WV|=256}return ZV[VV]=RV,VV<UV&&(lV[VV+(+!!(512&J)-1)]=void 0),WV!==J&&nt(lV,WV),WV}return lV[VV+(+!!(512&J)-1)]=RV,256&J&&VV in(lV=lV[lV.length-1])&&delete lV[VV],J}function Je(lV,J,VV,RV,UV){var ZV=2&J;UV=Ye(lV,J,VV,UV),Array.isArray(UV)||(UV=ot);const WV=!(2&RV);RV=!(1&RV);const IV=!!(32&J);let dV=tt(UV);return dV!==0||!IV||ZV||WV?1&dV||(dV|=1,nt(UV,dV)):(dV|=33,nt(UV,dV)),ZV?(lV=!1,2&dV||(rt(UV),lV=!!(4&dV)),(RV||lV)&&Object.freeze(UV)):(ZV=!!(2&dV)||!!(2048&dV),RV&&ZV?(UV=H(UV),ZV=1,IV&&!WV&&(ZV|=32),nt(UV,ZV),qe(lV,J,VV,UV)):WV&&32&dV&&!ZV&&Q(UV,32)),UV}function Ze(lV,J){lV=lV.u;let VV=et(lV);const RV=Ye(lV,VV,J),UV=Ht(RV);return UV!=null&&UV!==RV&&qe(lV,VV,J,UV),UV}function Qe(lV){lV=lV.u;let J=et(lV);const VV=Ye(lV,J,1),RV=lt(VV,!0,!!(34&J));return RV!=null&&RV!==VV&&qe(lV,J,1,RV),RV}function tn(){return _t===void 0?2:5}function en(lV,J,VV,RV,UV,ZV){const WV=lV.u;let IV=et(WV);RV=2&IV?1:RV,ZV=!!ZV,UV=nn(WV,IV,J,UV);var dV=tt(UV),CV=UV;if(ve(CV,lV),RV!==2&&RV!==1||Te(CV,lV),We(lV,dV,void 0)){4&dV&&(UV=H(UV),dV=vn(dV,IV),IV=qe(WV,IV,J,UV));let NV=CV=0;for(;CV<UV.length;CV++){const eV=VV(UV[CV]);eV!=null&&(UV[NV++]=eV)}NV<CV&&(UV.length=NV),dV=-4097&(20|(dV=rn(dV,IV))),nt(UV,dV&=-8193),2&dV&&Object.freeze(UV)}let FV;return RV===1||RV===4&&32&dV?sn(dV)||(lV=dV,(dV|=2)!==lV&&nt(UV,dV),Object.freeze(UV)):(VV=RV===5&&(!!(32&dV)||sn(dV)||!!(ae!=null&&ae.get(UV))),(RV===2||VV)&&sn(dV)&&(UV=H(UV),dV=En(dV=vn(dV,IV),IV,ZV),nt(UV,dV),IV=qe(WV,IV,J,UV)),sn(dV)||(J=dV,(dV=En(dV,IV,ZV))!==J&&nt(UV,dV)),VV?(FV=oe(UV),_e(UV,lV,!0)):RV!==2||ZV||(ae==null||ae.delete(UV))),FV||UV}function nn(lV,J,VV,RV){return lV=Ye(lV,J,VV,RV),Array.isArray(lV)?lV:ot}function rn(lV,J){return lV===0&&(lV=vn(lV,J)),1|lV}function sn(lV){return!!(2&lV)&&!!(4&lV)||!!(2048&lV)}function on(lV){lV=H(lV);for(let J=0;J<lV.length;J++){const VV=lV[J]=H(lV[J]);Array.isArray(VV[1])&&(VV[1]=rt(VV[1]))}return lV}function an(lV,J,VV,RV){lV=lV.u;let UV=et(lV);pt(UV),qe(lV,UV,J,(RV==="0"?Number(VV)===0:VV===RV)?void 0:VV)}function hn(lV,J){var VV=_s;return ln(cn(lV=lV.u),lV,et(lV),VV)===J?J:-1}function cn(lV){if(W)return lV[q]??(lV[q]=new Map);if(q in lV)return lV[q];const J=new Map;return Object.defineProperty(lV,q,{value:J}),J}function un(lV,J,VV,RV){const UV=cn(lV),ZV=ln(UV,lV,J,VV);return ZV!==RV&&(ZV&&(J=qe(lV,J,ZV)),UV.set(VV,RV)),J}function ln(lV,J,VV,RV){let UV=lV.get(RV);if(UV!=null)return UV;UV=0;for(let ZV=0;ZV<RV.length;ZV++){const WV=RV[ZV];Ye(J,VV,WV)!=null&&(UV!==0&&(VV=qe(J,VV,UV)),UV=WV)}return lV.set(RV,UV),UV}function fn(lV,J,VV,RV){let UV,ZV=et(lV);if((RV=Ye(lV,ZV,VV,RV))!=null&&RV.Y===at)return(J=He(RV))!==RV&&qe(lV,ZV,VV,J),J.u;if(Array.isArray(RV)){const WV=tt(RV);UV=2&WV?Xe(RV,WV,!1):RV,UV=Ae(UV,J)}else UV=Ae(void 0,J);return UV!==RV&&qe(lV,ZV,VV,UV),UV}function dn(lV,J,VV,RV){lV=lV.u;let UV=et(lV);return(J=ie(RV=Ye(lV,UV,VV,RV),J,!1,UV))!==RV&&J!=null&&qe(lV,UV,VV,J),J}function pn(lV,J,VV,RV=!1){if((J=dn(lV,J,VV,RV))==null)return J;if(lV=lV.u,!(2&(RV=et(lV)))){const UV=He(J);UV!==J&&qe(lV,RV,VV,J=UV)}return J}function gn(lV,J,VV,RV,UV,ZV,WV){const IV=lV.u;var dV=!!(2&J);UV=dV?1:UV,ZV=!!ZV,WV&&(WV=!dV),dV=nn(IV,J,RV);var CV=tt(dV),FV=dV;if(ve(FV,lV),UV!==2&&UV!==1||Te(FV,lV),!(FV=!!(4&CV))){var NV=dV,eV=J;const nV=!!(2&(CV=rn(CV,J)));nV&&(eV|=2);let JV=!nV,aV=!0,GV=0,YV=0;for(;GV<NV.length;GV++){const tV=ie(NV[GV],VV,!1,eV);if(tV instanceof VV){if(!nV){const kV=!!(2&tt(tV.u));JV&&(JV=!kV),aV&&(aV=kV)}NV[YV++]=tV}}YV<GV&&(NV.length=YV),CV|=4,CV=aV?16|CV:-17&CV,nt(NV,CV=JV?8|CV:-9&CV),nV&&Object.freeze(NV)}if(WV&&!(8&CV||!dV.length&&(UV===1||UV===4&&32&CV))){for(sn(CV)?(dV=H(dV),CV=vn(CV,J),J=qe(IV,J,RV,dV)):Te(dV,lV),VV=dV,WV=CV,NV=0;NV<VV.length;NV++)(CV=VV[NV])!==(eV=He(CV))&&(VV[NV]=eV);WV|=8,WV=VV.length?-17&WV:16|WV,nt(VV,WV),CV=WV}let gV;return UV===1||UV===4&&32&CV?sn(CV)||(lV=CV,(CV|=!dV.length||16&CV&&(!FV||32&CV)?2:2048)!==lV&&nt(dV,CV),Object.freeze(dV)):(FV=UV===5&&(!!(32&CV)||sn(CV)||!!(ae!=null&&ae.get(dV))),(UV===2||FV)&&sn(CV)&&(dV=H(dV),CV=En(CV=vn(CV,J),J,ZV),nt(dV,CV),J=qe(IV,J,RV,dV)),sn(CV)||(RV=CV,(CV=En(CV,J,ZV))!==RV&&nt(dV,CV)),FV?(gV=oe(dV),_e(dV,lV,!0)):UV!==2||ZV||(ae==null||ae.delete(dV))),gV||dV}function mn(lV,J,VV){const RV=et(lV.u);return gn(lV,RV,J,VV,tn(),!1,!(2&RV))}function yn(lV,J,VV,RV){return RV==null&&(RV=void 0),$e(lV,VV,RV)}function _n(lV,J,VV,RV){RV==null&&(RV=void 0);V:{lV=lV.u;let UV=et(lV);if(pt(UV),RV==null){const ZV=cn(lV);if(ln(ZV,lV,UV,VV)!==J)break V;ZV.set(VV,0)}else UV=un(lV,UV,VV,J);qe(lV,UV,J,RV)}}function vn(lV,J){return-2049&(lV=32|(2&J?2|lV:-3&lV))}function En(lV,J,VV){return 32&J&&VV||(lV&=-33),lV}function wn(lV,J,VV,RV){const UV=et(lV.u);pt(UV),lV=gn(lV,UV,VV,J,2,!0),VV=RV??new VV,lV.push(VV),2&tt(VV.u)?Q(lV,8):Q(lV,16)}function Tn(lV,J){return lV??J}function An(lV,J){return Yt(ze(lV,J))}function bn(lV,J){return Tn(Ze(lV,J),0)}function kn(lV,J){return Tn(re(ze(lV,J)),"")}function Sn(lV,J,VV){if(VV!=null&&typeof VV!="boolean")throw lV=typeof VV,Error(`Expected boolean but got ${lV!="object"?lV:VV?Array.isArray(VV)?"array":lV:"null"}: ${VV}`);$e(lV,J,VV)}function xn(lV,J,VV){if(VV!=null){if(typeof VV!="number"||!Number.isFinite(VV))throw V("int32");VV|=0}$e(lV,J,VV)}function Ln(lV,J,VV){if(VV!=null&&typeof VV!="number")throw Error(`Value of float/double field must be a number, found ${typeof VV}: ${VV}`);$e(lV,J,VV)}function Rn(lV,J,VV){{const IV=lV.u;let dV=et(IV);if(pt(dV),VV==null)qe(IV,dV,J);else{VV=(he==null?void 0:he.get(VV))||VV;var RV,UV=tt(VV),ZV=UV,WV=!!(2&UV)||Object.isFrozen(VV);if((RV=!WV)&&(RV=vt===void 0||!1),We(lV,UV)){UV=21,WV&&(VV=H(VV),ZV=0,UV=En(UV=vn(UV,dV),dV,!0));for(let CV=0;CV<VV.length;CV++)VV[CV]=ee(VV[CV])}RV?(VV=H(VV),ZV=0,UV=En(UV=vn(UV,dV),dV,!0)):WV||_e(VV,lV),UV!==ZV&&nt(VV,UV),qe(IV,dV,J,VV)}}}function Fn(lV,J,VV){pt(et(lV.u)),en(lV,J,re,2,void 0,!0).push(ee(VV))}function Mn(lV,J){return Error(`Invalid wire type: ${lV} (at position ${J})`)}function In(){return Error("Failed to read varint, encoding is invalid.")}function Pn(lV,J){return Error(`Tried to read past the end of the data ${J} > ${lV}`)}function On(lV){if(typeof lV=="string")return{buffer:M(lV),O:!1};if(Array.isArray(lV))return{buffer:new Uint8Array(lV),O:!1};if(lV.constructor===Uint8Array)return{buffer:lV,O:!1};if(lV.constructor===ArrayBuffer)return{buffer:new Uint8Array(lV),O:!1};if(lV.constructor===D)return{buffer:U(lV)||new Uint8Array(0),O:!0};if(lV instanceof Uint8Array)return{buffer:new Uint8Array(lV.buffer,lV.byteOffset,lV.byteLength),O:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function Cn(lV,J){let VV,RV=0,UV=0,ZV=0;const WV=lV.h;let IV=lV.g;do VV=WV[IV++],RV|=(127&VV)<<ZV,ZV+=7;while(ZV<32&&128&VV);for(ZV>32&&(UV|=(127&VV)>>4),ZV=3;ZV<32&&128&VV;ZV+=7)VV=WV[IV++],UV|=(127&VV)<<ZV;if(Xn(lV,IV),VV<128)return J(RV>>>0,UV>>>0);throw In()}function Nn(lV){let J=0,VV=lV.g;const RV=VV+10,UV=lV.h;for(;VV<RV;){const ZV=UV[VV++];if(J|=ZV,(128&ZV)==0)return Xn(lV,VV),!!(127&J)}throw In()}function Un(lV){const J=lV.h;let VV=lV.g,RV=J[VV++],UV=127&RV;if(128&RV&&(RV=J[VV++],UV|=(127&RV)<<7,128&RV&&(RV=J[VV++],UV|=(127&RV)<<14,128&RV&&(RV=J[VV++],UV|=(127&RV)<<21,128&RV&&(RV=J[VV++],UV|=RV<<28,128&RV&&128&J[VV++]&&128&J[VV++]&&128&J[VV++]&&128&J[VV++]&&128&J[VV++])))))throw In();return Xn(lV,VV),UV}function Dn(lV){return Un(lV)>>>0}function Bn(lV){var J=lV.h;const VV=lV.g,RV=J[VV],UV=J[VV+1],ZV=J[VV+2];return J=J[VV+3],Xn(lV,lV.g+4),(RV<<0|UV<<8|ZV<<16|J<<24)>>>0}function Gn(lV){var J=Bn(lV);lV=2*(J>>31)+1;const VV=J>>>23&255;return J&=8388607,VV==255?J?NaN:lV*(1/0):VV==0?1401298464324817e-60*lV*J:lV*Math.pow(2,VV-150)*(J+8388608)}function jn(lV){return Un(lV)}function Vn(lV,J,{ea:VV=!1}={}){lV.ea=VV,J&&(J=On(J),lV.h=J.buffer,lV.m=J.O,lV.j=0,lV.l=lV.h.length,lV.g=lV.j)}function Xn(lV,J){if(lV.g=J,J>lV.l)throw Pn(lV.l,J)}function Hn(lV,J){if(J<0)throw Error(`Tried to read a negative byte length: ${J}`);const VV=lV.g,RV=VV+J;if(RV>lV.l)throw Pn(J,lV.l-VV);return lV.g=RV,VV}function Wn(lV,J){if(J==0)return N();var VV=Hn(lV,J);return lV.ea&&lV.m?VV=lV.h.subarray(VV,VV+J):(lV=lV.h,VV=VV===(J=VV+J)?new Uint8Array(0):Mt?lV.slice(VV,J):new Uint8Array(lV.subarray(VV,J))),VV.length==0?N():new D(VV,P)}Me.prototype.toJSON=void 0,Me.prototype.La=ht;var zn=[];function Kn(lV){var J=lV.g;if(J.g==J.l)return!1;lV.l=lV.g.g;var VV=Dn(lV.g);if(J=VV>>>3,!((VV&=7)>=0&&VV<=5))throw Mn(VV,lV.l);if(J<1)throw Error(`Invalid field number: ${J} (at position ${lV.l})`);return lV.m=J,lV.h=VV,!0}function Yn(lV){switch(lV.h){case 0:lV.h!=0?Yn(lV):Nn(lV.g);break;case 1:Xn(lV=lV.g,lV.g+8);break;case 2:if(lV.h!=2)Yn(lV);else{var J=Dn(lV.g);Xn(lV=lV.g,lV.g+J)}break;case 5:Xn(lV=lV.g,lV.g+4);break;case 3:for(J=lV.m;;){if(!Kn(lV))throw Error("Unmatched start-group tag: stream EOF");if(lV.h==4){if(lV.m!=J)throw Error("Unmatched end-group tag");break}Yn(lV)}break;default:throw Mn(lV.h,lV.l)}}function $n(lV,J,VV){const RV=lV.g.l,UV=Dn(lV.g),ZV=lV.g.g+UV;let WV=ZV-RV;if(WV<=0&&(lV.g.l=ZV,VV(J,lV,void 0,void 0,void 0),WV=ZV-lV.g.g),WV)throw Error(`Message parsing ended unexpectedly. Expected to read ${UV} bytes, instead read ${UV-WV} bytes, either the data ended unexpectedly or the message misreported its own length`);return lV.g.g=ZV,lV.g.l=RV,J}function qn(lV){var J=Dn(lV.g),VV=Hn(lV=lV.g,J);if(lV=lV.h,o){var RV,UV=lV;(RV=s)||(RV=s=new TextDecoder("utf-8",{fatal:!0})),J=VV+J,UV=VV===0&&J===UV.length?UV:UV.subarray(VV,J);try{var ZV=RV.decode(UV)}catch(IV){if(i$1===void 0){try{RV.decode(new Uint8Array([128]))}catch{}try{RV.decode(new Uint8Array([97])),i$1=!0}catch{i$1=!1}}throw!i$1&&(s=void 0),IV}}else{J=(ZV=VV)+J,VV=[];let IV,dV=null;for(;ZV<J;){var WV=lV[ZV++];WV<128?VV.push(WV):WV<224?ZV>=J?n():(IV=lV[ZV++],WV<194||(192&IV)!=128?(ZV--,n()):VV.push((31&WV)<<6|63&IV)):WV<240?ZV>=J-1?n():(IV=lV[ZV++],(192&IV)!=128||WV===224&&IV<160||WV===237&&IV>=160||(192&(RV=lV[ZV++]))!=128?(ZV--,n()):VV.push((15&WV)<<12|(63&IV)<<6|63&RV)):WV<=244?ZV>=J-2?n():(IV=lV[ZV++],(192&IV)!=128||IV-144+(WV<<28)>>30||(192&(RV=lV[ZV++]))!=128||(192&(UV=lV[ZV++]))!=128?(ZV--,n()):(WV=(7&WV)<<18|(63&IV)<<12|(63&RV)<<6|63&UV,WV-=65536,VV.push(55296+(WV>>10&1023),56320+(1023&WV)))):n(),VV.length>=8192&&(dV=r(dV,VV),VV.length=0)}ZV=r(dV,VV)}return ZV}function Jn(lV){const J=Dn(lV.g);return Wn(lV.g,J)}function Zn(lV,J,VV){var RV=Dn(lV.g);for(RV=lV.g.g+RV;lV.g.g<RV;)VV.push(J(lV.g))}var Qn=[];let tr;function er(lV,J,VV){J.g?J.m(lV,J.g,J.h,VV,!0):J.m(lV,J.h,VV,!0)}var nr=class{constructor(lV,J){this.u=be(lV,J)}toJSON(){return rr(this)}l(){var lV=vo;return lV.g?lV.l(this,lV.g,lV.h,!0):lV.l(this,lV.h,lV.defaultValue,!0)}clone(){const lV=this.u;return Ve(this,lV,et(lV),!1)}O(){return!!(2&tt(this.u))}};function rr(lV){we(lV),lV=tr?lV.u:De(lV.u,Ge,void 0,void 0,!1);{var J=!tr;let CV=lV.length;if(CV){var VV=lV[CV-1],RV=ut(VV);RV?CV--:VV=void 0;var UV=lV;if(RV){V:{var ZV,WV=VV,IV=!1;if(WV)for(let FV in WV)isNaN(+FV)?(ZV??(ZV={}))[FV]=WV[FV]:(RV=WV[FV],Array.isArray(RV)&&(ft(RV)||ct(RV)&&RV.size===0)&&(RV=null),RV==null&&(IV=!0),RV!=null&&((ZV??(ZV={}))[FV]=RV));if(IV||(ZV=WV),ZV)for(let FV in ZV){IV=ZV;break V}IV=null}WV=IV==null?VV!=null:IV!==VV}for(;CV>0&&((ZV=UV[CV-1])==null||ft(ZV)||ct(ZV)&&ZV.size===0);CV--)var dV=!0;(UV!==lV||WV||dV)&&(J?(dV||WV||IV)&&(UV.length=CV):UV=Array.prototype.slice.call(UV,0,CV),IV&&UV.push(IV)),dV=UV}else dV=lV}return dV}function ir(lV){return lV?/^\d+$/.test(lV)?(Vt(lV),new sr(Pt,Ot)):null:or||(or=new sr(0,0))}nr.prototype.Y=at,nr.prototype.toString=function(){try{return tr=!0,rr(this).toString()}finally{tr=!1}};var sr=class{constructor(lV,J){this.h=lV>>>0,this.g=J>>>0}};let or;function ar(lV){return lV?/^-?\d+$/.test(lV)?(Vt(lV),new hr(Pt,Ot)):null:cr||(cr=new hr(0,0))}var hr=class{constructor(lV,J){this.h=lV>>>0,this.g=J>>>0}};let cr;function ur(lV,J,VV){for(;VV>0||J>127;)lV.g.push(127&J|128),J=(J>>>7|VV<<25)>>>0,VV>>>=7;lV.g.push(J)}function lr(lV,J){for(;J>127;)lV.g.push(127&J|128),J>>>=7;lV.g.push(J)}function fr(lV,J){if(J>=0)lr(lV,J);else{for(let VV=0;VV<9;VV++)lV.g.push(127&J|128),J>>=7;lV.g.push(1)}}function dr(lV,J){lV.g.push(J>>>0&255),lV.g.push(J>>>8&255),lV.g.push(J>>>16&255),lV.g.push(J>>>24&255)}function pr(lV,J){J.length!==0&&(lV.l.push(J),lV.h+=J.length)}function gr(lV,J,VV){lr(lV.g,8*J+VV)}function mr(lV,J){return gr(lV,J,2),J=lV.g.end(),pr(lV,J),J.push(lV.h),J}function yr(lV,J){var VV=J.pop();for(VV=lV.h+lV.g.length()-VV;VV>127;)J.push(127&VV|128),VV>>>=7,lV.h++;J.push(VV),lV.h++}function _r(lV,J,VV){gr(lV,J,2),lr(lV.g,VV.length),pr(lV,lV.g.end()),pr(lV,VV)}function vr(lV,J,VV,RV){VV!=null&&(J=mr(lV,J),RV(VV,lV),yr(lV,J))}class Er{constructor(J,VV,RV){this.g=J,this.h=VV,this.qa=RV}}function wr(lV){return Array.isArray(lV)?lV[0]instanceof Er?lV:[gi,lV]:[lV,void 0]}function Tr(lV,J){if(Array.isArray(J)){var VV=tt(J);if(4&VV)return J;for(var RV=0,UV=0;RV<J.length;RV++){const ZV=lV(J[RV]);ZV!=null&&(J[UV++]=ZV)}return UV<RV&&(J.length=UV),nt(J,-12289&(5|VV)),2&VV&&Object.freeze(J),J}}const Ar=Symbol();function br(lV){let J=lV[Ar];if(!J){const VV=Ur(lV),RV=VV.h;J=RV?(UV,ZV)=>RV(UV,ZV,VV):(UV,ZV)=>{var CV;for(;Kn(ZV)&&ZV.h!=4;){var WV=ZV.m;let FV=VV[WV];const NV=!FV;let eV=!1;if(!FV){var IV=VV.X;if(IV){var dV=IV[WV];dV&&(eV=(CV=IV.P)==null?void 0:CV[WV],(!d||eV)&&(IV=kr(dV))&&(FV=VV[WV]=IV))}}FV&&FV(ZV,UV,WV)||(WV=(IV=ZV).l,Yn(IV),IV.ja?IV=void 0:(dV=IV.g.g-WV,IV.g.g=WV,IV=Wn(IV.g,dV)),WV=UV,IV&&(mt||(mt=Symbol()),(dV=WV[mt])?dV.push(IV):WV[mt]=[IV])),NV&&FV&&!eV&&Wr++<5&&j()}},lV[Ar]=J}return J}function kr(lV){const J=(lV=wr(lV))[0].g;if(lV=lV[1]){const VV=br(lV),RV=Ur(lV).g;return(UV,ZV,WV)=>J(UV,ZV,WV,RV,VV)}return J}function Sr(lV,J,VV){lV[J]=VV}function xr(lV,J,VV,RV){var UV=Sr;J.g=function(NV){switch(typeof NV){case"boolean":return pe||(pe=[0,void 0,!0]);case"number":return NV>0?void 0:NV===0?ge||(ge=[0,void 0]):[-NV,void 0];case"string":return[0,NV];case"object":return NV}}(lV[0]);let ZV=0;var WV=lV[++ZV];WV&&WV.constructor===Object&&(J.X=WV,typeof(WV=lV[++ZV])=="function"&&(J.h=WV,J.l=lV[++ZV],WV=lV[++ZV]));const IV={};for(;Array.isArray(WV)&&typeof WV[0]=="number"&&WV[0]>0;){for(var dV=0;dV<WV.length;dV++)IV[WV[dV]]=WV;WV=lV[++ZV]}for(dV=1;WV!==void 0;){let NV;typeof WV=="number"&&(dV+=WV,WV=lV[++ZV]);var CV=void 0;if(WV instanceof Er?NV=WV:(NV=mi,ZV--),NV.qa){WV=lV[++ZV],CV=lV;var FV=ZV;typeof WV=="function"&&(WV=WV(),CV[FV]=WV),CV=WV}for(FV=dV+1,typeof(WV=lV[++ZV])=="number"&&WV<0&&(FV-=WV,WV=lV[++ZV]);dV<FV;dV++){const eV=IV[dV];UV(J,dV,CV?RV(NV,CV,eV):VV(NV,eV))}}return J}const Lr=Symbol();function Rr(lV){let J=lV[Lr];if(!J){const VV=Pr(lV);J=(RV,UV)=>Br(RV,UV,VV),lV[Lr]=J}return J}const Fr=Symbol();function Mr(lV){return lV.h}function Ir(lV,J){let VV,RV;const UV=lV.h;return(ZV,WV,IV)=>UV(ZV,WV,IV,RV||(RV=Pr(J).g),VV||(VV=Rr(J)))}function Pr(lV){let J=lV[Fr];return J||(J=xr(lV,lV[Fr]={},Mr,Ir))}const Or=Symbol();function Cr(lV,J){const VV=lV.g;return J?(RV,UV,ZV)=>VV(RV,UV,ZV,J):VV}function Nr(lV,J,VV){const RV=lV.g;let UV,ZV;return(WV,IV,dV)=>RV(WV,IV,dV,ZV||(ZV=Ur(J).g),UV||(UV=br(J)),VV)}function Ur(lV){let J=lV[Or];return J||(J=xr(lV,lV[Or]={},Cr,Nr))}function Dr(lV,J){var ZV;var VV=lV[J];if(VV)return VV;if(VV=lV.X){var RV=VV[J];if(RV){var UV=(RV=wr(RV))[0].h;if(RV=RV[1],VV=(ZV=VV.P)==null?void 0:ZV[J],!d||VV){if(RV){const WV=Rr(RV),IV=Pr(RV).g;VV=(VV=lV.l)?VV(IV,WV):(dV,CV,FV)=>UV(dV,CV,FV,IV,WV)}else VV=UV;return lV[J]=VV}}}}function Br(lV,J,VV){var dV,CV,FV;for(var RV=et(lV),UV=+!!(512&RV)-1,ZV=lV.length,WV=512&RV?1:0,IV=ZV+(256&RV?-1:0);WV<IV;WV++){const NV=lV[WV];if(NV==null)continue;const eV=WV-UV,gV=Dr(VV,eV);if(!gV)continue;const nV=VV.X;nV!=null&&nV[eV]&&!((dV=nV==null?void 0:nV.P)!=null&&dV[eV])&&Wr++<5&&j(),gV(J,NV,eV)}if(256&RV){RV=lV[ZV-1];for(let NV in RV)UV=+NV,!Number.isNaN(UV)&&(ZV=RV[NV])!=null&&(IV=Dr(VV,UV))&&((CV=WV=VV.X)!=null&&CV[UV]&&!((FV=WV==null?void 0:WV.P)!=null&&FV[UV])&&Wr++<5&&j(),IV(J,ZV,UV))}if(lV=mt?lV[mt]:void 0)for(pr(J,J.g.end()),VV=0;VV<lV.length;VV++)pr(J,U(lV[VV])||new Uint8Array(0))}function Gr(lV,J){return new Er(lV,J,!1)}function jr(lV,J){return new Er(lV,J,!1)}function Vr(lV,J){return new Er(lV,J,!0)}function Xr(lV,J,VV){qe(lV,et(lV),J,VV)}var Hr=Vr(function(lV,J,VV,RV,UV){return lV.h===2&&(lV=$n(lV,Ae([void 0,void 0],RV),UV),pt(RV=et(J)),(UV=Ye(J,RV,VV))instanceof Me?2&UV.M?((UV=UV.Z()).push(lV),qe(J,RV,VV,UV)):UV.Qa(lV):Array.isArray(UV)?(2&tt(UV)&&qe(J,RV,VV,UV=on(UV)),UV.push(lV)):qe(J,RV,VV,[lV]),!0)},function(lV,J,VV,RV,UV){if(J instanceof Me)J.forEach((ZV,WV)=>{vr(lV,VV,Ae([WV,ZV],RV),UV)});else if(Array.isArray(J))for(let ZV=0;ZV<J.length;ZV++){const WV=J[ZV];Array.isArray(WV)&&vr(lV,VV,Ae(WV,RV),UV)}});let Wr=0;function zr(lV,J,VV){if(J=function(RV){if(RV==null)return RV;const UV=typeof RV;if(UV==="bigint")return String(BigInt.asIntN(64,RV));if(Kt(RV)){if(UV==="string")return Zt(RV);if(UV==="number")return Jt(RV)}}(J),J!=null&&(typeof J=="string"&&ar(J),J!=null))switch(gr(lV,VV,0),typeof J){case"number":lV=lV.g,Nt(J),ur(lV,Pt,Ot);break;case"bigint":VV=BigInt.asUintN(64,J),VV=new hr(Number(VV&BigInt(4294967295)),Number(VV>>BigInt(32))),ur(lV.g,VV.h,VV.g);break;default:VV=ar(J),ur(lV.g,VV.h,VV.g)}}function Kr(lV,J,VV){(J=Yt(J))!=null&&J!=null&&(gr(lV,VV,0),fr(lV.g,J))}function Yr(lV,J,VV){(J=Wt(J))!=null&&(gr(lV,VV,0),lV.g.g.push(J?1:0))}function $r(lV,J,VV){(J=re(J))!=null&&_r(lV,VV,c(J))}function qr(lV,J,VV,RV,UV){J instanceof nr?(we(J),J=J.u):J=Array.isArray(J)?Ae(J,RV):void 0,vr(lV,VV,J,UV)}function Jr(lV,J,VV){(J=J==null||typeof J=="string"||I(J)||J instanceof D?J:void 0)!=null&&_r(lV,VV,On(J).buffer)}function Zr(lV,J,VV){return(lV.h===5||lV.h===2)&&(J=Je(J,et(J),VV,2,!1),lV.h==2?Zn(lV,Gn,J):J.push(Gn(lV.g)),!0)}var Qr,ti=Gr(function(lV,J,VV){if(lV.h!==1)return!1;var RV=lV.g;lV=Bn(RV);const UV=Bn(RV);RV=2*(UV>>31)+1;const ZV=UV>>>20&2047;return lV=4294967296*(1048575&UV)+lV,Xr(J,VV,ZV==2047?lV?NaN:RV*(1/0):ZV==0?5e-324*RV*lV:RV*Math.pow(2,ZV-1075)*(lV+4503599627370496)),!0},function(lV,J,VV){(J=Ht(J))!=null&&(gr(lV,VV,1),lV=lV.g,(VV=It||(It=new DataView(new ArrayBuffer(8)))).setFloat64(0,+J,!0),Pt=VV.getUint32(0,!0),Ot=VV.getUint32(4,!0),dr(lV,Pt),dr(lV,Ot))}),ei=Gr(function(lV,J,VV){return lV.h===5&&(Xr(J,VV,Gn(lV.g)),!0)},function(lV,J,VV){(J=Ht(J))!=null&&(gr(lV,VV,5),lV=lV.g,Ut(J),dr(lV,Pt))}),ni=jr(Zr,function(lV,J,VV){if((J=Tr(Ht,J))!=null)for(let WV=0;WV<J.length;WV++){var RV=lV,UV=VV,ZV=J[WV];ZV!=null&&(gr(RV,UV,5),RV=RV.g,Ut(ZV),dr(RV,Pt))}}),ri=jr(Zr,function(lV,J,VV){if((J=Tr(Ht,J))!=null&&J.length){gr(lV,VV,2),lr(lV.g,4*J.length);for(let RV=0;RV<J.length;RV++)VV=lV.g,Ut(J[RV]),dr(VV,Pt)}}),ii=Gr(function(lV,J,VV){return lV.h===0&&(Xr(J,VV,Cn(lV.g,Bt)),!0)},zr),si=Gr(function(lV,J,VV){return lV.h===0&&(Xr(J,VV,(lV=Cn(lV.g,Bt))===0?void 0:lV),!0)},zr),oi=Gr(function(lV,J,VV){return lV.h===0&&(Xr(J,VV,Cn(lV.g,Dt)),!0)},function(lV,J,VV){if((J=te(J))!=null&&(typeof J=="string"&&ir(J),J!=null))switch(gr(lV,VV,0),typeof J){case"number":lV=lV.g,Nt(J),ur(lV,Pt,Ot);break;case"bigint":VV=BigInt.asUintN(64,J),VV=new sr(Number(VV&BigInt(4294967295)),Number(VV>>BigInt(32))),ur(lV.g,VV.h,VV.g);break;default:VV=ir(J),ur(lV.g,VV.h,VV.g)}}),ai=Gr(function(lV,J,VV){return lV.h===0&&(Xr(J,VV,Un(lV.g)),!0)},Kr),hi=jr(function(lV,J,VV){return(lV.h===0||lV.h===2)&&(J=Je(J,et(J),VV,2,!1),lV.h==2?Zn(lV,Un,J):J.push(Un(lV.g)),!0)},function(lV,J,VV){if((J=Tr(Yt,J))!=null&&J.length){VV=mr(lV,VV);for(let RV=0;RV<J.length;RV++)fr(lV.g,J[RV]);yr(lV,VV)}}),ci=Gr(function(lV,J,VV){return lV.h===0&&(Xr(J,VV,(lV=Un(lV.g))===0?void 0:lV),!0)},Kr),ui=Gr(function(lV,J,VV){return lV.h===0&&(Xr(J,VV,Nn(lV.g)),!0)},Yr),li=Gr(function(lV,J,VV){return lV.h===0&&(Xr(J,VV,(lV=Nn(lV.g))===!1?void 0:lV),!0)},Yr),fi=jr(function(lV,J,VV){if(lV.h!==2)return!1;lV=qn(lV);const RV=et(J);return pt(RV),Je(J,RV,VV,2).push(lV),!0},function(lV,J,VV){if((J=Tr(re,J))!=null)for(let WV=0;WV<J.length;WV++){var RV=lV,UV=VV,ZV=J[WV];ZV!=null&&_r(RV,UV,c(ZV))}}),di=Gr(function(lV,J,VV){return lV.h===2&&(Xr(J,VV,(lV=qn(lV))===""?void 0:lV),!0)},$r),pi=Gr(function(lV,J,VV){return lV.h===2&&(Xr(J,VV,qn(lV)),!0)},$r),gi=Vr(function(lV,J,VV,RV,UV){return lV.h===2&&($n(lV,fn(J,RV,VV,!0),UV),!0)},qr),mi=Vr(function(lV,J,VV,RV,UV){return lV.h===2&&($n(lV,fn(J,RV,VV),UV),!0)},qr);Qr=new Er(function(lV,J,VV,RV,UV){if(lV.h!==2)return!1;RV=Ae(void 0,RV);let ZV=et(J);pt(ZV);let WV=Je(J,ZV,VV,3);return ZV=et(J),4&tt(WV)&&(WV=H(WV),nt(WV,-2079&(1|tt(WV))),qe(J,ZV,VV,WV)),WV.push(RV),$n(lV,RV,UV),!0},function(lV,J,VV,RV,UV){if(Array.isArray(J))for(let ZV=0;ZV<J.length;ZV++)qr(lV,J[ZV],VV,RV,UV)},!0);var yi=Vr(function(lV,J,VV,RV,UV,ZV){return lV.h===2&&(un(J,et(J),ZV,VV),$n(lV,J=fn(J,RV,VV),UV),!0)},qr),_i=Gr(function(lV,J,VV){return lV.h===2&&(Xr(J,VV,Jn(lV)),!0)},Jr),vi=jr(function(lV,J,VV){return(lV.h===0||lV.h===2)&&(J=Je(J,et(J),VV,2,!1),lV.h==2?Zn(lV,Dn,J):J.push(Dn(lV.g)),!0)},function(lV,J,VV){if((J=Tr($t,J))!=null)for(let WV=0;WV<J.length;WV++){var RV=lV,UV=VV,ZV=J[WV];ZV!=null&&(gr(RV,UV,0),lr(RV.g,ZV))}}),Ei=Gr(function(lV,J,VV){return lV.h===0&&(Xr(J,VV,Un(lV.g)),!0)},function(lV,J,VV){(J=Yt(J))!=null&&(J=parseInt(J,10),gr(lV,VV,0),fr(lV.g,J))});class wi{constructor(J,VV){this.h=J,this.g=VV,this.l=pn,this.m=yn,this.defaultValue=void 0}}function Ti(lV,J){return new wi(lV,J)}function Ai(lV,J){return(VV,RV)=>{if(Qn.length){const ZV=Qn.pop();ZV.o(RV),Vn(ZV.g,VV,RV),VV=ZV}else VV=new class{constructor(ZV,WV){if(zn.length){const IV=zn.pop();Vn(IV,ZV,WV),ZV=IV}else ZV=new class{constructor(IV,dV){this.h=null,this.m=!1,this.g=this.l=this.j=0,Vn(this,IV,dV)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.ea=!1}}(ZV,WV);this.g=ZV,this.l=this.g.g,this.h=this.m=-1,this.o(WV)}o({ja:ZV=!1}={}){this.ja=ZV}}(VV,RV);try{const ZV=new lV,WV=ZV.u;br(J)(WV,VV);var UV=ZV}finally{VV.g.clear(),VV.m=-1,VV.h=-1,Qn.length<100&&Qn.push(VV)}return UV}}function bi(lV){return function(){we(this);const J=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const WV=this.g;return this.g=[],WV}}}};Br(this.u,J,Pr(lV)),pr(J,J.g.end());const VV=new Uint8Array(J.h),RV=J.l,UV=RV.length;let ZV=0;for(let WV=0;WV<UV;WV++){const IV=RV[WV];VV.set(IV,ZV),ZV+=IV.length}return J.l=[VV],VV}}var ki=class extends nr{constructor(lV){super(lV)}},Si=[0,di,Gr(function(lV,J,VV){return lV.h===2&&(Xr(J,VV,(lV=Jn(lV))===N()?void 0:lV),!0)},function(lV,J,VV){if(J!=null){if(J instanceof nr){const RV=J.Ta;return void(RV&&(J=RV(J),J!=null&&_r(lV,VV,On(J).buffer)))}if(Array.isArray(J))return}Jr(lV,J,VV)})],xi=[0,ai,Ei,ui,-1,hi,Ei,-1],Li=class extends nr{constructor(){super()}},Ri=[0,ui,pi,ui,Ei,-1,jr(function(lV,J,VV){return(lV.h===0||lV.h===2)&&(J=Je(J,et(J),VV,2,!1),lV.h==2?Zn(lV,jn,J):J.push(Un(lV.g)),!0)},function(lV,J,VV){if((J=Tr(Yt,J))!=null&&J.length){VV=mr(lV,VV);for(let RV=0;RV<J.length;RV++)fr(lV.g,J[RV]);yr(lV,VV)}}),pi,-1,[0,ui,-1],Ei,ui,-1],Fi=[0,pi,-2],Mi=class extends nr{constructor(){super()}},Ii=[0],Pi=[0,ai,ui,1,ui,-3],Oi=[0,pi,ui,-1,ai,[0,[1,2,3,4,5,6,7],yi,Ii,yi,Ri,yi,Fi,yi,Pi,yi,xi,yi,[0,pi,-2],yi,[0,pi,Ei]],[0,pi],ui,[0,[1,3],[2,4],yi,[0,hi],-1,yi,[0,fi],-1,Qr,[0,pi,-1]],pi],Ci=class extends nr{constructor(lV){super(lV,2)}},Ni={},Ui=Ni.P={};Ni[336783863]=Oi,Ui[336783863]=1;var Di=[0,si,-1,li,-3,si,hi,di,ci,si,-1,li,ci,li,-2,di];function Bi(lV,J){an(lV,2,ne(J),"")}function Gi(lV,J){Fn(lV,3,J)}function ji(lV,J){Fn(lV,4,J)}var Vi=class extends nr{constructor(lV){super(lV,500)}o(lV){return yn(this,0,7,lV)}},Xi=[-1,{P:{}}],Hi=[0,pi,1,Xi],Wi=[0,pi,fi,Xi];function zi(lV,J){wn(lV,1,Vi,J)}function Ki(lV,J){Fn(lV,10,J)}function Yi(lV,J){Fn(lV,15,J)}var $i=class extends nr{constructor(lV){super(lV,500)}o(lV){return yn(this,0,1001,lV)}},qi=[-500,Qr,[-500,di,-1,fi,-3,[-2,Ni,ui],Qr,Si,ci,-1,Hi,Wi,Qr,[0,di,li],di,Di,ci,fi,987,fi],4,Qr,[-500,pi,-1,[-1,{P:{}}],998,pi],Qr,[-500,pi,fi,-1,[-2,{P:{}},ui],997,fi,-1],ci,Qr,[-500,pi,fi,Xi,998,fi],fi,ci,Hi,Wi,Qr,[0,di,-1,Xi],fi,-2,Di,di,-1,li,979,Xi,Qr,Si];$i.prototype.g=bi(qi);var Ji=Ai($i,qi),Zi=class extends nr{constructor(lV){super(lV)}},Qi=class extends nr{constructor(lV){super(lV)}g(){return mn(this,Zi,1)}},ts=[0,Qr,[0,ai,ei,pi,-1]],es=Ai(Qi,ts),ns=class extends nr{constructor(lV){super(lV)}},rs=class extends nr{constructor(lV){super(lV)}},is=class extends nr{constructor(lV){super(lV)}h(){return pn(this,ns,2)}g(){return mn(this,rs,5)}},ss=Ai(class extends nr{constructor(lV){super(lV)}},[0,fi,hi,ri,[0,Ei,[0,ai,-3],[0,ei,-3],[0,ai,-1,[0,Qr,[0,ai,-2]]],Qr,[0,ei,-1,pi,ei]],pi,-1,ii,Qr,[0,ai,ei],fi,ii]),os=class extends nr{constructor(lV){super(lV)}},as=Ai(class extends nr{constructor(lV){super(lV)}},[0,Qr,[0,ei,-4]]),hs=class extends nr{constructor(lV){super(lV)}},cs=Ai(class extends nr{constructor(lV){super(lV)}},[0,Qr,[0,ei,-4]]),us=class extends nr{constructor(lV){super(lV)}},ls=[0,ai,-1,ri,Ei],fs=class extends nr{constructor(){super()}};fs.prototype.g=bi([0,ei,-4,ii]);var ds=class extends nr{constructor(lV){super(lV)}},ps=Ai(class extends nr{constructor(lV){super(lV)}},[0,Qr,[0,1,ai,pi,ts],ii]),gs=class extends nr{constructor(lV){super(lV)}},ms=class extends nr{constructor(lV){super(lV)}ra(){const lV=Qe(this);return lV??N()}},ys=class extends nr{constructor(lV){super(lV)}},_s=[1,2],vs=Ai(class extends nr{constructor(lV){super(lV)}},[0,Qr,[0,_s,yi,[0,ri],yi,[0,_i],ai,pi],ii]),Es=class extends nr{constructor(lV){super(lV)}},ws=[0,pi,ai,ei,fi,-1],Ts=class extends nr{constructor(lV){super(lV)}},As=[0,ui,-1],bs=class extends nr{constructor(lV){super(lV)}},ks=[1,2,3,4,5],Ss=class extends nr{constructor(lV){super(lV)}g(){return Qe(this)!=null}h(){return re(ze(this,2))!=null}},xs=class extends nr{constructor(lV){super(lV)}g(){return Wt(ze(this,2))??!1}},Ls=[0,_i,pi,[0,ai,ii,-1],[0,oi,ii]],Rs=[0,Ls,ui,[0,ks,yi,Pi,yi,Ri,yi,xi,yi,Ii,yi,Fi],Ei],Fs=class extends nr{constructor(lV){super(lV)}},Ms=[0,Rs,ei,-1,ai],Is=Ti(502141897,Fs);Ni[502141897]=Ms,Ui[502141897]=1;var Ps=[0,Ls];Ni[512499200]=Ps;var Os=[0,Ps];Ni[515723506]=Os;var Cs=Ai(class extends nr{constructor(lV){super(lV)}},[0,[0,Ei,-1,ni,vi],ls]),Ns=[0,Rs];Ni[508981768]=Ns;var Us=class extends nr{constructor(lV){super(lV)}},Ds=class extends nr{constructor(lV){super(lV)}},Bs=[0,Rs,ei,Ns,ui],Gs=[0,Rs,Ms,Bs,ei,Os];Ni[508968149]=Bs;var js=Ti(508968150,Ds);Ni[508968150]=Gs,Ui[508968150]=1,Ui[508968149]=1;var Vs=class extends nr{constructor(lV){super(lV)}},Xs=Ti(513916220,Vs);Ni[513916220]=[0,Rs,Gs,ai],Ui[513916220]=1;var Hs=class extends nr{constructor(lV){super(lV)}h(){return pn(this,Es,2)}g(){$e(this,2)}},Ws=[0,Rs,ws];Ni[478825465]=Ws,Ui[478825465]=1;var zs=[0,Rs];Ni[478825422]=zs;var Ks=class extends nr{constructor(lV){super(lV)}},Ys=class extends nr{constructor(lV){super(lV)}},$s=class extends nr{constructor(lV){super(lV)}},qs=class extends nr{constructor(lV){super(lV)}},Js=class extends nr{constructor(lV){super(lV)}},Zs=[0,Rs,zs,Ws,-1],Qs=[0,Rs,ei,ai],to=[0,Rs,ei],eo=[0,Rs,Qs,to,ei],no=[0,Rs,eo,Zs];Ni[463370452]=Zs,Ni[464864288]=Qs,Ni[474472470]=to;var ro=Ti(462713202,qs);Ni[462713202]=eo;var io=Ti(479097054,Js);Ni[479097054]=no,Ui[479097054]=1,Ui[463370452]=1,Ui[464864288]=1,Ui[462713202]=1,Ui[474472470]=1;var so=class extends nr{constructor(lV){super(lV)}},oo=class extends nr{constructor(lV){super(lV)}},ao=class extends nr{constructor(lV){super(lV)}},ho=class extends nr{constructor(){super()}},co=[0,Rs,ei,-1,ai],uo=[0,Rs,ei,ui];ho.prototype.g=bi([0,Rs,to,[0,Rs],Ms,Bs,co,uo]),Ni[514774813]=co,Ni[518928384]=uo;var lo=class extends nr{constructor(lV){super(lV)}},fo=Ti(456383383,lo);Ni[456383383]=[0,Rs,ws],Ui[456383383]=1;var po=class extends nr{constructor(lV){super(lV)}},go=Ti(476348187,po);Ni[476348187]=[0,Rs,As],Ui[476348187]=1;var mo=class extends nr{constructor(lV){super(lV)}},yo=class extends nr{constructor(lV){super(lV)}},_o=[0,Ei,-1],vo=Ti(458105876,class extends nr{constructor(lV){super(lV)}g(){var lV=this.u;const J=et(lV),VV=2&J;return lV=function(RV,UV,ZV){var WV=yo;const IV=2&UV;let dV=!1;if(ZV==null){if(IV)return Ne();ZV=[]}else if(ZV.constructor===Me){if(!(2&ZV.M)||IV)return ZV;ZV=ZV.Z()}else Array.isArray(ZV)?dV=!!(2&tt(ZV)):ZV=[];if(IV){if(!ZV.length)return Ne();dV||(dV=!0,rt(ZV))}else dV&&(dV=!1,ZV=on(ZV));return dV||(64&tt(ZV)?Q(ZV,32):32&UV&&Z(ZV,32)),qe(RV,UV,2,WV=new Me(ZV,WV,se,void 0)),WV}(lV,J,Ye(lV,J,2)),!VV&&yo&&(lV.va=!0),lV}});Ni[458105876]=[0,_o,Hr,[!0,ii,[0,pi,-1,fi]]],Ui[458105876]=1;var Eo=class extends nr{constructor(lV){super(lV)}},wo=Ti(458105758,Eo);Ni[458105758]=[0,Rs,pi,_o],Ui[458105758]=1;var To=class extends nr{constructor(lV){super(lV)}},Ao=Ti(443442058,To);Ni[443442058]=[0,Rs,pi,ai,ei,fi,-1],Ui[443442058]=1,Ui[514774813]=1;var bo=class extends nr{constructor(lV){super(lV)}},ko=Ti(516587230,bo);function So(lV,J){return J=J?J.clone():new Es,lV.displayNamesLocale!==void 0?$e(J,1,ne(lV.displayNamesLocale)):lV.displayNamesLocale===void 0&&$e(J,1),lV.maxResults!==void 0?xn(J,2,lV.maxResults):"maxResults"in lV&&$e(J,2),lV.scoreThreshold!==void 0?Ln(J,3,lV.scoreThreshold):"scoreThreshold"in lV&&$e(J,3),lV.categoryAllowlist!==void 0?Rn(J,4,lV.categoryAllowlist):"categoryAllowlist"in lV&&$e(J,4),lV.categoryDenylist!==void 0?Rn(J,5,lV.categoryDenylist):"categoryDenylist"in lV&&$e(J,5),J}function xo(lV,J=-1,VV=""){return{categories:lV.map(RV=>({index:Tn(An(RV,1),0)??-1,score:bn(RV,2)??0,categoryName:kn(RV,3)??"",displayName:kn(RV,4)??""})),headIndex:J,headName:VV}}function Lo(lV){var WV,IV;var J=en(lV,3,Ht,tn()),VV=en(lV,2,Yt,tn()),RV=en(lV,1,re,tn()),UV=en(lV,9,re,tn());const ZV={categories:[],keypoints:[]};for(let dV=0;dV<J.length;dV++)ZV.categories.push({score:J[dV],index:VV[dV]??-1,categoryName:RV[dV]??"",displayName:UV[dV]??""});if((J=(WV=pn(lV,is,4))==null?void 0:WV.h())&&(ZV.boundingBox={originX:An(J,1)??0,originY:An(J,2)??0,width:An(J,3)??0,height:An(J,4)??0,angle:0}),(IV=pn(lV,is,4))==null?void 0:IV.g().length)for(const dV of pn(lV,is,4).g())ZV.keypoints.push({x:Ze(dV,1)??0,y:Ze(dV,2)??0,score:Ze(dV,4)??0,label:re(ze(dV,3))??""});return ZV}function Ro(lV){const J=[];for(const VV of mn(lV,hs,1))J.push({x:bn(VV,1)??0,y:bn(VV,2)??0,z:bn(VV,3)??0,visibility:bn(VV,4)??0});return J}function Fo(lV){const J=[];for(const VV of mn(lV,os,1))J.push({x:bn(VV,1)??0,y:bn(VV,2)??0,z:bn(VV,3)??0,visibility:bn(VV,4)??0});return J}function Mo(lV){return Array.from(lV,J=>J>127?J-256:J)}function Io(lV,J){if(lV.length!==J.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${lV.length} vs. ${J.length}).`);let VV=0,RV=0,UV=0;for(let ZV=0;ZV<lV.length;ZV++)VV+=lV[ZV]*J[ZV],RV+=lV[ZV]*lV[ZV],UV+=J[ZV]*J[ZV];if(RV<=0||UV<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return VV/Math.sqrt(RV*UV)}let Po;Ni[516587230]=[0,Rs,co,uo,ei],Ui[516587230]=1,Ui[518928384]=1;const Oo=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function Co(){if(Po===void 0)try{await WebAssembly.instantiate(Oo),Po=!0}catch{Po=!1}return Po}async function No(lV,J=""){const VV=await Co()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${J}/${lV}_${VV}.js`,wasmBinaryPath:`${J}/${lV}_${VV}.wasm`}}var Uo=class{};function Do(){var lV=navigator;return typeof OffscreenCanvas<"u"&&(!function(J=navigator){return(J=J.userAgent).includes("Safari")&&!J.includes("Chrome")}(lV)||!!((lV=lV.userAgent.match(/Version\/([\d]+).*Safari/))&&lV.length>=1&&Number(lV[1])>=17))}async function Bo(lV){if(typeof importScripts!="function"){const J=document.createElement("script");return J.src=lV.toString(),J.crossOrigin="anonymous",new Promise((VV,RV)=>{J.addEventListener("load",()=>{VV()},!1),J.addEventListener("error",UV=>{RV(UV)},!1),document.body.appendChild(J)})}importScripts(lV.toString())}function Go(lV){return lV.videoWidth!==void 0?[lV.videoWidth,lV.videoHeight]:lV.naturalWidth!==void 0?[lV.naturalWidth,lV.naturalHeight]:lV.displayWidth!==void 0?[lV.displayWidth,lV.displayHeight]:[lV.width,lV.height]}function jo(lV,J,VV){lV.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),VV(J=lV.i.stringToNewUTF8(J)),lV.i._free(J)}function Vo(lV,J,VV){if(!lV.i.canvas)throw Error("No OpenGL canvas configured.");if(VV?lV.i._bindTextureToStream(VV):lV.i._bindTextureToCanvas(),!(VV=lV.i.canvas.getContext("webgl2")||lV.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");lV.i.gpuOriginForWebTexturesIsBottomLeft&&VV.pixelStorei(VV.UNPACK_FLIP_Y_WEBGL,!0),VV.texImage2D(VV.TEXTURE_2D,0,VV.RGBA,VV.RGBA,VV.UNSIGNED_BYTE,J),lV.i.gpuOriginForWebTexturesIsBottomLeft&&VV.pixelStorei(VV.UNPACK_FLIP_Y_WEBGL,!1);const[RV,UV]=Go(J);return!lV.l||RV===lV.i.canvas.width&&UV===lV.i.canvas.height||(lV.i.canvas.width=RV,lV.i.canvas.height=UV),[RV,UV]}function Xo(lV,J,VV){lV.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const RV=new Uint32Array(J.length);for(let UV=0;UV<J.length;UV++)RV[UV]=lV.i.stringToNewUTF8(J[UV]);J=lV.i._malloc(4*RV.length),lV.i.HEAPU32.set(RV,J>>2),VV(J);for(const UV of RV)lV.i._free(UV);lV.i._free(J)}function Ho(lV,J,VV){lV.i.simpleListeners=lV.i.simpleListeners||{},lV.i.simpleListeners[J]=VV}function Wo(lV,J,VV){let RV=[];lV.i.simpleListeners=lV.i.simpleListeners||{},lV.i.simpleListeners[J]=(UV,ZV,WV)=>{ZV?(VV(RV,WV),RV=[]):RV.push(UV)}}Uo.forVisionTasks=function(lV){return No("vision",lV)},Uo.forTextTasks=function(lV){return No("text",lV)},Uo.forGenAiExperimentalTasks=function(lV){return No("genai_experimental",lV)},Uo.forGenAiTasks=function(lV){return No("genai",lV)},Uo.forAudioTasks=function(lV){return No("audio",lV)},Uo.isSimdSupported=function(){return Co()};async function zo(lV,J,VV,RV){return lV=await(async(UV,ZV,WV,IV,dV)=>{if(ZV&&await Bo(ZV),!self.ModuleFactory||WV&&(await Bo(WV),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&dV&&((ZV=self.Module).locateFile=dV.locateFile,dV.mainScriptUrlOrBlob&&(ZV.mainScriptUrlOrBlob=dV.mainScriptUrlOrBlob)),dV=await self.ModuleFactory(self.Module||dV),self.ModuleFactory=self.Module=void 0,new UV(dV,IV)})(lV,VV.wasmLoaderPath,VV.assetLoaderPath,J,{locateFile:UV=>UV.endsWith(".wasm")?VV.wasmBinaryPath.toString():VV.assetBinaryPath&&UV.endsWith(".data")?VV.assetBinaryPath.toString():UV}),await lV.o(RV),lV}function Ko(lV,J){const VV=pn(lV.baseOptions,Ss,1)||new Ss;typeof J=="string"?($e(VV,2,ne(J)),$e(VV,1)):J instanceof Uint8Array&&($e(VV,1,lt(J,!1,!1)),$e(VV,2)),yn(lV.baseOptions,0,1,VV)}function Yo(lV){try{const J=lV.H.length;if(J===1)throw Error(lV.H[0].message);if(J>1)throw Error("Encountered multiple errors: "+lV.H.map(VV=>VV.message).join(", "))}finally{lV.H=[]}}function $o(lV,J){lV.B=Math.max(lV.B,J)}function qo(lV,J){lV.A=new Vi,Bi(lV.A,"PassThroughCalculator"),Gi(lV.A,"free_memory"),ji(lV.A,"free_memory_unused_out"),Ki(J,"free_memory"),zi(J,lV.A)}function Jo(lV,J){Gi(lV.A,J),ji(lV.A,J+"_unused_out")}function Zo(lV){lV.g.addBoolToStream(!0,"free_memory",lV.B)}var Qo=class{constructor(lV){this.g=lV,this.H=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(lV,J=!0){var VV,RV,UV,ZV,WV,IV;if(J){const dV=lV.baseOptions||{};if((VV=lV.baseOptions)!=null&&VV.modelAssetBuffer&&((RV=lV.baseOptions)!=null&&RV.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((UV=pn(this.baseOptions,Ss,1))!=null&&UV.g()||(ZV=pn(this.baseOptions,Ss,1))!=null&&ZV.h()||(WV=lV.baseOptions)!=null&&WV.modelAssetBuffer||(IV=lV.baseOptions)!=null&&IV.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(CV,FV){let NV=pn(CV.baseOptions,bs,3);if(!NV){var eV=NV=new bs,gV=new Mi;_n(eV,4,ks,gV)}"delegate"in FV&&(FV.delegate==="GPU"?(FV=NV,eV=new Li,_n(FV,2,ks,eV)):(FV=NV,eV=new Mi,_n(FV,4,ks,eV))),yn(CV.baseOptions,0,3,NV)}(this,dV),dV.modelAssetPath)return fetch(dV.modelAssetPath.toString()).then(CV=>{if(CV.ok)return CV.arrayBuffer();throw Error(`Failed to fetch model: ${dV.modelAssetPath} (${CV.status})`)}).then(CV=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(CV),!0,!1,!1),Ko(this,"/model.dat"),this.m(),this.J()});if(dV.modelAssetBuffer instanceof Uint8Array)Ko(this,dV.modelAssetBuffer);else if(dV.modelAssetBuffer)return async function(CV){const FV=[];for(var NV=0;;){const{done:eV,value:gV}=await CV.read();if(eV)break;FV.push(gV),NV+=gV.length}if(FV.length===0)return new Uint8Array(0);if(FV.length===1)return FV[0];CV=new Uint8Array(NV),NV=0;for(const eV of FV)CV.set(eV,NV),NV+=eV.length;return CV}(dV.modelAssetBuffer).then(CV=>{Ko(this,CV),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ga(){let lV;if(this.g.ga(J=>{lV=Ji(J)}),!lV)throw Error("Failed to retrieve CalculatorGraphConfig");return lV}setGraph(lV,J){this.g.attachErrorListener((VV,RV)=>{this.H.push(Error(RV))}),this.g.Oa(),this.g.setGraph(lV,J),this.A=void 0,Yo(this)}finishProcessing(){this.g.finishProcessing(),Yo(this)}close(){this.A=void 0,this.g.closeGraph()}};function ta(lV,J){if(!lV)throw Error(`Unable to obtain required WebGL resource: ${J}`);return lV}Qo.prototype.close=Qo.prototype.close,function(lV,J){lV=lV.split(".");var VV,RV=t;for((lV[0]in RV)||RV.execScript===void 0||RV.execScript("var "+lV[0]);lV.length&&(VV=lV.shift());)lV.length||J===void 0?RV=RV[VV]&&RV[VV]!==Object.prototype[VV]?RV[VV]:RV[VV]={}:RV[VV]=J}("TaskRunner",Qo);class ea{constructor(J,VV,RV,UV){this.g=J,this.h=VV,this.m=RV,this.l=UV}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function na(lV,J,VV){const RV=lV.g;if(VV=ta(RV.createShader(VV),"Failed to create WebGL shader"),RV.shaderSource(VV,J),RV.compileShader(VV),!RV.getShaderParameter(VV,RV.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${RV.getShaderInfoLog(VV)}`);return RV.attachShader(lV.h,VV),VV}function ra(lV,J){const VV=lV.g,RV=ta(VV.createVertexArray(),"Failed to create vertex array");VV.bindVertexArray(RV);const UV=ta(VV.createBuffer(),"Failed to create buffer");VV.bindBuffer(VV.ARRAY_BUFFER,UV),VV.enableVertexAttribArray(lV.R),VV.vertexAttribPointer(lV.R,2,VV.FLOAT,!1,0,0),VV.bufferData(VV.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),VV.STATIC_DRAW);const ZV=ta(VV.createBuffer(),"Failed to create buffer");return VV.bindBuffer(VV.ARRAY_BUFFER,ZV),VV.enableVertexAttribArray(lV.J),VV.vertexAttribPointer(lV.J,2,VV.FLOAT,!1,0,0),VV.bufferData(VV.ARRAY_BUFFER,new Float32Array(J?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),VV.STATIC_DRAW),VV.bindBuffer(VV.ARRAY_BUFFER,null),VV.bindVertexArray(null),new ea(VV,RV,UV,ZV)}function ia(lV,J){if(lV.g){if(J!==lV.g)throw Error("Cannot change GL context once initialized")}else lV.g=J}function sa(lV,J,VV,RV){return ia(lV,J),lV.h||(lV.m(),lV.C()),VV?(lV.s||(lV.s=ra(lV,!0)),VV=lV.s):(lV.v||(lV.v=ra(lV,!1)),VV=lV.v),J.useProgram(lV.h),VV.bind(),lV.l(),lV=RV(),VV.g.bindVertexArray(null),lV}function oa(lV,J,VV){return ia(lV,J),lV=ta(J.createTexture(),"Failed to create texture"),J.bindTexture(J.TEXTURE_2D,lV),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_WRAP_S,J.CLAMP_TO_EDGE),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_WRAP_T,J.CLAMP_TO_EDGE),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MIN_FILTER,VV??J.LINEAR),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MAG_FILTER,VV??J.LINEAR),J.bindTexture(J.TEXTURE_2D,null),lV}function aa(lV,J,VV){ia(lV,J),lV.A||(lV.A=ta(J.createFramebuffer(),"Failed to create framebuffe.")),J.bindFramebuffer(J.FRAMEBUFFER,lV.A),J.framebufferTexture2D(J.FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_2D,VV,0)}function ha(lV){var J;(J=lV.g)==null||J.bindFramebuffer(lV.g.FRAMEBUFFER,null)}var ca=class{H(){return`
|
|
22454
|
+
`,name:"",attributes:{},children:[]}],value:"",attributes:{}},...NV],value:""};return stringify(YV)}var circuitJsonToSchematicSvg=convertCircuitJsonToSchematicSvg;const index=Object.freeze(Object.defineProperty({__proto__:null,circuitJsonToPcbSvg,circuitJsonToSchematicSvg,convertCircuitJsonToAssemblySvg,convertCircuitJsonToPcbSvg,convertCircuitJsonToSchematicSvg},Symbol.toStringTag,{value:"Module"}));var t=typeof self<"u"?self:{};function e(lV,J){V:{for(var VV=["CLOSURE_FLAGS"],RV=t,UV=0;UV<VV.length;UV++)if((RV=RV[VV[UV]])==null){VV=null;break V}VV=RV}return(lV=VV&&VV[lV])!=null?lV:J}function n(){throw Error("Invalid UTF8")}function r(lV,J){return J=String.fromCharCode.apply(null,J),lV==null?J:lV+J}let i$1,s;const o=typeof TextDecoder<"u";let a;const h=typeof TextEncoder<"u";function c(lV){if(h)lV=(a||(a=new TextEncoder)).encode(lV);else{let VV=0;const RV=new Uint8Array(3*lV.length);for(let UV=0;UV<lV.length;UV++){var J=lV.charCodeAt(UV);if(J<128)RV[VV++]=J;else{if(J<2048)RV[VV++]=J>>6|192;else{if(J>=55296&&J<=57343){if(J<=56319&&UV<lV.length){const ZV=lV.charCodeAt(++UV);if(ZV>=56320&&ZV<=57343){J=1024*(J-55296)+ZV-56320+65536,RV[VV++]=J>>18|240,RV[VV++]=J>>12&63|128,RV[VV++]=J>>6&63|128,RV[VV++]=63&J|128;continue}UV--}J=65533}RV[VV++]=J>>12|224,RV[VV++]=J>>6&63|128}RV[VV++]=63&J|128}}lV=VV===RV.length?RV:RV.subarray(0,VV)}return lV}var u,l=e(610401301,!1),f=e(653718497,e(1,!0)),d=e(660014094,!1);const p=t.navigator;function g(lV){return!!l&&!!u&&u.brands.some(({brand:J})=>J&&J.indexOf(lV)!=-1)}function m(lV){var J;return(J=t.navigator)&&(J=J.userAgent)||(J=""),J.indexOf(lV)!=-1}function y(){return!!l&&!!u&&u.brands.length>0}function _(){return y()?g("Chromium"):(m("Chrome")||m("CriOS"))&&!(!y()&&m("Edge"))||m("Silk")}function v(lV){return v[" "](lV),lV}u=p&&p.userAgentData||null,v[" "]=function(){};var E=!y()&&(m("Trident")||m("MSIE"));!m("Android")||_(),_(),m("Safari")&&(_()||!y()&&m("Coast")||!y()&&m("Opera")||!y()&&m("Edge")||(y()?g("Microsoft Edge"):m("Edg/"))||y()&&g("Opera"));var w={},T=null;function A(lV){var J=lV.length,VV=3*J/4;VV%3?VV=Math.floor(VV):"=.".indexOf(lV[J-1])!=-1&&(VV="=.".indexOf(lV[J-2])!=-1?VV-2:VV-1);var RV=new Uint8Array(VV),UV=0;return function(ZV,WV){function IV(gV){for(;dV<ZV.length;){var nV=ZV.charAt(dV++),JV=T[nV];if(JV!=null)return JV;if(!/^[\s\xa0]*$/.test(nV))throw Error("Unknown base64 encoding at char: "+nV)}return gV}b();for(var dV=0;;){var CV=IV(-1),FV=IV(0),NV=IV(64),eV=IV(64);if(eV===64&&CV===-1)break;WV(CV<<2|FV>>4),NV!=64&&(WV(FV<<4&240|NV>>2),eV!=64&&WV(NV<<6&192|eV))}}(lV,function(ZV){RV[UV++]=ZV}),UV!==VV?RV.subarray(0,UV):RV}function b(){if(!T){T={};for(var lV="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),J=["+/=","+/","-_=","-_.","-_"],VV=0;VV<5;VV++){var RV=lV.concat(J[VV].split(""));w[VV]=RV;for(var UV=0;UV<RV.length;UV++){var ZV=RV[UV];T[ZV]===void 0&&(T[ZV]=UV)}}}}var k=typeof Uint8Array<"u",S=!E&&typeof btoa=="function";function x(lV){if(!S){var J;J===void 0&&(J=0),b(),J=w[J];var VV=Array(Math.floor(lV.length/3)),RV=J[64]||"";let dV=0,CV=0;for(;dV<lV.length-2;dV+=3){var UV=lV[dV],ZV=lV[dV+1],WV=lV[dV+2],IV=J[UV>>2];UV=J[(3&UV)<<4|ZV>>4],ZV=J[(15&ZV)<<2|WV>>6],WV=J[63&WV],VV[CV++]=IV+UV+ZV+WV}switch(IV=0,WV=RV,lV.length-dV){case 2:WV=J[(15&(IV=lV[dV+1]))<<2]||RV;case 1:lV=lV[dV],VV[CV]=J[lV>>2]+J[(3&lV)<<4|IV>>4]+WV+RV}return VV.join("")}for(J="",VV=0,RV=lV.length-10240;VV<RV;)J+=String.fromCharCode.apply(null,lV.subarray(VV,VV+=10240));return J+=String.fromCharCode.apply(null,VV?lV.subarray(VV):lV),btoa(J)}const L=/[-_.]/g,R={"-":"+",_:"/",".":"="};function F(lV){return R[lV]||""}function M(lV){if(!S)return A(lV);L.test(lV)&&(lV=lV.replace(L,F)),lV=atob(lV);const J=new Uint8Array(lV.length);for(let VV=0;VV<lV.length;VV++)J[VV]=lV.charCodeAt(VV);return J}function I(lV){return k&&lV!=null&&lV instanceof Uint8Array}var P={};let O;function C(lV){if(lV!==P)throw Error("illegal external caller")}function N(){return O||(O=new D(null,P))}function U(lV){C(P);var J=lV.ba;return(J=J==null||I(J)?J:typeof J=="string"?M(J):null)==null?J:lV.ba=J}var D=class{constructor(lV,J){if(C(J),this.ba=lV,lV!=null&&lV.length===0)throw Error("ByteString should be constructed with non-empty values")}ua(){return new Uint8Array(U(this)||0)}};function B(lV,J){lV.__closure__error__context__984382||(lV.__closure__error__context__984382={}),lV.__closure__error__context__984382.severity=J}let G;function j(){const lV=Error();B(lV,"incident"),function(J){t.setTimeout(()=>{throw J},0)}(lV)}function V(lV){return B(lV=Error(lV),"warning"),lV}function X(){return typeof BigInt=="function"}function H(lV){return Array.prototype.slice.call(lV)}var W=typeof Symbol=="function"&&typeof Symbol()=="symbol";function z(lV){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol():lV}var K=z(),Y=z("0di"),$=z("2ex"),q=z("1oa"),Z=W?(lV,J)=>{lV[K]|=J}:(lV,J)=>{lV.G!==void 0?lV.G|=J:Object.defineProperties(lV,{G:{value:J,configurable:!0,writable:!0,enumerable:!1}})},Q=W?(lV,J)=>{lV[K]&=~J}:(lV,J)=>{lV.G!==void 0&&(lV.G&=~J)},tt=W?lV=>0|lV[K]:lV=>0|lV.G,et=W?lV=>lV[K]:lV=>lV.G,nt=W?(lV,J)=>{lV[K]=J}:(lV,J)=>{lV.G!==void 0?lV.G=J:Object.defineProperties(lV,{G:{value:J,configurable:!0,writable:!0,enumerable:!1}})};function rt(lV){return Z(lV,34),lV}function it(lV,J){nt(J,-14591&(0|lV))}function st(lV,J){nt(J,-14557&(34|lV))}var ot,at={},ht={};function ct(lV){return!(!lV||typeof lV!="object"||lV.La!==ht)}function ut(lV){return lV!==null&&typeof lV=="object"&&!Array.isArray(lV)&&lV.constructor===Object}function lt(lV,J,VV){if(lV!=null){if(typeof lV=="string")lV=lV?new D(lV,P):N();else if(lV.constructor!==D)if(I(lV))lV=lV.length?new D(VV?lV:new Uint8Array(lV),P):N();else{if(!J)throw Error();lV=void 0}}return lV}function ft(lV){return!(!Array.isArray(lV)||lV.length)&&!!(1&tt(lV))}const dt=[];function pt(lV){if(2&lV)throw Error()}nt(dt,55),ot=Object.freeze(dt);class gt{constructor(J,VV,RV){this.l=0,this.g=J,this.h=VV,this.m=RV}next(){if(this.l<this.g.length){const J=this.g[this.l++];return{done:!1,value:this.h?this.h.call(this.m,J):J}}return{done:!0,value:void 0}}[Symbol.iterator](){return new gt(this.g,this.h,this.m)}}let mt;function yt(lV,J){(J=mt?J[mt]:void 0)&&(lV[mt]=H(J))}var _t=Object.freeze({}),vt=Object.freeze({});function Et(lV){return lV.Sa=!0,lV}var wt=Et(lV=>typeof lV=="number"),Tt=Et(lV=>typeof lV=="string"),At=Et(lV=>typeof lV=="boolean"),bt=typeof t.BigInt=="function"&&typeof t.BigInt(0)=="bigint",kt=Et(lV=>bt?lV>=xt&&lV<=Rt:lV[0]==="-"?Ft(lV,St):Ft(lV,Lt));const St=Number.MIN_SAFE_INTEGER.toString(),xt=bt?BigInt(Number.MIN_SAFE_INTEGER):void 0,Lt=Number.MAX_SAFE_INTEGER.toString(),Rt=bt?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Ft(lV,J){if(lV.length>J.length)return!1;if(lV.length<J.length||lV===J)return!0;for(let VV=0;VV<lV.length;VV++){const RV=lV[VV],UV=J[VV];if(RV>UV)return!1;if(RV<UV)return!0}}const Mt=typeof Uint8Array.prototype.slice=="function";let It,Pt=0,Ot=0;function Ct(lV){const J=lV>>>0;Pt=J,Ot=(lV-J)/4294967296>>>0}function Nt(lV){if(lV<0){Ct(-lV);const[J,VV]=Xt(Pt,Ot);Pt=J>>>0,Ot=VV>>>0}else Ct(lV)}function Ut(lV){const J=It||(It=new DataView(new ArrayBuffer(8)));J.setFloat32(0,+lV,!0),Ot=0,Pt=J.getUint32(0,!0)}function Dt(lV,J){return 4294967296*J+(lV>>>0)}function Bt(lV,J){const VV=2147483648&J;return VV&&(J=~J>>>0,(lV=1+~lV>>>0)==0&&(J=J+1>>>0)),lV=Dt(lV,J),VV?-lV:lV}function Gt(lV,J){if(lV>>>=0,(J>>>=0)<=2097151)var VV=""+(4294967296*J+lV);else X()?VV=""+(BigInt(J)<<BigInt(32)|BigInt(lV)):(lV=(16777215&lV)+6777216*(VV=16777215&(lV>>>24|J<<8))+6710656*(J=J>>16&65535),VV+=8147497*J,J*=2,lV>=1e7&&(VV+=lV/1e7>>>0,lV%=1e7),VV>=1e7&&(J+=VV/1e7>>>0,VV%=1e7),VV=J+jt(VV)+jt(lV));return VV}function jt(lV){return lV=String(lV),"0000000".slice(lV.length)+lV}function Vt(lV){if(lV.length<16)Nt(Number(lV));else if(X())lV=BigInt(lV),Pt=Number(lV&BigInt(4294967295))>>>0,Ot=Number(lV>>BigInt(32)&BigInt(4294967295));else{const J=+(lV[0]==="-");Ot=Pt=0;const VV=lV.length;for(let RV=J,UV=(VV-J)%6+J;UV<=VV;RV=UV,UV+=6){const ZV=Number(lV.slice(RV,UV));Ot*=1e6,Pt=1e6*Pt+ZV,Pt>=4294967296&&(Ot+=Math.trunc(Pt/4294967296),Ot>>>=0,Pt>>>=0)}if(J){const[RV,UV]=Xt(Pt,Ot);Pt=RV,Ot=UV}}}function Xt(lV,J){return J=~J,lV?lV=1+~lV:J+=1,[lV,J]}function Ht(lV){return lV==null||typeof lV=="number"?lV:lV==="NaN"||lV==="Infinity"||lV==="-Infinity"?Number(lV):void 0}function Wt(lV){return lV==null||typeof lV=="boolean"?lV:typeof lV=="number"?!!lV:void 0}const zt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Kt(lV){const J=typeof lV;switch(J){case"bigint":return!0;case"number":return Number.isFinite(lV)}return J==="string"&&zt.test(lV)}function Yt(lV){if(lV==null)return lV;if(typeof lV=="string"){if(!lV)return;lV=+lV}return typeof lV=="number"&&Number.isFinite(lV)?0|lV:void 0}function $t(lV){if(lV==null)return lV;if(typeof lV=="string"){if(!lV)return;lV=+lV}return typeof lV=="number"&&Number.isFinite(lV)?lV>>>0:void 0}function qt(lV){return lV[0]!=="-"&&(lV.length<20||lV.length===20&&Number(lV.substring(0,6))<184467)}function Jt(lV){return lV=Math.trunc(lV),Number.isSafeInteger(lV)||(Nt(lV),lV=Bt(Pt,Ot)),lV}function Zt(lV){var J=Math.trunc(Number(lV));if(Number.isSafeInteger(J))return String(J);if((J=lV.indexOf("."))!==-1&&(lV=lV.substring(0,J)),!(lV[0]==="-"?lV.length<20||lV.length===20&&Number(lV.substring(0,7))>-922337:lV.length<19||lV.length===19&&Number(lV.substring(0,6))<922337))if(Vt(lV),lV=Pt,2147483648&(J=Ot))if(X())lV=""+(BigInt(0|J)<<BigInt(32)|BigInt(lV>>>0));else{const[VV,RV]=Xt(lV,J);lV="-"+Gt(VV,RV)}else lV=Gt(lV,J);return lV}function Qt(lV){return lV==null?lV:typeof lV=="bigint"?(kt(lV)?lV=Number(lV):(lV=BigInt.asIntN(64,lV),lV=kt(lV)?Number(lV):String(lV)),lV):Kt(lV)?typeof lV=="number"?Jt(lV):Zt(lV):void 0}function te(lV){if(lV==null)return lV;var J=typeof lV;if(J==="bigint")return String(BigInt.asUintN(64,lV));if(Kt(lV)){if(J==="string")return J=Math.trunc(Number(lV)),Number.isSafeInteger(J)&&J>=0?lV=String(J):((J=lV.indexOf("."))!==-1&&(lV=lV.substring(0,J)),qt(lV)||(Vt(lV),lV=Gt(Pt,Ot))),lV;if(J==="number")return(lV=Math.trunc(lV))>=0&&Number.isSafeInteger(lV)?lV:function(VV){if(VV<0){Nt(VV);const RV=Gt(Pt,Ot);return VV=Number(RV),Number.isSafeInteger(VV)?VV:RV}return qt(String(VV))?VV:(Nt(VV),Dt(Pt,Ot))}(lV)}}function ee(lV){if(typeof lV!="string")throw Error();return lV}function ne(lV){if(lV!=null&&typeof lV!="string")throw Error();return lV}function re(lV){return lV==null||typeof lV=="string"?lV:void 0}function ie(lV,J,VV,RV){if(lV!=null&&typeof lV=="object"&&lV.Y===at)return lV;if(!Array.isArray(lV))return VV?2&RV?(lV=J[Y])?J=lV:(rt((lV=new J).u),J=J[Y]=lV):J=new J:J=void 0,J;let UV=VV=tt(lV);return UV===0&&(UV|=32&RV),UV|=2&RV,UV!==VV&&nt(lV,UV),new J(lV)}function se(lV,J,VV){if(J)V:{if(!Kt(J=lV))throw V("int64");switch(typeof J){case"string":J=Zt(J);break V;case"bigint":if(lV=J=BigInt.asIntN(64,J),Tt(lV)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(lV))throw Error(String(lV))}else if(wt(lV)&&!Number.isSafeInteger(lV))throw Error(String(lV));J=bt?BigInt(J):At(J)?J?"1":"0":Tt(J)?J.trim()||"0":String(J);break V;default:J=Jt(J)}}else J=Qt(lV);return typeof(VV=(lV=J)==null?VV?0:void 0:lV)=="string"&&(J=+VV,Number.isSafeInteger(J))?J:VV}function oe(lV){if(ce===void 0&&(ce=typeof Proxy=="function"?ye(Proxy):null),!ce||!me())return lV;let J=ae==null?void 0:ae.get(lV);return J||(Math.random()>.01?lV:(function(VV){if(le===void 0){const RV=new ce([],{});le=Array.prototype.concat.call([],RV).length===1}le&&typeof Symbol=="function"&&Symbol.isConcatSpreadable&&(VV[Symbol.isConcatSpreadable]=!0)}(lV),J=new ce(lV,{set:(VV,RV,UV)=>(j(),VV[RV]=UV,!0)}),function(VV,RV){(ae||(ae=new ue)).set(VV,RV),(he||(he=new ue)).set(RV,VV)}(lV,J),J))}let ae,he,ce,ue,le,fe,de,pe,ge;function me(){return ue===void 0&&(ue=typeof WeakMap=="function"?ye(WeakMap):null),ue}function ye(lV){try{return lV.toString().indexOf("[native code]")!==-1?lV:null}catch{return null}}function _e(lV,J,VV){var WV;if(f&&me()){if((WV=fe==null?void 0:fe.get(J))!=null&&WV.get(lV)){if(VV)return}else if(Math.random()>.01)return;var RV=lV.length;VV={length:RV};for(var UV=0;UV<Math.min(RV,10);UV++){if(RV<=10)var ZV=UV;else{ZV=RV/10;const IV=Math.floor(UV*ZV);ZV=IV+Math.floor(Math.random()*(Math.floor((UV+1)*ZV)-IV))}VV[ZV]=lV[ZV]}Ee(lV,VV)?((UV=(RV=fe||(fe=new ue)).get(J))||(UV=new ue,RV.set(J,UV)),UV.set(lV,VV)):(j(),Te(lV,J))}}function ve(lV,J){var RV;const VV=(RV=fe==null?void 0:fe.get(J))==null?void 0:RV.get(lV);VV&&!Ee(lV,VV)&&(j(),Te(lV,J))}function Ee(lV,J){if(lV.length!==J.length)return!1;for(const UV in J){var VV,RV=Number(UV);if((VV=Number.isInteger(RV))&&(VV=lV[RV],RV=J[RV],VV=!(Number.isNaN(VV)?Number.isNaN(RV):VV===RV)),VV)return!1}return!0}function we(lV){if(lV&&(fe!=null&&fe.has(lV))){var J=lV.u;if(J)for(let VV=0;VV<J.length;VV++){const RV=J[VV];if(VV===J.length-1&&ut(RV))for(const UV in RV){const ZV=RV[UV];Array.isArray(ZV)&&ve(ZV,lV)}else Array.isArray(RV)&&ve(RV,lV)}}}function Te(lV,J){var VV;(VV=fe==null?void 0:fe.get(J))==null||VV.delete(lV)}function Ae(lV,J){return lV=be(lV,J[0],J[1]),Z(lV,16384),lV}function be(lV,J,VV){if(lV==null&&(lV=de),de=void 0,lV==null){var RV=96;VV?(lV=[VV],RV|=512):lV=[],J&&(RV=-33521665&RV|(1023&J)<<15)}else{if(!Array.isArray(lV))throw Error("narr");if(2048&(RV=tt(lV)))throw Error("farr");if(64&RV)return lV;if(RV|=64,VV&&(RV|=512,VV!==lV[0]))throw Error("mid");V:{const UV=(VV=lV).length;if(UV){const ZV=UV-1;if(ut(VV[ZV])){if((J=ZV-(+!!(512&(RV|=256))-1))>=1024)throw Error("pvtlmt");RV=-33521665&RV|(1023&J)<<15;break V}}if(J){if((J=Math.max(J,UV-(+!!(512&RV)-1)))>1024)throw Error("spvt");RV=-33521665&RV|(1023&J)<<15}}}return nt(lV,RV),lV}const ke={};let Se=function(){try{return v(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class xe{constructor(){this.g=new Map}get(J){return this.g.get(J)}set(J,VV){return this.g.set(J,VV),this.size=this.g.size,this}delete(J){return J=this.g.delete(J),this.size=this.g.size,J}clear(){this.g.clear(),this.size=this.g.size}has(J){return this.g.has(J)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(J,VV){return this.g.forEach(J,VV)}[Symbol.iterator](){return this.entries()}}const Le=Se?(Object.setPrototypeOf(xe.prototype,Map.prototype),Object.defineProperties(xe.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),xe):class extends Map{constructor(){super()}};function Re(lV){return lV}function Fe(lV){if(2&lV.M)throw Error("Cannot mutate an immutable Map")}var Me=class extends Le{constructor(lV,J,VV=Re,RV=Re){super();let UV=tt(lV);UV|=64,nt(lV,UV),this.M=UV,this.U=J,this.T=VV,this.aa=this.U?Ie:RV;for(let ZV=0;ZV<lV.length;ZV++){const WV=lV[ZV],IV=VV(WV[0],!1,!0);let dV=WV[1];J?dV===void 0&&(dV=null):dV=RV(WV[1],!1,!0,void 0,void 0,UV),super.set(IV,dV)}}pa(lV=Pe){if(this.size!==0)return this.Z(lV)}Z(lV=Pe){const J=[],VV=super.entries();for(var RV;!(RV=VV.next()).done;)(RV=RV.value)[0]=lV(RV[0]),RV[1]=lV(RV[1]),J.push(RV);return J}clear(){Fe(this),super.clear()}delete(lV){return Fe(this),super.delete(this.T(lV,!0,!1))}entries(){var lV=this.oa();return new gt(lV,Oe,this)}keys(){return this.Ka()}values(){var lV=this.oa();return new gt(lV,Me.prototype.get,this)}forEach(lV,J){super.forEach((VV,RV)=>{lV.call(J,this.get(RV),RV,this)})}set(lV,J){return Fe(this),(lV=this.T(lV,!0,!1))==null?this:J==null?(super.delete(lV),this):super.set(lV,this.aa(J,!0,!0,this.U,!1,this.M))}Qa(lV){const J=this.T(lV[0],!1,!0);lV=lV[1],lV=this.U?lV===void 0?null:lV:this.aa(lV,!1,!0,void 0,!1,this.M),super.set(J,lV)}has(lV){return super.has(this.T(lV,!1,!1))}get(lV){lV=this.T(lV,!1,!1);const J=super.get(lV);if(J!==void 0){var VV=this.U;return VV?((VV=this.aa(J,!1,!0,VV,this.va,this.M))!==J&&super.set(lV,VV),VV):J}}oa(){return Array.from(super.keys())}Ka(){return super.keys()}[Symbol.iterator](){return this.entries()}};function Ie(lV,J,VV,RV,UV,ZV){return lV=ie(lV,RV,VV,ZV),UV&&(lV=He(lV)),lV}function Pe(lV){return lV}function Oe(lV){return[lV,this.get(lV)]}let Ce;function Ne(){return Ce||(Ce=new Me(rt([]),void 0,void 0,void 0,ke))}function Ue(lV,J,VV,RV,UV){if(lV!=null){if(Array.isArray(lV))lV=ft(lV)?void 0:UV&&2&tt(lV)?lV:De(lV,J,VV,RV!==void 0,UV);else if(ut(lV)){const ZV={};for(let WV in lV)ZV[WV]=Ue(lV[WV],J,VV,RV,UV);lV=ZV}else lV=J(lV,RV);return lV}}function De(lV,J,VV,RV,UV){const ZV=RV||VV?tt(lV):0;RV=RV?!!(32&ZV):void 0;const WV=H(lV);for(let IV=0;IV<WV.length;IV++)WV[IV]=Ue(WV[IV],J,VV,RV,UV);return VV&&(yt(WV,lV),VV(ZV,WV)),WV}function Be(lV){return Ue(lV,Ge,void 0,void 0,!1)}function Ge(lV){return lV.Y===at?lV.toJSON():lV instanceof Me?lV.pa(Be):function(J){switch(typeof J){case"number":return isFinite(J)?J:String(J);case"bigint":return kt(J)?Number(J):String(J);case"boolean":return J?1:0;case"object":if(J)if(Array.isArray(J)){if(ft(J))return}else{if(I(J))return x(J);if(J instanceof D){const VV=J.ba;return VV==null?"":typeof VV=="string"?VV:J.ba=x(VV)}if(J instanceof Me)return J.pa()}}return J}(lV)}function je(lV,J,VV=st){if(lV!=null){if(k&&lV instanceof Uint8Array)return J?lV:new Uint8Array(lV);if(Array.isArray(lV)){var RV=tt(lV);return 2&RV?lV:(J&&(J=RV===0||!!(32&RV)&&!(64&RV||!(16&RV))),J?(nt(lV,-12293&(34|RV)),lV):De(lV,je,4&RV?st:VV,!0,!0))}return lV.Y===at?(VV=lV.u,lV=2&(RV=et(VV))?lV:Ve(lV,VV,RV,!0)):lV instanceof Me&&!(2&lV.M)&&(VV=rt(lV.Z(je)),lV=new Me(VV,lV.U,lV.T,lV.aa)),lV}}function Ve(lV,J,VV,RV){return we(lV),lV=lV.constructor,de=J=Xe(J,VV,RV),J=new lV(J),de=void 0,J}function Xe(lV,J,VV){const RV=VV||2&J?st:it,UV=!!(32&J);return lV=function(ZV,WV,IV){const dV=H(ZV);var CV=dV.length;const FV=256&WV?dV[CV-1]:void 0;for(CV+=FV?-1:0,WV=512&WV?1:0;WV<CV;WV++)dV[WV]=IV(dV[WV]);if(FV){WV=dV[WV]={};for(const NV in FV)WV[NV]=IV(FV[NV])}return yt(dV,ZV),dV}(lV,J,ZV=>je(ZV,UV,RV)),Z(lV,32|(VV?2:0)),lV}function He(lV){const J=lV.u,VV=et(J);return 2&VV?Ve(lV,J,VV,!1):lV}function We(lV,J,VV,RV){return!(4&J)||VV!=null}function ze(lV,J){return Ye(lV=lV.u,et(lV),J)}function Ke(lV,J,VV,RV){if(!((J=RV+(+!!(512&J)-1))<0||J>=lV.length||J>=VV))return lV[J]}function Ye(lV,J,VV,RV){if(VV===-1)return null;const UV=J>>15&1023||536870912;if(!(VV>=UV)){var ZV=lV.length;return RV&&256&J&&(RV=lV[ZV-1][VV])!=null?(Ke(lV,J,UV,VV)&&$!=null&&((J=(lV=G??(G={}))[$]||0)>=4||(lV[$]=J+1,j())),RV):Ke(lV,J,UV,VV)}return 256&J?lV[lV.length-1][VV]:void 0}function $e(lV,J,VV){const RV=lV.u;let UV=et(RV);return pt(UV),qe(RV,UV,J,VV),lV}function qe(lV,J,VV,RV){const UV=J>>15&1023||536870912;if(VV>=UV){let ZV,WV=J;if(256&J)ZV=lV[lV.length-1];else{if(RV==null)return WV;ZV=lV[UV+(+!!(512&J)-1)]={},WV|=256}return ZV[VV]=RV,VV<UV&&(lV[VV+(+!!(512&J)-1)]=void 0),WV!==J&&nt(lV,WV),WV}return lV[VV+(+!!(512&J)-1)]=RV,256&J&&VV in(lV=lV[lV.length-1])&&delete lV[VV],J}function Je(lV,J,VV,RV,UV){var ZV=2&J;UV=Ye(lV,J,VV,UV),Array.isArray(UV)||(UV=ot);const WV=!(2&RV);RV=!(1&RV);const IV=!!(32&J);let dV=tt(UV);return dV!==0||!IV||ZV||WV?1&dV||(dV|=1,nt(UV,dV)):(dV|=33,nt(UV,dV)),ZV?(lV=!1,2&dV||(rt(UV),lV=!!(4&dV)),(RV||lV)&&Object.freeze(UV)):(ZV=!!(2&dV)||!!(2048&dV),RV&&ZV?(UV=H(UV),ZV=1,IV&&!WV&&(ZV|=32),nt(UV,ZV),qe(lV,J,VV,UV)):WV&&32&dV&&!ZV&&Q(UV,32)),UV}function Ze(lV,J){lV=lV.u;let VV=et(lV);const RV=Ye(lV,VV,J),UV=Ht(RV);return UV!=null&&UV!==RV&&qe(lV,VV,J,UV),UV}function Qe(lV){lV=lV.u;let J=et(lV);const VV=Ye(lV,J,1),RV=lt(VV,!0,!!(34&J));return RV!=null&&RV!==VV&&qe(lV,J,1,RV),RV}function tn(){return _t===void 0?2:5}function en(lV,J,VV,RV,UV,ZV){const WV=lV.u;let IV=et(WV);RV=2&IV?1:RV,ZV=!!ZV,UV=nn(WV,IV,J,UV);var dV=tt(UV),CV=UV;if(ve(CV,lV),RV!==2&&RV!==1||Te(CV,lV),We(lV,dV,void 0)){4&dV&&(UV=H(UV),dV=vn(dV,IV),IV=qe(WV,IV,J,UV));let NV=CV=0;for(;CV<UV.length;CV++){const eV=VV(UV[CV]);eV!=null&&(UV[NV++]=eV)}NV<CV&&(UV.length=NV),dV=-4097&(20|(dV=rn(dV,IV))),nt(UV,dV&=-8193),2&dV&&Object.freeze(UV)}let FV;return RV===1||RV===4&&32&dV?sn(dV)||(lV=dV,(dV|=2)!==lV&&nt(UV,dV),Object.freeze(UV)):(VV=RV===5&&(!!(32&dV)||sn(dV)||!!(ae!=null&&ae.get(UV))),(RV===2||VV)&&sn(dV)&&(UV=H(UV),dV=En(dV=vn(dV,IV),IV,ZV),nt(UV,dV),IV=qe(WV,IV,J,UV)),sn(dV)||(J=dV,(dV=En(dV,IV,ZV))!==J&&nt(UV,dV)),VV?(FV=oe(UV),_e(UV,lV,!0)):RV!==2||ZV||(ae==null||ae.delete(UV))),FV||UV}function nn(lV,J,VV,RV){return lV=Ye(lV,J,VV,RV),Array.isArray(lV)?lV:ot}function rn(lV,J){return lV===0&&(lV=vn(lV,J)),1|lV}function sn(lV){return!!(2&lV)&&!!(4&lV)||!!(2048&lV)}function on(lV){lV=H(lV);for(let J=0;J<lV.length;J++){const VV=lV[J]=H(lV[J]);Array.isArray(VV[1])&&(VV[1]=rt(VV[1]))}return lV}function an(lV,J,VV,RV){lV=lV.u;let UV=et(lV);pt(UV),qe(lV,UV,J,(RV==="0"?Number(VV)===0:VV===RV)?void 0:VV)}function hn(lV,J){var VV=_s;return ln(cn(lV=lV.u),lV,et(lV),VV)===J?J:-1}function cn(lV){if(W)return lV[q]??(lV[q]=new Map);if(q in lV)return lV[q];const J=new Map;return Object.defineProperty(lV,q,{value:J}),J}function un(lV,J,VV,RV){const UV=cn(lV),ZV=ln(UV,lV,J,VV);return ZV!==RV&&(ZV&&(J=qe(lV,J,ZV)),UV.set(VV,RV)),J}function ln(lV,J,VV,RV){let UV=lV.get(RV);if(UV!=null)return UV;UV=0;for(let ZV=0;ZV<RV.length;ZV++){const WV=RV[ZV];Ye(J,VV,WV)!=null&&(UV!==0&&(VV=qe(J,VV,UV)),UV=WV)}return lV.set(RV,UV),UV}function fn(lV,J,VV,RV){let UV,ZV=et(lV);if((RV=Ye(lV,ZV,VV,RV))!=null&&RV.Y===at)return(J=He(RV))!==RV&&qe(lV,ZV,VV,J),J.u;if(Array.isArray(RV)){const WV=tt(RV);UV=2&WV?Xe(RV,WV,!1):RV,UV=Ae(UV,J)}else UV=Ae(void 0,J);return UV!==RV&&qe(lV,ZV,VV,UV),UV}function dn(lV,J,VV,RV){lV=lV.u;let UV=et(lV);return(J=ie(RV=Ye(lV,UV,VV,RV),J,!1,UV))!==RV&&J!=null&&qe(lV,UV,VV,J),J}function pn(lV,J,VV,RV=!1){if((J=dn(lV,J,VV,RV))==null)return J;if(lV=lV.u,!(2&(RV=et(lV)))){const UV=He(J);UV!==J&&qe(lV,RV,VV,J=UV)}return J}function gn(lV,J,VV,RV,UV,ZV,WV){const IV=lV.u;var dV=!!(2&J);UV=dV?1:UV,ZV=!!ZV,WV&&(WV=!dV),dV=nn(IV,J,RV);var CV=tt(dV),FV=dV;if(ve(FV,lV),UV!==2&&UV!==1||Te(FV,lV),!(FV=!!(4&CV))){var NV=dV,eV=J;const nV=!!(2&(CV=rn(CV,J)));nV&&(eV|=2);let JV=!nV,aV=!0,GV=0,YV=0;for(;GV<NV.length;GV++){const tV=ie(NV[GV],VV,!1,eV);if(tV instanceof VV){if(!nV){const kV=!!(2&tt(tV.u));JV&&(JV=!kV),aV&&(aV=kV)}NV[YV++]=tV}}YV<GV&&(NV.length=YV),CV|=4,CV=aV?16|CV:-17&CV,nt(NV,CV=JV?8|CV:-9&CV),nV&&Object.freeze(NV)}if(WV&&!(8&CV||!dV.length&&(UV===1||UV===4&&32&CV))){for(sn(CV)?(dV=H(dV),CV=vn(CV,J),J=qe(IV,J,RV,dV)):Te(dV,lV),VV=dV,WV=CV,NV=0;NV<VV.length;NV++)(CV=VV[NV])!==(eV=He(CV))&&(VV[NV]=eV);WV|=8,WV=VV.length?-17&WV:16|WV,nt(VV,WV),CV=WV}let gV;return UV===1||UV===4&&32&CV?sn(CV)||(lV=CV,(CV|=!dV.length||16&CV&&(!FV||32&CV)?2:2048)!==lV&&nt(dV,CV),Object.freeze(dV)):(FV=UV===5&&(!!(32&CV)||sn(CV)||!!(ae!=null&&ae.get(dV))),(UV===2||FV)&&sn(CV)&&(dV=H(dV),CV=En(CV=vn(CV,J),J,ZV),nt(dV,CV),J=qe(IV,J,RV,dV)),sn(CV)||(RV=CV,(CV=En(CV,J,ZV))!==RV&&nt(dV,CV)),FV?(gV=oe(dV),_e(dV,lV,!0)):UV!==2||ZV||(ae==null||ae.delete(dV))),gV||dV}function mn(lV,J,VV){const RV=et(lV.u);return gn(lV,RV,J,VV,tn(),!1,!(2&RV))}function yn(lV,J,VV,RV){return RV==null&&(RV=void 0),$e(lV,VV,RV)}function _n(lV,J,VV,RV){RV==null&&(RV=void 0);V:{lV=lV.u;let UV=et(lV);if(pt(UV),RV==null){const ZV=cn(lV);if(ln(ZV,lV,UV,VV)!==J)break V;ZV.set(VV,0)}else UV=un(lV,UV,VV,J);qe(lV,UV,J,RV)}}function vn(lV,J){return-2049&(lV=32|(2&J?2|lV:-3&lV))}function En(lV,J,VV){return 32&J&&VV||(lV&=-33),lV}function wn(lV,J,VV,RV){const UV=et(lV.u);pt(UV),lV=gn(lV,UV,VV,J,2,!0),VV=RV??new VV,lV.push(VV),2&tt(VV.u)?Q(lV,8):Q(lV,16)}function Tn(lV,J){return lV??J}function An(lV,J){return Yt(ze(lV,J))}function bn(lV,J){return Tn(Ze(lV,J),0)}function kn(lV,J){return Tn(re(ze(lV,J)),"")}function Sn(lV,J,VV){if(VV!=null&&typeof VV!="boolean")throw lV=typeof VV,Error(`Expected boolean but got ${lV!="object"?lV:VV?Array.isArray(VV)?"array":lV:"null"}: ${VV}`);$e(lV,J,VV)}function xn(lV,J,VV){if(VV!=null){if(typeof VV!="number"||!Number.isFinite(VV))throw V("int32");VV|=0}$e(lV,J,VV)}function Ln(lV,J,VV){if(VV!=null&&typeof VV!="number")throw Error(`Value of float/double field must be a number, found ${typeof VV}: ${VV}`);$e(lV,J,VV)}function Rn(lV,J,VV){{const IV=lV.u;let dV=et(IV);if(pt(dV),VV==null)qe(IV,dV,J);else{VV=(he==null?void 0:he.get(VV))||VV;var RV,UV=tt(VV),ZV=UV,WV=!!(2&UV)||Object.isFrozen(VV);if((RV=!WV)&&(RV=vt===void 0||!1),We(lV,UV)){UV=21,WV&&(VV=H(VV),ZV=0,UV=En(UV=vn(UV,dV),dV,!0));for(let CV=0;CV<VV.length;CV++)VV[CV]=ee(VV[CV])}RV?(VV=H(VV),ZV=0,UV=En(UV=vn(UV,dV),dV,!0)):WV||_e(VV,lV),UV!==ZV&&nt(VV,UV),qe(IV,dV,J,VV)}}}function Fn(lV,J,VV){pt(et(lV.u)),en(lV,J,re,2,void 0,!0).push(ee(VV))}function Mn(lV,J){return Error(`Invalid wire type: ${lV} (at position ${J})`)}function In(){return Error("Failed to read varint, encoding is invalid.")}function Pn(lV,J){return Error(`Tried to read past the end of the data ${J} > ${lV}`)}function On(lV){if(typeof lV=="string")return{buffer:M(lV),O:!1};if(Array.isArray(lV))return{buffer:new Uint8Array(lV),O:!1};if(lV.constructor===Uint8Array)return{buffer:lV,O:!1};if(lV.constructor===ArrayBuffer)return{buffer:new Uint8Array(lV),O:!1};if(lV.constructor===D)return{buffer:U(lV)||new Uint8Array(0),O:!0};if(lV instanceof Uint8Array)return{buffer:new Uint8Array(lV.buffer,lV.byteOffset,lV.byteLength),O:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function Cn(lV,J){let VV,RV=0,UV=0,ZV=0;const WV=lV.h;let IV=lV.g;do VV=WV[IV++],RV|=(127&VV)<<ZV,ZV+=7;while(ZV<32&&128&VV);for(ZV>32&&(UV|=(127&VV)>>4),ZV=3;ZV<32&&128&VV;ZV+=7)VV=WV[IV++],UV|=(127&VV)<<ZV;if(Xn(lV,IV),VV<128)return J(RV>>>0,UV>>>0);throw In()}function Nn(lV){let J=0,VV=lV.g;const RV=VV+10,UV=lV.h;for(;VV<RV;){const ZV=UV[VV++];if(J|=ZV,(128&ZV)==0)return Xn(lV,VV),!!(127&J)}throw In()}function Un(lV){const J=lV.h;let VV=lV.g,RV=J[VV++],UV=127&RV;if(128&RV&&(RV=J[VV++],UV|=(127&RV)<<7,128&RV&&(RV=J[VV++],UV|=(127&RV)<<14,128&RV&&(RV=J[VV++],UV|=(127&RV)<<21,128&RV&&(RV=J[VV++],UV|=RV<<28,128&RV&&128&J[VV++]&&128&J[VV++]&&128&J[VV++]&&128&J[VV++]&&128&J[VV++])))))throw In();return Xn(lV,VV),UV}function Dn(lV){return Un(lV)>>>0}function Bn(lV){var J=lV.h;const VV=lV.g,RV=J[VV],UV=J[VV+1],ZV=J[VV+2];return J=J[VV+3],Xn(lV,lV.g+4),(RV<<0|UV<<8|ZV<<16|J<<24)>>>0}function Gn(lV){var J=Bn(lV);lV=2*(J>>31)+1;const VV=J>>>23&255;return J&=8388607,VV==255?J?NaN:lV*(1/0):VV==0?1401298464324817e-60*lV*J:lV*Math.pow(2,VV-150)*(J+8388608)}function jn(lV){return Un(lV)}function Vn(lV,J,{ea:VV=!1}={}){lV.ea=VV,J&&(J=On(J),lV.h=J.buffer,lV.m=J.O,lV.j=0,lV.l=lV.h.length,lV.g=lV.j)}function Xn(lV,J){if(lV.g=J,J>lV.l)throw Pn(lV.l,J)}function Hn(lV,J){if(J<0)throw Error(`Tried to read a negative byte length: ${J}`);const VV=lV.g,RV=VV+J;if(RV>lV.l)throw Pn(J,lV.l-VV);return lV.g=RV,VV}function Wn(lV,J){if(J==0)return N();var VV=Hn(lV,J);return lV.ea&&lV.m?VV=lV.h.subarray(VV,VV+J):(lV=lV.h,VV=VV===(J=VV+J)?new Uint8Array(0):Mt?lV.slice(VV,J):new Uint8Array(lV.subarray(VV,J))),VV.length==0?N():new D(VV,P)}Me.prototype.toJSON=void 0,Me.prototype.La=ht;var zn=[];function Kn(lV){var J=lV.g;if(J.g==J.l)return!1;lV.l=lV.g.g;var VV=Dn(lV.g);if(J=VV>>>3,!((VV&=7)>=0&&VV<=5))throw Mn(VV,lV.l);if(J<1)throw Error(`Invalid field number: ${J} (at position ${lV.l})`);return lV.m=J,lV.h=VV,!0}function Yn(lV){switch(lV.h){case 0:lV.h!=0?Yn(lV):Nn(lV.g);break;case 1:Xn(lV=lV.g,lV.g+8);break;case 2:if(lV.h!=2)Yn(lV);else{var J=Dn(lV.g);Xn(lV=lV.g,lV.g+J)}break;case 5:Xn(lV=lV.g,lV.g+4);break;case 3:for(J=lV.m;;){if(!Kn(lV))throw Error("Unmatched start-group tag: stream EOF");if(lV.h==4){if(lV.m!=J)throw Error("Unmatched end-group tag");break}Yn(lV)}break;default:throw Mn(lV.h,lV.l)}}function $n(lV,J,VV){const RV=lV.g.l,UV=Dn(lV.g),ZV=lV.g.g+UV;let WV=ZV-RV;if(WV<=0&&(lV.g.l=ZV,VV(J,lV,void 0,void 0,void 0),WV=ZV-lV.g.g),WV)throw Error(`Message parsing ended unexpectedly. Expected to read ${UV} bytes, instead read ${UV-WV} bytes, either the data ended unexpectedly or the message misreported its own length`);return lV.g.g=ZV,lV.g.l=RV,J}function qn(lV){var J=Dn(lV.g),VV=Hn(lV=lV.g,J);if(lV=lV.h,o){var RV,UV=lV;(RV=s)||(RV=s=new TextDecoder("utf-8",{fatal:!0})),J=VV+J,UV=VV===0&&J===UV.length?UV:UV.subarray(VV,J);try{var ZV=RV.decode(UV)}catch(IV){if(i$1===void 0){try{RV.decode(new Uint8Array([128]))}catch{}try{RV.decode(new Uint8Array([97])),i$1=!0}catch{i$1=!1}}throw!i$1&&(s=void 0),IV}}else{J=(ZV=VV)+J,VV=[];let IV,dV=null;for(;ZV<J;){var WV=lV[ZV++];WV<128?VV.push(WV):WV<224?ZV>=J?n():(IV=lV[ZV++],WV<194||(192&IV)!=128?(ZV--,n()):VV.push((31&WV)<<6|63&IV)):WV<240?ZV>=J-1?n():(IV=lV[ZV++],(192&IV)!=128||WV===224&&IV<160||WV===237&&IV>=160||(192&(RV=lV[ZV++]))!=128?(ZV--,n()):VV.push((15&WV)<<12|(63&IV)<<6|63&RV)):WV<=244?ZV>=J-2?n():(IV=lV[ZV++],(192&IV)!=128||IV-144+(WV<<28)>>30||(192&(RV=lV[ZV++]))!=128||(192&(UV=lV[ZV++]))!=128?(ZV--,n()):(WV=(7&WV)<<18|(63&IV)<<12|(63&RV)<<6|63&UV,WV-=65536,VV.push(55296+(WV>>10&1023),56320+(1023&WV)))):n(),VV.length>=8192&&(dV=r(dV,VV),VV.length=0)}ZV=r(dV,VV)}return ZV}function Jn(lV){const J=Dn(lV.g);return Wn(lV.g,J)}function Zn(lV,J,VV){var RV=Dn(lV.g);for(RV=lV.g.g+RV;lV.g.g<RV;)VV.push(J(lV.g))}var Qn=[];let tr;function er(lV,J,VV){J.g?J.m(lV,J.g,J.h,VV,!0):J.m(lV,J.h,VV,!0)}var nr=class{constructor(lV,J){this.u=be(lV,J)}toJSON(){return rr(this)}l(){var lV=vo;return lV.g?lV.l(this,lV.g,lV.h,!0):lV.l(this,lV.h,lV.defaultValue,!0)}clone(){const lV=this.u;return Ve(this,lV,et(lV),!1)}O(){return!!(2&tt(this.u))}};function rr(lV){we(lV),lV=tr?lV.u:De(lV.u,Ge,void 0,void 0,!1);{var J=!tr;let CV=lV.length;if(CV){var VV=lV[CV-1],RV=ut(VV);RV?CV--:VV=void 0;var UV=lV;if(RV){V:{var ZV,WV=VV,IV=!1;if(WV)for(let FV in WV)isNaN(+FV)?(ZV??(ZV={}))[FV]=WV[FV]:(RV=WV[FV],Array.isArray(RV)&&(ft(RV)||ct(RV)&&RV.size===0)&&(RV=null),RV==null&&(IV=!0),RV!=null&&((ZV??(ZV={}))[FV]=RV));if(IV||(ZV=WV),ZV)for(let FV in ZV){IV=ZV;break V}IV=null}WV=IV==null?VV!=null:IV!==VV}for(;CV>0&&((ZV=UV[CV-1])==null||ft(ZV)||ct(ZV)&&ZV.size===0);CV--)var dV=!0;(UV!==lV||WV||dV)&&(J?(dV||WV||IV)&&(UV.length=CV):UV=Array.prototype.slice.call(UV,0,CV),IV&&UV.push(IV)),dV=UV}else dV=lV}return dV}function ir(lV){return lV?/^\d+$/.test(lV)?(Vt(lV),new sr(Pt,Ot)):null:or||(or=new sr(0,0))}nr.prototype.Y=at,nr.prototype.toString=function(){try{return tr=!0,rr(this).toString()}finally{tr=!1}};var sr=class{constructor(lV,J){this.h=lV>>>0,this.g=J>>>0}};let or;function ar(lV){return lV?/^-?\d+$/.test(lV)?(Vt(lV),new hr(Pt,Ot)):null:cr||(cr=new hr(0,0))}var hr=class{constructor(lV,J){this.h=lV>>>0,this.g=J>>>0}};let cr;function ur(lV,J,VV){for(;VV>0||J>127;)lV.g.push(127&J|128),J=(J>>>7|VV<<25)>>>0,VV>>>=7;lV.g.push(J)}function lr(lV,J){for(;J>127;)lV.g.push(127&J|128),J>>>=7;lV.g.push(J)}function fr(lV,J){if(J>=0)lr(lV,J);else{for(let VV=0;VV<9;VV++)lV.g.push(127&J|128),J>>=7;lV.g.push(1)}}function dr(lV,J){lV.g.push(J>>>0&255),lV.g.push(J>>>8&255),lV.g.push(J>>>16&255),lV.g.push(J>>>24&255)}function pr(lV,J){J.length!==0&&(lV.l.push(J),lV.h+=J.length)}function gr(lV,J,VV){lr(lV.g,8*J+VV)}function mr(lV,J){return gr(lV,J,2),J=lV.g.end(),pr(lV,J),J.push(lV.h),J}function yr(lV,J){var VV=J.pop();for(VV=lV.h+lV.g.length()-VV;VV>127;)J.push(127&VV|128),VV>>>=7,lV.h++;J.push(VV),lV.h++}function _r(lV,J,VV){gr(lV,J,2),lr(lV.g,VV.length),pr(lV,lV.g.end()),pr(lV,VV)}function vr(lV,J,VV,RV){VV!=null&&(J=mr(lV,J),RV(VV,lV),yr(lV,J))}class Er{constructor(J,VV,RV){this.g=J,this.h=VV,this.qa=RV}}function wr(lV){return Array.isArray(lV)?lV[0]instanceof Er?lV:[gi,lV]:[lV,void 0]}function Tr(lV,J){if(Array.isArray(J)){var VV=tt(J);if(4&VV)return J;for(var RV=0,UV=0;RV<J.length;RV++){const ZV=lV(J[RV]);ZV!=null&&(J[UV++]=ZV)}return UV<RV&&(J.length=UV),nt(J,-12289&(5|VV)),2&VV&&Object.freeze(J),J}}const Ar=Symbol();function br(lV){let J=lV[Ar];if(!J){const VV=Ur(lV),RV=VV.h;J=RV?(UV,ZV)=>RV(UV,ZV,VV):(UV,ZV)=>{var CV;for(;Kn(ZV)&&ZV.h!=4;){var WV=ZV.m;let FV=VV[WV];const NV=!FV;let eV=!1;if(!FV){var IV=VV.X;if(IV){var dV=IV[WV];dV&&(eV=(CV=IV.P)==null?void 0:CV[WV],(!d||eV)&&(IV=kr(dV))&&(FV=VV[WV]=IV))}}FV&&FV(ZV,UV,WV)||(WV=(IV=ZV).l,Yn(IV),IV.ja?IV=void 0:(dV=IV.g.g-WV,IV.g.g=WV,IV=Wn(IV.g,dV)),WV=UV,IV&&(mt||(mt=Symbol()),(dV=WV[mt])?dV.push(IV):WV[mt]=[IV])),NV&&FV&&!eV&&Wr++<5&&j()}},lV[Ar]=J}return J}function kr(lV){const J=(lV=wr(lV))[0].g;if(lV=lV[1]){const VV=br(lV),RV=Ur(lV).g;return(UV,ZV,WV)=>J(UV,ZV,WV,RV,VV)}return J}function Sr(lV,J,VV){lV[J]=VV}function xr(lV,J,VV,RV){var UV=Sr;J.g=function(NV){switch(typeof NV){case"boolean":return pe||(pe=[0,void 0,!0]);case"number":return NV>0?void 0:NV===0?ge||(ge=[0,void 0]):[-NV,void 0];case"string":return[0,NV];case"object":return NV}}(lV[0]);let ZV=0;var WV=lV[++ZV];WV&&WV.constructor===Object&&(J.X=WV,typeof(WV=lV[++ZV])=="function"&&(J.h=WV,J.l=lV[++ZV],WV=lV[++ZV]));const IV={};for(;Array.isArray(WV)&&typeof WV[0]=="number"&&WV[0]>0;){for(var dV=0;dV<WV.length;dV++)IV[WV[dV]]=WV;WV=lV[++ZV]}for(dV=1;WV!==void 0;){let NV;typeof WV=="number"&&(dV+=WV,WV=lV[++ZV]);var CV=void 0;if(WV instanceof Er?NV=WV:(NV=mi,ZV--),NV.qa){WV=lV[++ZV],CV=lV;var FV=ZV;typeof WV=="function"&&(WV=WV(),CV[FV]=WV),CV=WV}for(FV=dV+1,typeof(WV=lV[++ZV])=="number"&&WV<0&&(FV-=WV,WV=lV[++ZV]);dV<FV;dV++){const eV=IV[dV];UV(J,dV,CV?RV(NV,CV,eV):VV(NV,eV))}}return J}const Lr=Symbol();function Rr(lV){let J=lV[Lr];if(!J){const VV=Pr(lV);J=(RV,UV)=>Br(RV,UV,VV),lV[Lr]=J}return J}const Fr=Symbol();function Mr(lV){return lV.h}function Ir(lV,J){let VV,RV;const UV=lV.h;return(ZV,WV,IV)=>UV(ZV,WV,IV,RV||(RV=Pr(J).g),VV||(VV=Rr(J)))}function Pr(lV){let J=lV[Fr];return J||(J=xr(lV,lV[Fr]={},Mr,Ir))}const Or=Symbol();function Cr(lV,J){const VV=lV.g;return J?(RV,UV,ZV)=>VV(RV,UV,ZV,J):VV}function Nr(lV,J,VV){const RV=lV.g;let UV,ZV;return(WV,IV,dV)=>RV(WV,IV,dV,ZV||(ZV=Ur(J).g),UV||(UV=br(J)),VV)}function Ur(lV){let J=lV[Or];return J||(J=xr(lV,lV[Or]={},Cr,Nr))}function Dr(lV,J){var ZV;var VV=lV[J];if(VV)return VV;if(VV=lV.X){var RV=VV[J];if(RV){var UV=(RV=wr(RV))[0].h;if(RV=RV[1],VV=(ZV=VV.P)==null?void 0:ZV[J],!d||VV){if(RV){const WV=Rr(RV),IV=Pr(RV).g;VV=(VV=lV.l)?VV(IV,WV):(dV,CV,FV)=>UV(dV,CV,FV,IV,WV)}else VV=UV;return lV[J]=VV}}}}function Br(lV,J,VV){var dV,CV,FV;for(var RV=et(lV),UV=+!!(512&RV)-1,ZV=lV.length,WV=512&RV?1:0,IV=ZV+(256&RV?-1:0);WV<IV;WV++){const NV=lV[WV];if(NV==null)continue;const eV=WV-UV,gV=Dr(VV,eV);if(!gV)continue;const nV=VV.X;nV!=null&&nV[eV]&&!((dV=nV==null?void 0:nV.P)!=null&&dV[eV])&&Wr++<5&&j(),gV(J,NV,eV)}if(256&RV){RV=lV[ZV-1];for(let NV in RV)UV=+NV,!Number.isNaN(UV)&&(ZV=RV[NV])!=null&&(IV=Dr(VV,UV))&&((CV=WV=VV.X)!=null&&CV[UV]&&!((FV=WV==null?void 0:WV.P)!=null&&FV[UV])&&Wr++<5&&j(),IV(J,ZV,UV))}if(lV=mt?lV[mt]:void 0)for(pr(J,J.g.end()),VV=0;VV<lV.length;VV++)pr(J,U(lV[VV])||new Uint8Array(0))}function Gr(lV,J){return new Er(lV,J,!1)}function jr(lV,J){return new Er(lV,J,!1)}function Vr(lV,J){return new Er(lV,J,!0)}function Xr(lV,J,VV){qe(lV,et(lV),J,VV)}var Hr=Vr(function(lV,J,VV,RV,UV){return lV.h===2&&(lV=$n(lV,Ae([void 0,void 0],RV),UV),pt(RV=et(J)),(UV=Ye(J,RV,VV))instanceof Me?2&UV.M?((UV=UV.Z()).push(lV),qe(J,RV,VV,UV)):UV.Qa(lV):Array.isArray(UV)?(2&tt(UV)&&qe(J,RV,VV,UV=on(UV)),UV.push(lV)):qe(J,RV,VV,[lV]),!0)},function(lV,J,VV,RV,UV){if(J instanceof Me)J.forEach((ZV,WV)=>{vr(lV,VV,Ae([WV,ZV],RV),UV)});else if(Array.isArray(J))for(let ZV=0;ZV<J.length;ZV++){const WV=J[ZV];Array.isArray(WV)&&vr(lV,VV,Ae(WV,RV),UV)}});let Wr=0;function zr(lV,J,VV){if(J=function(RV){if(RV==null)return RV;const UV=typeof RV;if(UV==="bigint")return String(BigInt.asIntN(64,RV));if(Kt(RV)){if(UV==="string")return Zt(RV);if(UV==="number")return Jt(RV)}}(J),J!=null&&(typeof J=="string"&&ar(J),J!=null))switch(gr(lV,VV,0),typeof J){case"number":lV=lV.g,Nt(J),ur(lV,Pt,Ot);break;case"bigint":VV=BigInt.asUintN(64,J),VV=new hr(Number(VV&BigInt(4294967295)),Number(VV>>BigInt(32))),ur(lV.g,VV.h,VV.g);break;default:VV=ar(J),ur(lV.g,VV.h,VV.g)}}function Kr(lV,J,VV){(J=Yt(J))!=null&&J!=null&&(gr(lV,VV,0),fr(lV.g,J))}function Yr(lV,J,VV){(J=Wt(J))!=null&&(gr(lV,VV,0),lV.g.g.push(J?1:0))}function $r(lV,J,VV){(J=re(J))!=null&&_r(lV,VV,c(J))}function qr(lV,J,VV,RV,UV){J instanceof nr?(we(J),J=J.u):J=Array.isArray(J)?Ae(J,RV):void 0,vr(lV,VV,J,UV)}function Jr(lV,J,VV){(J=J==null||typeof J=="string"||I(J)||J instanceof D?J:void 0)!=null&&_r(lV,VV,On(J).buffer)}function Zr(lV,J,VV){return(lV.h===5||lV.h===2)&&(J=Je(J,et(J),VV,2,!1),lV.h==2?Zn(lV,Gn,J):J.push(Gn(lV.g)),!0)}var Qr,ti=Gr(function(lV,J,VV){if(lV.h!==1)return!1;var RV=lV.g;lV=Bn(RV);const UV=Bn(RV);RV=2*(UV>>31)+1;const ZV=UV>>>20&2047;return lV=4294967296*(1048575&UV)+lV,Xr(J,VV,ZV==2047?lV?NaN:RV*(1/0):ZV==0?5e-324*RV*lV:RV*Math.pow(2,ZV-1075)*(lV+4503599627370496)),!0},function(lV,J,VV){(J=Ht(J))!=null&&(gr(lV,VV,1),lV=lV.g,(VV=It||(It=new DataView(new ArrayBuffer(8)))).setFloat64(0,+J,!0),Pt=VV.getUint32(0,!0),Ot=VV.getUint32(4,!0),dr(lV,Pt),dr(lV,Ot))}),ei=Gr(function(lV,J,VV){return lV.h===5&&(Xr(J,VV,Gn(lV.g)),!0)},function(lV,J,VV){(J=Ht(J))!=null&&(gr(lV,VV,5),lV=lV.g,Ut(J),dr(lV,Pt))}),ni=jr(Zr,function(lV,J,VV){if((J=Tr(Ht,J))!=null)for(let WV=0;WV<J.length;WV++){var RV=lV,UV=VV,ZV=J[WV];ZV!=null&&(gr(RV,UV,5),RV=RV.g,Ut(ZV),dr(RV,Pt))}}),ri=jr(Zr,function(lV,J,VV){if((J=Tr(Ht,J))!=null&&J.length){gr(lV,VV,2),lr(lV.g,4*J.length);for(let RV=0;RV<J.length;RV++)VV=lV.g,Ut(J[RV]),dr(VV,Pt)}}),ii=Gr(function(lV,J,VV){return lV.h===0&&(Xr(J,VV,Cn(lV.g,Bt)),!0)},zr),si=Gr(function(lV,J,VV){return lV.h===0&&(Xr(J,VV,(lV=Cn(lV.g,Bt))===0?void 0:lV),!0)},zr),oi=Gr(function(lV,J,VV){return lV.h===0&&(Xr(J,VV,Cn(lV.g,Dt)),!0)},function(lV,J,VV){if((J=te(J))!=null&&(typeof J=="string"&&ir(J),J!=null))switch(gr(lV,VV,0),typeof J){case"number":lV=lV.g,Nt(J),ur(lV,Pt,Ot);break;case"bigint":VV=BigInt.asUintN(64,J),VV=new sr(Number(VV&BigInt(4294967295)),Number(VV>>BigInt(32))),ur(lV.g,VV.h,VV.g);break;default:VV=ir(J),ur(lV.g,VV.h,VV.g)}}),ai=Gr(function(lV,J,VV){return lV.h===0&&(Xr(J,VV,Un(lV.g)),!0)},Kr),hi=jr(function(lV,J,VV){return(lV.h===0||lV.h===2)&&(J=Je(J,et(J),VV,2,!1),lV.h==2?Zn(lV,Un,J):J.push(Un(lV.g)),!0)},function(lV,J,VV){if((J=Tr(Yt,J))!=null&&J.length){VV=mr(lV,VV);for(let RV=0;RV<J.length;RV++)fr(lV.g,J[RV]);yr(lV,VV)}}),ci=Gr(function(lV,J,VV){return lV.h===0&&(Xr(J,VV,(lV=Un(lV.g))===0?void 0:lV),!0)},Kr),ui=Gr(function(lV,J,VV){return lV.h===0&&(Xr(J,VV,Nn(lV.g)),!0)},Yr),li=Gr(function(lV,J,VV){return lV.h===0&&(Xr(J,VV,(lV=Nn(lV.g))===!1?void 0:lV),!0)},Yr),fi=jr(function(lV,J,VV){if(lV.h!==2)return!1;lV=qn(lV);const RV=et(J);return pt(RV),Je(J,RV,VV,2).push(lV),!0},function(lV,J,VV){if((J=Tr(re,J))!=null)for(let WV=0;WV<J.length;WV++){var RV=lV,UV=VV,ZV=J[WV];ZV!=null&&_r(RV,UV,c(ZV))}}),di=Gr(function(lV,J,VV){return lV.h===2&&(Xr(J,VV,(lV=qn(lV))===""?void 0:lV),!0)},$r),pi=Gr(function(lV,J,VV){return lV.h===2&&(Xr(J,VV,qn(lV)),!0)},$r),gi=Vr(function(lV,J,VV,RV,UV){return lV.h===2&&($n(lV,fn(J,RV,VV,!0),UV),!0)},qr),mi=Vr(function(lV,J,VV,RV,UV){return lV.h===2&&($n(lV,fn(J,RV,VV),UV),!0)},qr);Qr=new Er(function(lV,J,VV,RV,UV){if(lV.h!==2)return!1;RV=Ae(void 0,RV);let ZV=et(J);pt(ZV);let WV=Je(J,ZV,VV,3);return ZV=et(J),4&tt(WV)&&(WV=H(WV),nt(WV,-2079&(1|tt(WV))),qe(J,ZV,VV,WV)),WV.push(RV),$n(lV,RV,UV),!0},function(lV,J,VV,RV,UV){if(Array.isArray(J))for(let ZV=0;ZV<J.length;ZV++)qr(lV,J[ZV],VV,RV,UV)},!0);var yi=Vr(function(lV,J,VV,RV,UV,ZV){return lV.h===2&&(un(J,et(J),ZV,VV),$n(lV,J=fn(J,RV,VV),UV),!0)},qr),_i=Gr(function(lV,J,VV){return lV.h===2&&(Xr(J,VV,Jn(lV)),!0)},Jr),vi=jr(function(lV,J,VV){return(lV.h===0||lV.h===2)&&(J=Je(J,et(J),VV,2,!1),lV.h==2?Zn(lV,Dn,J):J.push(Dn(lV.g)),!0)},function(lV,J,VV){if((J=Tr($t,J))!=null)for(let WV=0;WV<J.length;WV++){var RV=lV,UV=VV,ZV=J[WV];ZV!=null&&(gr(RV,UV,0),lr(RV.g,ZV))}}),Ei=Gr(function(lV,J,VV){return lV.h===0&&(Xr(J,VV,Un(lV.g)),!0)},function(lV,J,VV){(J=Yt(J))!=null&&(J=parseInt(J,10),gr(lV,VV,0),fr(lV.g,J))});class wi{constructor(J,VV){this.h=J,this.g=VV,this.l=pn,this.m=yn,this.defaultValue=void 0}}function Ti(lV,J){return new wi(lV,J)}function Ai(lV,J){return(VV,RV)=>{if(Qn.length){const ZV=Qn.pop();ZV.o(RV),Vn(ZV.g,VV,RV),VV=ZV}else VV=new class{constructor(ZV,WV){if(zn.length){const IV=zn.pop();Vn(IV,ZV,WV),ZV=IV}else ZV=new class{constructor(IV,dV){this.h=null,this.m=!1,this.g=this.l=this.j=0,Vn(this,IV,dV)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.ea=!1}}(ZV,WV);this.g=ZV,this.l=this.g.g,this.h=this.m=-1,this.o(WV)}o({ja:ZV=!1}={}){this.ja=ZV}}(VV,RV);try{const ZV=new lV,WV=ZV.u;br(J)(WV,VV);var UV=ZV}finally{VV.g.clear(),VV.m=-1,VV.h=-1,Qn.length<100&&Qn.push(VV)}return UV}}function bi(lV){return function(){we(this);const J=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const WV=this.g;return this.g=[],WV}}}};Br(this.u,J,Pr(lV)),pr(J,J.g.end());const VV=new Uint8Array(J.h),RV=J.l,UV=RV.length;let ZV=0;for(let WV=0;WV<UV;WV++){const IV=RV[WV];VV.set(IV,ZV),ZV+=IV.length}return J.l=[VV],VV}}var ki=class extends nr{constructor(lV){super(lV)}},Si=[0,di,Gr(function(lV,J,VV){return lV.h===2&&(Xr(J,VV,(lV=Jn(lV))===N()?void 0:lV),!0)},function(lV,J,VV){if(J!=null){if(J instanceof nr){const RV=J.Ta;return void(RV&&(J=RV(J),J!=null&&_r(lV,VV,On(J).buffer)))}if(Array.isArray(J))return}Jr(lV,J,VV)})],xi=[0,ai,Ei,ui,-1,hi,Ei,-1],Li=class extends nr{constructor(){super()}},Ri=[0,ui,pi,ui,Ei,-1,jr(function(lV,J,VV){return(lV.h===0||lV.h===2)&&(J=Je(J,et(J),VV,2,!1),lV.h==2?Zn(lV,jn,J):J.push(Un(lV.g)),!0)},function(lV,J,VV){if((J=Tr(Yt,J))!=null&&J.length){VV=mr(lV,VV);for(let RV=0;RV<J.length;RV++)fr(lV.g,J[RV]);yr(lV,VV)}}),pi,-1,[0,ui,-1],Ei,ui,-1],Fi=[0,pi,-2],Mi=class extends nr{constructor(){super()}},Ii=[0],Pi=[0,ai,ui,1,ui,-3],Oi=[0,pi,ui,-1,ai,[0,[1,2,3,4,5,6,7],yi,Ii,yi,Ri,yi,Fi,yi,Pi,yi,xi,yi,[0,pi,-2],yi,[0,pi,Ei]],[0,pi],ui,[0,[1,3],[2,4],yi,[0,hi],-1,yi,[0,fi],-1,Qr,[0,pi,-1]],pi],Ci=class extends nr{constructor(lV){super(lV,2)}},Ni={},Ui=Ni.P={};Ni[336783863]=Oi,Ui[336783863]=1;var Di=[0,si,-1,li,-3,si,hi,di,ci,si,-1,li,ci,li,-2,di];function Bi(lV,J){an(lV,2,ne(J),"")}function Gi(lV,J){Fn(lV,3,J)}function ji(lV,J){Fn(lV,4,J)}var Vi=class extends nr{constructor(lV){super(lV,500)}o(lV){return yn(this,0,7,lV)}},Xi=[-1,{P:{}}],Hi=[0,pi,1,Xi],Wi=[0,pi,fi,Xi];function zi(lV,J){wn(lV,1,Vi,J)}function Ki(lV,J){Fn(lV,10,J)}function Yi(lV,J){Fn(lV,15,J)}var $i=class extends nr{constructor(lV){super(lV,500)}o(lV){return yn(this,0,1001,lV)}},qi=[-500,Qr,[-500,di,-1,fi,-3,[-2,Ni,ui],Qr,Si,ci,-1,Hi,Wi,Qr,[0,di,li],di,Di,ci,fi,987,fi],4,Qr,[-500,pi,-1,[-1,{P:{}}],998,pi],Qr,[-500,pi,fi,-1,[-2,{P:{}},ui],997,fi,-1],ci,Qr,[-500,pi,fi,Xi,998,fi],fi,ci,Hi,Wi,Qr,[0,di,-1,Xi],fi,-2,Di,di,-1,li,979,Xi,Qr,Si];$i.prototype.g=bi(qi);var Ji=Ai($i,qi),Zi=class extends nr{constructor(lV){super(lV)}},Qi=class extends nr{constructor(lV){super(lV)}g(){return mn(this,Zi,1)}},ts=[0,Qr,[0,ai,ei,pi,-1]],es=Ai(Qi,ts),ns=class extends nr{constructor(lV){super(lV)}},rs=class extends nr{constructor(lV){super(lV)}},is=class extends nr{constructor(lV){super(lV)}h(){return pn(this,ns,2)}g(){return mn(this,rs,5)}},ss=Ai(class extends nr{constructor(lV){super(lV)}},[0,fi,hi,ri,[0,Ei,[0,ai,-3],[0,ei,-3],[0,ai,-1,[0,Qr,[0,ai,-2]]],Qr,[0,ei,-1,pi,ei]],pi,-1,ii,Qr,[0,ai,ei],fi,ii]),os=class extends nr{constructor(lV){super(lV)}},as=Ai(class extends nr{constructor(lV){super(lV)}},[0,Qr,[0,ei,-4]]),hs=class extends nr{constructor(lV){super(lV)}},cs=Ai(class extends nr{constructor(lV){super(lV)}},[0,Qr,[0,ei,-4]]),us=class extends nr{constructor(lV){super(lV)}},ls=[0,ai,-1,ri,Ei],fs=class extends nr{constructor(){super()}};fs.prototype.g=bi([0,ei,-4,ii]);var ds=class extends nr{constructor(lV){super(lV)}},ps=Ai(class extends nr{constructor(lV){super(lV)}},[0,Qr,[0,1,ai,pi,ts],ii]),gs=class extends nr{constructor(lV){super(lV)}},ms=class extends nr{constructor(lV){super(lV)}ra(){const lV=Qe(this);return lV??N()}},ys=class extends nr{constructor(lV){super(lV)}},_s=[1,2],vs=Ai(class extends nr{constructor(lV){super(lV)}},[0,Qr,[0,_s,yi,[0,ri],yi,[0,_i],ai,pi],ii]),Es=class extends nr{constructor(lV){super(lV)}},ws=[0,pi,ai,ei,fi,-1],Ts=class extends nr{constructor(lV){super(lV)}},As=[0,ui,-1],bs=class extends nr{constructor(lV){super(lV)}},ks=[1,2,3,4,5],Ss=class extends nr{constructor(lV){super(lV)}g(){return Qe(this)!=null}h(){return re(ze(this,2))!=null}},xs=class extends nr{constructor(lV){super(lV)}g(){return Wt(ze(this,2))??!1}},Ls=[0,_i,pi,[0,ai,ii,-1],[0,oi,ii]],Rs=[0,Ls,ui,[0,ks,yi,Pi,yi,Ri,yi,xi,yi,Ii,yi,Fi],Ei],Fs=class extends nr{constructor(lV){super(lV)}},Ms=[0,Rs,ei,-1,ai],Is=Ti(502141897,Fs);Ni[502141897]=Ms,Ui[502141897]=1;var Ps=[0,Ls];Ni[512499200]=Ps;var Os=[0,Ps];Ni[515723506]=Os;var Cs=Ai(class extends nr{constructor(lV){super(lV)}},[0,[0,Ei,-1,ni,vi],ls]),Ns=[0,Rs];Ni[508981768]=Ns;var Us=class extends nr{constructor(lV){super(lV)}},Ds=class extends nr{constructor(lV){super(lV)}},Bs=[0,Rs,ei,Ns,ui],Gs=[0,Rs,Ms,Bs,ei,Os];Ni[508968149]=Bs;var js=Ti(508968150,Ds);Ni[508968150]=Gs,Ui[508968150]=1,Ui[508968149]=1;var Vs=class extends nr{constructor(lV){super(lV)}},Xs=Ti(513916220,Vs);Ni[513916220]=[0,Rs,Gs,ai],Ui[513916220]=1;var Hs=class extends nr{constructor(lV){super(lV)}h(){return pn(this,Es,2)}g(){$e(this,2)}},Ws=[0,Rs,ws];Ni[478825465]=Ws,Ui[478825465]=1;var zs=[0,Rs];Ni[478825422]=zs;var Ks=class extends nr{constructor(lV){super(lV)}},Ys=class extends nr{constructor(lV){super(lV)}},$s=class extends nr{constructor(lV){super(lV)}},qs=class extends nr{constructor(lV){super(lV)}},Js=class extends nr{constructor(lV){super(lV)}},Zs=[0,Rs,zs,Ws,-1],Qs=[0,Rs,ei,ai],to=[0,Rs,ei],eo=[0,Rs,Qs,to,ei],no=[0,Rs,eo,Zs];Ni[463370452]=Zs,Ni[464864288]=Qs,Ni[474472470]=to;var ro=Ti(462713202,qs);Ni[462713202]=eo;var io=Ti(479097054,Js);Ni[479097054]=no,Ui[479097054]=1,Ui[463370452]=1,Ui[464864288]=1,Ui[462713202]=1,Ui[474472470]=1;var so=class extends nr{constructor(lV){super(lV)}},oo=class extends nr{constructor(lV){super(lV)}},ao=class extends nr{constructor(lV){super(lV)}},ho=class extends nr{constructor(){super()}},co=[0,Rs,ei,-1,ai],uo=[0,Rs,ei,ui];ho.prototype.g=bi([0,Rs,to,[0,Rs],Ms,Bs,co,uo]),Ni[514774813]=co,Ni[518928384]=uo;var lo=class extends nr{constructor(lV){super(lV)}},fo=Ti(456383383,lo);Ni[456383383]=[0,Rs,ws],Ui[456383383]=1;var po=class extends nr{constructor(lV){super(lV)}},go=Ti(476348187,po);Ni[476348187]=[0,Rs,As],Ui[476348187]=1;var mo=class extends nr{constructor(lV){super(lV)}},yo=class extends nr{constructor(lV){super(lV)}},_o=[0,Ei,-1],vo=Ti(458105876,class extends nr{constructor(lV){super(lV)}g(){var lV=this.u;const J=et(lV),VV=2&J;return lV=function(RV,UV,ZV){var WV=yo;const IV=2&UV;let dV=!1;if(ZV==null){if(IV)return Ne();ZV=[]}else if(ZV.constructor===Me){if(!(2&ZV.M)||IV)return ZV;ZV=ZV.Z()}else Array.isArray(ZV)?dV=!!(2&tt(ZV)):ZV=[];if(IV){if(!ZV.length)return Ne();dV||(dV=!0,rt(ZV))}else dV&&(dV=!1,ZV=on(ZV));return dV||(64&tt(ZV)?Q(ZV,32):32&UV&&Z(ZV,32)),qe(RV,UV,2,WV=new Me(ZV,WV,se,void 0)),WV}(lV,J,Ye(lV,J,2)),!VV&&yo&&(lV.va=!0),lV}});Ni[458105876]=[0,_o,Hr,[!0,ii,[0,pi,-1,fi]]],Ui[458105876]=1;var Eo=class extends nr{constructor(lV){super(lV)}},wo=Ti(458105758,Eo);Ni[458105758]=[0,Rs,pi,_o],Ui[458105758]=1;var To=class extends nr{constructor(lV){super(lV)}},Ao=Ti(443442058,To);Ni[443442058]=[0,Rs,pi,ai,ei,fi,-1],Ui[443442058]=1,Ui[514774813]=1;var bo=class extends nr{constructor(lV){super(lV)}},ko=Ti(516587230,bo);function So(lV,J){return J=J?J.clone():new Es,lV.displayNamesLocale!==void 0?$e(J,1,ne(lV.displayNamesLocale)):lV.displayNamesLocale===void 0&&$e(J,1),lV.maxResults!==void 0?xn(J,2,lV.maxResults):"maxResults"in lV&&$e(J,2),lV.scoreThreshold!==void 0?Ln(J,3,lV.scoreThreshold):"scoreThreshold"in lV&&$e(J,3),lV.categoryAllowlist!==void 0?Rn(J,4,lV.categoryAllowlist):"categoryAllowlist"in lV&&$e(J,4),lV.categoryDenylist!==void 0?Rn(J,5,lV.categoryDenylist):"categoryDenylist"in lV&&$e(J,5),J}function xo(lV,J=-1,VV=""){return{categories:lV.map(RV=>({index:Tn(An(RV,1),0)??-1,score:bn(RV,2)??0,categoryName:kn(RV,3)??"",displayName:kn(RV,4)??""})),headIndex:J,headName:VV}}function Lo(lV){var WV,IV;var J=en(lV,3,Ht,tn()),VV=en(lV,2,Yt,tn()),RV=en(lV,1,re,tn()),UV=en(lV,9,re,tn());const ZV={categories:[],keypoints:[]};for(let dV=0;dV<J.length;dV++)ZV.categories.push({score:J[dV],index:VV[dV]??-1,categoryName:RV[dV]??"",displayName:UV[dV]??""});if((J=(WV=pn(lV,is,4))==null?void 0:WV.h())&&(ZV.boundingBox={originX:An(J,1)??0,originY:An(J,2)??0,width:An(J,3)??0,height:An(J,4)??0,angle:0}),(IV=pn(lV,is,4))==null?void 0:IV.g().length)for(const dV of pn(lV,is,4).g())ZV.keypoints.push({x:Ze(dV,1)??0,y:Ze(dV,2)??0,score:Ze(dV,4)??0,label:re(ze(dV,3))??""});return ZV}function Ro(lV){const J=[];for(const VV of mn(lV,hs,1))J.push({x:bn(VV,1)??0,y:bn(VV,2)??0,z:bn(VV,3)??0,visibility:bn(VV,4)??0});return J}function Fo(lV){const J=[];for(const VV of mn(lV,os,1))J.push({x:bn(VV,1)??0,y:bn(VV,2)??0,z:bn(VV,3)??0,visibility:bn(VV,4)??0});return J}function Mo(lV){return Array.from(lV,J=>J>127?J-256:J)}function Io(lV,J){if(lV.length!==J.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${lV.length} vs. ${J.length}).`);let VV=0,RV=0,UV=0;for(let ZV=0;ZV<lV.length;ZV++)VV+=lV[ZV]*J[ZV],RV+=lV[ZV]*lV[ZV],UV+=J[ZV]*J[ZV];if(RV<=0||UV<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return VV/Math.sqrt(RV*UV)}let Po;Ni[516587230]=[0,Rs,co,uo,ei],Ui[516587230]=1,Ui[518928384]=1;const Oo=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function Co(){if(Po===void 0)try{await WebAssembly.instantiate(Oo),Po=!0}catch{Po=!1}return Po}async function No(lV,J=""){const VV=await Co()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${J}/${lV}_${VV}.js`,wasmBinaryPath:`${J}/${lV}_${VV}.wasm`}}var Uo=class{};function Do(){var lV=navigator;return typeof OffscreenCanvas<"u"&&(!function(J=navigator){return(J=J.userAgent).includes("Safari")&&!J.includes("Chrome")}(lV)||!!((lV=lV.userAgent.match(/Version\/([\d]+).*Safari/))&&lV.length>=1&&Number(lV[1])>=17))}async function Bo(lV){if(typeof importScripts!="function"){const J=document.createElement("script");return J.src=lV.toString(),J.crossOrigin="anonymous",new Promise((VV,RV)=>{J.addEventListener("load",()=>{VV()},!1),J.addEventListener("error",UV=>{RV(UV)},!1),document.body.appendChild(J)})}importScripts(lV.toString())}function Go(lV){return lV.videoWidth!==void 0?[lV.videoWidth,lV.videoHeight]:lV.naturalWidth!==void 0?[lV.naturalWidth,lV.naturalHeight]:lV.displayWidth!==void 0?[lV.displayWidth,lV.displayHeight]:[lV.width,lV.height]}function jo(lV,J,VV){lV.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),VV(J=lV.i.stringToNewUTF8(J)),lV.i._free(J)}function Vo(lV,J,VV){if(!lV.i.canvas)throw Error("No OpenGL canvas configured.");if(VV?lV.i._bindTextureToStream(VV):lV.i._bindTextureToCanvas(),!(VV=lV.i.canvas.getContext("webgl2")||lV.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");lV.i.gpuOriginForWebTexturesIsBottomLeft&&VV.pixelStorei(VV.UNPACK_FLIP_Y_WEBGL,!0),VV.texImage2D(VV.TEXTURE_2D,0,VV.RGBA,VV.RGBA,VV.UNSIGNED_BYTE,J),lV.i.gpuOriginForWebTexturesIsBottomLeft&&VV.pixelStorei(VV.UNPACK_FLIP_Y_WEBGL,!1);const[RV,UV]=Go(J);return!lV.l||RV===lV.i.canvas.width&&UV===lV.i.canvas.height||(lV.i.canvas.width=RV,lV.i.canvas.height=UV),[RV,UV]}function Xo(lV,J,VV){lV.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const RV=new Uint32Array(J.length);for(let UV=0;UV<J.length;UV++)RV[UV]=lV.i.stringToNewUTF8(J[UV]);J=lV.i._malloc(4*RV.length),lV.i.HEAPU32.set(RV,J>>2),VV(J);for(const UV of RV)lV.i._free(UV);lV.i._free(J)}function Ho(lV,J,VV){lV.i.simpleListeners=lV.i.simpleListeners||{},lV.i.simpleListeners[J]=VV}function Wo(lV,J,VV){let RV=[];lV.i.simpleListeners=lV.i.simpleListeners||{},lV.i.simpleListeners[J]=(UV,ZV,WV)=>{ZV?(VV(RV,WV),RV=[]):RV.push(UV)}}Uo.forVisionTasks=function(lV){return No("vision",lV)},Uo.forTextTasks=function(lV){return No("text",lV)},Uo.forGenAiExperimentalTasks=function(lV){return No("genai_experimental",lV)},Uo.forGenAiTasks=function(lV){return No("genai",lV)},Uo.forAudioTasks=function(lV){return No("audio",lV)},Uo.isSimdSupported=function(){return Co()};async function zo(lV,J,VV,RV){return lV=await(async(UV,ZV,WV,IV,dV)=>{if(ZV&&await Bo(ZV),!self.ModuleFactory||WV&&(await Bo(WV),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&dV&&((ZV=self.Module).locateFile=dV.locateFile,dV.mainScriptUrlOrBlob&&(ZV.mainScriptUrlOrBlob=dV.mainScriptUrlOrBlob)),dV=await self.ModuleFactory(self.Module||dV),self.ModuleFactory=self.Module=void 0,new UV(dV,IV)})(lV,VV.wasmLoaderPath,VV.assetLoaderPath,J,{locateFile:UV=>UV.endsWith(".wasm")?VV.wasmBinaryPath.toString():VV.assetBinaryPath&&UV.endsWith(".data")?VV.assetBinaryPath.toString():UV}),await lV.o(RV),lV}function Ko(lV,J){const VV=pn(lV.baseOptions,Ss,1)||new Ss;typeof J=="string"?($e(VV,2,ne(J)),$e(VV,1)):J instanceof Uint8Array&&($e(VV,1,lt(J,!1,!1)),$e(VV,2)),yn(lV.baseOptions,0,1,VV)}function Yo(lV){try{const J=lV.H.length;if(J===1)throw Error(lV.H[0].message);if(J>1)throw Error("Encountered multiple errors: "+lV.H.map(VV=>VV.message).join(", "))}finally{lV.H=[]}}function $o(lV,J){lV.B=Math.max(lV.B,J)}function qo(lV,J){lV.A=new Vi,Bi(lV.A,"PassThroughCalculator"),Gi(lV.A,"free_memory"),ji(lV.A,"free_memory_unused_out"),Ki(J,"free_memory"),zi(J,lV.A)}function Jo(lV,J){Gi(lV.A,J),ji(lV.A,J+"_unused_out")}function Zo(lV){lV.g.addBoolToStream(!0,"free_memory",lV.B)}var Qo=class{constructor(lV){this.g=lV,this.H=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(lV,J=!0){var VV,RV,UV,ZV,WV,IV;if(J){const dV=lV.baseOptions||{};if((VV=lV.baseOptions)!=null&&VV.modelAssetBuffer&&((RV=lV.baseOptions)!=null&&RV.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((UV=pn(this.baseOptions,Ss,1))!=null&&UV.g()||(ZV=pn(this.baseOptions,Ss,1))!=null&&ZV.h()||(WV=lV.baseOptions)!=null&&WV.modelAssetBuffer||(IV=lV.baseOptions)!=null&&IV.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(CV,FV){let NV=pn(CV.baseOptions,bs,3);if(!NV){var eV=NV=new bs,gV=new Mi;_n(eV,4,ks,gV)}"delegate"in FV&&(FV.delegate==="GPU"?(FV=NV,eV=new Li,_n(FV,2,ks,eV)):(FV=NV,eV=new Mi,_n(FV,4,ks,eV))),yn(CV.baseOptions,0,3,NV)}(this,dV),dV.modelAssetPath)return fetch(dV.modelAssetPath.toString()).then(CV=>{if(CV.ok)return CV.arrayBuffer();throw Error(`Failed to fetch model: ${dV.modelAssetPath} (${CV.status})`)}).then(CV=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(CV),!0,!1,!1),Ko(this,"/model.dat"),this.m(),this.J()});if(dV.modelAssetBuffer instanceof Uint8Array)Ko(this,dV.modelAssetBuffer);else if(dV.modelAssetBuffer)return async function(CV){const FV=[];for(var NV=0;;){const{done:eV,value:gV}=await CV.read();if(eV)break;FV.push(gV),NV+=gV.length}if(FV.length===0)return new Uint8Array(0);if(FV.length===1)return FV[0];CV=new Uint8Array(NV),NV=0;for(const eV of FV)CV.set(eV,NV),NV+=eV.length;return CV}(dV.modelAssetBuffer).then(CV=>{Ko(this,CV),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ga(){let lV;if(this.g.ga(J=>{lV=Ji(J)}),!lV)throw Error("Failed to retrieve CalculatorGraphConfig");return lV}setGraph(lV,J){this.g.attachErrorListener((VV,RV)=>{this.H.push(Error(RV))}),this.g.Oa(),this.g.setGraph(lV,J),this.A=void 0,Yo(this)}finishProcessing(){this.g.finishProcessing(),Yo(this)}close(){this.A=void 0,this.g.closeGraph()}};function ta(lV,J){if(!lV)throw Error(`Unable to obtain required WebGL resource: ${J}`);return lV}Qo.prototype.close=Qo.prototype.close,function(lV,J){lV=lV.split(".");var VV,RV=t;for((lV[0]in RV)||RV.execScript===void 0||RV.execScript("var "+lV[0]);lV.length&&(VV=lV.shift());)lV.length||J===void 0?RV=RV[VV]&&RV[VV]!==Object.prototype[VV]?RV[VV]:RV[VV]={}:RV[VV]=J}("TaskRunner",Qo);class ea{constructor(J,VV,RV,UV){this.g=J,this.h=VV,this.m=RV,this.l=UV}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function na(lV,J,VV){const RV=lV.g;if(VV=ta(RV.createShader(VV),"Failed to create WebGL shader"),RV.shaderSource(VV,J),RV.compileShader(VV),!RV.getShaderParameter(VV,RV.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${RV.getShaderInfoLog(VV)}`);return RV.attachShader(lV.h,VV),VV}function ra(lV,J){const VV=lV.g,RV=ta(VV.createVertexArray(),"Failed to create vertex array");VV.bindVertexArray(RV);const UV=ta(VV.createBuffer(),"Failed to create buffer");VV.bindBuffer(VV.ARRAY_BUFFER,UV),VV.enableVertexAttribArray(lV.R),VV.vertexAttribPointer(lV.R,2,VV.FLOAT,!1,0,0),VV.bufferData(VV.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),VV.STATIC_DRAW);const ZV=ta(VV.createBuffer(),"Failed to create buffer");return VV.bindBuffer(VV.ARRAY_BUFFER,ZV),VV.enableVertexAttribArray(lV.J),VV.vertexAttribPointer(lV.J,2,VV.FLOAT,!1,0,0),VV.bufferData(VV.ARRAY_BUFFER,new Float32Array(J?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),VV.STATIC_DRAW),VV.bindBuffer(VV.ARRAY_BUFFER,null),VV.bindVertexArray(null),new ea(VV,RV,UV,ZV)}function ia(lV,J){if(lV.g){if(J!==lV.g)throw Error("Cannot change GL context once initialized")}else lV.g=J}function sa(lV,J,VV,RV){return ia(lV,J),lV.h||(lV.m(),lV.C()),VV?(lV.s||(lV.s=ra(lV,!0)),VV=lV.s):(lV.v||(lV.v=ra(lV,!1)),VV=lV.v),J.useProgram(lV.h),VV.bind(),lV.l(),lV=RV(),VV.g.bindVertexArray(null),lV}function oa(lV,J,VV){return ia(lV,J),lV=ta(J.createTexture(),"Failed to create texture"),J.bindTexture(J.TEXTURE_2D,lV),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_WRAP_S,J.CLAMP_TO_EDGE),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_WRAP_T,J.CLAMP_TO_EDGE),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MIN_FILTER,VV??J.LINEAR),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MAG_FILTER,VV??J.LINEAR),J.bindTexture(J.TEXTURE_2D,null),lV}function aa(lV,J,VV){ia(lV,J),lV.A||(lV.A=ta(J.createFramebuffer(),"Failed to create framebuffe.")),J.bindFramebuffer(J.FRAMEBUFFER,lV.A),J.framebufferTexture2D(J.FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_2D,VV,0)}function ha(lV){var J;(J=lV.g)==null||J.bindFramebuffer(lV.g.FRAMEBUFFER,null)}var ca=class{H(){return`
|
|
22446
22455
|
precision mediump float;
|
|
22447
22456
|
varying vec2 vTex;
|
|
22448
22457
|
uniform sampler2D inputTexture;
|