MCPcopy Index your code
hub / github.com/ChinaSiro/claude-code-sourcemap / preventDefault

Method preventDefault

package/cli.js:567–567  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

565`){if($)z+=Csq("");if(Y&&X)z+=Ssq(X)}else if(M===`
566`){if(Y&&X)z+=Ssq(Y);if($)z+=Csq($)}H+=M.length}return z};var Isq=y(()=>{hsq();CT();N08();S08=new Set(["\x1B","›"]),h08=`${fP_}8;;`});var vP_,b16;var _l6=y(()=>{Isq();vP_=typeof Bun<"u"&&typeof Bun.wrapAnsi==="function"?Bun.wrapAnsi:null,b16=vP_??Cy1});function b08(q,K,_){let z=of(q,K,_);return O1(z)>_-K?of(q,K,_-1):z}function kP_(q,K,_){if(K<1)return"";if(K===1)return C08;let z=O1(q);if(z<=K)return q;if(_==="start")return C08+b08(q,z-K+1,z);if(_==="middle"){let Y=Math.floor(K/2);return b08(q,0,Y)+C08+b08(q,z-(K-Y)+1,z)}return b08(q,0,K-1)+C08}function nS(q,K,_){if(_==="wrap")return b16(q,K,{trim:!1,hard:!0});if(_==="wrap-trim")return b16(q,K,{trim:!0,hard:!0});if(_.startsWith("truncate")){let z="end";if(_==="truncate-middle")z="middle";if(_==="truncate-start")z="start";return kP_(q,K,z)}return q}var C08="…";var x08=y(()=>{$A6();Q5();_l6()});function usq(q,K,_=!1){if(K.nodeName==="#text")return;let z=K,Y=_||z.style.position==="absolute",$=zM.get(z);if($)jsq(q,$,Y),zM.delete(z);for(let A of z.childNodes)usq(q,A,Y)}function VP_(q,K){return psq(q,K)}function psq(q,K){if(q===K)return!0;if(q===void 0||K===void 0)return!1;let _=Object.keys(q),z=Object.keys(K);if(_.length!==z.length)return!1;for(let Y of _)if(q[Y]!==K[Y])return!1;return!0}function EP_(q){return q.nodeName!=="#text"}function Fsq(q,K){let _=[];return z(q,0),_;function z(Y,$){let A=Y.yogaNode;if(!A||A.getDisplay()===jL.None)return;let O=$+A.getComputedTop(),w=A.getComputedHeight();if(K<O||K>=O+w)return;if(Y.debugOwnerChain)_=Y.debugOwnerChain;for(let j of Y.childNodes)if(EP_(j))z(j,O)}}var zl6=(q)=>{let _={nodeName:q,style:{},attributes:{},childNodes:[],parentNode:void 0,yogaNode:q!=="ink-virtual-text"&&q!=="ink-link"&&q!=="ink-progress"?Asq():void 0,dirty:!1};if(q==="ink-text")_.yogaNode?.setMeasureFunc(NP_.bind(null,_));else if(q==="ink-raw-ansi")_.yogaNode?.setMeasureFunc(yP_.bind(null,_));return _},I08=(q,K)=>{if(K.parentNode)Yl6(K.parentNode,K);if(K.parentNode=q,q.childNodes.push(K),K.yogaNode)q.yogaNode?.insertChild(K.yogaNode,q.yogaNode.getChildCount());oW(q)},by1=(q,K,_)=>{if(K.parentNode)Yl6(K.parentNode,K);K.parentNode=q;let z=q.childNodes.indexOf(_);if(z>=0){let Y=0;if(K.yogaNode&&q.yogaNode){for(let $=0;$<z;$++)if(q.childNodes[$]?.yogaNode)Y++}if(q.childNodes.splice(z,0,K),K.yogaNode&&q.yogaNode)q.yogaNode.insertChild(K.yogaNode,Y);oW(q);return}if(q.childNodes.push(K),K.yogaNode)q.yogaNode?.insertChild(K.yogaNode,q.yogaNode.getChildCount());oW(q)},Yl6=(q,K)=>{if(K.yogaNode)K.parentNode?.yogaNode?.removeChild(K.yogaNode);usq(q,K),K.parentNode=void 0;let _=q.childNodes.indexOf(K);if(_>=0)q.childNodes.splice(_,1);oW(q)},xy1=(q,K,_)=>{if(K==="children")return;if(q.attributes[K]===_)return;q.attributes[K]=_,oW(q)},Iy1=(q,K)=>{if(VP_(q.style,K))return;q.style=K,oW(q)},msq=(q,K)=>{if(psq(q.textStyles,K))return;q.textStyles=K,oW(q)},Bsq=(q)=>{let K={nodeName:"#text",nodeValue:q,yogaNode:void 0,parentNode:void 0,style:{}};return $l6(K,q),K},NP_=function(q,K,_){let z=q.nodeName==="#text"?q.nodeValue:Jsq(q),Y=Msq(z),$=k08(Y,K);if($.width<=K)return $;if($.width>=1&&K>0&&K<1)return $;if(Y.includes(`
567`)&&_===DT6.Undefined){let w=Math.max(K,$.width);return k08(Y,w)}let A=q.style?.textWrap??"wrap",O=nS(Y,K,A);return k08(O,K)},yP_=function(q){return{width:q.attributes.rawWidth,height:q.attributes.rawHeight}},oW=(q)=>{let K=q,_=!1;while(K){if(K.nodeName!=="#text"){if(K.dirty=!0,!_&&(K.nodeName==="ink-text"||K.nodeName==="ink-raw-ansi")&&K.yogaNode)K.yogaNode.markDirty(),_=!0}K=K.parentNode}},gsq=(q)=>{let K=q;while(K?.parentNode)K=K.parentNode;if(K&&K.nodeName!=="#text")K.onRender?.()},$l6=(q,K)=>{if(typeof K!=="string")K=String(K);if(q.nodeValue===K)return;q.nodeValue=K,oW(q)},uy1=(q)=>{if("childNodes"in q)for(let K of q.childNodes)uy1(K);q.yogaNode=void 0};var TT6=y(()=>{Osq();KA6();wsq();fT6();ky1();Xsq();x08()});var Usq,my1;var py1=y(()=>{Usq={keydown:{bubble:"onKeyDown",capture:"onKeyDownCapture"},focus:{bubble:"onFocus",capture:"onFocusCapture"},blur:{bubble:"onBlur",capture:"onBlurCapture"},paste:{bubble:"onPaste",capture:"onPasteCapture"},resize:{bubble:"onResize"},click:{bubble:"onClick"}},my1=new Set(["onKeyDown","onKeyDownCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onPaste","onPasteCapture","onResize","onClick","onMouseEnter","onMouseLeave"])});function Qsq(q,K,_){let z=q._eventHandlers;if(!z)return;let Y=Usq[K];if(!Y)return;let $=_?Y.capture:Y.bubble;if(!$)return;return z[$]}function RP_(q,K){let _=[],z=q;while(z){let Y=z===q,$=Qsq(z,K.type,!0),A=Qsq(z,K.type,!1);if($)_.unshift({node:z,handler:$,phase:Y?"at_target":"capturing"});if(A&&(K.bubbles||Y))_.push({node:z,handler:A,phase:Y?"at_target":"bubbling"});z=z.parentNode}return _}function hP_(q,K){let _;for(let{node:z,handler:Y,phase:$}of q){if(K._isImmediatePropagationStopped())break;if(K._isPropagationStopped()&&z!==_)break;K._setEventPhase($),K._setCurrentTarget(z),K._prepareForTarget(z);try{Y(K)}catch(A){H6(A)}_=z}}function SP_(q){switch(q){case"keydown":case"keyup":case"click":case"focus":case"blur":case"paste":return hN1;case"resize":case"scroll":case"mousemove":return tf8;default:return gc6}}class By1{currentEvent=null;currentUpdatePriority=gc6;discreteUpdates=null;resolveEventPriority(){if(this.currentUpdatePriority!==SN1)return this.currentUpdatePriority;if(this.currentEvent)return SP_(this.currentEvent.type);return gc6}dispatch(q,K){let _=this.currentEvent;this.currentEvent=K;try{K._setTarget(q);let z=RP_(q,K);return hP_(z,K),K._setEventPhase("none"),K._setCurrentTarget(null),!K.defaultPrevented}finally{this.currentEvent=_}}dispatchDiscrete(q,K){if(!this.discreteUpdates)return this.dispatch(q,K);return this.discreteUpdates((_,z)=>this.dispatch(_,z),q,K,void 0,void 0)}dispatchContinuous(q,K){let _=this.currentUpdatePriority;try{return this.currentUpdatePriority=tf8,this.dispatch(q,K)}finally{this.currentUpdatePriority=_}}}var dsq=y(()=>{ef8();E8();py1()});var Al6;var gy1=y(()=>{Al6=class Al6 extends AL{type;timeStamp;bubbles;cancelable;_target=null;_currentTarget=null;_eventPhase="none";_propagationStopped=!1;_defaultPrevented=!1;constructor(q,K){super();this.type=q,this.timeStamp=performance.now(),this.bubbles=K?.bubbles??!0,this.cancelable=K?.cancelable??!0}get target(){return this._target}get currentTarget(){return this._currentTarget}get eventPhase(){return this._eventPhase}get defaultPrevented(){return this._defaultPrevented}stopPropagation(){this._propagationStopped=!0}stopImmediatePropagation(){super.stopImmediatePropagation(),this._propagationStopped=!0}preventDefault(){if(this.cancelable)this._defaultPrevented=!0}_setTarget(q){this._target=q}_setCurrentTarget(q){this._currentTarget=q}_setEventPhase(q){this._eventPhase=q}_isPropagationStopped(){return this._propagationStopped}_isImmediatePropagationStopped(){return this.didStopImmediatePropagation()}_prepareForTarget(q){}}});var OA6;var csq=y(()=>{gy1();OA6=class OA6 extends Al6{relatedTarget;constructor(q,K=null){super(q,{bubbles:!0,cancelable:!1});this.relatedTarget=K}}});class vT6{activeElement=null;dispatchFocusEvent;enabled=!0;focusStack=[];constructor(q){this.dispatchFocusEvent=q}focus(q){if(q===this.activeElement)return;if(!this.enabled)return;let K=this.activeElement;if(K){let _=this.focusStack.indexOf(K);if(_!==-1)this.focusStack.splice(_,1);if(this.focusStack.push(K),this.focusStack.length>CP_)this.focusStack.shift();this.dispatchFocusEvent(K,new OA6("blur",q))}this.activeElement=q,this.dispatchFocusEvent(q,new OA6("focus",K))}blur(){if(!this.activeElement)return;let q=this.activeElement;this.activeElement=null,this.dispatchFocusEvent(q,new OA6("blur",null))}handleNodeRemoved(q,K){if(this.focusStack=this.focusStack.filter((z)=>z!==q&&Fy1(z,K)),!this.activeElement)return;if(this.activeElement!==q&&Fy1(this.activeElement,K))return;let _=this.activeElement;this.activeElement=null,this.dispatchFocusEvent(_,new OA6("blur",null));while(this.focusStack.length>0){let z=this.focusStack.pop();if(Fy1(z,K)){this.activeElement=z,this.dispatchFocusEvent(z,new OA6("focus",_));return}}}handleAutoFocus(q){this.focus(q)}handleClickFocus(q){if(typeof q.attributes.tabIndex!=="number")return;this.focus(q)}enable(){this.enabled=!0}disable(){this.enabled=!1}focusNext(q){this.moveFocus(1,q)}focusPrevious(q){this.moveFocus(-1,q)}moveFocus(q,K){if(!this.enabled)return;let _=bP_(K);if(_.length===0)return;let z=this.activeElement?_.indexOf(this.activeElement):-1,Y=z===-1?q===1?0:_.length-1:(z+q+_.length)%_.length,$=_[Y];if($)this.focus($)}}function bP_(q){let K=[];return lsq(q,K),K}function lsq(q,K){let _=q.attributes.tabIndex;if(typeof _==="number"&&_>=0)K.push(q);for(let z of q.childNodes)if(z.nodeName!=="#text")lsq(z,K)}function Fy1(q,K){let _=q;while(_){if(_===K)return!0;_=_.parentNode}return!1}function Uy1(q){let K=q;while(K){if(K.focusManager)return K;K=K.parentNode}throw Error("Node is not in a tree with a FocusManager")}function Qy1(q){return Uy1(q).focusManager}var CP_=32;var Ol6=y(()=>{csq()});function u08(q,K,_){if(typeof _==="string")q.setPositionPercent(K,Number.parseInt(_,10));else if(typeof _==="number")q.setPosition(K,_);else q.setPosition(K,Number.NaN)}var xP_=(q,K)=>{if("position"in K)q.setPositionType(K.position==="absolute"?fy1.Absolute:fy1.Relative);if("top"in K)u08(q,"top",K.top);if("bottom"in K)u08(q,"bottom",K.bottom);if("left"in K)u08(q,"left",K.left);if("right"in K)u08(q,"right",K.right)},IP_=(q,K)=>{let _=K.overflowY??K.overflow,z=K.overflowX??K.overflow;if(_==="scroll"||z==="scroll")q.setOverflow(G08.Scroll);else if(_==="hidden"||z==="hidden")q.setOverflow(G08.Hidden);else if("overflow"in K||"overflowX"in K||"overflowY"in K)q.setOverflow(G08.Visible)},uP_=(q,K)=>{if("margin"in K)q.setMargin(F_.All,K.margin??0);if("marginX"in K)q.setMargin(F_.Horizontal,K.marginX??0);if("marginY"in K)q.setMargin(F_.Vertical,K.marginY??0);if("marginLeft"in K)q.setMargin(F_.Start,K.marginLeft||0);if("marginRight"in K)q.setMargin(F_.End,K.marginRight||0);if("marginTop"in K)q.setMargin(F_.Top,K.marginTop||0);if("marginBottom"in K)q.setMargin(F_.Bottom,K.marginBottom||0)},mP_=(q,K)=>{if("padding"in K)q.setPadding(F_.All,K.padding??0);if("paddingX"in K)q.setPadding(F_.Horizontal,K.paddingX??0);if("paddingY"in K)q.setPadding(F_.Vertical,K.paddingY??0);if("paddingLeft"in K)q.setPadding(F_.Left,K.paddingLeft||0);if("paddingRight"in K)q.setPadding(F_.Right,K.paddingRight||0);if("paddingTop"in K)q.setPadding(F_.Top,K.paddingTop||0);if("paddingBottom"in K)q.setPadding(F_.Bottom,K.paddingBottom||0)},pP_=(q,K)=>{if("flexGrow"in K)q.setFlexGrow(K.flexGrow??0);if("flexShrink"in K)q.setFlexShrink(typeof K.flexShrink==="number"?K.flexShrink:1);if("flexWrap"in K){if(K.flexWrap==="nowrap")q.setFlexWrap(Z08.NoWrap);if(K.flexWrap==="wrap")q.setFlexWrap(Z08.Wrap);if(K.flexWrap==="wrap-reverse")q.setFlexWrap(Z08.WrapReverse)}if("flexDirection"in K){if(K.flexDirection==="row")q.setFlexDirection(ec6.Row);if(K.flexDirection==="row-reverse")q.setFlexDirection(ec6.RowReverse);if(K.flexDirection==="column")q.setFlexDirection(ec6.Column);if(K.flexDirection==="column-reverse")q.setFlexDirection(ec6.ColumnReverse)}if("flexBasis"in K)if(typeof K.flexBasis==="number")q.setFlexBasis(K.flexBasis);else if(typeof K.flexBasis==="string")q.setFlexBasisPercent(Number.parseInt(K.flexBasis,10));else q.setFlexBasis(Number.NaN);if("alignItems"in K){if(K.alignItems==="stretch"||!K.alignItems)q.setAlignItems(Li.Stretch);if(K.alignItems==="flex-start")q.setAlignItems(Li.FlexStart);if(K.alignItems==="center")q.setAlignItems(Li.Center);if(K.alignItems==="flex-end")q.setAlignItems(Li.FlexEnd)}if("alignSelf"in K){if(K.alignSelf==="auto"||!K.alignSelf)q.setAlignSelf(Li.Auto);if(K.alignSelf==="flex-start")q.setAlignSelf(Li.FlexStart);if(K.alignSelf==="center")q.setAlignSelf(Li.Center);if(K.alignSelf==="flex-end")q.setAlignSelf(Li.FlexEnd)}if("justifyContent"in K){if(K.justifyContent==="flex-start"||!K.justifyContent)q.setJustifyContent(qA6.FlexStart);if(K.justifyContent==="center")q.setJustifyContent(qA6.Center);if(K.justifyContent==="flex-end")q.setJustifyContent(qA6.FlexEnd);if(K.justifyContent==="space-between")q.setJustifyContent(qA6.SpaceBetween);if(K.justifyContent==="space-around")q.setJustifyContent(qA6.SpaceAround);if(K.justifyContent==="space-evenly")q.setJustifyContent(qA6.SpaceEvenly)}},BP_=(q,K)=>{if("width"in K)if(typeof K.width==="number")q.setWidth(K.width);else if(typeof K.width==="string")q.setWidthPercent(Number.parseInt(K.width,10));else q.setWidthAuto();if("height"in K)if(typeof K.height==="number")q.setHeight(K.height);else if(typeof K.height==="string")q.setHeightPercent(Number.parseInt(K.height,10));else q.setHeightAuto();if("minWidth"in K)if(typeof K.minWidth==="string")q.setMinWidthPercent(Number.parseInt(K.minWidth,10));else q.setMinWidth(K.minWidth??0);if("minHeight"in K)if(typeof K.minHeight==="string")q.setMinHeightPercent(Number.parseInt(K.minHeight,10));else q.setMinHeight(K.minHeight??0);if("maxWidth"in K)if(typeof K.maxWidth==="string")q.setMaxWidthPercent(Number.parseInt(K.maxWidth,10));else q.setMaxWidth(K.maxWidth??0);if("maxHeight"in K)if(typeof K.maxHeight==="string")q.setMaxHeightPercent(Number.parseInt(K.maxHeight,10));else q.setMaxHeight(K.maxHeight??0)},gP_=(q,K)=>{if("display"in K)q.setDisplay(K.display==="flex"?jL.Flex:jL.None)},FP_=(q,K,_)=>{let z=_??K;if("borderStyle"in K){let Y=K.borderStyle?1:0;q.setBorder(F_.Top,z.borderTop!==!1?Y:0),q.setBorder(F_.Bottom,z.borderBottom!==!1?Y:0),q.setBorder(F_.Left,z.borderLeft!==!1?Y:0),q.setBorder(F_.Right,z.borderRight!==!1?Y:0)}else{if("borderTop"in K&&K.borderTop!==void 0)q.setBorder(F_.Top,K.borderTop===!1?0:1);if("borderBottom"in K&&K.borderBottom!==void 0)q.setBorder(F_.Bottom,K.borderBottom===!1?0:1);if("borderLeft"in K&&K.borderLeft!==void 0)q.setBorder(F_.Left,K.borderLeft===!1?0:1);if("borderRight"in K&&K.borderRight!==void 0)q.setBorder(F_.Right,K.borderRight===!1?0:1)}},UP_=(q,K)=>{if("gap"in K)q.setGap(f08.All,K.gap??0);if("columnGap"in K)q.setGap(f08.Column,K.columnGap??0);if("rowGap"in K)q.setGap(f08.Row,K.rowGap??0)},QP_=(q,K={},_)=>{xP_(q,K),IP_(q,K),uP_(q,K),mP_(q,K),pP_(q,K),BP_(q,K),gP_(q,K),FP_(q,K,_),UP_(q,K)},dy1;var nsq=y(()=>{KA6();dy1=QP_});import{appendFileSync as m08}from"fs";function ssq(q,K,_){if(!q._eventHandlers)q._eventHandlers={};q._eventHandlers[K]=_}function dP_(q,K,_){if(K==="children")return;if(K==="style"){if(Iy1(q,_),q.yogaNode)dy1(q.yogaNode,_);return}if(K==="textStyles"){q.textStyles=_;return}if(my1.has(K)){ssq(q,K,_);return}xy1(q,K,_)}function cP_(q){let K=[],_=new Set,z=q;for(let Y=0;z&&Y<50;Y++){if(_.has(z))break;_.add(z);let $=z.elementType,A=typeof $==="function"?$.displayName||$.name:typeof $==="string"?void 0:$?.displayName||$?.name;if(A&&A!==K[K.length-1])K.push(A);z=z._debugOwner??z.return}return K}function oy1(){if(cy1===void 0)cy1=i6(process.env.CLAUDE_CODE_DEBUG_REPAINTS);return cy1}function tsq(q){ay1=q}function esq(){return ay1}function qtq(){wl6=performance.now()}function Ktq(){return sy1}function _tq(){ay1=0,sy1=0,wl6=0}var asq,isq=(q,K)=>{if(q===K)return;if(!q)return K;let _={},z=!1;for(let Y of Object.keys(q))if(K?!Object.hasOwn(K,Y):!0)_[Y]=void 0,z=!0;if(K){for(let Y of Object.keys(K))if(K[Y]!==q[Y])_[Y]=K[Y],z=!0}return z?_:void 0},rsq=(q)=>{let K=q.yogaNode;if(K)K.unsetMeasureFunc(),uy1(q),K.freeRecursive()},cy1,Ri,Du,ly1=0,osq=0,ny1=0,p08=0,B08=0,iy1=0,ay1=0,sy1=0,wl6=0,ry1,WF;var jl6=y(()=>{O08();m8();TT6();dsq();py1();Ol6();KA6();nsq();asq=O6(zsq(),1);Ri=new By1,Du=process.env.CLAUDE_CODE_COMMIT_LOG;ry1=asq.default({getRootHostContext:()=>({isInsideText:!1}),prepareForCommit:()=>{if(Du)iy1=performance.now();return null},preparePortalMount:()=>null,clearContainer:()=>!1,resetAfterCommit(q){if(sy1=wl6>0?performance.now()-wl6:0,wl6=0,Du){let z=performance.now();ly1++;let Y=ny1>0?z-ny1:0;if(Y>p08)p08=Y;ny1=z;let $=iy1>0?z-iy1:0;if(Y>30||$>20||B08>50)m08(Du,`${z.toFixed(1)} gap=${Y.toFixed(1)}ms reconcile=${$.toFixed(1)}ms creates=${B08}
568`);if(B08=0,z-osq>1000)m08(Du,`${z.toFixed(1)} commits=${ly1}/s maxGap=${p08.toFixed(1)}ms
569`),ly1=0,p08=0,osq=z}let K=Du?performance.now():0;if(typeof q.onComputeLayout==="function")q.onComputeLayout();if(Du){let z=performance.now()-K;if(z>20){let Y=A08();m08(Du,`${K.toFixed(1)} SLOW_YOGA ${z.toFixed(1)}ms visited=${Y.visited} measured=${Y.measured} hits=${Y.cacheHits} live=${Y.live}
570`)}}let _=Du?performance.now():0;if(q.onRender?.(),Du){let z=performance.now()-_;if(z>10)m08(Du,`${_.toFixed(1)} SLOW_PAINT ${z.toFixed(1)}ms

Callers 15

sZ_Function · 0.45
zFunction · 0.45
Y78Function · 0.45
YOYFunction · 0.45
YwYFunction · 0.45
BbFunction · 0.45
WFunction · 0.45
yvKFunction · 0.45
fFunction · 0.45
VFunction · 0.45
xfYFunction · 0.45
YSKFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected