{"version":3,"sources":["assets/libs/i18n/i18n.js","pages/Layout.js","redux/designerPropertiesSlice.js","constants/action.js","constants/status.js","components/mapeditor/header.js","components/tools/common/Scrollbar.js","components/mapeditor/toolBar.js","components/canvas/handlers/ImageHandler.ts","components/canvas/handlers/ChartHandler.ts","components/canvas/handlers/ElementHandler.ts","components/canvas/handlers/CropHandler.ts","components/canvas/handlers/AnimationHandler.ts","components/canvas/handlers/ContextmenuHandler.ts","components/canvas/handlers/TooltipHandler.ts","components/canvas/handlers/TransactionHandler.ts","components/canvas/handlers/ZoomHandler.ts","components/canvas/handlers/WorkareaHandler.ts","redux/store.js","components/canvas/handlers/InteractionHandler.ts","components/canvas/handlers/GridHandler.ts","components/canvas/handlers/PortHandler.ts","components/canvas/objects/fabric/Gif.ts","components/canvas/objects/fabric/Arrow.ts","components/canvas/enums/SeatIcon.ts","components/canvas/utils/ObjectUtil.ts","components/canvas/objects/fabric/Chart.ts","components/canvas/objects/fabric/Element.ts","components/canvas/objects/fabric/Iframe.ts","components/canvas/objects/fabric/Video.ts","components/canvas/objects/fabric/Port.ts","components/canvas/objects/fabric/Node.ts","components/canvas/objects/fabric/Link.ts","components/canvas/objects/fabric/CurvedLink.ts","components/canvas/objects/fabric/OrthogonalLink.ts","components/canvas/objects/fabric/Line.ts","components/canvas/objects/fabric/CirclePort.ts","components/canvas/objects/fabric/Cube.ts","components/canvas/objects/fabric/Svg.ts","components/canvas/enums/SeatDistribution.ts","components/canvas/handlers/LinkHandler.ts","components/canvas/handlers/NodeHandler.ts","components/canvas/handlers/AlignmentHandler.ts","components/canvas/handlers/GuidelineHandler.ts","components/canvas/constants/defaults.ts","components/canvas/constants/code.ts","components/canvas/handlers/EventHandler.ts","components/canvas/objects/designer/properties/ShapeProperties.ts","components/canvas/objects/designer/properties/ZoneProperties.ts","components/mapeditor/icons/Icons.ts","components/canvas/constants/letters.ts","components/canvas/objects/designer/properties/RowProperties.ts","components/canvas/objects/designer/properties/ActiveSelectionProperties.ts","components/canvas/objects/designer/Ellipse.ts","components/canvas/objects/designer/CircleZone.ts","components/canvas/objects/designer/CircularTable.ts","components/canvas/objects/designer/Icon.ts","components/canvas/objects/designer/MultipleRows.ts","components/canvas/objects/designer/Polygon.ts","components/canvas/objects/designer/PolygonZone.ts","components/canvas/objects/designer/Rect.ts","components/canvas/objects/designer/RectangleZone.ts","components/canvas/objects/designer/RectTable.ts","components/canvas/objects/designer/Row.ts","components/canvas/objects/designer/Text.ts","components/canvas/objects/designer/Triangle.ts","components/canvas/objects/designer/ActiveSelection.ts","components/canvas/handlers/DrawingHandler.ts","components/canvas/handlers/ShortcutHandler.ts","components/canvas/objects/tooltip/Icons.tsx","components/canvas/objects/preview/Row.ts","components/canvas/objects/tooltip/Row.tsx","components/canvas/handlers/PreviewHandler.ts","service/base.service.js","service/map.service.js","service/mapEvent.service.js","service/seat.service.js","service/channel.service.js","service/index.js","components/canvas/objects/selector/Row.ts","components/canvas/objects/selector/PolygonZone.ts","components/canvas/handlers/SelectorHandler.ts","components/canvas/objects/blocker/Row.ts","components/canvas/handlers/BlockerHandler.ts","components/canvas/handlers/UpdateSeatQuantity.ts","components/canvas/objects/channels/Row.ts","components/canvas/handlers/ChannelHandler.ts","components/canvas/objects/detail/Row.ts","components/canvas/objects/detail/PolygonZone.ts","components/canvas/handlers/DetailHandler.ts","components/canvas/CanvasObject.ts","components/canvas/handlers/Handler.ts","components/canvas/Canvas.tsx","components/tools/icon/Icon.js","components/tools/common/ColorPicker.js","components/tools/font/fonts.js","components/mapeditor/properties/inputTextHandler.js","components/mapeditor/properties/inputShapeZonesHandler.js","components/mapeditor/properties/inputShapesHandler.js","components/mapeditor/properties/inputIconsHandler.js","components/mapeditor/properties/inputSeatsRowHandler.js","components/mapeditor/properties/inputSeatsHandler.js","components/mapeditor/properties/listProperties.js","components/tools/common/FileUpload.js","components/mapeditor/properties/mapProperty.js","components/mapeditor/properties/propertyDefinition.js","components/mapeditor/properties/GroupProperty.js","components/mapeditor/properties/imageFilterProperty.js","components/mapeditor/properties/defaultProperties.js","components/mapeditor/properties/objectProperties.js","components/mapeditor/properties/inputToolRow.js","components/mapeditor/properties/toolProperties.js","components/mapeditor/properties/inputActiveSelectionHandler.js","components/mapeditor/properties/activeSelectionProperties.js","components/mapeditor/propertyBar.js","components/mapeditor/preview.js","components/mapeditor/joystick.js","components/mapeditor/footer.js","components/canvas/utils/ValidationsUtil.ts","pages/MapEditor.js","pages/MapSelector.js","pages/MapBlocker.js","components/canvas/channels/ChannelItem.tsx","components/canvas/channels/ChannelSelector.tsx","components/tools/common/InputJson.js","components/tools/common/CodeModal.js","components/tools/common/InputScript.js","components/tools/common/InputTemplate.js","components/tools/ace/AcePreview.js","components/tools/ace/AceEditor.js","components/tools/common/InputHtml.js","components/tools/common/UrlModal.js","components/tools/common/SVGModal.js","components/canvas/channels/ChannelItemManagement.tsx","components/canvas/channels/ChannelManagement.tsx","pages/MapChannel.js","pages/MapDetail.js","App.js","index.js"],"names":["i18nClient","i18n","use","LanguageDetector","init","load","whitelist","nonExplicitWhitelist","lngs","fallbackLng","interpolation","escapeValue","react","wait","nsMode","defaultNS","resources","es","translationES","Layout","spinning","useSelector","state","properties","Helmet","charSet","name","content","rel","href","designerPropertiesSlice","createSlice","initialState","categories","channels","rowSeatSpacing","rowSeatSize","selectedSeats","selection","available","open","zoneActive","selectedChannel","color","key","channelList","reducers","setCategories","action","payload","setChannels","Array","isArray","window","redseats","setRowSpacing","setRowSeatSize","setSpinning","setSelection","addSeatToSelection","index","seat","seats","push","removeSeatToSelection","actionSeat","filter","setSelectedSeats","addSelectedSeat","removeSelectSeat","setAvailableToPublish","openModal","setZoneActive","setSelectedChannel","setChannelList","actions","actionSaveMap","mapStatus","Header","map","canvasRef","screenCaptureAction","saveMap","dispatch","useDispatch","isCropping","handler","interactionMode","onUndoRedoHandler","type","_","partial","transactionHandler","redo","undo","saveContent","className","status","t","isPublished","onClick","disabled","loadContent","exitRedSeats","onExitDesigner","exitSection","zoomHandler","zoomOneToOne","onZone","title","placement","undos","length","redos","Scrollbar","props","renderTrackVertical","children","notification","config","top","duration","ToolBar","activeKey","isZoneActive","waitForCanvasRender","canvas","setTimeout","attachEventListener","setState","wrapperEl","addEventListener","events","onDragEnter","onDragOver","onDragLeave","onDrop","detachEventListener","removeEventListener","handlers","onSelecteItem","tool","onChangeSelectedProperties","onAddItem","item","id","v4","option","Object","assign","add","drawing","objectType","drawingHandler","setType","onInit","seatSelection","interactionHandler","isDrawingMode","forceUpdate","selectedType","grab","e","preventDefault","dataTransfer","dropEffect","target","classList","remove","event","stopPropagation","layerX","layerY","dt","types","files","from","forEach","file","uid","left","warn","message","newItem","onClickHandler","deleteIncompletePolygon","this","console","log","menuSeats","style","fontSize","menuGeneralZones","menuShapes","overflowY","width","display","flexDirection","justifyContent","alignItems","overlay","trigger","Component","connect","FILTER_TYPES","SHARPEN_MATRIX","EMBOSS_MATRIX","ImageHandler","createFilter","filterType","other","toLowerCase","fabric","Image","filters","Grayscale","Invert","Sepia","Brightness","brightness","Contrast","Saturation","Noise","noise","Pixelate","Convolute","matrix","BlendColor","BlendImage","Resize","Tint","Mask","channel","mask","Multiply","Sepia2","createFilters","reduce","prev","isEqual","findIndex","applyFilterByType","apply","value","imageObj","obj","getActiveObject","ft","applyFilters","requestRenderAll","applyFilter","applyFilterValue","prop","setOptions","applyGrayscale","grayscale","mode","undefined","applyInvert","invert","applySepia","sepia","applyBrightness","applyContrast","contrast","applySaturation","saturation","applyNoise","applyPixelate","pixelate","blocksize","applySharpen","sharpen","applyEmboss","emboss","applyBlendColor","blend","applyBlendImage","blendImage","applyResize","resize","applyTint","tint","applyMask","applyMultiply","multiply","applySepia2","sepia2","applyGradientTransparency","gradientTransparency","GradientTransparency","applyColorMatrix","colorMatrix","ColorMatrix","applyRemoveWhite","removeWhite","RemoveWhite","ChartHandler","instance","ElementHandler","setById","source","findById","set","setSource","document","getElementById","el","container","removeChild","removeById","scriptEl","styleEl","head","removeByIds","ids","setPosition","setCoords","zoom","getZoom","scaleX","scaleY","height","getBoundingRect","padLeft","padTop","setPositionByOrigin","setSize","setScaleOrAngle","angle","transform","CropHandler","cropRect","cropObject","validType","activeObject","start","Rect","originX","originY","hasRotatingPoint","fill","setActiveObject","selectable","evented","renderAll","finish","croppedImg","toDataURL","setImage","cancel","opt","original","corner","cropLeft","cropTop","cropWidth","cropHeight","cropScaleX","cropScaleY","Math","round","diffRightRatio","diffBottomRatio","diffTopRatio","diffLeftRatio","moving","movedTop","max","AnimationHandler","play","hasControls","findObject","anime","restart","animation","getAnime","lockMovementX","lockMovementY","hoverCursor","pause","stop","resetAnimation","editable","opacity","originOpacity","bounce","originTop","originLeft","shake","originScaleX","originScaleY","originAngle","rotation","originFill","stroke","originStroke","origniStroke","delay","autoplay","loop","targets","direction","begin","update","animations","currentValue","rotate","complete","easing","offset","elasticity","scale","ContextmenuHandler","contextmenuEl","show","debounce","onContext","hasChildNodes","firstChild","contextmenu","createElement","element","innerHTML","appendChild","ReactDOM","render","clientX","clientY","hide","initialize","body","TooltipHandler","tooltipEl","htmlElement","tooltip","TouchEvent","touches","clientWidth","offsetWidth","clientHeight","offsetHeight","TransactionHandler","active","save","canvasJSON","keyEvent","transaction","json","JSON","stringify","toJSON","propertiesToInclude","objects","superType","error","throttle","pop","replay","parse","renderOnAddRemove","clear","discardActiveObject","util","enlivenObjects","targetIndex","_objects","insertAt","portHandler","create","link","getObjects","linkHandler","fromNodeId","fromNode","fromPortId","fromPort","toNodeId","toNode","toPortId","toPort","onTransaction","ZoomHandler","zoomToPoint","point","minZoom","maxZoom","zoomRatio","onZoom","center","getCenter","Point","zoomToFit","group","Group","zoomToCenterWithObject","zoomIn","zoomOut","clickCoords","cliked","canvasLeft","canvasTop","diffTop","diffLeft","getWidth","getHeight","setViewportTransform","x","y","zoomToCenter","boundingRect","acc","objRect","min","Infinity","canvasWidth","canvasHeight","setZoom","WorkareaHandler","setLayout","layout","workarea","_element","isElement","workareaWidth","workareaHeight","isFixed","isResponsive","isFullscreen","scales","calculateScale","player","objScaleX","objScaleY","objWidth","objHeight","elementHandler","setPlayerSize","centerObject","backgroundColor","setResponsiveImage","loaded","imageFromUrl","src","Promise","resolve","fromURL","img","image","setElement","File","reader","FileReader","onload","result","then","readAsDataURL","sendToBack","work","workareaOption","configureStore","reducer","designerPropertiesReducer","InteractionHandler","callback","store","getState","canvasOption","defaultCursor","interactionCallback","cursor","selectedObject","linking","delta","eventHandler","prevX","prevY","movementX","movementY","relativePan","GridHandler","gridOption","grid","lineColor","borderColor","enabled","gridLength","lineOptions","i","distance","fhorizontal","Line","shorizontal","fvertical","svertical","snapToGrid","activeSelection","PortHandler","createToPort","on","activeLine","class","links","some","bringToFront","createFromPort","port","hoverFill","toCoords","fromCoords","leftDiff","topDiff","recreate","ports","removeWithUpdate","nodeId","op","np","Gif","createClass","gifCanvas","isStarted","options","callSuper","drawFrame","ctx","frame","drawImage","buffer","_render","gifler","frames","_c","fromObject","Arrow","points","x1","x2","y1","y2","xDiff","yDiff","atan2","translate","beginPath","moveTo","lineTo","closePath","fillStyle","restore","Icons","toObject","object","extend","property","get","getSvgObject","icon","size","svg","loadSVGFromString","groupSVGElements","objectCaching","strokeUniform","hasBorders","loadType","scaleToWidth","scaleToHeight","path","Chart","chartOption","setChartOptionStr","setChartOption","chartOptionStr","distroyChart","createChart","echarts","setOption","xAxis","yAxis","series","data","dispose","calcCoords","tl","makeElement","initialCode","html","css","js","Element","code","setCode","Iframe","setSrc","iframeElement","wrapElement","Video","setFile","muted","videoElement","preload","controls","MediaElementPlayer","pauseOtherPlayers","videoWidth","videoHeight","success","_mediaeElement","_originalNode","Port","NODE_COLORS","TRIGGER","border","LOGIC","DATA","ACTION","OUT_PORT_TYPE","Node","i18next","text","IText","fontFamily","fontWeight","test","substring","concat","label","Text","rect","rx","ry","strokeWidth","errorFlag","visible","errors","node","description","configuration","nodeClazz","descriptor","borderScaleFactor","dblclick","deletable","cloneable","defaultPortOption","lockScalingX","lockScalingY","selectFill","toPortOption","fromPortOption","inEnabled","outPortType","broadcastPort","staticPort","dynamicPort","singlePort","portOption","outPorts","outPort","_portOption","setErrors","duplicate","FromPort","ToPort","Link","coords","lockRotation","perPixelTargetFind","setPort","_toNode","setPortEnabled","fromPortIndex","outputCount","arrow","CurvedLink","strokeStyle","fp","sp","bezierCurveTo","OrthogonalLink","lineJoin","CirclePort","Circle","Cube","shadeColor","percent","substr","num","parseInt","amt","R","G","B","toString","slice","wx","wy","h","Svg","loadSvg","addSvgElements","createdObj","loadSVGFromURL","SeatDistribution","LinkHandler","isDrawing","isConnected","objectMap","generate","isDuplicate","isSameNode","createdLink","warning","fabricObjects","onAdd","removeFrom","portLink","splice","removeTo","removeAll","validate","NodeHandler","getNodePath","nodes","selectByPath","targetObjects","fromIndex","toIndex","setShadow","highlightingNode","animating","blur","selectById","deselect","highlightingByPath","nonTargetObjects","lastObject","highlightingLink","targetObject","animationHandler","minBlur","maxBlur","onComplete","shadow","animate","ease","easeInOutQuad","onChange","AlignmentHandler","activeObjectLeft","forEachObject","right","GuidelineHandler","verticalLines","horizontalLines","viewportTransform","aligningLineOffset","aligningLineMargin","aligningLineWidth","aligningLineColor","beforeRender","_opt","clearContext","guidelineHandler","afterRender","drawVerticalLine","drawHorizontalLine","drawLine","lineWidth","isInRange","v1","v2","len","movingGuidelines","canvasObjects","activeObjectCenter","getCenterPoint","activeObjectTop","activeObjectBoundingRect","activeObjectHeight","activeObjectWidth","horizontalInTheRange","verticalInTheRange","_currentTransform","objectCenter","objectLeft","objectTop","objectBoundingRect","objectHeight","objectWidth","scalingGuidelines","_target","guidelineOption","off","getSelectionContext","preserveObjectStacking","screen","enteredScaling","centeredRotation","move","all","copy","paste","esc","del","clipboard","cut","objectOption","activeSelectionOption","_controlsVisibility","bl","br","mb","ml","mr","mt","mtr","tr","subTargetCheck","ESCAPE","DELETE","BACKSPACE","EQUAL","MINUS","KEY_A","KEY_Q","KEY_W","KEY_C","KEY_V","KEY_Z","KEY_Y","KEY_O","KEY_P","KEY_X","ARROW_UP","ARROW_DOWN","ARROW_LEFT","ARROW_RIGHT","EventHandler","panning","destroy","modified","scaling","moved","rotating","mousewheel","mousedown","mousemove","mouseup","mouseout","keydown","keyup","onmousedown","selectorHandler","onMousedown","mousedblclick","onDblClick","parentId","onModified","cropHandler","gridHandler","video","addWithUpdate","scaled","newAngle","rotated","onRotated","arrowmoving","zoomEnabled","deltaY","subTargets","enablePanning","blockerHandler","channelHandler","altKey","selectedTarget","originPointer","getPointer","onBlur","includes","onMouseDblClick","canvasEnabled","onMousemove","previewHandler","detailHandler","onMouseOut","onMouseup","onSelect","setControlsVisibility","onSelection","nextWidth","nextHeight","centerWorkarea","setWidth","setHeight","setBackgroundColor","bind","diffWidth","diffHeight","workareaHandler","deltaPoint","diffScaleX","diffScaleY","newScaleX","newScaleY","activeElement","clipboardData","clipboardType","textPlain","getData","padding","isCut","filteredObjects","fromNodeIndex","toNodeIndex","ActiveSelection","keys","shortcutHandler","isEscape","isW","tooltipHandler","isQ","isDelete","isArrow","isCtrlA","selectAll","isCtrlC","isCtrlV","isCtrlX","isCtrlZ","isCtrlY","isPlus","isMinus","isO","isP","findTarget","select","contextmenuHandler","_e","tabIndex","ShapeProperties","updateProperties","propertyName","newValue","allValuesForm","selectedItem","shape","old","isNaN","widthDiff","abs","heightDiff","svgConverted","svgStr","svgEl","typeIconIcon","createRange","createContextualFragment","XMLSerializer","serializeToString","loadedObject","containerId","originHeight","originWidth","visibleText","visibleIcon","newPropertyName","newNameProperty","ZoneProperties","categoriesList","rows","selectedCategory","category","row","section","displayedLabel","txtObj","setSeatValue","rowData","seatlabel","isLabeled","iconStage","iconCheck","letters","RowProperties","textObjs","textRight","textbox","side","textLeft","renderedIcon","seatsQuantity","parameters","previewText","getWidthFromPreviewText","canvasPreviewText","seatGroup","centerTransform","maxSeatsQuantity","rowSize","seatsSpacing","distanceBetweenX","distanceBetweenY","restrictedView","companion","accesible","radius","transparentCorners","defaultIcon","zoneID","trunc","angleHelp","seatsCurve","remainItems","newLeft","newTop","createSeatGroupRP","firstSeatText","createSeatRP","createTextRP","createIconRP","newSeatsQuantity","labelList","list","starts","reverse","startsAt","normal","odds","evens","seatObj","Number","auY","auY2","restar","ind","mid","longDistance","augmentX","selectDistribution","numberArr","letterArr","selectedText","upperCase","toUpperCase","lowerCase","odd","count","oddsToEvens","centerOddsToEvens","letter","repeat","ceil","newList","initDimensions","position","newText","prevText","labelPosition","displayed","labl","ActiveSelectionProperties","selectedItems","Ellipse","activeShape","addPoint","isDown","updating","strokeLineCap","typeIcon","objText","objIcon","guides","widthIcon","heightIcon","widthText","heightText","CircleZone","Error","capacity","typeCapacity","MultipleRows","generateCircularTable","createGroup","table","createTable","addObjectToGroup","coordXTableCenter","coordYTableCenter","seatLocationDiameter","cos","PI","sin","createSeat","Icon","selectedIcon","setIcon","addSeatToGroup","updateRow","xHelper","seatQuantityH","seatQuantityV","seatHelper","Polygon","pointArray","lineArray","activeShapePolygon","circle","line","activeShapePoints","polygon","polyPoint","PolygonZone","activeZone","objs","mapRows","mapRow","originalFill","polygonZone","centeredScaling","strokeColor","fillText","strokeText","strokeColorText","fillIcon","RectangleZone","RectTable","generateRectTable","yHelper","Row","defaultSeatColor","createPreviewGroup","addSeatToPreviewGroup","updatePreviewRow","pointer","previewGroup","generateSeatLinear","seatCount","isPreview","rowGroup","stepX","stepY","origin","hypot","seatQuantity","textCount","createSeatCounter","createSeatGroup","createText","createIcon","addSeatToRowGroup","createRowGroup","tan","atan","checkCenter","checkRight","checkJustify","checkLeft","fontStyle","checkFontStyle","checkFontWeight","Triangle","DrawingHandler","objectTypes","multipleRows","circularTable","CircularTable","rectTable","ellipse","triangle","circleZone","rectangleZone","ShortcutHandler","ctrlKey","metaKey","RestrictedViewIcon","AccesibleIcon","CompanionIcon","TooltipIcons","targetSeat","seatCircle","a","find","borderLeft","TooltipRowPreview","PreviewHandler","callBack","onHover","BaseService","response","ok","statusCode","errorMessage","url","method","headers","Authorization","btoa","publicKey","privateKey","fetch","process","_handleResponse_","catch","_handleError_","MapService","mapKey","mapName","mapId","imageUrl","imagebase64","MapEventService","eventKey","selector","sessionStorage","getItem","EventId","AvailableCategories","availableCategories","SeatStatusColor","seatStatusColor","Channels","selectorToken","token","setItem","selectorKey","SeatService","isAdmin","Status","ChannelService","services","mapEvent","setTooltip","changeStatus","valueHub","getSeatById","rowKey","seatKey","holdInCanvas","releaseInCanvas","responseCallback","seatsLength","maximumsSeatsSelected","isHoldByMe","isSuccessful","isSelection","seatModel","createSeatModel","changeStatusInDb","seatCallback","createSeatCallback","onSeatSelected","onSeatDeselected","onFailedSeatSelection","seatText","seatIcon","seatIcon2","colorFill","statusColor","Free","Seats","service","RowKey","SeatKey","SeatValue","s","showTooltip","getTooltipInfo","rowInstance","tooltipInfo","info","sectionLabel","rowLabel","zone","getInfoSpan","TooltipRowSelector","categoryKey","activeZoneSelector","SelectorHandler","onChangeHub","forSale","noForSale","onBlocker","seatData","split","seatNumber","selected","changeMultipleStatus","reserveInCanvas","seatS","TooltipRowBlocker","BlockerHandler","onSaveChanges","UpdateSeatQuantity","updateProperty","objectToRemove","selectedChannels","seatChannels","eventId","setSeat","hub","changeSeatChannels","isSelected","TooltipRowChannel","channelIndex","seatValue","seatIndex","seatC","removeSeatChannels","addSeatChannels","ChannelHandler","TooltipRowDetail","DetailHandler","CanvasObject","Textbox","cube","crossOrigin","chart","iframe","gif","curvedLink","orthogonalLink","Handler","defaults","onTooltip","onRemove","onInteraction","onLoad","imageHandler","chartHandler","nodeHandler","alignmentHandler","updateSeatQuantity","isRequsetAnimFrame","requestFrame","initOption","setPropertiesToInclude","setWorkareaOption","setCanvasOption","setGridOption","setObjectOption","setFabricObjects","setGuidelineOption","setActiveSelectionOption","setKeyEvent","initCallback","initHandler","setObject","setByObject","setByPartial","loadImage","setImageById","setVisible","centered","isSubtarget","newOption","addImage","addGroup","groupOption","startRequestAnimFrame","stopRequestAnimFrame","iconButton","child","otherOption","activeObjects","removeOriginById","findOriginByIdWithIndex","clone","clonedObj","o","duplicateById","cloned","copyToClipboard","textarea","execCommand","focus","linkTarget","compObj","iconName","linkObjects","linkObject","newClipboard","setPatternFill","findOriginById","locked","originScaleToResize","scaleToResize","importJSON","prevLeft","prevTop","workareaExist","leftRatio","topRatio","exportJSON","toGroup","toActiveSelection","bringForward","sendBackwards","includeWorkarea","curr","requestAnimFrame","cancelAnimationFrame","clearTimeout","saveImage","dataUrl","format","quality","anchorEl","download","click","saveCanvasImage","multiplier","enableRetinaScaling","getCanvasImage","destory","union","Canvas","React","createRef","resizeObserver","createObserver","ResizeObserver","entries","contentRect","handleLoad","observe","current","destroyObserver","disconnect","responsive","mergedCanvasOption","prevProps","ref","defaultProps","getIconHtml","prefix","iconClassName","iconStyle","innerIcon","innerColor","innerSize","innerClassName","startsWith","iconHtml","innerIconHtml","ColorPicker","arguments","rgbToHex","r","g","b","toHex","component","hex","newColor","valueType","rgb","getBackgroundColor","nextProps","background","fonts","default","google","InputTextHandler","Fonts","form","span","initialValue","v","k","Option","valuePropName","CheckableTag","linethrough","underline","InputShapeZonesHandler","objectGroup","objectText","objectShape","changeDisplayedLabel","changeTypeCapacity","Select","Item","labelCol","wrapperCol","rules","required","step","InputShapesHandler","objectShapeIcon","useState","objectShapeType","InputIconsHandler","addNewIcon","xmlns","viewBox","d","InputSeatsRowHandler","xs","InputSeatsHandler","setAccesible","setCompanion","setRestrictedView","checked","ListProperties","getFieldDecorator","Dragger","Upload","FileUpload","fileList","accept","limit","multiple","indexOf","newFileList","beforeUpload","MapProperty","numberSeats","duplicates","unlabeled","notCategorized","marginTop","PropertyDefinition","general","md","lg","gamma","Form","onValuesChange","changedValues","allValues","validation","exitSubzone","ObjectProperties","resetFields","colon","InputToolRow","rowSpacingHandler","rowSeatSizeHandler","ToolProperties","selectedTool","InputActiveSelectionHandler","setCategory","sectionName","setSectionName","displayedSectionName","setDisplayedSectionName","seatLabeling","setSeatLabeling","setRowLabel","rowLabelLeft","setRowLabelLeft","rowLabelRight","setRowLabelRight","setStarstAt","setReverse","PropertyBar","selectedProperties","setDisplayedLabel","setTypeCapacity","Preview","onChangePreview","preview","previewClassName","classnames","c","overflow","Joystick","mousePosition","joystick","useRef","transition","offsetLeft","offsetTop","Footer","zoomValue","toFixed","zoomToFitV2","ExpandOutlined","getSeats","flatMap","getDuplicates","findDuplicates","getNotCategorized","getUnlabeled","defaultOption","resource","dashboard","template","userProperty","script","effect","MapEditor","loading","progress","tools","objCanvasPreviewOver","cursorName","onClickCanvas","itemOnCanvas","maps","selectedMap","initScript","setSettigs","loadMap","setPropertiesInStore","mapCanvas","setProperties","successfulStatus","onExportToJson","updateData","updateLayout","publish","onMapCreated","alert","canvasHandlers","onChangeCanvas","changedKey","changedValue","onChangeWokarea","filterKey","filterValue","onMouseMove","exited","zoneRows","onProgress","onChangeStyles","styles","onChangeDataSources","dataSources","onSaveImage","exportData","polygonZones","otherObjects","toolConfiguration","Objects","ToolConfiguration","RowSeatSpacing","RowSeatSize","onOpenModal","getPublishedMaps","shortcutHandlers","transformList","values","zones","seatsInZone","setMapValidation","onChangeCursorName","onChangeDataTool","handleModalOk","newMap","getById","mapSelected","args","Title","Typography","itemsRef","onOk","onCancel","okText","cancelText","showSearch","placeholder","optionFilterProp","filterOption","input","margin","marginBottom","level","MapSelector","connection","setConnection","expanded","setExpanded","showExpanded","setShowExpanded","useEffect","invoke","showFullScreenButton","buildSelector","selectionObj","newConnection","HubConnectionBuilder","withUrl","withAutomaticReconnect","build","groupLeft","groupTop","__eventListeners","onMinimize","onExpand","FullscreenOutlined","FullscreenExitOutlined","selectorEnabled","MapBlocker","setSelectionType","buildNotForSale","blockerEnabled","defaultValue","AimOutlined","GroupOutlined","ChannelItem","selectChannel","ChannelSelector","onManageClick","updatedChannel","updatedList","channelToUpdate","InputJson","debouncedValidate","onValidate","annotations","annotation","column","aceRef","theme","editorProps","$blockScrolling","readOnly","InputScript","dsiabled","InputTemplate","newLineMode","editor","keyBinding","addKeyboardHandler","hashId","keyString","keyCode","command","showLineNumbers","maxLines","AcePreview","iframeRender","contentDocument","defaultStyle","AceEditor","onChangeHTML","htmlAnnotations","htmlRef","getSession","getAnnotations","onChangeCSS","cssAnnotations","cssRef","onChangeJS","jsAnnotations","jsRef","onValidateHTML","setAnnotations","getCodes","isHTML","isCSS","isJS","setText","aceEditor","SVGModal","handleChangeSvgType","handleOk","validateFields","err","Blob","handleCancel","closable","Button","arg","InputHtml","ChannelItemManagement","updateList","deleteChannel","channelName","setChannelName","channelColor","setChannelColor","setChannelAction","ChannelManagement","onClose","saveChannels","originalChannelList","setList","handleConfirm","channelsToSave","timestamp","prevList","newChannel","Date","now","MapChannel","showManagement","setShowManagement","buildChannel","getChannels","showAside","setShowAside","MenuOutlined","SaveOutlined","MapDetail","buildDetail","App","esEs","locale","language"],"mappings":"o2CA8BeA,G,OA1BIC,IACjBC,IAAIC,KACJC,KAAK,CACLC,KAAM,MACNC,UAAW,CAAC,KAAM,SAClBC,sBAAsB,EACtBC,KAAM,CAAC,SACPC,YAAa,QACbC,cAAe,CACdC,aAAa,GAEdC,MAAO,CACNC,MAAM,EACNC,OAAQ,WAETC,UAAW,kBACXC,UAAW,CACVC,GAAI,CACH,kBAAmBC,GAEpB,QAAS,CACR,kBAAmBA,O,0CCGRC,EAtBA,WACb,IAAMC,EAAWC,aAAY,SAACC,GAAD,OAAWA,EAAMC,WAAWH,QAA5B,IAE7B,OACE,cAAC,IAAD,CAAMA,SAAUA,EAAhB,SACE,iCACE,eAACI,EAAA,OAAD,WACE,sBAAMC,QAAQ,UACd,sBACEC,KAAK,WACLC,QAAQ,0CAEV,sBAAMC,IAAI,WAAWC,KAAK,+BAC1B,sBAAMD,IAAI,gBAAgBC,KAAK,6BAC/B,iDAEF,cAAC,IAAD,QAIP,E,6JCxBYC,EAA0BC,YAAY,CACjDL,KAAM,aACNM,aAAc,CACZC,WAAY,GACZC,SAAU,GACVC,eAAgB,EAChBC,YAAa,GACbhB,UAAU,EACViB,cAAe,GACfC,UAAW,GACXC,WAAW,EACX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KAAK,cAActP,QAAS,cAAC,GAAD,UAIlD,E,qBCVKtZ,GAAY,CAChBC,GAAI21D,IACJ,QAASA,KAGXn8C,IAASC,OACP,cAAC,KAAD,CAAgBm8C,OAAQ71D,GAAUf,EAAK62D,UAAvC,SACE,cAAC,KAAD,UACE,cAAC,IAAD,CAAUzzC,MAAOA,GAAjB,SACE,cAAC,GAAD,UAINpQ,SAASC,eAAe,Q","file":"static/js/main.73ccdf60.chunk.js","sourcesContent":["import i18n from 'i18next';\r\nimport LanguageDetector from 'i18next-browser-languagedetector';\r\nimport { translationES } from '../locales';\r\n\r\nconst i18nClient = i18n\r\n\t.use(LanguageDetector)\r\n\t.init({\r\n\t\tload: 'all',\r\n\t\twhitelist: ['es', 'es-ES'],\r\n\t\tnonExplicitWhitelist: false,\r\n\t\tlngs: ['es-ES'],\r\n\t\tfallbackLng: 'es-ES',\r\n\t\tinterpolation: {\r\n\t\t\tescapeValue: false, // not needed for react!!\r\n\t\t},\r\n\t\treact: {\r\n\t\t\twait: true, // set to true if you like to wait for loaded in every translated hoc\r\n\t\t\tnsMode: 'default', // set it to fallback to let passed namespaces to translated hoc act as fallbacks\r\n\t\t},\r\n\t\tdefaultNS: 'locale.constant',\r\n\t\tresources: {\r\n\t\t\tes: {\r\n\t\t\t\t'locale.constant': translationES,\r\n\t\t\t},\r\n\t\t\t'es-ES': {\r\n\t\t\t\t'locale.constant': translationES,\r\n\t\t\t},\r\n\t\t},\r\n\t});\r\n\r\nexport default i18nClient;\r\n","import React from \"react\";\r\nimport { Spin } from \"antd\";\r\nimport { Helmet } from \"react-helmet\";\r\nimport { useSelector } from \"react-redux\";\r\nimport { Outlet } from \"react-router-dom\";\r\n\r\nconst Layout = () => {\r\n const spinning = useSelector((state) => state.properties.spinning);\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n Red Seats\r\n \r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Layout;\r\n","import { createSlice } from \"@reduxjs/toolkit\";\r\n\r\nexport const designerPropertiesSlice = createSlice({\r\n name: \"properties\",\r\n initialState: {\r\n categories: [],\r\n channels: [],\r\n rowSeatSpacing: 2,\r\n rowSeatSize: 15,\r\n spinning: false,\r\n selectedSeats: [],\r\n selection: [],\r\n available: false,\r\n open: false,\r\n zoneActive: false,\r\n selectedChannel: {name: '',\r\n color: '',\r\n key: ''},\r\n channelList: []\r\n },\r\n reducers: {\r\n setCategories: (state, action) => {\r\n state.categories = action.payload;\r\n },\r\n setChannels: (state, action) => {\r\n if (Array.isArray(action.payload)) state.channels = action.payload;\r\n else {\r\n state.channels = [];\r\n window.redseats.channels= [];\r\n }\r\n },\r\n setRowSpacing: (state, action) => {\r\n state.rowSeatSpacing = action.payload;\r\n },\r\n setRowSeatSize: (state, action) => {\r\n state.rowSeatSize = action.payload;\r\n },\r\n setSpinning: (state, action) => {\r\n state.spinning = action.payload;\r\n },\r\n setSelection: (state, action) => {\r\n state.selection = action.payload;\r\n },\r\n addSeatToSelection: (state, action) => {\r\n const {\r\n payload: { index, seat },\r\n } = action;\r\n const { selection } = state;\r\n selection[index].seats.push(seat);\r\n },\r\n removeSeatToSelection: (state, action) => {\r\n const {\r\n payload: { index, seat: actionSeat },\r\n } = action;\r\n let { selection } = state;\r\n selection[index].seats = selection[index].seats.filter(\r\n (seat) => seat !== actionSeat\r\n );\r\n },\r\n setSelectedSeats: (state, action) => {\r\n state.selectedSeats = action.payload;\r\n },\r\n addSelectedSeat: (state, action) => {\r\n state.selectedSeats.push(action.payload);\r\n },\r\n removeSelectSeat: (state, action) => {\r\n state.selectedSeats = state.selectedSeats.filter(\r\n (seat) => seat != action.payload\r\n );\r\n },\r\n setAvailableToPublish: (state, action) => {\r\n state.available = action.payload;\r\n },\r\n openModal: (state, action) => {\r\n state.open = action.payload;\r\n },\r\n setZoneActive: (state, action) => {\r\n state.zoneActive = action.payload\r\n },\r\n setSelectedChannel: (state, action) => {\r\n state.selectedChannel = action.payload\r\n },\r\n setChannelList: (state, action) => {\r\n state.channelList = action.payload\r\n }\r\n },\r\n});\r\n\r\n// Action creators are generated for each case reducer function\r\nexport const {\r\n setCategories,\r\n setChannels,\r\n setRowSpacing,\r\n setRowSeatSize,\r\n setSpinning,\r\n setSelectedSeats,\r\n addSelectedSeat,\r\n removeSelectSeat,\r\n setSelection,\r\n addSeatToSelection,\r\n removeSeatToSelection,\r\n setAvailableToPublish,\r\n openModal,\r\n setZoneActive,\r\n setSelectedChannel,\r\n setChannelList\r\n} = designerPropertiesSlice.actions;\r\n\r\nexport default designerPropertiesSlice.reducer;\r\n","export const actionSaveMap = {\r\n create: 1,\r\n updateData: 2,\r\n updateLayout: 3,\r\n publish: 4,\r\n};\r\n","export const mapStatus = {\r\n new: 0,\r\n saved: 1,\r\n published: 2,\r\n};\r\n","import React from \"react\";\r\nimport { useSelector, useDispatch} from \"react-redux\";\r\nimport { Button, Tooltip } from \"antd\";\r\nimport { FaCheckCircle, FaArchive } from \"react-icons/fa\";\r\nimport i18n from \"i18next\";\r\nimport _ from \"underscore\";\r\n\r\nimport { mapStatus } from \"../../constants/status\";\r\nimport { actionSaveMap } from \"../../constants/action\";\r\nimport { setZoneActive } from \"../../redux/designerPropertiesSlice\";\r\n\r\nexport const Header = ({\r\n map,\r\n canvasRef,\r\n screenCaptureAction,\r\n action,\r\n saveMap,\r\n openModal\r\n}) => {\r\n\r\n const {available, zoneActive} = useSelector((state) => state.properties);\r\n const dispatch = useDispatch();\r\n const isCropping = canvasRef\r\n ? canvasRef.handler?.interactionMode === \"crop\"\r\n : false;\r\n\r\n const onUndoRedoHandler = (type) => {\r\n _.partial(saveMap, actionSaveMap.updateLayout);\r\n type == \"redo\"\r\n ? canvasRef.handler?.transactionHandler.redo()\r\n : canvasRef.handler?.transactionHandler.undo();\r\n };\r\n\r\n const saveContent = (\r\n <>\r\n
\r\n \r\n {action == \"saving\" && (\r\n
\r\n
Guardando\r\n
\r\n )}\r\n {map.status == mapStatus.saved && action == \"\" && (\r\n <>\r\n {i18n.t(\"mapeditor.actions.saved\")}\r\n \r\n )}\r\n {map.status == mapStatus.published && action == \"\" && (\r\n <>\r\n {i18n.t(\"mapeditor.actions.published\")}\r\n \r\n )}\r\n
\r\n {(map.isPublished && map.status == mapStatus.saved) && (\r\n <>\r\n {action == \"publishing\" ? (\r\n \r\n
\r\n
Publicando\r\n
\r\n
\r\n ) : (\r\n \r\n {i18n.t(\"mapeditor.btns.publish\")}\r\n \r\n )}\r\n \r\n )}\r\n
\r\n \r\n );\r\n\r\n const onExit = () => {\r\n window.redseats.onExitDesigner();\r\n };\r\n\r\n const onSectionExit = () => {\r\n canvasRef.handler.zoomHandler.zoomOneToOne();\r\n canvasRef.handler.onZone(true);\r\n dispatch(setZoneActive(false));\r\n }\r\n\r\n const loadContent = (\r\n <>\r\n {(!map || (map && !map.isPublished)) && (\r\n \r\n {i18n.t(\"mapeditor.map.load-map\")}\r\n \r\n )}\r\n \r\n );\r\n\r\n const exitRedSeats = (\r\n <>\r\n
\r\n \r\n
\r\n
\r\n
{map.name}
\r\n
\r\n {i18n.t(\"mapeditor.venue\")}\r\n
\r\n
\r\n
{saveContent}
\r\n
{loadContent}
\r\n \r\n );\r\n\r\n const exitSection = (\r\n <>\r\n
\r\n \r\n
\r\n
\r\n
Salir de la seccion
\r\n
\r\n \r\n );\r\n\r\n\r\n\r\n return (\r\n \r\n );\r\n};\r\n","import React from 'react';\r\nimport { Scrollbars } from 'react-custom-scrollbars';\r\n\r\nconst Scrollbar = (props) => {\r\n\tconst renderTrack = props =>
;\r\n\r\n\treturn {props.children};\r\n}\r\n\r\nexport default Scrollbar;\r\n","import React, { Component } from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport { Button, Dropdown, notification, Tooltip } from \"antd\";\r\nimport { v4 } from \"uuid\";\r\nimport Scrollbar from \"../tools/common/Scrollbar\";\r\nimport i18n from \"i18next\";\r\nimport { connect } from \"react-redux\";\r\n\r\nnotification.config({\r\n top: 80,\r\n duration: 2,\r\n});\r\n\r\nclass ToolBar extends Component {\r\n static propTypes = {\r\n canvasRef: PropTypes.any,\r\n onChangeSelectedProperties: PropTypes.any,\r\n };\r\n\r\n state = {\r\n activeKey: [],\r\n interactionMode: \"selection\",\r\n isZoneActive: false\r\n };\r\n\r\n\r\n\r\n componentDidMount() {\r\n const { canvasRef } = this.props;\r\n this.waitForCanvasRender(canvasRef);\r\n console.log('this.props.zoneActive', this.props.zoneActive)\r\n }\r\n\r\n // shouldComponentUpdate(nextProps, nextState) {\r\n // if (\r\n // JSON.stringify(this.state.activeKey) !==\r\n // JSON.stringify(nextState.activeKey)\r\n // ) {\r\n // return true;\r\n // }\r\n // return false;\r\n // }\r\n\r\n componentWillUnmount() {\r\n const { canvasRef } = this.props;\r\n this.detachEventListener(canvasRef);\r\n }\r\n\r\n waitForCanvasRender = (canvas) => {\r\n setTimeout(() => {\r\n if (canvas) {\r\n this.attachEventListener(canvas);\r\n this.setState({ isZoneActive: canvas.handler.isZoneActive });\r\n return;\r\n }\r\n const { canvasRef } = this.props;\r\n this.waitForCanvasRender(canvasRef);\r\n }, 5);\r\n };\r\n\r\n attachEventListener = (canvas) => {\r\n canvas.canvas.wrapperEl.addEventListener(\r\n \"dragenter\",\r\n this.events.onDragEnter,\r\n false\r\n );\r\n canvas.canvas.wrapperEl.addEventListener(\r\n \"dragover\",\r\n this.events.onDragOver,\r\n false\r\n );\r\n canvas.canvas.wrapperEl.addEventListener(\r\n \"dragleave\",\r\n this.events.onDragLeave,\r\n false\r\n );\r\n canvas.canvas.wrapperEl.addEventListener(\"drop\", this.events.onDrop, false);\r\n };\r\n\r\n detachEventListener = (canvas) => {\r\n canvas.canvas.wrapperEl.removeEventListener(\r\n \"dragenter\",\r\n this.events.onDragEnter\r\n );\r\n canvas.canvas.wrapperEl.removeEventListener(\r\n \"dragover\",\r\n this.events.onDragOver\r\n );\r\n canvas.canvas.wrapperEl.removeEventListener(\r\n \"dragleave\",\r\n this.events.onDragLeave\r\n );\r\n canvas.canvas.wrapperEl.removeEventListener(\"drop\", this.events.onDrop);\r\n };\r\n\r\n handlers = {\r\n onSelecteItem: (type, tool) => {\r\n const { onChangeSelectedProperties } = this.props;\r\n onChangeSelectedProperties(type, tool);\r\n },\r\n onAddItem: (item) => {\r\n const { canvasRef } = this.props;\r\n const id = v4();\r\n let option = Object.assign({}, item.option, { id });\r\n canvasRef.handler.add(option);\r\n },\r\n drawing: (objectType) => {\r\n const { canvasRef } = this.props;\r\n canvasRef.handler.drawingHandler.setType(objectType);\r\n canvasRef.handler.drawingHandler.onInit();\r\n },\r\n seatSelection: () => {\r\n const { canvasRef } = this.props;\r\n if (canvasRef.handler.interactionHandler.isDrawingMode()) {\r\n return;\r\n }\r\n this.forceUpdate();\r\n canvasRef.handler.interactionHandler.seatSelection();\r\n this.setState({ interactionMode: \"seatSelection\" });\r\n canvasRef.handler.drawingHandler.selectedType = \"\";\r\n },\r\n selection: () => {\r\n const { canvasRef } = this.props;\r\n if (canvasRef.handler.interactionHandler.isDrawingMode()) {\r\n return;\r\n }\r\n this.forceUpdate();\r\n canvasRef.handler.interactionHandler.selection();\r\n this.setState({ interactionMode: \"selection\" });\r\n canvasRef.handler.drawingHandler.selectedType = \"\";\r\n },\r\n grab: () => {\r\n const { canvasRef } = this.props;\r\n if (canvasRef.handler.interactionHandler.isDrawingMode()) {\r\n return;\r\n }\r\n this.forceUpdate();\r\n canvasRef.handler.interactionHandler.grab();\r\n this.setState({ interactionMode: \"grab\" });\r\n canvasRef.handler.drawingHandler.selectedType = \"\";\r\n },\r\n };\r\n\r\n events = {\r\n onDragOver: (e) => {\r\n if (e.preventDefault) e.preventDefault();\r\n e.dataTransfer.dropEffect = \"copy\";\r\n return false;\r\n },\r\n onDragEnter: (e) => {\r\n const { target } = e;\r\n target.classList.add(\"over\");\r\n },\r\n onDragLeave: (e) => {\r\n const { target } = e;\r\n target.classList.remove(\"over\");\r\n },\r\n onDrop: (e) => {\r\n e = e || window.event;\r\n if (e.preventDefault) {\r\n e.preventDefault();\r\n }\r\n if (e.stopPropagation) {\r\n e.stopPropagation();\r\n }\r\n const { layerX, layerY } = e;\r\n const dt = e.dataTransfer;\r\n if (dt.types.length && dt.types[0] === \"Files\") {\r\n const { files } = dt;\r\n Array.from(files).forEach((file) => {\r\n file.uid = v4();\r\n const { type } = file;\r\n if (\r\n type === \"image/png\" ||\r\n type === \"image/jpeg\" ||\r\n type === \"image/jpg\"\r\n ) {\r\n const item = {\r\n option: {\r\n type: \"image\",\r\n file,\r\n left: layerX,\r\n top: layerY,\r\n },\r\n };\r\n this.handlers.onAddItem(item, false);\r\n } else {\r\n notification.warn({ message: \"Not supported file type\" });\r\n }\r\n });\r\n return false;\r\n }\r\n const option = Object.assign({}, this.item.option, {\r\n left: layerX,\r\n top: layerY,\r\n });\r\n const newItem = Object.assign({}, this.item, { option });\r\n this.handlers.onAddItem(newItem, false);\r\n return false;\r\n },\r\n };\r\n\r\n onClickHandler = (objectType) => {\r\n this.props.canvasRef.handler.deleteIncompletePolygon();\r\n switch (objectType) {\r\n case \"seatSelector\":\r\n return this.handlers.seatSelection();\r\n case \"selection\":\r\n return this.handlers.selection();\r\n case \"move\":\r\n return this.handlers.grab();\r\n default:\r\n this.handlers.onSelecteItem(\"menu\", objectType);\r\n return this.handlers.drawing(objectType);\r\n }\r\n };\r\n\r\n render() {\r\n const menuSeats = (\r\n
    \r\n
  • \r\n \r\n
  • \r\n {/*
  • \r\n \r\n
  • */}\r\n
\r\n );\r\n\r\n const menuSelectionSeats = (\r\n
    \r\n
  • \r\n \r\n
  • \r\n
  • \r\n \r\n
  • \r\n
\r\n );\r\n\r\n const menuTables = (\r\n
    \r\n
  • \r\n \r\n
  • \r\n
  • \r\n \r\n
  • \r\n
\r\n );\r\n\r\n const menuGeneralZones = (\r\n
    \r\n {/*
  • \r\n \r\n
  • \r\n
  • \r\n \r\n
  • */}\r\n
  • \r\n \r\n
  • \r\n
\r\n );\r\n\r\n const menuShapes = (\r\n
    \r\n
  • \r\n \r\n
  • \r\n
  • \r\n \r\n
  • \r\n
  • \r\n \r\n
  • \r\n
  • \r\n \r\n
  • \r\n
\r\n );\r\n\r\n return (\r\n
\r\n {/*
*/}\r\n \r\n \r\n \r\n this.onClickHandler(\"selection\")}\r\n >\r\n \r\n
\r\n \r\n \r\n this.onClickHandler(\"seatSelector\")}\r\n >\r\n \r\n
\r\n \r\n \r\n this.onClickHandler(\"move\")}\r\n >\r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n
\r\n {/*
\r\n \r\n \r\n \r\n
*/}\r\n {/*
\r\n \r\n \r\n \r\n
*/}\r\n { this.props.zoneActive === false &&\r\n <>\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n \r\n this.onClickHandler(\"text\")}\r\n >\r\n \r\n \r\n \r\n \r\n this.onClickHandler(\"svg\")}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n \r\n\r\n \r\n {/* */}\r\n \r\n );\r\n }\r\n}\r\nconst mapStateToProps = (state) => {\r\n return {\r\n zoneActive: state.properties.zoneActive,\r\n };\r\n};\r\n\r\nexport default connect(mapStateToProps)(ToolBar);\r\n","import { fabric } from 'fabric';\r\nimport isEqual from 'lodash/isEqual';\r\n\r\nimport Handler from './Handler';\r\n\r\nexport type GrayscaleModeType = 'average' | 'luminosity' | 'lightness';\r\n\r\nexport interface RemoveColorFilter {\r\n\tcolor?: string;\r\n\tdistance?: number;\r\n\tfragmentSource?: any;\r\n\tuseAlpahe?: any;\r\n}\r\n\r\nexport interface BlendColorFilter {\r\n\tcolor?: string;\r\n\tmode?: string;\r\n\talpha?: number;\r\n}\r\n\r\nexport interface GammaFilter {\r\n\tgamma?: number[];\r\n}\r\n\r\nexport interface BlendImageFilter {\r\n\timage?: fabric.Image;\r\n\tmode?: string;\r\n\talpha?: number;\r\n}\r\n\r\nexport interface HueRotationFilter {\r\n\trotation?: number;\r\n}\r\n\r\nexport type ResizeType = 'bilinear' | 'hermite' | 'sliceHack' | 'lanczos';\r\n\r\nexport interface ResizeFilter {\r\n\tresizeType?: ResizeType;\r\n\tscaleX?: number;\r\n\tscaleY?: number;\r\n\tlanczosLobes?: number;\r\n}\r\n\r\nexport interface TintFilter {\r\n\tcolor?: string;\r\n\topacity?: number;\r\n}\r\n\r\nexport interface MaskFilter {\r\n\tmask?: fabric.Image;\r\n\t/**\r\n\t * Rgb channel (0, 1, 2 or 3)\r\n\t * @default 0\r\n\t */\r\n\tchannel: number;\r\n}\r\n\r\nexport interface MultiplyFilter {\r\n\t/**\r\n\t * Color to multiply the image pixels with\r\n\t * @default #000000\r\n\t */\r\n\tcolor: string;\r\n}\r\n\r\nexport interface GradientTransparencyFilter {\r\n\t/** @default 100 */\r\n\tthreshold?: number;\r\n}\r\n\r\nexport interface ColorMatrixFilter {\r\n\t/** Filter matrix */\r\n\tmatrix?: number[];\r\n}\r\n\r\nexport interface RemoveWhiteFilter {\r\n\t/** @default 30 */\r\n\tthreshold?: number;\r\n\t/** @default 20 */\r\n\tdistance?: number;\r\n}\r\n\r\nexport type ValuesOf = T[number];\r\n\r\nexport interface IFilter {\r\n\ttype: typeof FILTER_TYPES[number];\r\n\t[key: string]: any;\r\n}\r\n\r\nexport const FILTER_TYPES = [\r\n\t'grayscale',\r\n\t'invert',\r\n\t'remove-color',\r\n\t'sepia',\r\n\t'brownie',\r\n\t'brightness',\r\n\t'contrast',\r\n\t'saturation',\r\n\t'noise',\r\n\t'vintage',\r\n\t'pixelate',\r\n\t'blur',\r\n\t'sharpen',\r\n\t'emboss',\r\n\t'technicolor',\r\n\t'polaroid',\r\n\t'blend-color',\r\n\t'gamma',\r\n\t'kodachrome',\r\n\t'blackwhite',\r\n\t'blend-image',\r\n\t'hue',\r\n\t'resize',\r\n\t'tint',\r\n\t'mask',\r\n\t'multiply',\r\n\t'sepia2',\r\n];\r\n\r\nexport const capitalize = (str: string) => (str ? str.charAt(0).toUpperCase() + str.slice(1) : false);\r\n\r\nconst SHARPEN_MATRIX = [0, -1, 0, -1, 5, -1, 0, -1, 0];\r\nconst EMBOSS_MATRIX = [1, 1, 1, 1, 0.7, -1, -1, -1, -1];\r\n\r\n/**\r\n * Image Handler\r\n * @author salgum1114\r\n * @date 2019-09-01\r\n * @class ImageHandler\r\n * @implements {IBaseHandler}\r\n */\r\nclass ImageHandler {\r\n\thandler: Handler;\r\n\r\n\tconstructor(handler: Handler) {\r\n\t\tthis.handler = handler;\r\n\t}\r\n\r\n\t/**\r\n\t * Create filter by type\r\n\t * @param {IFilter} filter\r\n\t */\r\n\tpublic createFilter = (filter: IFilter) => {\r\n\t\tconst { type: filterType, ...other } = filter;\r\n\t\tconst type = filterType.toLowerCase();\r\n\t\tif (type === 'grayscale') {\r\n\t\t\treturn new fabric.Image.filters.Grayscale(other);\r\n\t\t} else if (type === 'invert') {\r\n\t\t\treturn new fabric.Image.filters.Invert();\r\n\t\t\t// } else if (type === 'remove-color') {\r\n\t\t\t// return new fabric.Image.filters.RemoveColor(other);\r\n\t\t} else if (type === 'sepia') {\r\n\t\t\treturn new fabric.Image.filters.Sepia();\r\n\t\t\t// } else if (type === 'brownie') {\r\n\t\t\t// return new fabric.Image.filters.Brownie();\r\n\t\t} else if (type === 'brightness') {\r\n\t\t\treturn new fabric.Image.filters.Brightness({ brightness: other.brightness });\r\n\t\t} else if (type === 'contrast') {\r\n\t\t\treturn new fabric.Image.filters.Contrast(other);\r\n\t\t} else if (type === 'saturation') {\r\n\t\t\treturn new fabric.Image.filters.Saturation(other);\r\n\t\t} else if (type === 'noise') {\r\n\t\t\treturn new fabric.Image.filters.Noise({ noise: other.noise });\r\n\t\t\t// } else if (type === 'vintage') {\r\n\t\t\t// return new fabric.Image.filters.Vintage();\r\n\t\t} else if (type === 'pixelate') {\r\n\t\t\treturn new fabric.Image.filters.Pixelate(other);\r\n\t\t\t// } else if (type === 'blur') {\r\n\t\t\t// return new fabric.Image.filters.Blur(other);\r\n\t\t} else if (type === 'sharpen') {\r\n\t\t\treturn new fabric.Image.filters.Convolute({\r\n\t\t\t\tmatrix: SHARPEN_MATRIX,\r\n\t\t\t});\r\n\t\t} else if (type === 'emboss') {\r\n\t\t\treturn new fabric.Image.filters.Convolute({\r\n\t\t\t\tmatrix: EMBOSS_MATRIX,\r\n\t\t\t});\r\n\t\t\t// } else if (type === 'technicolor') {\r\n\t\t\t// return new fabric.Image.filters.Technicolor();\r\n\t\t\t// } else if (type === 'polaroid') {\r\n\t\t\t// return new fabric.Image.filters.Polaroid();\r\n\t\t} else if (type === 'blend-color') {\r\n\t\t\treturn new fabric.Image.filters.BlendColor(other);\r\n\t\t\t// } else if (type === 'gamma') {\r\n\t\t\t// return new fabric.Image.filters.Gamma(other);\r\n\t\t\t// } else if (type === 'kodachrome') {\r\n\t\t\t// return new fabric.Image.filters.Kodachrome();\r\n\t\t\t// } else if (type === 'blackwhite') {\r\n\t\t\t// return new fabric.Image.filters.BlackWhite();\r\n\t\t} else if (type === 'blend-image') {\r\n\t\t\treturn new fabric.Image.filters.BlendImage(other);\r\n\t\t\t// } else if (type === 'hue') {\r\n\t\t\t// return new fabric.Image.filters.HueRotation(other);\r\n\t\t} else if (type === 'resize') {\r\n\t\t\treturn new fabric.Image.filters.Resize(other);\r\n\t\t} else if (type === 'tint') {\r\n\t\t\treturn new fabric.Image.filters.Tint(other);\r\n\t\t} else if (type === 'mask') {\r\n\t\t\treturn new fabric.Image.filters.Mask({\r\n\t\t\t\tchannel: other.channel,\r\n\t\t\t\tmask: other.mask,\r\n\t\t\t});\r\n\t\t} else if (type === 'multiply') {\r\n\t\t\treturn new fabric.Image.filters.Multiply({\r\n\t\t\t\tcolor: other.color,\r\n\t\t\t});\r\n\t\t} else if (type === 'sepia2') {\r\n\t\t\treturn new fabric.Image.filters.Sepia2(other);\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\t/**\r\n\t * Create filter by types\r\n\t * @param {IFilter[]} filters\r\n\t */\r\n\tpublic createFilters = (filters: IFilter[]) => {\r\n\t\tconst createdFilters = filters.reduce((prev, filter) => {\r\n\t\t\tlet type = filter.type;\r\n\t\t\tif (type.toLowerCase() === 'convolute' && isEqual(filter.matrix, SHARPEN_MATRIX)) {\r\n\t\t\t\ttype = 'sharpen';\r\n\t\t\t} else if (type.toLowerCase() === 'convolute' && isEqual(filter.matrix, EMBOSS_MATRIX)) {\r\n\t\t\t\ttype = 'emboss';\r\n\t\t\t}\r\n\t\t\tconst findIndex = FILTER_TYPES.findIndex(filterType => type.toLowerCase() === filterType);\r\n\t\t\tif (findIndex > -1) {\r\n\t\t\t\tprev[findIndex] = this.createFilter({\r\n\t\t\t\t\t...filter,\r\n\t\t\t\t\ttype,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\treturn prev;\r\n\t\t}, []);\r\n\t\treturn createdFilters;\r\n\t};\r\n\r\n\t/**\r\n\t * Apply filter by type\r\n\t * @param {string} type\r\n\t * @param {*} [value]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applyFilterByType = (type: string, apply = true, value?: any, imageObj?: fabric.Image): void => {\r\n\t\tconst obj = imageObj || (this.handler.canvas.getActiveObject() as any);\r\n\t\tconst findIndex = FILTER_TYPES.findIndex(ft => ft === type);\r\n\t\tif (obj.filters && findIndex > -1) {\r\n\t\t\tif (apply) {\r\n\t\t\t\tobj.filters[findIndex] = this.createFilter({\r\n\t\t\t\t\ttype,\r\n\t\t\t\t\t...value,\r\n\t\t\t\t});\r\n\t\t\t\tobj.applyFilters();\r\n\t\t\t} else {\r\n\t\t\t\tobj.filters[findIndex] = false;\r\n\t\t\t\tobj.applyFilters();\r\n\t\t\t}\r\n\t\t\tthis.handler.canvas.requestRenderAll();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Apply filter in image\r\n\t * @param {fabric.Image} [imageObj]\r\n\t * @param {number} index\r\n\t * @param {fabric.IBaseFilter} filter\r\n\t */\r\n\tpublic applyFilter = (index: number, filter: fabric.IBaseFilter | boolean, imageObj?: fabric.Image): void => {\r\n\t\tconst obj = imageObj || (this.handler.canvas.getActiveObject() as any);\r\n\t\tif (obj.filters) {\r\n\t\t\tobj.filters[index] = filter;\r\n\t\t\tobj.applyFilters();\r\n\t\t\tthis.handler.canvas.requestRenderAll();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Apply filter value in image\r\n\t * @param {fabric.Image} [imageObj]\r\n\t * @param {number} index\r\n\t * @param {string} prop\r\n\t * @param {any} value\r\n\t */\r\n\tpublic applyFilterValue = (index: number, prop: string, value: any, imageObj?: fabric.Image): void => {\r\n\t\tconst obj = imageObj || (this.handler.canvas.getActiveObject() as fabric.Image);\r\n\t\tif (obj.filters) {\r\n\t\t\tconst filter = obj.filters[index];\r\n\t\t\tif (filter) {\r\n\t\t\t\tfilter.setOptions({\r\n\t\t\t\t\t[prop]: value,\r\n\t\t\t\t});\r\n\t\t\t\tobj.applyFilters();\r\n\t\t\t\tthis.handler.canvas.requestRenderAll();\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Apply grayscale in image\r\n\t * @param {fabric.Image} [imageObj]\r\n\t * @param {boolean} [grayscale=false]\r\n\t * @param {GrayscaleModeType} [value]\r\n\t */\r\n\tpublic applyGrayscale = (grayscale = false, value?: GrayscaleModeType, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(\r\n\t\t\t0,\r\n\t\t\tgrayscale &&\r\n\t\t\t\tnew fabric.Image.filters.Grayscale(\r\n\t\t\t\t\tvalue\r\n\t\t\t\t\t\t? {\r\n\t\t\t\t\t\t\t\tmode: value,\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t: undefined,\r\n\t\t\t\t),\r\n\t\t\timageObj,\r\n\t\t);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply invert in image\r\n\t * @param {fabric.Image} [imageObj]\r\n\t * @param {boolean} [invert=false]\r\n\t */\r\n\tpublic applyInvert = (invert = false, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(1, invert && new fabric.Image.filters.Invert(), imageObj);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply remove color in image\r\n\t * @param {fabric.Image} [imageObj]\r\n\t * @param {boolean} [removeColor=false]\r\n\t * @param {RemoveColorFilter} [value]\r\n\t */\r\n\t// public applyRemoveColor = (removeColor = false, value?: RemoveColorFilter, imageObj?: fabric.Image): void => {\r\n\t// this.applyFilter(2, removeColor && new fabric.Image.filters.RemoveColor(value), imageObj);\r\n\t// }\r\n\r\n\t/**\r\n\t * Apply sepia in image\r\n\t * @param {fabric.Image} [imageObj]\r\n\t * @param {boolean} [sepia=false]\r\n\t */\r\n\tpublic applySepia = (sepia = false, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(3, sepia && new fabric.Image.filters.Sepia(), imageObj);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply brownie in image\r\n\t * @param {boolean} [brownie=false]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\t// public applyBrownie = (brownie = false, imageObj?: fabric.Image): void => {\r\n\t// this.applyFilter(4, brownie && new fabric.Image.filters.Brownie(), imageObj);\r\n\t// }\r\n\r\n\t/**\r\n\t * Apply brightness in image\r\n\t * @param {boolean} [brightness=false]\r\n\t * @param {number} [value]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applyBrightness = (brightness = false, value?: number, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(\r\n\t\t\t5,\r\n\t\t\tbrightness &&\r\n\t\t\t\tnew fabric.Image.filters.Brightness(\r\n\t\t\t\t\tvalue\r\n\t\t\t\t\t\t? {\r\n\t\t\t\t\t\t\t\tbrightness: value,\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t: undefined,\r\n\t\t\t\t),\r\n\t\t\timageObj,\r\n\t\t);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply contrast in image\r\n\t * @param {boolean} [contrast=false]\r\n\t * @param {number} [value]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applyContrast = (contrast = false, value?: number, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(\r\n\t\t\t6,\r\n\t\t\tcontrast &&\r\n\t\t\t\tnew fabric.Image.filters.Contrast(\r\n\t\t\t\t\tvalue\r\n\t\t\t\t\t\t? {\r\n\t\t\t\t\t\t\t\tcontrast: value,\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t: undefined,\r\n\t\t\t\t),\r\n\t\t\timageObj,\r\n\t\t);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply saturation in image\r\n\t * @param {boolean} [saturation=false]\r\n\t * @param {number} [value]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applySaturation = (saturation = false, value?: number, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(\r\n\t\t\t7,\r\n\t\t\tsaturation &&\r\n\t\t\t\tnew fabric.Image.filters.Saturation(\r\n\t\t\t\t\tvalue\r\n\t\t\t\t\t\t? {\r\n\t\t\t\t\t\t\t\tsaturation: value,\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t: undefined,\r\n\t\t\t\t),\r\n\t\t\timageObj,\r\n\t\t);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply noise in image\r\n\t * @param {boolean} [noise=false]\r\n\t * @param {number} [value]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applyNoise = (noise = false, value?: number, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(\r\n\t\t\t8,\r\n\t\t\tnoise &&\r\n\t\t\t\tnew fabric.Image.filters.Noise(\r\n\t\t\t\t\tvalue\r\n\t\t\t\t\t\t? {\r\n\t\t\t\t\t\t\t\tnoise: value,\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t: undefined,\r\n\t\t\t\t),\r\n\t\t\timageObj,\r\n\t\t);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply vintage in image\r\n\t * @param {boolean} [vintage=false]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\t// public applyVintage = (vintage = false, imageObj?: fabric.Image): void => {\r\n\t// this.applyFilter(9, vintage && new fabric.Image.filters.Vintage(), imageObj);\r\n\t// }\r\n\r\n\t/**\r\n\t * Apply pixelate in image\r\n\t * @param {boolean} [pixelate=false]\r\n\t * @param {number} [value]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applyPixelate = (pixelate = false, value?: number, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(\r\n\t\t\t10,\r\n\t\t\tpixelate &&\r\n\t\t\t\tnew fabric.Image.filters.Pixelate(\r\n\t\t\t\t\tvalue\r\n\t\t\t\t\t\t? {\r\n\t\t\t\t\t\t\t\tblocksize: value,\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t: undefined,\r\n\t\t\t\t),\r\n\t\t\timageObj,\r\n\t\t);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply blur in image\r\n\t * @param {boolean} [blur=false]\r\n\t * @param {number} [value]\r\n\t * @param {fabric.Image} imageObj\r\n\t */\r\n\t// public applyBlur = (blur = false, value?: number, imageObj?: fabric.Image): void => {\r\n\t// this.applyFilter(11, blur && new fabric.Image.filters.Blur(value ? {\r\n\t// value,\r\n\t// } : undefined), imageObj);\r\n\t// }\r\n\r\n\t/**\r\n\t * Apply sharpen in image\r\n\t * @param {boolean} [sharpen=false]\r\n\t * @param {number[]} [value=[0, -1, 0, -1, 5, -1, 0, -1, 0]]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applySharpen = (sharpen = false, value: number[] = SHARPEN_MATRIX, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(\r\n\t\t\t12,\r\n\t\t\tsharpen &&\r\n\t\t\t\tnew fabric.Image.filters.Convolute(\r\n\t\t\t\t\tvalue\r\n\t\t\t\t\t\t? {\r\n\t\t\t\t\t\t\t\tmatrix: value,\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t: undefined,\r\n\t\t\t\t),\r\n\t\t\timageObj,\r\n\t\t);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply emboss in image\r\n\t * @param {boolean} [emboss=false]\r\n\t * @param {number[]} [value=[1, 1, 1, 1, 0.7, -1, -1, -1, -1]]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applyEmboss = (emboss = false, value: number[] = EMBOSS_MATRIX, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(\r\n\t\t\t13,\r\n\t\t\temboss &&\r\n\t\t\t\tnew fabric.Image.filters.Convolute(\r\n\t\t\t\t\tvalue\r\n\t\t\t\t\t\t? {\r\n\t\t\t\t\t\t\t\tmatrix: value,\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t: undefined,\r\n\t\t\t\t),\r\n\t\t\timageObj,\r\n\t\t);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply technicolor in image\r\n\t * @param {boolean} [technicolor=false]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\t// public applyTechnicolor = (technicolor = false, imageObj?: fabric.Image): void => {\r\n\t// this.applyFilter(14, technicolor && new fabric.Image.filters.Technicolor(), imageObj);\r\n\t// }\r\n\r\n\t/**\r\n\t * Apply polaroid in image\r\n\t * @param {boolean} [polaroid=false]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\t// public applyPolaroid = (polaroid = false, imageObj?: fabric.Image): void => {\r\n\t// this.applyFilter(15, polaroid && new fabric.Image.filters.Polaroid(), imageObj);\r\n\t// }\r\n\r\n\t/**\r\n\t * Apply blend color in image\r\n\t * @param {boolean} [blend=false]\r\n\t * @param {BlendColorFilter} [value]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applyBlendColor = (blend = false, value?: BlendColorFilter, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(16, blend && new fabric.Image.filters.BlendColor(value), imageObj);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply gamma in image\r\n\t * @param {boolean} [gamma=false]\r\n\t * @param {GammaFilter} [value]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\t// public applyGamma = (gamma = false, value?: GammaFilter, imageObj?: fabric.Image): void => {\r\n\t// this.applyFilter(17, gamma && new fabric.Image.filters.Gamma(value), imageObj);\r\n\t// }\r\n\r\n\t/**\r\n\t * Apply kodachrome in image\r\n\t * @param {boolean} [kodachrome=false]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\t// public applyKodachrome = (kodachrome = false, imageObj?: fabric.Image): void => {\r\n\t// this.applyFilter(18, kodachrome && new fabric.Image.filters.Kodachrome(), imageObj);\r\n\t// }\r\n\r\n\t/**\r\n\t * Apply black white in image\r\n\t * @param {boolean} [blackWhite=false]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\t// public applyBlackWhite = (blackWhite = false, imageObj?: fabric.Image): void => {\r\n\t// this.applyFilter(19, blackWhite && new fabric.Image.filters.BlackWhite(), imageObj);\r\n\t// }\r\n\r\n\t/**\r\n\t * Apply blend image in image\r\n\t * @param {boolean} [blendImage=false]\r\n\t * @param {BlendImageFilter} value\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applyBlendImage = (blendImage = false, value?: BlendImageFilter, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(20, blendImage && new fabric.Image.filters.BlendImage(value), imageObj);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply hue rotation in image\r\n\t * @param {boolean} [hue=false]\r\n\t * @param {HueRotationFilter} [value]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\t// public applyHue = (hue = false, value?: HueRotationFilter, imageObj?: fabric.Image): void => {\r\n\t// this.applyFilter(21, hue && new fabric.Image.filters.HueRotation(value ? {\r\n\t// rotation: value,\r\n\t// } : undefined), imageObj);\r\n\t// }\r\n\r\n\t/**\r\n\t * Apply resize in image\r\n\t * @param {boolean} [resize=false]\r\n\t * @param {ResizeFilter} [value]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applyResize = (resize = false, value?: ResizeFilter, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(22, resize && new fabric.Image.filters.Resize(value), imageObj);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply tint in image\r\n\t * @param {boolean} [tint=false]\r\n\t * @param {TintFilter} [value]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applyTint = (tint = false, value?: TintFilter, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(23, tint && new fabric.Image.filters.Tint(value), imageObj);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply mask in image\r\n\t * @param {boolean} [mask=false]\r\n\t * @param {MaskFilter} [value]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applyMask = (mask = false, value?: MaskFilter, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(24, mask && new fabric.Image.filters.Mask(value), imageObj);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply multiply in image\r\n\t * @param {boolean} [multiply=false]\r\n\t * @param {MultiplyFilter} [value]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applyMultiply = (multiply = false, value?: MultiplyFilter, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(25, multiply && new fabric.Image.filters.Multiply(value), imageObj);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply sepia2 in image\r\n\t * @param {boolean} [sepia2=false]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applySepia2 = (sepia2 = false, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(26, sepia2 && new fabric.Image.filters.Sepia2(), imageObj);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply gradient transparency in image\r\n\t * @param {boolean} [gradientTransparency=false]\r\n\t * @param {GradientTransparencyFilter} [value]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applyGradientTransparency = (\r\n\t\tgradientTransparency = false,\r\n\t\tvalue?: GradientTransparencyFilter,\r\n\t\timageObj?: fabric.Image,\r\n\t): void => {\r\n\t\tthis.applyFilter(27, gradientTransparency && new fabric.Image.filters.GradientTransparency(value), imageObj);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply color matrix in image\r\n\t * @param {boolean} [colorMatrix=false]\r\n\t * @param {ColorMatrixFilter} [value]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applyColorMatrix = (colorMatrix = false, value?: ColorMatrixFilter, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(28, colorMatrix && new fabric.Image.filters.ColorMatrix(value), imageObj);\r\n\t};\r\n\r\n\t/**\r\n\t * Apply remove white in image\r\n\t * @param {boolean} [removeWhite=false]\r\n\t * @param {RemoveWhiteFilter} [value]\r\n\t * @param {fabric.Image} [imageObj]\r\n\t */\r\n\tpublic applyRemoveWhite = (removeWhite = false, value?: RemoveWhiteFilter, imageObj?: fabric.Image): void => {\r\n\t\tthis.applyFilter(29, removeWhite && new fabric.Image.filters.RemoveWhite(value), imageObj);\r\n\t};\r\n}\r\n\r\nexport default ImageHandler;\r\n","import * as echarts from 'echarts';\r\n\r\nimport Handler from './Handler';\r\n\r\nclass ChartHandler {\r\n handler?: Handler;\r\n instance?: echarts.ECharts;\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n}\r\n\r\nexport default ChartHandler;\r\n","import { fabric } from 'fabric';\r\n\r\nimport Handler from './Handler';\r\nimport { VideoObject } from '../objects/fabric/Video';\r\nimport { ChartObject } from '../objects/fabric/Chart';\r\nimport { IframeObject } from '../objects/fabric/Iframe';\r\nimport { ElementObject } from '../objects/fabric/Element';\r\n\r\nexport type ElementType = 'container' | 'script' | 'style';\r\n\r\nexport type ElementObjectType = VideoObject | ChartObject | IframeObject | ElementObject;\r\n\r\nexport interface ElementCode {\r\n html?: string;\r\n css?: string;\r\n js?: string;\r\n}\r\n\r\nclass ElementHandler {\r\n handler?: Handler;\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n /**\r\n * Set element by id\r\n * @param {string} id\r\n * @param {*} source\r\n * @returns {void}\r\n */\r\n public setById = (id: string, source: any): void => {\r\n const obj = this.handler.findById(id) as ElementObjectType;\r\n if (!obj) {\r\n return;\r\n }\r\n this.set(obj, source);\r\n }\r\n\r\n /**\r\n * Set element\r\n * @param {ElementObjectType} obj\r\n * @param {*} source\r\n */\r\n public set = (obj: ElementObjectType, source: any) => {\r\n obj.setSource(source);\r\n }\r\n\r\n /**\r\n * Find element by id with type\r\n * @param {string} id\r\n * @param {ElementType} [type='container']\r\n * @returns\r\n */\r\n public findById = (id: string, type: ElementType = 'container') => {\r\n return document.getElementById(`${id}_${type}`);\r\n }\r\n\r\n /**\r\n * Remove element\r\n * @param {HTMLElement} el\r\n * @returns\r\n */\r\n public remove = (el: HTMLElement) => {\r\n if (!el) {\r\n return;\r\n }\r\n this.handler.container.removeChild(el);\r\n }\r\n\r\n /**\r\n * Remove element by id\r\n * @param {string} id\r\n */\r\n public removeById = (id: string) => {\r\n const el = this.findById(id);\r\n const scriptEl = this.findById(id, 'script');\r\n const styleEl = this.findById(id, 'style');\r\n if (el) {\r\n if (el.remove) {\r\n el.remove();\r\n } else {\r\n this.remove(el);\r\n }\r\n }\r\n if (scriptEl) {\r\n if (scriptEl.remove) {\r\n scriptEl.remove();\r\n } else {\r\n document.head.removeChild(scriptEl);\r\n }\r\n }\r\n if (styleEl) {\r\n if (styleEl.remove) {\r\n styleEl.remove();\r\n } else {\r\n document.head.removeChild(styleEl);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Remove element by ids\r\n * @param {string[]} ids\r\n */\r\n public removeByIds = (ids: string[]) => {\r\n ids.forEach(id => {\r\n this.removeById(id);\r\n });\r\n }\r\n\r\n /**\r\n * Set position\r\n * @param {HTMLElement} el\r\n * @param {number} left\r\n * @param {number} top\r\n * @returns\r\n */\r\n public setPosition = (el: HTMLElement, obj: fabric.Object) => {\r\n if (!el) {\r\n return;\r\n }\r\n obj.setCoords();\r\n const zoom = this.handler.canvas.getZoom();\r\n const { scaleX, scaleY, width, height } = obj;\r\n const { left, top } = obj.getBoundingRect(false);\r\n const padLeft = ((width * scaleX * zoom) - width) / 2;\r\n const padTop = ((height * scaleY * zoom) - height) / 2;\r\n el.style.left = `${left + padLeft}px`;\r\n el.style.top = `${top + padTop}px`;\r\n }\r\n\r\n public setPositionByOrigin = (el: HTMLElement, obj: fabric.Object, left: number, top: number) => {\r\n if (!el) {\r\n return;\r\n }\r\n obj.setCoords();\r\n const zoom = this.handler.canvas.getZoom();\r\n const { scaleX, scaleY, width, height } = obj;\r\n const padLeft = ((width * scaleX * zoom) - width) / 2;\r\n const padTop = ((height * scaleY * zoom) - height) / 2;\r\n el.style.left = `${left + padLeft}px`;\r\n el.style.top = `${top + padTop}px`;\r\n }\r\n\r\n /**\r\n * Set size\r\n * @param {HTMLElement} el\r\n * @param {number} width\r\n * @param {number} height\r\n * @returns\r\n */\r\n public setSize = (el: HTMLElement, obj: fabric.Object) => {\r\n if (!el) {\r\n return;\r\n }\r\n const { width, height } = obj;\r\n el.style.width = `${width}px`;\r\n el.style.height = `${height}px`;\r\n }\r\n\r\n /**\r\n * Set scale or angle\r\n * @param {HTMLElement} el\r\n * @param {number} scaleX\r\n * @param {number} scaleY\r\n * @param {number} angle\r\n * @returns\r\n */\r\n public setScaleOrAngle = (el: HTMLElement, obj: fabric.Object) => {\r\n if (!el) {\r\n return;\r\n }\r\n const zoom = this.handler.canvas.getZoom();\r\n const { scaleX, scaleY, angle } = obj;\r\n el.style.transform = `rotate(${angle}deg) scale(${scaleX * zoom}, ${scaleY * zoom})`;\r\n }\r\n}\r\n\r\nexport default ElementHandler;\r\n","import { fabric } from 'fabric';\r\n\r\nimport { Handler } from '.';\r\nimport { FabricImage } from '../utils';\r\n\r\nclass CropHandler {\r\n\thandler: Handler;\r\n\tcropRect: fabric.Rect;\r\n\tcropObject: FabricImage;\r\n\r\n\tconstructor(handler: Handler) {\r\n\t\tthis.handler = handler;\r\n\t\tthis.cropRect = null;\r\n\t\tthis.cropObject = null;\r\n\t}\r\n\r\n\t/**\r\n\t * Validate crop type\r\n\t *\r\n\t * @returns\r\n\t */\r\n\tpublic validType = () => {\r\n\t\tconst activeObject = this.handler.canvas.getActiveObject();\r\n\t\tif (!activeObject) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (activeObject.type === 'image') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\t/**\r\n\t * Start crop image\r\n\t *\r\n\t */\r\n\tpublic start = () => {\r\n\t\tif (this.validType()) {\r\n\t\t\tthis.handler.interactionMode = 'crop';\r\n\t\t\tthis.cropObject = this.handler.canvas.getActiveObject() as FabricImage;\r\n\t\t\tconst { left, top } = this.cropObject;\r\n\t\t\tthis.cropRect = new fabric.Rect({\r\n\t\t\t\twidth: this.cropObject.width,\r\n\t\t\t\theight: this.cropObject.height,\r\n\t\t\t\tscaleX: this.cropObject.scaleX,\r\n\t\t\t\tscaleY: this.cropObject.scaleY,\r\n\t\t\t\toriginX: 'left',\r\n\t\t\t\toriginY: 'top',\r\n\t\t\t\tleft,\r\n\t\t\t\ttop,\r\n\t\t\t\thasRotatingPoint: false,\r\n\t\t\t\tfill: 'rgba(0, 0, 0, 0.2)',\r\n\t\t\t});\r\n\t\t\tthis.handler.canvas.add(this.cropRect);\r\n\t\t\tthis.handler.canvas.setActiveObject(this.cropRect);\r\n\t\t\tthis.cropObject.selectable = false;\r\n\t\t\tthis.cropObject.evented = false;\r\n\t\t\tthis.handler.canvas.renderAll();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Finish crop image\r\n\t *\r\n\t */\r\n\tpublic finish = () => {\r\n\t\tconst { left, top, width, height, scaleX, scaleY } = this.cropRect;\r\n\t\tconst croppedImg = this.cropObject.toDataURL({\r\n\t\t\tleft: left - this.cropObject.left,\r\n\t\t\ttop: top - this.cropObject.top,\r\n\t\t\twidth: width * scaleX,\r\n\t\t\theight: height * scaleY,\r\n\t\t});\r\n\t\tthis.handler.setImage(this.cropObject, croppedImg);\r\n\t\tthis.cancel();\r\n\t};\r\n\r\n\t/**\r\n\t * Cancel crop\r\n\t *\r\n\t */\r\n\tpublic cancel = () => {\r\n\t\tthis.handler.interactionMode = 'selection';\r\n\t\tthis.cropObject.selectable = true;\r\n\t\tthis.cropObject.evented = true;\r\n\t\tthis.handler.canvas.setActiveObject(this.cropObject);\r\n\t\tthis.handler.canvas.remove(this.cropRect);\r\n\t\tthis.cropRect = null;\r\n\t\tthis.cropObject = null;\r\n\t\tthis.handler.canvas.renderAll();\r\n\t};\r\n\r\n\t/**\r\n\t * Resize crop\r\n\t *\r\n\t * @param {FabricEvent} opt\r\n\t */\r\n\tpublic resize = (opt: fabric.IEvent) => {\r\n\t\tconst {\r\n\t\t\ttarget,\r\n\t\t\ttransform: { original, corner },\r\n\t\t} = opt;\r\n\t\tconst { left, top, width, height, scaleX, scaleY } = target;\r\n\t\tconst {\r\n\t\t\tleft: cropLeft,\r\n\t\t\ttop: cropTop,\r\n\t\t\twidth: cropWidth,\r\n\t\t\theight: cropHeight,\r\n\t\t\tscaleX: cropScaleX,\r\n\t\t\tscaleY: cropScaleY,\r\n\t\t} = this.cropObject;\r\n\t\tif (corner === 'tl') {\r\n\t\t\tif (Math.round(cropLeft) > Math.round(left)) {\r\n\t\t\t\t// left\r\n\t\t\t\tconst originRight = Math.round(cropLeft + cropWidth);\r\n\t\t\t\tconst targetRight = Math.round(target.getBoundingRect().left + target.getBoundingRect().width);\r\n\t\t\t\tconst diffRightRatio = 1 - (originRight - targetRight) / cropWidth;\r\n\t\t\t\ttarget.set({\r\n\t\t\t\t\tleft: cropLeft,\r\n\t\t\t\t\tscaleX: diffRightRatio > 1 ? 1 : diffRightRatio,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (Math.round(cropTop) > Math.round(top)) {\r\n\t\t\t\t// top\r\n\t\t\t\tconst originBottom = Math.round(cropTop + cropHeight);\r\n\t\t\t\tconst targetBottom = Math.round(target.getBoundingRect().top + target.getBoundingRect().height);\r\n\t\t\t\tconst diffBottomRatio = 1 - (originBottom - targetBottom) / cropHeight;\r\n\t\t\t\ttarget.set({\r\n\t\t\t\t\ttop: cropTop,\r\n\t\t\t\t\tscaleY: diffBottomRatio > 1 ? 1 : diffBottomRatio,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} else if (corner === 'bl') {\r\n\t\t\tif (Math.round(cropLeft) > Math.round(left)) {\r\n\t\t\t\t// left\r\n\t\t\t\tconst originRight = Math.round(cropLeft + cropWidth);\r\n\t\t\t\tconst targetRight = Math.round(target.getBoundingRect().left + target.getBoundingRect().width);\r\n\t\t\t\tconst diffRightRatio = 1 - (originRight - targetRight) / cropWidth;\r\n\t\t\t\ttarget.set({\r\n\t\t\t\t\tleft: cropLeft,\r\n\t\t\t\t\tscaleX: diffRightRatio > 1 ? 1 : diffRightRatio,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (Math.round(cropTop + cropHeight * cropScaleY) < Math.round(top + height * scaleY)) {\r\n\t\t\t\t// bottom\r\n\t\t\t\tconst diffTopRatio = 1 - (original.top - cropTop) / cropHeight;\r\n\t\t\t\ttarget.set({\r\n\t\t\t\t\ttop: original.top,\r\n\t\t\t\t\tscaleY: diffTopRatio > 1 ? 1 : diffTopRatio,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} else if (corner === 'tr') {\r\n\t\t\tif (Math.round(cropLeft + cropWidth * cropScaleX) < Math.round(left + width * scaleX)) {\r\n\t\t\t\t// right\r\n\t\t\t\tconst diffLeftRatio = 1 - (original.left - cropLeft) / cropWidth;\r\n\t\t\t\ttarget.set({\r\n\t\t\t\t\tleft: original.left,\r\n\t\t\t\t\tscaleX: diffLeftRatio > 1 ? 1 : diffLeftRatio,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (Math.round(cropTop) > Math.round(top)) {\r\n\t\t\t\t// top\r\n\t\t\t\tconst originBottom = Math.round(cropTop + cropHeight);\r\n\t\t\t\tconst targetBottom = Math.round(target.getBoundingRect().top + target.getBoundingRect().height);\r\n\t\t\t\tconst diffBottomRatio = 1 - (originBottom - targetBottom) / cropHeight;\r\n\t\t\t\ttarget.set({\r\n\t\t\t\t\ttop: cropTop,\r\n\t\t\t\t\tscaleY: diffBottomRatio > 1 ? 1 : diffBottomRatio,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} else if (corner === 'br') {\r\n\t\t\tif (Math.round(cropLeft + cropWidth * cropScaleX) < Math.round(left + width * scaleX)) {\r\n\t\t\t\t// right\r\n\t\t\t\tconst diffLeftRatio = 1 - (original.left - cropLeft) / cropWidth;\r\n\t\t\t\ttarget.set({\r\n\t\t\t\t\tleft: original.left,\r\n\t\t\t\t\tscaleX: diffLeftRatio > 1 ? 1 : diffLeftRatio,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (Math.round(cropTop + cropHeight * cropScaleY) < Math.round(top + height * scaleY)) {\r\n\t\t\t\t// bottom\r\n\t\t\t\tconst diffTopRatio = 1 - (original.top - cropTop) / cropHeight;\r\n\t\t\t\ttarget.set({\r\n\t\t\t\t\ttop: original.top,\r\n\t\t\t\t\tscaleY: diffTopRatio > 1 ? 1 : diffTopRatio,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} else if (corner === 'ml') {\r\n\t\t\tif (Math.round(cropLeft) > Math.round(left)) {\r\n\t\t\t\t// left\r\n\t\t\t\tconst originRight = Math.round(cropLeft + cropWidth);\r\n\t\t\t\tconst targetRight = Math.round(target.getBoundingRect().left + target.getBoundingRect().width);\r\n\t\t\t\tconst diffRightRatio = 1 - (originRight - targetRight) / cropWidth;\r\n\t\t\t\ttarget.set({\r\n\t\t\t\t\tleft: cropLeft,\r\n\t\t\t\t\tscaleX: diffRightRatio > 1 ? 1 : diffRightRatio,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} else if (corner === 'mt') {\r\n\t\t\tif (Math.round(cropTop) > Math.round(top)) {\r\n\t\t\t\t// top\r\n\t\t\t\tconst originBottom = Math.round(cropTop + cropHeight);\r\n\t\t\t\tconst targetBottom = Math.round(target.getBoundingRect().top + target.getBoundingRect().height);\r\n\t\t\t\tconst diffBottomRatio = 1 - (originBottom - targetBottom) / cropHeight;\r\n\t\t\t\ttarget.set({\r\n\t\t\t\t\ttop: cropTop,\r\n\t\t\t\t\tscaleY: diffBottomRatio > 1 ? 1 : diffBottomRatio,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} else if (corner === 'mb') {\r\n\t\t\tif (Math.round(cropTop + cropHeight * cropScaleY) < Math.round(top + height * scaleY)) {\r\n\t\t\t\t// bottom\r\n\t\t\t\tconst diffTopRatio = 1 - (original.top - cropTop) / cropHeight;\r\n\t\t\t\ttarget.set({\r\n\t\t\t\t\ttop: original.top,\r\n\t\t\t\t\tscaleY: diffTopRatio > 1 ? 1 : diffTopRatio,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} else if (corner === 'mr') {\r\n\t\t\tif (Math.round(cropLeft + cropWidth * cropScaleX) < Math.round(left + width * scaleX)) {\r\n\t\t\t\t// right\r\n\t\t\t\tconst diffLeftRatio = 1 - (original.left - cropLeft) / cropWidth;\r\n\t\t\t\ttarget.set({\r\n\t\t\t\t\tleft: original.left,\r\n\t\t\t\t\tscaleX: diffLeftRatio > 1 ? 1 : diffLeftRatio,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Resize crop\r\n\t *\r\n\t * @param {FabricEvent} opt\r\n\t */\r\n\tpublic moving = (opt: fabric.IEvent) => {\r\n\t\tconst { target } = opt;\r\n\t\tconst { left, top, width, height, scaleX, scaleY } = target;\r\n\t\tconst {\r\n\t\t\tleft: cropLeft,\r\n\t\t\ttop: cropTop,\r\n\t\t\twidth: cropWidth,\r\n\t\t\theight: cropHeight,\r\n\t\t} = this.cropObject.getBoundingRect();\r\n\t\tconst movedTop = () => {\r\n\t\t\tif (Math.round(cropTop) >= Math.round(top)) {\r\n\t\t\t\ttarget.set({\r\n\t\t\t\t\ttop: cropTop,\r\n\t\t\t\t});\r\n\t\t\t} else if (Math.round(cropTop + cropHeight) <= Math.round(top + height * scaleY)) {\r\n\t\t\t\ttarget.set({\r\n\t\t\t\t\ttop: cropTop + cropHeight - height * scaleY,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\t\tif (Math.round(cropLeft) >= Math.round(left)) {\r\n\t\t\ttarget.set({\r\n\t\t\t\tleft: Math.max(left, cropLeft),\r\n\t\t\t});\r\n\t\t\tmovedTop();\r\n\t\t} else if (Math.round(cropLeft + cropWidth) <= Math.round(left + width * scaleX)) {\r\n\t\t\ttarget.set({\r\n\t\t\t\tleft: cropLeft + cropWidth - width * scaleX,\r\n\t\t\t});\r\n\t\t\tmovedTop();\r\n\t\t} else if (Math.round(cropTop) >= Math.round(top)) {\r\n\t\t\ttarget.set({\r\n\t\t\t\ttop: cropTop,\r\n\t\t\t});\r\n\t\t} else if (Math.round(cropTop + cropHeight) <= Math.round(top + height * scaleY)) {\r\n\t\t\ttarget.set({\r\n\t\t\t\ttop: cropTop + cropHeight - height * scaleY,\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default CropHandler;\r\n","import anime from 'animejs';\r\n\r\nimport { Handler } from '.';\r\nimport { FabricObject } from '../utils';\r\n\r\nclass AnimationHandler {\r\n\thandler: Handler;\r\n\r\n\tconstructor(handler: Handler) {\r\n\t\tthis.handler = handler;\r\n\t}\r\n\r\n\t/**\r\n\t * Play the animation\r\n\t * @param {string} id\r\n\t * @param {boolean} [hasControls]\r\n\t * @returns\r\n\t */\r\n\tpublic play = (id: string, hasControls?: boolean) => {\r\n\t\tconst findObject = this.handler.findById(id);\r\n\t\tif (!findObject) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (findObject.anime) {\r\n\t\t\tfindObject.anime.restart();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (findObject.animation.type === 'none') {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst instance = this.getAnime(findObject, hasControls);\r\n\t\tif (instance) {\r\n\t\t\tfindObject.set('anime', instance);\r\n\t\t\tfindObject.set({\r\n\t\t\t\thasControls: false,\r\n\t\t\t\tlockMovementX: true,\r\n\t\t\t\tlockMovementY: true,\r\n\t\t\t\thoverCursor: 'pointer',\r\n\t\t\t});\r\n\t\t\tthis.handler.canvas.requestRenderAll();\r\n\t\t\tinstance.play();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Pause the animation\r\n\t * @param {string} id\r\n\t * @returns\r\n\t */\r\n\tpublic pause = (id: string) => {\r\n\t\tconst findObject = this.handler.findById(id);\r\n\t\tif (!findObject) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfindObject.anime.pause();\r\n\t};\r\n\r\n\t/**\r\n\t * Stop the animation\r\n\t * @param {string} id\r\n\t * @param {boolean} [hasControls=true]\r\n\t * @returns\r\n\t */\r\n\tpublic stop = (id: string, hasControls = true) => {\r\n\t\tconst findObject = this.handler.findById(id);\r\n\t\tif (!findObject) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.resetAnimation(findObject, hasControls);\r\n\t};\r\n\r\n\t/**\r\n\t * Restart the animation\r\n\t * @param {string} id\r\n\t * @returns\r\n\t */\r\n\tpublic restart = (id: string) => {\r\n\t\tconst findObject = this.handler.findById(id);\r\n\t\tif (!findObject) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (!findObject.anime) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.stop(id);\r\n\t\tthis.play(id);\r\n\t};\r\n\r\n\t/**\r\n\t * Reset animation\r\n\t *\r\n\t * @param {FabricObject} obj\r\n\t * @param {boolean} [hasControls=true]\r\n\t * @returns\r\n\t */\r\n\tpublic resetAnimation = (obj: FabricObject, hasControls = true) => {\r\n\t\tif (!obj.anime) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlet option;\r\n\t\tif (this.handler.editable) {\r\n\t\t\toption = {\r\n\t\t\t\tanime: null,\r\n\t\t\t\thasControls,\r\n\t\t\t\tlockMovementX: !hasControls,\r\n\t\t\t\tlockMovementY: !hasControls,\r\n\t\t\t\thoverCursor: hasControls ? 'move' : 'pointer',\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\toption = {\r\n\t\t\t\tanime: null,\r\n\t\t\t\thasControls: false,\r\n\t\t\t\tlockMovementX: true,\r\n\t\t\t\tlockMovementY: true,\r\n\t\t\t\thoverCursor: 'pointer',\r\n\t\t\t};\r\n\t\t}\r\n\t\tanime.remove(obj);\r\n\t\tconst { type } = obj.animation;\r\n\t\tif (type === 'fade') {\r\n\t\t\tObject.assign(option, {\r\n\t\t\t\topacity: obj.originOpacity,\r\n\t\t\t\toriginOpacity: null,\r\n\t\t\t});\r\n\t\t} else if (type === 'bounce') {\r\n\t\t\tif (obj.animation.bounce === 'vertical') {\r\n\t\t\t\tObject.assign(option, {\r\n\t\t\t\t\ttop: obj.originTop,\r\n\t\t\t\t\toriginTop: null,\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tObject.assign(option, {\r\n\t\t\t\t\tleft: obj.originLeft,\r\n\t\t\t\t\toriginLeft: null,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} else if (type === 'shake') {\r\n\t\t\tif (obj.animation.shake === 'vertical') {\r\n\t\t\t\tObject.assign(option, {\r\n\t\t\t\t\ttop: obj.originTop,\r\n\t\t\t\t\toriginTop: null,\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tObject.assign(option, {\r\n\t\t\t\t\tleft: obj.originLeft,\r\n\t\t\t\t\toriginLeft: null,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} else if (type === 'scaling') {\r\n\t\t\tObject.assign(option, {\r\n\t\t\t\tscaleX: obj.originScaleX,\r\n\t\t\t\tscaleY: obj.originScaleY,\r\n\t\t\t\toriginScaleX: null,\r\n\t\t\t\toriginScaleY: null,\r\n\t\t\t});\r\n\t\t} else if (type === 'rotation') {\r\n\t\t\tObject.assign(option, {\r\n\t\t\t\tangle: obj.originAngle,\r\n\t\t\t\trotation: obj.originAngle,\r\n\t\t\t\tleft: obj.originLeft,\r\n\t\t\t\ttop: obj.originTop,\r\n\t\t\t\toriginLeft: null,\r\n\t\t\t\toriginTop: null,\r\n\t\t\t\toriginAngle: null,\r\n\t\t\t});\r\n\t\t} else if (type === 'flash') {\r\n\t\t\tObject.assign(option, {\r\n\t\t\t\tfill: obj.originFill,\r\n\t\t\t\tstroke: obj.originStroke,\r\n\t\t\t\toriginFill: null,\r\n\t\t\t\torigniStroke: null,\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tconsole.warn('Not supported type.');\r\n\t\t}\r\n\t\tobj.set(option);\r\n\t\tthis.handler.canvas.renderAll();\r\n\t};\r\n\r\n\t/**\r\n\t * Get animation option\r\n\t *\r\n\t * @param {FabricObject} obj\r\n\t * @param {boolean} [hasControls]\r\n\t * @returns\r\n\t */\r\n\tgetAnime = (obj: FabricObject, hasControls?: boolean) => {\r\n\t\tconst { delay = 0, duration = 100, autoplay = true, loop = true, type, ...other } = obj.animation;\r\n\t\tconst option: anime.AnimeParams = {\r\n\t\t\ttargets: obj,\r\n\t\t\tdelay,\r\n\t\t\tloop,\r\n\t\t\tautoplay,\r\n\t\t\tduration,\r\n\t\t\tdirection: 'alternate',\r\n\t\t\tbegin: () => {\r\n\t\t\t\tobj.set({\r\n\t\t\t\t\thasControls: false,\r\n\t\t\t\t\tlockMovementX: true,\r\n\t\t\t\t\tlockMovementY: true,\r\n\t\t\t\t\thoverCursor: 'pointer',\r\n\t\t\t\t});\r\n\t\t\t\tthis.handler.canvas.requestRenderAll();\r\n\t\t\t},\r\n\t\t\tupdate: (e: any) => {\r\n\t\t\t\tif (type === 'flash') {\r\n\t\t\t\t\t// I don't know why it works. Magic code...\r\n\t\t\t\t\tconst fill = e.animations[0].currentValue;\r\n\t\t\t\t\tconst stroke = e.animations[1].currentValue;\r\n\t\t\t\t\tobj.set('fill', '');\r\n\t\t\t\t\tobj.set('fill', fill);\r\n\t\t\t\t\tobj.set('stroke', stroke);\r\n\t\t\t\t} else if (type === 'rotation') {\r\n\t\t\t\t\tconst angle = e.animations[0].currentValue;\r\n\t\t\t\t\tobj.rotate(angle);\r\n\t\t\t\t\tthis.handler.canvas.requestRenderAll();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tobj.setCoords();\r\n\t\t\t\tthis.handler.canvas.requestRenderAll();\r\n\t\t\t},\r\n\t\t\tcomplete: () => {\r\n\t\t\t\tthis.resetAnimation(obj, hasControls);\r\n\t\t\t},\r\n\t\t};\r\n\t\tif (type === 'fade') {\r\n\t\t\tconst { opacity = 0 } = other;\r\n\t\t\tobj.set('originOpacity', obj.opacity);\r\n\t\t\tObject.assign(option, {\r\n\t\t\t\topacity,\r\n\t\t\t\teasing: 'easeInQuad',\r\n\t\t\t});\r\n\t\t} else if (type === 'bounce') {\r\n\t\t\tconst { offset = 1 } = other;\r\n\t\t\tif (other.bounce === 'vertical') {\r\n\t\t\t\tobj.set('originTop', obj.top);\r\n\t\t\t\tObject.assign(option, {\r\n\t\t\t\t\ttop: obj.top + offset,\r\n\t\t\t\t\teasing: 'easeInQuad',\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tobj.set('originLeft', obj.left);\r\n\t\t\t\tObject.assign(option, {\r\n\t\t\t\t\tleft: obj.left + offset,\r\n\t\t\t\t\teasing: 'easeInQuad',\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} else if (type === 'shake') {\r\n\t\t\tconst { offset = 1 } = other;\r\n\t\t\tif (other.shake === 'vertical') {\r\n\t\t\t\tobj.set('originTop', obj.top);\r\n\t\t\t\tObject.assign(option, {\r\n\t\t\t\t\ttop: obj.top + offset,\r\n\t\t\t\t\tdelay: 0,\r\n\t\t\t\t\telasticity: 1000,\r\n\t\t\t\t\tduration: 500,\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tobj.set('originLeft', obj.left);\r\n\t\t\t\tObject.assign(option, {\r\n\t\t\t\t\tleft: obj.left + offset,\r\n\t\t\t\t\tdelay: 0,\r\n\t\t\t\t\telasticity: 1000,\r\n\t\t\t\t\tduration: 500,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} else if (type === 'scaling') {\r\n\t\t\tconst { scale = 2 } = other;\r\n\t\t\tobj.set('originScaleX', obj.scaleX);\r\n\t\t\tobj.set('originScaleY', obj.scaleY);\r\n\t\t\tobj.set({\r\n\t\t\t\toriginScaleX: obj.scaleX,\r\n\t\t\t\toriginScaleY: obj.scaleY,\r\n\t\t\t});\r\n\t\t\tconst scaleX = obj.scaleX * scale;\r\n\t\t\tconst scaleY = obj.scaleY * scale;\r\n\t\t\tObject.assign(option, {\r\n\t\t\t\tscaleX,\r\n\t\t\t\tscaleY,\r\n\t\t\t\teasing: 'easeInQuad',\r\n\t\t\t});\r\n\t\t} else if (type === 'rotation') {\r\n\t\t\tconst { angle = 360 } = other;\r\n\t\t\tobj.set('rotation', obj.angle);\r\n\t\t\tobj.set('originAngle', obj.angle);\r\n\t\t\tobj.set('originLeft', obj.left);\r\n\t\t\tobj.set('originTop', obj.top);\r\n\t\t\tObject.assign(option, {\r\n\t\t\t\trotation: angle,\r\n\t\t\t\teasing: 'linear',\r\n\t\t\t\tdirection: 'normal',\r\n\t\t\t});\r\n\t\t} else if (type === 'flash') {\r\n\t\t\tconst { fill = obj.fill, stroke = obj.stroke } = other;\r\n\t\t\tobj.set('originFill', obj.fill as string);\r\n\t\t\tobj.set('originStroke', obj.stroke);\r\n\t\t\tObject.assign(option, {\r\n\t\t\t\tfill,\r\n\t\t\t\tstroke,\r\n\t\t\t\teasing: 'easeInQuad',\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tconsole.warn('Not supported type.');\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn anime(option);\r\n\t};\r\n}\r\n\r\nexport default AnimationHandler;\r\n","import ReactDOM from 'react-dom';\r\nimport debounce from 'lodash/debounce';\r\n\r\nimport { Handler } from '.';\r\n\r\nclass ContextmenuHandler {\r\n\thandler: Handler;\r\n\tcontextmenuEl: HTMLDivElement;\r\n\r\n\tconstructor(handler: Handler) {\r\n\t\tthis.handler = handler;\r\n\t\tthis.initialize();\r\n\t}\r\n\r\n\t/**\r\n\t * Initialize contextmenu\r\n\t *\r\n\t */\r\n\tpublic initialize() {\r\n\t\tthis.contextmenuEl = document.createElement('div');\r\n\t\tthis.contextmenuEl.id = `${this.handler.id}_contextmenu`;\r\n\t\tthis.contextmenuEl.className = 'rde-contextmenu contextmenu-hidden';\r\n\t\tdocument.body.appendChild(this.contextmenuEl);\r\n\t}\r\n\r\n\t/**\r\n\t * Destroy contextmenu\r\n\t *\r\n\t */\r\n\tpublic destory() {\r\n\t\tif (this.contextmenuEl) {\r\n\t\t\tdocument.body.removeChild(this.contextmenuEl);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Show context menu\r\n\t *\r\n\t */\r\n\tpublic show = debounce(async (e, target) => {\r\n\t\tconst { onContext } = this.handler;\r\n\t\twhile (this.contextmenuEl.hasChildNodes()) {\r\n\t\t\tthis.contextmenuEl.removeChild(this.contextmenuEl.firstChild);\r\n\t\t}\r\n\t\tconst contextmenu = document.createElement('div');\r\n\t\tcontextmenu.className = 'rde-contextmenu-right';\r\n\t\tconst element = await onContext(this.contextmenuEl, e, target);\r\n\t\tif (!element) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcontextmenu.innerHTML = element;\r\n\t\tthis.contextmenuEl.appendChild(contextmenu);\r\n\t\tReactDOM.render(element, contextmenu);\r\n\t\tthis.contextmenuEl.classList.remove('contextmenu-hidden');\r\n\t\tconst { clientX: left, clientY: top } = e;\r\n\t\tthis.contextmenuEl.style.left = `${left}px`;\r\n\t\tthis.contextmenuEl.style.top = `${top}px`;\r\n\t}, 100);\r\n\r\n\t/**\r\n\t * Hide context menu\r\n\t *\r\n\t */\r\n\tpublic hide = debounce(() => {\r\n\t\tif (this.contextmenuEl) {\r\n\t\t\tthis.contextmenuEl.classList.add('contextmenu-hidden');\r\n\t\t}\r\n\t}, 100);\r\n}\r\n\r\nexport default ContextmenuHandler;\r\n","import ReactDOM from \"react-dom\";\r\nimport debounce from \"lodash/debounce\";\r\n\r\nimport Handler from \"./Handler\";\r\nimport { FabricObject } from \"../utils\";\r\n\r\nclass TooltipHandler {\r\n handler: Handler;\r\n tooltipEl: HTMLDivElement;\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n this.initialize();\r\n }\r\n\r\n /**\r\n * Initialize tooltip\r\n *\r\n * @author salgum1114\r\n */\r\n public initialize() {\r\n this.tooltipEl = document.createElement(\"div\");\r\n this.tooltipEl.id = `${this.handler.id}_tooltip`;\r\n this.tooltipEl.className = \"rde-tooltip tooltip-hidden\";\r\n document.body.appendChild(this.tooltipEl);\r\n }\r\n\r\n /**\r\n * Destroy tooltip\r\n *\r\n * @author salgum1114\r\n */\r\n public destroy() {\r\n if (this.tooltipEl) {\r\n document.body.removeChild(this.tooltipEl);\r\n }\r\n }\r\n\r\n /**\r\n * Show tooltip\r\n *\r\n * @param {FabricObject} [target]\r\n */\r\n public show = debounce(async (e: any, htmlElement?: any) => {\r\n while (this.tooltipEl.hasChildNodes()) {\r\n this.tooltipEl.removeChild(this.tooltipEl.firstChild);\r\n }\r\n\r\n if (!htmlElement) return;\r\n\r\n const tooltip = document.createElement(\"div\");\r\n tooltip.className = \"rde-tooltip-show\";\r\n tooltip.innerHTML = htmlElement;\r\n this.tooltipEl.appendChild(tooltip);\r\n ReactDOM.render(htmlElement, tooltip);\r\n this.tooltipEl.classList.remove(\"tooltip-hidden\");\r\n\r\n let left, top;\r\n if (e instanceof TouchEvent) {\r\n left = e.touches[0].clientX;\r\n top = e.touches[0].clientY;\r\n } else {\r\n left = e.clientX;\r\n top = e.clientY;\r\n }\r\n\r\n const space = 10;\r\n if (document.body.clientWidth <= left + this.tooltipEl.offsetWidth) {\r\n this.tooltipEl.style.left = `${left -\r\n this.tooltipEl.offsetWidth -\r\n space}px`;\r\n } else {\r\n this.tooltipEl.style.left = `${left + space}px`;\r\n }\r\n\r\n if (document.body.clientHeight <= top + this.tooltipEl.offsetHeight) {\r\n this.tooltipEl.style.top = `${top -\r\n this.tooltipEl.offsetHeight -\r\n space}px`;\r\n } else {\r\n this.tooltipEl.style.top = `${top + space}px`;\r\n }\r\n }, 100);\r\n\r\n /**\r\n * Hide tooltip\r\n * @param {fabric.Object} [_target]\r\n */\r\n public hide = debounce(() => {\r\n if (this.tooltipEl) {\r\n this.tooltipEl.classList.add(\"tooltip-hidden\");\r\n }\r\n }, 0);\r\n}\r\n\r\nexport default TooltipHandler;\r\n","import { fabric } from \"fabric\";\r\nimport throttle from \"lodash/throttle\";\r\n\r\nimport Handler from \"./Handler\";\r\nimport { FabricObject } from \"../utils\";\r\nimport { NodeObject } from \"../objects/fabric/Node\";\r\nimport { LinkObject } from \"../objects/fabric/Link\";\r\n\r\nexport type TransactionType =\r\n | \"add\"\r\n | \"remove\"\r\n | \"moved\"\r\n | \"scaled\"\r\n | \"rotated\"\r\n | \"skewed\"\r\n | \"group\"\r\n | \"ungroup\"\r\n | \"paste\"\r\n | \"bringForward\"\r\n | \"bringToFront\"\r\n | \"sendBackwards\"\r\n | \"sendToBack\"\r\n | \"redo\"\r\n | \"undo\"\r\n | \"loaded\"\r\n | \"properties\";\r\n\r\nexport interface TransactionTransform {\r\n scaleX?: number;\r\n scaleY?: number;\r\n skewX?: number;\r\n skewY?: number;\r\n angle?: number;\r\n left?: number;\r\n top?: number;\r\n flipX?: number;\r\n flipY?: number;\r\n originX?: string;\r\n originY?: string;\r\n}\r\n\r\nexport interface TransactionEvent {\r\n json: string;\r\n type: TransactionType;\r\n}\r\n\r\nclass TransactionHandler {\r\n handler: Handler;\r\n redos: TransactionEvent[];\r\n undos: TransactionEvent[];\r\n active: boolean = false;\r\n state: FabricObject[] = [];\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n if (this.handler.editable) {\r\n this.initialize();\r\n }\r\n }\r\n\r\n /**\r\n * Initialize transaction handler\r\n *\r\n */\r\n public initialize = () => {\r\n this.redos = [];\r\n this.undos = [];\r\n this.state = [];\r\n this.active = false;\r\n };\r\n\r\n /**\r\n * Save transaction\r\n *\r\n * @param {TransactionType} type\r\n * @param {*} [canvasJSON]\r\n * @param {boolean} [isWorkarea=true]\r\n */\r\n public save = (\r\n type: TransactionType,\r\n canvasJSON?: any,\r\n _isWorkarea: boolean = true\r\n ) => {\r\n if (!this.handler.keyEvent.transaction || !this.undos) {\r\n return;\r\n }\r\n try {\r\n if (this.state) {\r\n const json = JSON.stringify(this.state);\r\n this.redos = [];\r\n this.undos.push({\r\n type,\r\n json,\r\n });\r\n }\r\n const { objects }: { objects: FabricObject[] } =\r\n canvasJSON ||\r\n this.handler.canvas.toJSON(this.handler.propertiesToInclude);\r\n this.state = objects.filter((obj) => {\r\n if (obj.id === \"workarea\") {\r\n return false;\r\n } else if (obj.id === \"grid\") {\r\n return false;\r\n } else if (obj.superType === \"port\") {\r\n return false;\r\n }\r\n return true;\r\n });\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n };\r\n\r\n /**\r\n * Undo transaction\r\n *\r\n */\r\n public undo = throttle(() => {\r\n const undo = this.undos.pop();\r\n if (!undo) {\r\n return;\r\n }\r\n this.redos.push({\r\n type: \"redo\",\r\n json: JSON.stringify(this.state),\r\n });\r\n this.replay(undo);\r\n }, 100);\r\n\r\n /**\r\n * Redo transaction\r\n *\r\n */\r\n public redo = throttle(() => {\r\n const redo = this.redos.pop();\r\n if (!redo) {\r\n return;\r\n }\r\n this.undos.push({\r\n type: \"undo\",\r\n json: JSON.stringify(this.state),\r\n });\r\n this.replay(redo);\r\n }, 100);\r\n\r\n /**\r\n * Replay transaction\r\n *\r\n * @param {TransactionEvent} transaction\r\n */\r\n public replay = (transaction: TransactionEvent) => {\r\n const objects = JSON.parse(transaction.json) as FabricObject[];\r\n this.state = objects;\r\n this.active = true;\r\n this.handler.canvas.renderOnAddRemove = false;\r\n this.handler.clear();\r\n this.handler.canvas.discardActiveObject();\r\n fabric.util.enlivenObjects(\r\n objects,\r\n (enlivenObjects: FabricObject[]) => {\r\n enlivenObjects.forEach((obj) => {\r\n const targetIndex = this.handler.canvas._objects.length;\r\n if (obj.superType === \"node\") {\r\n this.handler.canvas.insertAt(obj, targetIndex, false);\r\n this.handler.portHandler.create(obj as NodeObject);\r\n } else if (obj.superType === \"link\") {\r\n const link = obj as LinkObject;\r\n this.handler.objects = this.handler.getObjects();\r\n this.handler.linkHandler.create({\r\n type: \"curvedLink\",\r\n fromNodeId: link.fromNode?.id,\r\n fromPortId: link.fromPort?.id,\r\n toNodeId: link.toNode?.id,\r\n toPortId: link.toPort?.id,\r\n });\r\n } else {\r\n this.handler.canvas.insertAt(obj, targetIndex, false);\r\n }\r\n });\r\n this.handler.canvas.renderOnAddRemove = true;\r\n this.active = false;\r\n this.handler.canvas.renderAll();\r\n this.handler.objects = this.handler.getObjects();\r\n if (this.handler.onTransaction) {\r\n this.handler.onTransaction(transaction);\r\n }\r\n },\r\n null\r\n );\r\n };\r\n}\r\n\r\nexport default TransactionHandler;\r\n","import { fabric } from \"fabric\";\r\n\r\nimport Handler from \"./Handler\";\r\nimport { FabricObject } from \"../utils\";\r\n\r\nclass ZoomHandler {\r\n handler?: Handler;\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n /**\r\n * Zoom to point\r\n *\r\n * @param {fabric.Point} point\r\n * @param {number} zoom ex) 0 ~ 1. Not percentage value.\r\n */\r\n public zoomToPoint = (point: fabric.Point, zoom: number) => {\r\n const { minZoom, maxZoom } = this.handler;\r\n let zoomRatio = zoom;\r\n if (zoom <= minZoom / 100) {\r\n zoomRatio = minZoom / 100;\r\n } else if (zoom >= maxZoom / 100) {\r\n zoomRatio = maxZoom / 100;\r\n }\r\n this.handler.canvas.zoomToPoint(point, zoomRatio);\r\n if (this.handler.onZoom) {\r\n this.handler.onZoom(zoomRatio);\r\n }\r\n this.handler.canvas.requestRenderAll();\r\n };\r\n\r\n /**\r\n * Zoom one to one\r\n *\r\n */\r\n public zoomOneToOne = () => {\r\n const center = this.handler.canvas.getCenter();\r\n this.zoomToPoint(new fabric.Point(center.left, center.top), 1);\r\n };\r\n\r\n /**\r\n * Zoom to fit\r\n *\r\n */\r\n public zoomToFit = () => {\r\n if (this.handler.canvas.getObjects().length < 1) {\r\n return;\r\n }\r\n\r\n const group = new fabric.Group(this.handler.canvas.getObjects());\r\n this.zoomToCenterWithObject(group, 1);\r\n };\r\n\r\n public zoomToFitV2(){\r\n const objects = this.handler.canvas.getObjects();\r\n if (objects.length === 0) return;\r\n\r\n // Calcular el bounding box de todos los objetos\r\n const boundingRect = this.handler.canvas.getObjects().reduce((acc, obj) => {\r\n const objRect = obj.getBoundingRect();\r\n acc.left = Math.min(acc.left, objRect.left);\r\n acc.top = Math.min(acc.top, objRect.top);\r\n acc.width = Math.max(acc.width, objRect.left + objRect.width - acc.left);\r\n acc.height = Math.max(acc.height, objRect.top + objRect.height - acc.top);\r\n return acc;\r\n }, {\r\n left: Infinity,\r\n top: Infinity,\r\n width: -Infinity,\r\n height: -Infinity\r\n });\r\n\r\n // Ajustar el zoom\r\n const canvasWidth = this.handler.canvas.getWidth();\r\n const canvasHeight = this.handler.canvas.getHeight();\r\n const scaleX = canvasWidth / boundingRect.width;\r\n const scaleY = canvasHeight / boundingRect.height;\r\n const scale = Math.min(scaleX, scaleY);\r\n\r\n // Establecer el zoom\r\n this.handler.canvas.setZoom(scale);\r\n\r\n // Centrar el canvas en el bounding box\r\n this.handler.canvas.setViewportTransform([\r\n scale, 0, 0,\r\n scale, -boundingRect.left * scale + (canvasWidth / 2 - (boundingRect.width * scale / 2)),\r\n -boundingRect.top * scale + (canvasHeight / 2 - (boundingRect.height * scale / 2))\r\n ]);\r\n\r\n this.handler.canvas.renderAll();\r\n }\r\n\r\n /**\r\n * Zoom in\r\n *\r\n */\r\n public zoomIn = (zoom = 0.05) => {\r\n let zoomRatio = this.handler.canvas.getZoom();\r\n zoomRatio += zoom;\r\n const center = this.handler.canvas.getCenter();\r\n this.zoomToPoint(new fabric.Point(center.left, center.top), zoomRatio);\r\n };\r\n\r\n /**\r\n * Zoom out\r\n *\r\n */\r\n public zoomOut = (zoom = 0.05) => {\r\n let zoomRatio = this.handler.canvas.getZoom();\r\n zoomRatio -= zoom;\r\n const center = this.handler.canvas.getCenter();\r\n this.zoomToPoint(new fabric.Point(center.left, center.top), zoomRatio);\r\n };\r\n\r\n /**\r\n * Zoom to center with object\r\n *\r\n * @param {FabricObject} target If zoomFit true, rescaled canvas zoom.\r\n */\r\n public zoomToCenterWithObject = (\r\n target: FabricObject,\r\n clickCoords: any,\r\n cliked = false\r\n ) => {\r\n const {\r\n left: canvasLeft,\r\n top: canvasTop,\r\n } = this.handler.canvas.getCenter();\r\n const { left, top, width, height } = target;\r\n const diffTop = canvasTop - (top + height / 2);\r\n const diffLeft = canvasLeft - (left + width / 2);\r\n let scaleX;\r\n let scaleY;\r\n scaleX = this.handler.canvas.getWidth() / width;\r\n scaleY = this.handler.canvas.getHeight() / height;\r\n if (height > width) {\r\n scaleX = scaleY;\r\n if (this.handler.canvas.getWidth() < width * scaleX) {\r\n scaleX = scaleX * (this.handler.canvas.getWidth() / (width * scaleX));\r\n }\r\n } else {\r\n scaleY = scaleX;\r\n if (this.handler.canvas.getHeight() < height * scaleX) {\r\n scaleX = scaleX * (this.handler.canvas.getHeight() / (height * scaleX));\r\n }\r\n }\r\n if(!cliked){\r\n this.handler.canvas.setViewportTransform([1, 0, 0, 1, diffLeft, diffTop]);\r\n }\r\n let zoom = scaleX * 0.9;\r\n if(cliked){\r\n zoom = 4;\r\n console.log('CLICKED', clickCoords.x, clickCoords.y)\r\n this.zoomToPoint(new fabric.Point(clickCoords.x, clickCoords.y), zoom);\r\n return\r\n }\r\n this.zoomToPoint(new fabric.Point(canvasLeft, canvasTop), zoom);\r\n };\r\n\r\n /**\r\n * Zoom to center with objects\r\n *\r\n * @param\r\n * @returns\r\n */\r\n public zoomToCenter = () => {\r\n const activeObject = this.handler.canvas.getActiveObject();\r\n if (!activeObject) {\r\n return;\r\n }\r\n this.zoomToCenterWithObject(activeObject, 1);\r\n };\r\n}\r\n\r\nexport default ZoomHandler;\r\n","import { fabric } from 'fabric';\r\n\r\nimport { Handler } from '.';\r\nimport { WorkareaLayout, WorkareaObject, FabricImage } from '../utils';\r\nimport { VideoObject } from '../objects/fabric/Video';\r\n\r\nclass WorkareaHandler {\r\n\thandler: Handler;\r\n\r\n\tconstructor(handler: Handler) {\r\n\t\tthis.handler = handler;\r\n\t\tthis.initialize();\r\n\t}\r\n\r\n\t/**\r\n\t * Initialize workarea\r\n\t *\r\n\t * @author salgum1114\r\n\t */\r\n\tpublic initialize() {\r\n\t\tconst { workareaOption } = this.handler;\r\n\t\tconst image = new Image(workareaOption.width, workareaOption.height);\r\n\t\timage.width = workareaOption.width;\r\n\t\timage.height = workareaOption.height;\r\n\t\tthis.handler.workarea = new fabric.Image(image, workareaOption) as WorkareaObject;\r\n\t\t// this.handler.canvas.add(this.handler.workarea);\r\n\t\tthis.handler.objects = this.handler.getObjects();\r\n\t\tthis.handler.canvas.centerObject(this.handler.workarea);\r\n\t\tthis.handler.canvas.renderAll();\r\n\t}\r\n\r\n\t/**\r\n\t * Set the layout on workarea\r\n\t * @param {WorkareaLayout} layout\r\n\t * @returns\r\n\t */\r\n\tpublic setLayout = (layout: WorkareaLayout) => {\r\n\t\tthis.handler.workarea.set('layout', layout);\r\n\t\tconst { _element, isElement, workareaWidth, workareaHeight } = this.handler.workarea;\r\n\t\tconst { canvas } = this.handler;\r\n\t\tlet scaleX = 1;\r\n\t\tlet scaleY = 1;\r\n\t\tconst isFixed = layout === 'fixed';\r\n\t\tconst isResponsive = layout === 'responsive';\r\n\t\tconst isFullscreen = layout === 'fullscreen';\r\n\t\tif (isElement) {\r\n\t\t\tif (isFixed) {\r\n\t\t\t\tscaleX = workareaWidth / _element.width;\r\n\t\t\t\tscaleY = workareaHeight / _element.height;\r\n\t\t\t} else if (isResponsive) {\r\n\t\t\t\tconst scales = this.calculateScale();\r\n\t\t\t\tscaleX = scales.scaleX;\r\n\t\t\t\tscaleY = scales.scaleY;\r\n\t\t\t} else {\r\n\t\t\t\tscaleX = canvas.getWidth() / _element.width;\r\n\t\t\t\tscaleY = canvas.getHeight() / _element.height;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.handler.getObjects().forEach(obj => {\r\n\t\t\tconst { id, player } = obj as VideoObject;\r\n\t\t\tif (id !== 'workarea') {\r\n\t\t\t\tconst objScaleX = !isFullscreen ? 1 : scaleX;\r\n\t\t\t\tconst objScaleY = !isFullscreen ? 1 : scaleY;\r\n\t\t\t\tconst objWidth = obj.width * objScaleX * canvas.getZoom();\r\n\t\t\t\tconst objHeight = obj.height * objScaleY * canvas.getZoom();\r\n\t\t\t\tconst el = this.handler.elementHandler.findById(obj.id);\r\n\t\t\t\tthis.handler.elementHandler.setSize(el, obj);\r\n\t\t\t\tif (player) {\r\n\t\t\t\t\tplayer.setPlayerSize(objWidth, objHeight);\r\n\t\t\t\t}\r\n\t\t\t\tobj.set({\r\n\t\t\t\t\tscaleX: !isFullscreen ? 1 : objScaleX,\r\n\t\t\t\t\tscaleY: !isFullscreen ? 1 : objScaleY,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (isResponsive) {\r\n\t\t\tconst center = canvas.getCenter();\r\n\t\t\tif (isElement) {\r\n\t\t\t\tthis.handler.workarea.set({\r\n\t\t\t\t\tscaleX: 1,\r\n\t\t\t\t\tscaleY: 1,\r\n\t\t\t\t});\r\n\t\t\t\tthis.handler.zoomHandler.zoomToPoint(new fabric.Point(center.left, center.top), scaleX);\r\n\t\t\t} else {\r\n\t\t\t\tthis.handler.workarea.set({\r\n\t\t\t\t\twidth: workareaWidth,\r\n\t\t\t\t\theight: workareaHeight,\r\n\t\t\t\t});\r\n\t\t\t\tscaleX = canvas.getWidth() / workareaWidth;\r\n\t\t\t\tscaleY = canvas.getHeight() / workareaHeight;\r\n\t\t\t\tif (workareaHeight >= workareaWidth) {\r\n\t\t\t\t\tscaleX = scaleY;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscaleY = scaleX;\r\n\t\t\t\t}\r\n\t\t\t\tthis.handler.zoomHandler.zoomToPoint(new fabric.Point(center.left, center.top), scaleX);\r\n\t\t\t}\r\n\t\t\tcanvas.centerObject(this.handler.workarea);\r\n\t\t\tcanvas.renderAll();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (isElement) {\r\n\t\t\tthis.handler.workarea.set({\r\n\t\t\t\twidth: _element.width,\r\n\t\t\t\theight: _element.height,\r\n\t\t\t\tscaleX,\r\n\t\t\t\tscaleY,\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tconst width = isFixed ? workareaWidth : this.handler.canvas.getWidth();\r\n\t\t\tconst height = isFixed ? workareaHeight : this.handler.canvas.getHeight();\r\n\t\t\tthis.handler.workarea.set({\r\n\t\t\t\twidth,\r\n\t\t\t\theight,\r\n\t\t\t\tbackgroundColor: 'rgba(255, 255, 255, 1)',\r\n\t\t\t});\r\n\t\t\tthis.handler.canvas.renderAll();\r\n\t\t\tif (isFixed) {\r\n\t\t\t\tcanvas.centerObject(this.handler.workarea);\r\n\t\t\t} else {\r\n\t\t\t\tthis.handler.workarea.set({\r\n\t\t\t\t\tleft: 0,\r\n\t\t\t\t\ttop: 0,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\tcanvas.centerObject(this.handler.workarea);\r\n\t\tconst center = canvas.getCenter();\r\n\t\tcanvas.setViewportTransform([1, 0, 0, 1, 0, 0]);\r\n\t\tthis.handler.zoomHandler.zoomToPoint(new fabric.Point(center.left, center.top), 1);\r\n\t\tcanvas.renderAll();\r\n\t};\r\n\r\n\t/**\r\n\t * Set the responsive image on Workarea\r\n\t * @param {string | File} [source]\r\n\t * @param {boolean} [loaded]\r\n\t * @returns\r\n\t */\r\n\tpublic setResponsiveImage = async (source: string | File, loaded?: boolean) => {\r\n\t\tconst imageFromUrl = async (src: string = '') => {\r\n\t\t\treturn new Promise(resolve => {\r\n\t\t\t\tfabric.Image.fromURL(src, (img: any) => {\r\n\t\t\t\t\tconst { canvas, workarea, editable } = this.handler;\r\n\t\t\t\t\tconst { workareaWidth, workareaHeight } = workarea;\r\n\t\t\t\t\tconst { scaleX, scaleY } = this.calculateScale(img);\r\n\t\t\t\t\tif (img._element) {\r\n\t\t\t\t\t\tworkarea.set({\r\n\t\t\t\t\t\t\t...img,\r\n\t\t\t\t\t\t\tisElement: true,\r\n\t\t\t\t\t\t\tselectable: false,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconst image = new Image(workareaWidth, workareaHeight);\r\n\t\t\t\t\t\tworkarea.setElement(image);\r\n\t\t\t\t\t\tworkarea.set({\r\n\t\t\t\t\t\t\tisElement: false,\r\n\t\t\t\t\t\t\tselectable: false,\r\n\t\t\t\t\t\t\twidth: workareaWidth,\r\n\t\t\t\t\t\t\theight: workareaHeight,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (editable && !loaded) {\r\n\t\t\t\t\t\tcanvas.getObjects().forEach(obj => {\r\n\t\t\t\t\t\t\tconst { id, player } = obj as VideoObject;\r\n\t\t\t\t\t\t\tif (id !== 'workarea') {\r\n\t\t\t\t\t\t\t\tconst objWidth = obj.width * scaleX;\r\n\t\t\t\t\t\t\t\tconst objHeight = obj.height * scaleY;\r\n\t\t\t\t\t\t\t\tconst el = this.handler.elementHandler.findById(id);\r\n\t\t\t\t\t\t\t\tthis.handler.elementHandler.setScaleOrAngle(el, obj);\r\n\t\t\t\t\t\t\t\tthis.handler.elementHandler.setSize(el, obj);\r\n\t\t\t\t\t\t\t\tif (player) {\r\n\t\t\t\t\t\t\t\t\tplayer.setPlayerSize(objWidth, objHeight);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tobj.set({\r\n\t\t\t\t\t\t\t\t\tscaleX: 1,\r\n\t\t\t\t\t\t\t\t\tscaleY: 1,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\tobj.setCoords();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// 파일이 없을 경우 Canvas의 nextWidth, nextHeight 값이 변경되기 전 상태에서 zoomToFit이 동작함\r\n\t\t\t\t\t// 정상 동작 resize event logic => zoomToFit\r\n\t\t\t\t\t// 현재 동작 zoomToFit -> resize event logic\r\n\t\t\t\t\tthis.handler.zoomHandler.zoomToFit();\r\n\t\t\t\t\tcanvas.centerObject(workarea);\r\n\t\t\t\t\tresolve(workarea);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\t\tconst { workarea } = this.handler;\r\n\t\tif (!source) {\r\n\t\t\tworkarea.set({\r\n\t\t\t\tsrc: null,\r\n\t\t\t\tfile: null,\r\n\t\t\t});\r\n\t\t\treturn imageFromUrl(source as string);\r\n\t\t}\r\n\t\tif (source instanceof File) {\r\n\t\t\treturn new Promise(resolve => {\r\n\t\t\t\tconst reader = new FileReader();\r\n\t\t\t\treader.onload = () => {\r\n\t\t\t\t\tworkarea.set({\r\n\t\t\t\t\t\tfile: source,\r\n\t\t\t\t\t});\r\n\t\t\t\t\timageFromUrl(reader.result as string).then(resolve);\r\n\t\t\t\t};\r\n\t\t\t\treader.readAsDataURL(source);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tworkarea.set({\r\n\t\t\t\tsrc: source,\r\n\t\t\t});\r\n\t\t\treturn imageFromUrl(source);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Set the image on Workarea\r\n\t * @param {string | File} source\r\n\t * @param {boolean} [loaded=false]\r\n\t * @returns\r\n\t */\r\n\tsetImage = async (source: string | File, loaded = false) => {\r\n\t\tlet objects = this.handler.canvas.getObjects(\"image\");\r\n\t\tif(objects.length == 0){\r\n\t\t\t// this.handler.workareaHandler.initialize();\r\n\t\t\tthis.handler.canvas.add(this.handler.workarea);\r\n\t\t\tthis.handler.objects = this.handler.getObjects();\r\n\t\t\tthis.handler.canvas.centerObject(this.handler.workarea);\r\n\t\t\tthis.handler.canvas.renderAll();\r\n\t\t\tobjects = this.handler.canvas.getObjects(\"image\");\r\n\t\t\tthis.handler.canvas.sendToBack(objects[0])\r\n\t\t}\r\n\t\tconst { canvas, workarea, editable } = this.handler;\r\n\t\tif (workarea.layout === 'responsive') {\r\n\t\t\treturn this.setResponsiveImage(source, loaded);\r\n\t\t}\r\n\t\tconst imageFromUrl = async (src: string) => {\r\n\t\t\treturn new Promise(resolve => {\r\n\t\t\t\tfabric.Image.fromURL(src, (img: any) => {\r\n\t\t\t\t\tlet width = canvas.getWidth();\r\n\t\t\t\t\tlet height = canvas.getHeight();\r\n\t\t\t\t\tif (workarea.layout === 'fixed') {\r\n\t\t\t\t\t\twidth = workarea.width * workarea.scaleX;\r\n\t\t\t\t\t\theight = workarea.height * workarea.scaleY;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlet scaleX = 1;\r\n\t\t\t\t\tlet scaleY = 1;\r\n\t\t\t\t\tif (img._element) {\r\n\t\t\t\t\t\t// scaleX = width / img.width;\r\n\t\t\t\t\t\t// scaleY = height / img.height;}\r\n\t\t\t\t\t\timg.set({\r\n\t\t\t\t\t\t\toriginX: 'left',\r\n\t\t\t\t\t\t\toriginY: 'top',\r\n\t\t\t\t\t\t\tscaleX,\r\n\t\t\t\t\t\t\tscaleY,\r\n\t\t\t\t\t\t\topacity: 0.5\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tworkarea.set({\r\n\t\t\t\t\t\t\t...img,\r\n\t\t\t\t\t\t\tisElement: true,\r\n\t\t\t\t\t\t\tselectable: false,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tworkarea.setElement(new Image());\r\n\t\t\t\t\t\tworkarea.set({\r\n\t\t\t\t\t\t\twidth,\r\n\t\t\t\t\t\t\theight,\r\n\t\t\t\t\t\t\tscaleX,\r\n\t\t\t\t\t\t\tscaleY,\r\n\t\t\t\t\t\t\tisElement: false,\r\n\t\t\t\t\t\t\tselectable: false,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcanvas.centerObject(workarea);\r\n\t\t\t\t\tif (editable && !loaded) {\r\n\t\t\t\t\t\tconst { layout } = workarea;\r\n\t\t\t\t\t\tcanvas.getObjects().forEach(obj => {\r\n\t\t\t\t\t\t\tconst { id, player } = obj as VideoObject;\r\n\t\t\t\t\t\t\tif (id !== 'workarea') {\r\n\t\t\t\t\t\t\t\tscaleX = layout === 'fullscreen' ? scaleX : obj.scaleX;\r\n\t\t\t\t\t\t\t\tscaleY = layout === 'fullscreen' ? scaleY : obj.scaleY;\r\n\t\t\t\t\t\t\t\tconst el = this.handler.elementHandler.findById(id);\r\n\t\t\t\t\t\t\t\tthis.handler.elementHandler.setSize(el, obj);\r\n\t\t\t\t\t\t\t\tif (player) {\r\n\t\t\t\t\t\t\t\t\tconst objWidth = obj.width * scaleX;\r\n\t\t\t\t\t\t\t\t\tconst objHeight = obj.height * scaleY;\r\n\t\t\t\t\t\t\t\t\tplayer.setPlayerSize(objWidth, objHeight);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tobj.set({\r\n\t\t\t\t\t\t\t\t\tscaleX,\r\n\t\t\t\t\t\t\t\t\tscaleY,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\tobj.setCoords();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\tconst center = canvas.getCenter();\r\n\t\t\t\t\tconst zoom = loaded || workarea.layout === 'fullscreen' ? 1 : this.handler.canvas.getZoom();\r\n\t\t\t\t\tcanvas.setViewportTransform([1, 0, 0, 1, 0, 0]);\r\n\t\t\t\t\tthis.handler.zoomHandler.zoomToPoint(new fabric.Point(center.left, center.top), zoom);\r\n\t\t\t\t\tcanvas.renderAll();\r\n\t\t\t\t\tresolve(workarea);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\t\tif (!source) {\r\n\t\t\tobjects.forEach(work => {\r\n\t\t\t\tthis.handler.canvas.remove(work);\r\n\t\t\t});\r\n\t\t}\r\n\t\tif (source instanceof File) {\r\n\t\t\treturn new Promise(resolve => {\r\n\t\t\t\tconst reader = new FileReader();\r\n\t\t\t\treader.onload = () => {\r\n\t\t\t\t\tworkarea.set({\r\n\t\t\t\t\t\tfile: source,\r\n\t\t\t\t\t});\r\n\t\t\t\t\timageFromUrl(reader.result as string).then(resolve);\r\n\t\t\t\t};\r\n\t\t\t\treader.readAsDataURL(source);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tworkarea.set({\r\n\t\t\t\tsrc: source,\r\n\t\t\t});\r\n\t\t\treturn imageFromUrl(source);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Calculate scale to the image\r\n\t *\r\n\t * @param {FabricImage} [image]\r\n\t * @returns\r\n\t */\r\n\tpublic calculateScale = (image?: FabricImage) => {\r\n\t\tconst { canvas, workarea } = this.handler;\r\n\t\tconst { workareaWidth, workareaHeight } = workarea;\r\n\t\tconst { _element } = image || workarea;\r\n\t\tconst width = _element?.width || workareaWidth;\r\n\t\tconst height = _element?.height || workareaHeight;\r\n\t\tlet scaleX = canvas.getWidth() / width;\r\n\t\tlet scaleY = canvas.getHeight() / height;\r\n\t\tif (height >= width) {\r\n\t\t\tscaleX = scaleY;\r\n\t\t\tif (canvas.getWidth() < width * scaleX) {\r\n\t\t\t\tscaleX = scaleX * (canvas.getWidth() / (width * scaleX));\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tscaleY = scaleX;\r\n\t\t\tif (canvas.getHeight() < height * scaleX) {\r\n\t\t\t\tscaleX = scaleX * (canvas.getHeight() / (height * scaleX));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn { scaleX, scaleY };\r\n\t};\r\n}\r\n\r\nexport default WorkareaHandler;\r\n","\r\nimport { configureStore } from '@reduxjs/toolkit'\r\n\r\nimport designerPropertiesReducer from \"./designerPropertiesSlice\";\r\n\r\nexport default configureStore({\r\n reducer: {\r\n properties: designerPropertiesReducer\r\n },\r\n})\r\n","import { fabric } from \"fabric\";\r\n\r\nimport Handler from \"./Handler\";\r\nimport { FabricObject, CustomObjectType } from \"../utils\";\r\nimport store from \"../../../redux/store\";\r\n\r\ntype IReturnType = { selectable?: boolean; evented?: boolean } | boolean;\r\n\r\nclass InteractionHandler {\r\n handler: Handler;\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n if (this.handler.editable) {\r\n this.selection();\r\n }\r\n }\r\n\r\n /**\r\n * Change selection mode\r\n * @param {(obj: FabricObject) => IReturnType} [callback]\r\n */\r\n public selection = (callback?: (obj: FabricObject) => IReturnType) => {\r\n const {\r\n properties: { zoneActive },\r\n } = store.getState();\r\n if(this.handler.interactionMode === \"blocker\" ) return;\r\n if (this.handler.interactionMode === \"selection\") {\r\n return;\r\n }\r\n this.handler.interactionMode = \"selection\";\r\n if (typeof this.handler.canvasOption.selection === \"undefined\") {\r\n this.handler.canvas.selection = true;\r\n } else {\r\n this.handler.canvas.selection = this.handler.canvasOption.selection;\r\n }\r\n this.handler.canvas.defaultCursor = \"default\";\r\n this.handler.workarea.hoverCursor = \"default\";\r\n this.handler.getObjects().forEach((obj) => {\r\n if (callback) {\r\n this.interactionCallback(obj, callback);\r\n } else {\r\n // When typeof selection is ActiveSelection, ignoring selectable, because link position left: 0, top: 0\r\n\r\n if (obj.superType === \"link\" || obj.superType === \"port\") {\r\n obj.selectable = false;\r\n obj.evented = true;\r\n obj.hoverCursor = \"pointer\";\r\n return;\r\n }\r\n if(obj.superType === \"polygonZone\" && zoneActive){\r\n obj.hoverCursor = \"move\";\r\n obj.selectable = false;\r\n obj.evented = true;\r\n }\r\n else if(obj.superType === \"polygonZone\" && !zoneActive){\r\n obj.hoverCursor = \"move\";\r\n obj.selectable = true;\r\n obj.evented = true;\r\n }else{\r\n obj.hoverCursor = \"move\";\r\n obj.selectable = true;\r\n obj.evented = true;\r\n }\r\n }\r\n });\r\n this.handler.canvas.renderAll();\r\n };\r\n\r\n public seatSelection = (callback?: (obj: FabricObject) => IReturnType) => {\r\n const {\r\n properties: { zoneActive },\r\n } = store.getState();\r\n if (this.handler.interactionMode === \"seatSelection\") {\r\n return;\r\n }\r\n this.handler.interactionMode = \"seatSelection\";\r\n if (typeof this.handler.canvasOption.selection === \"undefined\") {\r\n this.handler.canvas.selection = true;\r\n } else {\r\n this.handler.canvas.selection = this.handler.canvasOption.selection;\r\n }\r\n this.handler.canvas.defaultCursor = \"default\";\r\n this.handler.workarea.hoverCursor = \"default\";\r\n this.handler.getObjects().forEach((obj) => {\r\n if (callback) {\r\n this.interactionCallback(obj, callback);\r\n } else {\r\n if(zoneActive) return;\r\n obj.hoverCursor = \"move\";\r\n obj.selectable = true;\r\n obj.evented = true;\r\n }\r\n });\r\n this.handler.canvas.renderAll();\r\n };\r\n\r\n /**\r\n * Change grab mode\r\n * @param {(obj: FabricObject) => IReturnType} [callback]\r\n */\r\n public grab = (callback?: (obj: FabricObject) => IReturnType) => {\r\n if (this.handler.interactionMode === \"grab\") {\r\n return;\r\n }\r\n this.handler.interactionMode = \"grab\";\r\n this.handler.canvas.selection = false;\r\n this.handler.canvas.defaultCursor = \"grab\";\r\n this.handler.workarea.hoverCursor = \"grab\";\r\n this.handler.getObjects().forEach((obj) => {\r\n if (callback) {\r\n this.interactionCallback(obj, callback);\r\n } else {\r\n obj.selectable = false;\r\n obj.evented = this.handler.editable ? false : true;\r\n }\r\n });\r\n this.handler.canvas.renderAll();\r\n };\r\n\r\n /**\r\n * Change drawing mode\r\n * @param {CustomObjectType} [type]\r\n * @param {(obj: FabricObject) => IReturnType} [callback]\r\n */\r\n public drawing = (\r\n objectType?: CustomObjectType,\r\n cursor = \"pointer\",\r\n callback?: (obj: FabricObject) => IReturnType\r\n ) => {\r\n if (this.isDrawingMode()) {\r\n return;\r\n }\r\n this.handler.interactionMode = \"drawing\";\r\n this.handler.selectedObject = objectType;\r\n this.handler.canvas.selection = false;\r\n this.handler.canvas.defaultCursor = cursor;\r\n this.handler.workarea.hoverCursor = cursor;\r\n this.handler.getObjects().forEach((obj) => {\r\n if (callback) {\r\n this.interactionCallback(obj, callback);\r\n } else {\r\n obj.selectable = false;\r\n obj.evented = this.handler.editable ? false : true;\r\n }\r\n });\r\n this.handler.canvas.renderAll();\r\n };\r\n\r\n public linking = (callback?: (obj: FabricObject) => IReturnType) => {\r\n if (this.isDrawingMode()) {\r\n return;\r\n }\r\n this.handler.interactionMode = \"link\";\r\n this.handler.canvas.selection = false;\r\n this.handler.canvas.defaultCursor = \"default\";\r\n this.handler.workarea.hoverCursor = \"default\";\r\n this.handler.getObjects().forEach((obj) => {\r\n if (callback) {\r\n this.interactionCallback(obj, callback);\r\n } else {\r\n if (obj.superType === \"node\" || obj.superType === \"port\") {\r\n obj.hoverCursor = \"pointer\";\r\n obj.selectable = false;\r\n obj.evented = true;\r\n return;\r\n }\r\n obj.selectable = false;\r\n obj.evented = this.handler.editable ? false : true;\r\n }\r\n });\r\n this.handler.canvas.renderAll();\r\n };\r\n\r\n /**\r\n * Moving objects in grap mode\r\n * @param {any} e\r\n */\r\n public moving = (e: any) => {\r\n if (this.isDrawingMode()) {\r\n return;\r\n }\r\n\r\n let delta;\r\n if (e instanceof TouchEvent) {\r\n // we're on mobile\r\n const { clientX, clientY } = e.touches[0];\r\n delta = new fabric.Point(clientX - this.handler.eventHandler.prevX, clientY - this.handler.eventHandler.prevY);\r\n this.handler.eventHandler.prevX = clientX;\r\n this.handler.eventHandler.prevY = clientY;\r\n } else {\r\n // we're on desktop\r\n delta = new fabric.Point(e.movementX, e.movementY);\r\n }\r\n\r\n this.handler.canvas.relativePan(delta);\r\n this.handler.canvas.requestRenderAll();\r\n this.handler.objects.forEach((obj) => {\r\n if (obj.superType === \"element\") {\r\n const { id } = obj;\r\n const el = this.handler.elementHandler.findById(id);\r\n // update the element\r\n this.handler.elementHandler.setPosition(el, obj);\r\n }\r\n });\r\n };\r\n\r\n /**\r\n * Whether is drawing mode\r\n * @returns\r\n */\r\n public isDrawingMode = () => {\r\n return this.handler.interactionMode === \"link\";\r\n };\r\n\r\n /**\r\n * Interaction callback\r\n *\r\n * @param {FabricObject} obj\r\n * @param {(obj: FabricObject) => void} [callback]\r\n */\r\n private interactionCallback = (\r\n obj: FabricObject,\r\n callback?: (obj: FabricObject) => void\r\n ) => {\r\n callback(obj);\r\n };\r\n}\r\n\r\nexport default InteractionHandler;\r\n","import { fabric } from 'fabric';\r\n\r\nimport Handler from './Handler';\r\nimport { FabricObject } from '../utils';\r\nimport { NodeObject } from '../objects/fabric/Node';\r\n\r\nclass GridHandler {\r\n\thandler?: Handler;\r\n\r\n\tconstructor(handler: Handler) {\r\n\t\tthis.handler = handler;\r\n\t\tthis.initialize();\r\n\t}\r\n\r\n\t/**\r\n\t * Init grid\r\n\t *\r\n\t */\r\n\tpublic initialize = () => {\r\n\t\tconst { grid, lineColor, borderColor, enabled } = this.handler.gridOption;\r\n\t\tif (enabled && grid) {\r\n\t\t\tconst width = 5000;\r\n\t\t\tconst gridLength = width / grid;\r\n\t\t\tconst lineOptions = {\r\n\t\t\t\tstroke: lineColor,\r\n\t\t\t\tselectable: false,\r\n\t\t\t\tevented: false,\r\n\t\t\t\tid: 'grid',\r\n\t\t\t};\r\n\t\t\tfor (let i = 0; i < gridLength; i++) {\r\n\t\t\t\tconst distance = i * grid;\r\n\t\t\t\tconst fhorizontal = new fabric.Line([distance, -width, distance, width], lineOptions);\r\n\t\t\t\tconst shorizontal = new fabric.Line([distance - width, -width, distance - width, width], lineOptions);\r\n\t\t\t\tthis.handler.canvas.add(fhorizontal);\r\n\t\t\t\tthis.handler.canvas.add(shorizontal);\r\n\t\t\t\tconst fvertical = new fabric.Line([-width, distance - width, width, distance - width], lineOptions);\r\n\t\t\t\tconst svertical = new fabric.Line([-width, distance, width, distance], lineOptions);\r\n\t\t\t\tthis.handler.canvas.add(fvertical);\r\n\t\t\t\tthis.handler.canvas.add(svertical);\r\n\t\t\t\tif (i % 5 === 0) {\r\n\t\t\t\t\tfhorizontal.set({ stroke: borderColor });\r\n\t\t\t\t\tshorizontal.set({ stroke: borderColor });\r\n\t\t\t\t\tfvertical.set({ stroke: borderColor });\r\n\t\t\t\t\tsvertical.set({ stroke: borderColor });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Set coords in grid\r\n\t * @param {(FabricObject | fabric.ActiveSelection)} target\r\n\t * @returns\r\n\t */\r\n\tpublic setCoords = (target: FabricObject | fabric.ActiveSelection) => {\r\n\t\tconst {\r\n\t\t\tgridOption: { enabled, grid, snapToGrid },\r\n\t\t} = this.handler;\r\n\t\tif (enabled && grid && snapToGrid) {\r\n\t\t\tif (target.type === 'activeSelection') {\r\n\t\t\t\tconst activeSelection = target as fabric.ActiveSelection;\r\n\t\t\t\tactiveSelection.set({\r\n\t\t\t\t\tleft: Math.round(target.left / grid) * grid,\r\n\t\t\t\t\ttop: Math.round(target.top / grid) * grid,\r\n\t\t\t\t});\r\n\t\t\t\tactiveSelection.setCoords();\r\n\t\t\t\tactiveSelection.getObjects().forEach((obj: any) => {\r\n\t\t\t\t\tif (obj.superType === 'node') {\r\n\t\t\t\t\t\tconst left = target.left + obj.left + target.width / 2;\r\n\t\t\t\t\t\tconst top = target.top + obj.top + target.height / 2;\r\n\t\t\t\t\t\tthis.handler.portHandler.setCoords({ ...obj, left, top });\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst obj = target as FabricObject;\r\n\t\t\tobj.set({\r\n\t\t\t\tleft: Math.round(target.left / grid) * grid,\r\n\t\t\t\ttop: Math.round(target.top / grid) * grid,\r\n\t\t\t});\r\n\t\t\ttarget.setCoords();\r\n\t\t\tthis.handler.portHandler.setCoords(target as NodeObject);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default GridHandler;\r\n","import Handler from './Handler';\r\nimport { NodeObject } from '../objects/fabric/Node';\r\nimport { PortObject } from '../objects/fabric/Port';\r\n\r\nclass PortHandler {\r\n\thandler?: Handler;\r\n\r\n\tconstructor(handler: Handler) {\r\n\t\tthis.handler = handler;\r\n\t}\r\n\r\n\t/**\r\n\t * Create port\r\n\t * @param {NodeObject} target\r\n\t */\r\n\tcreate = (target: NodeObject) => {\r\n\t\tif (!target.createToPort) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst toPort = target.createToPort(target.left + target.width / 2, target.top);\r\n\t\tif (toPort) {\r\n\t\t\ttoPort.on('mouseover', () => {\r\n\t\t\t\tif (\r\n\t\t\t\t\tthis.handler.interactionMode === 'link' &&\r\n\t\t\t\t\tthis.handler.activeLine &&\r\n\t\t\t\t\tthis.handler.activeLine.class === 'line'\r\n\t\t\t\t) {\r\n\t\t\t\t\tif (toPort.links.some(link => link.fromNode === this.handler.activeLine.fromNode)) {\r\n\t\t\t\t\t\ttoPort.set({\r\n\t\t\t\t\t\t\tfill: 'red',\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.handler.canvas.renderAll();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttoPort.set({\r\n\t\t\t\t\t\tfill: 'green',\r\n\t\t\t\t\t});\r\n\t\t\t\t\tthis.handler.canvas.renderAll();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\ttoPort.on('mouseout', () => {\r\n\t\t\t\ttoPort.set({\r\n\t\t\t\t\tfill: toPort.originFill,\r\n\t\t\t\t});\r\n\t\t\t\tthis.handler.canvas.renderAll();\r\n\t\t\t});\r\n\t\t\tthis.handler.canvas.add(toPort);\r\n\t\t\ttoPort.setCoords();\r\n\t\t\tthis.handler.canvas.bringToFront(toPort);\r\n\t\t}\r\n\t\tconst fromPort = target.createFromPort(target.left + target.width / 2, target.top + target.height);\r\n\t\tif (fromPort && fromPort.length) {\r\n\t\t\tfromPort.forEach(port => {\r\n\t\t\t\tif (port) {\r\n\t\t\t\t\tport.on('mouseover', () => {\r\n\t\t\t\t\t\tif (this.handler.interactionMode !== 'link') {\r\n\t\t\t\t\t\t\tif (port.enabled) {\r\n\t\t\t\t\t\t\t\tif (this.handler.activeLine) {\r\n\t\t\t\t\t\t\t\t\tport.set({\r\n\t\t\t\t\t\t\t\t\t\tfill: 'red',\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\tthis.handler.canvas.renderAll();\r\n\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tport.set({\r\n\t\t\t\t\t\t\t\t\tfill: 'green',\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\tthis.handler.canvas.renderAll();\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tport.set({\r\n\t\t\t\t\t\t\t\tfill: 'red',\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tthis.handler.canvas.renderAll();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tport.on('mouseout', () => {\r\n\t\t\t\t\t\tif (this.handler.interactionMode !== 'link') {\r\n\t\t\t\t\t\t\tport.set({\r\n\t\t\t\t\t\t\t\tfill: port.enabled ? port.originFill : port.hoverFill,\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.handler.canvas.renderAll();\r\n\t\t\t\t\t});\r\n\t\t\t\t\tthis.handler.canvas.add(port);\r\n\t\t\t\t\tport.setCoords();\r\n\t\t\t\t\tthis.handler.canvas.bringToFront(port);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Set coords port\r\n\t * @param {NodeObject} target\r\n\t */\r\n\tsetCoords = (target: NodeObject) => {\r\n\t\tif (target.toPort) {\r\n\t\t\tconst toCoords = {\r\n\t\t\t\tleft: target.left + target.width / 2,\r\n\t\t\t\ttop: target.top,\r\n\t\t\t};\r\n\t\t\ttarget.toPort.set({\r\n\t\t\t\t...toCoords,\r\n\t\t\t});\r\n\t\t\ttarget.toPort.setCoords();\r\n\t\t\tif (target.toPort.links.length) {\r\n\t\t\t\ttarget.toPort.links.forEach(link => {\r\n\t\t\t\t\tconst fromPort = link.fromNode.fromPort.filter(port => port.id === link.fromPort.id)[0];\r\n\t\t\t\t\tthis.handler.linkHandler.setCoords(fromPort.left, fromPort.top, toCoords.left, toCoords.top, link);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (target.fromPort) {\r\n\t\t\tconst fromCoords = {\r\n\t\t\t\tleft: target.left + target.width / 2,\r\n\t\t\t\ttop: target.top + target.height,\r\n\t\t\t};\r\n\t\t\ttarget.fromPort.forEach(port => {\r\n\t\t\t\tconst left = port.leftDiff ? fromCoords.left + port.leftDiff : fromCoords.left;\r\n\t\t\t\tconst top = port.topDiff ? fromCoords.top + port.topDiff : fromCoords.top;\r\n\t\t\t\tport.set({\r\n\t\t\t\t\tleft,\r\n\t\t\t\t\ttop,\r\n\t\t\t\t});\r\n\t\t\t\tport.setCoords();\r\n\t\t\t\tif (port.links.length) {\r\n\t\t\t\t\tport.links.forEach(link => {\r\n\t\t\t\t\t\tthis.handler.linkHandler.setCoords(\r\n\t\t\t\t\t\t\tleft,\r\n\t\t\t\t\t\t\ttop,\r\n\t\t\t\t\t\t\tlink.toNode.toPort.left,\r\n\t\t\t\t\t\t\tlink.toNode.toPort.top,\r\n\t\t\t\t\t\t\tlink,\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Recreate port\r\n\t * @param {NodeObject} target\r\n\t */\r\n\trecreate = (target: NodeObject) => {\r\n\t\tconst { fromPort, toPort } = target;\r\n\t\tconst ports = target.ports as PortObject[];\r\n\t\tif (ports) {\r\n\t\t\tports.forEach(port => {\r\n\t\t\t\ttarget.removeWithUpdate(port);\r\n\t\t\t\tthis.handler.canvas.remove(port.fromPort);\r\n\t\t\t});\r\n\t\t}\r\n\t\tthis.handler.canvas.remove(target.toPort);\r\n\t\tif (target.toPort) {\r\n\t\t\ttarget.toPort.links.forEach(link => {\r\n\t\t\t\tthis.handler.linkHandler.remove(link, 'from');\r\n\t\t\t});\r\n\t\t}\r\n\t\tif (target.fromPort) {\r\n\t\t\ttarget.fromPort.forEach((port: any) => {\r\n\t\t\t\tif (port.links.length) {\r\n\t\t\t\t\tport.links.forEach((link: any) => {\r\n\t\t\t\t\t\tthis.handler.linkHandler.remove(link, 'to');\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tthis.create(target);\r\n\t\ttoPort.links.forEach((link: any) => {\r\n\t\t\tlink.fromNode = link.fromNode.id;\r\n\t\t\tlink.fromPort = link.fromPort.id;\r\n\t\t\tlink.toNode = target.toPort.nodeId;\r\n\t\t\tlink.toPort = target.toPort.id;\r\n\t\t\tthis.handler.linkHandler.create(link);\r\n\t\t});\r\n\t\tfromPort\r\n\t\t\t.filter(op => target.fromPort.some(np => np.id === op.id))\r\n\t\t\t.forEach(port => {\r\n\t\t\t\tport.links.forEach((link: any) => {\r\n\t\t\t\t\tif (link.fromPort.id === port.id) {\r\n\t\t\t\t\t\tlink.fromNode = port.nodeId;\r\n\t\t\t\t\t\tlink.fromPort = port.id;\r\n\t\t\t\t\t\tlink.toNode = link.toNode.id;\r\n\t\t\t\t\t\tlink.toPort = link.toPort.id;\r\n\t\t\t\t\t\tthis.handler.linkHandler.create(link);\r\n\t\t\t\t\t\tthis.setCoords(target);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t};\r\n}\r\n\r\nexport default PortHandler;\r\n","import { fabric } from 'fabric';\r\nimport 'gifler';\r\n\r\nconst Gif = fabric.util.createClass(fabric.Object, {\r\n type: 'gif',\r\n superType: 'image',\r\n gifCanvas: null,\r\n isStarted: false,\r\n initialize(options: any) {\r\n options = options || {};\r\n this.callSuper('initialize', options);\r\n this.gifCanvas = document.createElement('canvas');\r\n },\r\n drawFrame(ctx: CanvasRenderingContext2D, frame: any) {\r\n // update canvas size\r\n this.gifCanvas.width = frame.width;\r\n this.gifCanvas.height = frame.height;\r\n // update canvas that we are using for fabric.js\r\n ctx.drawImage(frame.buffer, -frame.width / 2, -frame.height / 2, frame.width, frame.height);\r\n },\r\n _render(ctx: CanvasRenderingContext2D) {\r\n this.callSuper('_render', ctx);\r\n if (!this.isStarted) {\r\n this.isStarted = true;\r\n window.gifler('./images/sample/earth.gif')\r\n .frames(this.gifCanvas, (_c: CanvasRenderingContext2D, frame: any) => {\r\n this.isStarted = true;\r\n this.drawFrame(ctx, frame);\r\n });\r\n }\r\n },\r\n});\r\n\r\nGif.fromObject = (options: any, callback: (obj: any) => any) => {\r\n return callback(new Gif(options));\r\n};\r\n\r\nwindow.fabric.Gif = Gif;\r\n\r\nexport default Gif;\r\n","import { fabric } from 'fabric';\r\n\r\nconst Arrow = fabric.util.createClass(fabric.Line, {\r\n type: 'arrow',\r\n superType: 'drawing',\r\n initialize(points: any, options: any) {\r\n if (!points) {\r\n const { x1, x2, y1, y2 } = options;\r\n points = [x1, y1, x2, y2];\r\n }\r\n options = options || {};\r\n this.callSuper('initialize', points, options);\r\n },\r\n _render(ctx: CanvasRenderingContext2D) {\r\n this.callSuper('_render', ctx);\r\n ctx.save();\r\n const xDiff = this.x2 - this.x1;\r\n const yDiff = this.y2 - this.y1;\r\n const angle = Math.atan2(yDiff, xDiff);\r\n ctx.translate((this.x2 - this.x1) / 2, (this.y2 - this.y1) / 2);\r\n ctx.rotate(angle);\r\n ctx.beginPath();\r\n // Move 5px in front of line to start the arrow so it does not have the square line end showing in front (0,0)\r\n ctx.moveTo(5, 0);\r\n ctx.lineTo(-5, 5);\r\n ctx.lineTo(-5, -5);\r\n ctx.closePath();\r\n ctx.fillStyle = this.stroke;\r\n ctx.fill();\r\n ctx.restore();\r\n },\r\n});\r\n\r\nArrow.fromObject = (options: any, callback: any) => {\r\n const { x1, x2, y1, y2 } = options;\r\n return callback(new Arrow([x1, y1, x2, y2], options));\r\n};\r\n\r\nwindow.fabric.Arrow = Arrow;\r\n\r\nexport default Arrow;\r\n","export enum Icons{\r\n check = ``,\r\n block = ``,\r\n companion = ``,\r\n restricted = ``,\r\n accesible = ``\r\n}","import { fabric } from \"fabric\";\r\n\r\nimport { IFilter } from \"../handlers/ImageHandler\";\r\n\r\nimport { Icons } from '../enums/SeatIcon'\r\n\r\nexport type AnimationType =\r\n | \"fade\"\r\n | \"bounce\"\r\n | \"shake\"\r\n | \"scaling\"\r\n | \"rotation\"\r\n | \"flash\"\r\n | \"custom\"\r\n | \"none\";\r\n\r\nexport interface AnimationProperty {\r\n delay?: number;\r\n duration?: number;\r\n autoplay?: boolean;\r\n loop?: boolean | number;\r\n type: AnimationType;\r\n offset?: number;\r\n opacity?: number;\r\n bounce?: \"vertical\" | \"horizontal\";\r\n shake?: \"vertical\" | \"horizontal\";\r\n scale?: number;\r\n angle?: number;\r\n fill?: string | fabric.Pattern;\r\n stroke?: string;\r\n}\r\n\r\nexport interface LinkProperty {\r\n enabled?: boolean;\r\n type?: string;\r\n state?: string;\r\n dashboard?: any;\r\n}\r\n\r\nexport interface TooltipProperty {\r\n enabled?: boolean;\r\n type?: string;\r\n template?: string;\r\n}\r\n\r\nexport interface TriggerProperty {\r\n enabled?: boolean;\r\n type?: string;\r\n script?: string;\r\n effect?: string;\r\n}\r\n\r\nexport interface FabricCanvasOption {\r\n wrapperEl?: HTMLElement;\r\n}\r\n\r\nexport type FabricCanvas = T &\r\n FabricCanvasOption;\r\n\r\nexport type FabricObjectOption = T & {\r\n /**\r\n * Object id\r\n * @type {string}\r\n */\r\n id?: string;\r\n /**\r\n * Parent object id\r\n * @type {string}\r\n */\r\n parentId?: string;\r\n /**\r\n * Original opacity\r\n * @type {number}\r\n */\r\n originOpacity?: number;\r\n /**\r\n * Original top position\r\n * @type {number}\r\n */\r\n originTop?: number;\r\n /**\r\n * Original left position\r\n * @type {number}\r\n */\r\n originLeft?: number;\r\n /**\r\n * Original scale X\r\n * @type {number}\r\n */\r\n originScaleX?: number;\r\n /**\r\n * Original scale Y\r\n * @type {number}\r\n */\r\n originScaleY?: number;\r\n /**\r\n * Original angle\r\n * @type {number}\r\n */\r\n originAngle?: number;\r\n /**\r\n * Original fill color\r\n * @type {(string | fabric.Pattern)}\r\n */\r\n originFill?: string | fabric.Pattern;\r\n /**\r\n * Original stroke color\r\n * @type {string}\r\n */\r\n originStroke?: string;\r\n /**\r\n * Original rotation\r\n *\r\n * @type {number}\r\n */\r\n originRotation?: number;\r\n /**\r\n * Object editable\r\n * @type {boolean}\r\n */\r\n editable?: boolean;\r\n /**\r\n * Object Super type\r\n * @type {string}\r\n */\r\n superType?: string;\r\n /**\r\n * @description\r\n * @type {string}\r\n */\r\n description?: string;\r\n /**\r\n * Animation property\r\n * @type {AnimationProperty}\r\n */\r\n animation?: AnimationProperty;\r\n /**\r\n * Anime instance\r\n * @type {anime.AnimeInstance}\r\n */\r\n anime?: anime.AnimeInstance;\r\n /**\r\n * Tooltip property\r\n * @type {TooltipProperty}\r\n */\r\n tooltip?: TooltipProperty;\r\n /**\r\n * Link property\r\n * @type {LinkProperty}\r\n */\r\n link?: LinkProperty;\r\n /**\r\n * Is running animation\r\n * @type {boolean}\r\n */\r\n animating?: boolean;\r\n /**\r\n * Object class\r\n * @type {string}\r\n */\r\n class?: string;\r\n /**\r\n * Is possible delete\r\n * @type {boolean}\r\n */\r\n deletable?: boolean;\r\n /**\r\n * Is enable double click\r\n * @type {boolean}\r\n */\r\n dblclick?: boolean;\r\n /**\r\n * Is possible clone\r\n * @type {boolean}\r\n */\r\n cloneable?: boolean;\r\n /**\r\n * Is locked object\r\n * @type {boolean}\r\n */\r\n locked?: boolean;\r\n /**\r\n * This property replaces \"angle\"\r\n *\r\n * @type {number}\r\n */\r\n rotation?: number;\r\n [key: string]: any;\r\n};\r\n\r\nexport type FabricObject = T &\r\n FabricObjectOption;\r\n\r\nexport type FabricGroup = FabricObject & {\r\n /**\r\n * Object that config group\r\n * @type {FabricObject[]}\r\n */\r\n objects?: FabricObject[];\r\n};\r\n\r\nexport type FabricImage = FabricObject &\r\n fabric.Image & {\r\n /**\r\n * Image URL\r\n * @type {string}\r\n */\r\n src?: string;\r\n /**\r\n * Image File or Blob\r\n * @type {File}\r\n */\r\n file?: File;\r\n /**\r\n * Image Filter\r\n * @type {IFilter[]}\r\n */\r\n filters?: IFilter[];\r\n _element?: any;\r\n };\r\n\r\nexport interface FabricElement extends FabricObject {\r\n /**\r\n * Wrapped Element\r\n * @type {HTMLDivElement}\r\n */\r\n container: HTMLDivElement;\r\n /**\r\n * Target Element\r\n * @type {HTMLDivElement}\r\n */\r\n element: HTMLDivElement;\r\n /**\r\n * Source of Element Object\r\n */\r\n setSource: (source: any) => void;\r\n}\r\n\r\nexport type WorkareaLayout = \"fixed\" | \"responsive\" | \"fullscreen\";\r\n\r\nexport interface WorkareaOption {\r\n /**\r\n * Image URL\r\n * @type {string}\r\n */\r\n src?: string;\r\n /**\r\n * Image File or Blbo\r\n * @type {File}\r\n */\r\n file?: File;\r\n /**\r\n * Workarea Width\r\n * @type {number}\r\n */\r\n width?: number;\r\n /**\r\n * Workarea Height\r\n * @type {number}\r\n */\r\n height?: number;\r\n /**\r\n * Workarea Background Color\r\n * @type {string}\r\n */\r\n backgroundColor?: string;\r\n /**\r\n * Workarea Layout Type\r\n * @type {WorkareaLayout}\r\n */\r\n layout?: WorkareaLayout;\r\n}\r\n\r\nexport type WorkareaObject = FabricImage & {\r\n /**\r\n * Workarea Layout Type\r\n * @type {WorkareaLayout}\r\n */\r\n layout?: WorkareaLayout;\r\n /**\r\n * Workarea Image Element\r\n * @type {HTMLImageElement}\r\n */\r\n _element?: HTMLImageElement;\r\n /**\r\n * Whether exist the element\r\n * @type {boolean}\r\n */\r\n isElement?: boolean;\r\n /**\r\n * Stored width in workarea\r\n * @type {number}\r\n */\r\n workareaWidth?: number;\r\n /**\r\n * Stored height in workarea\r\n * @type {number}\r\n */\r\n workareaHeight?: number;\r\n};\r\n\r\nexport interface CanvasOption extends fabric.ICanvasOptions {\r\n /**\r\n * Unique id of Canvas\r\n * @type {string}\r\n */\r\n id?: string;\r\n}\r\n\r\nexport interface GridOption {\r\n /**\r\n * Whether should be enabled\r\n * @type {boolean}\r\n */\r\n enabled?: boolean;\r\n /**\r\n * Grid interval\r\n * @type {number}\r\n */\r\n grid?: number;\r\n /**\r\n * When had moved object, whether should adjust position on grid interval\r\n * @type {boolean}\r\n */\r\n snapToGrid?: boolean;\r\n /**\r\n * Grid line color\r\n *\r\n * @type {string}\r\n */\r\n lineColor?: string;\r\n /**\r\n * Grid border color\r\n *\r\n * @type {string}\r\n */\r\n borderColor?: string;\r\n}\r\n\r\nexport interface GuidelineOption {\r\n /**\r\n * When have moved object, whether should show guideline\r\n * @type {boolean}\r\n */\r\n enabled?: boolean;\r\n}\r\n\r\nexport interface KeyEvent {\r\n /**\r\n * Arrow key\r\n * @type {boolean}\r\n */\r\n move?: boolean;\r\n /**\r\n * Ctrl + A\r\n * @type {boolean}\r\n */\r\n all?: boolean;\r\n /**\r\n * Ctrl + C\r\n * @type {boolean}\r\n */\r\n copy?: boolean;\r\n /**\r\n * Ctrl + P\r\n * @type {boolean}\r\n */\r\n paste?: boolean;\r\n /**\r\n * Escape\r\n * @type {boolean}\r\n */\r\n esc?: boolean;\r\n /**\r\n * Delete or Backspace\r\n * @type {boolean}\r\n */\r\n del?: boolean;\r\n /**\r\n * When have copied object, whether should copy object option on clipboard\r\n * @type {boolean}\r\n */\r\n clipboard?: boolean;\r\n /**\r\n * Ctrl + Z, Ctrl + Y\r\n * @type {boolean}\r\n */\r\n transaction?: boolean;\r\n /**\r\n * Plus, Minus\r\n *\r\n * @type {boolean}\r\n */\r\n zoom?: boolean;\r\n /**\r\n * Ctrl + X\r\n *\r\n * @type {boolean}\r\n */\r\n cut?: boolean;\r\n}\r\n\r\nexport type InteractionMode =\r\n | \"selection\"\r\n | \"grab\"\r\n | \"drawing\"\r\n | \"link\"\r\n | \"crop\"\r\n | \"preview\"\r\n | \"selector\"\r\n | \"seatSelection\"\r\n | \"blocker\"\r\n | \"channel\"\r\n | \"detail\";\r\n\r\nexport interface FabricEvent\r\n extends Omit {\r\n e: T;\r\n target?: FabricObject;\r\n subTargets?: FabricObject[];\r\n button?: number;\r\n isClick?: boolean;\r\n pointer?: fabric.Point;\r\n absolutePointer?: fabric.Point;\r\n transform?: {\r\n corner: string;\r\n original: FabricObject;\r\n originX: string;\r\n originY: string;\r\n width: number;\r\n };\r\n}\r\n\r\nexport type FabricObjects = {\r\n [key: string]: {\r\n create: (...args: any) => FabricObject;\r\n };\r\n};\r\n\r\n/**\r\n * toObject util\r\n * @param {*} obj\r\n * @param {string[]} propertiesToInclude\r\n * @param {{ [key: string]: any }} [properties]\r\n */\r\nexport const toObject = (\r\n obj: any,\r\n propertiesToInclude: string[],\r\n properties?: { [key: string]: any }\r\n) =>\r\n fabric.util.object.extend(\r\n obj.callSuper(\"toObject\"),\r\n propertiesToInclude.reduce(\r\n (prev, property) =>\r\n Object.assign(prev, {\r\n [property]: obj.get(property),\r\n }),\r\n Object.assign({}, properties)\r\n )\r\n );\r\n\r\nexport interface IObjectDesingner {\r\n onInit(): any;\r\n onMousedown(event: FabricEvent): any;\r\n onMousemove(event: FabricEvent): any;\r\n onMouseup(event: FabricEvent): any;\r\n onMouseDblClick(event: FabricEvent): any;\r\n onRotated(event: FabricEvent): any;\r\n updateProperties(\r\n propertyName: string,\r\n newValue: any,\r\n allValuesForm: any,\r\n selectedItem: any\r\n ): any;\r\n}\r\n\r\nexport interface IObjectPreview {\r\n onHover(event: FabricEvent): any;\r\n}\r\n\r\nexport interface IObjectSelector {\r\n onHover(event: FabricEvent): any;\r\n onSelect(event: FabricEvent): any;\r\n onChangeHub(valueHub: any): any;\r\n}\r\n\r\nexport interface IObjectBlocker {\r\n onHover(event: FabricEvent): any;\r\n onSelect(event: FabricEvent): any;\r\n onSelection(event: FabricEvent): any;\r\n onChangeHub(valueHub: any): any;\r\n onSaveChanges(): any;\r\n}\r\n\r\nexport interface IObjectChannel {\r\n onHover(event: FabricEvent): any;\r\n onSelect(event: FabricEvent): any;\r\n onSelection(event: FabricEvent): any;\r\n onChangeHub(valueHub: any): any;\r\n onSaveChanges(): any;\r\n}\r\n\r\nexport interface IObjectDetail {\r\n onHover(event: FabricEvent): any;\r\n onChangeHub(valueHub: any): any;\r\n}\r\n\r\nexport type CustomObjectType =\r\n | \"row\"\r\n | \"multipleRows\"\r\n | \"circularTable\"\r\n | \"rectTable\"\r\n | \"polygon\"\r\n | \"line\"\r\n | \"arrow\"\r\n | \"ellipse\"\r\n | \"circle\"\r\n | \"rect\"\r\n | \"triangle\"\r\n | \"circleZone\"\r\n | \"rectangleZone\"\r\n | \"polygonZone\"\r\n | \"text\"\r\n | \"svg\"\r\n | \"activeSelection\";\r\n\r\nexport const getSvgObject = ( icon: string, size: number, fill: string) => {\r\n let svg: any;\r\n fabric.loadSVGFromString(Icons[icon as keyof typeof Icons], function(objects, options) {\r\n svg = fabric.util.groupSVGElements(objects, options);\r\n svg.set({\r\n fill,\r\n originX: \"center\",\r\n originY: \"center\",\r\n objectCaching: false,\r\n type: \"svg\",\r\n strokeUniform: true,\r\n hasControls: false,\r\n hasBorders: false,\r\n lockMovementX: true,\r\n lockMovementY: true,\r\n loadType: \"svg\",\r\n svg: Icons[icon as keyof typeof Icons],\r\n });\r\n svg.scaleToWidth(size - 3);\r\n svg.scaleToHeight(size - 3);\r\n svg._objects.forEach((path: any) => {\r\n path.set('fill', fill);\r\n });\r\n });\r\n return svg;\r\n }\r\n","import { fabric } from 'fabric';\r\nimport * as echarts from 'echarts';\r\n\r\nimport { toObject, FabricElement } from '../../utils';\r\n\r\nexport interface ChartObject extends FabricElement {\r\n\tsetSource: (source: echarts.EChartOption) => void;\r\n\tsetChartOption: (chartOption: echarts.EChartOption) => void;\r\n\tchartOption: echarts.EChartOption;\r\n\tinstance: echarts.ECharts;\r\n}\r\n\r\nconst Chart = fabric.util.createClass(fabric.Rect, {\r\n\ttype: 'chart',\r\n\tsuperType: 'element',\r\n\thasRotatingPoint: false,\r\n\tinitialize(chartOption: echarts.EChartOption, options: any) {\r\n\t\toptions = options || {};\r\n\t\tthis.callSuper('initialize', options);\r\n\t\tthis.set({\r\n\t\t\tchartOption,\r\n\t\t\tfill: 'rgba(255, 255, 255, 0)',\r\n\t\t\tstroke: 'rgba(255, 255, 255, 0)',\r\n\t\t});\r\n\t},\r\n\tsetSource(source: echarts.EChartOption | string) {\r\n\t\tif (typeof source === 'string') {\r\n\t\t\tthis.setChartOptionStr(source);\r\n\t\t} else {\r\n\t\t\tthis.setChartOption(source);\r\n\t\t}\r\n\t},\r\n\tsetChartOptionStr(chartOptionStr: string) {\r\n\t\tthis.set({\r\n\t\t\tchartOptionStr,\r\n\t\t});\r\n\t},\r\n\tsetChartOption(chartOption: echarts.EChartOption) {\r\n\t\tthis.set({\r\n\t\t\tchartOption,\r\n\t\t});\r\n\t\tthis.distroyChart();\r\n\t\tthis.createChart(chartOption);\r\n\t},\r\n\tcreateChart(chartOption: echarts.EChartOption) {\r\n\t\tthis.instance = echarts.init(this.element);\r\n\t\tif (!chartOption) {\r\n\t\t\tthis.instance.setOption({\r\n\t\t\t\txAxis: {},\r\n\t\t\t\tyAxis: {},\r\n\t\t\t\tseries: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttype: 'line',\r\n\t\t\t\t\t\tdata: [\r\n\t\t\t\t\t\t\t[0, 1],\r\n\t\t\t\t\t\t\t[1, 2],\r\n\t\t\t\t\t\t\t[2, 3],\r\n\t\t\t\t\t\t\t[3, 4],\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t},\r\n\t\t\t\t],\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis.instance.setOption(chartOption);\r\n\t\t}\r\n\t},\r\n\tdistroyChart() {\r\n\t\tif (this.instance) {\r\n\t\t\tthis.instance.dispose();\r\n\t\t}\r\n\t},\r\n\ttoObject(propertiesToInclude: string[]) {\r\n\t\treturn toObject(this, propertiesToInclude, {\r\n\t\t\tchartOption: this.get('chartOption'),\r\n\t\t\tcontainer: this.get('container'),\r\n\t\t\teditable: this.get('editable'),\r\n\t\t});\r\n\t},\r\n\t_render(ctx: CanvasRenderingContext2D) {\r\n\t\tthis.callSuper('_render', ctx);\r\n\t\tif (!this.instance) {\r\n\t\t\tconst { id, scaleX, scaleY, width, height, angle, editable, chartOption } = this;\r\n\t\t\tconst zoom = this.canvas.getZoom();\r\n\t\t\tconst left = this.calcCoords().tl.x;\r\n\t\t\tconst top = this.calcCoords().tl.y;\r\n\t\t\tconst padLeft = (width * scaleX * zoom - width) / 2;\r\n\t\t\tconst padTop = (height * scaleY * zoom - height) / 2;\r\n\t\t\tthis.element = fabric.util.makeElement('div', {\r\n\t\t\t\tid: `${id}_container`,\r\n\t\t\t\tstyle: `transform: rotate(${angle}deg) scale(${scaleX * zoom}, ${scaleY * zoom});\r\n width: ${width}px;\r\n height: ${height}px;\r\n left: ${left + padLeft}px;\r\n top: ${top + padTop}px;\r\n position: absolute;\r\n user-select: ${editable ? 'none' : 'auto'};\r\n pointer-events: ${editable ? 'none' : 'auto'};`,\r\n\t\t\t}) as HTMLDivElement;\r\n\t\t\tthis.createChart(chartOption);\r\n\t\t\tconst container = document.getElementById(this.container);\r\n\t\t\tcontainer.appendChild(this.element);\r\n\t\t}\r\n\t},\r\n});\r\n\r\nChart.fromObject = (options: ChartObject, callback: (obj: ChartObject) => any) => {\r\n\treturn callback(new Chart(options.chartOption, options));\r\n};\r\n\r\nwindow.fabric.Chart = Chart;\r\n\r\nexport default Chart;\r\n","import { fabric } from 'fabric';\r\n\r\nimport { toObject, FabricElement } from '../../utils';\r\n\r\nexport interface Code {\r\n\thtml: string;\r\n\tcss: string;\r\n\tjs: string;\r\n}\r\n\r\nexport interface ElementObject extends FabricElement {\r\n\tsetSource: (source: Code) => void;\r\n\tsetCode: (code: Code) => void;\r\n\tcode: Code;\r\n}\r\n\r\nconst initialCode: Code = {\r\n\thtml: '',\r\n\tcss: '',\r\n\tjs: '',\r\n};\r\n\r\nconst Element = fabric.util.createClass(fabric.Rect, {\r\n\ttype: 'element',\r\n\tsuperType: 'element',\r\n\thasRotatingPoint: false,\r\n\tinitialize(code = initialCode, options: any) {\r\n\t\toptions = options || {};\r\n\t\tthis.callSuper('initialize', options);\r\n\t\tthis.set({\r\n\t\t\tcode,\r\n\t\t\tfill: 'rgba(255, 255, 255, 0)',\r\n\t\t\tstroke: 'rgba(255, 255, 255, 0)',\r\n\t\t});\r\n\t},\r\n\tsetSource(source: any) {\r\n\t\tthis.setCode(source);\r\n\t},\r\n\tsetCode(code = initialCode) {\r\n\t\tthis.set({\r\n\t\t\tcode,\r\n\t\t});\r\n\t\tconst { css, js, html } = code;\r\n\t\tthis.styleEl.innerHTML = css;\r\n\t\tthis.scriptEl.innerHTML = js;\r\n\t\tthis.element.innerHTML = html;\r\n\t},\r\n\ttoObject(propertiesToInclude: string[]) {\r\n\t\treturn toObject(this, propertiesToInclude, {\r\n\t\t\tcode: this.get('code'),\r\n\t\t\tcontainer: this.get('container'),\r\n\t\t\teditable: this.get('editable'),\r\n\t\t});\r\n\t},\r\n\t_render(ctx: CanvasRenderingContext2D) {\r\n\t\tthis.callSuper('_render', ctx);\r\n\t\tif (!this.element) {\r\n\t\t\tconst { id, scaleX, scaleY, width, height, angle, editable, code } = this;\r\n\t\t\tconst zoom = this.canvas.getZoom();\r\n\t\t\tconst left = this.calcCoords().tl.x;\r\n\t\t\tconst top = this.calcCoords().tl.y;\r\n\t\t\tconst padLeft = (width * scaleX * zoom - width) / 2;\r\n\t\t\tconst padTop = (height * scaleY * zoom - height) / 2;\r\n\t\t\tthis.element = fabric.util.makeElement('div', {\r\n\t\t\t\tid: `${id}_container`,\r\n\t\t\t\tstyle: `transform: rotate(${angle}deg) scale(${scaleX * zoom}, ${scaleY * zoom});\r\n width: ${width}px;\r\n height: ${height}px;\r\n left: ${left + padLeft}px;\r\n top: ${top + padTop}px;\r\n position: absolute;\r\n user-select: ${editable ? 'none' : 'auto'};\r\n pointer-events: ${editable ? 'none' : 'auto'};`,\r\n\t\t\t}) as HTMLDivElement;\r\n\t\t\tconst { html, css, js } = code;\r\n\t\t\tthis.styleEl = document.createElement('style');\r\n\t\t\tthis.styleEl.id = `${id}_style`;\r\n\t\t\tthis.styleEl.type = 'text/css';\r\n\t\t\tthis.styleEl.innerHTML = css;\r\n\t\t\tdocument.head.appendChild(this.styleEl);\r\n\r\n\t\t\tthis.scriptEl = document.createElement('script');\r\n\t\t\tthis.scriptEl.id = `${id}_script`;\r\n\t\t\tthis.scriptEl.type = 'text/javascript';\r\n\t\t\tthis.scriptEl.innerHTML = js;\r\n\t\t\tdocument.head.appendChild(this.scriptEl);\r\n\r\n\t\t\tconst container = document.getElementById(this.container);\r\n\t\t\tcontainer.appendChild(this.element);\r\n\t\t\tthis.element.innerHTML = html;\r\n\t\t}\r\n\t},\r\n});\r\n\r\nElement.fromObject = (options: ElementObject, callback: (obj: ElementObject) => any) => {\r\n\treturn callback(new Element(options.code, options));\r\n};\r\n\r\nwindow.fabric.Element = Element;\r\n\r\nexport default Element;\r\n","import { fabric } from 'fabric';\r\n\r\nimport { toObject, FabricElement } from '../../utils';\r\n\r\nexport interface IframeObject extends FabricElement {\r\n\tsetSource: (source: string) => void;\r\n\tsetSrc: (src: string) => void;\r\n\tsrc: string;\r\n\tiframeElement: HTMLIFrameElement;\r\n}\r\n\r\nconst Iframe = fabric.util.createClass(fabric.Rect, {\r\n\ttype: 'iframe',\r\n\tsuperType: 'element',\r\n\thasRotatingPoint: false,\r\n\tinitialize(src: string = '', options: any) {\r\n\t\toptions = options || {};\r\n\t\tthis.callSuper('initialize', options);\r\n\t\tthis.set({\r\n\t\t\tsrc,\r\n\t\t\tfill: 'rgba(255, 255, 255, 0)',\r\n\t\t\tstroke: 'rgba(255, 255, 255, 0)',\r\n\t\t});\r\n\t},\r\n\tsetSource(source: any) {\r\n\t\tthis.setSrc(source);\r\n\t},\r\n\tsetSrc(src: string) {\r\n\t\tthis.set({\r\n\t\t\tsrc,\r\n\t\t});\r\n\t\tthis.iframeElement.src = src;\r\n\t},\r\n\ttoObject(propertiesToInclude: string[]) {\r\n\t\treturn toObject(this, propertiesToInclude, {\r\n\t\t\tsrc: this.get('src'),\r\n\t\t\tcontainer: this.get('container'),\r\n\t\t\teditable: this.get('editable'),\r\n\t\t});\r\n\t},\r\n\t_render(ctx: CanvasRenderingContext2D) {\r\n\t\tthis.callSuper('_render', ctx);\r\n\t\tif (!this.element) {\r\n\t\t\tconst { id, scaleX, scaleY, width, height, angle, editable, src } = this;\r\n\t\t\tconst zoom = this.canvas.getZoom();\r\n\t\t\tconst left = this.calcCoords().tl.x;\r\n\t\t\tconst top = this.calcCoords().tl.y;\r\n\t\t\tconst padLeft = (width * scaleX * zoom - width) / 2;\r\n\t\t\tconst padTop = (height * scaleY * zoom - height) / 2;\r\n\t\t\tthis.iframeElement = fabric.util.makeElement('iframe', {\r\n\t\t\t\tid,\r\n\t\t\t\tsrc,\r\n\t\t\t\twidth: '100%',\r\n\t\t\t\theight: '100%',\r\n\t\t\t});\r\n\t\t\tthis.element = fabric.util.wrapElement(this.iframeElement, 'div', {\r\n\t\t\t\tid: `${id}_container`,\r\n\t\t\t\tstyle: `transform: rotate(${angle}deg) scale(${scaleX * zoom}, ${scaleY * zoom});\r\n width: ${width}px;\r\n height: ${height}px;\r\n left: ${left + padLeft}px;\r\n top: ${top + padTop}px;\r\n position: absolute;\r\n user-select: ${editable ? 'none' : 'auto'};\r\n pointer-events: ${editable ? 'none' : 'auto'};`,\r\n\t\t\t}) as HTMLDivElement;\r\n\t\t\tconst container = document.getElementById(this.container);\r\n\t\t\tcontainer.appendChild(this.element);\r\n\t\t}\r\n\t},\r\n});\r\n\r\nIframe.fromObject = (options: IframeObject, callback: (obj: IframeObject) => any) => {\r\n\treturn callback(new Iframe(options.src, options));\r\n};\r\n\r\nwindow.fabric.Iframe = Iframe;\r\n\r\nexport default Iframe;\r\n","import { fabric } from 'fabric';\r\nimport 'mediaelement';\r\nimport 'mediaelement/build/mediaelementplayer.min.css';\r\nimport { toObject, FabricElement } from '../../utils';\r\n\r\ndeclare class MediaElementPlayer {\r\n\tconstructor(\r\n\t\tid: string,\r\n\t\toptions: {\r\n\t\t\tpauseOtherPlayers: boolean;\r\n\t\t\tvideoWidth: string;\r\n\t\t\tvideoHeight: string;\r\n\t\t\tsuccess: (mediaeElement: any, originalNode: any, instance: any) => void;\r\n\t\t},\r\n\t);\r\n}\r\n\r\nexport interface VideoObject extends FabricElement {\r\n\tsetSource: (source: string | File) => void;\r\n\tsetFile: (file: File) => void;\r\n\tsetSrc: (src: string) => void;\r\n\tfile?: File;\r\n\tsrc?: string;\r\n\tvideoElement?: HTMLVideoElement;\r\n\tplayer?: any;\r\n}\r\n\r\nconst Video = fabric.util.createClass(fabric.Rect, {\r\n\ttype: 'video',\r\n\tsuperType: 'element',\r\n\thasRotatingPoint: false,\r\n\tinitialize(source: string | File, options: any) {\r\n\t\toptions = options || {};\r\n\t\tthis.callSuper('initialize', options);\r\n\t\tif (source instanceof File) {\r\n\t\t\tthis.set({\r\n\t\t\t\tfile: source,\r\n\t\t\t\tsrc: null,\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis.set({\r\n\t\t\t\tfile: null,\r\n\t\t\t\tsrc: source,\r\n\t\t\t});\r\n\t\t}\r\n\t\tthis.set({\r\n\t\t\tfill: 'rgba(255, 255, 255, 0)',\r\n\t\t\tstroke: 'rgba(255, 255, 255, 0)',\r\n\t\t});\r\n\t},\r\n\tsetSource(source: any) {\r\n\t\tif (source instanceof File) {\r\n\t\t\tthis.setFile(source);\r\n\t\t} else {\r\n\t\t\tthis.setSrc(source);\r\n\t\t}\r\n\t},\r\n\tsetFile(file: File) {\r\n\t\tthis.set({\r\n\t\t\tfile,\r\n\t\t\tsrc: null,\r\n\t\t});\r\n\t\tconst reader = new FileReader();\r\n\t\treader.onload = () => {\r\n\t\t\tthis.player.setSrc(reader.result);\r\n\t\t};\r\n\t\treader.readAsDataURL(file);\r\n\t},\r\n\tsetSrc(src: string) {\r\n\t\tthis.set({\r\n\t\t\tfile: null,\r\n\t\t\tsrc,\r\n\t\t});\r\n\t\tthis.player.setSrc(src);\r\n\t},\r\n\ttoObject(propertiesToInclude: string[]) {\r\n\t\treturn toObject(this, propertiesToInclude, {\r\n\t\t\tsrc: this.get('src'),\r\n\t\t\tfile: this.get('file'),\r\n\t\t\tcontainer: this.get('container'),\r\n\t\t\teditable: this.get('editable'),\r\n\t\t});\r\n\t},\r\n\t_render(ctx: CanvasRenderingContext2D) {\r\n\t\tthis.callSuper('_render', ctx);\r\n\t\tif (!this.element) {\r\n\t\t\tconst { id, scaleX, scaleY, width, height, angle, editable, src, file, autoplay, muted, loop } = this;\r\n\t\t\tconst zoom = this.canvas.getZoom();\r\n\t\t\tconst left = this.calcCoords().tl.x;\r\n\t\t\tconst top = this.calcCoords().tl.y;\r\n\t\t\tconst padLeft = (width * scaleX * zoom - width) / 2;\r\n\t\t\tconst padTop = (height * scaleY * zoom - height) / 2;\r\n\t\t\tthis.videoElement = fabric.util.makeElement('video', {\r\n\t\t\t\tid,\r\n\t\t\t\tautoplay: editable ? false : autoplay,\r\n\t\t\t\tmuted: editable ? false : muted,\r\n\t\t\t\tloop: editable ? false : loop,\r\n\t\t\t\tpreload: 'none',\r\n\t\t\t\tcontrols: false,\r\n\t\t\t});\r\n\t\t\tthis.element = fabric.util.wrapElement(this.videoElement, 'div', {\r\n\t\t\t\tid: `${id}_container`,\r\n\t\t\t\tstyle: `transform: rotate(${angle}deg) scale(${scaleX * zoom}, ${scaleY * zoom});\r\n width: ${width}px;\r\n height: ${height}px;\r\n left: ${left + padLeft}px;\r\n top: ${top + padTop}px;\r\n position: absolute;\r\n user-select: ${editable ? 'none' : 'auto'};\r\n pointer-events: ${editable ? 'none' : 'auto'};`,\r\n\t\t\t}) as HTMLDivElement;\r\n\t\t\tconst container = document.getElementById(this.container);\r\n\t\t\tcontainer.appendChild(this.element);\r\n\t\t\tthis.player = new MediaElementPlayer(id, {\r\n\t\t\t\tpauseOtherPlayers: false,\r\n\t\t\t\tvideoWidth: '100%',\r\n\t\t\t\tvideoHeight: '100%',\r\n\t\t\t\tsuccess: (_mediaeElement: any, _originalNode: any, instance: any) => {\r\n\t\t\t\t\tif (editable) {\r\n\t\t\t\t\t\tinstance.pause();\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t\t\tthis.player.setPlayerSize(width, height);\r\n\t\t\tif (src) {\r\n\t\t\t\tthis.setSrc(src);\r\n\t\t\t} else if (file) {\r\n\t\t\t\tthis.setFile(file);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n});\r\n\r\nVideo.fromObject = (options: VideoObject, callback: (obj: VideoObject) => any) => {\r\n\treturn callback(new Video(options.src || options.file, options));\r\n};\r\n\r\nwindow.fabric.Video = Video;\r\n\r\nexport default Video;\r\n","import { fabric } from 'fabric';\r\n\r\nimport { FabricObject } from '../../utils';\r\nimport { LinkObject } from './Link';\r\n\r\nexport interface PortObject extends FabricObject {\r\n\tlinks?: LinkObject[];\r\n\tnodeId?: string;\r\n\tenabled?: boolean;\r\n\thoverFill?: string;\r\n\tselectFill?: string;\r\n}\r\n\r\nconst Port = fabric.util.createClass(fabric.Rect, {\r\n\ttype: 'port',\r\n\tsuperType: 'port',\r\n\tinitialize(options: any) {\r\n\t\toptions = options || {};\r\n\t\tthis.callSuper('initialize', options);\r\n\t},\r\n\ttoObject() {\r\n\t\treturn fabric.util.object.extend(this.callSuper('toObject'), {\r\n\t\t\tid: this.get('id'),\r\n\t\t\tsuperType: this.get('superType'),\r\n\t\t\tenabled: this.get('enabled'),\r\n\t\t\tnodeId: this.get('nodeId'),\r\n\t\t});\r\n\t},\r\n\t_render(ctx: CanvasRenderingContext2D) {\r\n\t\tthis.callSuper('_render', ctx);\r\n\t},\r\n});\r\n\r\nPort.fromObject = (options: PortObject, callback: (obj: PortObject) => any) => {\r\n\treturn callback(new Port(options));\r\n};\r\n\r\n// @ts-ignore\r\nwindow.fabric.Port = Port;\r\n\r\nexport default Port;\r\n","import { fabric } from 'fabric';\r\nimport { v4 } from 'uuid';\r\nimport i18next from 'i18next';\r\n\r\nimport { FabricObject } from '../../utils';\r\nimport { LinkObject } from './Link';\r\nimport Port, { PortObject } from './Port';\r\n\r\nexport const NODE_COLORS = {\r\n\tTRIGGER: {\r\n\t\tfill: '#48C9B0',\r\n\t\tborder: '#1ABC9C',\r\n\t},\r\n\tLOGIC: {\r\n\t\tfill: '#AF7AC5',\r\n\t\tborder: '#9B59B6',\r\n\t},\r\n\tDATA: {\r\n\t\tfill: '#5DADE2',\r\n\t\tborder: '#3498DB',\r\n\t},\r\n\tACTION: {\r\n\t\tfill: '#F5B041',\r\n\t\tborder: 'rgb(243, 156, 18)',\r\n\t},\r\n};\r\n\r\nexport const OUT_PORT_TYPE = {\r\n\tSINGLE: 'SINGLE',\r\n\tSTATIC: 'STATIC',\r\n\tDYNAMIC: 'DYNAMIC',\r\n\tBROADCAST: 'BROADCAST',\r\n\tNONE: 'NONE',\r\n};\r\n\r\nexport const DESCRIPTIONS = {\r\n\tscript: i18next.t('common.name'),\r\n\ttemplate: i18next.t('common.name'),\r\n\tjson: i18next.t('common.name'),\r\n\tcron: i18next.t('common.name'),\r\n};\r\n\r\nexport const getEllipsis = (text: string, length: number) => {\r\n\tif (!length) {\r\n\t\treturn /[ㄱ-ㅎ|ㅏ-ㅣ|가-힣]/.test(text)\r\n\t\t\t? text.length > 8\r\n\t\t\t\t? text.substring(0, 8).concat('...')\r\n\t\t\t\t: text\r\n\t\t\t: text.length > 15\r\n\t\t\t? text.substring(0, 15).concat('...')\r\n\t\t\t: text;\r\n\t}\r\n\treturn /[ㄱ-ㅎ|ㅏ-ㅣ|가-힣]/.test(text)\r\n\t\t? text.length > length / 2\r\n\t\t\t? text.substring(0, length / 2).concat('...')\r\n\t\t\t: text\r\n\t\t: text.length > length\r\n\t\t? text.substring(0, length).concat('...')\r\n\t\t: text;\r\n};\r\n\r\nexport type NodeType = 'TRIGGER' | 'LOGIC' | 'DATA' | 'ACTION';\r\n\r\nexport interface NodeObject extends FabricObject {\r\n\terrorFlag?: fabric.IText;\r\n\tlabel?: fabric.Text;\r\n\ttoPort?: PortObject;\r\n\terrors?: any;\r\n\tfromPort?: PortObject[];\r\n\tdescriptor?: Record;\r\n\tnodeClazz?: string;\r\n\tconfiguration?: Record;\r\n\tdefaultPortOption?: () => Partial;\r\n\ttoPortOption?: () => Partial;\r\n\tfromPortOption?: () => Partial;\r\n\tcreateToPort?: (left: number, top: number) => PortObject;\r\n\tcreateFromPort?: (left: number, top: number) => PortObject[];\r\n\tsinglePort?: (portOption: Partial) => PortObject[];\r\n\tstaticPort?: (portOption: Partial) => PortObject[];\r\n\tdynamicPort?: (portOption: Partial) => PortObject[];\r\n\tbroadcastPort?: (portOption: Partial) => PortObject[];\r\n\tsetErrors?: (errors: any) => void;\r\n\tduplicate?: () => NodeObject;\r\n}\r\n\r\nconst Node = fabric.util.createClass(fabric.Group, {\r\n\ttype: 'node',\r\n\tsuperType: 'node',\r\n\tinitialize(options: any) {\r\n\t\toptions = options || {};\r\n\t\tconst icon = new fabric.IText(options.icon || '\\uE174', {\r\n\t\t\tfontFamily: 'Font Awesome 5 Free',\r\n\t\t\tfontWeight: 900,\r\n\t\t\tfontSize: 20,\r\n\t\t\tfill: 'rgba(255, 255, 255, 0.8)',\r\n\t\t});\r\n\t\tlet name = 'Default Node';\r\n\t\tif (options.name) {\r\n\t\t\tname = getEllipsis(options.name, 18);\r\n\t\t}\r\n\t\tthis.label = new fabric.Text(name || 'Default Node', {\r\n\t\t\tfontSize: 16,\r\n\t\t\tfontFamily: 'polestar',\r\n\t\t\tfontWeight: 500,\r\n\t\t\tfill: 'rgba(255, 255, 255, 0.8)',\r\n\t\t});\r\n\t\tconst rect = new fabric.Rect({\r\n\t\t\trx: 10,\r\n\t\t\try: 10,\r\n\t\t\twidth: 200,\r\n\t\t\theight: 40,\r\n\t\t\tfill: options.fill || 'rgba(0, 0, 0, 0.3)',\r\n\t\t\tstroke: options.stroke || 'rgba(0, 0, 0, 0)',\r\n\t\t\tstrokeWidth: 2,\r\n\t\t});\r\n\t\tthis.errorFlag = new fabric.IText('\\uf071', {\r\n\t\t\tfontFamily: 'Font Awesome 5 Free',\r\n\t\t\tfontWeight: 900,\r\n\t\t\tfontSize: 14,\r\n\t\t\tfill: 'rgba(255, 0, 0, 0.8)',\r\n\t\t\tvisible: options.errors,\r\n\t\t});\r\n\t\tconst node = [rect, icon, this.label, this.errorFlag];\r\n\t\tconst option = Object.assign({}, options, {\r\n\t\t\tid: options.id || v4(),\r\n\t\t\twidth: 200,\r\n\t\t\theight: 40,\r\n\t\t\toriginX: 'left',\r\n\t\t\toriginY: 'top',\r\n\t\t\thasRotatingPoint: false,\r\n\t\t\thasControls: false,\r\n\t\t});\r\n\t\tthis.callSuper('initialize', node, option);\r\n\t\ticon.set({\r\n\t\t\ttop: icon.top + 10,\r\n\t\t\tleft: icon.left + 10,\r\n\t\t});\r\n\t\tthis.label.set({\r\n\t\t\ttop: this.label.top + this.label.height / 2 + 4,\r\n\t\t\tleft: this.label.left + 35,\r\n\t\t});\r\n\t\tthis.errorFlag.set({\r\n\t\t\tleft: rect.left,\r\n\t\t\ttop: rect.top,\r\n\t\t\tvisible: options.errors,\r\n\t\t});\r\n\t},\r\n\ttoObject() {\r\n\t\treturn fabric.util.object.extend(this.callSuper('toObject'), {\r\n\t\t\tid: this.get('id'),\r\n\t\t\tname: this.get('name'),\r\n\t\t\ticon: this.get('icon'),\r\n\t\t\tdescription: this.get('description'),\r\n\t\t\tsuperType: this.get('superType'),\r\n\t\t\tconfiguration: this.get('configuration'),\r\n\t\t\tnodeClazz: this.get('nodeClazz'),\r\n\t\t\tdescriptor: this.get('descriptor'),\r\n\t\t\tborderColor: this.get('borderColor'),\r\n\t\t\tborderScaleFactor: this.get('borderScaleFactor'),\r\n\t\t\tdblclick: this.get('dblclick'),\r\n\t\t\tdeletable: this.get('deletable'),\r\n\t\t\tcloneable: this.get('cloneable'),\r\n\t\t\tfromPort: this.get('fromPort'),\r\n\t\t\ttoPort: this.get('toPort'),\r\n\t\t});\r\n\t},\r\n\tdefaultPortOption() {\r\n\t\tconst { type }: { type: NodeType } = this.descriptor as any;\r\n\t\treturn {\r\n\t\t\tnodeId: this.id,\r\n\t\t\thasBorders: false,\r\n\t\t\thasControls: false,\r\n\t\t\thasRotatingPoint: false,\r\n\t\t\tselectable: false,\r\n\t\t\toriginX: 'center',\r\n\t\t\toriginY: 'center',\r\n\t\t\tlockScalingX: true,\r\n\t\t\tlockScalingY: true,\r\n\t\t\tsuperType: 'port',\r\n\t\t\toriginFill: 'rgba(0, 0, 0, 0.1)',\r\n\t\t\thoverFill: 'rgba(0, 0, 0, 0.1)',\r\n\t\t\tselectFill: 'rgba(0, 0, 0, 0.1)',\r\n\t\t\tfill: 'rgba(0, 0, 0, 0.1)',\r\n\t\t\thoverCursor: 'pointer',\r\n\t\t\tstrokeWidth: 2,\r\n\t\t\tstroke: this.descriptor ? NODE_COLORS[type].border : 'rgba(0, 0, 0, 1)',\r\n\t\t\twidth: 10,\r\n\t\t\theight: 10,\r\n\t\t\tlinks: [] as LinkObject[],\r\n\t\t\tenabled: true,\r\n\t\t};\r\n\t},\r\n\ttoPortOption() {\r\n\t\treturn {\r\n\t\t\t...this.defaultPortOption(),\r\n\t\t};\r\n\t},\r\n\tfromPortOption() {\r\n\t\treturn {\r\n\t\t\t...this.defaultPortOption(),\r\n\t\t\tangle: 45,\r\n\t\t};\r\n\t},\r\n\tcreateToPort(left: number, top: number) {\r\n\t\tif (this.descriptor.inEnabled) {\r\n\t\t\tthis.toPort = new Port({\r\n\t\t\t\tid: 'defaultInPort',\r\n\t\t\t\ttype: 'toPort',\r\n\t\t\t\t...this.toPortOption(),\r\n\t\t\t\tleft,\r\n\t\t\t\ttop,\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn this.toPort;\r\n\t},\r\n\tcreateFromPort(left: number, top: number) {\r\n\t\tif (this.descriptor.outPortType === OUT_PORT_TYPE.BROADCAST) {\r\n\t\t\tthis.fromPort = this.broadcastPort({ ...this.fromPortOption(), left, top });\r\n\t\t} else if (this.descriptor.outPortType === OUT_PORT_TYPE.STATIC) {\r\n\t\t\tthis.fromPort = this.staticPort({ ...this.fromPortOption(), left, top });\r\n\t\t} else if (this.descriptor.outPortType === OUT_PORT_TYPE.DYNAMIC) {\r\n\t\t\tthis.fromPort = this.dynamicPort({ ...this.fromPortOption(), left, top });\r\n\t\t} else if (this.descriptor.outPortType === OUT_PORT_TYPE.NONE) {\r\n\t\t\tthis.fromPort = [];\r\n\t\t} else {\r\n\t\t\tthis.fromPort = this.singlePort({ ...this.fromPortOption(), left, top });\r\n\t\t}\r\n\t\treturn this.fromPort;\r\n\t},\r\n\tsinglePort(portOption: any) {\r\n\t\tconst fromPort = new Port({\r\n\t\t\tid: 'defaultFromPort',\r\n\t\t\ttype: 'fromPort',\r\n\t\t\t...portOption,\r\n\t\t});\r\n\t\treturn [fromPort];\r\n\t},\r\n\tstaticPort(portOption: any) {\r\n\t\treturn this.descriptor.outPorts.map((outPort: any, i: number) => {\r\n\t\t\treturn new Port({\r\n\t\t\t\tid: outPort,\r\n\t\t\t\ttype: 'fromPort',\r\n\t\t\t\t...portOption,\r\n\t\t\t\tleft: i === 0 ? portOption.left - 20 : portOption.left + 20,\r\n\t\t\t\ttop: portOption.top,\r\n\t\t\t\tleftDiff: i === 0 ? -20 : 20,\r\n\t\t\t\tfill: i === 0 ? 'rgba(0, 255, 0, 0.3)' : 'rgba(255, 0, 0, 0.3)',\r\n\t\t\t\toriginFill: i === 0 ? 'rgba(0, 255, 0, 0.3)' : 'rgba(255, 0, 0, 0.3)',\r\n\t\t\t\thoverFill: i === 0 ? 'rgba(0, 255, 0, 1)' : 'rgba(255, 0, 0, 1)',\r\n\t\t\t});\r\n\t\t});\r\n\t},\r\n\tdynamicPort(_portOption: any): any[] {\r\n\t\treturn [];\r\n\t},\r\n\tbroadcastPort(portOption: any) {\r\n\t\treturn this.singlePort(portOption);\r\n\t},\r\n\tsetErrors(errors: any) {\r\n\t\tthis.set({\r\n\t\t\terrors,\r\n\t\t});\r\n\t\tif (errors) {\r\n\t\t\tthis.errorFlag.set({\r\n\t\t\t\tvisible: true,\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis.errorFlag.set({\r\n\t\t\t\tvisible: false,\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\tduplicate() {\r\n\t\tconst options = this.toObject();\r\n\t\toptions.id = v4();\r\n\t\toptions.name = `${options.name}_clone`;\r\n\t\treturn new Node(options);\r\n\t},\r\n\t_render(ctx: CanvasRenderingContext2D) {\r\n\t\tthis.callSuper('_render', ctx);\r\n\t},\r\n});\r\n\r\nNode.fromObject = (options: NodeObject, callback: (obj: NodeObject) => any) => {\r\n\treturn callback(new Node(options));\r\n};\r\n\r\n// @ts-ignore\r\nwindow.fabric.FromPort = Port;\r\n\r\n// @ts-ignore\r\nwindow.fabric.ToPort = Port;\r\n\r\n// @ts-ignore\r\nwindow.fabric.Node = Node;\r\n\r\nexport default Node;\r\n","import { fabric } from 'fabric';\r\nimport { v4 } from 'uuid';\r\n\r\nimport { FabricObject } from '../../utils';\r\nimport { OUT_PORT_TYPE, NodeObject } from './Node';\r\nimport { PortObject } from './Port';\r\n\r\nexport interface LinkObject extends FabricObject {\r\n\tfromNode?: NodeObject;\r\n\ttoNode?: NodeObject;\r\n\tfromPort?: PortObject;\r\n\ttoPort?: PortObject;\r\n\tfromPortIndex?: number;\r\n\tsetPort?: (fromNode: NodeObject, fromPort: PortObject, toNode: NodeObject, toPort: PortObject) => void;\r\n\tsetPortEnabled?: (node: NodeObject, port: PortObject, enabled: boolean) => void;\r\n}\r\n\r\nconst Link = fabric.util.createClass(fabric.Line, {\r\n\ttype: 'link',\r\n\tsuperType: 'link',\r\n\tinitialize(\r\n\t\tfromNode: Partial,\r\n\t\tfromPort: Partial,\r\n\t\ttoNode: Partial,\r\n\t\ttoPort: Partial,\r\n\t\toptions: Partial,\r\n\t) {\r\n\t\toptions = options || {};\r\n\t\tconst coords = [fromPort.left, fromPort.top, toPort.left, toPort.top];\r\n\t\tthis.callSuper('initialize', coords, options);\r\n\t\tthis.set({\r\n\t\t\tstrokeWidth: 4,\r\n\t\t\tid: options.id || v4(),\r\n\t\t\toriginX: 'center',\r\n\t\t\toriginY: 'center',\r\n\t\t\tlockScalingX: true,\r\n\t\t\tlockScalingY: true,\r\n\t\t\tlockRotation: true,\r\n\t\t\thasRotatingPoint: false,\r\n\t\t\thasControls: false,\r\n\t\t\thasBorders: false,\r\n\t\t\tperPixelTargetFind: true,\r\n\t\t\tlockMovementX: true,\r\n\t\t\tlockMovementY: true,\r\n\t\t\tselectable: false,\r\n\t\t\tfromNode,\r\n\t\t\tfromPort,\r\n\t\t\ttoNode,\r\n\t\t\ttoPort,\r\n\t\t});\r\n\t},\r\n\tsetPort(fromNode: NodeObject, fromPort: PortObject, _toNode: NodeObject, toPort: PortObject) {\r\n\t\tif (fromNode.type === 'BroadcastNode') {\r\n\t\t\tfromPort = fromNode.fromPort[0];\r\n\t\t}\r\n\t\tfromPort.links.push(this);\r\n\t\ttoPort.links.push(this);\r\n\t\tthis.setPortEnabled(fromNode, fromPort, false);\r\n\t},\r\n\tsetPortEnabled(node: NodeObject, port: PortObject, enabled: boolean) {\r\n\t\tif (node.descriptor.outPortType !== OUT_PORT_TYPE.BROADCAST) {\r\n\t\t\tport.set({\r\n\t\t\t\tenabled,\r\n\t\t\t\tfill: enabled ? port.originFill : port.selectFill,\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tif (node.toPort.id === port.id) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tport.links.forEach((link, index) => {\r\n\t\t\t\tlink.set({\r\n\t\t\t\t\tfromPort: port,\r\n\t\t\t\t\tfromPortIndex: index,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\tnode.set({\r\n\t\t\t\tconfiguration: {\r\n\t\t\t\t\toutputCount: port.links.length,\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\ttoObject() {\r\n\t\treturn fabric.util.object.extend(this.callSuper('toObject'), {\r\n\t\t\tid: this.get('id'),\r\n\t\t\tname: this.get('name'),\r\n\t\t\tsuperType: this.get('superType'),\r\n\t\t\tconfiguration: this.get('configuration'),\r\n\t\t\tfromNode: this.get('fromNode'),\r\n\t\t\tfromPort: this.get('fromPort'),\r\n\t\t\ttoNode: this.get('toNode'),\r\n\t\t\ttoPort: this.get('toPort'),\r\n\t\t});\r\n\t},\r\n\t_render(ctx: CanvasRenderingContext2D) {\r\n\t\tthis.callSuper('_render', ctx);\r\n\t\tctx.save();\r\n\t\tconst xDiff = this.x2 - this.x1;\r\n\t\tconst yDiff = this.y2 - this.y1;\r\n\t\tconst angle = Math.atan2(yDiff, xDiff);\r\n\t\tctx.translate((this.x2 - this.x1) / 2, (this.y2 - this.y1) / 2);\r\n\t\tctx.rotate(angle);\r\n\t\tctx.beginPath();\r\n\t\tif (this.arrow) {\r\n\t\t\t// Move 5px in front of line to start the arrow so it does not have the square line end showing in front (0,0)\r\n\t\t\tctx.moveTo(5, 0);\r\n\t\t\tctx.lineTo(-5, 5);\r\n\t\t\tctx.lineTo(-5, -5);\r\n\t\t}\r\n\t\tctx.closePath();\r\n\t\tctx.fillStyle = this.stroke;\r\n\t\tctx.fill();\r\n\t\tctx.restore();\r\n\t},\r\n});\r\n\r\nLink.fromObject = (options: LinkObject, callback: (obj: LinkObject) => any) => {\r\n\tconst { fromNode, fromPort, toNode, toPort } = options;\r\n\treturn callback(new Link(fromNode, fromPort, toNode, toPort, options));\r\n};\r\n\r\nwindow.fabric.Link = Link;\r\n\r\nexport default Link;\r\n","import { fabric } from 'fabric';\r\n\r\nimport Link, { LinkObject } from './Link';\r\nimport { NodeObject } from './Node';\r\nimport { PortObject } from './Port';\r\n\r\nconst CurvedLink = fabric.util.createClass(Link, {\r\n\ttype: 'curvedLink',\r\n\tsuperType: 'link',\r\n\tinitialize(\r\n\t\tfromNode: Partial,\r\n\t\tfromPort: Partial,\r\n\t\ttoNode: Partial,\r\n\t\ttoPort: Partial,\r\n\t\toptions: Partial,\r\n\t) {\r\n\t\toptions = options || {};\r\n\t\tthis.callSuper('initialize', fromNode, fromPort, toNode, toPort, options);\r\n\t},\r\n\t_render(ctx: CanvasRenderingContext2D) {\r\n\t\t// Drawing curved link\r\n\t\tconst { x1, y1, x2, y2 } = this;\r\n\t\tctx.strokeStyle = this.stroke;\r\n\t\tconst fp = { x: (x1 - x2) / 2, y: (y1 - y2) / 2 };\r\n\t\tconst sp = { x: (x2 - x1) / 2, y: (y2 - y1) / 2 };\r\n\t\tctx.beginPath();\r\n\t\tctx.moveTo(fp.x, fp.y);\r\n\t\tctx.bezierCurveTo(fp.x, sp.y, sp.x, fp.y, sp.x, sp.y);\r\n\t\tctx.stroke();\r\n\t\tctx.save();\r\n\t\tconst xDiff = x2 - x1;\r\n\t\tconst yDiff = y2 - y1;\r\n\t\tconst angle = Math.atan2(yDiff, xDiff);\r\n\t\tctx.translate((x2 - x1) / 2, (y2 - y1) / 2);\r\n\t\tctx.rotate(angle >= 0 ? 1.57 : -1.57);\r\n\t\tctx.beginPath();\r\n\t\tif (this.arrow) {\r\n\t\t\t// Move 5px in front of line to start the arrow so it does not have the square line end showing in front (0,0)\r\n\t\t\tctx.moveTo(5, 0);\r\n\t\t\tctx.lineTo(-5, 5);\r\n\t\t\tctx.lineTo(-5, -5);\r\n\t\t}\r\n\t\tctx.closePath();\r\n\t\tctx.fillStyle = this.stroke;\r\n\t\tctx.fill();\r\n\t\tctx.restore();\r\n\t},\r\n});\r\n\r\nCurvedLink.fromObject = (options: LinkObject, callback: (obj: LinkObject) => any) => {\r\n\tconst { fromNode, fromPort, toNode, toPort } = options;\r\n\treturn callback(new CurvedLink(fromNode, fromPort, toNode, toPort, options));\r\n};\r\n\r\nwindow.fabric.CurvedLink = CurvedLink;\r\n\r\nexport default CurvedLink;\r\n","import { fabric } from 'fabric';\r\n\r\nimport Link, { LinkObject } from './Link';\r\nimport { NodeObject } from './Node';\r\nimport { PortObject } from './Port';\r\n\r\nconst OrthogonalLink = fabric.util.createClass(Link, {\r\n\ttype: 'OrthogonalLink',\r\n\tsuperType: 'link',\r\n\tinitialize(\r\n\t\tfromNode: Partial,\r\n\t\tfromPort: Partial,\r\n\t\ttoNode: Partial,\r\n\t\ttoPort: Partial,\r\n\t\toptions: Partial,\r\n\t) {\r\n\t\toptions = options || {};\r\n\t\tthis.callSuper('initialize', fromNode, fromPort, toNode, toPort, options);\r\n\t},\r\n\t_render(ctx: CanvasRenderingContext2D) {\r\n\t\t// Drawing orthogonal link\r\n\t\tconst { x1, y1, x2, y2 } = this;\r\n\t\tctx.strokeStyle = this.stroke;\r\n\t\tconst fp = { x: (x1 - x2) / 2, y: (y1 - y2) / 2 };\r\n\t\tconst sp = { x: (x2 - x1) / 2, y: (y2 - y1) / 2 };\r\n\t\tctx.lineJoin = 'round';\r\n\t\tctx.beginPath();\r\n\t\tctx.moveTo(fp.x, fp.y);\r\n\t\tctx.lineTo(fp.x, sp.y / 2);\r\n\t\tctx.lineTo(sp.x, sp.y / 2);\r\n\t\tctx.lineTo(sp.x, sp.y);\r\n\t\tctx.stroke();\r\n\t\tctx.save();\r\n\t\tconst xDiff = this.x2 - this.x1;\r\n\t\tconst yDiff = this.y2 - this.y1;\r\n\t\tconst angle = Math.atan2(yDiff, xDiff);\r\n\t\tctx.translate((this.x2 - this.x1) / 2, (this.y2 - this.y1) / 2);\r\n\t\tctx.rotate(angle >= 0 ? 1.57 : -1.57);\r\n\t\tctx.beginPath();\r\n\t\tif (this.arrow) {\r\n\t\t\t// Move 5px in front of line to start the arrow so it does not have the square line end showing in front (0,0)\r\n\t\t\tctx.moveTo(5, 0);\r\n\t\t\tctx.lineTo(-5, 5);\r\n\t\t\tctx.lineTo(-5, -5);\r\n\t\t}\r\n\t\tctx.closePath();\r\n\t\tctx.fillStyle = this.stroke;\r\n\t\tctx.fill();\r\n\t\tctx.restore();\r\n\t},\r\n});\r\n\r\nOrthogonalLink.fromObject = (options: LinkObject, callback: (obj: LinkObject) => any) => {\r\n\tconst { fromNode, fromPort, toNode, toPort } = options;\r\n\treturn callback(new OrthogonalLink(fromNode, fromPort, toNode, toPort, options));\r\n};\r\n\r\nwindow.fabric.OrthogonalLink = OrthogonalLink;\r\n\r\nexport default OrthogonalLink;\r\n","import { fabric } from 'fabric';\r\n\r\nconst Line = fabric.util.createClass(fabric.Line, {\r\n\ttype: 'line',\r\n\tsuperType: 'drawing',\r\n\tinitialize(points: any, options: any) {\r\n\t\tif (!points) {\r\n\t\t\tconst { x1, x2, y1, y2 } = options;\r\n\t\t\tpoints = [x1, y1, x2, y2];\r\n\t\t}\r\n\t\toptions = options || {};\r\n\t\tthis.callSuper('initialize', points, options);\r\n\t},\r\n\t_render(ctx: CanvasRenderingContext2D) {\r\n\t\tthis.callSuper('_render', ctx);\r\n\t},\r\n});\r\n\r\nLine.fromObject = (options: any, callback: any) => {\r\n\tconst { x1, x2, y1, y2 } = options;\r\n\treturn callback(new Line([x1, y1, x2, y2], options));\r\n};\r\n\r\nwindow.fabric.Line = Line;\r\n\r\nexport default Line;\r\n","import { fabric } from 'fabric';\r\n\r\nimport { PortObject } from './Port';\r\n\r\nconst CirclePort = fabric.util.createClass(fabric.Circle, {\r\n\ttype: 'port',\r\n\tsuperType: 'port',\r\n\tinitialize(options: any) {\r\n\t\toptions = options || {};\r\n\t\tthis.callSuper('initialize', options);\r\n\t},\r\n\ttoObject() {\r\n\t\treturn fabric.util.object.extend(this.callSuper('toObject'), {\r\n\t\t\tid: this.get('id'),\r\n\t\t\tsuperType: this.get('superType'),\r\n\t\t\tenabled: this.get('enabled'),\r\n\t\t\tnodeId: this.get('nodeId'),\r\n\t\t});\r\n\t},\r\n\t_render(ctx: CanvasRenderingContext2D) {\r\n\t\tthis.callSuper('_render', ctx);\r\n\t},\r\n});\r\n\r\nCirclePort.fromObject = (options: PortObject, callback: (obj: PortObject) => any) => {\r\n\treturn callback(new CirclePort(options));\r\n};\r\n\r\n// @ts-ignore\r\nwindow.fabric.CirclePort = CirclePort;\r\n\r\nexport default CirclePort;\r\n","import { fabric } from 'fabric';\r\nimport { FabricObject } from '../../utils';\r\n\r\nexport interface CubeObject extends FabricObject {}\r\n\r\nconst Cube = fabric.util.createClass(fabric.Object, {\r\n\ttype: 'cube',\r\n\tsuperType: 'shape',\r\n\tinitialize(options: any) {\r\n\t\toptions = options || {};\r\n\t\tthis.callSuper('initialize', options);\r\n\t},\r\n\tshadeColor(color: any, percent: number) {\r\n\t\tcolor = color.substr(1);\r\n\t\tconst num = parseInt(color, 16);\r\n\t\tconst amt = Math.round(2.55 * percent);\r\n\t\tconst R = (num >> 16) + amt;\r\n\t\tconst G = ((num >> 8) & 0x00ff) + amt;\r\n\t\tconst B = (num & 0x0000ff) + amt;\r\n\t\treturn (\r\n\t\t\t'#' +\r\n\t\t\t(\r\n\t\t\t\t0x1000000 +\r\n\t\t\t\t(R < 255 ? (R < 1 ? 0 : R) : 255) * 0x10000 +\r\n\t\t\t\t(G < 255 ? (G < 1 ? 0 : G) : 255) * 0x100 +\r\n\t\t\t\t(B < 255 ? (B < 1 ? 0 : B) : 255)\r\n\t\t\t)\r\n\t\t\t\t.toString(16)\r\n\t\t\t\t.slice(1)\r\n\t\t);\r\n\t},\r\n\t_render(ctx: CanvasRenderingContext2D) {\r\n\t\tconst { width, height, fill } = this;\r\n\t\tconst wx = width / 2;\r\n\t\tconst wy = width / 2;\r\n\t\tconst h = height / 2;\r\n\t\tconst x = 0;\r\n\t\tconst y = wy;\r\n\t\tctx.beginPath();\r\n\t\tctx.moveTo(x, y);\r\n\t\tctx.lineTo(x - wx, y - wx * 0.5);\r\n\t\tctx.lineTo(x - wx, y - h - wx * 0.5);\r\n\t\tctx.lineTo(x, y - h * 1);\r\n\t\tctx.closePath();\r\n\t\tctx.fillStyle = this.shadeColor(fill, -10);\r\n\t\tctx.strokeStyle = fill;\r\n\t\tctx.stroke();\r\n\t\tctx.fill();\r\n\r\n\t\tctx.beginPath();\r\n\t\tctx.moveTo(x, y);\r\n\t\tctx.lineTo(x + wy, y - wy * 0.5);\r\n\t\tctx.lineTo(x + wy, y - h - wy * 0.5);\r\n\t\tctx.lineTo(x, y - h * 1);\r\n\t\tctx.closePath();\r\n\t\tctx.fillStyle = this.shadeColor(fill, 10);\r\n\t\tctx.strokeStyle = this.shadeColor(fill, 50);\r\n\t\tctx.stroke();\r\n\t\tctx.fill();\r\n\r\n\t\tctx.beginPath();\r\n\t\tctx.moveTo(x, y - h);\r\n\t\tctx.lineTo(x - wx, y - h - wx * 0.5);\r\n\t\tctx.lineTo(x - wx + wy, y - h - (wx * 0.5 + wy * 0.5));\r\n\t\tctx.lineTo(x + wy, y - h - wy * 0.5);\r\n\t\tctx.closePath();\r\n\t\tctx.fillStyle = this.shadeColor(fill, 20);\r\n\t\tctx.strokeStyle = this.shadeColor(fill, 60);\r\n\t\tctx.stroke();\r\n\t\tctx.fill();\r\n\r\n\t\tctx.restore();\r\n\t},\r\n});\r\n\r\nCube.fromObject = (options: CubeObject, callback: (obj: CubeObject) => any) => {\r\n\treturn callback(new Cube(options));\r\n};\r\n\r\n// @ts-ignore\r\nwindow.fabric.Cube = Cube;\r\n\r\nexport default Cube;\r\n","import { fabric } from 'fabric';\r\nimport { FabricObject, toObject, FabricObjectOption, FabricGroup } from '../../utils';\r\n\r\nexport type SvgObject = FabricGroup | FabricObject;\r\n\r\nexport interface SvgOption extends FabricObjectOption {\r\n\tsvg?: string;\r\n\tloadType?: 'file' | 'svg';\r\n}\r\n\r\nconst Svg = fabric.util.createClass(fabric.Group, {\r\n\ttype: 'svg',\r\n\tinitialize(option: SvgOption = {}) {\r\n\t\tconst { svg, loadType } = option;\r\n\t\tthis.callSuper('initialize', [], option);\r\n\t\tthis.loadSvg(svg, loadType);\r\n\t},\r\n\taddSvgElements(objects: FabricObject[], options: any, path: string) {\r\n\t\tconst createdObj = fabric.util.groupSVGElements(objects, options, path) as SvgObject;\r\n\t\tthis.set(options);\r\n\t\tif (createdObj.getObjects) {\r\n\t\t\t(createdObj).getObjects().forEach(obj => this.add(obj));\r\n\t\t} else {\r\n\t\t\tcreatedObj.set({\r\n\t\t\t\toriginX: 'center',\r\n\t\t\t\toriginY: 'center',\r\n\t\t\t});\r\n\t\t\tthis.add(createdObj);\r\n\t\t}\r\n\t\tthis.setCoords();\r\n\t\tif (this.canvas) {\r\n\t\t\tthis.canvas.requestRenderAll();\r\n\t\t}\r\n\t},\r\n\tloadSvg(svg: string, loadType: 'file' | 'svg') {\r\n\t\tsvg = svg+=\"\";\r\n\t\treturn new Promise(resolve => {\r\n\t\t\tif (loadType === 'svg') {\r\n\t\t\t\tfabric.loadSVGFromString(svg, (objects, options) => {\r\n\t\t\t\t\tresolve(this.addSvgElements(objects, options, svg));\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tfabric.loadSVGFromURL(svg, (objects, options) => {\r\n\t\t\t\t\tresolve(this.addSvgElements(objects, options, svg));\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\ttoObject(propertiesToInclude: string[]) {\r\n\t\treturn toObject(this, propertiesToInclude, {\r\n\t\t\tsvg: this.get('svg'),\r\n\t\t\tloadType: this.get('loadType'),\r\n\t\t});\r\n\t},\r\n\t_render(ctx: CanvasRenderingContext2D) {\r\n\t\tthis.callSuper('_render', ctx);\r\n\t},\r\n});\r\n\r\nSvg.fromObject = (option: SvgOption, callback: (obj: SvgObject) => any) => {\r\n\treturn callback(new Svg(option));\r\n};\r\n\r\n// @ts-ignore\r\nwindow.fabric.Svg = Svg;\r\n\r\nexport default Svg;\r\n","export const enum SeatDistribution{\r\n normal = 1,\r\n odds = 2,\r\n evens = 3,\r\n oddsToEvens = 4,\r\n centerOddsToEvens = 5,\r\n upperCase = 6,\r\n lowerCase = 7\r\n}","import warning from 'warning';\r\n\r\nimport Handler from './Handler';\r\nimport { CurvedLink } from '../objects/fabric';\r\nimport { NodeObject } from '../objects/fabric/Node';\r\nimport { PortObject } from '../objects/fabric/Port';\r\nimport { LinkObject } from '../objects/fabric/Link';\r\n\r\nexport interface LinkOption {\r\n\t/**\r\n\t * Link Type\r\n\t * @type {string}\r\n\t */\r\n\ttype: string;\r\n\t/**\r\n\t * FromNode id of Link\r\n\t * @type {string}\r\n\t */\r\n\tfromNodeId?: string;\r\n\t/**\r\n\t * FromPort id of Link\r\n\t * @type {string}\r\n\t */\r\n\tfromPortId?: string;\r\n\t/**\r\n\t * ToNode id of Link\r\n\t * @type {string}\r\n\t */\r\n\ttoNodeId?: string;\r\n\t/**\r\n\t * ToPort id of Link\r\n\t * @type {string}\r\n\t */\r\n\ttoPortId?: string;\r\n}\r\n\r\n/**\r\n * Link Handler Class\r\n * @author salgum1114\r\n * @class LinkHandler\r\n */\r\nclass LinkHandler {\r\n\tprivate port: PortObject = null;\r\n\thandler: Handler;\r\n\r\n\tconstructor(handler: Handler) {\r\n\t\tthis.handler = handler;\r\n\t}\r\n\r\n\t/**\r\n\t * On source port click, start link\r\n\t * @param {PortObject} port\r\n\t */\r\n\tinit = (port: PortObject) => {\r\n\t\tif (this.isDrawing()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (this.isConnected(port)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.port = port;\r\n\t\tthis.port.set({\r\n\t\t\tfill: port.selectFill,\r\n\t\t});\r\n\t\tthis.handler.interactionHandler.linking();\r\n\t\tconst { left, top, nodeId, id } = port;\r\n\t\tconst fromPort = { left, top, id };\r\n\t\tconst toPort = { left, top };\r\n\t\tconst fromNode = this.handler.objectMap[nodeId];\r\n\t\tthis.handler.activeLine = new CurvedLink(fromNode, fromPort, null, toPort, {\r\n\t\t\tstrokeWidth: 2,\r\n\t\t\tfill: '#999999',\r\n\t\t\tstroke: '#999999',\r\n\t\t\tclass: 'line',\r\n\t\t\toriginX: 'center',\r\n\t\t\toriginY: 'center',\r\n\t\t\tselectable: false,\r\n\t\t\thasBorders: false,\r\n\t\t\thasControls: false,\r\n\t\t\tevented: false,\r\n\t\t});\r\n\t\tthis.handler.canvas.add(this.handler.activeLine);\r\n\t};\r\n\r\n\t/**\r\n\t * End drawing link.\r\n\t */\r\n\tfinish = (link?: LinkObject) => {\r\n\t\tif (!link) {\r\n\t\t\tthis.port.set({\r\n\t\t\t\tfill: this.port.originFill,\r\n\t\t\t});\r\n\t\t}\r\n\t\tthis.handler.interactionHandler.selection();\r\n\t\tthis.handler.canvas.remove(this.handler.activeLine);\r\n\t\tthis.handler.activeLine = null;\r\n\t\tthis.handler.canvas.renderAll();\r\n\t};\r\n\r\n\t/**\r\n\t * On dest port click, finish link\r\n\t * @param {PortObject} port\r\n\t */\r\n\tgenerate = (port: PortObject) => {\r\n\t\tif (!port) {\r\n\t\t\twarning(!port, 'Does not exist target port.');\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (this.isDuplicate(port)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (this.isSameNode(port)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst link = {\r\n\t\t\ttype: 'curvedLink',\r\n\t\t\tfromNodeId: this.handler.activeLine.fromNode.id,\r\n\t\t\tfromPortId: this.handler.activeLine.fromPort.id,\r\n\t\t\ttoNodeId: port.nodeId,\r\n\t\t\ttoPortId: port.id,\r\n\t\t};\r\n\t\tconst createdLink = this.create(link);\r\n\t\tthis.finish(createdLink);\r\n\t\t// TODO...\r\n\t\t// Save transactions unconditionally\r\n\t\tif (!this.handler.transactionHandler.active) {\r\n\t\t\tthis.handler.transactionHandler.save('add');\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Add link in Canvas\r\n\t * @param {LinkOption} link\r\n\t * @param {boolean} [loaded=false]\r\n\t * @returns\r\n\t */\r\n\tcreate = (link: LinkOption, loaded = false) => {\r\n\t\tconst fromNode = this.handler.objectMap[link.fromNodeId] as NodeObject;\r\n\t\tconst fromPort = fromNode.fromPort.filter(port => port.id === link.fromPortId || !port.id)[0];\r\n\t\tconst toNode = this.handler.objectMap[link.toNodeId] as NodeObject;\r\n\t\tconst { toPort } = toNode;\r\n\t\tconst createdObj = this.handler.fabricObjects[link.type].create(fromNode, fromPort, toNode, toPort, {\r\n\t\t\t...link,\r\n\t\t}) as LinkObject;\r\n\t\tthis.handler.canvas.add(createdObj);\r\n\t\tthis.handler.objects = this.handler.getObjects();\r\n\t\tconst { editable } = this.handler;\r\n\t\tif (this.handler.onAdd && editable && !loaded) {\r\n\t\t\tthis.handler.onAdd(createdObj);\r\n\t\t}\r\n\t\tthis.handler.canvas.renderAll();\r\n\t\tcreatedObj.setPort(fromNode, fromPort, toNode, toPort);\r\n\t\tthis.handler.portHandler.setCoords(fromNode);\r\n\t\tthis.handler.portHandler.setCoords(toNode);\r\n\t\tthis.handler.canvas.requestRenderAll();\r\n\t\treturn createdObj;\r\n\t};\r\n\r\n\t/**\r\n\t * Set coordinate of link\r\n\t * @param {number} x1\r\n\t * @param {number} y1\r\n\t * @param {number} x2\r\n\t * @param {number} y2\r\n\t * @param {LinkObject} link\r\n\t */\r\n\tsetCoords = (x1: number, y1: number, x2: number, y2: number, link: LinkObject) => {\r\n\t\tlink.set({\r\n\t\t\tx1,\r\n\t\t\ty1,\r\n\t\t\tx2,\r\n\t\t\ty2,\r\n\t\t});\r\n\t\tlink.setCoords();\r\n\t};\r\n\r\n\t/**\r\n\t * When the link is deleted, linked FromNode delete\r\n\t * @param {LinkObject} link\r\n\t */\r\n\tremoveFrom = (link: LinkObject) => {\r\n\t\tif (link.fromPort) {\r\n\t\t\tlet index = -1;\r\n\t\t\tif (link.fromPort.links.length) {\r\n\t\t\t\tlink.fromPort.links.some((portLink: any, i: number) => {\r\n\t\t\t\t\tif (link.id === portLink.id) {\r\n\t\t\t\t\t\tindex = i;\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t});\r\n\t\t\t\tif (index > -1) {\r\n\t\t\t\t\tlink.fromPort.links.splice(index, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlink.setPortEnabled(link.fromNode, link.fromPort, true);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * When the link is deleted, linked ToNode delete\r\n\t * @param {LinkObject} link\r\n\t */\r\n\tremoveTo = (link: LinkObject) => {\r\n\t\tif (link.toNode.toPort.links.length) {\r\n\t\t\tlet index = -1;\r\n\t\t\tlink.toNode.toPort.links.some((portLink: any, i: number) => {\r\n\t\t\t\tif (link.id === portLink.id) {\r\n\t\t\t\t\tindex = i;\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t\t\tif (index > -1) {\r\n\t\t\t\tlink.toNode.toPort.links.splice(index, 1);\r\n\t\t\t}\r\n\t\t\tlink.setPortEnabled(link.toNode, link.toNode.toPort, true);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * When the link is deleted, linked node delete\r\n\t * @param {LinkObject} link\r\n\t */\r\n\tremoveAll = (link: LinkObject) => {\r\n\t\tthis.removeFrom(link);\r\n\t\tthis.removeTo(link);\r\n\t};\r\n\r\n\t/**\r\n\t * Remove link in canvas\r\n\t * @param {LinkObject} link\r\n\t * @param {string} [type]\r\n\t */\r\n\tremove = (link: LinkObject, type?: string) => {\r\n\t\tif (type === 'from') {\r\n\t\t\tthis.removeFrom(link);\r\n\t\t} else if (type === 'to') {\r\n\t\t\tthis.removeTo(link);\r\n\t\t} else {\r\n\t\t\tthis.removeAll(link);\r\n\t\t}\r\n\t\tthis.handler.canvas.remove(link);\r\n\t\tthis.handler.objects = this.handler.getObjects();\r\n\t};\r\n\r\n\t/**\r\n\t * Check if there is a port connected\r\n\t * @param {PortObject} port\r\n\t * @returns\r\n\t */\r\n\tisConnected = (port: PortObject) => {\r\n\t\twarning(port.enabled, 'A connected node already exists.');\r\n\t\treturn !port.enabled;\r\n\t};\r\n\r\n\t/**\r\n\t * Check if select same node\r\n\t * @param {PortObject} port\r\n\t * @returns\r\n\t */\r\n\tisSameNode = (port: PortObject) => {\r\n\t\tconst validate = port.nodeId === this.handler.activeLine.fromNode.id;\r\n\t\twarning(!validate, 'Cannot select the same node.');\r\n\t\treturn validate;\r\n\t};\r\n\r\n\t/**\r\n\t * Check if select same node\r\n\t * @param {PortObject} port\r\n\t * @returns\r\n\t */\r\n\tisDuplicate = (port: PortObject) => {\r\n\t\tconst validate = port.links.some(link => link.fromNode.id === this.handler.activeLine.fromNode.id);\r\n\t\twarning(!validate, 'Duplicate connections cannot be made.');\r\n\t\treturn validate;\r\n\t};\r\n\r\n\t/**\r\n\t * Check if draw the link\r\n\t * @returns\r\n\t */\r\n\tisDrawing = () => {\r\n\t\tconst validate = this.handler.interactionMode === 'link' && this.handler.activeLine;\r\n\t\twarning(!validate, 'Already drawing links.');\r\n\t\treturn validate;\r\n\t};\r\n}\r\n\r\nexport default LinkHandler;\r\n","import { fabric } from 'fabric';\r\n\r\nimport Handler from './Handler';\r\nimport { FabricObject } from '../utils';\r\nimport { NodeObject } from '../objects/fabric/Node';\r\nimport { LinkObject } from '../objects/fabric/Link';\r\n\r\nclass NodeHandler {\r\n\thandler: Handler;\r\n\tconstructor(handler: Handler) {\r\n\t\tthis.handler = handler;\r\n\t}\r\n\r\n\t/**\r\n\t * Get the node path by target object\r\n\t * @param {NodeObject} target\r\n\t * @param {NodeObject[]} [nodes=[]]\r\n\t * @param {string} [direction='init']\r\n\t */\r\n\tgetNodePath = (target: NodeObject, nodes: NodeObject[] = [], direction = 'init') => {\r\n\t\tif (target) {\r\n\t\t\tif (direction === 'to' || direction === 'init') {\r\n\t\t\t\tif (target.toPort) {\r\n\t\t\t\t\ttarget.toPort.links.forEach(link => {\r\n\t\t\t\t\t\tif (link.fromNode) {\r\n\t\t\t\t\t\t\tnodes.push(link.fromNode);\r\n\t\t\t\t\t\t\tthis.getNodePath(link.fromNode, nodes, 'to');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tif (direction === 'init') {\r\n\t\t\t\t\tnodes.push(target);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (direction === 'from' || direction === 'init') {\r\n\t\t\t\ttarget.fromPort.forEach(port => {\r\n\t\t\t\t\tport.links.forEach(link => {\r\n\t\t\t\t\t\tif (link.toNode) {\r\n\t\t\t\t\t\t\tnodes.push(link.toNode);\r\n\t\t\t\t\t\t\tthis.getNodePath(link.toNode, nodes, 'from');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Select the node path\r\n\t * @param {string[]} [path]\r\n\t */\r\n\tselectByPath = (path?: string[]) => {\r\n\t\tif (!path || !path.length) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst targetObjects = this.handler.objects.filter(object => path.some(id => id === object.id));\r\n\t\tconst nonTargetObjects = this.handler.objects.filter(object => path.some(id => id !== object.id));\r\n\t\tnonTargetObjects.forEach((object: any) => {\r\n\t\t\tif (object.superType === 'link') {\r\n\t\t\t\tconst { fromNode, toNode } = object as LinkObject;\r\n\t\t\t\tif (fromNode && toNode) {\r\n\t\t\t\t\tconst fromIndex = targetObjects.findIndex(obj => obj.id === fromNode.id);\r\n\t\t\t\t\tconst toIndex = targetObjects.findIndex(obj => obj.id === toNode.id);\r\n\t\t\t\t\tif (fromIndex >= 0 && targetObjects[fromIndex] && toIndex >= 0 && targetObjects[toIndex]) {\r\n\t\t\t\t\t\tobject.set({\r\n\t\t\t\t\t\t\topacity: 1,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tobject.setShadow({\r\n\t\t\t\t\t\t\tcolor: object.stroke,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.highlightingNode(object, 300);\r\n\t\t\t\t\t\tthis.handler.canvas.requestRenderAll();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tobject.set({\r\n\t\t\t\topacity: 0.2,\r\n\t\t\t});\r\n\t\t\tif (object.superType === 'node') {\r\n\t\t\t\tif (object.toPort) {\r\n\t\t\t\t\tobject.toPort.set({\r\n\t\t\t\t\t\topacity: 0.2,\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tobject.fromPort.forEach((port: any) => {\r\n\t\t\t\t\tport.set({\r\n\t\t\t\t\t\topacity: 0.2,\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (!object.animating) {\r\n\t\t\t\tobject.setShadow({\r\n\t\t\t\t\tblur: 0,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\ttargetObjects.forEach((object: any) => {\r\n\t\t\tobject.set({\r\n\t\t\t\topacity: 1,\r\n\t\t\t});\r\n\t\t\tobject.setShadow({\r\n\t\t\t\tcolor: object.stroke,\r\n\t\t\t});\r\n\t\t\tthis.highlightingNode(object, 300);\r\n\t\t\tif (object.toPort) {\r\n\t\t\t\tobject.toPort.set({\r\n\t\t\t\t\topacity: 1,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (object.fromPort) {\r\n\t\t\t\tobject.fromPort.forEach((port: any) => {\r\n\t\t\t\t\tport.set({\r\n\t\t\t\t\t\topacity: 1,\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.handler.canvas.requestRenderAll();\r\n\t};\r\n\r\n\t/**\r\n\t * Select node by id\r\n\t * @param {string} id\r\n\t */\r\n\tselectById = (id: string) => {\r\n\t\tthis.handler.objects.forEach((object: FabricObject) => {\r\n\t\t\tif (id === object.id) {\r\n\t\t\t\tobject.setShadow({\r\n\t\t\t\t\tcolor: object.stroke,\r\n\t\t\t\t\tblur: 50,\r\n\t\t\t\t} as fabric.Shadow);\r\n\t\t\t\treturn;\r\n\t\t\t} else if (id === object.nodeId) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tobject.setShadow({\r\n\t\t\t\tblur: 0,\r\n\t\t\t} as fabric.Shadow);\r\n\t\t});\r\n\t\tthis.handler.canvas.requestRenderAll();\r\n\t};\r\n\r\n\t/**\r\n\t * Deselect nodes\r\n\t */\r\n\tdeselect = () => {\r\n\t\tthis.handler.objects.forEach((object: FabricObject) => {\r\n\t\t\tobject.set({\r\n\t\t\t\topacity: 1,\r\n\t\t\t});\r\n\t\t\tif (object.superType === 'node') {\r\n\t\t\t\tconst node = object as NodeObject;\r\n\t\t\t\tif (node.toPort) {\r\n\t\t\t\t\tnode.toPort.set({\r\n\t\t\t\t\t\topacity: 1,\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tnode.fromPort.forEach(port => {\r\n\t\t\t\t\tport.set({\r\n\t\t\t\t\t\topacity: 1,\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (!object.animating) {\r\n\t\t\t\tconst node = object as FabricObject;\r\n\t\t\t\tnode.setShadow({\r\n\t\t\t\t\tblur: 0,\r\n\t\t\t\t} as fabric.Shadow);\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.handler.canvas.renderAll();\r\n\t};\r\n\r\n\t/**\r\n\t * Highlight node path\r\n\t * @param {string[]} [path]\r\n\t */\r\n\thighlightingByPath = (path?: string[]) => {\r\n\t\tif (!path || !path.length) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst targetObjects = this.handler.objects.filter((obj: FabricObject) => path.some(id => id === obj.id));\r\n\t\tconst nonTargetObjects = this.handler.objects.filter((obj: FabricObject) => path.some(id => id !== obj.id));\r\n\t\tconst lastObject = targetObjects.filter((obj: FabricObject) => obj.id === path[path.length - 1])[0];\r\n\t\ttargetObjects.forEach((object: FabricObject) => {\r\n\t\t\tif (lastObject) {\r\n\t\t\t\tobject.setShadow({\r\n\t\t\t\t\tcolor: lastObject.stroke,\r\n\t\t\t\t} as fabric.Shadow);\r\n\t\t\t} else {\r\n\t\t\t\tobject.setShadow({\r\n\t\t\t\t\tcolor: object.stroke,\r\n\t\t\t\t} as fabric.Shadow);\r\n\t\t\t}\r\n\t\t\tthis.highlightingNode(object);\r\n\t\t\tthis.handler.canvas.requestRenderAll();\r\n\t\t});\r\n\t\tnonTargetObjects.forEach((object: FabricObject) => {\r\n\t\t\tif (object.superType === 'link') {\r\n\t\t\t\tconst { fromNode, toNode } = object;\r\n\t\t\t\tif (fromNode && toNode) {\r\n\t\t\t\t\tconst fromIndex = targetObjects.findIndex((obj: FabricObject) => obj.id === fromNode.id);\r\n\t\t\t\t\tconst toIndex = targetObjects.findIndex((obj: FabricObject) => obj.id === toNode.id);\r\n\t\t\t\t\tif (fromIndex >= 0 && targetObjects[fromIndex] && toIndex >= 0 && targetObjects[toIndex]) {\r\n\t\t\t\t\t\tif (lastObject) {\r\n\t\t\t\t\t\t\tobject.setShadow({\r\n\t\t\t\t\t\t\t\tcolor: lastObject.stroke,\r\n\t\t\t\t\t\t\t} as fabric.Shadow);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tobject.setShadow({\r\n\t\t\t\t\t\t\t\tcolor: object.stroke,\r\n\t\t\t\t\t\t\t} as fabric.Shadow);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.highlightingNode(object);\r\n\t\t\t\t\t\tthis.highlightingLink(object, lastObject);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.handler.canvas.requestRenderAll();\r\n\t};\r\n\r\n\t/**\r\n\t * Highlight link\r\n\t * @param {FabricObject} object\r\n\t * @param {FabricObject} targetObject\r\n\t * @param {number} [duration=500]\r\n\t */\r\n\thighlightingLink = (object: FabricObject, targetObject: FabricObject, duration = 500) => {\r\n\t\tobject.animation = {\r\n\t\t\tduration,\r\n\t\t\ttype: 'flash',\r\n\t\t\tstroke: targetObject ? targetObject.stroke : object.stroke,\r\n\t\t\tloop: 1,\r\n\t\t\tdelay: 0,\r\n\t\t};\r\n\t\tthis.handler.animationHandler.play(object.id, false);\r\n\t};\r\n\r\n\t/**\r\n\t * Highlight node\r\n\t *\r\n\t * @param {*} object\r\n\t * @param {number} [duration=500]\r\n\t * @param {number} [minBlur=0]\r\n\t * @param {number} [maxBlur=50]\r\n\t */\r\n\thighlightingNode = (object: any, duration = 500, minBlur = 0, maxBlur = 50) => {\r\n\t\tconst onComplete = () => {\r\n\t\t\tif (object.shadow.blur === maxBlur) {\r\n\t\t\t\tobject.animating = true;\r\n\t\t\t\tobject.animate('shadow.blur', minBlur, {\r\n\t\t\t\t\teasing: fabric.util.ease.easeInOutQuad,\r\n\t\t\t\t\tonChange: (value: number) => {\r\n\t\t\t\t\t\tobject.shadow.blur = value;\r\n\t\t\t\t\t\tthis.handler.canvas.requestRenderAll();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tonComplete: () => {\r\n\t\t\t\t\t\tobject.animating = false;\r\n\t\t\t\t\t\tif (object.superType === 'link') {\r\n\t\t\t\t\t\t\tobject.set({\r\n\t\t\t\t\t\t\t\tstroke: object.originStroke,\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\t\tobject.animating = true;\r\n\t\tobject.animate('shadow.blur', maxBlur, {\r\n\t\t\teasing: fabric.util.ease.easeInOutQuad,\r\n\t\t\tduration,\r\n\t\t\tonChange: (value: number) => {\r\n\t\t\t\tobject.shadow.blur = value;\r\n\t\t\t\tthis.handler.canvas.requestRenderAll();\r\n\t\t\t},\r\n\t\t\tonComplete,\r\n\t\t});\r\n\t};\r\n}\r\n\r\nexport default NodeHandler;\r\n","import Handler from './Handler';\r\n\r\nclass AlignmentHandler {\r\n handler: Handler;\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n /**\r\n * Align left at selection\r\n */\r\n public left = () => {\r\n const activeObject = this.handler.canvas.getActiveObject();\r\n if (activeObject && activeObject.type === 'activeSelection') {\r\n const activeSelection = activeObject as fabric.ActiveSelection;\r\n const activeObjectLeft = -(activeObject.width / 2);\r\n activeSelection.forEachObject(obj => {\r\n obj.set({\r\n left: activeObjectLeft,\r\n });\r\n obj.setCoords();\r\n this.handler.canvas.renderAll();\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Align center at selection\r\n */\r\n public center = () => {\r\n const activeObject = this.handler.canvas.getActiveObject();\r\n if (activeObject && activeObject.type === 'activeSelection') {\r\n const activeSelection = activeObject as fabric.ActiveSelection;\r\n activeSelection.forEachObject(obj => {\r\n obj.set({\r\n left: 0 - ((obj.width * obj.scaleX) / 2),\r\n });\r\n obj.setCoords();\r\n this.handler.canvas.renderAll();\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Align right at selection\r\n */\r\n public right = () => {\r\n const activeObject = this.handler.canvas.getActiveObject();\r\n if (activeObject && activeObject.type === 'activeSelection') {\r\n const activeSelection = activeObject as fabric.ActiveSelection;\r\n const activeObjectLeft = (activeObject.width / 2);\r\n activeSelection.forEachObject(obj => {\r\n obj.set({\r\n left: activeObjectLeft - (obj.width * obj.scaleX),\r\n });\r\n obj.setCoords();\r\n this.handler.canvas.renderAll();\r\n });\r\n }\r\n }\r\n}\r\n\r\nexport default AlignmentHandler;\r\n","import { fabric } from 'fabric';\r\n\r\nimport Handler from './Handler';\r\nimport { WorkareaObject, FabricObject, FabricEvent } from '../utils';\r\n\r\nclass GuidelineHandler {\r\n\thandler: Handler;\r\n\tverticalLines: { x?: number; y1?: number; y2?: number }[];\r\n\thorizontalLines: { y?: number; x1?: number; x2?: number }[];\r\n\tctx: CanvasRenderingContext2D;\r\n\tviewportTransform: number[];\r\n\r\n\taligningLineOffset = 5;\r\n\taligningLineMargin = 4;\r\n\taligningLineWidth = 1;\r\n\taligningLineColor = 'rgb(255, 0, 0)';\r\n\tzoom = 1;\r\n\r\n\tconstructor(handler: Handler) {\r\n\t\tthis.handler = handler;\r\n\t\tthis.initialize();\r\n\t}\r\n\r\n\t/**\r\n\t * Initialize guideline handler\r\n\t *\r\n\t */\r\n\tpublic initialize() {\r\n\t\tif (this.handler.guidelineOption.enabled) {\r\n\t\t\tthis.handler.canvas.on({\r\n\t\t\t\t'before:render': this.beforeRender,\r\n\t\t\t\t'after:render': this.afterRender,\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis.handler.canvas.off({\r\n\t\t\t\t'before:render': this.beforeRender,\r\n\t\t\t\t'after:render': this.afterRender,\r\n\t\t\t});\r\n\t\t}\r\n\t\tthis.ctx = this.handler.canvas.getSelectionContext();\r\n\t\tthis.aligningLineOffset = 5;\r\n\t\tthis.aligningLineMargin = 4;\r\n\t\tthis.aligningLineWidth = 1;\r\n\t\tthis.aligningLineColor = 'rgb(255, 0, 0)';\r\n\t\tthis.viewportTransform = this.handler.canvas.viewportTransform;\r\n\t\tthis.zoom = 1;\r\n\t\tthis.verticalLines = [];\r\n\t\tthis.horizontalLines = [];\r\n\t}\r\n\r\n\t/**\r\n\t * Destroy guideline handler\r\n\t *\r\n\t * @author salgum1114\r\n\t */\r\n\tpublic destroy() {\r\n\t\tthis.handler.canvas.off({\r\n\t\t\t'before:render': this.beforeRender,\r\n\t\t\t'after:render': this.afterRender,\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Before the render\r\n\t *\r\n\t * @param {FabricEvent} _opt\r\n\t */\r\n\tpublic beforeRender = (_opt: FabricEvent) => {\r\n\t\tthis.handler.canvas.clearContext(this.handler.guidelineHandler.ctx);\r\n\t};\r\n\r\n\t/**\r\n\t * After the render\r\n\t *\r\n\t * @param {FabricEvent} _opt\r\n\t */\r\n\tpublic afterRender = (_opt: FabricEvent) => {\r\n\t\tfor (let i = this.handler.guidelineHandler.verticalLines.length; i--; ) {\r\n\t\t\tthis.handler.guidelineHandler.drawVerticalLine(this.handler.guidelineHandler.verticalLines[i]);\r\n\t\t}\r\n\t\tfor (let i = this.handler.guidelineHandler.horizontalLines.length; i--; ) {\r\n\t\t\tthis.handler.guidelineHandler.drawHorizontalLine(this.handler.guidelineHandler.horizontalLines[i]);\r\n\t\t}\r\n\t\tthis.handler.guidelineHandler.verticalLines.length = 0;\r\n\t\tthis.handler.guidelineHandler.horizontalLines.length = 0;\r\n\t};\r\n\r\n\tdrawVerticalLine = (coords: { x?: number; y1?: number; y2?: number }) => {\r\n\t\tthis.drawLine(\r\n\t\t\tcoords.x + 0.5,\r\n\t\t\tcoords.y1 > coords.y2 ? coords.y2 : coords.y1,\r\n\t\t\tcoords.x + 0.5,\r\n\t\t\tcoords.y2 > coords.y1 ? coords.y2 : coords.y1,\r\n\t\t);\r\n\t};\r\n\r\n\tdrawHorizontalLine = (coords: { y?: number; x1?: number; x2?: number }) => {\r\n\t\tthis.drawLine(\r\n\t\t\tcoords.x1 > coords.x2 ? coords.x2 : coords.x1,\r\n\t\t\tcoords.y + 0.5,\r\n\t\t\tcoords.x2 > coords.x1 ? coords.x2 : coords.x1,\r\n\t\t\tcoords.y + 0.5,\r\n\t\t);\r\n\t};\r\n\r\n\tdrawLine = (x1: number, y1: number, x2: number, y2: number) => {\r\n\t\tconst { ctx, aligningLineWidth, aligningLineColor, viewportTransform, zoom } = this;\r\n\t\tctx.save();\r\n\t\tctx.lineWidth = aligningLineWidth;\r\n\t\tctx.strokeStyle = aligningLineColor;\r\n\t\tctx.beginPath();\r\n\t\tctx.moveTo(x1 * zoom + viewportTransform[4], y1 * zoom + viewportTransform[5]);\r\n\t\tctx.lineTo(x2 * zoom + viewportTransform[4], y2 * zoom + viewportTransform[5]);\r\n\t\tctx.stroke();\r\n\t\tctx.restore();\r\n\t};\r\n\r\n\tisInRange = (v1: number, v2: number) => {\r\n\t\tconst { aligningLineMargin } = this;\r\n\t\tv1 = Math.round(v1);\r\n\t\tv2 = Math.round(v2);\r\n\t\tfor (let i = v1 - aligningLineMargin, len = v1 + aligningLineMargin; i <= len; i++) {\r\n\t\t\tif (i === v2) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\tmovingGuidelines = (target: FabricObject) => {\r\n\t\tconst canvasObjects = this.handler.canvas.getObjects() as FabricObject[];\r\n\t\tconst activeObjectCenter = target.getCenterPoint();\r\n\t\tconst activeObjectLeft = activeObjectCenter.x;\r\n\t\tconst activeObjectTop = activeObjectCenter.y;\r\n\t\tconst activeObjectBoundingRect = target.getBoundingRect();\r\n\t\tconst activeObjectHeight = activeObjectBoundingRect.height / this.viewportTransform[3];\r\n\t\tconst activeObjectWidth = activeObjectBoundingRect.width / this.viewportTransform[0];\r\n\t\tlet horizontalInTheRange = false;\r\n\t\tlet verticalInTheRange = false;\r\n\t\tconst { _currentTransform: transform } = this.handler.canvas as any;\r\n\t\tif (!transform) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// It should be trivial to DRY this up by encapsulating (repeating) creation of x1, x2, y1, and y2 into functions,\r\n\t\t// but we're not doing it here for perf. reasons -- as this a function that's invoked on every mouse move\r\n\r\n\t\tfor (let i = canvasObjects.length; i--; ) {\r\n\t\t\tif (\r\n\t\t\t\tcanvasObjects[i] === target ||\r\n\t\t\t\tcanvasObjects[i].superType === 'port' ||\r\n\t\t\t\tcanvasObjects[i].superType === 'link' ||\r\n\t\t\t\t!canvasObjects[i].evented\r\n\t\t\t) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tconst objectCenter = canvasObjects[i].getCenterPoint();\r\n\t\t\tconst objectLeft = objectCenter.x;\r\n\t\t\tconst objectTop = objectCenter.y;\r\n\t\t\tconst objectBoundingRect = canvasObjects[i].getBoundingRect();\r\n\t\t\tconst objectHeight = objectBoundingRect.height / this.viewportTransform[3];\r\n\t\t\tconst objectWidth = objectBoundingRect.width / this.viewportTransform[0];\r\n\r\n\t\t\t// snap by the horizontal center line\r\n\t\t\tif (this.isInRange(objectLeft, activeObjectLeft)) {\r\n\t\t\t\tverticalInTheRange = true;\r\n\t\t\t\tif (canvasObjects[i].id === 'workarea') {\r\n\t\t\t\t\tconst y1 = -5000;\r\n\t\t\t\t\tconst y2 = 5000;\r\n\t\t\t\t\tthis.verticalLines.push({\r\n\t\t\t\t\t\tx: objectLeft,\r\n\t\t\t\t\t\ty1,\r\n\t\t\t\t\t\ty2,\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.verticalLines.push({\r\n\t\t\t\t\t\tx: objectLeft,\r\n\t\t\t\t\t\ty1:\r\n\t\t\t\t\t\t\tobjectTop < activeObjectTop\r\n\t\t\t\t\t\t\t\t? objectTop - objectHeight / 2 - this.aligningLineOffset\r\n\t\t\t\t\t\t\t\t: objectTop + objectHeight / 2 + this.aligningLineOffset,\r\n\t\t\t\t\t\ty2:\r\n\t\t\t\t\t\t\tactiveObjectTop > objectTop\r\n\t\t\t\t\t\t\t\t? activeObjectTop + activeObjectHeight / 2 + this.aligningLineOffset\r\n\t\t\t\t\t\t\t\t: activeObjectTop - activeObjectHeight / 2 - this.aligningLineOffset,\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\ttarget.setPositionByOrigin(new fabric.Point(objectLeft, activeObjectTop), 'center', 'center');\r\n\t\t\t}\r\n\r\n\t\t\t// snap by the left edge\r\n\t\t\tif (this.isInRange(objectLeft - objectWidth / 2, activeObjectLeft - activeObjectWidth / 2)) {\r\n\t\t\t\tverticalInTheRange = true;\r\n\t\t\t\tif (canvasObjects[i].id === 'workarea') {\r\n\t\t\t\t\tconst workarea = canvasObjects[i] as WorkareaObject;\r\n\t\t\t\t\tconst y1 = -5000;\r\n\t\t\t\t\tconst y2 = 5000;\r\n\t\t\t\t\tlet x = objectLeft - objectWidth / 2;\r\n\t\t\t\t\tif (workarea.layout === 'fullscreen') {\r\n\t\t\t\t\t\tx = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.verticalLines.push({\r\n\t\t\t\t\t\tx,\r\n\t\t\t\t\t\ty1,\r\n\t\t\t\t\t\ty2,\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.verticalLines.push({\r\n\t\t\t\t\t\tx: objectLeft - objectWidth / 2,\r\n\t\t\t\t\t\ty1:\r\n\t\t\t\t\t\t\tobjectTop < activeObjectTop\r\n\t\t\t\t\t\t\t\t? objectTop - objectHeight / 2 - this.aligningLineOffset\r\n\t\t\t\t\t\t\t\t: objectTop + objectHeight / 2 + this.aligningLineOffset,\r\n\t\t\t\t\t\ty2:\r\n\t\t\t\t\t\t\tactiveObjectTop > objectTop\r\n\t\t\t\t\t\t\t\t? activeObjectTop + activeObjectHeight / 2 + this.aligningLineOffset\r\n\t\t\t\t\t\t\t\t: activeObjectTop - activeObjectHeight / 2 - this.aligningLineOffset,\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\ttarget.setPositionByOrigin(\r\n\t\t\t\t\tnew fabric.Point(objectLeft - objectWidth / 2 + activeObjectWidth / 2, activeObjectTop),\r\n\t\t\t\t\t'center',\r\n\t\t\t\t\t'center',\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\t// snap by the right edge\r\n\t\t\tif (this.isInRange(objectLeft + objectWidth / 2, activeObjectLeft + activeObjectWidth / 2)) {\r\n\t\t\t\tverticalInTheRange = true;\r\n\t\t\t\tif (canvasObjects[i].id === 'workarea') {\r\n\t\t\t\t\tconst workarea = canvasObjects[i] as WorkareaObject;\r\n\t\t\t\t\tconst y1 = -5000;\r\n\t\t\t\t\tconst y2 = 5000;\r\n\t\t\t\t\tlet x = objectLeft + objectWidth / 2;\r\n\t\t\t\t\tif (workarea.layout === 'fullscreen') {\r\n\t\t\t\t\t\tx = this.handler.canvas.getWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.verticalLines.push({\r\n\t\t\t\t\t\tx,\r\n\t\t\t\t\t\ty1,\r\n\t\t\t\t\t\ty2,\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.verticalLines.push({\r\n\t\t\t\t\t\tx: objectLeft + objectWidth / 2,\r\n\t\t\t\t\t\ty1:\r\n\t\t\t\t\t\t\tobjectTop < activeObjectTop\r\n\t\t\t\t\t\t\t\t? objectTop - objectHeight / 2 - this.aligningLineOffset\r\n\t\t\t\t\t\t\t\t: objectTop + objectHeight / 2 + this.aligningLineOffset,\r\n\t\t\t\t\t\ty2:\r\n\t\t\t\t\t\t\tactiveObjectTop > objectTop\r\n\t\t\t\t\t\t\t\t? activeObjectTop + activeObjectHeight / 2 + this.aligningLineOffset\r\n\t\t\t\t\t\t\t\t: activeObjectTop - activeObjectHeight / 2 - this.aligningLineOffset,\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\ttarget.setPositionByOrigin(\r\n\t\t\t\t\tnew fabric.Point(objectLeft + objectWidth / 2 - activeObjectWidth / 2, activeObjectTop),\r\n\t\t\t\t\t'center',\r\n\t\t\t\t\t'center',\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\t// snap by the vertical center line\r\n\t\t\tif (this.isInRange(objectTop, activeObjectTop)) {\r\n\t\t\t\thorizontalInTheRange = true;\r\n\t\t\t\tif (canvasObjects[i].id === 'workarea') {\r\n\t\t\t\t\tconst x1 = -5000;\r\n\t\t\t\t\tconst x2 = 5000;\r\n\t\t\t\t\tthis.horizontalLines.push({\r\n\t\t\t\t\t\ty: objectTop,\r\n\t\t\t\t\t\tx1,\r\n\t\t\t\t\t\tx2,\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.horizontalLines.push({\r\n\t\t\t\t\t\ty: objectTop,\r\n\t\t\t\t\t\tx1:\r\n\t\t\t\t\t\t\tobjectLeft < activeObjectLeft\r\n\t\t\t\t\t\t\t\t? objectLeft - objectWidth / 2 - this.aligningLineOffset\r\n\t\t\t\t\t\t\t\t: objectLeft + objectWidth / 2 + this.aligningLineOffset,\r\n\t\t\t\t\t\tx2:\r\n\t\t\t\t\t\t\tactiveObjectLeft > objectLeft\r\n\t\t\t\t\t\t\t\t? activeObjectLeft + activeObjectWidth / 2 + this.aligningLineOffset\r\n\t\t\t\t\t\t\t\t: activeObjectLeft - activeObjectWidth / 2 - this.aligningLineOffset,\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\ttarget.setPositionByOrigin(new fabric.Point(activeObjectLeft, objectTop), 'center', 'center');\r\n\t\t\t}\r\n\r\n\t\t\t// snap by the top edge\r\n\t\t\tif (this.isInRange(objectTop - objectHeight / 2, activeObjectTop - activeObjectHeight / 2)) {\r\n\t\t\t\thorizontalInTheRange = true;\r\n\t\t\t\tif (canvasObjects[i].id === 'workarea') {\r\n\t\t\t\t\tconst workarea = canvasObjects[i] as WorkareaObject;\r\n\t\t\t\t\tconst x1 = -5000;\r\n\t\t\t\t\tconst x2 = 5000;\r\n\t\t\t\t\tlet y = objectTop - objectHeight / 2;\r\n\t\t\t\t\tif (workarea.layout === 'fullscreen') {\r\n\t\t\t\t\t\ty = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.horizontalLines.push({\r\n\t\t\t\t\t\ty,\r\n\t\t\t\t\t\tx1,\r\n\t\t\t\t\t\tx2,\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.horizontalLines.push({\r\n\t\t\t\t\t\ty: objectTop - objectHeight / 2,\r\n\t\t\t\t\t\tx1:\r\n\t\t\t\t\t\t\tobjectLeft < activeObjectLeft\r\n\t\t\t\t\t\t\t\t? objectLeft - objectWidth / 2 - this.aligningLineOffset\r\n\t\t\t\t\t\t\t\t: objectLeft + objectWidth / 2 + this.aligningLineOffset,\r\n\t\t\t\t\t\tx2:\r\n\t\t\t\t\t\t\tactiveObjectLeft > objectLeft\r\n\t\t\t\t\t\t\t\t? activeObjectLeft + activeObjectWidth / 2 + this.aligningLineOffset\r\n\t\t\t\t\t\t\t\t: activeObjectLeft - activeObjectWidth / 2 - this.aligningLineOffset,\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\ttarget.setPositionByOrigin(\r\n\t\t\t\t\tnew fabric.Point(activeObjectLeft, objectTop - objectHeight / 2 + activeObjectHeight / 2),\r\n\t\t\t\t\t'center',\r\n\t\t\t\t\t'center',\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\t// snap by the bottom edge\r\n\t\t\tif (this.isInRange(objectTop + objectHeight / 2, activeObjectTop + activeObjectHeight / 2)) {\r\n\t\t\t\thorizontalInTheRange = true;\r\n\t\t\t\tif (canvasObjects[i].id === 'workarea') {\r\n\t\t\t\t\tconst workarea = canvasObjects[i] as WorkareaObject;\r\n\t\t\t\t\tconst x1 = -5000;\r\n\t\t\t\t\tconst x2 = 5000;\r\n\t\t\t\t\tlet y = objectTop + objectHeight / 2;\r\n\t\t\t\t\tif (workarea.layout === 'fullscreen') {\r\n\t\t\t\t\t\ty = this.handler.canvas.getHeight();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.horizontalLines.push({\r\n\t\t\t\t\t\ty,\r\n\t\t\t\t\t\tx1,\r\n\t\t\t\t\t\tx2,\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.horizontalLines.push({\r\n\t\t\t\t\t\ty: objectTop + objectHeight / 2,\r\n\t\t\t\t\t\tx1:\r\n\t\t\t\t\t\t\tobjectLeft < activeObjectLeft\r\n\t\t\t\t\t\t\t\t? objectLeft - objectWidth / 2 - this.aligningLineOffset\r\n\t\t\t\t\t\t\t\t: objectLeft + objectWidth / 2 + this.aligningLineOffset,\r\n\t\t\t\t\t\tx2:\r\n\t\t\t\t\t\t\tactiveObjectLeft > objectLeft\r\n\t\t\t\t\t\t\t\t? activeObjectLeft + activeObjectWidth / 2 + this.aligningLineOffset\r\n\t\t\t\t\t\t\t\t: activeObjectLeft - activeObjectWidth / 2 - this.aligningLineOffset,\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\ttarget.setPositionByOrigin(\r\n\t\t\t\t\tnew fabric.Point(activeObjectLeft, objectTop + objectHeight / 2 - activeObjectHeight / 2),\r\n\t\t\t\t\t'center',\r\n\t\t\t\t\t'center',\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!horizontalInTheRange) {\r\n\t\t\tthis.horizontalLines.length = 0;\r\n\t\t}\r\n\r\n\t\tif (!verticalInTheRange) {\r\n\t\t\tthis.verticalLines.length = 0;\r\n\t\t}\r\n\t};\r\n\r\n\tscalingGuidelines = (_target: FabricObject) => {\r\n\t\t// TODO... object scaling guideline\r\n\t};\r\n}\r\n\r\nexport default GuidelineHandler;\r\n","import { WorkareaObject, FabricObjectOption } from \"../utils\";\r\n\r\nexport const canvasOption = {\r\n preserveObjectStacking: true,\r\n width: window.screen.width,\r\n height: window.screen.height,\r\n selection: true,\r\n defaultCursor: \"default\",\r\n backgroundColor: \"#fff\",\r\n enteredScaling: true,\r\n centeredRotation: true,\r\n};\r\n\r\nexport const keyEvent = {\r\n move: true,\r\n all: true,\r\n copy: true,\r\n paste: true,\r\n esc: true,\r\n del: true,\r\n clipboard: false,\r\n transaction: true,\r\n zoom: true,\r\n cut: true,\r\n};\r\n\r\nexport const gridOption = {\r\n enabled: false,\r\n grid: 10,\r\n snapToGrid: false,\r\n lineColor: \"#ebebeb\",\r\n borderColor: \"#cccccc\",\r\n};\r\n\r\nexport const workareaOption: Partial = {\r\n width: 0,\r\n height: 0,\r\n workareaWidth: 0,\r\n workareaHeight: 0,\r\n lockScalingX: true,\r\n lockScalingY: true,\r\n scaleX: 1,\r\n scaleY: 1,\r\n backgroundColor: \"#fff\",\r\n hasBorders: false,\r\n hasControls: false,\r\n selectable: false,\r\n lockMovementX: true,\r\n lockMovementY: true,\r\n hoverCursor: \"default\",\r\n name: \"\",\r\n id: \"workarea\",\r\n type: \"image\",\r\n layout: \"fixed\", // fixed, responsive, fullscreen\r\n link: {},\r\n tooltip: {\r\n enabled: false,\r\n },\r\n isElement: false,\r\n superType: \"workarea\",\r\n};\r\n\r\nexport const objectOption: Partial = {\r\n rotation: 0,\r\n centeredRotation: true,\r\n strokeUniform: true,\r\n};\r\n\r\nexport const guidelineOption = {\r\n enabled: true,\r\n};\r\n\r\nexport const activeSelectionOption = {\r\n hasControls: true,\r\n _controlsVisibility: {\r\n bl : false,\r\n br : false,\r\n mb : false,\r\n ml : false,\r\n mr : false,\r\n mt : false,\r\n mtr : true,\r\n tl : false,\r\n tr : false\r\n },\r\n subTargetCheck: true,\r\n hasBorders: false\r\n};\r\n\r\nexport const propertiesToInclude = [\r\n \"id\",\r\n \"name\",\r\n \"superType\",\r\n \"locked\",\r\n \"editable\",\r\n \"subTargetCheck\",\r\n \"hasControls\",\r\n \"visible\",\r\n \"seatsQuantity\",\r\n \"maxSeatsQuantity\",\r\n \"rowSize\",\r\n \"seatsSpacing\",\r\n \"distanceBetweenX\",\r\n \"distanceBetweenY\",\r\n \"category\",\r\n \"seat\",\r\n \"section\",\r\n \"row\",\r\n \"side\",\r\n \"label\",\r\n \"displayedLabel\",\r\n \"restrictedView\",\r\n \"companion\",\r\n \"accesible\",\r\n \"value\",\r\n \"isLabeled\",\r\n \"seatsCurve\",\r\n \"angleHelp\",\r\n \"angleType\",\r\n \"visibleIcon\",\r\n \"visibleText\",\r\n \"_controlsVisibility\",\r\n \"scaled\",\r\n \"originHeight\",\r\n \"originWidth\",\r\n \"rotated\",\r\n \"perPixelTargetFind\",\r\n \"checkFontWeight\",\r\n \"checkFontStyle\",\r\n \"strokeWidthShape\",\r\n \"lockMovementX\",\r\n \"lockMovementY\",\r\n \"selectable\",\r\n \"zoneID\",\r\n \"channel\"\r\n];\r\n","export const ESCAPE = 'Escape';\r\nexport const DELETE = 'Delete';\r\nexport const BACKSPACE = 'Backspace';\r\nexport const EQUAL = 'Equal';\r\nexport const MINUS = 'Minus';\r\nexport const KEY_A = 'KeyA';\r\nexport const KEY_Q = 'KeyQ';\r\nexport const KEY_W = 'KeyW';\r\nexport const KEY_C = 'KeyC';\r\nexport const KEY_V = 'KeyV';\r\nexport const KEY_Z = 'KeyZ';\r\nexport const KEY_Y = 'KeyY';\r\nexport const KEY_O = 'KeyO';\r\nexport const KEY_P = 'KeyP';\r\nexport const KEY_X = 'KeyX';\r\nexport const ARROW_UP = 'ArrowUp';\r\nexport const ARROW_DOWN = 'ArrowDown';\r\nexport const ARROW_LEFT = 'ArrowLeft';\r\nexport const ARROW_RIGHT = 'ArrowRight';\r\n","import { fabric } from \"fabric\";\r\nimport anime from \"animejs\";\r\n\r\nimport Handler from \"./Handler\";\r\nimport { FabricObject, FabricEvent, FabricGroup } from \"../utils\";\r\nimport { VideoObject } from \"../objects/fabric/Video\";\r\nimport { code } from \"../constants\";\r\n\r\n/**\r\n * Event Handler Class\r\n * @author salgum1114\r\n * @class EventHandler\r\n */\r\nclass EventHandler {\r\n handler: Handler;\r\n code: string;\r\n panning: boolean;\r\n prevX: number;\r\n prevY: number;\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n this.initialize();\r\n }\r\n\r\n /**\r\n * Attch event on document\r\n *\r\n */\r\n public initialize() {\r\n if (this.handler.editable) {\r\n this.handler.canvas.on({\r\n \"object:modified\": this.modified,\r\n \"object:scaling\": this.scaling,\r\n \"object:scaled\": this.scaled,\r\n \"object:moving\": this.moving,\r\n \"object:moved\": this.moved,\r\n \"object:rotating\": this.rotating,\r\n \"object:rotated\": this.rotated,\r\n \"mouse:wheel\": this.mousewheel,\r\n \"mouse:down\": this.mousedown,\r\n \"mouse:move\": this.mousemove,\r\n \"mouse:up\": this.mouseup,\r\n \"mouse:dblclick\": this.mousedblclick,\r\n \"selection:cleared\": this.selection,\r\n \"selection:created\": this.selection,\r\n \"selection:updated\": this.selection,\r\n });\r\n } else {\r\n this.handler.canvas.on({\r\n \"mouse:down\": this.mousedown,\r\n \"mouse:move\": this.mousemove,\r\n \"mouse:out\": this.mouseout,\r\n \"mouse:up\": this.mouseup,\r\n \"mouse:wheel\": this.mousewheel,\r\n \"selection:cleared\": this.selection,\r\n \"selection:created\": this.selection,\r\n \"selection:updated\": this.selection,\r\n });\r\n }\r\n this.handler.canvas.wrapperEl.tabIndex = 1000;\r\n this.handler.canvas.wrapperEl.addEventListener(\r\n \"keydown\",\r\n this.keydown,\r\n false\r\n );\r\n this.handler.canvas.wrapperEl.addEventListener(\"keyup\", this.keyup, false);\r\n this.handler.canvas.wrapperEl.addEventListener(\r\n \"mousedown\",\r\n this.onmousedown,\r\n false\r\n );\r\n this.handler.canvas.wrapperEl.addEventListener(\r\n \"contextmenu\",\r\n this.contextmenu,\r\n false\r\n );\r\n if (this.handler.keyEvent.clipboard) {\r\n document.addEventListener(\"paste\", this.paste, false);\r\n }\r\n }\r\n\r\n /**\r\n * Detach event on document\r\n *\r\n */\r\n public destroy = () => {\r\n if (this.handler.editable) {\r\n this.handler.canvas.off({\r\n \"object:modified\": this.modified,\r\n \"object:scaling\": this.scaling,\r\n \"object:moving\": this.moving,\r\n \"object:moved\": this.moved,\r\n \"object:rotating\": this.rotating,\r\n \"mouse:wheel\": this.mousewheel,\r\n \"mouse:down\": this.mousedown,\r\n \"mouse:move\": this.mousemove,\r\n \"mouse:up\": this.mouseup,\r\n \"selection:cleared\": this.selection,\r\n \"selection:created\": this.selection,\r\n \"selection:updated\": this.selection,\r\n });\r\n } else {\r\n this.handler.canvas.off({\r\n \"mouse:down\": this.mousedown,\r\n \"mouse:move\": this.mousemove,\r\n \"mouse:out\": this.mouseout,\r\n \"mouse:up\": this.mouseup,\r\n \"mouse:wheel\": this.mousewheel,\r\n \"selection:cleared\": this.selection,\r\n \"selection:created\": this.selection,\r\n \"selection:updated\": this.selection,\r\n });\r\n this.handler.getObjects().forEach((object) => {\r\n object.off(\"mousedown\", this.handler.eventHandler.object.mousedown);\r\n if (object.anime) {\r\n anime.remove(object);\r\n }\r\n });\r\n }\r\n this.handler.canvas.wrapperEl.removeEventListener(\"keydown\", this.keydown);\r\n this.handler.canvas.wrapperEl.removeEventListener(\"keyup\", this.keyup);\r\n this.handler.canvas.wrapperEl.removeEventListener(\r\n \"mousedown\",\r\n this.onmousedown\r\n );\r\n this.handler.canvas.wrapperEl.removeEventListener(\r\n \"contextmenu\",\r\n this.contextmenu\r\n );\r\n if (this.handler.keyEvent.clipboard) {\r\n this.handler.canvas.wrapperEl.removeEventListener(\"paste\", this.paste);\r\n }\r\n };\r\n\r\n /**\r\n * Individual object event\r\n *\r\n */\r\n public object = {\r\n /**\r\n * Mouse down event on object\r\n * @param {FabricEvent} opt\r\n */\r\n mousedown: (opt: FabricEvent) => {\r\n console.log(\"object mousedown\")\r\n if (\r\n this.handler.interactionMode === \"selector\"\r\n ) {\r\n // if (!this.handler.canvasEnabled) {\r\n // if (opt.target.superType === \"row\") {\r\n // this.handler.zoomHandler.zoomToCenterWithObject(\r\n // opt.target,\r\n // { x: opt.pointer.x, y: opt.pointer.y },\r\n // true\r\n // );\r\n // }\r\n // }\r\n const event = opt as FabricEvent;\r\n if (this.handler.interactionMode === \"selector\")\r\n this.handler.selectorHandler.onMousedown(event);\r\n }\r\n },\r\n /**\r\n * Mouse double click event on object\r\n * @param {FabricEvent} opt\r\n */\r\n mousedblclick: (opt: FabricEvent) => {\r\n const { target } = opt;\r\n if (target) {\r\n const { onDblClick } = this.handler;\r\n if (onDblClick) {\r\n onDblClick(this.handler.canvas, target);\r\n }\r\n }\r\n },\r\n };\r\n\r\n /**\r\n * Modified event object\r\n *\r\n * @param {FabricEvent} opt\r\n * @returns\r\n */\r\n public modified = (opt: FabricEvent) => {\r\n const { target } = opt;\r\n if (!target) {\r\n return;\r\n }\r\n if (target.type === \"ellipse\" && target.parentId) {\r\n return;\r\n }\r\n const { onModified } = this.handler;\r\n if (onModified) {\r\n onModified(target);\r\n }\r\n };\r\n\r\n /**\r\n * Moving event object\r\n *\r\n * @param {FabricEvent} opt\r\n * @returns\r\n */\r\n public moving = (opt: FabricEvent) => {\r\n const { target } = opt as any;\r\n if (this.handler.interactionMode === \"crop\") {\r\n this.handler.cropHandler.moving(opt);\r\n } else {\r\n if (this.handler.editable && this.handler.guidelineOption.enabled) {\r\n this.handler.guidelineHandler.movingGuidelines(target);\r\n }\r\n if (target.type === \"activeSelection\") {\r\n const activeSelection = target as fabric.ActiveSelection;\r\n activeSelection.getObjects().forEach((obj: any) => {\r\n const left = target.left + obj.left + target.width / 2;\r\n const top = target.top + obj.top + target.height / 2;\r\n if (obj.superType === \"node\") {\r\n this.handler.portHandler.setCoords({ ...obj, left, top });\r\n } else if (obj.superType === \"element\") {\r\n const { id } = obj;\r\n const el = this.handler.elementHandler.findById(id);\r\n // TODO... Element object incorrect position\r\n this.handler.elementHandler.setPositionByOrigin(el, obj, left, top);\r\n }\r\n });\r\n return;\r\n }\r\n if (target.superType === \"node\") {\r\n this.handler.portHandler.setCoords(target);\r\n } else if (target.superType === \"element\") {\r\n const { id } = target;\r\n const el = this.handler.elementHandler.findById(id);\r\n this.handler.elementHandler.setPosition(el, target);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Moved event object\r\n *\r\n * @param {FabricEvent} opt\r\n */\r\n public moved = (opt: FabricEvent) => {\r\n const { target } = opt;\r\n this.handler.gridHandler.setCoords(target);\r\n if (!this.handler.transactionHandler.active) {\r\n this.handler.transactionHandler.save(\"moved\");\r\n }\r\n if (target.superType === \"element\") {\r\n const { id } = target;\r\n const el = this.handler.elementHandler.findById(id);\r\n this.handler.elementHandler.setPosition(el, target);\r\n }\r\n if(target.type === \"activeSelection\"){\r\n this.handler.drawingHandler.setType(\"activeSelection\")\r\n }\r\n };\r\n\r\n /**\r\n * Scaling event object\r\n *\r\n * @param {FabricEvent} opt\r\n */\r\n public scaling = (opt: FabricEvent) => {\r\n const { target } = opt as any;\r\n if (this.handler.interactionMode === \"crop\") {\r\n this.handler.cropHandler.resize(opt);\r\n }\r\n // TODO...this.handler.guidelineHandler.scalingGuidelines(target);\r\n if (target.superType === \"element\") {\r\n const { id, width, height } = target;\r\n const el = this.handler.elementHandler.findById(id);\r\n // update the element\r\n this.handler.elementHandler.setScaleOrAngle(el, target);\r\n this.handler.elementHandler.setSize(el, target);\r\n this.handler.elementHandler.setPosition(el, target);\r\n const video = target as VideoObject;\r\n if (video.type === \"video\" && video.player) {\r\n video.player.setPlayerSize(width, height);\r\n }\r\n }\r\n target.addWithUpdate();\r\n target.setCoords();\r\n };\r\n\r\n /**\r\n * Scaled event object\r\n *\r\n * @param {FabricEvent} opt\r\n */\r\n public scaled = (_opt: FabricEvent) => {\r\n const { target } = _opt as any;\r\n let group = target as FabricGroup;\r\n if (target && target.item(0).type === \"ellipse\") {\r\n group.addWithUpdate();\r\n group.setCoords();\r\n }\r\n if (!this.handler.transactionHandler.active) {\r\n this.handler.transactionHandler.save(\"scaled\");\r\n }\r\n };\r\n\r\n /**\r\n * Rotating event object\r\n *\r\n * @param {FabricEvent} opt\r\n */\r\n public rotating = (opt: FabricEvent) => {\r\n const { target } = opt as any;\r\n target.set({\r\n newAngle: target.angle,\r\n });\r\n if (target.superType === \"element\") {\r\n const { id } = target;\r\n const el = this.handler.elementHandler.findById(id);\r\n // update the element\r\n this.handler.elementHandler.setScaleOrAngle(el, target);\r\n }\r\n };\r\n\r\n /**\r\n * Rotated event object\r\n *\r\n * @param {FabricEvent} opt\r\n */\r\n public rotated = (event: FabricEvent) => {\r\n if (!this.handler.transactionHandler.active) {\r\n this.handler.transactionHandler.save(\"rotated\");\r\n }\r\n if (this.handler.interactionMode === \"selection\") {\r\n this.handler.drawingHandler.onRotated(event);\r\n }\r\n };\r\n\r\n /**\r\n * Moing object at keyboard arrow key down event\r\n *\r\n * @param {KeyboardEvent} e\r\n * @returns\r\n */\r\n public arrowmoving = (e: KeyboardEvent) => {\r\n const activeObject = this.handler.canvas.getActiveObject() as FabricObject;\r\n if (!activeObject) {\r\n return false;\r\n }\r\n if (activeObject.id === \"workarea\") {\r\n return false;\r\n }\r\n if (e.code === code.ARROW_UP) {\r\n activeObject.set(\"top\", activeObject.top - 2);\r\n activeObject.setCoords();\r\n this.handler.canvas.renderAll();\r\n return true;\r\n } else if (e.code === code.ARROW_DOWN) {\r\n activeObject.set(\"top\", activeObject.top + 2);\r\n activeObject.setCoords();\r\n this.handler.canvas.renderAll();\r\n return true;\r\n } else if (e.code === code.ARROW_LEFT) {\r\n activeObject.set(\"left\", activeObject.left - 2);\r\n activeObject.setCoords();\r\n this.handler.canvas.renderAll();\r\n return true;\r\n } else if (e.code === code.ARROW_RIGHT) {\r\n activeObject.set(\"left\", activeObject.left + 2);\r\n activeObject.setCoords();\r\n this.handler.canvas.renderAll();\r\n return true;\r\n }\r\n if (this.handler.onModified) {\r\n this.handler.onModified(activeObject);\r\n }\r\n return true;\r\n };\r\n\r\n /**\r\n * Zoom at mouse wheel event\r\n *\r\n * @param {FabricEvent} opt\r\n * @returns\r\n */\r\n public mousewheel = (opt: FabricEvent) => {\r\n const event = opt as FabricEvent;\r\n const { zoomEnabled } = this.handler;\r\n if (!zoomEnabled) {\r\n return;\r\n }\r\n const delta = event.e.deltaY;\r\n let zoomRatio = this.handler.canvas.getZoom();\r\n if (delta > 0) {\r\n zoomRatio -= 0.05;\r\n } else {\r\n zoomRatio += 0.05;\r\n }\r\n this.handler.zoomHandler.zoomToPoint(\r\n new fabric.Point(\r\n this.handler.canvas.getWidth() / 2,\r\n this.handler.canvas.getHeight() / 2\r\n ),\r\n zoomRatio\r\n );\r\n event.e.preventDefault();\r\n event.e.stopPropagation();\r\n };\r\n\r\n /**\r\n * Mouse down event on object\r\n *\r\n * @param {FabricEvent} opt\r\n * @returns\r\n */\r\n public mousedown = (opt: FabricEvent) => {\r\n const event = opt as FabricEvent;\r\n const { editable } = this.handler;\r\n if (editable) {\r\n const { target, subTargets } = event;\r\n this.panning = this.handler.enablePanning;\r\n console.log('target', target)\r\n if (this.handler.interactionMode === \"blocker\" && event.target!= null && this.panning){\r\n this.handler.blockerHandler.onMousedown(event);\r\n return;\r\n }\r\n\r\n if (this.handler.interactionMode === \"channel\" && event.target!= null && this.panning){\r\n this.handler.channelHandler.onMousedown(event);\r\n return;\r\n }\r\n\r\n\r\n if ((this.handler.interactionMode !== \"blocker\" && this.handler.interactionMode !== \"channel\") && event.e.altKey) {\r\n this.handler.interactionHandler.grab();\r\n this.panning = true;\r\n return;\r\n }\r\n\r\n if (this.handler.interactionMode === \"grab\") {\r\n this.panning = true;\r\n return;\r\n }\r\n\r\n if (\r\n this.handler.selectedTarget &&\r\n this.handler.selectedTarget.superType === \"link\"\r\n ) {\r\n this.handler.selectedTarget.set({\r\n stroke: this.handler.selectedTarget.originStroke,\r\n });\r\n }\r\n\r\n if (target && target.type === \"fromPort\") {\r\n this.handler.linkHandler.init(target);\r\n return;\r\n }\r\n\r\n if (\r\n target &&\r\n this.handler.interactionMode === \"link\" &&\r\n (target.type === \"toPort\" || target.superType === \"node\")\r\n ) {\r\n let toPort;\r\n if (target.superType === \"node\") {\r\n toPort = target.toPort;\r\n } else {\r\n toPort = target;\r\n }\r\n this.handler.linkHandler.generate(toPort);\r\n return;\r\n }\r\n this.handler.guidelineHandler.viewportTransform = this.handler.canvas.viewportTransform;\r\n this.handler.guidelineHandler.zoom = this.handler.canvas.getZoom();\r\n if (this.handler.interactionMode === \"selection\") {\r\n if (target && target.superType === \"link\") {\r\n target.set({\r\n stroke: target.selectFill || \"green\",\r\n });\r\n }\r\n if (target) {\r\n console.log('if target');\r\n if(target.superType === \"polygonZone\"){\r\n if(subTargets.length === 3){\r\n this.handler.canvas.setActiveObject(subTargets[2]);\r\n this.handler.selectedTarget = subTargets[2];\r\n this.handler.drawingHandler.setType(subTargets[2].superType);\r\n return;\r\n }\r\n }\r\n this.handler.selectedTarget = target;\r\n this.handler.drawingHandler.setType(target.superType);\r\n return;\r\n }\r\n }\r\n console.log('this.handler.interactionMode', this.handler.interactionMode)\r\n if (this.handler.interactionMode === \"seatSelection\") {\r\n if (subTargets && subTargets[1] && subTargets[1].superType === \"seat\" && subTargets[1].selectable ) {\r\n this.handler.canvas.setActiveObject(subTargets[1]);\r\n this.handler.canvas.requestRenderAll();\r\n this.handler.drawingHandler.setType(target.superType);\r\n }\r\n return;\r\n }\r\n\r\n this.handler.originPointer = this.handler.canvas.getPointer(event.e);\r\n if (this.handler.interactionMode === \"drawing\") {\r\n this.handler.canvas.discardActiveObject();\r\n this.handler.drawingHandler.onMousedown(event);\r\n }\r\n } else {\r\n this.panning = true;\r\n if (event.e instanceof TouchEvent) {\r\n const { clientX, clientY } = event.e.touches[0];\r\n this.prevX = clientX;\r\n this.prevY = clientY;\r\n this.handler.selectorHandler.onBlur();\r\n }\r\n\r\n }\r\n };\r\n\r\n public mousedblclick = (opt: FabricEvent) => {\r\n const {target} = opt;\r\n if(!target) return;\r\n if(target.superType.includes(\"Zone\")){\r\n this.handler.isZoneActive = true;\r\n this.handler.drawingHandler.setType(target.superType);\r\n this.handler.drawingHandler.onMouseDblClick(opt);\r\n }\r\n }\r\n /**\r\n * Mouse move event on canvas\r\n *\r\n * @param {FabricEvent} opt\r\n * @returns\r\n */\r\n public mousemove = (opt: FabricEvent) => {\r\n const event = opt as FabricEvent;\r\n if (this.handler.editable) {\r\n if (\r\n this.handler.interactionMode === \"blocker\" &&\r\n this.handler.canvasEnabled\r\n ) {\r\n if (this.panning) {\r\n this.handler.interactionHandler.moving(event.e);\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n if(this.handler.enablePanning){\r\n this.handler.blockerHandler.onMousemove(event);\r\n }\r\n }\r\n if (\r\n this.handler.interactionMode === \"channel\" &&\r\n this.handler.canvasEnabled\r\n ) {\r\n if (this.panning) {\r\n this.handler.interactionHandler.moving(event.e);\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n if(this.handler.enablePanning){\r\n this.handler.channelHandler.onMousemove(event);\r\n }\r\n }\r\n if (this.handler.interactionMode === \"grab\" && this.panning) {\r\n this.handler.interactionHandler.moving(event.e);\r\n this.handler.canvas.requestRenderAll();\r\n return;\r\n }\r\n if (this.handler.interactionMode === \"drawing\") {\r\n this.handler.drawingHandler.onMousemove(event);\r\n }\r\n } else {\r\n if (this.panning) {\r\n this.handler.interactionHandler.moving(event.e);\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n\r\n if (this.handler.interactionMode === \"preview\") {\r\n this.handler.previewHandler.onMousemove(event);\r\n }\r\n\r\n if (\r\n this.handler.interactionMode === \"selector\" &&\r\n this.handler.canvasEnabled\r\n ) {\r\n this.handler.selectorHandler.onMousemove(event);\r\n }\r\n\r\n if (\r\n this.handler.interactionMode === \"detail\" &&\r\n this.handler.canvasEnabled\r\n ) {\r\n this.handler.detailHandler.onMousemove(event);\r\n }\r\n }\r\n };\r\n\r\n public mouseout = (opt: FabricEvent) => {\r\n const event = opt as FabricEvent;\r\n if (\r\n this.handler.interactionMode === \"selector\" &&\r\n this.handler.canvasEnabled\r\n ) {\r\n this.handler.selectorHandler.onMouseOut();\r\n }\r\n if (\r\n this.handler.interactionMode === \"blocker\" &&\r\n this.handler.canvasEnabled\r\n ) {\r\n this.handler.blockerHandler.onMouseOut();\r\n }\r\n if (\r\n this.handler.interactionMode === \"channel\" &&\r\n this.handler.canvasEnabled\r\n ) {\r\n this.handler.channelHandler.onMouseOut();\r\n }\r\n };\r\n\r\n /**\r\n * Mouse up event on canvas\r\n *\r\n * @param {FabricEvent} opt\r\n * @returns\r\n */\r\n public mouseup = (opt: FabricEvent) => {\r\n const event = opt as FabricEvent;\r\n\r\n if (this.handler.editable) {\r\n if (this.handler.interactionMode === \"seatSelection\") {\r\n // this.handler.canvas.discardActiveObject();\r\n }\r\n if (this.handler.interactionMode === \"grab\") {\r\n this.panning = false;\r\n return;\r\n }\r\n\r\n if (this.handler.interactionMode === \"drawing\") {\r\n this.handler.drawingHandler.onMouseup(event);\r\n }\r\n\r\n if (this.handler.guidelineOption.enabled) {\r\n this.handler.guidelineHandler.verticalLines.length = 0;\r\n this.handler.guidelineHandler.horizontalLines.length = 0;\r\n }\r\n if(this.handler.interactionMode == \"blocker\"){\r\n this.panning = false;\r\n }\r\n\r\n if(this.handler.interactionMode == \"channel\"){\r\n this.panning = false;\r\n }\r\n this.handler.canvas.renderAll();\r\n } else this.panning = false;\r\n };\r\n\r\n // /**\r\n // * Mouse out event on canvas\r\n // *\r\n // * @param {FabricEvent} opt\r\n // */\r\n // public mouseout = (opt: FabricEvent) => {\r\n // debugger\r\n // const event = opt as FabricEvent;\r\n // if (!event.target) {\r\n // this.handler.tooltipHandler.hide();\r\n // }\r\n // };\r\n\r\n /**\r\n * Selection event event on canvas\r\n *\r\n * @param {FabricEvent} opt\r\n */\r\n public selection = (opt: FabricEvent) => {\r\n if(this.handler.enablePanning){\r\n this.handler.canvas.discardActiveObject();\r\n return;\r\n }\r\n const { onSelect, activeSelectionOption } = this.handler;\r\n const target = opt.target as FabricObject;\r\n if (target && target.type === \"activeSelection\") {\r\n if(this.handler.interactionMode === \"seatSelection\"){\r\n this.handler.canvas.discardActiveObject();\r\n return;\r\n }\r\n target.set({\r\n ...activeSelectionOption,\r\n });\r\n target.setControlsVisibility({\r\n tl: false, //top-left\r\n mt: false, // middle-top\r\n tr: false, //top-right\r\n ml: false, //middle-left\r\n mr: false, //middle-right\r\n bl: false, // bottom-left\r\n mb: false, //middle-bottom\r\n br: false, //bottom-right\r\n mtr: true,\r\n });\r\n if(this.handler.interactionMode == \"selection\"){\r\n this.handler.selectedTarget = target;\r\n this.handler.drawingHandler.setType(target.type);\r\n }\r\n if(this.handler.interactionMode === \"blocker\" || this.handler.interactionMode === \"channel\" ){\r\n target.hasControls = false;\r\n target.lockMovementX = true;\r\n target.lockMovementY = true;\r\n switch (this.handler.interactionMode) {\r\n case \"blocker\" :\r\n this.handler.blockerHandler.onSelection(opt);\r\n break;\r\n case \"channel\" :\r\n this.handler.channelHandler.onSelection(opt);\r\n break;\r\n }\r\n }\r\n }\r\n if (onSelect) {\r\n onSelect(target);\r\n }\r\n };\r\n\r\n /**\r\n * Called resize event on canvas\r\n *\r\n * @param {number} nextWidth\r\n * @param {number} nextHeight\r\n * @returns\r\n */\r\n public resize = (\r\n nextWidth: number,\r\n nextHeight: number,\r\n centerWorkarea?: boolean\r\n ) => {\r\n this.handler.canvas.setWidth(nextWidth).setHeight(nextHeight);\r\n this.handler.canvas.setBackgroundColor(\r\n this.handler.canvasOption.backgroundColor,\r\n this.handler.canvas.renderAll.bind(this.handler.canvas)\r\n );\r\n if (!this.handler.workarea) {\r\n return;\r\n }\r\n const diffWidth = nextWidth / 2 - this.handler.width / 2;\r\n const diffHeight = nextHeight / 2 - this.handler.height / 2;\r\n this.handler.width = nextWidth;\r\n this.handler.height = nextHeight;\r\n if (this.handler.workarea.layout === \"fixed\") {\r\n if (centerWorkarea) {\r\n this.handler.canvas.centerObject(this.handler.workarea);\r\n this.handler.workarea.setCoords();\r\n }\r\n if (this.handler.gridOption.enabled) {\r\n return;\r\n }\r\n this.handler.canvas.getObjects().forEach((obj: FabricObject) => {\r\n if (obj.id !== \"workarea\") {\r\n // const left = obj.left + diffWidth;\r\n // const top = obj.top + diffHeight;\r\n // obj.set({\r\n // left: left,\r\n // top: top,\r\n // });\r\n // obj.setCoords();\r\n // if(obj.group){\r\n // console.log('update')\r\n // obj.addWithUpdate()\r\n // }\r\n // console.log('OBJ')\r\n }\r\n });\r\n this.handler.canvas.requestRenderAll();\r\n return;\r\n }\r\n if (this.handler.workarea.layout === \"responsive\") {\r\n const { scaleX } = this.handler.workareaHandler.calculateScale();\r\n const center = this.handler.canvas.getCenter();\r\n const deltaPoint = new fabric.Point(diffWidth, diffHeight);\r\n this.handler.canvas.relativePan(deltaPoint);\r\n this.handler.zoomHandler.zoomToPoint(\r\n new fabric.Point(center.left, center.top),\r\n scaleX\r\n );\r\n return;\r\n }\r\n const scaleX = nextWidth / this.handler.workarea.width;\r\n const scaleY = nextHeight / this.handler.workarea.height;\r\n const diffScaleX =\r\n nextWidth / (this.handler.workarea.width * this.handler.workarea.scaleX);\r\n const diffScaleY =\r\n nextHeight /\r\n (this.handler.workarea.height * this.handler.workarea.scaleY);\r\n this.handler.workarea.set({\r\n scaleX,\r\n scaleY,\r\n });\r\n this.handler.canvas.getObjects().forEach((obj: any) => {\r\n const { id } = obj;\r\n if (obj.id !== \"workarea\") {\r\n const left = obj.left * diffScaleX;\r\n const top = obj.top * diffScaleY;\r\n const newScaleX = obj.scaleX * diffScaleX;\r\n const newScaleY = obj.scaleY * diffScaleY;\r\n obj.set({\r\n scaleX: newScaleX,\r\n scaleY: newScaleY,\r\n left,\r\n top,\r\n });\r\n obj.setCoords();\r\n if (obj.superType === \"element\") {\r\n const video = obj as VideoObject;\r\n const { width, height } = obj;\r\n const el = this.handler.elementHandler.findById(id);\r\n this.handler.elementHandler.setSize(el, obj);\r\n if (video.player) {\r\n video.player.setPlayerSize(width, height);\r\n }\r\n this.handler.elementHandler.setPosition(el, obj);\r\n }\r\n }\r\n });\r\n this.handler.canvas.renderAll();\r\n };\r\n\r\n /**\r\n * Paste event on canvas\r\n *\r\n * @param {ClipboardEvent} e\r\n * @returns\r\n */\r\n public paste = async (e: ClipboardEvent) => {\r\n if (this.handler.canvas.wrapperEl !== document.activeElement) {\r\n return false;\r\n }\r\n if (e.preventDefault) {\r\n e.preventDefault();\r\n }\r\n if (e.stopPropagation) {\r\n e.stopPropagation();\r\n }\r\n const clipboardData = e.clipboardData;\r\n if (clipboardData.types.length) {\r\n clipboardData.types.forEach((clipboardType: string) => {\r\n if (clipboardType === \"text/plain\") {\r\n const textPlain = clipboardData.getData(\"text/plain\");\r\n try {\r\n const objects = JSON.parse(textPlain);\r\n const {\r\n gridOption: { grid = 10 },\r\n isCut,\r\n } = this.handler;\r\n const padding = isCut ? 0 : grid;\r\n if (objects && Array.isArray(objects)) {\r\n const filteredObjects = objects.filter((obj) => obj !== null);\r\n if (filteredObjects.length === 1) {\r\n const obj = filteredObjects[0];\r\n if (typeof obj.cloneable !== \"undefined\" && !obj.cloneable) {\r\n return;\r\n }\r\n obj.left = obj.properties.left + padding;\r\n obj.top = obj.properties.top + padding;\r\n const createdObj = this.handler.add(obj, false, true);\r\n this.handler.canvas.setActiveObject(createdObj as FabricObject);\r\n this.handler.canvas.requestRenderAll();\r\n } else {\r\n const nodes = [] as any[];\r\n const targets = [] as any[];\r\n objects.forEach((obj) => {\r\n if (!obj) {\r\n return;\r\n }\r\n if (obj.superType === \"link\") {\r\n obj.fromNodeId = nodes[obj.fromNodeIndex].id;\r\n obj.toNodeId = nodes[obj.toNodeIndex].id;\r\n } else {\r\n obj.left = obj.properties.left + padding;\r\n obj.top = obj.properties.top + padding;\r\n }\r\n const createdObj = this.handler.add(obj, false, true);\r\n if (obj.superType === \"node\") {\r\n nodes.push(createdObj);\r\n } else {\r\n targets.push(createdObj);\r\n }\r\n });\r\n const activeSelection = new fabric.ActiveSelection(\r\n nodes.length ? nodes : targets,\r\n {\r\n canvas: this.handler.canvas,\r\n ...this.handler.activeSelectionOption,\r\n }\r\n );\r\n this.handler.canvas.setActiveObject(activeSelection);\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n if (!this.handler.transactionHandler.active) {\r\n this.handler.transactionHandler.save(\"paste\");\r\n }\r\n this.handler.isCut = false;\r\n this.handler.copy();\r\n }\r\n } catch (error) {\r\n console.error(error);\r\n // const item = {\r\n // id: uuv4id(),\r\n // type: 'textbox',\r\n // text: textPlain,\r\n // };\r\n // this.handler.add(item, true);\r\n }\r\n } else if (clipboardType === \"text/html\") {\r\n // Todo ...\r\n // const textHtml = clipboardData.getData('text/html');\r\n // console.log(textHtml);\r\n } else if (clipboardType === \"Files\") {\r\n // Array.from(clipboardData.files).forEach((file) => {\r\n // const { type } = file;\r\n // if (type === 'image/png' || type === 'image/jpeg' || type === 'image/jpg') {\r\n // const item = {\r\n // id: v4(),\r\n // type: 'image',\r\n // file,\r\n // superType: 'image',\r\n // };\r\n // this.handler.add(item, true);\r\n // } else {\r\n // console.error('Not supported file type');\r\n // }\r\n // });\r\n }\r\n });\r\n }\r\n return true;\r\n };\r\n\r\n /**\r\n * Keydown event on document\r\n *\r\n * @param {KeyboardEvent} e\r\n */\r\n public keydown = (e: KeyboardEvent) => {\r\n const { keyEvent, editable } = this.handler;\r\n if (!Object.keys(keyEvent).length) {\r\n return;\r\n }\r\n this.handler.deleteIncompletePolygon();\r\n const { clipboard } = keyEvent;\r\n if (this.handler.interactionHandler.isDrawingMode()) {\r\n if (this.handler.shortcutHandler.isEscape(e)) {\r\n // if (this.handler.selectedObject === \"polygon\") {\r\n // this.handler.shapeHandler.polygon.finish();\r\n // } else if (this.handler.selectedObject === \"line\") {\r\n // this.handler.drawingHandler.line.finish();\r\n // } else if (this.handler.selectedObject === \"arrow\") {\r\n // this.handler.drawingHandler.arrow.finish();\r\n // } else if (this.handler.interactionMode === \"link\") {\r\n // this.handler.linkHandler.finish();\r\n // }\r\n }\r\n return;\r\n }\r\n if (this.handler.interactionMode === \"seatSelection\") {\r\n return;\r\n }\r\n if (this.handler.shortcutHandler.isW(e)) {\r\n this.code = e.code;\r\n this.handler.interactionHandler.grab();\r\n return;\r\n }\r\n if (e.altKey && editable && this.handler.interactionMode !== \"blocker\") {\r\n this.handler.interactionHandler.grab();\r\n return;\r\n }\r\n if (this.handler.shortcutHandler.isEscape(e)) {\r\n if (this.handler.interactionMode === \"selection\") {\r\n this.handler.canvas.discardActiveObject();\r\n this.handler.canvas.renderAll();\r\n }\r\n this.handler.tooltipHandler.hide();\r\n }\r\n if (this.handler.canvas.wrapperEl !== document.activeElement) {\r\n return;\r\n }\r\n if (editable && this.handler.interactionMode !== \"blocker\") {\r\n if (this.handler.shortcutHandler.isQ(e)) {\r\n this.code = e.code;\r\n } else if (this.handler.shortcutHandler.isDelete(e)) {\r\n this.handler.remove();\r\n } else if (this.handler.shortcutHandler.isArrow(e)) {\r\n this.arrowmoving(e);\r\n } else if (this.handler.shortcutHandler.isCtrlA(e)) {\r\n e.preventDefault();\r\n this.handler.selectAll();\r\n } else if (this.handler.shortcutHandler.isCtrlC(e)) {\r\n e.preventDefault();\r\n this.handler.copy();\r\n } else if (this.handler.shortcutHandler.isCtrlV(e) && !clipboard) {\r\n e.preventDefault();\r\n this.handler.paste();\r\n } else if (this.handler.shortcutHandler.isCtrlX(e)) {\r\n e.preventDefault();\r\n this.handler.cut();\r\n } else if (this.handler.shortcutHandler.isCtrlZ(e)) {\r\n e.preventDefault();\r\n this.handler.transactionHandler.undo();\r\n } else if (this.handler.shortcutHandler.isCtrlY(e)) {\r\n e.preventDefault();\r\n this.handler.transactionHandler.redo();\r\n } else if (this.handler.shortcutHandler.isPlus(e)) {\r\n e.preventDefault();\r\n this.handler.zoomHandler.zoomIn();\r\n } else if (this.handler.shortcutHandler.isMinus(e)) {\r\n e.preventDefault();\r\n this.handler.zoomHandler.zoomOut();\r\n } else if (this.handler.shortcutHandler.isO(e)) {\r\n e.preventDefault();\r\n this.handler.zoomHandler.zoomOneToOne();\r\n } else if (this.handler.shortcutHandler.isP(e)) {\r\n e.preventDefault();\r\n this.handler.zoomHandler.zoomToFit();\r\n }\r\n return;\r\n }\r\n return;\r\n };\r\n\r\n /**\r\n * Key up event on canvas\r\n *\r\n * @param {KeyboardEvent} _e\r\n */\r\n public keyup = (e: KeyboardEvent) => {\r\n if (this.handler.interactionHandler.isDrawingMode()) {\r\n return;\r\n }\r\n if (!this.handler.shortcutHandler.isW(e)) {\r\n this.handler.interactionHandler.selection();\r\n }\r\n };\r\n\r\n /**\r\n * Context menu event on canvas\r\n *\r\n * @param {MouseEvent} e\r\n */\r\n public contextmenu = (e: MouseEvent) => {\r\n if (this.handler.interactionMode === \"seatSelection\") {\r\n return;\r\n }\r\n e.preventDefault();\r\n const { editable, onContext } = this.handler;\r\n if (editable && onContext) {\r\n const target = this.handler.canvas.findTarget(e, false) as FabricObject;\r\n if (target && target.type !== \"activeSelection\") {\r\n this.handler.select(target);\r\n }\r\n this.handler.contextmenuHandler.show(e, target);\r\n }\r\n };\r\n\r\n /**\r\n * Mouse down event on canvas\r\n *\r\n * @param {MouseEvent} _e\r\n */\r\n public onmousedown = (_e: MouseEvent) => {\r\n this.handler.contextmenuHandler.hide();\r\n };\r\n}\r\n\r\nexport default EventHandler;\r\n","import { fabric } from \"fabric\";\r\nimport { Handler } from \"../../../handlers\";\r\n\r\nclass ShapeProperties {\r\n public handler: Handler;\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n public updateProperties = (\r\n propertyName: string,\r\n newValue: any,\r\n allValuesForm: any,\r\n selectedItem: any\r\n ) => {\r\n let shape: any, text: any, icon: any, left: any, top: any;\r\n const old = {...selectedItem};\r\n // const {left, top} = {...selectedItem.item(1)}\r\n switch (propertyName) {\r\n case \"textText\":\r\n case \"displayedLabelText\":\r\n case \"leftText\":\r\n case \"topText\":\r\n case \"fontSizeText\":\r\n case \"fillText\":\r\n case \"angleText\":\r\n case \"visibleText\":\r\n text = selectedItem.item(1);\r\n break;\r\n default:\r\n console.log(\"La propiedad no corresponde a un obj texto\");\r\n break;\r\n }\r\n switch (propertyName) {\r\n case \"typeIconIcon\":\r\n case \"leftIcon\":\r\n case \"topIcon\":\r\n case \"fontIcon\":\r\n case \"fillIcon\":\r\n case \"rotateIcon\":\r\n case \"scaled\":\r\n case \"visibleIcon\":\r\n icon = selectedItem.item(2);\r\n break;\r\n default:\r\n console.log(\"La propiedad no corresponde a un obj svg\");\r\n break;\r\n }\r\n switch (propertyName) {\r\n case \"name\":\r\n case \"locked\":\r\n case \"rx\":\r\n case \"ry\":\r\n case \"height\":\r\n case \"width\":\r\n case \"left\":\r\n case \"top\":\r\n case \"opacity\":\r\n case \"angle\":\r\n case \"fill\":\r\n case \"strokeWidthShape\":\r\n case \"stroke\":\r\n case \"borderRadius\":\r\n shape = selectedItem.item(0);\r\n break;\r\n default:\r\n console.log(\"La propiedad no corresponde a un obj figura\");\r\n break;\r\n }\r\n\r\n const activeObject = this.handler.canvas.getActiveObject();\r\n // aqui se modifica la propiedad\r\n switch (propertyName) {\r\n case \"angle\":\r\n selectedItem.rotate(newValue);\r\n // selectedItem.addWithUpdate();\r\n selectedItem.setCoords();\r\n break;\r\n case \"name\":\r\n case \"left\":\r\n case \"top\":\r\n case \"opacity\":\r\n shape.set(propertyName, newValue);\r\n selectedItem.setCoords();\r\n break;\r\n case \"rx\":\r\n case \"ry\":\r\n shape.set(propertyName, newValue);\r\n shape.setCoords();\r\n selectedItem.addWithUpdate();\r\n break;\r\n case \"height\":\r\n case \"width\":\r\n shape.set(propertyName, newValue);\r\n shape.setCoords();\r\n selectedItem.addWithUpdate();\r\n break;\r\n case \"strokeWidthShape\":\r\n if(typeof newValue == 'string' || newValue == null || isNaN(newValue) || newValue < 1){\r\n newValue = 1;\r\n }\r\n if(newValue > 30){\r\n newValue = 30\r\n }\r\n shape.set(\"strokeWidth\", newValue);\r\n selectedItem.addWithUpdate();\r\n let widthDiff = Math.abs(selectedItem.width-old.width);\r\n let heightDiff = Math.abs(selectedItem.height-old.height);\r\n selectedItem.set({\r\n left: selectedItem.width>old.width ? old.left-widthDiff/2 : old.left+widthDiff/2,\r\n top: selectedItem.height>old.height ? old.top-heightDiff/2 : old.top+heightDiff/2,\r\n });\r\n selectedItem.addWithUpdate();\r\n selectedItem.setCoords();\r\n break;\r\n case \"typeIconIcon\":\r\n let svgConverted, serializer, svgStr;\r\n let svgEl = allValuesForm.typeIconIcon;\r\n\r\n svgConverted = document.createRange().createContextualFragment(svgEl);\r\n serializer = new XMLSerializer();\r\n svgStr = serializer.serializeToString(svgConverted);\r\n\r\n let containerId = this.handler.container.id;\r\n let loadedObject: any;\r\n\r\n fabric.loadSVGFromString(svgStr, function(objects, options) {\r\n loadedObject = fabric.util.groupSVGElements(objects, options);\r\n loadedObject.set({\r\n id: icon.id,\r\n hasControls: icon.editable,\r\n hasBorders: icon.editable,\r\n selectable: icon.editable,\r\n lockMovementX: icon.editable,\r\n lockMovementY: icon.editable,\r\n hoverCursor: !icon.editable ? \"pointer\" : \"move\",\r\n container: containerId,\r\n editable: icon.editable,\r\n fill: icon.fill,\r\n left: selectedItem.left+(selectedItem.width/2)+icon.left,\r\n top: selectedItem.top+(selectedItem.height/2)+icon.top,\r\n originX: \"left\",\r\n originY: \"top\",\r\n opacity: 1,\r\n objectCaching: !icon.editable,\r\n superType: \"svg\",\r\n type: \"svg\",\r\n name: \"New icon SVG\",\r\n scaleX: icon.scaleX,\r\n scaleY: icon.scaleY,\r\n svg: svgEl,\r\n angle: icon.angle,\r\n loadType: \"svg\",\r\n scaled: icon.scaled,\r\n originHeight: loadedObject.height,\r\n originWidth: loadedObject.width,\r\n rotated: 0\r\n });\r\n });\r\n for (let index = 0; index < loadedObject._objects.length; index++) {\r\n loadedObject._objects[index].set({fill: icon._objects[0].fill});\r\n }\r\n selectedItem.addWithUpdate(loadedObject);\r\n selectedItem.removeWithUpdate(selectedItem._objects[2]);\r\n selectedItem.setCoords();\r\n loadedObject.scaleToWidth((loadedObject.originWidth*loadedObject.scaled));\r\n loadedObject.scaleToHeight((loadedObject.originHeight*loadedObject.scaled));\r\n loadedObject.setCoords();\r\n console.log('selectedItem', selectedItem)\r\n break;\r\n case 'scaled':\r\n icon.set({\r\n scaled: newValue,\r\n })\r\n icon.scaleToWidth((icon.originWidth*newValue));\r\n icon.scaleToHeight((icon.originHeight*newValue));\r\n icon.setCoords();\r\n console.log('icon.width', icon.width)\r\n console.log('icon.height', icon.height)\r\n selectedItem.addWithUpdate();\r\n selectedItem.setCoords();\r\n console.log('objectShape.width/2 - objectShapeIcon.width', selectedItem.item(0).width/2 - icon.width)\r\n console.log('objectShape.width/2 - objectShapeIcon.width', selectedItem.item(0).height/2 - icon.height)\r\n break;\r\n case 'fillIcon':\r\n icon.set({\r\n fill: newValue,\r\n });\r\n for (let index = 0; index < icon._objects.length; index++) {\r\n icon._objects[index].set({fill: newValue});\r\n }\r\n selectedItem.addWithUpdate();\r\n break;\r\n case 'fill':\r\n shape.set({\r\n fill: newValue,\r\n });\r\n selectedItem.addWithUpdate();\r\n break;\r\n case 'fillText':\r\n text.set({\r\n fill: newValue,\r\n });\r\n selectedItem.addWithUpdate();\r\n break;\r\n case 'visibleText':\r\n console.log('newValue', newValue)\r\n text.set({\r\n visible: newValue\r\n });\r\n selectedItem.set({\r\n visibleText: newValue\r\n });\r\n selectedItem.addWithUpdate();\r\n break;\r\n case 'visibleIcon':\r\n icon.set({\r\n visible: newValue\r\n });\r\n selectedItem.set({\r\n visibleIcon: newValue\r\n });\r\n selectedItem.addWithUpdate();\r\n break;\r\n case 'textText':\r\n text.set({\r\n text: newValue,\r\n left: 0\r\n });\r\n selectedItem.addWithUpdate();\r\n selectedItem.setCoords();\r\n text.set({\r\n left: text.left-(text.width / 2)\r\n })\r\n selectedItem.addWithUpdate();\r\n selectedItem.setCoords();\r\n break;\r\n case 'rotateIcon':\r\n icon.rotate(newValue);\r\n icon.set({\r\n rotated: newValue\r\n })\r\n selectedItem.addWithUpdate();\r\n selectedItem.setCoords();\r\n break;\r\n\r\n default:\r\n let newPropertyName: any;\r\n\r\n if (icon || text)\r\n newPropertyName = propertyName.substring(0, propertyName.length - 4);\r\n\r\n const prop = shape ? shape : icon ? icon : text ? text : null;\r\n const newNameProperty = shape ? propertyName : newPropertyName;\r\n\r\n prop.set(newNameProperty, newValue);\r\n prop.setCoords();\r\n selectedItem.addWithUpdate();\r\n break;\r\n }\r\n };\r\n}\r\n\r\nexport default ShapeProperties;\r\n","import { Handler } from \"../../../handlers\";\r\nimport store from \"../../../../../redux/store\";\r\n\r\nclass ZoneProperties {\r\n public handler: Handler;\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n public updateProperties = (\r\n propertyName: string,\r\n newValue: any,\r\n allValuesForm: any,\r\n selectedItem: any\r\n ) => {\r\n const {\r\n properties: { categories: categoriesList },\r\n } = store.getState();\r\n const rows = selectedItem.getObjects(\"group\");\r\n let selectedCategory: any =\r\n propertyName === \"category\"\r\n ? categoriesList.filter((category: any) => category.key === newValue)[0]\r\n : \"\";\r\n let shape: any,\r\n text = null,\r\n icon = null;\r\n console.log(\"propertyName...............................\", propertyName);\r\n switch (propertyName) {\r\n case \"textText\":\r\n case \"displayedLabelText\":\r\n case \"leftText\":\r\n case \"topText\":\r\n case \"fontSizeText\":\r\n case \"fillText\":\r\n case \"angleText\":\r\n text = selectedItem.item(1);\r\n break;\r\n default:\r\n console.log(\"La propiedad no corresponde a un obj texto\");\r\n }\r\n\r\n const activeObject = this.handler.canvas.getActiveObject();\r\n let label = selectedItem.item(1);\r\n // aqui se modifica la propiedad\r\n switch (propertyName) {\r\n case \"angle\":\r\n selectedItem.rotate(newValue);\r\n // selectedItem.addWithUpdate();\r\n selectedItem.setCoords();\r\n break;\r\n case \"name\":\r\n case \"left\":\r\n case \"top\":\r\n case \"opacity\":\r\n activeObject.set(propertyName, newValue);\r\n activeObject.setCoords();\r\n break;\r\n case \"height\":\r\n case \"width\":\r\n shape.set(propertyName, newValue);\r\n shape.setCoords();\r\n selectedItem.addWithUpdate();\r\n break;\r\n case \"category\":\r\n selectedItem.set({\r\n category: {\r\n name: selectedCategory.name,\r\n color: selectedCategory.color,\r\n key: selectedCategory.key,\r\n },\r\n });\r\n console.log('selectedItem', selectedItem)\r\n const polygon = selectedItem.item(0);\r\n polygon.set({\r\n stroke: selectedCategory.color,\r\n fill: `${selectedCategory.color}40`,\r\n });\r\n\r\n if(rows.length > 0){\r\n rows.forEach((row: any) => {\r\n row.set({\r\n category: {\r\n name: selectedCategory.name,\r\n color: selectedCategory.color,\r\n key: selectedCategory.key,\r\n },\r\n })\r\n const seats = row.getObjects(\"group\");\r\n seats.forEach((seat: any) => {\r\n const seatShape = seat.item(0);\r\n seatShape.set({\r\n stroke: selectedCategory.color,\r\n fill: `${selectedCategory.color}40`,\r\n });\r\n seat.set({\r\n category: {\r\n name: selectedCategory.name,\r\n color: selectedCategory.color,\r\n key: selectedCategory.key,\r\n },\r\n });\r\n });\r\n });\r\n }\r\n selectedItem.addWithUpdate();\r\n break;\r\n case \"sectionLabel\":\r\n selectedItem.set({\r\n section: {\r\n label: newValue,\r\n displayedLabel: selectedItem.section.displayedLabel,\r\n },\r\n });\r\n if(selectedItem.section.displayedLabel === \"\"){\r\n label.set({\r\n text: newValue\r\n });\r\n }\r\n else{\r\n label.set({\r\n text: selectedItem.section.displayedLabel\r\n });\r\n }\r\n if(rows.length > 0){\r\n rows.forEach((row: any) => {\r\n row.set({\r\n section: {\r\n label: newValue,\r\n displayedLabel: selectedItem.section.displayedLabel,\r\n },\r\n })\r\n const seats = row.getObjects(\"group\");\r\n seats.forEach((seat: any) => {\r\n let txtObj = seat.item(1);\r\n this.setSeatValue(seat, row, txtObj.text);\r\n });\r\n });\r\n }\r\n break;\r\n case \"displayedSectionLabel\":\r\n selectedItem.set({\r\n section: {\r\n label: selectedItem.section.label,\r\n displayedLabel: newValue,\r\n },\r\n });\r\n if(rows.length > 0){\r\n rows.forEach((row: any) => {\r\n row.set({\r\n section: {\r\n label: selectedItem.section.label,\r\n displayedLabel: newValue,\r\n },\r\n })\r\n const seats = row.getObjects(\"group\");\r\n seats.forEach((seat: any) => {\r\n let txtObj = seat.item(1);\r\n this.setSeatValue(seat, row, txtObj.text);\r\n });\r\n });\r\n }\r\n if(newValue === \"\"){\r\n label.set({\r\n text: selectedItem.section.label\r\n });\r\n }\r\n else{\r\n label.set({\r\n text: newValue\r\n });\r\n }\r\n break;\r\n default:\r\n let newPropertyName: any;\r\n\r\n if (text)\r\n newPropertyName = propertyName.substring(0, propertyName.length - 4);\r\n const prop = shape ? shape : text;\r\n const newNameProperty = shape ? propertyName : newPropertyName;\r\n\r\n prop.set(newNameProperty, newValue);\r\n prop.setCoords();\r\n selectedItem.addWithUpdate();\r\n break;\r\n }\r\n\r\n this.handler.canvas.requestRenderAll();\r\n const { onModified } = this.handler;\r\n if (onModified) onModified(activeObject);\r\n };\r\n\r\n private setSeatValue = (seat: any, rowData: any, seatlabel: string) => {\r\n seat.set({\r\n value: `${rowData.section.label}${rowData.section.label && \r\n rowData.row.label &&\r\n \"-\"}${rowData.row.label}${(rowData.row.label ||\r\n rowData.section.label) &&\r\n seatlabel &&\r\n \"-\"}${seatlabel}`,\r\n isLabeled:\r\n (rowData.row.enabled ? rowData.row.label != \"\" : true) &&\r\n seatlabel != \"\",\r\n });\r\n };\r\n}\r\n\r\nexport default ZoneProperties;\r\n","export const iconBathLadies = ``;\r\n\r\nexport const iconRestrooms = ``;\r\n\r\nexport const iconBathGentle = ``;\r\n\r\nexport const iconUpstairs = ``;\r\n\r\nexport const iconDownStairs = ``;\r\n\r\nexport const iconExit = ``;\r\n\r\nexport const iconFood = ``;\r\n\r\nexport const iconStage = ``;\r\n\r\nexport const iconCheck = ``;\r\n\r\nexport const iconAccesible = ``;\r\n\r\nexport const iconCompanion = ``;\r\n\r\nexport const iconRestrictedView = ``;\r\n\r\nexport const iconX = ``","export const letters: Array = [\r\n \"a\",\r\n \"b\",\r\n \"c\",\r\n \"d\",\r\n \"e\",\r\n \"f\",\r\n \"g\",\r\n \"h\",\r\n \"i\",\r\n \"j\",\r\n \"k\",\r\n \"l\",\r\n \"ñ\",\r\n \"m\",\r\n \"n\",\r\n \"o\",\r\n \"p\",\r\n \"q\",\r\n \"r\",\r\n \"s\",\r\n \"t\",\r\n \"u\",\r\n \"v\",\r\n \"w\",\r\n \"x\",\r\n \"y\",\r\n \"z\",\r\n];","import { Handler } from \"../../../handlers\";\r\nimport { FabricObject, getSvgObject } from \"../../../utils\";\r\nimport store from \"../../../../../redux/store\";\r\nimport { fabric } from \"fabric\";\r\nimport { v4 } from \"uuid\";\r\nimport {\r\n iconCompanion,\r\n iconAccesible,\r\n iconRestrictedView,\r\n iconCheck,\r\n} from \"../../../../mapeditor/icons/Icons\";\r\nimport { SeatDistribution } from \"../../../enums/SeatDistribution\";\r\nimport { RowProperty } from \"../../../enums/RowProperties\";\r\nimport { letters } from \"../../../constants/letters\";\r\n\r\nclass RowProperties {\r\n public handler: Handler;\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n public updateProperties = (\r\n propertyName: RowProperty,\r\n newValue: any,\r\n allValuesForm: any,\r\n selectedItem: any\r\n ) => {\r\n const {\r\n properties: { rowSeatSize },\r\n } = store.getState();\r\n const objects: any = selectedItem.getObjects();\r\n let seats: any = selectedItem.getObjects(\"group\");\r\n const textObjs = selectedItem.getObjects(\"textbox\") || [];\r\n const textRight =\r\n textObjs.filter((textbox: any) => textbox.side === \"right\") || [];\r\n const textLeft =\r\n textObjs.filter((textbox: any) => textbox.side === \"left\") || [];\r\n const {\r\n properties: { categories: categoriesList },\r\n } = store.getState();\r\n const renderedIcon = selectedItem.getObjects(\"svg\") || undefined;\r\n const { seatsQuantity } = selectedItem;\r\n const old = { ...selectedItem };\r\n console.log(\"selectedItem\", selectedItem);\r\n let selectedCategory: any =\r\n propertyName === \"rowCategory\" || propertyName === \"seatCategory\"\r\n ? categoriesList.filter((category: any) => category.key === newValue)[0]\r\n : \"\";\r\n let previewText;\r\n\r\n const parameters = {\r\n rowSeatSize,\r\n objects,\r\n seats,\r\n textRight,\r\n textLeft,\r\n renderedIcon,\r\n seatsQuantity,\r\n old,\r\n selectedCategory,\r\n previewText,\r\n selectedItem,\r\n newValue,\r\n propertyName,\r\n };\r\n console.log(\"propertyName\", propertyName);\r\n this[propertyName]({ ...parameters });\r\n };\r\n\r\n private setSeatValue = (seat: any, rowData: any, seatlabel: string) => {\r\n seat.set({\r\n value: `${rowData.section.label}${rowData.section.label &&\r\n rowData.row.label &&\r\n \"-\"}${rowData.row.label}${(rowData.row.label ||\r\n rowData.section.label) &&\r\n seatlabel &&\r\n \"-\"}${seatlabel}`,\r\n isLabeled:\r\n (rowData.row.enabled ? rowData.row.label != \"\" : true) &&\r\n seatlabel != \"\",\r\n });\r\n };\r\n\r\n private getWidthFromPreviewText = (\r\n text: string,\r\n rowSeatSize: number\r\n ): any => {\r\n let previewText = new fabric.Text(text, {\r\n fontSize: rowSeatSize - 2,\r\n left: 0,\r\n top: 0,\r\n fill: \"#000000\",\r\n stroke: \"#000000\",\r\n strokeWidth: 0,\r\n fontFamily: \"Roboto\",\r\n originX: \"left\",\r\n originY: \"top\",\r\n type: \"textbox\",\r\n }) as FabricObject;\r\n this.handler.canvas.add(previewText);\r\n let canvasObjects = this.handler.canvas.getObjects();\r\n let canvasPreviewText = canvasObjects[canvasObjects.length - 1];\r\n this.handler.canvas.remove(canvasPreviewText);\r\n return canvasPreviewText;\r\n };\r\n\r\n private createSeatGroupRP(x: number, y: number, category: any) {\r\n const { editable } = this.handler;\r\n const id = v4();\r\n const seatGroup = new fabric.Group(undefined, {\r\n left: x,\r\n top: y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n hasControls: false,\r\n hasBorders: editable,\r\n selectable: editable,\r\n type: \"group\",\r\n subTargetCheck: true,\r\n }) as FabricObject;\r\n\r\n seatGroup.set({\r\n id: id,\r\n superType: \"seat\",\r\n centerTransform: true,\r\n seatsQuantity: null,\r\n maxSeatsQuantity: null,\r\n rowSize: null,\r\n seatsSpacing: 0,\r\n distanceBetweenX: 0,\r\n distanceBetweenY: 0,\r\n category: {\r\n key: category.key,\r\n name: category.name,\r\n },\r\n label: \"\",\r\n restrictedView: false,\r\n companion: false,\r\n accesible: false,\r\n });\r\n return seatGroup;\r\n }\r\n\r\n private createSeatRP(\r\n x: number,\r\n y: number,\r\n fill: string,\r\n rowSeatSize: number,\r\n rotation: number\r\n ) {\r\n // this.handler.isDown = true;\r\n const editable = this.handler.editable;\r\n const id = v4();\r\n\r\n let shape = new fabric.Circle({\r\n name: \"Seat\",\r\n left: x,\r\n top: y,\r\n originX: \"center\",\r\n originY: \"center\",\r\n radius: rowSeatSize / 2,\r\n angle: rotation,\r\n fill: `${fill}40`,\r\n strokeWidth: 1,\r\n stroke: fill,\r\n transparentCorners: false,\r\n hasControls: false,\r\n hasBorders: editable,\r\n selectable: true,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n opacity: 50,\r\n }) as FabricObject;\r\n\r\n shape.set({\r\n id: id,\r\n label: \"Label\",\r\n displayedLabel: \"\",\r\n container: this.handler.container.id,\r\n editable: editable,\r\n objectOption: this.handler.objectOption,\r\n });\r\n return shape;\r\n }\r\n\r\n private createTextRP(\r\n x: number,\r\n y: number,\r\n label: string,\r\n rowSeatSize: number\r\n ) {\r\n const editable = this.handler.editable;\r\n\r\n const text = new fabric.Text(label, {\r\n fontSize: rowSeatSize - 5,\r\n left: x,\r\n top: y,\r\n fill: \"#000000\",\r\n stroke: \"#000000\",\r\n strokeWidth: 0,\r\n fontFamily: \"Roboto\",\r\n originX: \"center\",\r\n originY: \"center\",\r\n type: \"text\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n strokeUniform: true,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n visible: true,\r\n }) as FabricObject;\r\n return text;\r\n }\r\n\r\n private createIconRP(x: number, y: number) {\r\n const editable = this.handler.editable;\r\n let defaultIcon = iconCheck;\r\n let svg: any;\r\n fabric.loadSVGFromString(defaultIcon, function(objects, options) {\r\n svg = fabric.util.groupSVGElements(objects, options);\r\n svg.set({\r\n fill: \"#ffffff\",\r\n left: x,\r\n top: y,\r\n originX: \"center\",\r\n originY: \"center\",\r\n objectCaching: !editable,\r\n type: \"svg\",\r\n name: \"New icon SVG\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n strokeUniform: true,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n loadType: \"svg\",\r\n svg: defaultIcon,\r\n visible: false,\r\n });\r\n });\r\n return svg;\r\n }\r\n\r\n private rowCategory({\r\n selectedItem,\r\n seatsQuantity,\r\n objects,\r\n selectedCategory,\r\n }: any) {\r\n selectedItem.set({\r\n category: {\r\n name: selectedCategory.name,\r\n color: selectedCategory.color,\r\n key: selectedCategory.key,\r\n },\r\n });\r\n if(!selectedItem.zoneID){\r\n selectedItem.set({\r\n section: {\r\n label: selectedCategory.name,\r\n displayedLabel: selectedCategory.name,\r\n },\r\n });\r\n }\r\n for (let index = 0; index < seatsQuantity; index++) {\r\n objects[index].set({\r\n category: {\r\n name: selectedCategory.name,\r\n color: selectedCategory.color,\r\n key: selectedCategory.key,\r\n },\r\n\r\n });\r\n this.setSeatValue(objects[index], selectedItem, objects[index].label);\r\n\r\n const seatCircle = objects[index].item(0);\r\n seatCircle.set({\r\n stroke: selectedCategory.color,\r\n fill: `${selectedCategory.color}40`,\r\n });\r\n }\r\n selectedItem.addWithUpdate();\r\n }\r\n\r\n private seatsQuantity({\r\n selectedItem,\r\n newValue,\r\n propertyName,\r\n old,\r\n rowSeatSize,\r\n textRight,\r\n seats,\r\n allValuesForm,\r\n }: any) {\r\n if (\r\n typeof newValue == \"string\" ||\r\n newValue == null ||\r\n isNaN(newValue) ||\r\n newValue < 1\r\n ) {\r\n newValue = 1;\r\n }\r\n if (newValue % 1 != 0) {\r\n newValue = Math.trunc(newValue);\r\n }\r\n selectedItem.set({\r\n seatsQuantity: newValue,\r\n });\r\n selectedItem.rotate(-selectedItem.angleHelp);\r\n selectedItem.addWithUpdate();\r\n selectedItem.setCoords();\r\n if (textRight.length > 0) {\r\n selectedItem.removeWithUpdate(textRight[0]);\r\n }\r\n // let newLeft;\r\n let label = \"\";\r\n if (!newValue) {\r\n let objectsToRemove = seats.slice(1, seats.length);\r\n objectsToRemove.forEach((object: any) => {\r\n selectedItem.removeWithUpdate(object);\r\n });\r\n return;\r\n }\r\n if (selectedItem.seatsCurve != 0) {\r\n for (let index = 0; index < seats.length; index++) {\r\n seats[index].set({\r\n top: seats[0].top,\r\n });\r\n }\r\n selectedItem.set({\r\n seatsCurve: 0,\r\n });\r\n selectedItem.addWithUpdate();\r\n }\r\n if (newValue > seats.length) {\r\n let remainItems = newValue - seats.length;\r\n for (let index = 0; index < remainItems; index++) {\r\n const { height, width } = selectedItem;\r\n let newLeft =\r\n selectedItem.left +\r\n selectedItem.width +\r\n rowSeatSize / 2 +\r\n selectedItem.seatsSpacing * 2;\r\n let newTop =\r\n selectedItem.top + (height - rowSeatSize) / 2 + rowSeatSize / 2;\r\n let group = this.createSeatGroupRP(\r\n newLeft,\r\n newTop,\r\n selectedItem.category\r\n );\r\n const firstSeat = selectedItem.item(0);\r\n const firstSeatText = firstSeat.item(1);\r\n const seat = this.createSeatRP(\r\n newLeft,\r\n newTop,\r\n selectedItem.category.color ?? \"#000000\",\r\n rowSeatSize,\r\n firstSeatText.angle\r\n );\r\n const text = this.createTextRP(newLeft, newTop, label, rowSeatSize);\r\n text.set({\r\n angle: -selectedItem.angleHelp,\r\n });\r\n const icon = this.createIconRP(newLeft, newTop);\r\n group.addWithUpdate(seat);\r\n group.addWithUpdate(text);\r\n group.addWithUpdate(icon);\r\n selectedItem._objects.splice(\r\n selectedItem.getObjects(\"group\").length,\r\n 0,\r\n group\r\n );\r\n selectedItem.addWithUpdate();\r\n }\r\n let newSeatsQuantity = selectedItem.getObjects(\"group\").length;\r\n let labelList = [];\r\n if(selectedItem.seat.list.length>0){\r\n let starts;\r\n if(selectedItem.seat.reverse){\r\n starts = selectedItem.seat.startsAt+newSeatsQuantity-1;\r\n switch (selectedItem.seat.key) {\r\n case SeatDistribution.normal:\r\n for (let index = 0; index < newSeatsQuantity; index++) {\r\n labelList.push(starts);\r\n starts--;\r\n }\r\n break;\r\n case SeatDistribution.odds:\r\n starts = selectedItem.seat.startsAt;\r\n do {\r\n if (starts % 2 == 1) labelList.push(starts);\r\n starts++;\r\n } while (labelList.length != newSeatsQuantity);\r\n labelList.reverse();\r\n break;\r\n case SeatDistribution.evens:\r\n starts = selectedItem.seat.startsAt;\r\n do {\r\n if (starts % 2 == 0) labelList.push(starts);\r\n starts++;\r\n } while (labelList.length != newSeatsQuantity);\r\n labelList.reverse();\r\n break;\r\n }\r\n }\r\n else{\r\n starts = selectedItem.seat.startsAt;\r\n switch (selectedItem.seat.key) {\r\n case SeatDistribution.normal:\r\n for (let index = 0; index < newSeatsQuantity; index++) {\r\n labelList.push(starts);\r\n starts++;\r\n }\r\n break;\r\n case SeatDistribution.odds:\r\n do {\r\n if (starts % 2 == 1) labelList.push(starts);\r\n starts++;\r\n } while (labelList.length != newSeatsQuantity);\r\n break;\r\n case SeatDistribution.evens:\r\n do {\r\n if (starts % 2 == 0) labelList.push(starts);\r\n starts++;\r\n } while (labelList.length != newSeatsQuantity);\r\n break;\r\n }\r\n }\r\n selectedItem.set({\r\n seat: {\r\n list: labelList,\r\n startsAt: selectedItem.seat.startsAt,\r\n key: selectedItem.seat.key,\r\n reverse: selectedItem.seat.reverse,\r\n },\r\n });\r\n selectedItem.addWithUpdate();\r\n for (\r\n let index = 0;\r\n index < selectedItem.getObjects(\"group\").length;\r\n index++\r\n ) {\r\n let seatObj = selectedItem.item(index);\r\n let txtObj = seatObj.item(1);\r\n txtObj.set({\r\n text: labelList[index].toString(),\r\n });\r\n seatObj.set({\r\n label: labelList[index].toString(),\r\n });\r\n this.setSeatValue(seatObj, selectedItem, txtObj.text);\r\n }\r\n }\r\n selectedItem.addWithUpdate();\r\n console.log(\"selectedItemmmmmmmmmmmm\", selectedItem);\r\n } else {\r\n let objectsToRemove = seats.slice(newValue, seats.length);\r\n objectsToRemove.forEach((object: any) => {\r\n selectedItem.removeWithUpdate(object);\r\n });\r\n }\r\n if (textRight.length > 0) {\r\n textRight[0].set({\r\n left: selectedItem.left + selectedItem.width + 6,\r\n });\r\n selectedItem.addWithUpdate(textRight[0]);\r\n }\r\n selectedItem.rotate(selectedItem.angleHelp);\r\n selectedItem.addWithUpdate();\r\n let widthDiff = Math.abs(selectedItem.width - old.width);\r\n let heightDiff = Math.abs(selectedItem.height - old.height);\r\n if (selectedItem.angleHelp < 0) {\r\n selectedItem.set({\r\n left: old.left,\r\n top:\r\n selectedItem.height > old.height\r\n ? old.top - heightDiff\r\n : old.top + heightDiff,\r\n });\r\n } else {\r\n selectedItem.set({\r\n left: old.left,\r\n top: old.top,\r\n });\r\n }\r\n selectedItem.addWithUpdate();\r\n selectedItem.setCoords();\r\n }\r\n\r\n private seatsCurve({ selectedItem, newValue, seats, old }: any) {\r\n console.log(\"newValue\", newValue);\r\n newValue = Number(newValue);\r\n if (\r\n typeof newValue == \"string\" ||\r\n newValue == null ||\r\n isNaN(newValue)\r\n ) {\r\n newValue = 0;\r\n }\r\n if (newValue % 1 != 0) {\r\n newValue = Math.trunc(newValue);\r\n }\r\n if (newValue > 30) {\r\n newValue = 30;\r\n }\r\n selectedItem.set({\r\n seatsCurve: newValue,\r\n });\r\n let h = newValue;\r\n let auY, auY2, restar;\r\n let mid = Math.trunc(seats.length / 2);\r\n if (h != 0) {\r\n auY = (h * 2) / mid;\r\n auY2 = (h * 2) / mid;\r\n restar = auY2 / h;\r\n }\r\n selectedItem.set({\r\n angle: -selectedItem.angleHelp,\r\n });\r\n selectedItem.addWithUpdate();\r\n for (let index = 1; index < seats.length; index++) {\r\n seats[index].set({\r\n top: seats[0].top,\r\n });\r\n }\r\n selectedItem.addWithUpdate();\r\n if (h != 0) {\r\n let ind;\r\n if (seats.length % 2 == 0) {\r\n console.log(\"es par\");\r\n for (let index = 1; index < mid; index++) {\r\n auY2 -= restar;\r\n seats[index].set({\r\n top: seats[index].top - (auY * index + auY2),\r\n });\r\n }\r\n auY2 = (h * 2) / mid;\r\n ind = 1;\r\n for (let index = seats.length - 2; index >= mid; index--) {\r\n auY2 -= restar;\r\n seats[index].set({\r\n top: seats[index].top - (auY * ind + auY2),\r\n });\r\n ind++;\r\n }\r\n } else {\r\n for (let index = 1; index <= mid; index++) {\r\n auY2 -= restar;\r\n seats[index].set({\r\n top: seats[index].top - (auY * index + auY2),\r\n });\r\n }\r\n auY2 = (h * 2) / mid;\r\n ind = 1;\r\n for (let index = seats.length - 2; index > mid; index--) {\r\n auY2 -= restar;\r\n seats[index].set({\r\n top: seats[index].top - (auY * ind + auY2),\r\n });\r\n ind++;\r\n }\r\n }\r\n }\r\n selectedItem.set({\r\n angle: selectedItem.angleHelp,\r\n });\r\n selectedItem.addWithUpdate();\r\n selectedItem.set({\r\n left: old.left,\r\n top: old.top,\r\n });\r\n selectedItem.addWithUpdate();\r\n selectedItem.setCoords();\r\n }\r\n\r\n private seatsSpacing({\r\n selectedItem,\r\n newValue,\r\n propertyName,\r\n seats,\r\n rowSeatSize,\r\n old,\r\n textRight,\r\n textLeft,\r\n }: any) {\r\n console.log(\"newValue\", newValue);\r\n if (\r\n typeof newValue == \"string\" ||\r\n newValue == null ||\r\n isNaN(newValue) ||\r\n newValue < 1\r\n ) {\r\n newValue = 0;\r\n }\r\n if (newValue % 1 != 0) {\r\n newValue = Math.trunc(newValue);\r\n }\r\n selectedItem.set({\r\n seatsSpacing: newValue,\r\n });\r\n let longDistance = seats.length * (rowSeatSize + newValue * 2);\r\n selectedItem.set({\r\n angle: -selectedItem.angleHelp,\r\n });\r\n selectedItem.addWithUpdate();\r\n let augmentX = longDistance / seats.length;\r\n for (let index = 0; index < seats.length; index++) {\r\n if (textLeft.length > 0) {\r\n seats[index].set(\r\n \"left\",\r\n augmentX * index +\r\n textLeft[0].width -\r\n (longDistance - (textLeft[0].width + 4)) / 2\r\n );\r\n } else {\r\n seats[index].set(\"left\", augmentX * index + longDistance / 2);\r\n }\r\n }\r\n if (textLeft.length > 0 && textRight.length > 0) {\r\n textLeft[0].set(\"left\", textLeft[0].width / 2 - 2 - longDistance / 2);\r\n selectedItem.removeWithUpdate(textRight[0]);\r\n textRight[0].set({\r\n left: selectedItem.left + selectedItem.width + 2,\r\n });\r\n selectedItem.addWithUpdate(textRight[0]);\r\n } else if (textLeft.length > 0 && textRight.length == 0) {\r\n textLeft[0].set(\"left\", textLeft[0].width / 2 - 2 - longDistance / 2);\r\n } else if (textLeft.length == 0 && textRight.length > 0) {\r\n selectedItem.removeWithUpdate(textRight[0]);\r\n textRight[0].set({\r\n left: selectedItem.left + selectedItem.width + 2,\r\n angle: selectedItem.angleHelp,\r\n });\r\n selectedItem.addWithUpdate(textRight[0]);\r\n }\r\n selectedItem.set({\r\n angle: selectedItem.angleHelp,\r\n });\r\n selectedItem.addWithUpdate();\r\n console.log(\"newValue\", newValue);\r\n selectedItem.set({\r\n left: old.left,\r\n top: old.top,\r\n });\r\n selectedItem.addWithUpdate();\r\n selectedItem.setCoords();\r\n }\r\n\r\n private seatLabeling({\r\n selectedItem,\r\n newValue,\r\n seatsQuantity,\r\n objects,\r\n }: any) {\r\n const { numberArr, letterArr } = this.selectDistribution(\r\n newValue,\r\n seatsQuantity,\r\n selectedItem\r\n );\r\n for (let index = 0; index < seatsQuantity; index++) {\r\n const text = objects[index].item(1);\r\n const selectedText =\r\n numberArr.length != 0\r\n ? numberArr[index].toString()\r\n : newValue == SeatDistribution.upperCase\r\n ? letterArr[index].toUpperCase()\r\n : newValue == SeatDistribution.lowerCase\r\n ? letterArr[index]\r\n : \"\";\r\n text.set({\r\n text: selectedText,\r\n });\r\n objects[index].set({\r\n label: selectedText,\r\n });\r\n this.setSeatValue(objects[index], selectedItem, selectedText.toString());\r\n }\r\n selectedItem.set({\r\n seat: {\r\n key: newValue,\r\n list: numberArr.length != 0 ? numberArr : letterArr,\r\n startsAt: 1,\r\n reverse: false,\r\n },\r\n });\r\n selectedItem.addWithUpdate();\r\n }\r\n\r\n private selectDistribution(newValue: any, seatsQuantity: number, selectedItem: any) {\r\n let numberArr: Array = [];\r\n let letterArr: Array = [];\r\n let odd = seatsQuantity % 2;\r\n let count = 0;\r\n switch (newValue) {\r\n case SeatDistribution.normal:\r\n do {\r\n count++;\r\n numberArr.push(count);\r\n } while (numberArr.length != seatsQuantity);\r\n break;\r\n case SeatDistribution.odds:\r\n do {\r\n count++;\r\n if (count % 2 == 1) numberArr.push(count);\r\n } while (numberArr.length != seatsQuantity);\r\n break;\r\n case SeatDistribution.evens:\r\n do {\r\n count++;\r\n if (count % 2 == 0) numberArr.push(count);\r\n } while (numberArr.length != seatsQuantity);\r\n break;\r\n case SeatDistribution.oddsToEvens:\r\n if (odd == 1) {\r\n do {\r\n count++;\r\n if (count % 2 == 1) numberArr.push(count);\r\n } while (numberArr.length != Math.round(seatsQuantity / 2));\r\n count--;\r\n } else {\r\n do {\r\n count++;\r\n if (count % 2 == 1) numberArr.push(count);\r\n } while (numberArr.length != seatsQuantity / 2);\r\n count++;\r\n }\r\n do {\r\n if (count % 2 == 0) numberArr.push(count);\r\n count--;\r\n } while (numberArr.length != seatsQuantity);\r\n break;\r\n case SeatDistribution.centerOddsToEvens:\r\n numberArr = Array(seatsQuantity);\r\n let index = 0;\r\n index = Math.trunc(seatsQuantity / 2);\r\n index = index % 2 == 0 ? index : index + 1;\r\n do {\r\n count++;\r\n if (count % 2 == 1) {\r\n numberArr[index] = count;\r\n index--;\r\n }\r\n } while (index >= 0);\r\n count = 1;\r\n index = Math.round(seatsQuantity / 2);\r\n do {\r\n count++;\r\n if (count % 2 == 0) {\r\n numberArr[index] = count;\r\n index++;\r\n }\r\n } while (index < seatsQuantity);\r\n break;\r\n case SeatDistribution.upperCase:\r\n case SeatDistribution.lowerCase:\r\n for (let index = 0; index < seatsQuantity; index++) {\r\n let letter: string = \"\";\r\n let repeat: number = Math.ceil(letterArr.length / 26);\r\n if (letterArr.length == 0) repeat = 1;\r\n if (count > 26) count = 0;\r\n for (let index = 0; index < repeat; index++) {\r\n letter += letters[count];\r\n }\r\n letterArr.push(letter);\r\n count++;\r\n }\r\n break;\r\n }\r\n return { numberArr, letterArr };\r\n }\r\n\r\n private startsAt({ selectedItem, newValue, seatsQuantity, objects }: any) {\r\n if (\r\n typeof newValue == \"string\" ||\r\n newValue == null ||\r\n isNaN(newValue) ||\r\n newValue < 1\r\n ) {\r\n selectedItem.set({\r\n seat: {\r\n key: selectedItem.seat.key,\r\n list: selectedItem.seat.list,\r\n startsAt: 1,\r\n reverse: selectedItem.seat.reverse,\r\n },\r\n });\r\n newValue = 1;\r\n }\r\n if (newValue % 1 != 0) {\r\n selectedItem.set({\r\n seat: {\r\n key: selectedItem.seat.key,\r\n list: selectedItem.seat.list,\r\n startsAt: Math.trunc(newValue),\r\n reverse: selectedItem.seat.reverse,\r\n },\r\n });\r\n newValue = Math.trunc(newValue);\r\n }\r\n let startsAt = newValue;\r\n let starts;\r\n let newList = [] as Array;\r\n starts = newValue;\r\n if(selectedItem.seat.reverse){\r\n switch (selectedItem.seat.key) {\r\n case SeatDistribution.normal:\r\n do {\r\n newList.push(starts);\r\n starts++;\r\n } while (newList.length != seatsQuantity);\r\n newList.reverse();\r\n break;\r\n case SeatDistribution.odds:\r\n do {\r\n if (starts % 2 == 1) newList.push(starts);\r\n starts++;\r\n } while (newList.length != seatsQuantity);\r\n newList.reverse();\r\n break;\r\n case SeatDistribution.evens:\r\n do {\r\n if (starts % 2 == 0) newList.push(starts);\r\n starts++;\r\n } while (newList.length != seatsQuantity);\r\n newList.reverse();\r\n break;\r\n }\r\n }\r\n else{\r\n switch (selectedItem.seat.key) {\r\n case SeatDistribution.normal:\r\n do {\r\n newList.push(starts);\r\n starts++;\r\n } while (newList.length != seatsQuantity);\r\n break;\r\n case SeatDistribution.odds:\r\n do {\r\n if (starts % 2 == 1) newList.push(starts);\r\n starts++;\r\n } while (newList.length != seatsQuantity);\r\n break;\r\n case SeatDistribution.evens:\r\n do {\r\n if (starts % 2 == 0) newList.push(starts);\r\n starts++;\r\n } while (newList.length != seatsQuantity);\r\n break;\r\n }\r\n }\r\n for (let index = 0; index < seatsQuantity; index++) {\r\n const text = objects[index].item(1);\r\n text.set({\r\n text: newList[index].toString(),\r\n });\r\n objects[index].set({\r\n label: newList[index].toString(),\r\n });\r\n this.setSeatValue(\r\n objects[index],\r\n selectedItem,\r\n newList[index]\r\n );\r\n }\r\n // if (selectedItem.seat.reverse) {\r\n // startsAt += seatsQuantity - 1;\r\n // for (let index = 0; index < seatsQuantity; index++) {\r\n // newList.push(startsAt);\r\n // const text = objects[index].item(1);\r\n // text.set({\r\n // text: startsAt.toString(),\r\n // });\r\n // objects[index].set({\r\n // label: startsAt.toString(),\r\n // });\r\n // this.setSeatValue(\r\n // objects[index],\r\n // selectedItem,\r\n // startsAt\r\n // );\r\n // startsAt--;\r\n // }\r\n // } else {\r\n // for (let index = 0; index < seatsQuantity; index++) {\r\n // newList.push(startsAt);\r\n // const text = objects[index].item(1);\r\n // text.set({\r\n // text: startsAt.toString(),\r\n // });\r\n // objects[index].set({\r\n // label: startsAt.toString(),\r\n // });\r\n // selectedItem.addWithUpdate();\r\n // this.setSeatValue(\r\n // objects[index],\r\n // selectedItem,\r\n // startsAt\r\n // );\r\n\r\n // startsAt++;\r\n // }\r\n // }\r\n selectedItem.set({\r\n seat: {\r\n key: selectedItem.seat.key,\r\n list: newList,\r\n startsAt: newValue,\r\n reverse: selectedItem.seat.reverse,\r\n },\r\n });\r\n }\r\n\r\n private reverse({ selectedItem, newValue, seatsQuantity, objects }: any) {\r\n let original = selectedItem.seat.list as Array;\r\n let reverse = original.reverse();\r\n for (let index = 0; index < seatsQuantity; index++) {\r\n const text = objects[index].item(1);\r\n text.set({\r\n text: reverse[index].toString(),\r\n });\r\n text.initDimensions();\r\n objects[index].set({\r\n label: reverse[index].toString(),\r\n });\r\n this.setSeatValue(\r\n objects[index],\r\n selectedItem,\r\n reverse[index].toString()\r\n );\r\n }\r\n selectedItem.set({\r\n seat: {\r\n key: selectedItem.seat.key,\r\n list: reverse,\r\n reverse: newValue,\r\n startsAt: selectedItem.seat.startsAt,\r\n },\r\n });\r\n console.log('newValue', newValue)\r\n console.log('selectedItem.reverse', selectedItem.reverse)\r\n selectedItem.addWithUpdate();\r\n }\r\n\r\n private sectionLabel({\r\n selectedItem,\r\n newValue,\r\n seatsQuantity,\r\n objects,\r\n }: any) {\r\n selectedItem.set({\r\n section: {\r\n label: newValue,\r\n displayedLabel: selectedItem.section.displayedLabel,\r\n },\r\n });\r\n\r\n for (let index = 0; index < seatsQuantity; index++) {\r\n this.setSeatValue(objects[index], selectedItem, objects[index].label);\r\n }\r\n\r\n selectedItem.addWithUpdate();\r\n }\r\n\r\n private displayedSectionLabel({ selectedItem, newValue }: any) {\r\n selectedItem.set({\r\n section: {\r\n label: selectedItem.section.label,\r\n displayedLabel: newValue,\r\n },\r\n });\r\n selectedItem.addWithUpdate();\r\n }\r\n\r\n private enabledRowLabel({\r\n selectedItem,\r\n newValue,\r\n seatsQuantity,\r\n objects,\r\n textRight,\r\n textLeft,\r\n }: any) {\r\n selectedItem.set({\r\n row: {\r\n label: \"\",\r\n displayedLabel: \"\",\r\n enabled: newValue,\r\n position: {\r\n left: false,\r\n right: false,\r\n },\r\n },\r\n });\r\n for (let index = 0; index < seatsQuantity; index++) {\r\n this.setSeatValue(objects[index], selectedItem, objects[index].label);\r\n }\r\n\r\n if (textRight.length > 0 && !newValue) {\r\n selectedItem.removeWithUpdate(textRight[0]);\r\n }\r\n if (textLeft.length > 0 && !newValue) {\r\n selectedItem.removeWithUpdate(textLeft[0]);\r\n }\r\n selectedItem.addWithUpdate();\r\n }\r\n\r\n private rowLabel({\r\n selectedItem,\r\n newValue,\r\n seatsQuantity,\r\n rowSeatSize,\r\n old,\r\n previewText,\r\n objects,\r\n textRight,\r\n textLeft,\r\n }: any) {\r\n selectedItem.set({\r\n row: {\r\n label: newValue,\r\n displayedLabel: selectedItem.row.displayedLabel,\r\n enabled: selectedItem.row.enabled,\r\n position: {\r\n left: selectedItem.row.position.left,\r\n right: selectedItem.row.position.right,\r\n },\r\n },\r\n });\r\n\r\n for (let index = 0; index < seatsQuantity; index++) {\r\n this.setSeatValue(objects[index], selectedItem, objects[index].label);\r\n }\r\n\r\n if (textRight.length > 0 && selectedItem.row.displayedLabel == \"\") {\r\n textRight[0].set({\r\n text: newValue,\r\n });\r\n }\r\n if (textLeft.length > 0 && selectedItem.row.displayedLabel == \"\") {\r\n selectedItem.set({\r\n angle: -selectedItem.angleHelp,\r\n });\r\n selectedItem.addWithUpdate();\r\n selectedItem.removeWithUpdate(textLeft[0]);\r\n previewText = this.getWidthFromPreviewText(newValue, rowSeatSize);\r\n\r\n textLeft[0].set({\r\n left: selectedItem.left - previewText.width - 3,\r\n text: newValue,\r\n });\r\n selectedItem.addWithUpdate(textLeft[0]);\r\n selectedItem.set({\r\n angle: selectedItem.angleHelp,\r\n });\r\n selectedItem.addWithUpdate();\r\n }\r\n selectedItem.set({\r\n left: old.left,\r\n top: old.top,\r\n });\r\n selectedItem.addWithUpdate();\r\n }\r\n\r\n private displayedRowLabel({\r\n selectedItem,\r\n newValue,\r\n rowSeatSize,\r\n old,\r\n previewText,\r\n textRight,\r\n textLeft,\r\n seats,\r\n }: any) {\r\n selectedItem.set({\r\n row: {\r\n label: selectedItem.row.label,\r\n displayedLabel: newValue,\r\n enabled: selectedItem.row.enabled,\r\n position: {\r\n left: selectedItem.row.position.left,\r\n right: selectedItem.row.position.right,\r\n },\r\n },\r\n });\r\n let newText = this.getWidthFromPreviewText(newValue, rowSeatSize);\r\n let prev =\r\n textRight.length > 0\r\n ? textRight[0].text\r\n : textLeft.length > 0\r\n ? textLeft[0].text\r\n : \"\";\r\n let prevText = this.getWidthFromPreviewText(prev, rowSeatSize);\r\n selectedItem.rotate(-selectedItem.angleHelp);\r\n selectedItem.addWithUpdate();\r\n if (selectedItem.seatsCurve != 0) {\r\n for (let index = 0; index < seats.length; index++) {\r\n seats[index].set({\r\n top: seats[0].top,\r\n });\r\n }\r\n selectedItem.set({\r\n seatsCurve: 0,\r\n });\r\n selectedItem.addWithUpdate();\r\n }\r\n let prevRow = { ...selectedItem };\r\n if (textRight.length > 0) {\r\n textRight[0].set({\r\n text: newValue === \"\" ? selectedItem.row.label : newValue,\r\n });\r\n selectedItem.addWithUpdate();\r\n if (textLeft.length == 0) {\r\n if (selectedItem.angleHelp > 0) {\r\n selectedItem.rotate(selectedItem.angleHelp);\r\n selectedItem.addWithUpdate();\r\n selectedItem.set({\r\n left: old.left,\r\n top: old.top,\r\n });\r\n selectedItem.addWithUpdate();\r\n } else {\r\n selectedItem.rotate(selectedItem.angleHelp);\r\n selectedItem.addWithUpdate();\r\n selectedItem.set({\r\n top:\r\n newText > prevText\r\n ? old.top - Math.abs(selectedItem.height - old.height)\r\n : old.top + Math.abs(selectedItem.height - old.height),\r\n left: old.left,\r\n });\r\n selectedItem.addWithUpdate();\r\n }\r\n return;\r\n }\r\n }\r\n if (textLeft.length > 0) {\r\n selectedItem.removeWithUpdate(textLeft[0]);\r\n previewText = this.getWidthFromPreviewText(\r\n newValue === \"\" ? selectedItem.row.label : newValue,\r\n rowSeatSize\r\n );\r\n textLeft[0].set({\r\n left: selectedItem.left - previewText.width - 6,\r\n text: newValue === \"\" ? selectedItem.row.label : newValue,\r\n });\r\n selectedItem.addWithUpdate(textLeft[0]);\r\n if (textRight.length == 0) {\r\n if (selectedItem.angleHelp < 0) {\r\n selectedItem.rotate(selectedItem.angleHelp);\r\n selectedItem.addWithUpdate();\r\n selectedItem.set({\r\n left:\r\n newText > prevText\r\n ? old.left - Math.abs(selectedItem.width - old.width)\r\n : old.left + Math.abs(selectedItem.width - old.width),\r\n top: old.top,\r\n });\r\n selectedItem.addWithUpdate();\r\n } else {\r\n selectedItem.rotate(selectedItem.angleHelp);\r\n selectedItem.addWithUpdate();\r\n selectedItem.set({\r\n left:\r\n newText > prevText\r\n ? old.left - Math.abs(selectedItem.width - old.width)\r\n : old.left + Math.abs(selectedItem.width - old.width),\r\n top:\r\n newText > prevText\r\n ? old.top - Math.abs(selectedItem.height - old.height)\r\n : old.top + Math.abs(selectedItem.height - old.height),\r\n });\r\n selectedItem.addWithUpdate();\r\n }\r\n return;\r\n }\r\n }\r\n selectedItem.rotate(selectedItem.angleHelp);\r\n selectedItem.addWithUpdate();\r\n }\r\n\r\n private labelPositionLeft({\r\n selectedItem,\r\n newValue,\r\n propertyName,\r\n old,\r\n previewText,\r\n rowSeatSize,\r\n seats,\r\n }: any) {\r\n this.labelPosition({\r\n selectedItem,\r\n newValue,\r\n propertyName,\r\n old,\r\n previewText,\r\n rowSeatSize,\r\n seats,\r\n });\r\n }\r\n\r\n private labelPositionRight({\r\n selectedItem,\r\n newValue,\r\n propertyName,\r\n old,\r\n previewText,\r\n rowSeatSize,\r\n seats,\r\n }: any) {\r\n this.labelPosition({\r\n selectedItem,\r\n newValue,\r\n propertyName,\r\n old,\r\n previewText,\r\n rowSeatSize,\r\n seats,\r\n });\r\n }\r\n\r\n private labelPosition({\r\n selectedItem,\r\n newValue,\r\n propertyName,\r\n old,\r\n previewText,\r\n rowSeatSize,\r\n seats,\r\n }: any) {\r\n console.log(\"propertyNameInside\", propertyName);\r\n selectedItem.set({\r\n row: {\r\n label: selectedItem.row.label,\r\n displayedLabel: selectedItem.row.displayedLabel,\r\n enabled: selectedItem.row.enabled,\r\n position: {\r\n left:\r\n propertyName == \"labelPositionLeft\"\r\n ? newValue\r\n : selectedItem.row.position.left,\r\n right:\r\n propertyName == \"labelPositionRight\"\r\n ? newValue\r\n : selectedItem.row.position.right,\r\n },\r\n },\r\n });\r\n const {\r\n row: { displayedLabel: displayed, label: labl },\r\n } = selectedItem;\r\n let selectedText = displayed != \"\" ? displayed : labl != \"\" ? labl : \"?\";\r\n if (!newValue) {\r\n let textObjs = selectedItem.getObjects(\"textbox\");\r\n let textbox;\r\n if (propertyName === \"labelPositionLeft\") {\r\n textbox = textObjs.filter((textbox: any) => textbox.side === \"left\");\r\n selectedItem.removeWithUpdate(textbox[0]);\r\n if (selectedItem.angleHelp < 0) {\r\n selectedItem.set({\r\n left: old.left + (old.width - selectedItem.width),\r\n top: old.top,\r\n });\r\n selectedItem.addWithUpdate();\r\n } else {\r\n selectedItem.set({\r\n left: old.left + (old.width - selectedItem.width),\r\n top: old.top + (old.height - selectedItem.height),\r\n });\r\n selectedItem.addWithUpdate();\r\n }\r\n } else {\r\n textbox = textObjs.filter((textbox: any) => textbox.side === \"right\");\r\n selectedItem.removeWithUpdate(textbox[0]);\r\n if (selectedItem.angleHelp < 0) {\r\n selectedItem.set({\r\n left: old.left,\r\n top: old.top + (old.height - selectedItem.height),\r\n });\r\n selectedItem.addWithUpdate();\r\n } else {\r\n selectedItem.set({\r\n left: old.left,\r\n top: old.top,\r\n });\r\n selectedItem.addWithUpdate();\r\n }\r\n }\r\n } else {\r\n previewText = this.getWidthFromPreviewText(selectedText, rowSeatSize);\r\n selectedItem.set({\r\n angle: -selectedItem.angleHelp,\r\n });\r\n selectedItem.addWithUpdate();\r\n selectedItem.setCoords();\r\n if (selectedItem.seatsCurve != 0) {\r\n for (let index = 0; index < seats.length; index++) {\r\n seats[index].set({\r\n top: seats[0].top,\r\n });\r\n }\r\n selectedItem.set({\r\n seatsCurve: 0,\r\n });\r\n selectedItem.addWithUpdate();\r\n }\r\n selectedItem.set({\r\n left: old.left,\r\n top: old.top,\r\n });\r\n selectedItem.addWithUpdate();\r\n selectedItem.setCoords();\r\n let text = new fabric.Text(selectedText, {\r\n fontSize: rowSeatSize - 2,\r\n left:\r\n propertyName == \"labelPositionLeft\"\r\n ? selectedItem.left - previewText.width - 6\r\n : selectedItem.left + selectedItem.width + 6,\r\n top:\r\n selectedItem.top + selectedItem.height / 2 - previewText.height / 2,\r\n fill: \"#000000\",\r\n stroke: \"#000000\",\r\n strokeWidth: 0,\r\n fontFamily: \"Roboto\",\r\n originX: \"left\",\r\n originY: \"top\",\r\n type: \"textbox\",\r\n hasControls: false,\r\n hasBorders: false,\r\n strokeUniform: true,\r\n selectable: false,\r\n lockMovementX: true,\r\n lockMovementY: true,\r\n hoverCursor: \"pointer\",\r\n visible: true,\r\n angle: 0,\r\n }) as FabricObject;\r\n text.set({\r\n side: propertyName == \"labelPositionLeft\" ? \"left\" : \"right\",\r\n });\r\n selectedItem.addWithUpdate(text);\r\n selectedItem.set({\r\n angle: selectedItem.angleHelp,\r\n });\r\n selectedItem.addWithUpdate();\r\n if (selectedItem.angleHelp < 0) {\r\n selectedItem.set({\r\n left:\r\n propertyName == \"labelPositionLeft\"\r\n ? old.left - (selectedItem.width - old.width)\r\n : old.left,\r\n top:\r\n propertyName == \"labelPositionLeft\"\r\n ? old.top\r\n : old.top - (selectedItem.height - old.height),\r\n });\r\n selectedItem.addWithUpdate();\r\n return;\r\n } else {\r\n if (propertyName == \"labelPositionLeft\") {\r\n selectedItem.set({\r\n left: old.left - (selectedItem.width - old.width),\r\n top: old.top - (selectedItem.height - old.height),\r\n });\r\n } else {\r\n selectedItem.set({\r\n left: old.left,\r\n top: old.top,\r\n });\r\n }\r\n selectedItem.addWithUpdate();\r\n }\r\n }\r\n }\r\n\r\n private seatCategory({ selectedItem, selectedCategory }: any) {\r\n selectedItem.set({\r\n category: {\r\n name: selectedCategory.name,\r\n color: selectedCategory.color,\r\n key: selectedCategory.key,\r\n },\r\n });\r\n const seatCircle = selectedItem.item(0);\r\n seatCircle.set({\r\n stroke: selectedCategory.color,\r\n fill: `${selectedCategory.color}40`,\r\n });\r\n selectedItem.group.addWithUpdate();\r\n }\r\n\r\n private seatLabel({ selectedItem, newValue }: any) {\r\n if (selectedItem.displayedLabel === \"\") {\r\n selectedItem._objects[1].set({\r\n text: newValue,\r\n });\r\n }\r\n selectedItem.set({\r\n label: newValue,\r\n });\r\n\r\n this.setSeatValue(selectedItem, selectedItem.group, newValue);\r\n }\r\n\r\n private displayedSeatLabel({ selectedItem, newValue }: any) {\r\n if (newValue === \"\") {\r\n selectedItem._objects[1].set({\r\n text: selectedItem.label,\r\n });\r\n } else {\r\n selectedItem._objects[1].set({\r\n text: newValue,\r\n });\r\n }\r\n selectedItem.set({\r\n displayedLabel: newValue,\r\n });\r\n }\r\n\r\n private restrictedView({\r\n selectedItem,\r\n newValue,\r\n rowSeatSize,\r\n renderedIcon,\r\n }: any) {\r\n if (renderedIcon[1]) {\r\n selectedItem.remove(renderedIcon[1]);\r\n }\r\n selectedItem.set({\r\n restrictedView: newValue,\r\n });\r\n if (newValue) {\r\n selectedItem.insertAt(getSvgObject('restricted', rowSeatSize, '#000000'), 3, true);\r\n selectedItem._objects[1].set({ visible: false });\r\n } else {\r\n if (selectedItem.companion) {\r\n selectedItem.insertAt(getSvgObject('companion', rowSeatSize, '#000000'), 3, true);\r\n } else if (selectedItem.accesible) {\r\n selectedItem.insertAt(getSvgObject('accesible', rowSeatSize, '#000000'), 3, true);\r\n } else {\r\n selectedItem._objects[1].set({ visible: true });\r\n }\r\n }\r\n\r\n selectedItem.group.addWithUpdate();\r\n }\r\n\r\n private accesible({\r\n selectedItem,\r\n newValue,\r\n rowSeatSize,\r\n renderedIcon,\r\n }: any) {\r\n selectedItem.set({\r\n accesible: newValue,\r\n });\r\n if (newValue) {\r\n if (selectedItem.companion) {\r\n selectedItem.set({\r\n companion: false,\r\n });\r\n }\r\n if (!selectedItem.restrictedView) {\r\n if (renderedIcon[1]) {\r\n selectedItem.remove(renderedIcon[1]);\r\n }\r\n selectedItem.insertAt(getSvgObject('accesible', rowSeatSize, '#000000'), 3, true);\r\n }\r\n\r\n selectedItem._objects[1].set({ visible: false });\r\n } else {\r\n if (!selectedItem.restrictedView) {\r\n selectedItem.remove(renderedIcon[1]);\r\n selectedItem._objects[1].set({ visible: true });\r\n }\r\n }\r\n selectedItem.group.addWithUpdate();\r\n }\r\n\r\n private companion({\r\n selectedItem,\r\n newValue,\r\n rowSeatSize,\r\n renderedIcon,\r\n }: any) {\r\n selectedItem.set({\r\n companion: newValue,\r\n });\r\n if (newValue) {\r\n if (selectedItem.accesible) {\r\n selectedItem.set({\r\n accesible: false,\r\n });\r\n }\r\n if (!selectedItem.restrictedView) {\r\n if (renderedIcon[1]) {\r\n selectedItem.remove(renderedIcon[1]);\r\n }\r\n selectedItem.insertAt(getSvgObject('companion', rowSeatSize, '#000000'), 3, true);\r\n }\r\n\r\n selectedItem._objects[1].set({ visible: false });\r\n } else {\r\n if (!selectedItem.restrictedView) {\r\n selectedItem.remove(renderedIcon[1]);\r\n selectedItem._objects[1].set({ visible: true });\r\n }\r\n }\r\n selectedItem.group.addWithUpdate();\r\n }\r\n}\r\n\r\nexport default RowProperties;\r\n","import { fabric } from \"fabric\";\r\nimport { Handler } from \"../../../handlers\";\r\nimport store from \"../../../../../redux/store\";\r\nimport { SeatDistribution } from \"../../../enums/SeatDistribution\";\r\nimport { letters } from \"../../../constants/letters\";\r\nimport { FabricObject } from \"../../../utils\";\r\n\r\nclass ActiveSelectionProperties {\r\n public handler: Handler;\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n public updateProperties = (\r\n propertyName: string,\r\n newValue: any,\r\n allValuesForm: any,\r\n selectedItem: any\r\n ) => {\r\n const {\r\n properties: { rowSeatSize },\r\n } = store.getState();\r\n const {\r\n properties: { categories: categoriesList },\r\n } = store.getState();\r\n let selectedCategory: any =\r\n propertyName === \"categories\"\r\n ? categoriesList.filter((category: any) => category.key === newValue)[0]\r\n : \"\";\r\n let previewText;\r\n const selectedItems = selectedItem.getObjects();\r\n console.log(\"selectedItem\", selectedItem)\r\n const rows = selectedItem.getObjects(\"group\").filter((object: any) => object.superType === \"row\");\r\n switch (propertyName) {\r\n case \"categories\":\r\n if(rows.length > 0){\r\n rows.forEach((row: any) => {\r\n row.set({\r\n category: {\r\n name: selectedCategory.name,\r\n color: selectedCategory.color,\r\n key: selectedCategory.key,\r\n },\r\n })\r\n const seats = row.getObjects(\"group\");\r\n seats.forEach((seat: any) => {\r\n const seatShape = seat.item(0);\r\n seatShape.set({\r\n stroke: selectedCategory.color,\r\n fill: `${selectedCategory.color}40`,\r\n });\r\n seat.set({\r\n category: {\r\n name: selectedCategory.name,\r\n color: selectedCategory.color,\r\n key: selectedCategory.key,\r\n },\r\n });\r\n });\r\n });\r\n }\r\n selectedItem.addWithUpdate();\r\n break;\r\n case \"sectionName\":\r\n if(rows.length > 0){\r\n rows.forEach((row: any) => {\r\n row.set({\r\n section: {\r\n label: newValue,\r\n displayedLabel: row.section.displayedLabel,\r\n },\r\n });\r\n const seats = row.getObjects(\"group\");\r\n seats.forEach((seat: any) => {\r\n let txtObj = seat.item(1);\r\n this.setSeatValue(seat, row, txtObj.text);\r\n });\r\n }\r\n );\r\n }\r\n break;\r\n case \"displayedSectionName\":\r\n if(rows.length > 0){\r\n rows.forEach((row: any) => {\r\n row.set({\r\n section: {\r\n label: row.section.label,\r\n displayedLabel: newValue,\r\n },\r\n });\r\n const seats = row.getObjects(\"group\");\r\n seats.forEach((seat: any) => {\r\n let txtObj = seat.item(1);\r\n this.setSeatValue(seat, row, txtObj.text);\r\n });\r\n }\r\n );\r\n }\r\n break;\r\n case \"seatLabeling\":\r\n if(rows.length > 0){\r\n rows.forEach((row: any) => {\r\n const seats = row.getObjects(\"group\");\r\n const { numberArr, letterArr } = this.selectDistribution(\r\n newValue,\r\n seats.length,\r\n row\r\n );\r\n seats.forEach((seat:any, index: number) => {\r\n const text = seat.item(1);\r\n const selectedText =\r\n numberArr.length != 0\r\n ? numberArr[index].toString()\r\n : newValue == SeatDistribution.upperCase\r\n ? letterArr[index].toUpperCase()\r\n : newValue == SeatDistribution.lowerCase\r\n ? letterArr[index]\r\n : \"\";\r\n text.set({\r\n text: selectedText,\r\n });\r\n seat.set({\r\n label: selectedText,\r\n });\r\n this.setSeatValue(seat, row, selectedText.toString());\r\n });\r\n row.set({\r\n seat: {\r\n key: newValue,\r\n list: numberArr.length != 0 ? numberArr : letterArr,\r\n startsAt: 1,\r\n reverse: false,\r\n },\r\n });\r\n })\r\n }\r\n break;\r\n case \"reverse\":\r\n if(rows.length > 0){\r\n rows.forEach((row: any) => {\r\n const seats = row.getObjects(\"group\");\r\n let original = row.seat.list as Array;\r\n let reverse = original.reverse();\r\n seats.forEach((seat:any, index: number) => {\r\n const text = seat.item(1);\r\n text.set({\r\n text: reverse[index].toString(),\r\n });\r\n text.initDimensions();\r\n seat.set({\r\n label: reverse[index].toString(),\r\n });\r\n this.setSeatValue(\r\n seat,\r\n row,\r\n reverse[index].toString()\r\n );\r\n }\r\n );\r\n row.set({\r\n seat: {\r\n key: row.seat.key,\r\n list: reverse,\r\n reverse: newValue,\r\n startsAt: row.seat.startsAt,\r\n },\r\n });\r\n })\r\n }\r\n selectedItem.addWithUpdate();\r\n break;\r\n case \"starstAt\":\r\n if(rows.length > 0){\r\n rows.forEach((row: any) => {\r\n const seats = row.getObjects(\"group\");\r\n let starts;\r\n let newList = [] as Array;\r\n starts = newValue;\r\n console.log(\"newValue\", newValue)\r\n console.log(\"row.seat.key\", row.seat.key)\r\n if(row.seat.reverse){\r\n switch (row.seat.key) {\r\n case SeatDistribution.normal:\r\n do {\r\n newList.push(starts);\r\n starts++;\r\n } while (newList.length != seats.length);\r\n newList.reverse();\r\n break;\r\n case SeatDistribution.odds:\r\n do {\r\n if (starts % 2 == 1) newList.push(starts);\r\n starts++;\r\n } while (newList.length != seats.length);\r\n newList.reverse();\r\n break;\r\n case SeatDistribution.evens:\r\n do {\r\n if (starts % 2 == 0) newList.push(starts);\r\n starts++;\r\n } while (newList.length != seats.length);\r\n newList.reverse();\r\n break;\r\n }\r\n }\r\n else{\r\n switch (row.seat.key) {\r\n case SeatDistribution.normal:\r\n do {\r\n newList.push(starts);\r\n starts++;\r\n } while (newList.length != seats.length);\r\n break;\r\n case SeatDistribution.odds:\r\n do {\r\n if (starts % 2 == 1) newList.push(starts);\r\n starts++;\r\n } while (newList.length != seats.length);\r\n break;\r\n case SeatDistribution.evens:\r\n do {\r\n if (starts % 2 == 0) newList.push(starts);\r\n starts++;\r\n } while (newList.length != seats.length);\r\n break;\r\n }\r\n }\r\n seats.forEach((seat: any, index: number) => {\r\n const text = seat.item(1);\r\n text.set({\r\n text: newList[index].toString(),\r\n });\r\n seat.set({\r\n label: newList[index].toString(),\r\n });\r\n this.setSeatValue(\r\n seat,\r\n row,\r\n newList[index]\r\n );\r\n });\r\n row.set({\r\n seat: {\r\n key: row.seat.key,\r\n list: newList,\r\n startsAt: newValue,\r\n reverse: row.seat.reverse,\r\n },\r\n });\r\n });\r\n }\r\n break;\r\n case \"rowLabel\":\r\n this.handler.canvas.discardActiveObject();\r\n if(rows.length > 0){\r\n rows.forEach((row: any, index: number) => {\r\n const old = { ...row };\r\n const seats = row.getObjects(\"group\");\r\n const textObjs = row.getObjects(\"textbox\") || [];\r\n const textRight =\r\n textObjs.filter((textbox: any) => textbox.side === \"right\") || [];\r\n const textLeft =\r\n textObjs.filter((textbox: any) => textbox.side === \"left\") || [];\r\n row.set({\r\n row: {\r\n label: letters[index].toUpperCase(),\r\n displayedLabel: row.row.displayedLabel,\r\n enabled: true,\r\n position: {\r\n left: row.row.position.left,\r\n right: row.row.position.right,\r\n },\r\n },\r\n });\r\n \r\n seats.forEach((seat: any) => {\r\n this.setSeatValue(seat, row, seat.label);\r\n });\r\n \r\n if (textRight.length > 0 && row.row.displayedLabel == \"\") {\r\n textRight[0].set({\r\n text: letters[index].toUpperCase(),\r\n });\r\n }\r\n if (textLeft.length > 0 && row.row.displayedLabel == \"\") {\r\n row.set({\r\n angle: -row.angleHelp,\r\n });\r\n row.addWithUpdate();\r\n row.removeWithUpdate(textLeft[0]);\r\n previewText = this.getWidthFromPreviewText(letters[index].toUpperCase(), rowSeatSize);\r\n \r\n textLeft[0].set({\r\n left: row.left - previewText.width - 6,\r\n text: letters[index].toUpperCase(),\r\n });\r\n row.addWithUpdate(textLeft[0]);\r\n row.set({\r\n angle: row.angleHelp,\r\n });\r\n row.addWithUpdate();\r\n }\r\n row.set({\r\n left: old.left,\r\n top: old.top,\r\n });\r\n row.addWithUpdate();\r\n })\r\n }\r\n const activeSelection = new fabric.ActiveSelection(selectedItems, {\r\n canvas: this.handler.canvas\r\n });\r\n this.handler.canvas.setActiveObject(activeSelection);\r\n this.handler.canvas.renderAll();\r\n this.handler.drawingHandler.setType('activeSelection');\r\n break;\r\n case \"labelPositionLeft\":\r\n case \"labelPositionRight\":\r\n this.handler.canvas.discardActiveObject();\r\n if(rows.length > 0){\r\n rows.forEach((row: any, index: number) => {\r\n const seats = row.getObjects(\"group\");\r\n const old = { ...row };\r\n if(propertyName == \"labelPositionLeft\" && row.row.position.left === newValue){\r\n return;\r\n }\r\n if(propertyName == \"labelPositionRight\" && row.row.position.right === newValue){\r\n return;\r\n }\r\n row.set({\r\n row: {\r\n label: row.row.label,\r\n displayedLabel: row.row.displayedLabel,\r\n enabled: row.row.enabled,\r\n position: {\r\n left:\r\n propertyName == \"labelPositionLeft\"\r\n ? newValue\r\n : row.row.position.left,\r\n right:\r\n propertyName == \"labelPositionRight\"\r\n ? newValue\r\n : row.row.position.right,\r\n },\r\n },\r\n });\r\n const {\r\n row: { displayedLabel: displayed, label: labl },\r\n } = row;\r\n let selectedText = displayed != \"\" ? displayed : labl != \"\" ? labl : \"?\";\r\n if (!newValue) {\r\n let textObjs = row.getObjects(\"textbox\");\r\n let textbox;\r\n if (propertyName === \"labelPositionLeft\") {\r\n textbox = textObjs.filter((textbox: any) => textbox.side === \"left\");\r\n row.removeWithUpdate(textbox[0]);\r\n if (row.angleHelp < 0) {\r\n row.set({\r\n left: old.left + (old.width - row.width),\r\n top: old.top,\r\n });\r\n row.addWithUpdate();\r\n } else {\r\n row.set({\r\n left: old.left + (old.width - row.width),\r\n top: old.top + (old.height - row.height),\r\n });\r\n row.addWithUpdate();\r\n }\r\n } else {\r\n textbox = textObjs.filter((textbox: any) => textbox.side === \"right\");\r\n row.removeWithUpdate(textbox[0]);\r\n if (row.angleHelp < 0) {\r\n row.set({\r\n left: old.left,\r\n top: old.top + (old.height - row.height),\r\n });\r\n row.addWithUpdate();\r\n } else {\r\n row.set({\r\n left: old.left,\r\n top: old.top,\r\n });\r\n row.addWithUpdate();\r\n }\r\n }\r\n } else {\r\n previewText = this.getWidthFromPreviewText(selectedText, rowSeatSize);\r\n row.set({\r\n angle: -row.angleHelp,\r\n });\r\n row.addWithUpdate();\r\n row.setCoords();\r\n if (row.seatsCurve != 0) {\r\n for (let index = 0; index < seats.length; index++) {\r\n seats[index].set({\r\n top: seats[0].top,\r\n });\r\n }\r\n row.set({\r\n seatsCurve: 0,\r\n });\r\n row.addWithUpdate();\r\n }\r\n row.set({\r\n left: old.left,\r\n top: old.top,\r\n });\r\n row.addWithUpdate();\r\n row.setCoords();\r\n let text = new fabric.Text(selectedText, {\r\n fontSize: rowSeatSize - 2,\r\n left:\r\n propertyName == \"labelPositionLeft\"\r\n ? row.left - previewText.width - 6\r\n : row.left + row.width + 6,\r\n top:\r\n row.top + row.height / 2 - previewText.height / 2,\r\n fill: \"#000000\",\r\n stroke: \"#000000\",\r\n strokeWidth: 0,\r\n fontFamily: \"Roboto\",\r\n originX: \"left\",\r\n originY: \"top\",\r\n type: \"textbox\",\r\n hasControls: false,\r\n hasBorders: false,\r\n strokeUniform: true,\r\n selectable: false,\r\n lockMovementX: true,\r\n lockMovementY: true,\r\n hoverCursor: \"pointer\",\r\n visible: true,\r\n angle: 0,\r\n }) as FabricObject;\r\n text.set({\r\n side: propertyName == \"labelPositionLeft\" ? \"left\" : \"right\",\r\n });\r\n row.addWithUpdate(text);\r\n row.set({\r\n angle: row.angleHelp,\r\n });\r\n row.addWithUpdate();\r\n if (row.angleHelp < 0) {\r\n row.set({\r\n left:\r\n propertyName == \"labelPositionLeft\"\r\n ? old.left - (row.width - old.width)\r\n : old.left,\r\n top:\r\n propertyName == \"labelPositionLeft\"\r\n ? old.top\r\n : old.top - (row.height - old.height),\r\n });\r\n row.addWithUpdate();\r\n return;\r\n } else {\r\n if (propertyName == \"labelPositionLeft\") {\r\n row.set({\r\n left: old.left - (row.width - old.width),\r\n top: old.top - (row.height - old.height),\r\n });\r\n } else {\r\n row.set({\r\n left: old.left,\r\n top: old.top,\r\n });\r\n }\r\n row.addWithUpdate();\r\n }\r\n }\r\n })\r\n const activeSelection = new fabric.ActiveSelection(selectedItems, {\r\n canvas: this.handler.canvas\r\n });\r\n this.handler.canvas.setActiveObject(activeSelection);\r\n this.handler.canvas.renderAll();\r\n this.handler.drawingHandler.setType('activeSelection');\r\n }\r\n break;\r\n default:\r\n console.log(\"La propiedad no corresponde a un obj texto\");\r\n break;\r\n }\r\n };\r\n\r\n private setSeatValue = (seat: any, rowData: any, seatlabel: string) => {\r\n seat.set({\r\n value: `${rowData.section.label}${rowData.section.label && \r\n rowData.row.label &&\r\n \"-\"}${rowData.row.label}${(rowData.row.label ||\r\n rowData.section.label) &&\r\n seatlabel &&\r\n \"-\"}${seatlabel}`,\r\n isLabeled:\r\n (rowData.row.enabled ? rowData.row.label != \"\" : true) &&\r\n seatlabel != \"\",\r\n });\r\n console.log(\"seat.value\", seat.value)\r\n };\r\n\r\n private selectDistribution(newValue: any, seatsQuantity: number, selectedItem: any) {\r\n let numberArr: Array = [];\r\n let letterArr: Array = [];\r\n let odd = seatsQuantity % 2;\r\n let count = 0;\r\n switch (newValue) {\r\n case SeatDistribution.normal:\r\n do {\r\n count++;\r\n numberArr.push(count);\r\n } while (numberArr.length != seatsQuantity);\r\n break;\r\n case SeatDistribution.odds:\r\n do {\r\n count++;\r\n if (count % 2 == 1) numberArr.push(count);\r\n } while (numberArr.length != seatsQuantity);\r\n break;\r\n case SeatDistribution.evens:\r\n do {\r\n count++;\r\n if (count % 2 == 0) numberArr.push(count);\r\n } while (numberArr.length != seatsQuantity);\r\n break;\r\n case SeatDistribution.oddsToEvens:\r\n if (odd == 1) {\r\n do {\r\n count++;\r\n if (count % 2 == 1) numberArr.push(count);\r\n } while (numberArr.length != Math.round(seatsQuantity / 2));\r\n count--;\r\n } else {\r\n do {\r\n count++;\r\n if (count % 2 == 1) numberArr.push(count);\r\n } while (numberArr.length != seatsQuantity / 2);\r\n count++;\r\n }\r\n do {\r\n if (count % 2 == 0) numberArr.push(count);\r\n count--;\r\n } while (numberArr.length != seatsQuantity);\r\n break;\r\n case SeatDistribution.centerOddsToEvens:\r\n numberArr = Array(seatsQuantity);\r\n let index = 0;\r\n index = Math.trunc(seatsQuantity / 2);\r\n index = index % 2 == 0 ? index : index + 1;\r\n do {\r\n count++;\r\n if (count % 2 == 1) {\r\n numberArr[index] = count;\r\n index--;\r\n }\r\n } while (index >= 0);\r\n count = 1;\r\n index = Math.round(seatsQuantity / 2);\r\n do {\r\n count++;\r\n if (count % 2 == 0) {\r\n numberArr[index] = count;\r\n index++;\r\n }\r\n } while (index < seatsQuantity);\r\n break;\r\n case SeatDistribution.upperCase:\r\n case SeatDistribution.lowerCase:\r\n for (let index = 0; index < seatsQuantity; index++) {\r\n let letter: string = \"\";\r\n let repeat: number = Math.ceil(letterArr.length / 26);\r\n if (letterArr.length == 0) repeat = 1;\r\n if (count > 26) count = 0;\r\n for (let index = 0; index < repeat; index++) {\r\n letter += letters[count];\r\n }\r\n letterArr.push(letter);\r\n count++;\r\n }\r\n break;\r\n }\r\n return { numberArr, letterArr };\r\n }\r\n\r\n private getWidthFromPreviewText = (\r\n text: string,\r\n rowSeatSize: number\r\n ): any => {\r\n let previewText = new fabric.Text(text, {\r\n fontSize: rowSeatSize - 2,\r\n left: 0,\r\n top: 0,\r\n fill: \"#000000\",\r\n stroke: \"#000000\",\r\n strokeWidth: 0,\r\n fontFamily: \"Roboto\",\r\n originX: \"left\",\r\n originY: \"top\",\r\n type: \"textbox\",\r\n }) as FabricObject;\r\n this.handler.canvas.add(previewText);\r\n let canvasObjects = this.handler.canvas.getObjects();\r\n let canvasPreviewText = canvasObjects[canvasObjects.length - 1];\r\n this.handler.canvas.remove(canvasPreviewText);\r\n return canvasPreviewText;\r\n };\r\n}\r\n\r\nexport default ActiveSelectionProperties;\r\n","import { fabric } from \"fabric\";\r\nimport { v4 } from \"uuid\";\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricObject, IObjectDesingner ,FabricEvent } from \"../../utils\";\r\nimport { ShapeProperties } from \"./properties\";\r\nimport {iconStage} from \"../../../mapeditor/icons/Icons\"\r\n\r\nclass Ellipse extends ShapeProperties implements IObjectDesingner {\r\n constructor(handler: Handler) {\r\n super(handler);\r\n }\r\n onMouseDblClick(event: FabricEvent) {\r\n return;\r\n }\r\n\r\n public onInit() {\r\n this.handler.interactionHandler.drawing(\"ellipse\", \"crosshair\");\r\n this.handler.activeShape = null;\r\n }\r\n\r\n public onMousedown(event : FabricEvent) {\r\n const {x , y} = this.handler.canvas.getPointer(event.e);\r\n this.addPoint(x, y);\r\n }\r\n\r\n public onMousemove(event : FabricEvent) {\r\n const {x , y} = this.handler.canvas.getPointer(event.e);\r\n if (!this.handler.isDown) return;\r\n this.updating(x, y);\r\n this.handler.canvas.renderAll();\r\n }\r\n\r\n public onMouseup(event : FabricEvent) {\r\n const {x, y} = this.handler.canvas.getPointer(event.e);\r\n this.generate(false, false, x, y);\r\n this.finish();\r\n }\r\n\r\n private addPoint(x: number, y: number) {\r\n this.handler.isDown = true;\r\n const editable = this.handler.editable;\r\n const id = v4();\r\n this.handler.activeShape = new fabric.Ellipse({\r\n name: \"New ellipse\",\r\n left: x,\r\n top: y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n angle: 0,\r\n fill: \"#cccccc\",\r\n strokeWidth: 4,\r\n stroke: \"#727272\",\r\n strokeUniform: true,\r\n strokeLineCap: \"true\",\r\n transparentCorners: false,\r\n objectCaching: !editable,\r\n type: \"ellipse\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n }) as FabricObject;\r\n\r\n this.handler.activeShape.set({\r\n id: id,\r\n superType: \"ellipse\",\r\n container: this.handler.container.id,\r\n editable: editable,\r\n text: \"Label\",\r\n displayedLabel: false,\r\n typeIcon: \"\",\r\n });\r\n\r\n this.handler.objText = new fabric.Text(\"Label\", {\r\n fontSize: 16,\r\n left: x,\r\n top: y,\r\n angle: 0,\r\n fill: \"#727272\",\r\n stroke: \"#727272\",\r\n strokeWidth: 0,\r\n fontFamily: \"Roboto\",\r\n opacity: 1,\r\n type: \"text\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n strokeUniform: true,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n text: \"?\",\r\n visible: false,\r\n }) as FabricObject;\r\n\r\n this.handler.objText.set({\r\n id: id,\r\n superType: \"textbox\",\r\n container: this.handler.container.id,\r\n editable,\r\n displayedLabel: false,\r\n });\r\n\r\n let svgConverted, serializer, svgStr;\r\n\r\n let svgEl = iconStage;\r\n\r\n svgConverted = document.createRange().createContextualFragment(svgEl);\r\n serializer = new XMLSerializer();\r\n svgStr = serializer.serializeToString(svgConverted);\r\n\r\n let containerId = this.handler.container.id;\r\n let loadedObject = this.handler.objIcon;\r\n fabric.loadSVGFromString(svgStr, function(objects, options) {\r\n // Group elements to fabric.PathGroup (more than 1 elements) or\r\n // to fabric.Path\r\n loadedObject = fabric.util.groupSVGElements(objects, options);\r\n loadedObject.set({\r\n id: id,\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n container: containerId,\r\n editable: editable,\r\n fill: \"#727272\",\r\n left: x,\r\n top: y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n opacity: 1,\r\n objectCaching: !editable,\r\n superType: \"svg\",\r\n type: \"svg\",\r\n name: \"New icon SVG\",\r\n svg: svgEl,\r\n loadType: \"svg\",\r\n visible: false,\r\n scaled: 1,\r\n originHeight: loadedObject.height,\r\n originWidth: loadedObject.width,\r\n rotated: 0\r\n });\r\n });\r\n\r\n this.handler.activeShape.guides = {};\r\n this.handler.canvas.add(this.handler.activeShape);\r\n this.handler.objIcon = loadedObject;\r\n this.handler.activeShape = this.handler.activeShape;\r\n }\r\n\r\n private updating(x: number, y: number) {\r\n if (this.handler.originPointer.x > x){\r\n this.handler.activeShape.set({ left: x });\r\n }\r\n if (this.handler.originPointer.y > y){\r\n this.handler.activeShape.set({ top: y });\r\n }\r\n this.handler.activeShape.set({ rx: Math.trunc(Math.abs((x-this.handler.originPointer.x)/2)), ry: Math.trunc(Math.abs((y-this.handler.originPointer.y)/2)) });\r\n }\r\n\r\n private generate(isDown: any, loaded: any, x: number, y: number) {\r\n const { editable, gridOption, onAdd } = this.handler;\r\n const id = v4();\r\n const group = new fabric.Group(\r\n [this.handler.activeShape, this.handler.objText, this.handler.objIcon],\r\n {\r\n left: this.handler.originPointer.x < x ? this.handler.originPointer.x : x,\r\n top: this.handler.originPointer.y < y ? this.handler.originPointer.y : y,\r\n hasControls: editable,\r\n hasBorders: editable,\r\n type: \"group\",\r\n subTargetCheck: true,\r\n }\r\n ) as FabricObject;\r\n\r\n group.set({\r\n id: id,\r\n superType: \"ellipse\",\r\n visibleIcon: false,\r\n visibleText: false,\r\n hoverCursor: \"crosshair\",\r\n selectable: false\r\n });\r\n\r\n // eliminamos el objeto creado incialmente del canvas\r\n this.handler.canvas.remove(this.handler.activeShape);\r\n this.handler.objIcon = null;\r\n\r\n //añadimos al canvas el nuevo objeto agrupado\r\n this.handler.canvas.add(group);\r\n\r\n //se establecen en 0 la posicion del label en X y Y\r\n group.item(2).left = 0;\r\n group.item(2).top = 0;\r\n\r\n // se le resta la mitad de la anchura y altura del texto por defecto para centrar el texto con el objeto\r\n const widthIcon = group.item(2).width ?? 0;\r\n const heightIcon = group.item(2).height ?? 0;\r\n group.item(2).set({\r\n left: group.item(2).left - (widthIcon / 2),\r\n top: group.item(2).top - (heightIcon / 2),\r\n fill: \"#727272\",\r\n });\r\n\r\n group.item(1).left = 1;\r\n group.item(1).top = 1;\r\n\r\n const widthText = group.item(1).width ?? 0;\r\n const heightText = group.item(1).height ?? 0;\r\n\r\n group.item(1).set({\r\n left: group.item(1).left - (widthText / 2),\r\n top: group.item(1).top - (heightText / 2),\r\n });\r\n this.handler.objects = this.handler.getObjects();\r\n group.addWithUpdate();\r\n group.setCoords();\r\n if (!editable && !(group.superType === \"element\"))\r\n group.on(\"mousedown\", this.handler.eventHandler.object.mousedown);\r\n if (group.dblclick)\r\n group.on(\"mousedblclick\", this.handler.eventHandler.object.mousedblclick);\r\n if (group.superType === \"node\") this.handler.portHandler.create(group);\r\n if (group.superType === \"node\") group.setShadow(group.stroke);\r\n if (gridOption?.enabled ?? false) this.handler.gridHandler.setCoords(group);\r\n if (!this.handler.transactionHandler.active)\r\n this.handler.transactionHandler.save(\"add\");\r\n if (onAdd && editable && !loaded) onAdd(group);\r\n\r\n this.handler.isDown = isDown;\r\n this.handler.activeShape = null;\r\n }\r\n\r\n private finish() {\r\n //this.handler.canvas.remove(this.handler.activeShape);\r\n this.handler.activeShape = null;\r\n this.handler.canvas.discardActiveObject();\r\n this.handler.canvas.renderAll();\r\n //this.handler.interactionHandler.selection();\r\n }\r\n}\r\nexport default Ellipse;\r\n","import { fabric } from \"fabric\";\r\nimport { v4 } from \"uuid\";\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricObject, IObjectDesingner, FabricEvent } from \"../../utils\";\r\nimport { ZoneProperties } from \"./properties\";\r\n\r\nclass CircleZone extends ZoneProperties implements IObjectDesingner {\r\n constructor(handler: Handler) {\r\n super(handler);\r\n }\r\n\r\n public onInit() {\r\n this.handler.interactionHandler.drawing(\"circleZone\", \"crosshair\");\r\n this.handler.activeShape = null;\r\n }\r\n\r\n public onMouseDblClick(event: FabricEvent) {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n public onMousedown(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n this.addPoint(x, y);\r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n if (!this.handler.isDown) return;\r\n this.updating(x, y);\r\n this.handler.canvas.renderAll();\r\n }\r\n\r\n public onMouseup(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n this.generate(false, false);\r\n this.finish();\r\n }\r\n\r\n private addPoint(x: number, y: number) {\r\n this.handler.isDown = true;\r\n const editable = this.handler.editable;\r\n const id = v4();\r\n this.handler.activeShape = new fabric.Circle({\r\n name: \"New circle zone\",\r\n left: x,\r\n top: y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n radius: 0,\r\n angle: 0,\r\n fill: \"#cccccc\",\r\n strokeWidth: 4,\r\n stroke: \"#727272\",\r\n strokeUniform: true,\r\n transparentCorners: false,\r\n opacity: 1,\r\n objectCaching: !editable,\r\n type: \"circle\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n }) as FabricObject;\r\n\r\n this.handler.activeShape.set({\r\n id: id,\r\n superType: \"circleZone\",\r\n container: this.handler.container.id,\r\n editable: editable,\r\n category: \"\",\r\n capacity: 100,\r\n typeCapacity: \"generalAdmission\",\r\n });\r\n\r\n this.handler.objText = new fabric.Text(\"Label\", {\r\n fontSize: 16,\r\n left: x,\r\n top: y,\r\n angle: 0,\r\n fill: \"#727272\",\r\n strokeUniform: true,\r\n stroke: \"#727272\",\r\n strokeWidth: 0,\r\n fontFamily: \"Roboto\",\r\n opacity: 1,\r\n type: \"textbox\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n text: \"?\",\r\n }) as FabricObject;\r\n\r\n this.handler.objText.set({\r\n id: id,\r\n superType: \"textbox\",\r\n container: this.handler.container.id,\r\n editable,\r\n displayedLabel: false,\r\n });\r\n\r\n this.handler.activeShape.guides = {};\r\n this.handler.canvas.add(this.handler.activeShape);\r\n }\r\n\r\n private updating(x: number, y: number) {\r\n if (this.handler.originPointer.x > x)\r\n this.handler.activeShape.set({ left: Math.abs(x) });\r\n if (this.handler.originPointer.y > y)\r\n this.handler.activeShape.set({ top: Math.abs(y) });\r\n this.handler.activeShape.set({\r\n radius:\r\n Math.max(\r\n Math.abs(this.handler.originPointer.y - y),\r\n Math.abs(this.handler.originPointer.x - x)\r\n ) / 2,\r\n });\r\n }\r\n\r\n private generate(isDown: any, loaded: any) {\r\n const { editable, gridOption, onAdd } = this.handler;\r\n\r\n const id = v4();\r\n\r\n let group = new fabric.Group(\r\n [this.handler.activeShape, this.handler.objText],\r\n {\r\n left: this.handler.originPointer.x,\r\n top: this.handler.originPointer.y,\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n type: \"group\",\r\n subTargetCheck: true,\r\n }\r\n ) as FabricObject;\r\n\r\n group.set({\r\n id: id,\r\n superType: \"circleZone\",\r\n tooltip: {\r\n enabled: true,\r\n },\r\n });\r\n\r\n // eliminamos el objeto creado incialmente del canvas\r\n this.handler.canvas.remove(this.handler.activeShape);\r\n //añadimos al canvas el nuevo objeto agrupado\r\n this.handler.canvas.add(group);\r\n\r\n //se establecen en 0 la posicion del label en X y Y\r\n group.item(1).left = 0;\r\n group.item(1).top = 0;\r\n\r\n // se le resta la mitad de la anchura y altura del texto por defecto para centrar el texto con el objeto\r\n const widthText = group.item(1).width ?? 0;\r\n const heightText = group.item(1).height ?? 0;\r\n group.item(1).set({\r\n left: -(widthText / 2),\r\n top: -(heightText / 2),\r\n // fontsize: group.item(1).width / 4,\r\n });\r\n\r\n this.handler.objects = this.handler.getObjects();\r\n\r\n if (!editable && !(group.superType === \"element\"))\r\n group.on(\"mousedown\", this.handler.eventHandler.object.mousedown);\r\n if (group.dblclick)\r\n group.on(\"mousedblclick\", this.handler.eventHandler.object.mousedblclick);\r\n if (group.superType === \"node\") this.handler.portHandler.create(group);\r\n if (group.superType === \"node\") group.setShadow(group.stroke);\r\n if (gridOption?.enabled) this.handler.gridHandler.setCoords(group);\r\n if (!this.handler.transactionHandler.active && !loaded)\r\n this.handler.transactionHandler.save(\"add\");\r\n if (onAdd && editable && !loaded) onAdd(group);\r\n\r\n this.handler.isDown = isDown;\r\n this.handler.activeShape = null;\r\n }\r\n\r\n private finish() {\r\n //this.handler.canvas.remove(this.handler.activeShape);\r\n this.handler.activeShape = null;\r\n this.handler.canvas.requestRenderAll();\r\n //this.handler.interactionHandler.selection();\r\n }\r\n}\r\nexport default CircleZone;\r\n","import { fabric } from \"fabric\";\r\nimport { v4 } from \"uuid\";\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricObject, IObjectDesingner, FabricEvent } from \"../../utils\";\r\n\r\nclass MultipleRows implements IObjectDesingner {\r\n private handler: Handler;\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n onMouseDblClick(event: FabricEvent) {\r\n return;\r\n }\r\n\r\n public onInit() {\r\n this.handler.interactionHandler.drawing(\"circularTable\", \"crosshair\");\r\n this.handler.activeShape = null;\r\n }\r\n\r\n public onMousedown(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n this.generateCircularTable(x, y);\r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n return;\r\n }\r\n\r\n public onMouseup(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n return;\r\n }\r\n\r\n public updateProperties(\r\n propertyName: string,\r\n newValue: any,\r\n allValuesForm: any,\r\n selectedItem: any\r\n ) {}\r\n\r\n private createSeat(x: number, y: number) {\r\n this.handler.isDown = true;\r\n const editable = this.handler.editable;\r\n const id = v4();\r\n\r\n let shape = new fabric.Circle({\r\n name: \"New circular Table Seat\",\r\n left: x,\r\n top: y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n radius: 7.5,\r\n angle: 0,\r\n fill: \"#cccccc\",\r\n strokeWidth: 1,\r\n stroke: \"#727272\",\r\n transparentCorners: false,\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n }) as FabricObject;\r\n\r\n shape.set({\r\n id: id,\r\n label: \"Label\",\r\n displayedLabel: \"\",\r\n container: this.handler.container.id,\r\n editable: editable,\r\n objectOption: this.handler.objectOption,\r\n });\r\n return shape;\r\n }\r\n\r\n private createTable(x: number, y: number) {\r\n this.handler.isDown = true;\r\n const editable = this.handler.editable;\r\n const id = v4();\r\n let shape = new fabric.Circle({\r\n name: \"Circular table\",\r\n left: x,\r\n top: y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n radius: 22.5,\r\n angle: 0,\r\n fill: \"#cccccc\",\r\n strokeWidth: 1,\r\n stroke: \"#727272\",\r\n transparentCorners: false,\r\n hasControls: this.handler.editable,\r\n hasBorders: this.handler.editable,\r\n selectable: this.handler.editable,\r\n lockMovementX: !this.handler.editable,\r\n lockMovementY: !this.handler.editable,\r\n hoverCursor: !this.handler.editable ? \"pointer\" : \"move\",\r\n }) as FabricObject;\r\n\r\n shape.set({\r\n id: id,\r\n label: \"Label\",\r\n displayedLabel: \"\",\r\n container: this.handler.container.id,\r\n editable: editable,\r\n objectOption: this.handler.objectOption,\r\n });\r\n return shape;\r\n }\r\n\r\n private createGroup() {\r\n const { editable } = this.handler;\r\n const id = v4();\r\n this.handler.group = new fabric.Group(undefined, {\r\n left: this.handler.originPointer.x,\r\n top: this.handler.originPointer.y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n type: \"group\",\r\n subTargetCheck: true,\r\n }) as FabricObject;\r\n\r\n this.handler.group.set({\r\n id: id,\r\n superType: \"circularTable\",\r\n centerTransform: true,\r\n seatsQuantity: null,\r\n maxSeatsQuantity: null,\r\n rowSize: null,\r\n seatsSpacing: 0,\r\n distanceBetweenX: 0,\r\n distanceBetweenY: 0,\r\n });\r\n this.handler.canvas.add(this.handler.group);\r\n }\r\n\r\n private addObjectToGroup(obj: FabricObject) {\r\n this.handler.activeShape = obj;\r\n this.handler.group?.addWithUpdate(obj);\r\n this.handler.canvas.renderAll();\r\n }\r\n\r\n private generateCircularTable(x: number, y: number) {\r\n this.createGroup();\r\n let table = this.createTable(x, y);\r\n this.addObjectToGroup(table);\r\n let seatQuantity = 10;\r\n let radius = 22.5;\r\n let diameter = radius * 2;\r\n let marginSeatTable = 8;\r\n let angleInterval = 360 / seatQuantity;\r\n let startAngle = 360;\r\n let seatRadius = 7.5;\r\n let seatDiameter = seatRadius * 2;\r\n let seatLocationDiameter = diameter + marginSeatTable + seatDiameter;\r\n let coordXTableCenter = x + radius - seatRadius;\r\n let coordYTableCenter = y + radius - seatRadius;\r\n for (let i = 0; i < seatQuantity; i++) {\r\n let rotation = startAngle - i * angleInterval;\r\n let x =\r\n coordXTableCenter +\r\n (seatLocationDiameter / 2) * Math.cos((Math.PI / 180) * rotation);\r\n let y =\r\n coordYTableCenter +\r\n (seatLocationDiameter / 2) * Math.sin((Math.PI / 180) * rotation);\r\n let seat = this.createSeat(x, y);\r\n this.addObjectToGroup(seat);\r\n }\r\n this.finish();\r\n }\r\n\r\n private finish() {\r\n this.handler.group?.setCoords();\r\n this.handler.canvas.renderAll();\r\n }\r\n}\r\nexport default MultipleRows;\r\n","import { fabric } from \"fabric\";\r\nimport { v4 } from \"uuid\";\r\n\r\nimport { Handler } from \"../../handlers\";\r\nimport { IObjectDesingner, FabricEvent } from \"../../utils\";\r\n\r\nclass Icon implements IObjectDesingner {\r\n private handler: Handler;\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n onMouseDblClick(event: FabricEvent) {\r\n return;\r\n }\r\n\r\n public onInit() {\r\n this.handler.interactionHandler.drawing(\"svg\");\r\n this.handler.activeShape = null;\r\n }\r\n\r\n public onMousedown(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n this.addPoint(x, y);\r\n this.generate(false, false);\r\n this.finish();\r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n return;\r\n }\r\n\r\n public onMouseup(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n return;\r\n }\r\n\r\n public updateProperties(\r\n propertyName: string,\r\n newValue: any,\r\n allValuesForm: any,\r\n selectedItem: any\r\n ) {\r\n if (propertyName === \"iconType\") {\r\n this.setIcon(newValue);\r\n return;\r\n }\r\n\r\n if (propertyName === \"fill\") {\r\n selectedItem.set({\r\n fill: newValue\r\n })\r\n selectedItem._objects.forEach((path: any) => {\r\n path.set(propertyName, newValue);\r\n path.setCoords();\r\n });\r\n }\r\n\r\n if (propertyName === \"scaleX\") {\r\n selectedItem.set(propertyName, newValue);\r\n selectedItem.set(\"scaleY\", newValue);\r\n selectedItem.setCoords();\r\n }\r\n\r\n this.handler.canvas.requestRenderAll();\r\n const { onModified } = this.handler;\r\n if (onModified) onModified(selectedItem);\r\n }\r\n\r\n private selectedIcon: string = `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `;\r\n\r\n private setIcon(icon: string) {\r\n this.selectedIcon = icon;\r\n }\r\n\r\n private addPoint(x: number, y: number) {\r\n this.handler.isDown = true;\r\n const editable = this.handler.editable;\r\n const id = v4();\r\n let svgConverted, serializer, svgStr;\r\n\r\n let svgEl = this.selectedIcon;\r\n\r\n svgConverted = document.createRange().createContextualFragment(svgEl);\r\n serializer = new XMLSerializer();\r\n svgStr = serializer.serializeToString(svgConverted);\r\n\r\n this.handler.activeShape = svgStr;\r\n\r\n let containerId = this.handler.container.id;\r\n let loadedObject = this.handler.activeShape;\r\n fabric.loadSVGFromString(this.handler.activeShape, function(\r\n objects,\r\n options\r\n ) {\r\n // Group elements to fabric.PathGroup (more than 1 elements) or\r\n // to fabric.Path\r\n loadedObject = fabric.util.groupSVGElements(objects, options);\r\n loadedObject.set({\r\n id: id,\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n container: containerId,\r\n editable: editable,\r\n left: x,\r\n top: y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n opacity: 1,\r\n objectCaching: !editable,\r\n superType: \"svg\",\r\n type: \"svg\",\r\n name: \"New icon SVG\",\r\n svg: svgEl,\r\n loadType: \"svg\",\r\n });\r\n });\r\n this.handler.canvas.add(loadedObject);\r\n this.handler.activeShape = loadedObject;\r\n }\r\n\r\n private generate(isDown: any, loaded: any) {\r\n const { editable, gridOption, onAdd } = this.handler;\r\n const obj = this.handler.activeShape;\r\n if (!editable && !(obj.superType === \"element\"))\r\n obj.on(\"mousedown\", this.handler.eventHandler.object.mousedown);\r\n if (obj === \"node\") obj.setShadow({ color: obj.stroke });\r\n //if (obj.dblclick) obj.on('mousedblclick', this.handler.eventHandler.object.mousedblclick);\r\n if (obj.superType === \"node\") this.handler.portHandler.create(obj);\r\n if (gridOption?.enabled ?? false) this.handler.gridHandler.setCoords(obj);\r\n if (!this.handler.transactionHandler.active && !loaded)\r\n this.handler.transactionHandler.save(\"add\");\r\n if (onAdd && editable && !loaded) onAdd(obj);\r\n\r\n this.handler.isDown = isDown;\r\n this.handler.activeShape = null;\r\n }\r\n\r\n private finish() {\r\n //this.handler.canvas.remove(this.handler.activeShape);\r\n this.handler.activeShape = null;\r\n this.handler.canvas.discardActiveObject();\r\n this.handler.canvas.renderAll();\r\n }\r\n}\r\nexport default Icon;\r\n","import { fabric } from \"fabric\";\r\nimport { v4 } from \"uuid\";\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricObject, IObjectDesingner, FabricEvent } from \"../../utils\";\r\n\r\nclass MultipleRows implements IObjectDesingner {\r\n private handler: Handler;\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n public onInit() {\r\n this.handler.interactionHandler.drawing(\"multipleRows\", \"crosshair\");\r\n this.handler.activeShape = null;\r\n }\r\n\r\n onMouseDblClick(event: FabricEvent) {\r\n return;\r\n }\r\n\r\n public onMousedown(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n this.createGroup();\r\n const seat = this.createSeat(x, y);\r\n this.addSeatToGroup(seat);\r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n return;\r\n }\r\n\r\n public onMouseup(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n this.updateRow(x, y);\r\n }\r\n\r\n public updateProperties(\r\n propertyName: string,\r\n newValue: any,\r\n allValuesForm: any,\r\n selectedItem: any\r\n ) {}\r\n\r\n private createSeat(x: number, y: number) {\r\n this.handler.isDown = true;\r\n const editable = this.handler.editable;\r\n const id = v4();\r\n\r\n let shape = new fabric.Circle({\r\n name: \"New Row Seat\",\r\n left: x,\r\n top: y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n radius: 7.5,\r\n angle: 0,\r\n fill: \"#cccccc\",\r\n strokeWidth: 1,\r\n stroke: \"#727272\",\r\n transparentCorners: false,\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n }) as FabricObject;\r\n\r\n shape.set({\r\n id: id,\r\n label: \"Label\",\r\n displayedLabel: \"\",\r\n container: this.handler.container.id,\r\n editable: editable,\r\n objectOption: this.handler.objectOption,\r\n });\r\n return shape;\r\n }\r\n\r\n private createGroup() {\r\n const { editable } = this.handler;\r\n const id = v4();\r\n this.handler.group = new fabric.Group(undefined, {\r\n left: this.handler.originPointer.x,\r\n top: this.handler.originPointer.y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n type: \"group\",\r\n subTargetCheck: true,\r\n }) as FabricObject;\r\n\r\n this.handler.group.set({\r\n id: id,\r\n superType: \"multipleRows\",\r\n centerTransform: true,\r\n seatsQuantity: null,\r\n maxSeatsQuantity: null,\r\n rowSize: null,\r\n seatsSpacing: 0,\r\n distanceBetweenX: 0,\r\n distanceBetweenY: 0,\r\n });\r\n this.handler.canvas.add(this.handler.group);\r\n }\r\n\r\n private addSeatToGroup(obj: FabricObject) {\r\n this.handler.activeShape = obj;\r\n this.handler.group?.addWithUpdate(obj);\r\n this.handler.canvas.renderAll();\r\n }\r\n\r\n private updateRow(x: number, y: number) {\r\n let x1 = this.handler.originPointer.x;\r\n let xHelper = this.handler.originPointer.x;\r\n let y1 = this.handler.originPointer.y;\r\n let x2 = x;\r\n let y2 = y;\r\n let distanceBetweenX = x2 - x1;\r\n let distanceBetweenY = y2 - y1;\r\n let seatQuantityH = Math.trunc(distanceBetweenX / 19);\r\n let seatQuantityV = Math.trunc(distanceBetweenY / 19);\r\n let seatHelper = seatQuantityH - 1;\r\n for (let y = 0; y < seatQuantityV; y++) {\r\n for (let x = 0; x < seatHelper; x++) {\r\n x1 += 19;\r\n const seat = this.createSeat(x1, y1);\r\n this.addSeatToGroup(seat);\r\n }\r\n y1 += 19;\r\n x1 = xHelper - 19;\r\n seatHelper = seatQuantityH;\r\n }\r\n this.finish();\r\n }\r\n\r\n private finish() {\r\n this.handler.group?.setCoords();\r\n this.handler.canvas.renderAll();\r\n }\r\n}\r\nexport default MultipleRows;\r\n","import { fabric } from \"fabric\";\r\nimport { v4 } from \"uuid\";\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricObject, IObjectDesingner, FabricEvent } from \"../../utils\";\r\nimport { ShapeProperties } from \"./properties\";\r\nimport {iconStage} from \"../../../mapeditor/icons/Icons\"\r\n\r\nclass Polygon extends ShapeProperties implements IObjectDesingner {\r\n constructor(handler: Handler) {\r\n super(handler);\r\n }\r\n\r\n public onInit() {\r\n this.handler.interactionHandler.drawing(\"polygon\");\r\n this.handler.pointArray = [];\r\n this.handler.lineArray = [];\r\n this.handler.activeLine = null;\r\n this.handler.activeShapePolygon = null;\r\n }\r\n\r\n onMouseDblClick(event: FabricEvent) {\r\n return;\r\n }\r\n\r\n public onMousedown(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n const { target } = event;\r\n if (\r\n target &&\r\n this.handler.pointArray.length &&\r\n target.id === this.handler.pointArray[0].id\r\n ) {\r\n this.generate(this.handler.pointArray);\r\n } else {\r\n this.addPoint(x, y);\r\n }\r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n if (this.handler.activeLine && this.handler.activeLine.class === \"line\") {\r\n this.handler.activeLine.set({ x2: x, y2: y });\r\n const points = this.handler.activeShapePolygon.get(\"points\");\r\n points[this.handler.pointArray.length] = { x, y };\r\n this.handler.activeShapePolygon.set({ points });\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n }\r\n\r\n public onMouseup(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n return;\r\n }\r\n\r\n private addPoint(x: number, y: number) {\r\n const circle = new fabric.Circle({\r\n radius: 3,\r\n fill: \"#cccccc\",\r\n stroke: \"#727272\",\r\n strokeWidth: 0.5,\r\n left: x,\r\n top: y,\r\n selectable: false,\r\n hasBorders: false,\r\n hasControls: false,\r\n originX: \"center\",\r\n originY: \"center\",\r\n hoverCursor: \"pointer\",\r\n }) as FabricObject;\r\n circle.set({ id: v4() });\r\n if (!this.handler.pointArray.length) circle.set({ fill: \"red\" });\r\n const points = [x, y, x, y];\r\n const line = new fabric.Line(points, {\r\n strokeWidth: 4,\r\n fill: \"#cccccc\",\r\n stroke: \"#727272\",\r\n originX: \"center\",\r\n originY: \"center\",\r\n selectable: false,\r\n hasBorders: false,\r\n hasControls: false,\r\n evented: false,\r\n }) as FabricObject;\r\n line.set({ class: \"line\" });\r\n if (this.handler.activeShapePolygon) {\r\n const activeShapePoints = this.handler.activeShapePolygon.get(\"points\");\r\n activeShapePoints.push({ x, y });\r\n const polygon = new fabric.Polygon(activeShapePoints, {\r\n stroke: \"#727272\",\r\n strokeWidth: 4,\r\n fill: \"#cccccc\",\r\n opacity: 0.1,\r\n selectable: false,\r\n hasBorders: false,\r\n hasControls: false,\r\n evented: false,\r\n });\r\n this.handler.canvas.remove(this.handler.activeShapePolygon);\r\n this.handler.canvas.add(polygon);\r\n this.handler.activeShapePolygon = polygon;\r\n this.handler.canvas.renderAll();\r\n } else {\r\n const polyPoint = [{ x, y }];\r\n const polygon = new fabric.Polygon(polyPoint, {\r\n stroke: \"#727272\",\r\n strokeWidth: 1,\r\n fill: \"#cccccc\",\r\n opacity: 0.1,\r\n selectable: false,\r\n hasBorders: false,\r\n hasControls: false,\r\n evented: false,\r\n });\r\n this.handler.activeShapePolygon = polygon;\r\n this.handler.canvas.add(polygon);\r\n }\r\n this.handler.activeLine = line;\r\n this.handler.pointArray.push(circle);\r\n this.handler.lineArray.push(line);\r\n this.handler.canvas.add(line);\r\n this.handler.canvas.add(circle);\r\n }\r\n\r\n private generate(pointArray: FabricObject[]) {\r\n const points = [] as any[];\r\n const id = v4();\r\n const { editable } = this.handler;\r\n\r\n pointArray.forEach((point) => {\r\n points.push({ x: point.left, y: point.top });\r\n this.handler.canvas.remove(point);\r\n });\r\n this.handler.lineArray.forEach((line) => {\r\n this.handler.canvas.remove(line);\r\n });\r\n\r\n this.handler.canvas\r\n .remove(this.handler.activeShapePolygon)\r\n .remove(this.handler.activeLine);\r\n this.handler.activeShapePolygon = new fabric.Polygon(points, {\r\n type: \"polygon\",\r\n stroke: \"#727272\",\r\n strokeWidth: 3,\r\n fill: \"#cccccc\",\r\n opacity: 1,\r\n objectCaching: !this.handler.editable,\r\n name: \"New polygon\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n perPixelTargetFind: true,\r\n }) as FabricObject;\r\n\r\n this.handler.activeShapePolygon.set({\r\n id,\r\n superType: \"drawing\",\r\n });\r\n\r\n this.handler.objText = new fabric.Text(\"Label\", {\r\n fontSize: 16,\r\n left: this.handler.originPointer.x,\r\n top: this.handler.originPointer.y,\r\n angle: 0,\r\n fill: \"#727272\",\r\n stroke: \"#727272\",\r\n strokeWidth: 0,\r\n fontFamily: \"Roboto\",\r\n opacity: 1,\r\n type: \"textbox\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n text: \"?\",\r\n visible: false,\r\n }) as FabricObject;\r\n\r\n this.handler.objText.set({\r\n id: id,\r\n superType: \"textbox\",\r\n container: this.handler.container.id,\r\n editable,\r\n displayedLabel: false,\r\n });\r\n\r\n let svgConverted, serializer, svgStr;\r\n\r\n let svgEl = iconStage;\r\n\r\n svgConverted = document.createRange().createContextualFragment(svgEl);\r\n serializer = new XMLSerializer();\r\n svgStr = serializer.serializeToString(svgConverted);\r\n\r\n let containerId = this.handler.container.id;\r\n let loadedObject = this.handler.objIcon;\r\n let x = this.handler.originPointer.x;\r\n let y = this.handler.originPointer.y;\r\n\r\n fabric.loadSVGFromString(svgStr, function(objects, options) {\r\n loadedObject = fabric.util.groupSVGElements(objects, options);\r\n\r\n loadedObject.set({\r\n id: id,\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n container: containerId,\r\n editable: editable,\r\n left: x,\r\n top: y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n opacity: 1,\r\n objectCaching: !editable,\r\n superType: \"svg\",\r\n type: \"svg\",\r\n name: \"New icon SVG\",\r\n svg: svgEl,\r\n loadType: \"svg\",\r\n visible: false,\r\n scaled: 1,\r\n originHeight: loadedObject.height,\r\n originWidth: loadedObject.width,\r\n rotated: 0\r\n });\r\n });\r\n\r\n this.handler.objIcon = loadedObject;\r\n\r\n let group = new fabric.Group(\r\n [this.handler.activeShapePolygon, this.handler.objText, this.handler.objIcon],\r\n {\r\n left: this.handler.activeShapePolygon.left,\r\n top: this.handler.activeShapePolygon.top,\r\n hasControls: editable,\r\n hasBorders: editable,\r\n type: \"group\",\r\n subTargetCheck: true,\r\n }\r\n ) as FabricObject;\r\n\r\n group.set({\r\n id: id,\r\n superType: \"polygon\",\r\n text: \"Label\",\r\n displayedLabel: false,\r\n typeIcon: \"\",\r\n visibleIcon: false,\r\n visibleText: false,\r\n hoverCursor: \"crosshair\",\r\n selectable: false\r\n });\r\n\r\n // eliminamos el objeto creado incialmente del canvas\r\n this.handler.canvas.remove(this.handler.activeShapePolygon);\r\n this.handler.objIcon = null;\r\n this.handler.canvas.add(group);\r\n\r\n //se establecen en 0 la posicion del label en X y Y\r\n group.item(2).left = 0;\r\n group.item(2).top = 0;\r\n\r\n const widthIcon = group.item(2).width ?? 0;\r\n const heightIcon = group.item(2).height ?? 0;\r\n group.item(2).set({\r\n left: group.item(2).left - (widthIcon / 2),\r\n top: group.item(2).top - (heightIcon / 2),\r\n fill: \"#727272\",\r\n });\r\n\r\n group.item(1).left = 1;\r\n group.item(1).top = 1;\r\n\r\n const widthText = group.item(1).width ?? 0;\r\n const heightText = group.item(1).height ?? 0;\r\n\r\n group.item(1).set({\r\n left: group.item(1).left - (widthText / 2),\r\n top: group.item(1).top - (heightText / 2),\r\n });\r\n\r\n this.handler.pointArray = [];\r\n this.handler.activeLine = null;\r\n this.handler.activeShapePolygon = null;\r\n this.handler.canvas.discardActiveObject();\r\n }\r\n\r\n private finish() {\r\n this.handler.pointArray.forEach((point) => {\r\n this.handler.canvas.remove(point);\r\n });\r\n this.handler.lineArray.forEach((line) => {\r\n this.handler.canvas.remove(line);\r\n });\r\n this.handler.canvas.remove(this.handler.activeLine);\r\n this.handler.canvas.remove(this.handler.activeShapePolygon);\r\n this.handler.pointArray = [];\r\n this.handler.lineArray = [];\r\n this.handler.activeLine = null;\r\n this.handler.activeShapePolygon = null;\r\n this.handler.canvas.renderAll();\r\n this.handler.interactionHandler.selection();\r\n }\r\n}\r\nexport default Polygon;\r\n","import { fabric } from \"fabric\";\r\nimport { v4 } from \"uuid\";\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricObject, IObjectDesingner, FabricEvent } from \"../../utils\";\r\nimport { ZoneProperties } from \"./properties\";\r\nimport store from \"../../../../redux/store\";\r\nimport {\r\n setZoneActive\r\n} from \"../../../../redux/designerPropertiesSlice\";\r\n\r\nclass PolygonZone extends ZoneProperties implements IObjectDesingner {\r\n constructor(handler: Handler) {\r\n super(handler);\r\n }\r\n onRotated(event: FabricEvent) {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n public onMouseDblClick(event: FabricEvent) {\r\n const {target} = event;\r\n const {\r\n properties: { zoneActive },\r\n } = store.getState();\r\n if(zoneActive) return;\r\n this.handler.activeZone = target;\r\n const objs = this.handler.canvas.getObjects().filter( (obj: any) => obj.id !== this.handler.activeZone.id);\r\n const mapRows = this.handler.canvas.getObjects(\"group\").filter( (obj: any) => obj.superType === \"row\" );\r\n if(mapRows.length > 0){\r\n mapRows.forEach( (mapRow: any) => {\r\n const rowSeats = mapRow.getObjects(\"group\");\r\n rowSeats.forEach((seat: any) => {\r\n seat.set({\r\n selectable: false\r\n })\r\n });\r\n })\r\n }\r\n objs.map( obj => obj.set( {selectable: false, opacity: 0.5} ));\r\n const shape = target.item(0);\r\n const text = target.item(1);\r\n target.set({\r\n lockMovementX: true,\r\n lockMovementY: true,\r\n selectable: false\r\n });\r\n shape.set({\r\n originalFill: shape.fill,\r\n fill: \"#FFFFFF\",\r\n\r\n });\r\n text.set({\r\n visible: false\r\n });\r\n const rows = target.getObjects(\"group\");\r\n if(rows){\r\n rows.forEach((row: any) => {\r\n row.set({\r\n visible: true\r\n })\r\n this.handler.canvas.add(row);\r\n this.handler.canvas.requestRenderAll();\r\n target.removeWithUpdate(row);\r\n });\r\n }\r\n this.handler.onZone(false);\r\n this.handler.canvas.requestRenderAll();\r\n store.dispatch(setZoneActive(true));\r\n this.handler.canvas.discardActiveObject();\r\n }\r\n\r\n public onInit() {\r\n this.handler.interactionHandler.drawing(\"polygonZone\");\r\n this.handler.pointArray = [];\r\n this.handler.lineArray = [];\r\n this.handler.activeLine = null;\r\n this.handler.activeShape = null;\r\n this.handler.activeShapePolygon = null;\r\n }\r\n\r\n public onMousedown(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n const { target } = event;\r\n if (\r\n target &&\r\n this.handler.pointArray.length &&\r\n target.id === this.handler.pointArray[0].id\r\n ) {\r\n this.generate(this.handler.pointArray);\r\n } else {\r\n this.addPoint(x, y);\r\n }\r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n if (this.handler.activeLine && this.handler.activeLine.class === \"line\") {\r\n this.handler.activeLine.set({ x2: x, y2: y });\r\n const points = this.handler.activeShape.get(\"points\");\r\n points[this.handler.pointArray.length] = { x, y };\r\n this.handler.activeShape.set({ points });\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n }\r\n\r\n public onMouseup(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n return;\r\n }\r\n\r\n private addPoint(x: number, y: number) {\r\n const circle = new fabric.Circle({\r\n radius: 3,\r\n fill: \"#cccccc\",\r\n stroke: \"#727272\",\r\n strokeWidth: 0.5,\r\n left: x,\r\n top: y,\r\n selectable: false,\r\n hasBorders: false,\r\n hasControls: false,\r\n originX: \"center\",\r\n originY: \"center\",\r\n hoverCursor: \"pointer\",\r\n }) as FabricObject;\r\n circle.set({ id: v4() });\r\n if (!this.handler.pointArray.length) circle.set({ fill: \"red\" });\r\n const points = [x, y, x, y];\r\n const line = new fabric.Line(points, {\r\n strokeWidth: 4,\r\n fill: \"#cccccc\",\r\n stroke: \"#727272\",\r\n originX: \"center\",\r\n originY: \"center\",\r\n selectable: false,\r\n hasBorders: false,\r\n hasControls: false,\r\n evented: false,\r\n }) as FabricObject;\r\n line.set({ class: \"line\" });\r\n if (this.handler.activeShape) {\r\n const activeShapePoints = this.handler.activeShape.get(\r\n \"points\"\r\n ) as Array<{ x: number; y: number }>;\r\n activeShapePoints.push({ x, y });\r\n const polygonZone = new fabric.Polygon(activeShapePoints, {\r\n stroke: \"#727272\",\r\n strokeWidth: 4,\r\n fill: \"#cccccc\",\r\n opacity: 0.1,\r\n selectable: false,\r\n hasBorders: false,\r\n hasControls: false,\r\n evented: false,\r\n });\r\n this.handler.canvas.remove(this.handler.activeShape);\r\n this.handler.canvas.add(polygonZone);\r\n this.handler.activeShape = polygonZone;\r\n this.handler.activeShapePolygon = polygonZone;\r\n this.handler.canvas.renderAll();\r\n } else {\r\n const polyPoint = [{ x, y }];\r\n const polygonZone = new fabric.Polygon(polyPoint, {\r\n stroke: \"#727272\",\r\n strokeWidth: 4,\r\n fill: \"#cccccc\",\r\n opacity: 0.1,\r\n selectable: false,\r\n hasBorders: false,\r\n hasControls: false,\r\n evented: false,\r\n });\r\n this.handler.activeShape = polygonZone;\r\n this.handler.activeShapePolygon = polygonZone;\r\n this.handler.canvas.add(polygonZone);\r\n }\r\n this.handler.activeLine = line;\r\n this.handler.pointArray.push(circle);\r\n this.handler.lineArray.push(line);\r\n this.handler.canvas.add(line);\r\n this.handler.canvas.add(circle);\r\n }\r\n\r\n private generate(pointArray: FabricObject[]) {\r\n const points = [] as any[];\r\n const id = v4();\r\n const { editable } = this.handler;\r\n pointArray.forEach((point) => {\r\n points.push({ x: point.left, y: point.top });\r\n this.handler.canvas.remove(point);\r\n });\r\n this.handler.lineArray.forEach((line) => {\r\n this.handler.canvas.remove(line);\r\n });\r\n this.handler.canvas\r\n .remove(this.handler.activeShape)\r\n .remove(this.handler.activeLine);\r\n this.handler.activeShape = new fabric.Polygon(points, {\r\n type: \"polygon\",\r\n stroke: \"#727272\",\r\n strokeWidth: 3,\r\n fill: \"#cccccc\",\r\n opacity: 1,\r\n objectCaching: !this.handler.editable,\r\n name: \"New polygon\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: false,\r\n lockMovementY: false,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n perPixelTargetFind: true,\r\n }) as FabricObject;\r\n\r\n this.handler.activeShape.set({\r\n id,\r\n superType: \"drawing\",\r\n });\r\n\r\n this.handler.objText = new fabric.Text(\"Label\", {\r\n fontSize: 16,\r\n left: this.handler.originPointer.x,\r\n top: this.handler.originPointer.y,\r\n angle: 0,\r\n fill: \"#727272\",\r\n stroke: \"#727272\",\r\n strokeWidth: 0,\r\n fontFamily: \"Roboto\",\r\n opacity: 1,\r\n type: \"textbox\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n text: \"?\",\r\n }) as FabricObject;\r\n\r\n this.handler.objText.set({\r\n id: id,\r\n superType: \"textbox\",\r\n container: this.handler.container.id,\r\n editable,\r\n displayedLabel: false,\r\n zoneID: this.handler.activeShape.id\r\n });\r\n\r\n let group = new fabric.Group(\r\n [this.handler.activeShape, this.handler.objText],\r\n {\r\n left: this.handler.activeShape.left,\r\n top: this.handler.activeShape.top,\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n type: \"group\",\r\n subTargetCheck: true,\r\n }\r\n ) as FabricObject;\r\n group.set({\r\n id: id,\r\n superType: \"polygonZone\",\r\n tooltip: {\r\n enabled: true,\r\n },\r\n category: {\r\n key: 0,\r\n },\r\n section: {\r\n label: \"\",\r\n displayedLabel: \"\",\r\n },\r\n });\r\n // eliminamos el objeto creado incialmente del canvas\r\n this.handler.canvas.add(group);\r\n\r\n //se establecen en 0 la posicion del label en X y Y\r\n\r\n group.item(1).left = 0;\r\n group.item(1).top = 0;\r\n group.setControlsVisibility({\r\n tl: false, //top-left\r\n mt: false, // middle-top\r\n tr: false, //top-right\r\n ml: false, //middle-left\r\n mr: false, //middle-right\r\n bl: false, // bottom-left\r\n mb: false, //middle-bottom\r\n br: false, //bottom-right\r\n mtr: false,\r\n });\r\n group.set({\r\n perPixelTargetFind: true\r\n })\r\n // se le resta la mitad de la anchura y altura del texto por defecto para centrar el texto con el objeto\r\n const widthText = group.item(1).width ?? 0;\r\n const heightText = group.item(1).height ?? 0;\r\n group.item(1).set({\r\n left: -(widthText / 2),\r\n top: -(heightText / 2),\r\n // fontsize: (group.item(1).width / 4)\r\n });\r\n if (!this.handler.transactionHandler.active){\r\n this.handler.transactionHandler.save(\"add\");\r\n }\r\n this.handler.onAdd(group);\r\n\r\n // let zoneGroup = new fabric.Group(\r\n // [group],\r\n // {\r\n // type: \"group\",\r\n // }\r\n // ) as FabricObject;\r\n // zoneGroup.set(\"superType\", \"zoneGroup\")\r\n // zoneGroup.setControlsVisibility({\r\n // tl: false, //top-left\r\n // mt: false, // middle-top\r\n // tr: false, //top-right\r\n // ml: false, //middle-left\r\n // mr: false, //middle-right\r\n // bl: false, // bottom-left\r\n // mb: false, //middle-bottom\r\n // br: false, //bottom-right\r\n // mtr: false,\r\n // });\r\n\r\n // this.handler.canvas.add(zoneGroup);\r\n\r\n this.handler.pointArray = [];\r\n this.handler.activeLine = null;\r\n this.handler.activeShape = null;\r\n // this.handler.interactionHandler.selection();\r\n }\r\n\r\n private finish() {\r\n this.handler.pointArray.forEach((point) => {\r\n this.handler.canvas.remove(point);\r\n });\r\n this.handler.lineArray.forEach((line) => {\r\n this.handler.canvas.remove(line);\r\n });\r\n this.handler.canvas.remove(this.handler.activeLine);\r\n this.handler.canvas.remove(this.handler.activeShape);\r\n this.handler.pointArray = [];\r\n this.handler.lineArray = [];\r\n this.handler.activeLine = null;\r\n this.handler.activeShape = null;\r\n this.handler.canvas.renderAll();\r\n this.handler.interactionHandler.selection();\r\n }\r\n}\r\nexport default PolygonZone;\r\n","import { fabric } from \"fabric\";\r\nimport { v4 } from \"uuid\";\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricObject, IObjectDesingner, FabricEvent } from \"../../utils\";\r\nimport { ShapeProperties } from \"./properties\";\r\nimport {iconStage} from \"../../../mapeditor/icons/Icons\"\r\n\r\nclass Rect extends ShapeProperties implements IObjectDesingner {\r\n constructor(handler: Handler) {\r\n super(handler);\r\n }\r\n\r\n public onInit() {\r\n this.handler.interactionHandler.drawing(\"rect\", \"crosshair\");\r\n this.handler.activeShape = null;\r\n }\r\n\r\n onMouseDblClick(event: FabricEvent) {\r\n return;\r\n }\r\n\r\n public onMousedown(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n this.addPoint(x, y);\r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n if (!this.handler.isDown) return;\r\n this.updating(x, y);\r\n this.handler.canvas.renderAll();\r\n }\r\n\r\n public onMouseup(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n this.generate(false, false, x, y);\r\n this.finish();\r\n }\r\n\r\n private addPoint(x: number, y: number) {\r\n this.handler.isDown = true;\r\n const editable = this.handler.editable;\r\n const id = v4();\r\n\r\n //creamos los objetos de tipo forma con su texto\r\n this.handler.activeShape = new fabric.Rect({\r\n name: \"New rectangle\",\r\n left: x,\r\n top: y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n width: 0,\r\n height: 0,\r\n angle: 0,\r\n fill: \"#cccccc\",\r\n stroke: \"#727272\",\r\n strokeWidth: 4,\r\n strokeUniform: true,\r\n transparentCorners: false,\r\n rx: 4,\r\n ry: 4,\r\n opacity: 1,\r\n objectCaching: !editable,\r\n type: \"rect\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n }) as FabricObject;\r\n\r\n this.handler.activeShape.set({\r\n id: id,\r\n superType: \"rect\",\r\n container: this.handler.container.id,\r\n editable: editable,\r\n text: \"Label\",\r\n displayedLabel: false,\r\n category: \"\",\r\n capacity: 100,\r\n typeCapacity: \"generalAdmission\",\r\n typeIcon: \"\",\r\n });\r\n\r\n this.handler.objText = new fabric.Text(\"Label\", {\r\n fontSize: 16,\r\n left: x,\r\n top: y,\r\n angle: 0,\r\n fill: \"#727272\",\r\n stroke: \"#727272\",\r\n strokeWidth: 0,\r\n fontFamily: \"Roboto\",\r\n opacity: 1,\r\n strokeUniform: true,\r\n centeredRotation: true,\r\n centeredScaling: true,\r\n type: \"textbox\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n text: \"?\",\r\n visible: false\r\n }) as FabricObject;\r\n\r\n this.handler.objText.set({\r\n id: id,\r\n superType: \"textbox\",\r\n container: this.handler.container.id,\r\n displayedLabel: false,\r\n editable,\r\n centerTransform: true,\r\n });\r\n\r\n let svgConverted, serializer, svgStr;\r\n\r\n let svgEl = iconStage;\r\n\r\n svgConverted = document.createRange().createContextualFragment(svgEl);\r\n serializer = new XMLSerializer();\r\n svgStr = serializer.serializeToString(svgConverted);\r\n\r\n let containerId = this.handler.container.id;\r\n let loadedObject = this.handler.objIcon;\r\n fabric.loadSVGFromString(svgStr, function(objects, options) {\r\n // Group elements to fabric.PathGroup (more than 1 elements) or\r\n // to fabric.Path\r\n loadedObject = fabric.util.groupSVGElements(objects, options);\r\n loadedObject.set({\r\n id: id,\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n container: containerId,\r\n editable: editable,\r\n left: x,\r\n top: y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n opacity: 1,\r\n objectCaching: !editable,\r\n superType: \"svg\",\r\n type: \"svg\",\r\n name: \"New icon SVG\",\r\n svg: svgEl,\r\n loadType: \"svg\",\r\n visible: false,\r\n scaled: 1,\r\n originHeight: loadedObject.height,\r\n originWidth: loadedObject.width,\r\n rotated: 0\r\n });\r\n });\r\n\r\n this.handler.activeShape.guides = {};\r\n this.handler.canvas.add(this.handler.activeShape);\r\n this.handler.objIcon = loadedObject;\r\n }\r\n\r\n private updating(x: number, y: number) {\r\n if (this.handler.originPointer.x > x)\r\n this.handler.activeShape.set({ left: x });\r\n if (this.handler.originPointer.y > y)\r\n this.handler.activeShape.set({ top: y });\r\n this.handler.activeShape.set({\r\n width: Math.abs(this.handler.originPointer.x - x),\r\n });\r\n this.handler.activeShape.set({\r\n height: Math.abs(this.handler.originPointer.y - y),\r\n });\r\n }\r\n\r\n private generate(isDown: any, loaded: any, x: number, y: number) {\r\n const { editable, gridOption, onAdd } = this.handler;\r\n\r\n let group = new fabric.Group(\r\n [this.handler.activeShape, this.handler.objText, this.handler.objIcon ],\r\n {\r\n hasControls: editable,\r\n hasBorders: editable,\r\n type: \"group\",\r\n subTargetCheck: true,\r\n fill: \"rgba(0,0,0,0)\",\r\n }\r\n ) as FabricObject;\r\n\r\n group.set({\r\n id: this.handler.activeShape.id,\r\n left: this.handler.originPointer.x < x ? this.handler.originPointer.x : x,\r\n top: this.handler.originPointer.y < y ? this.handler.originPointer.y : y,\r\n stroke: \"0\",\r\n superType: \"rect\",\r\n centerTransform: true,\r\n strokeColor: \"rgba(0,0,0,0)\",\r\n fillText: \"rgba(0,0,0,0)\",\r\n strokeText: 0,\r\n strokeColorText: \"rgba(0,0,0,0)\",\r\n fillIcon: \"rgba(0,0,0,0)\",\r\n visibleIcon: false,\r\n visibleText: false,\r\n hoverCursor: \"crosshair\",\r\n selectable: false\r\n });\r\n\r\n // eliminamos el objeto creado incialmente del canvas\r\n this.handler.canvas.remove(this.handler.activeShape);\r\n this.handler.objIcon = null;\r\n //añadimos al canvas el nuevo objeto agrupado\r\n this.handler.canvas.add(group);\r\n //se establecen en 0 la posicion del label en X y Y\r\n group.item(2).left = 0;\r\n group.item(2).top = 0;\r\n\r\n const widthIcon = group.item(2).width ?? 0;\r\n const heightIcon = group.item(2).height ?? 0;\r\n group.item(2).set({\r\n left: group.item(2).left - (widthIcon / 2),\r\n top: group.item(2).top - (heightIcon / 2),\r\n fill: \"#727272\",\r\n });\r\n\r\n group.item(1).left = 1;\r\n group.item(1).top = 1;\r\n\r\n const widthText = group.item(1).width ?? 0;\r\n const heightText = group.item(1).height ?? 0;\r\n\r\n group.item(1).set({\r\n left: group.item(1).left - (widthText / 2),\r\n top: group.item(1).top - (heightText / 2),\r\n });\r\n\r\n this.handler.objects = this.handler.getObjects();\r\n if (!editable && !(group.superType === \"element\"))\r\n group.on(\"mousedown\", this.handler.eventHandler.object.mousedown);\r\n if (group.superType === \"node\") group.setShadow(group.stroke);\r\n if (group.dblclick)\r\n group.on(\"mousedblclick\", this.handler.eventHandler.object.mousedblclick);\r\n if (group.superType === \"node\") this.handler.portHandler.create(group);\r\n if (gridOption?.enabled ?? false) this.handler.gridHandler.setCoords(group);\r\n if (!this.handler.transactionHandler.active && !loaded)\r\n this.handler.transactionHandler.save(\"add\");\r\n if (onAdd && editable && !loaded) onAdd(group);\r\n\r\n this.handler.isDown = isDown;\r\n this.handler.activeShape = null;\r\n this.handler.objText = null;\r\n }\r\n\r\n private finish() {\r\n //this.handler.canvas.remove(this.handler.activeShape);\r\n this.handler.canvas.discardActiveObject();\r\n this.handler.activeShape = null;\r\n this.handler.canvas.renderAll();\r\n //this.handler.interactionHandler.selection();\r\n }\r\n}\r\nexport default Rect;\r\n","import { fabric } from \"fabric\";\r\nimport { v4 } from \"uuid\";\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricObject, IObjectDesingner, FabricEvent } from \"../../utils\";\r\nimport { ZoneProperties } from \"./properties\";\r\n\r\nclass RectangleZone extends ZoneProperties implements IObjectDesingner {\r\n constructor(handler: Handler) {\r\n super(handler);\r\n }\r\n\r\n public onInit() {\r\n this.handler.interactionHandler.drawing(\"rectangleZone\", \"crosshair\");\r\n this.handler.activeShape = null;\r\n }\r\n\r\n public onMouseDblClick(event: FabricEvent) {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n public onMousedown(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n this.addPoint(x, y);\r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n if (!this.handler.isDown) return;\r\n this.updating(x, y);\r\n this.handler.canvas.renderAll();\r\n }\r\n\r\n public onMouseup(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n this.generate(false, false);\r\n this.finish();\r\n }\r\n\r\n private addPoint(x: number, y: number) {\r\n this.handler.isDown = true;\r\n const editable = this.handler.editable;\r\n const id = v4();\r\n this.handler.activeShape = new fabric.Rect({\r\n name: \"New rectangle\",\r\n left: x,\r\n top: y,\r\n visible: true,\r\n originX: \"left\",\r\n originY: \"top\",\r\n width: 0,\r\n height: 0,\r\n angle: 0,\r\n fill: \"#cccccc\",\r\n stroke: \"#727272\",\r\n strokeWidth: 4,\r\n strokeUniform: true,\r\n transparentCorners: false,\r\n rx: 4,\r\n ry: 4,\r\n opacity: 1,\r\n objectCaching: !this.handler.editable,\r\n type: \"rect\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n }) as FabricObject;\r\n\r\n this.handler.activeShape.set({\r\n id: id,\r\n superType: \"rectangleZone\",\r\n container: this.handler.container.id,\r\n editable: editable,\r\n category: \"\",\r\n capacity: 100,\r\n typeCapacity: \"generalAdmission\",\r\n text: \"Label\",\r\n displayedLabel: false,\r\n });\r\n\r\n this.handler.objText = new fabric.Text(\"Label\", {\r\n fontSize: 16,\r\n left: x,\r\n top: y,\r\n angle: 0,\r\n fill: \"#727272\",\r\n stroke: \"#727272\",\r\n strokeWidth: 0,\r\n strokeUniform: true,\r\n fontFamily: \"Roboto\",\r\n opacity: 1,\r\n type: \"textbox\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n text: \"Label\",\r\n }) as FabricObject;\r\n\r\n this.handler.objText.set({\r\n id: id,\r\n superType: \"textbox\",\r\n container: this.handler.container.id,\r\n editable,\r\n displayedLabel: false,\r\n });\r\n\r\n this.handler.activeShape.guides = {};\r\n this.handler.canvas.add(this.handler.activeShape);\r\n }\r\n\r\n private updating(x: number, y: number) {\r\n if (this.handler.originPointer.x > x)\r\n this.handler.activeShape.set({ left: Math.abs(x) });\r\n if (this.handler.originPointer.y > y)\r\n this.handler.activeShape.set({ top: Math.abs(y) });\r\n this.handler.activeShape.set({\r\n width: Math.abs(this.handler.originPointer.x - x),\r\n });\r\n this.handler.activeShape.set({\r\n height: Math.abs(this.handler.originPointer.y - y),\r\n });\r\n }\r\n\r\n private generate(isDown: any, loaded: any) {\r\n const { editable, gridOption, onAdd } = this.handler;\r\n const id = v4();\r\n\r\n let group = new fabric.Group(\r\n [this.handler.activeShape, this.handler.objText],\r\n {\r\n left: this.handler.originPointer.x,\r\n top: this.handler.originPointer.y,\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n type: \"group\",\r\n subTargetCheck: true,\r\n centeredRotation: true,\r\n centeredScaling: true,\r\n }\r\n ) as FabricObject;\r\n\r\n group.set({\r\n id: id,\r\n superType: \"rectangleZone\",\r\n tooltip: {\r\n enabled: true,\r\n },\r\n });\r\n\r\n // eliminamos el objeto creado incialmente del canvas\r\n this.handler.canvas.remove(this.handler.activeShape);\r\n //añadimos al canvas el nuevo objeto agrupado\r\n this.handler.canvas.add(group);\r\n\r\n //se establecen en 0 la posicion del label en X y Y\r\n group.item(1).left = 0;\r\n group.item(1).top = 0;\r\n\r\n // se le resta la mitad de la anchura y altura del texto por defecto para centrar el texto con el objeto\r\n const widthText = group.item(1).width ?? 0;\r\n const heightText = group.item(1).height ?? 0;\r\n group.item(1).set({\r\n left: -(widthText / 2),\r\n top: -(heightText / 2),\r\n });\r\n\r\n this.handler.objects = this.handler.getObjects();\r\n\r\n if (!editable && !(group.superType === \"element\"))\r\n group.on(\"mousedown\", this.handler.eventHandler.object.mousedown);\r\n if (group.dblclick)\r\n group.on(\"mousedblclick\", this.handler.eventHandler.object.mousedblclick);\r\n if (group.superType === \"node\") this.handler.portHandler.create(group);\r\n if (group.superType === \"node\") group.setShadow(group.stroke);\r\n if (gridOption?.enabled ?? false) this.handler.gridHandler.setCoords(group);\r\n if (!this.handler.transactionHandler.active && !loaded)\r\n this.handler.transactionHandler.save(\"add\");\r\n if (onAdd && editable && !loaded) onAdd(group);\r\n\r\n this.handler.isDown = isDown;\r\n this.handler.activeShape = null;\r\n }\r\n\r\n private finish() {\r\n //this.handler.canvas.remove(this.handler.activeShape);\r\n this.handler.activeShape = null;\r\n this.handler.canvas.renderAll();\r\n //this.handler.interactionHandler.selection();\r\n }\r\n}\r\nexport default RectangleZone;\r\n","import { fabric } from \"fabric\";\r\nimport { v4 } from \"uuid\";\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricObject, IObjectDesingner, FabricEvent } from \"../../utils\";\r\n\r\nclass RectTable implements IObjectDesingner {\r\n private handler: Handler;\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n public onInit() {\r\n this.handler.interactionHandler.drawing(\"rectTable\", \"crosshair\");\r\n this.handler.activeShape = null;\r\n }\r\n\r\n onMouseDblClick(event: FabricEvent) {\r\n return;\r\n }\r\n\r\n public onMousedown(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n this.generateRectTable(x, y);\r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n return;\r\n }\r\n\r\n public onMouseup(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n return;\r\n }\r\n\r\n public updateProperties(\r\n propertyName: string,\r\n newValue: any,\r\n allValuesForm: any,\r\n selectedItem: any\r\n ) {}\r\n\r\n private createSeat(x: number, y: number) {\r\n this.handler.isDown = true;\r\n const editable = this.handler.editable;\r\n const id = v4();\r\n\r\n let shape = new fabric.Circle({\r\n name: \"New Rect Table Seat\",\r\n left: x,\r\n top: y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n radius: 7.5,\r\n angle: 0,\r\n fill: \"#cccccc\",\r\n strokeWidth: 1,\r\n stroke: \"#727272\",\r\n transparentCorners: false,\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n }) as FabricObject;\r\n\r\n shape.set({\r\n id: id,\r\n label: \"Label\",\r\n displayedLabel: \"\",\r\n container: this.handler.container.id,\r\n editable: editable,\r\n objectOption: this.handler.objectOption,\r\n });\r\n return shape;\r\n }\r\n\r\n private createTable(x: number, y: number) {\r\n this.handler.isDown = true;\r\n const editable = this.handler.editable;\r\n const id = v4();\r\n let shape = new fabric.Rect({\r\n name: \"New Rect Table\",\r\n left: x,\r\n top: y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n width: 75,\r\n height: 50,\r\n angle: 0,\r\n fill: \"#cccccc\",\r\n stroke: \"#727272\",\r\n strokeWidth: 1,\r\n strokeUniform: true,\r\n transparentCorners: false,\r\n rx: 1,\r\n ry: 1,\r\n opacity: 1,\r\n objectCaching: !this.handler.editable,\r\n type: \"rect\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n }) as FabricObject;\r\n\r\n shape.set({\r\n id: id,\r\n label: \"Label\",\r\n displayedLabel: \"\",\r\n container: this.handler.container.id,\r\n editable: editable,\r\n objectOption: this.handler.objectOption,\r\n });\r\n return shape;\r\n }\r\n\r\n private createGroup() {\r\n const { editable } = this.handler;\r\n const id = v4();\r\n this.handler.group = new fabric.Group(undefined, {\r\n left: this.handler.originPointer.x,\r\n top: this.handler.originPointer.y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n type: \"group\",\r\n subTargetCheck: true,\r\n }) as FabricObject;\r\n\r\n this.handler.group.set({\r\n id: id,\r\n superType: \"groupRectTable\",\r\n centerTransform: true,\r\n seatsQuantity: null,\r\n maxSeatsQuantity: null,\r\n rowSize: null,\r\n seatsSpacing: 0,\r\n distanceBetweenX: 0,\r\n distanceBetweenY: 0,\r\n });\r\n this.handler.canvas.add(this.handler.group);\r\n }\r\n\r\n private addObjectToGroup(obj: FabricObject) {\r\n this.handler.activeShape = obj;\r\n this.handler.group?.addWithUpdate(obj);\r\n this.handler.canvas.renderAll();\r\n }\r\n\r\n private generateRectTable(x: number, y: number) {\r\n this.createGroup();\r\n let table = this.createTable(x, y);\r\n this.addObjectToGroup(table);\r\n let seatQuantityLeft = 7;\r\n let seatQuantityRight = 3;\r\n let seatQuantityTop = 4;\r\n let seatQuantityBottom = 2;\r\n let width = 75;\r\n let height = 50;\r\n let seatDistanceLeft = height / seatQuantityLeft;\r\n let seatDistanceRight = height / seatQuantityRight;\r\n let seatDistanceTop = width / seatQuantityTop;\r\n let seatDistanceBottom = width / seatQuantityBottom;\r\n for (let i = 0; i < seatQuantityTop; i++) {\r\n let xHelper = x + seatDistanceTop * i;\r\n let yHelper = y - 20;\r\n let seat = this.createSeat(xHelper, yHelper);\r\n this.addObjectToGroup(seat);\r\n }\r\n for (let i = 0; i < seatQuantityLeft; i++) {\r\n let xHelper = x + 5 + width;\r\n let yHelper = y + i * seatDistanceLeft;\r\n let seat = this.createSeat(xHelper, yHelper);\r\n this.addObjectToGroup(seat);\r\n }\r\n for (let i = 0; i < seatQuantityBottom; i++) {\r\n let xHelper = x + i * seatDistanceBottom;\r\n let yHelper = y + 5 + height;\r\n let seat = this.createSeat(xHelper, yHelper);\r\n this.addObjectToGroup(seat);\r\n }\r\n for (let i = 0; i < seatQuantityRight; i++) {\r\n let xHelper = x - 5 - 15;\r\n let yHelper = y + i * seatDistanceRight;\r\n let seat = this.createSeat(xHelper, yHelper);\r\n this.addObjectToGroup(seat);\r\n }\r\n this.finish();\r\n }\r\n\r\n private finish() {\r\n this.handler.group?.setCoords();\r\n this.handler.canvas.renderAll();\r\n }\r\n}\r\n\r\nexport default RectTable;\r\n","import { fabric } from \"fabric\";\r\nimport { v4 } from \"uuid\";\r\nimport store from \"../../../../redux/store\";\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricObject, FabricEvent, IObjectDesingner, FabricGroup } from \"../../utils\";\r\nimport { RowProperties } from \"./properties\";\r\nimport { iconCheck } from \"../../../mapeditor/icons/Icons\";\r\n\r\nclass Row extends RowProperties implements IObjectDesingner {\r\n private defaultSeatColor: string;\r\n private rowSeatSpacing: number;\r\n private rowSeatSize: number;\r\n\r\n constructor(handler: Handler) {\r\n super(handler);\r\n this.rowSeatSpacing = 0;\r\n }\r\n\r\n public onInit() {\r\n this.handler.interactionHandler.drawing(\"row\", \"crosshair\");\r\n this.handler.activeShape = null;\r\n this.defaultSeatColor = \"#000000\";\r\n }\r\n\r\n onMouseDblClick(event: FabricEvent) {\r\n return;\r\n }\r\n\r\n public onMousedown(event: FabricEvent) {\r\n const {\r\n properties: { rowSeatSpacing, rowSeatSize },\r\n } = store.getState();\r\n this.rowSeatSpacing = rowSeatSpacing;\r\n this.rowSeatSize = rowSeatSize;\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n this.createPreviewGroup();\r\n const seat = this.createSeat(x, y, true);\r\n this.addSeatToPreviewGroup(seat);\r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n if (!this.handler.isDown) return;\r\n this.updatePreviewRow(x, y);\r\n }\r\n\r\n public onMouseup(event: FabricEvent) {\r\n const canvasHeight = this.handler.canvas.getHeight();\r\n const canvasWidth = this.handler.canvas.getWidth();\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n if(event.pointer.x < 1 || event.pointer.y < 1 || event.pointer.x > canvasWidth || event.pointer.y > canvasHeight){\r\n this.handler.isDown = false;\r\n this.handler.canvas.remove(this.handler.previewGroup);\r\n this.handler.previewGroup = {} as FabricGroup;\r\n return;\r\n }\r\n this.generateSeatLinear(x, y);\r\n }\r\n\r\n private createPreviewGroup() {\r\n const { editable } = this.handler;\r\n const id = v4();\r\n this.handler.previewGroup = new fabric.Group(undefined, {\r\n left: this.handler.originPointer.x,\r\n top: this.handler.originPointer.y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n type: \"group\",\r\n }) as FabricObject;\r\n\r\n this.handler.previewGroup.set({\r\n id: id,\r\n superType: \"row\",\r\n centerTransform: true,\r\n seatsQuantity: null,\r\n maxSeatsQuantity: null,\r\n rowSize: null,\r\n seatsSpacing: 0,\r\n distanceBetweenX: 0,\r\n distanceBetweenY: 0,\r\n });\r\n\r\n this.handler.canvas.add(this.handler.previewGroup);\r\n }\r\n\r\n private createSeatCounter(x: number, y: number, seatCount: string) {\r\n const editable = this.handler.editable;\r\n const text = new fabric.Text(`Asientos: ${seatCount}`, {\r\n fontSize: 13,\r\n left: x,\r\n top: y,\r\n fill: \"#000000\",\r\n stroke: \"#000000\",\r\n strokeWidth: 0,\r\n fontFamily: \"Roboto\",\r\n originX: \"center\",\r\n originY: \"center\",\r\n type: \"textbox\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n strokeUniform: true,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n visible: true,\r\n }) as FabricObject;\r\n return text;\r\n }\r\n\r\n private createSeat(x: number, y: number, isPreview: boolean) {\r\n this.handler.isDown = true;\r\n const editable = this.handler.editable;\r\n const id = v4();\r\n\r\n let shape = new fabric.Circle({\r\n name: \"Seat\",\r\n left: x,\r\n top: y,\r\n originX: \"center\",\r\n originY: \"center\",\r\n radius: this.rowSeatSize / 2,\r\n angle: 0,\r\n fill: `${this.defaultSeatColor}40`,\r\n strokeWidth: 1,\r\n stroke: this.defaultSeatColor,\r\n transparentCorners: false,\r\n hasBorders: editable,\r\n selectable: true,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n }) as FabricObject;\r\n\r\n shape.set({\r\n id: id,\r\n label: \"Label\",\r\n displayedLabel: \"\",\r\n container: this.handler.container.id,\r\n editable: editable,\r\n objectOption: this.handler.objectOption,\r\n opacity: isPreview ? 0.4 : 1\r\n });\r\n\r\n return shape;\r\n }\r\n\r\n private createText(x: number, y: number) {\r\n const editable = this.handler.editable;\r\n const text = new fabric.Text(\"\", {\r\n fontSize: this.rowSeatSize - 5,\r\n left: x,\r\n top: y,\r\n fill: \"#000000\",\r\n stroke: \"#000000\",\r\n strokeWidth: 0,\r\n fontFamily: \"Roboto\",\r\n originX: \"center\",\r\n originY: \"center\",\r\n type: \"text\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n strokeUniform: true,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n visible: true,\r\n }) as FabricObject;\r\n return text;\r\n }\r\n\r\n private createIcon(x: number, y: number, rowSeatSize: number) {\r\n const editable = this.handler.editable;\r\n let defaultIcon = iconCheck;\r\n let svg: any;\r\n fabric.loadSVGFromString(defaultIcon, function(objects, options) {\r\n svg = fabric.util.groupSVGElements(objects, options);\r\n svg.set({\r\n fill: \"#ffffff\",\r\n left: x,\r\n top: y,\r\n originX: \"center\",\r\n originY: \"center\",\r\n objectCaching: !editable,\r\n type: \"svg\",\r\n name: \"New icon SVG\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n strokeUniform: true,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n loadType: \"svg\",\r\n svg: defaultIcon,\r\n visible: false,\r\n });\r\n svg.scaleToWidth(rowSeatSize - 3);\r\n svg.scaleToHeight(rowSeatSize - 3);\r\n });\r\n return svg;\r\n }\r\n\r\n private createRowGroup() {\r\n const { editable } = this.handler;\r\n const id = v4();\r\n this.handler.rowGroup = new fabric.Group(undefined, {\r\n left: this.handler.originPointer.x,\r\n top: this.handler.originPointer.y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n hasControls: false,\r\n hasBorders: editable,\r\n selectable: editable,\r\n type: \"group\",\r\n subTargetCheck: true,\r\n perPixelTargetFind: true,\r\n }) as FabricObject;\r\n\r\n this.handler.rowGroup.set({\r\n id: id,\r\n superType: \"row\",\r\n centerTransform: true,\r\n seatsQuantity: null,\r\n maxSeatsQuantity: null,\r\n rowSize: null,\r\n seatsSpacing: 0,\r\n distanceBetweenX: 0,\r\n distanceBetweenY: 0,\r\n category: {\r\n key: 0,\r\n name: \"\",\r\n },\r\n seat: {\r\n key: 0,\r\n list: [] as Array,\r\n reverse: false,\r\n startsAt: 1,\r\n },\r\n section: {\r\n label: \"\",\r\n displayedLabel: \"\",\r\n },\r\n row: {\r\n enabled: false,\r\n label: \"\",\r\n displayedLabel: \"\",\r\n position: {\r\n left: false,\r\n right: false,\r\n },\r\n },\r\n });\r\n this.handler.canvas.add(this.handler.rowGroup);\r\n }\r\n\r\n private createSeatGroup(x: number, y: number) {\r\n const { editable } = this.handler;\r\n const id = v4();\r\n const seatGroup = new fabric.Group(undefined, {\r\n left: x,\r\n top: y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n hasBorders: editable,\r\n selectable: editable,\r\n type: \"group\",\r\n subTargetCheck: true,\r\n }) as FabricObject;\r\n\r\n seatGroup.set({\r\n id: id,\r\n superType: \"seat\",\r\n seatsQuantity: null,\r\n maxSeatsQuantity: null,\r\n rowSize: null,\r\n seatsSpacing: 0,\r\n seatsCurve: 0,\r\n distanceBetweenX: 0,\r\n distanceBetweenY: 0,\r\n category: {\r\n key: 0,\r\n },\r\n label: \"\",\r\n displayedLabel: \"\",\r\n restrictedView: false,\r\n companion: false,\r\n accesible: false,\r\n value: \"\",\r\n });\r\n\r\n seatGroup.setControlsVisibility({\r\n tl: false, //top-left\r\n mt: false, // middle-top\r\n tr: false, //top-right\r\n ml: false, //middle-left\r\n mr: false, //middle-right\r\n bl: false, // bottom-left\r\n mb: false, //middle-bottom\r\n br: false, //bottom-right\r\n mtr: false,\r\n });\r\n\r\n return seatGroup;\r\n }\r\n\r\n private addSeatToRowGroup(obj: FabricObject) {\r\n this.handler.activeShape = obj;\r\n this.handler.rowGroup?.addWithUpdate(obj);\r\n this.handler.canvas.renderAll();\r\n }\r\n\r\n private addSeatToPreviewGroup(obj: FabricObject) {\r\n this.handler.activeShape = obj;\r\n this.handler.previewGroup?.addWithUpdate(obj);\r\n this.handler.canvas.renderAll();\r\n }\r\n\r\n private updatePreviewRow(x: number, y: number) {\r\n const groupObjects = this.handler.previewGroup?.getObjects();\r\n groupObjects.forEach((element: any, index: number) => {\r\n if (index != 0) this.handler.previewGroup.remove(element);\r\n });\r\n this.handler.previewGroup.remove();\r\n let stepX, stepY;\r\n let origin = {...this.handler.originPointer};\r\n let x1 = origin.x;\r\n let y1 = origin.y;\r\n let x2 = x;\r\n let y2 = y;\r\n let distanceBetweenX = x2 - x1;\r\n let distanceBetweenY = y2 - y1;\r\n let longDistance;\r\n\r\n if (x1 !== x2 && y1 === y2) {\r\n longDistance = Math.abs(distanceBetweenX);\r\n } else if (x1 === x2 && y1 !== y2) {\r\n longDistance = Math.abs(distanceBetweenY);\r\n } else {\r\n longDistance = Math.hypot(distanceBetweenX, distanceBetweenY);\r\n }\r\n\r\n let seatQuantity = Math.trunc(\r\n longDistance / (this.rowSeatSize + this.rowSeatSpacing * 2)\r\n );\r\n stepX = distanceBetweenX / seatQuantity;\r\n stepY = distanceBetweenY / seatQuantity;\r\n for (let index = 1; index < seatQuantity; index++) {\r\n x1 += stepX;\r\n y1 += stepY;\r\n this.handler.activeShape = null;\r\n const seat = this.createSeat(x1, y1, true);\r\n this.addSeatToPreviewGroup(seat);\r\n }\r\n const { top, left, width } = this.handler.previewGroup;\r\n let textCount;\r\n seatQuantity = seatQuantity == 0 ? 1 : seatQuantity;\r\n if(y1 < y2){\r\n textCount = this.createSeatCounter(\r\n this.handler.originPointer.x,\r\n this.handler.originPointer.y - 20,\r\n seatQuantity + \"\"\r\n );\r\n }\r\n else{\r\n textCount = this.createSeatCounter(\r\n this.handler.originPointer.x,\r\n this.handler.originPointer.y + 20,\r\n seatQuantity + \"\"\r\n );\r\n }\r\n this.addSeatToPreviewGroup(textCount);\r\n }\r\n\r\n private updateRow(x: number, y: number) {\r\n let stepX, stepY;\r\n let x1 = this.handler.originPointer.x;\r\n let y1 = this.handler.originPointer.y;\r\n let x2 = x;\r\n let y2 = y;\r\n let distanceBetweenX = x2 - x1;\r\n let distanceBetweenY = y2 - y1;\r\n let longDistance;\r\n let type = (x1 < x2 && y1 > y2) || (x2 < x1 && y2 > y1);\r\n\r\n if (x1 !== x2 && y1 === y2) {\r\n longDistance = distanceBetweenX;\r\n } else if (x1 === x2 && y1 !== y2) {\r\n longDistance = distanceBetweenY;\r\n } else {\r\n longDistance = Math.hypot(distanceBetweenX, distanceBetweenY);\r\n }\r\n\r\n let seatQuantity = Math.trunc(\r\n longDistance / (this.rowSeatSize + this.rowSeatSpacing * 2)\r\n );\r\n stepX = distanceBetweenX / seatQuantity;\r\n stepY = distanceBetweenY / seatQuantity;\r\n for (let index = 0; index < seatQuantity; index++) {\r\n this.handler.activeShape = null;\r\n let seatGroup = this.createSeatGroup(x1, y1);\r\n const seat = this.createSeat(x1, y1, false);\r\n const text = this.createText(x1, y1);\r\n const icon = this.createIcon(x1, y1, this.rowSeatSize);\r\n seatGroup.addWithUpdate(seat);\r\n seatGroup.addWithUpdate(text);\r\n seatGroup.addWithUpdate(icon);\r\n this.addSeatToRowGroup(seatGroup);\r\n this.handler.canvas.renderAll();\r\n console.log('seatGroup', seatGroup)\r\n x1 += stepX;\r\n y1 += stepY;\r\n }\r\n this.finish(distanceBetweenX, distanceBetweenY, longDistance, type);\r\n }\r\n\r\n private generateSeatLinear(x: number, y: number) {\r\n this.createRowGroup();\r\n this.updateRow(x, y);\r\n }\r\n\r\n private finish(\r\n distanceBetweenX: number,\r\n distanceBetweenY: number,\r\n longDistance: number,\r\n type: boolean\r\n ) {\r\n const {\r\n properties: { zoneActive },\r\n } = store.getState();\r\n this.handler.canvas.remove(this.handler.previewGroup);\r\n this.handler.isDown = false;\r\n this.handler.activeShape = null;\r\n const seatsQuantity = Math.trunc(\r\n longDistance / (this.rowSeatSize + this.rowSeatSpacing * 2)\r\n );\r\n if (seatsQuantity > 0) {\r\n const maxSeatsQuantity = Math.trunc(longDistance / this.rowSeatSize);\r\n const rowSize = longDistance;\r\n const tan = distanceBetweenY / distanceBetweenX;\r\n const angle = (Math.atan(tan) * 180) / Math.PI;\r\n this.handler.rowGroup?.set(\"seatsQuantity\", seatsQuantity);\r\n this.handler.rowGroup?.set(\"maxSeatsQuantity\", maxSeatsQuantity);\r\n this.handler.rowGroup?.set(\"rowSize\", rowSize);\r\n this.handler.rowGroup?.set(\"seatsSpacing\", this.rowSeatSpacing);\r\n this.handler.rowGroup?.set(\"seatsCurve\", 0);\r\n this.handler.rowGroup?.set(\"distanceBetweenX\", distanceBetweenX);\r\n this.handler.rowGroup?.set(\"distanceBetweenY\", distanceBetweenY);\r\n\r\n this.handler.rowGroup?.set(\"angleHelp\", angle);\r\n // this.handler.group?.set('angle', angle);\r\n this.handler.rowGroup?.set(\"angleType\", type);\r\n this.handler.rowGroup?.setCoords();\r\n this.handler.rowGroup?.addWithUpdate();\r\n this.handler.rowGroup?.set(\"hasControls\", true);\r\n this.handler.rowGroup?.set(\"hoverCursor\", \"crosshair\");\r\n // this.handler.rowGroup?.set(\"selectable\", false);\r\n this.handler.rowGroup?.setControlsVisibility({\r\n tl: false, //top-left\r\n mt: false, // middle-top\r\n tr: false, //top-right\r\n ml: false, //middle-left\r\n mr: false, //middle-right\r\n bl: false, // bottom-left\r\n mb: false, //middle-bottom\r\n br: false, //bottom-right\r\n mtr: true,\r\n });\r\n if(this.handler.activeZone){\r\n this.handler.rowGroup?.set(\"zoneID\", this.handler.activeZone.item(0).id)\r\n this.handler.rowGroup?.set({\r\n section:{\r\n label: this.handler.activeZone.section.label,\r\n displayedLabel: this.handler.activeZone.section.displayedLabel\r\n }\r\n })\r\n }\r\n // this.handler.canvas.renderAll();\r\n if (!this.handler.transactionHandler.active){\r\n this.handler.transactionHandler.save(\"add\");\r\n }\r\n this.handler.onAdd(this.handler.rowGroup);\r\n this.handler.canvas.discardActiveObject();\r\n this.handler.rowGroup = {} as FabricGroup;\r\n this.handler.previewGroup = {} as FabricGroup;\r\n }\r\n }\r\n}\r\nexport default Row;\r\n","import { fabric } from \"fabric\";\r\nimport { v4 } from \"uuid\";\r\n\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricObject, IObjectDesingner, FabricEvent } from \"../../utils\";\r\n\r\nclass Text implements IObjectDesingner {\r\n private handler: Handler;\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n public onInit() {\r\n this.handler.interactionHandler.drawing(\"text\", \"text\");\r\n this.handler.activeShape = null;\r\n }\r\n\r\n onMouseDblClick(event: FabricEvent) {\r\n return;\r\n }\r\n\r\n public onMousedown(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n this.addPoint(x, y);\r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n return;\r\n }\r\n\r\n public onMouseup(event: FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n this.generate(false, false);\r\n this.finish();\r\n }\r\n\r\n public updateProperties(\r\n propertyName: string,\r\n newValue: any,\r\n allValuesForm: any,\r\n selectedItem: any\r\n ) {\r\n switch (propertyName) {\r\n case \"checkFontWeight\":\r\n selectedItem.set(\"fontWeight\", newValue ? \"bold\" : \"normal\");\r\n selectedItem.set(\"checkFontWeight\", newValue);\r\n break;\r\n case \"checkFontStyle\":\r\n selectedItem.set(\"fontStyle\", newValue ? \"italic\" : \"normal\");\r\n selectedItem.set(\"checkFontStyle\", newValue);\r\n break;\r\n case \"checkLeft\":\r\n selectedItem.set(\"textAlign\", newValue ? \"left\" : \"\");\r\n if(newValue){\r\n selectedItem.set({\r\n checkCenter: false,\r\n checkRight: false,\r\n checkJustify: false\r\n })\r\n }\r\n break;\r\n case \"checkCenter\":\r\n selectedItem.set(\"textAlign\", newValue ? \"center\" : \"\");\r\n if(newValue){\r\n selectedItem.set({\r\n checkLeft: false,\r\n checkRight: false,\r\n checkJustify: false\r\n })\r\n }\r\n break;\r\n case \"checkRight\":\r\n selectedItem.set(\"textAlign\", newValue ? \"right\" : \"\");\r\n if(newValue){\r\n selectedItem.set({\r\n checkLeft: false,\r\n checkCenter: false,\r\n checkJustify: false\r\n })\r\n }\r\n break;\r\n case \"checkJustify\":\r\n selectedItem.set(\"textAlign\", newValue ? \"justify\" : \"\");\r\n if(newValue){\r\n selectedItem.set({\r\n checkLeft: false,\r\n checkCenter: false,\r\n checkRight: false\r\n })\r\n }\r\n break;\r\n default:\r\n selectedItem.set(propertyName, newValue);\r\n break;\r\n }\r\n selectedItem.setCoords();\r\n this.handler.canvas.renderAll();\r\n }\r\n\r\n private addPoint(x: number, y: number) {\r\n this.handler.isDown = true;\r\n const editable = this.handler.editable;\r\n const id = v4();\r\n this.handler.objText = new fabric.Text(\"Texto\", {\r\n fontSize: 16,\r\n fontStyle: \"normal\",\r\n left: x,\r\n top: y,\r\n angle: 0,\r\n fill: \"#000000\",\r\n stroke: \"#727272\",\r\n strokeWidth: 0,\r\n fontFamily: \"Roboto\",\r\n opacity: 1,\r\n strokeUniform: true,\r\n type: \"text\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n text: \"Texto\",\r\n fontWeight: \"bold\",\r\n }) as FabricObject;\r\n this.handler.objText.set({\r\n id: id,\r\n superType: \"text\",\r\n container: this.handler.container.id,\r\n centerTransform: true,\r\n checkFontStyle: false,\r\n checkFontWeight: true,\r\n checkCenter: false,\r\n checkRight: false,\r\n checkLeft: true,\r\n checkJustify: false\r\n });\r\n\r\n this.handler.canvas.add(this.handler.objText);\r\n this.handler.activeShape = this.handler.objText;\r\n }\r\n\r\n private generate(isDown: any, loaded: any) {\r\n const { editable, gridOption, onAdd } = this.handler;\r\n const obj = this.handler.activeShape;\r\n if (!editable && !(obj.superType === \"element\"))\r\n obj.on(\"mousedown\", this.handler.eventHandler.object.mousedown);\r\n if (obj === \"node\") obj.setShadow({ color: obj.stroke });\r\n if (obj.dblclick)\r\n obj.on(\"mousedblclick\", this.handler.eventHandler.object.mousedblclick);\r\n if (obj.superType === \"node\") this.handler.portHandler.create(obj);\r\n if (gridOption?.enabled ?? false) this.handler.gridHandler.setCoords(obj);\r\n if (!this.handler.transactionHandler.active && !loaded)\r\n this.handler.transactionHandler.save(\"add\");\r\n if (onAdd && editable && !loaded) onAdd(obj);\r\n\r\n this.handler.isDown = isDown;\r\n this.handler.objText = obj;\r\n }\r\n\r\n private finish() {\r\n //this.handler.canvas.remove(this.handler.activeShape);\r\n this.handler.isDown = false;\r\n this.handler.objText = null;\r\n this.handler.activeShape = null;\r\n this.handler.canvas.renderAll();\r\n this.handler.interactionHandler.selection();\r\n }\r\n}\r\n\r\nexport default Text;\r\n","import { fabric } from \"fabric\";\r\nimport { v4 } from \"uuid\";\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricObject, IObjectDesingner, FabricEvent } from \"../../utils\";\r\nimport { ShapeProperties } from \"./properties\";\r\nimport {iconStage} from \"../../../mapeditor/icons/Icons\"\r\n\r\nclass Triangle extends ShapeProperties implements IObjectDesingner {\r\n constructor(handler: Handler) {\r\n super(handler);\r\n }\r\n\r\n public onInit() {\r\n this.handler.interactionHandler.drawing(\"triangle\", \"crosshair\");\r\n this.handler.activeShape = null;\r\n }\r\n\r\n onMouseDblClick(event: FabricEvent) {\r\n return;\r\n }\r\n\r\n public onMousedown(event : FabricEvent) {\r\n const {x , y} = this.handler.canvas.getPointer(event.e);\r\n this.addPoint(x, y);\r\n }\r\n\r\n public onMousemove(event : FabricEvent) {\r\n const {x , y} = this.handler.canvas.getPointer(event.e);\r\n if (!this.handler.isDown) return;\r\n this.updating(x, y);\r\n this.handler.canvas.renderAll();\r\n }\r\n\r\n public onMouseup(event : FabricEvent) {\r\n const { x, y } = this.handler.canvas.getPointer(event.e);\r\n this.generate(false, false, x, y);\r\n this.finish();\r\n }\r\n\r\n private addPoint(x: number, y: number) {\r\n this.handler.isDown = true;\r\n const editable = this.handler.editable;\r\n const id = v4();\r\n this.handler.activeShape = new fabric.Triangle({\r\n name: \"New triangle\",\r\n left: x,\r\n top: y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n width: 0,\r\n height: 0,\r\n angle: 0,\r\n fill: \"#cccccc\",\r\n strokeWidth: 4,\r\n stroke: \"#727272\",\r\n strokeUniform: true,\r\n transparentCorners: false,\r\n opacity: 1,\r\n objectCaching: !editable,\r\n type: \"triangle\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n }) as FabricObject;\r\n\r\n this.handler.activeShape.set({\r\n id: id,\r\n rx: 4,\r\n ry: 4,\r\n superType: \"triangle\",\r\n container: this.handler.container.id,\r\n editable: editable,\r\n text: \"Label\",\r\n displayedLabel: false,\r\n typeIcon: \"\",\r\n });\r\n\r\n this.handler.objText = new fabric.Text(\"Label\", {\r\n fontSize: 16,\r\n left: x,\r\n top: y,\r\n angle: 0,\r\n fill: \"#727272\",\r\n stroke: \"#727272\",\r\n strokeWidth: 0,\r\n fontFamily: \"Roboto\",\r\n strokeUniform: true,\r\n opacity: 1,\r\n type: \"textbox\",\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n text: \"?\",\r\n visible: false\r\n }) as FabricObject;\r\n\r\n this.handler.objText.set({\r\n id: id,\r\n superType: \"textbox\",\r\n container: this.handler.container.id,\r\n editable,\r\n displayedLabel: false,\r\n });\r\n\r\n let svgConverted, serializer, svgStr;\r\n\r\n let svgEl = iconStage;\r\n\r\n svgConverted = document.createRange().createContextualFragment(svgEl);\r\n serializer = new XMLSerializer();\r\n svgStr = serializer.serializeToString(svgConverted);\r\n\r\n let containerId = this.handler.container.id;\r\n let loadedObject = this.handler.objIcon;\r\n fabric.loadSVGFromString(svgStr, function(objects, options) {\r\n // Group elements to fabric.PathGroup (more than 1 elements) or\r\n // to fabric.Path\r\n loadedObject = fabric.util.groupSVGElements(objects, options);\r\n\r\n loadedObject.set({\r\n id: id,\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? \"pointer\" : \"move\",\r\n container: containerId,\r\n editable: editable,\r\n fill: \"#727272\",\r\n left: x,\r\n top: y,\r\n originX: \"left\",\r\n originY: \"top\",\r\n opacity: 1,\r\n objectCaching: !editable,\r\n superType: \"svg\",\r\n type: \"svg\",\r\n name: \"New icon SVG\",\r\n svg: svgEl,\r\n loadType: \"svg\",\r\n visible: false,\r\n scaled: 1,\r\n originHeight: loadedObject.height,\r\n originWidth: loadedObject.width,\r\n rotated: 0\r\n });\r\n });\r\n\r\n this.handler.activeShape.guides = {};\r\n this.handler.canvas.add(this.handler.activeShape);\r\n this.handler.objIcon = loadedObject;\r\n }\r\n\r\n private updating(x: number, y: number) {\r\n if (this.handler.originPointer.x > x)\r\n this.handler.activeShape.set({ left: x });\r\n if (this.handler.originPointer.y > y)\r\n this.handler.activeShape.set({ top: y });\r\n this.handler.activeShape.set({\r\n width: Math.abs(this.handler.originPointer.x - x),\r\n });\r\n this.handler.activeShape.set({\r\n height: Math.abs(this.handler.originPointer.y - y),\r\n });\r\n }\r\n\r\n private generate(isDown: any, loaded: any, x: number, y: number) {\r\n const { editable, gridOption, onAdd } = this.handler;\r\n const id = v4();\r\n\r\n let group = new fabric.Group(\r\n [this.handler.activeShape, this.handler.objText, this.handler.objIcon],\r\n {\r\n left: this.handler.originPointer.x < x ? this.handler.originPointer.x : x,\r\n top: this.handler.originPointer.y < y ? this.handler.originPointer.y : y,\r\n hasControls: editable,\r\n hasBorders: editable,\r\n type: \"group\",\r\n subTargetCheck: true,\r\n }\r\n ) as FabricObject;\r\n group.set({\r\n id: id,\r\n superType: \"triangle\",\r\n visibleIcon: false,\r\n visibleText: false,\r\n hoverCursor: \"crosshair\",\r\n selectable: false\r\n });\r\n //this.handler.objShape = obj;\r\n // eliminamos el objeto creado incialmente del canvas\r\n this.handler.canvas.remove(this.handler.activeShape);\r\n //añadimos al canvas el nuevo objeto agrupado\r\n this.handler.canvas.add(group);\r\n\r\n group.item(2).left = 0;\r\n group.item(2).top = 0;\r\n\r\n const widthIcon = group.item(2).width ?? 0;\r\n const heightIcon = group.item(2).height ?? 0;\r\n group.item(2).set({\r\n left: group.item(2).left - (widthIcon / 2),\r\n top: group.item(2).top - (heightIcon / 2),\r\n fill: \"#727272\",\r\n });\r\n\r\n group.item(1).left = 1;\r\n group.item(1).top = 1;\r\n\r\n const widthText = group.item(1).width ?? 0;\r\n const heightText = group.item(1).height ?? 0;\r\n\r\n group.item(1).set({\r\n left: group.item(1).left - (widthText / 2),\r\n top: group.item(1).top - (heightText / 2),\r\n });\r\n\r\n this.handler.objects = this.handler.getObjects();\r\n\r\n if (!editable && !(group.superType === \"element\"))\r\n group.on(\"mousedown\", this.handler.eventHandler.object.mousedown);\r\n if (group.dblclick)\r\n group.on(\"mousedblclick\", this.handler.eventHandler.object.mousedblclick);\r\n if (group.superType === \"node\") this.handler.portHandler.create(group);\r\n if (group.superType === \"node\") group.setShadow(group.stroke);\r\n if (gridOption?.enabled ?? false) this.handler.gridHandler.setCoords(group);\r\n if (!this.handler.transactionHandler.active && !loaded)\r\n this.handler.transactionHandler.save(\"add\");\r\n if (onAdd && editable && !loaded) onAdd(group);\r\n\r\n this.handler.isDown = isDown;\r\n }\r\n\r\n private finish() {\r\n //this.handler.canvas.remove(this.handler.activeShape);\r\n this.handler.canvas.discardActiveObject();\r\n this.handler.activeShape = null;\r\n this.handler.canvas.renderAll();\r\n //this.handler.interactionHandler.selection();\r\n }\r\n}\r\nexport default Triangle;\r\n","import { fabric } from \"fabric\";\r\nimport { v4 } from \"uuid\";\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricObject, IObjectDesingner, FabricEvent } from \"../../utils\";\r\nimport { ActiveSelectionProperties } from \"./properties\";\r\n\r\nclass ActiveSelection extends ActiveSelectionProperties implements IObjectDesingner {\r\n constructor(handler: Handler) {\r\n super(handler);\r\n }\r\n\r\n public onInit() {\r\n this.handler.interactionHandler.drawing(\"activeSelection\", \"crosshair\");\r\n this.handler.activeShape = null;\r\n }\r\n\r\n public onMouseDblClick(event: FabricEvent) {\r\n }\r\n\r\n public onMousedown(event: FabricEvent) {\r\n \r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n }\r\n\r\n public onMouseup(event: FabricEvent) {\r\n }\r\n\r\n public onRotated(event: FabricEvent) {\r\n const { target } = event;\r\n this.handler.canvas.discardActiveObject();\r\n const rows = target.getObjects().filter( (obj: any) => obj.superType === \"row\" );\r\n rows.forEach((row: any) => {\r\n row.set({\r\n angleHelp: target.newAngle+row.angleHelp\r\n });\r\n let seats: any = row.getObjects(\"group\");\r\n seats.forEach((seat: any) => {\r\n let text = seat.item(1);\r\n text.set({\r\n angle: text.angle-target.newAngle\r\n })\r\n });\r\n row.addWithUpdate();\r\n row.setCoords();\r\n });\r\n const activeSelection = new fabric.ActiveSelection(target.getObjects(), {\r\n canvas: this.handler.canvas\r\n });\r\n this.handler.canvas.setActiveObject(activeSelection);\r\n this.handler.canvas.renderAll();\r\n this.handler.drawingHandler.setType('activeSelection');\r\n }\r\n}\r\nexport default ActiveSelection;\r\n","import Handler from \"./Handler\";\r\nimport {\r\n Row,\r\n MultipleRows,\r\n CircularTable,\r\n RectTable,\r\n Ellipse,\r\n Rect,\r\n Triangle,\r\n Polygon,\r\n CircleZone,\r\n RectangleZone,\r\n PolygonZone,\r\n Text,\r\n Icon,\r\n ActiveSelection\r\n} from \"../objects/designer\";\r\nimport { IObjectDesingner , FabricEvent, FabricGroup} from \"../utils\";\r\n\r\nclass DrawingHandler {\r\n private objectTypes: any;\r\n private object: IObjectDesingner;\r\n public selectedType: string;\r\n\r\n constructor(handler: Handler) {\r\n this.object = null;\r\n this.objectTypes = {\r\n row: new Row(handler),\r\n multipleRows: new MultipleRows(handler),\r\n circularTable: new CircularTable(handler),\r\n rectTable: new RectTable(handler),\r\n ellipse: new Ellipse(handler),\r\n rect: new Rect(handler),\r\n triangle: new Triangle(handler),\r\n polygon: new Polygon(handler),\r\n circleZone: new CircleZone(handler),\r\n rectangleZone: new RectangleZone(handler),\r\n polygonZone: new PolygonZone(handler),\r\n text: new Text(handler),\r\n svg: new Icon(handler),\r\n activeSelection: new ActiveSelection(handler),\r\n };\r\n }\r\n\r\n public setType(type: string) {\r\n this.selectedType = type;\r\n this.object = this.objectTypes[type];\r\n console.log('this.object', this.object)\r\n }\r\n\r\n public onInit() {\r\n this.object.onInit();\r\n }\r\n\r\n public onMousedown(event : FabricEvent) {\r\n this.object.onMousedown(event);\r\n }\r\n\r\n public onMousemove(event : FabricEvent) {\r\n this.object.onMousemove(event);\r\n }\r\n\r\n public onMouseup(event : FabricEvent) {\r\n this.object.onMouseup(event);\r\n }\r\n\r\n public onMouseDblClick(event: FabricEvent){\r\n this.object.onMouseDblClick(event);\r\n }\r\n\r\n public onRotated(event: FabricEvent){\r\n const { target } = event;\r\n if(target.type === \"activeSelection\"){\r\n this.setType(target.type);\r\n this.object.onRotated(event);\r\n }\r\n if(target.superType === \"text\"){\r\n return;\r\n }\r\n if(target.superType === \"row\"){\r\n target.set({\r\n angleHelp: target.newAngle+target.angleHelp\r\n });\r\n let seats: any = target.getObjects(\"group\");\r\n console.log('seats', seats)\r\n seats.forEach((seat: any) => {\r\n let text = seat.item(1);\r\n text.set({\r\n angle: text.angle-target.newAngle\r\n })\r\n });\r\n target.addWithUpdate();\r\n target.setCoords();\r\n }\r\n }\r\n\r\n public updateProperties(\r\n propertyName: string,\r\n newValue: any,\r\n allValuesForm: any,\r\n selectedItem: any\r\n ) {\r\n this.object.updateProperties(\r\n propertyName,\r\n newValue,\r\n allValuesForm,\r\n selectedItem\r\n );\r\n }\r\n}\r\n\r\nexport default DrawingHandler;\r\n","import Handler from './Handler';\r\nimport { KeyEvent } from '../utils';\r\nimport { code } from '../constants';\r\n\r\n/**\r\n * Shortcut Handler Class\r\n *\r\n * @author salgum1114\r\n * @class ShortcutHandler\r\n */\r\nclass ShortcutHandler {\r\n\thandler: Handler;\r\n\tkeyEvent: KeyEvent;\r\n\tconstructor(handler: Handler) {\r\n\t\tthis.handler = handler;\r\n\t\tthis.keyEvent = handler.keyEvent;\r\n\t}\r\n\r\n\t/**\r\n\t * Whether keydown Escape\r\n\t *\r\n\t * @param {KeyboardEvent} e\r\n\t * @returns\r\n\t */\r\n\tpublic isEscape = (e: KeyboardEvent) => {\r\n\t\treturn e.code === code.ESCAPE && this.keyEvent.esc;\r\n\t};\r\n\r\n\t/**\r\n\t * Whether keydown Q\r\n\t *\r\n\t * @param {KeyboardEvent} e\r\n\t * @returns\r\n\t */\r\n\tpublic isQ = (e: KeyboardEvent) => {\r\n\t\treturn e.code === code.KEY_Q;\r\n\t};\r\n\r\n\t/**\r\n\t * Whether keydown W\r\n\t *\r\n\t * @param {KeyboardEvent} e\r\n\t * @returns\r\n\t */\r\n\tpublic isW = (e: KeyboardEvent) => {\r\n\t\treturn e.code === code.KEY_W;\r\n\t};\r\n\r\n\t/**\r\n\t * Whether keydown Delete or Backpsace\r\n\t *\r\n\t * @param {KeyboardEvent} e\r\n\t * @returns\r\n\t */\r\n\tpublic isDelete = (e: KeyboardEvent) => {\r\n\t\treturn (e.code === code.BACKSPACE || e.code === code.DELETE) && this.keyEvent.del;\r\n\t};\r\n\r\n\t/**\r\n\t * Whether keydown Arrow\r\n\t *\r\n\t * @param {KeyboardEvent} e\r\n\t * @returns\r\n\t */\r\n\tpublic isArrow = (e: KeyboardEvent) => {\r\n\t\treturn e.code.includes('Arrow') && this.keyEvent.move;\r\n\t};\r\n\r\n\t/**\r\n\t * Whether keydown Ctrl + A\r\n\t *\r\n\t * @param {KeyboardEvent} e\r\n\t * @returns\r\n\t */\r\n\tpublic isCtrlA = (e: KeyboardEvent) => {\r\n\t\treturn (e.ctrlKey || e.metaKey) && e.code === code.KEY_A && this.keyEvent.all;\r\n\t};\r\n\r\n\t/**\r\n\t * Whether keydown Ctrl + C\r\n\t *\r\n\t * @param {KeyboardEvent} e\r\n\t * @returns\r\n\t */\r\n\tpublic isCtrlC = (e: KeyboardEvent) => {\r\n\t\treturn (e.ctrlKey || e.metaKey) && e.code === code.KEY_C && this.keyEvent.copy;\r\n\t};\r\n\r\n\t/**\r\n\t * Whether keydown Ctrl + V\r\n\t *\r\n\t * @param {KeyboardEvent} e\r\n\t * @returns\r\n\t */\r\n\tpublic isCtrlV = (e: KeyboardEvent) => {\r\n\t\treturn (e.ctrlKey || e.metaKey) && e.code === code.KEY_V && this.keyEvent.paste;\r\n\t};\r\n\r\n\t/**\r\n\t * Whether keydown Ctrl + Z\r\n\t *\r\n\t * @param {KeyboardEvent} e\r\n\t * @returns\r\n\t */\r\n\tpublic isCtrlZ = (e: KeyboardEvent) => {\r\n\t\treturn (e.ctrlKey || e.metaKey) && e.code === code.KEY_Z && this.keyEvent.transaction;\r\n\t};\r\n\r\n\t/**\r\n\t * Whether keydown Ctrl + Y\r\n\t *\r\n\t * @param {KeyboardEvent} e\r\n\t * @returns\r\n\t */\r\n\tpublic isCtrlY = (e: KeyboardEvent) => {\r\n\t\treturn (e.ctrlKey || e.metaKey) && e.code === code.KEY_Y && this.keyEvent.transaction;\r\n\t};\r\n\r\n\t/**\r\n\t * Whether keydown Plus Or Equal\r\n\t *\r\n\t * @param {KeyboardEvent} e\r\n\t * @returns\r\n\t */\r\n\tpublic isPlus = (e: KeyboardEvent) => {\r\n\t\treturn e.code === code.EQUAL && this.keyEvent.zoom;\r\n\t};\r\n\r\n\t/**\r\n\t * Whether keydown Minus\r\n\t *\r\n\t * @param {KeyboardEvent} e\r\n\t * @returns\r\n\t */\r\n\tpublic isMinus = (e: KeyboardEvent) => {\r\n\t\treturn e.code === code.MINUS && this.keyEvent.zoom;\r\n\t};\r\n\r\n\t/**\r\n\t * Whether keydown O\r\n\t *\r\n\t * @param {KeyboardEvent} e\r\n\t * @returns\r\n\t */\r\n\tpublic isO = (e: KeyboardEvent) => {\r\n\t\treturn e.code === code.KEY_O && this.keyEvent.zoom;\r\n\t};\r\n\r\n\t/**\r\n\t * Whether keydown P\r\n\t *\r\n\t * @param {KeyboardEvent} e\r\n\t * @returns\r\n\t */\r\n\tpublic isP = (e: KeyboardEvent) => {\r\n\t\treturn e.code === code.KEY_P && this.keyEvent.zoom;\r\n\t};\r\n\r\n\t/**\r\n\t * Whether keydown Ctrl + X\r\n\t *\r\n\t * @param {KeyboardEvent} e\r\n\t * @returns\r\n\t */\r\n\tpublic isCtrlX = (e: KeyboardEvent) => {\r\n\t\treturn (e.ctrlKey || e.metaKey) && e.code === code.KEY_X && this.keyEvent.cut;\r\n\t};\r\n}\r\n\r\nexport default ShortcutHandler;\r\n","import React from \"react\";\r\nimport i18n from \"i18next\";\r\n\r\nconst RestrictedViewIcon = ({ color }:any) => {\r\n return (\r\n
\r\n

\r\n \r\n {i18n.t(\"tooltipSeat.restrictedView\")}\r\n

\r\n
\r\n );\r\n};\r\n\r\nconst AccesibleIcon = ({ color }:any) => (\r\n
\r\n

\r\n \r\n {i18n.t(\"tooltipSeat.accessible\")}\r\n

\r\n
\r\n);\r\n\r\nconst CompanionIcon = ({color}:any) => (\r\n
\r\n

\r\n \r\n {i18n.t(\"tooltipSeat.companion\")}\r\n

\r\n
\r\n);\r\n\r\nexport const TooltipIcons = ({target}:any) => {\r\n return<>\r\n {target.restrictedView && }\r\n {target.accesible && }\r\n {target.companion && }\r\n \r\n}\r\n","import { Handler } from \"../../handlers\";\r\nimport { FabricObject, IObjectPreview } from \"../../utils\";\r\nimport { TooltipRowPreview } from \"../tooltip/Row\";\r\n\r\nclass Row implements IObjectPreview {\r\n private handler: Handler;\r\n private targetSeat: FabricObject;\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n public onHover(event: any): any {\r\n if (event.subTargets.some((a: any) => a.superType == \"seat\")) {\r\n const seat = event.subTargets.find((a: any) => a.superType == \"seat\");\r\n if (this.targetSeat != seat) {\r\n this.onBlur();\r\n const seatCircle = seat.item(0);\r\n const htmlElement = TooltipRowPreview(seat);\r\n this.handler.tooltipHandler.show(event.e, htmlElement);\r\n seatCircle.set({\r\n fill: `${seatCircle.stroke}90`,\r\n radius: seatCircle.radius + 0.5,\r\n });\r\n this.targetSeat = seat;\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n return this.onBlur;\r\n } else this.onBlur();\r\n }\r\n\r\n private onBlur = () => {\r\n if (this.targetSeat) {\r\n this.handler.tooltipHandler.hide();\r\n const seatCircle = this.targetSeat.item(0);\r\n seatCircle.set({\r\n fill: `${seatCircle.stroke}40`,\r\n radius: seatCircle.radius - 0.5,\r\n });\r\n this.handler.canvas.requestRenderAll();\r\n this.targetSeat = null;\r\n }\r\n };\r\n}\r\nexport default Row;\r\n","import React from \"react\";\r\nimport i18n from \"i18next\";\r\n\r\nimport store from \"../../../../redux/store\";\r\nimport { TooltipIcons } from \"./Icons\";\r\n\r\nexport const TooltipRowPreview = (target: any) => (\r\n \r\n {target.category && (\r\n \r\n

{target.category.name}

\r\n \r\n )}\r\n\r\n {target.restrictedView && (\r\n \r\n

\r\n \r\n {i18n.t(\"tooltipSeat.restrictedView\")}\r\n

\r\n \r\n )}\r\n {target.accesible && (\r\n \r\n

\r\n \r\n {i18n.t(\"tooltipSeat.accessible\")}\r\n

\r\n \r\n )}\r\n {target.companion && (\r\n \r\n

\r\n \r\n {i18n.t(\"tooltipSeat.companion\")}\r\n

\r\n \r\n )}\r\n\r\n
\r\n

\r\n \r\n {i18n.t(\"tooltipSeat.section\")}:{\" \"}\r\n {target.group.section.label || \"?\"}\r\n \r\n  \r\n

\r\n

\r\n \r\n {i18n.t(\"tooltipSeat.row\")}:{\" \"}\r\n {target.group.row.label || \"?\"}{\" \"}\r\n \r\n    \r\n \r\n {i18n.t(\"tooltipSeat.seat\")}: {target.label || \"?\"}\r\n \r\n

\r\n
\r\n \r\n);\r\n\r\nexport const TooltipRowSelector = (target: any, info: any, onSelect: any) => {\r\n const {\r\n properties: { selection },\r\n } = store.getState();\r\n const getInfoSpan = () => {\r\n if (target.available) {\r\n if (target.status == \"Free\") {\r\n const selectedZoneLength: {\r\n key: string;\r\n seats: Array;\r\n } = selection.filter((zone) => {\r\n return zone.key == target.category.key;\r\n })[0];\r\n if (\r\n selectedZoneLength.seats.length ==\r\n window.redseats.maximumsSeatsSelected\r\n )\r\n return (\r\n
\r\n {\" \"}\r\n {i18n.t(\"tooltipSeat.you-cant-choose-more-places\")}{\" \"}\r\n
\r\n );\r\n if (onSelect)\r\n return (\r\n \r\n );\r\n return

{i18n.t(\"tooltipSeat.click-to-select\")}

;\r\n } else if (target.isHoldByMe) {\r\n if (onSelect)\r\n return (\r\n \r\n );\r\n return

{i18n.t(\"tooltipSeat.selected\")}

;\r\n }\r\n }\r\n return

{i18n.t(\"tooltipSeat.not-available\")}

;\r\n };\r\n\r\n return (\r\n \r\n {target.category && (\r\n \r\n

{target.category.name}

\r\n \r\n )}\r\n {target.restrictedView && (\r\n \r\n

\r\n \r\n {i18n.t(\"tooltipSeat.restrictedView\")}\r\n

\r\n \r\n )}\r\n {target.accesible && (\r\n \r\n

\r\n \r\n {i18n.t(\"tooltipSeat.accessible\")}\r\n

\r\n \r\n )}\r\n {target.companion && (\r\n \r\n

\r\n \r\n {i18n.t(\"tooltipSeat.companion\")}\r\n

\r\n \r\n )}\r\n\r\n
\r\n

\r\n \r\n {i18n.t(\"tooltipSeat.section\")}:{\" \"}\r\n {target.sectionLabel || \"?\"}{\" \"}\r\n \r\n  \r\n

\r\n

\r\n \r\n {i18n.t(\"tooltipSeat.row\")}:{\" \"}\r\n {target.rowLabel || \"?\"}\r\n \r\n    \r\n \r\n {i18n.t(\"tooltipSeat.seat\")}: {target.label || \"?\"}\r\n \r\n

\r\n
\r\n\r\n
\r\n {info}\r\n
\r\n\r\n
{getInfoSpan()}
\r\n \r\n );\r\n};\r\n\r\nexport const TooltipRowBlocker = (target: any, onSelect: any) => {\r\n const getInfoSpan = () => {\r\n if (target.status == \"Free\") {\r\n if (onSelect)\r\n return (\r\n \r\n );\r\n return

{i18n.t(\"tooltipSeat.click-to-not-for-sale\")}

;\r\n } else if (target.status == \"NoForSale\") {\r\n if (onSelect)\r\n return (\r\n \r\n );\r\n return

{i18n.t(\"tooltipSeat.click-to-for-sale\")}

;\r\n }\r\n return

{i18n.t(\"tooltipSeat.not-available\")}

;\r\n };\r\n\r\n return (\r\n \r\n {target.status == \"Free\" && (\r\n \r\n

Disponible para venta

\r\n \r\n )}\r\n {target.status == \"NoForSale\" && (\r\n \r\n

{`Disponible > No disponible para venta`}

\r\n \r\n )}\r\n {target.status == \"Reserved\" && (\r\n \r\n

{`No es posible cambiar el estatus del asiento`}

\r\n \r\n )}\r\n {target.status == \"Booked\" && (\r\n \r\n

{`No es posible cambiar el estatus del asiento`}

\r\n \r\n )}\r\n {target.category && (\r\n \r\n

{target.category.name}

\r\n \r\n )}\r\n {target.restrictedView && (\r\n \r\n

\r\n \r\n {i18n.t(\"tooltipSeat.restrictedView\")}\r\n

\r\n \r\n )}\r\n {target.accesible && (\r\n \r\n

\r\n \r\n {i18n.t(\"tooltipSeat.accessible\")}\r\n

\r\n \r\n )}\r\n {target.companion && (\r\n \r\n

\r\n \r\n {i18n.t(\"tooltipSeat.companion\")}\r\n

\r\n \r\n )}\r\n\r\n
\r\n

\r\n \r\n {i18n.t(\"tooltipSeat.section\")}:{\" \"}\r\n {target.section || \"?\"}{\" \"}\r\n \r\n  \r\n

\r\n

\r\n \r\n {i18n.t(\"tooltipSeat.row\")}: {target.row || \"?\"}\r\n \r\n    \r\n \r\n {i18n.t(\"tooltipSeat.seat\")}:{\" \"}\r\n {target.seatNumber || \"?\"}\r\n \r\n

\r\n
\r\n\r\n
{getInfoSpan()}
\r\n \r\n );\r\n};\r\n\r\nexport const TooltipRowChannel = (target: any, onSelect: any) => {\r\n return (\r\n \r\n \r\n

{target.channel?.name ?? \"Sin Canal\"}

\r\n \r\n\r\n {target.category && (\r\n \r\n

{target.category.name}

\r\n \r\n )}\r\n\r\n \r\n\r\n
\r\n

\r\n \r\n {i18n.t(\"tooltipSeat.section\")}:{\" \"}\r\n {target.section || \"?\"}{\" \"}\r\n \r\n  \r\n

\r\n

\r\n \r\n {i18n.t(\"tooltipSeat.row\")}: {target.row || \"?\"}\r\n \r\n    \r\n \r\n {i18n.t(\"tooltipSeat.seat\")}:{\" \"}\r\n {target.seatNumber || \"?\"}\r\n \r\n

\r\n
\r\n\r\n
\r\n

{target.status}

\r\n
\r\n {target.isSelected && (\r\n
\r\n

Seleccionado

\r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\n\r\nexport const TooltipRowDetail = (target: any, info: any, onSelect: any) => {\r\n return (\r\n \r\n {target.category && (\r\n \r\n

{target.category.name}

\r\n \r\n )}\r\n \r\n\r\n
\r\n

\r\n \r\n {i18n.t(\"tooltipSeat.section\")}:{\" \"}\r\n {target.sectionLabel || \"?\"}{\" \"}\r\n \r\n  \r\n

\r\n

\r\n \r\n {i18n.t(\"tooltipSeat.row\")}:{\" \"}\r\n {target.rowLabel || \"?\"}\r\n \r\n    \r\n \r\n {i18n.t(\"tooltipSeat.seat\")}: {target.label || \"?\"}\r\n \r\n

\r\n
\r\n {\r\n target.status == \"Booked\" &&
{info}
\r\n }\r\n \r\n );\r\n};\r\n","import Handler from \"./Handler\";\r\nimport { Row } from \"../objects/preview\";\r\nimport { IObjectPreview, FabricEvent } from \"../utils\";\r\n\r\nclass PreviewHandler {\r\n private objectTypes: any;\r\n private object: IObjectPreview;\r\n public selectedType: string;\r\n private callBack: any;\r\n\r\n constructor(handler: Handler) {\r\n this.objectTypes = {\r\n row: new Row(handler),\r\n };\r\n }\r\n\r\n public setType(type: string) {\r\n this.selectedType = type;\r\n this.object = this.objectTypes[type];\r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n if (event.target) {\r\n this.setType(event.target.superType);\r\n if (this.object) {\r\n this.callBack = this.object.onHover(event);\r\n } else this.onBlur();\r\n }\r\n }\r\n\r\n private onBlur() {\r\n if (this.callBack) {\r\n this.callBack();\r\n this.callBack = null;\r\n }\r\n }\r\n}\r\n\r\nexport default PreviewHandler;\r\n","export default class BaseService {\r\n constructor() {}\r\n\r\n _setInterceptors() {}\r\n\r\n async _handleResponse_(response) {\r\n if (response.ok) {\r\n return await response.text().then((text) => {\r\n let data;\r\n\r\n try {\r\n data = text && JSON.parse(text);\r\n } catch (e) {\r\n data = text;\r\n }\r\n return data;\r\n });\r\n }\r\n\r\n return {\r\n statusCode: response.status,\r\n errorMessage: `Status code ${response.status}`,\r\n };\r\n }\r\n\r\n _handleError_(error) {\r\n console.log(\"error\", error);\r\n return error;\r\n }\r\n\r\n /**\r\n * Communication with the API\r\n * @param {*} url\r\n * @param {*} method\r\n * @param {*} body\r\n * @param {*} contentType\r\n */\r\n async callApi(url, method, body, headers) {\r\n const options = {\r\n method: method,\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n Authorization:\r\n \"Basic \" +\r\n btoa(\r\n `${window.redseats.publicKey}:${window.redseats?.privateKey ?? \"\"}`\r\n ),\r\n ...headers,\r\n },\r\n body: JSON.stringify(body),\r\n };\r\n return await fetch(`${process.env.REACT_APP_API_URL}${url}`, options)\r\n .then(this._handleResponse_)\r\n .catch(this._handleError_);\r\n }\r\n\r\n /**\r\n * Communication with the API\r\n * @param {*} url\r\n * @param {*} method\r\n * @param {*} body\r\n * @param {*} contentType\r\n */\r\n async callApiFile(url) {\r\n const options = {\r\n method: \"Get\",\r\n };\r\n return await fetch(`${url}`, options)\r\n .then(this._handleResponse_)\r\n .catch(this._handleError_);\r\n }\r\n\r\n htmlError(errorMessage) {\r\n let html = document.getElementById(\"root\");\r\n html.innerHTML = `

${errorMessage || \"server error\"}

`;\r\n return false;\r\n }\r\n}\r\n","import BaseService from \"./base.service\";\r\nimport { mapStatus } from \"../constants/status\";\r\n\r\nexport default class MapService extends BaseService {\r\n constructor() {\r\n super();\r\n }\r\n\r\n async get() {\r\n if (window.redseats == undefined) {\r\n let html = document.getElementById(\"root\");\r\n html.innerHTML = `

Not authorized

`;\r\n return;\r\n }\r\n\r\n if (window.redseats.mapKey) {\r\n const result = await super.callApi(\r\n `map/${window.redseats.mapKey}`,\r\n \"Get\"\r\n );\r\n if (result.statusCode == \"200\") {\r\n result.data.name = window.redseats.mapName ?? \"default\";\r\n result.data.categories = window.redseats.categories;\r\n return result.data;\r\n } else return super.htmlError(result.errorMessage);\r\n }\r\n\r\n return {\r\n name: window.redseats.mapName ?? \"default\",\r\n categories: window.redseats.categories,\r\n status: mapStatus.new,\r\n isPublished: false,\r\n };\r\n }\r\n\r\n async getById(mapId) {\r\n const result = await super.callApi(\r\n `map/${mapId}`,\r\n \"Get\"\r\n );\r\n if (result.statusCode == \"200\") {\r\n console.log('result', result)\r\n return result.data;\r\n } else return super.htmlError(result.errorMessage);\r\n }\r\n\r\n async create(data) {\r\n const result = await super.callApi(\"map\", \"Post\", data);\r\n return result;\r\n }\r\n\r\n async updateData(data) {\r\n const result = await super.callApi(\"map\", \"Put\", {\r\n key: data.key,\r\n name: data.name,\r\n categories: data.categories,\r\n });\r\n return result;\r\n }\r\n\r\n async updateLayout(data) {\r\n const result = await super.callApi(\"map/layout\", \"Put\", {\r\n key: data.key,\r\n layout: data.layout,\r\n });\r\n return result;\r\n }\r\n\r\n async publish({key, imageUrl}) {\r\n const result = await super.callApi(\"map/publish\", \"Put\", {\r\n key,\r\n imagebase64: imageUrl\r\n });\r\n return result;\r\n }\r\n\r\n async getPublishedMaps(){\r\n const result = await super.callApi(\"map/published\", \"Get\");\r\n if (result.statusCode == \"200\") {\r\n return result.data;\r\n } else return super.htmlError(result.errorMessage);\r\n }\r\n}\r\n","import BaseService from \"./base.service\";\r\n\r\nexport default class MapEventService extends BaseService {\r\n constructor() {\r\n super();\r\n }\r\n\r\n async buildSelector() {\r\n if (window.redseats.eventKey) {\r\n const selector = JSON.parse(sessionStorage.getItem(\"rs_selector\"));\r\n const body = {\r\n EventId: window.redseats.eventKey,\r\n AvailableCategories: window.redseats.availableCategories,\r\n SeatStatusColor: window.redseats.seatStatusColor,\r\n Channels: window.redseats.channels ?? []\r\n };\r\n const result = await super.callApi(\r\n \"mapevent/build/selector\",\r\n \"Post\",\r\n body,\r\n { selectorToken: selector?.token ?? \"\" }\r\n );\r\n if (result.statusCode == \"200\") {\r\n sessionStorage.setItem(\r\n \"rs_selector\",\r\n JSON.stringify({\r\n key: result.data.selectorKey,\r\n token: result.data.selectorToken,\r\n })\r\n );\r\n return result.data;\r\n } else return super.htmlError(result.errorMessage);\r\n }\r\n\r\n return super.htmlError(\"Event key does not exist\");\r\n }\r\n async buildNotForSale() {\r\n if (window.redseats.eventKey) {\r\n const body = {\r\n EventId: window.redseats.eventKey,\r\n };\r\n const result = await super.callApi(\r\n \"mapevent/build/notforsale\",\r\n \"Post\",\r\n body\r\n );\r\n if (result.statusCode == \"200\") return result.data;\r\n else return super.htmlError(result.errorMessage);\r\n }\r\n\r\n return super.htmlError(\"Event key does not exist\");\r\n }\r\n async buildChannel() {\r\n if (window.redseats.eventKey) {\r\n const body = {\r\n EventId: window.redseats.eventKey,\r\n };\r\n const result = await super.callApi(\r\n \"mapevent/build/channel\",\r\n \"Post\",\r\n body\r\n );\r\n if (result.statusCode == \"200\") return result.data;\r\n else return super.htmlError(result.errorMessage);\r\n }\r\n\r\n return super.htmlError(\"Event key does not exist\");\r\n }\r\n async buildDetail() {\r\n if (window.redseats.eventKey) {\r\n const body = {\r\n EventId: window.redseats.eventKey,\r\n SeatStatusColor: window.redseats.seatStatusColor\r\n };\r\n const result = await super.callApi(\r\n \"mapevent/build/detail\",\r\n \"Post\",\r\n body\r\n );\r\n if (result.statusCode == \"200\") return result.data;\r\n else return super.htmlError(result.errorMessage);\r\n }\r\n\r\n return super.htmlError(\"Event key does not exist\");\r\n }\r\n}\r\n","import BaseService from \"./base.service\";\r\n\r\nexport default class SeatService extends BaseService {\r\n constructor() {\r\n super();\r\n }\r\n\r\n async changeStatus(data, isAdmin = false) {\r\n data.EventId = window.redseats.eventKey;\r\n console.log(\"data.Status\", data.Status);\r\n let headers;\r\n if (!isAdmin) {\r\n const selector = JSON.parse(sessionStorage.getItem(\"rs_selector\"));\r\n headers = {\r\n selectorToken: selector.token,\r\n };\r\n }\r\n\r\n const result = await super.callApi(\r\n `seat/canvas/status`,\r\n \"Post\",\r\n data,\r\n headers\r\n );\r\n\r\n if (result.statusCode != \"200\") return false;\r\n\r\n return result.data[0].statusCode == \"200\";\r\n }\r\n}\r\n","import BaseService from \"./base.service\";\r\n\r\nexport default class ChannelService extends BaseService {\r\n constructor() {\r\n super();\r\n }\r\n\r\n async getChannels() {\r\n const result = await super.callApi(\r\n `MapEventChannel/${window.redseats.eventKey}`,\r\n \"Get\"\r\n );\r\n if (result.statusCode == \"201\") {\r\n return result.data;\r\n } else return super.htmlError(result.errorMessage);\r\n }\r\n\r\n async saveChannels(channels) {\r\n const body = {\r\n EventId: window.redseats.eventKey,\r\n Channels: channels\r\n };\r\n const result = await super.callApi(\r\n \"MapEventChannel\",\r\n \"Post\",\r\n body\r\n );\r\n if (result.statusCode == \"201\") {\r\n return result.data;\r\n } else return super.htmlError(result.errorMessage);\r\n}\r\n\r\nasync changeSeatChannels(channels) {\r\n const result = await super.callApi(\r\n `MapEventSeatChannel`,\r\n \"Post\",\r\n channels,\r\n );\r\n\r\n if (result.statusCode != \"200\") return false;\r\n\r\n return result.data[0].statusCode == \"200\";\r\n}\r\n}\r\n","import MapService from \"./map.service\";\r\nimport MapEventService from \"./mapEvent.service\";\r\nimport SeatService from \"./seat.service\";\r\nimport ChannelService from \"./channel.service\";\r\n\r\nconst services = {\r\n map: new MapService(),\r\n mapEvent: new MapEventService(),\r\n seat: new SeatService(),\r\n channel: new ChannelService(),\r\n};\r\n\r\nexport default services;\r\n","import _ from \"underscore\";\r\n\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricEvent, FabricObject, IObjectSelector } from \"../../utils\";\r\nimport service from \"../../../../service\";\r\nimport { TooltipRowSelector } from \"../tooltip/Row\";\r\nimport store from \"../../../../redux/store\";\r\nimport {\r\n setSpinning,\r\n addSeatToSelection,\r\n removeSeatToSelection,\r\n} from \"../../../../redux/designerPropertiesSlice\";\r\n\r\nclass Row implements IObjectSelector {\r\n private handler: Handler;\r\n private targetSeat: FabricObject;\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n public onMouseDblClick(event: FabricEvent) {\r\n\r\n }\r\n\r\n public onHover(event: any): any {\r\n if (event.target.superType === \"seat\") {\r\n if (event.e instanceof TouchEvent)\r\n this.handler.eventHandler.panning = false;\r\n\r\n const seat = event.target;\r\n if (this.targetSeat != seat) {\r\n this.onBlur();\r\n const seatCircle = seat.item(0);\r\n this.setTooltip(event, seat);\r\n if (seat.status == \"Free\" && seat.available) {\r\n seatCircle.set({\r\n fill: `${seatCircle.stroke}90`,\r\n radius: seatCircle.radius + 0.5,\r\n });\r\n }\r\n this.targetSeat = seat;\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n return this.onBlur;\r\n } else this.onBlur();\r\n }\r\n\r\n public async onSelect(event: any) {\r\n store.dispatch(setSpinning(true));\r\n await this.changeStatus(event);\r\n store.dispatch(setSpinning(false));\r\n }\r\n\r\n public async onChangeHub(valueHub: any): Promise {\r\n const {\r\n properties: { channels },\r\n } = store.getState();\r\n valueHub.seats.forEach((item: any) => {\r\n const seat = this.getSeatById(item.rowKey, item.seatKey);\r\n if (seat) {\r\n if (item.status == \"Free\" && ((item.channel?.key?? null) == null || channels.includes(item.channel?.key?? null))) {\r\n this.releaseInCanvas(seat);\r\n } else {\r\n this.holdInCanvas(seat, (item.channel?.key?? null) == null ? item.status : \"NoForSale\", valueHub.selectorKey);\r\n }\r\n if(window.redseats.responseCallback)\r\n window.redseats.responseCallback();\r\n }\r\n });\r\n }\r\n\r\n private onBlur = () => {\r\n if (this.targetSeat) {\r\n this.handler.tooltipHandler.hide();\r\n if (this.targetSeat.status == \"Free\" && this.targetSeat.available) {\r\n const seatCircle = this.targetSeat.item(0);\r\n seatCircle.set({\r\n fill: `${seatCircle.stroke}40`,\r\n radius: seatCircle.radius - 0.5,\r\n });\r\n }\r\n this.handler.canvas.requestRenderAll();\r\n this.targetSeat = null;\r\n }\r\n };\r\n\r\n private async changeStatus(event: any): Promise {\r\n if (event.target.superType == \"seat\") {\r\n console.log('changeStatus')\r\n const {\r\n properties: { selection },\r\n } = store.getState();\r\n this.handler.eventHandler.panning = false;\r\n const seat = event.target;\r\n let seatsLength = 0;\r\n if(seat.available){\r\n let category = selection.find( (select) => {\r\n return seat.category.key === select.key\r\n } );\r\n seatsLength = category.seats.length;\r\n }\r\n if (\r\n (seat.available &&\r\n seatsLength < window.redseats.maximumsSeatsSelected) ||\r\n (seat.status == \"Reserved\" && seat.isHoldByMe)\r\n ) {\r\n let isSuccessful = false;\r\n let isSelection = false;\r\n const seatModel = this.createSeatModel(event.target.id, seat);\r\n if (seat.status == \"Free\") {\r\n isSelection = true;\r\n isSuccessful = await this.changeStatusInDb([seatModel], \"Reserved\");\r\n } else if (seat.status == \"Reserved\" && seat.isHoldByMe) {\r\n seat.set({\r\n status: \"Reserved\",\r\n isHoldByMe: true,\r\n });\r\n isSuccessful = await this.changeStatusInDb([seatModel], \"Free\");\r\n }\r\n\r\n const seatCallback = this.createSeatCallback(seat);\r\n\r\n if (isSuccessful) {\r\n if (isSelection) window.redseats.onSeatSelected(seatCallback);\r\n else window.redseats.onSeatDeselected(seatCallback);\r\n } else window.redseats.onFailedSeatSelection(seatCallback);\r\n }\r\n }\r\n }\r\n\r\n private async holdInCanvas(seat: any, status: string, selectorKey: string) {\r\n const selector = JSON.parse(sessionStorage.getItem(\"rs_selector\"));\r\n const isHoldByMe: boolean = selector.key == selectorKey;\r\n const {\r\n properties: { selection },\r\n } = store.getState();\r\n seat.set({\r\n status: status,\r\n isHoldByMe: isHoldByMe,\r\n });\r\n const seatCircle = seat.item(0);\r\n const seatText = seat.item(1);\r\n const seatIcon = seat.item(2);\r\n const seatIcon2 = seat.item(3);\r\n const colorFill = seat.statusColor[status];\r\n if (isHoldByMe) {\r\n let index = 0;\r\n selection.some((category, i) => {\r\n if(category.key === seat.category.key){\r\n index = i\r\n }\r\n });\r\n store.dispatch(addSeatToSelection({index, seat: seat.id}));\r\n seatCircle.set({\r\n fill: seatCircle.stroke,\r\n hoverCursor: \"pointer\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: false,\r\n });\r\n seatIcon.set({\r\n visible: true,\r\n fill: \"red\",\r\n });\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: false,\r\n });\r\n } else {\r\n seatCircle.set({\r\n fill: colorFill,\r\n stroke: \"#FFFFFF\",\r\n hoverCursor: \"default\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"default\",\r\n visible: true,\r\n });\r\n seatIcon.set({\r\n visible: false,\r\n });\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: false,\r\n });\r\n }\r\n\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n\r\n private async releaseInCanvas(seat: any) {\r\n const {\r\n properties: { selection },\r\n } = store.getState();\r\n seat.set({\r\n status: \"Free\",\r\n isHoldByMe: false,\r\n });\r\n const seatCircle = seat.item(0);\r\n const seatText = seat.item(1);\r\n const seatIcon = seat.item(2);\r\n const seatIcon2 = seat.item(3);\r\n let index = 0;\r\n selection.some((category, i) => {\r\n if(category.key === seat.category.key){\r\n index = i\r\n }\r\n });\r\n store.dispatch(removeSeatToSelection({index, seat: seat.id}));\r\n seatCircle.set({\r\n fill: `${seat.statusColor.Free}40`,\r\n stroke: seat.statusColor.Free,\r\n hoverCursor: \"pointer\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: !seatIcon2,\r\n });\r\n seatIcon.set({\r\n visible: false,\r\n });\r\n\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: true,\r\n });\r\n\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n\r\n private async changeStatusInDb(seats: any, status: string) {\r\n const data = {\r\n Status: status,\r\n Seats: seats,\r\n };\r\n return await service.seat.changeStatus(data);\r\n }\r\n\r\n private createSeatModel(rowKey: string, seat: any) {\r\n const seatModel = {\r\n RowKey: rowKey,\r\n SeatKey: seat.id,\r\n SeatValue: seat.value,\r\n };\r\n return seatModel;\r\n }\r\n\r\n private getSeatById(rowKey: string, seatKey: string) {\r\n const objects = this.handler.canvas.getObjects();\r\n const seat = objects.find((s: any) => s.id == seatKey);\r\n return seat;\r\n }\r\n\r\n private setTooltip(event: any, seat: any) {\r\n const show = _.partial(this.handler.tooltipHandler.show, event.e);\r\n window.redseats.responseCallback = _.partial(\r\n this.showTooltip,\r\n show,\r\n seat,\r\n this,\r\n event\r\n );\r\n\r\n const seatCallback = this.createSeatCallback(seat);\r\n window.redseats.getTooltipInfo(seatCallback);\r\n }\r\n\r\n private showTooltip(\r\n show: any,\r\n seat: any,\r\n rowInstance: any,\r\n event: any,\r\n tooltipInfo: any\r\n ) {\r\n let onSelect;\r\n if (event.e instanceof TouchEvent)\r\n onSelect = () => rowInstance.onSelect(event);\r\n\r\n window.redseats.responseCallback = _.partial(\r\n window.redseats.responseCallback,\r\n tooltipInfo\r\n );\r\n\r\n const htmlElement = TooltipRowSelector(seat, tooltipInfo, onSelect);\r\n show(htmlElement);\r\n }\r\n\r\n private createSeatCallback(seat: any) {\r\n const selector = JSON.parse(sessionStorage.getItem(\"rs_selector\"));\r\n return {\r\n value: seat.value,\r\n status: seat.status,\r\n categoryKey: seat.category.key,\r\n category: seat.category.name,\r\n selectorKey: selector.key,\r\n row: seat.rowLabel,\r\n seat: seat.label,\r\n section: seat.sectionLabel,\r\n };\r\n }\r\n}\r\nexport default Row;\r\n","import _ from \"underscore\";\r\n\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricEvent, FabricObject, IObjectSelector } from \"../../utils\";\r\n\r\nclass PolygonZone implements IObjectSelector {\r\n private handler: Handler;\r\n private targetSeat: FabricObject;\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n public onMouseDblClick(event: FabricEvent) {\r\n\r\n }\r\n\r\n public onHover(event: any): any {\r\n }\r\n\r\n public async onSelect(event: any) {\r\n const {target} = event;\r\n const shape = target.item(0);\r\n const text = target.item(1);\r\n shape.set({visible: false});\r\n text.set({visible: false});\r\n this.handler.activeZoneSelector = target;\r\n this.handler.zoomHandler.zoomToCenterWithObject(target, null, false);\r\n }\r\n\r\n public async onChangeHub(valueHub: any): Promise {\r\n }\r\n}\r\n\r\nexport default PolygonZone;\r\n","import Handler from \"./Handler\";\r\nimport { Row } from \"../objects/selector\";\r\nimport { IObjectSelector, FabricEvent } from \"../utils\";\r\nimport { PolygonZone } from \"../objects/selector\";\r\n\r\nclass SelectorHandler {\r\n private handler: any;\r\n private objectTypes: any;\r\n private object: IObjectSelector;\r\n public selectedType: string;\r\n\r\n private callBack: any;\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n this.objectTypes = {\r\n row: new Row(handler),\r\n polygonZone: new PolygonZone(handler)\r\n };\r\n }\r\n\r\n public setType(type: string) {\r\n this.selectedType = type;\r\n this.object = this.objectTypes[type];\r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n if (event.target) {\r\n switch (event.target.superType) {\r\n case \"seat\":\r\n this.setType(\"row\");\r\n if (this.object) {\r\n this.callBack = this.object.onHover(event);\r\n } else this.onBlur();\r\n break;\r\n default:\r\n break;\r\n }\r\n }else{\r\n this.handler.selectorHandler.onBlur();\r\n }\r\n }\r\n\r\n public onMousedown(event: FabricEvent) {\r\n console.log('onMOUSEDOWN', event.target)\r\n if (event.target) {\r\n const {target: {superType} } = event;\r\n switch (superType) {\r\n case \"seat\":\r\n this.setType(\"row\");\r\n console.log('ON MOUSE DOWN SEAT')\r\n if (this.object) {\r\n if (event.e instanceof TouchEvent)\r\n this.callBack = this.object.onHover(event);\r\n else return this.object.onSelect(event);\r\n }\r\n break;\r\n case \"polygonZone\":\r\n this.setType(superType)\r\n if (this.object) {\r\n this.object.onSelect(event);\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n public onChangeHub(valueHub: any) {\r\n if (this.object) {\r\n this.object.onChangeHub(valueHub);\r\n }\r\n }\r\n\r\n public onBlur() {\r\n if (this.callBack) {\r\n this.callBack();\r\n this.callBack = null;\r\n }\r\n }\r\n\r\n public onMouseOut(){\r\n this.handler.selectorHandler.onBlur();\r\n }\r\n}\r\n\r\nexport default SelectorHandler;\r\n","import _ from \"underscore\";\r\n\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricObject, IObjectBlocker, getSvgObject } from \"../../utils\";\r\nimport service from \"../../../../service\";\r\nimport { TooltipRowBlocker } from \"../tooltip/Row\";\r\nimport store from \"../../../../redux/store\";\r\nimport {\r\n setSpinning,\r\n} from \"../../../../redux/designerPropertiesSlice\";\r\n\r\nclass Row implements IObjectBlocker {\r\n private handler: Handler;\r\n private targetSeat: FabricObject;\r\n private forSale: any[];\r\n private noForSale: any[];\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n this.forSale = [];\r\n this.noForSale = [];\r\n }\r\n\r\n public onHover(event: any): any {\r\n if (event.target.superType == \"seat\" ) {\r\n if (event.e instanceof TouchEvent)\r\n this.handler.eventHandler.panning = false;\r\n\r\n const seat = event.target;\r\n let seatData = seat.value.split(\"-\");\r\n seat.section = seatData[0];\r\n seat.row = seatData[1];\r\n seat.seatNumber = seatData[2];\r\n const seatCircle = seat.item(0);\r\n const seatText = seat.item(1);\r\n const seatIcon = seat.item(2);\r\n if (this.targetSeat != seat) {\r\n this.onBlur();\r\n this.setTooltip(event, seat);\r\n if (seat.status == \"Free\" && !seat.onBlocker) {\r\n seatCircle.set({\r\n fill: `${seat.statusColor[\"Free\"]}90`,\r\n radius: seatCircle.radius + 0.5,\r\n hoverCursor: \"pointer\"\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n });\r\n }\r\n else if (seat.status == \"NoForSale\" && seat.onBlocker) {\r\n seatCircle.set({\r\n fill: seat.statusColor[\"Free\"],\r\n radius: seatCircle.radius + 0.5,\r\n hoverCursor: \"pointer\"\r\n });\r\n seatIcon.set({\r\n hoverCursor: \"pointer\",\r\n });\r\n }\r\n else if (seat.status == \"NoForSale\" && !seat.onBlocker) {\r\n seatCircle.set({\r\n fill: `${seat.statusColor[\"Free\"]}90`,\r\n radius: seatCircle.radius + 0.5,\r\n hoverCursor: \"pointer\"\r\n });\r\n seatIcon.set({\r\n hoverCursor: \"pointer\",\r\n });\r\n }\r\n else if (seat.status == \"Free\" && seat.onBlocker) {\r\n seatCircle.set({\r\n fill: seat.statusColor[\"Free\"],\r\n radius: seatCircle.radius + 0.5,\r\n hoverCursor: \"pointer\"\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n });\r\n }\r\n this.targetSeat = seat;\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n return this.onBlur;\r\n } else this.onBlur();\r\n }\r\n\r\n private async changeMultipleStatus(event: any): Promise {\r\n console.log('event', event)\r\n this.handler.eventHandler.panning = false;\r\n const selected = event.selected || [];\r\n let seats;\r\n if(selected.length == 0) return;\r\n if(!selected.find((seat: any) => seat.status == \"Free\" || seat.status == \"NoForSale\")) return;\r\n if(event.e.altKey){\r\n seats = selected.filter((seat: any) => seat.status == \"NoForSale\");\r\n }\r\n else{\r\n seats = selected.filter((seat: any) => seat.status == \"Free\");\r\n }\r\n console.log('seats', seats)\r\n let isSelection = false;\r\n seats.forEach((seat: any) => {\r\n const seatModel = this.createSeatModel(seat);\r\n const seatCircle = seat.item(0);\r\n const seatText = seat.item(1);\r\n const seatIcon = seat.item(2);\r\n const seatIcon2 = seat.item(3);\r\n if (seat.status == \"Free\" && !seat.onBlocker) {\r\n this.noForSale.push(seatModel);\r\n isSelection = true;\r\n seat.set({\r\n status: \"NoForSale\",\r\n onBlocker: true\r\n });\r\n seat.insertAt(getSvgObject('block', (seat._objects[0].radius*2), '#ffffff'), 2, true);\r\n seatCircle.set({\r\n fill: seatCircle.stroke,\r\n hoverCursor: \"pointer\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: false,\r\n });\r\n seatIcon.set({\r\n visible: true,\r\n fill: \"red\",\r\n });\r\n\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: false,\r\n });\r\n\r\n this.handler.canvas.requestRenderAll();\r\n } else if (seat.status == \"NoForSale\" && seat.onBlocker) {\r\n seat.set({\r\n status: \"Free\",\r\n onBlocker: false,\r\n });\r\n this.noForSale = this.noForSale.filter(obj => seatModel.SeatKey != obj.SeatKey);\r\n seatCircle.set({\r\n fill: `${seat.statusColor.Free}40`,\r\n stroke: seat.statusColor.Free,\r\n hoverCursor: \"pointer\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: !seatIcon2,\r\n });\r\n seatIcon.set({\r\n visible: false,\r\n });\r\n\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: true,\r\n });\r\n\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n else if (seat.status == \"NoForSale\" && !seat.onBlocker) {\r\n this.forSale.push(seatModel);\r\n isSelection = true;\r\n seat.set({\r\n status: \"Free\",\r\n onBlocker: true\r\n });\r\n seat.insertAt(getSvgObject('check', (seat._objects[0].radius*2), '#ffffff'), 2, true);\r\n seatCircle.set({\r\n fill: seat.statusColor[\"Free\"],\r\n hoverCursor: \"pointer\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: false,\r\n });\r\n seatIcon.set({\r\n visible: true,\r\n fill: \"red\",\r\n });\r\n\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: false,\r\n });\r\n\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n else if (seat.status == \"Free\" && seat.onBlocker) {\r\n this.forSale = this.forSale.filter(seat => seat.SeatKey != seatModel.SeatKey);\r\n isSelection = true;\r\n seat.set({\r\n status: \"NoForSale\",\r\n onBlocker: false\r\n });\r\n seat.insertAt(getSvgObject('block', (seat._objects[0].radius*2), seatCircle.stroke), 2, true);\r\n seatCircle.set({\r\n fill: `${seatCircle.stroke}20`,\r\n strokeWidth: 0,\r\n hoverCursor: \"pointer\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: false,\r\n });\r\n seatIcon.set({\r\n visible: true,\r\n fill: \"red\",\r\n });\r\n\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: false,\r\n });\r\n\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n });\r\n this.handler.canvas.discardActiveObject();\r\n }\r\n\r\n public async onSelection(event: any){\r\n store.dispatch(setSpinning(true));\r\n await this.changeMultipleStatus(event);\r\n store.dispatch(setSpinning(false));\r\n }\r\n\r\n public async onSelect(event: any) {\r\n store.dispatch(setSpinning(true));\r\n if (event.target.superType == \"seat\") {\r\n await this.changeStatus(event);\r\n }\r\n store.dispatch(setSpinning(false));\r\n }\r\n\r\n public async onChangeHub(valueHub: any): Promise {\r\n valueHub.seats.forEach((item: any) => {\r\n const seat = this.getSeatById(item.seatKey);\r\n if (seat) {\r\n if (item.status == \"Free\") {\r\n this.releaseInCanvas(seat);\r\n }\r\n else if(item.status == \"Reserved\" || item.status == \"Booked\"){\r\n this.reserveInCanvas(seat, item.status);\r\n }\r\n else {\r\n this.holdInCanvas(seat, item.status, item.selectorKey);\r\n }\r\n }\r\n });\r\n }\r\n\r\n private onBlur = () => {\r\n if (this.targetSeat) {\r\n this.handler.tooltipHandler.hide();\r\n const seatCircle = this.targetSeat.item(0);\r\n if (this.targetSeat.status == \"Free\" && !this.targetSeat.onBlocker) {\r\n seatCircle.set({\r\n fill: `${this.targetSeat.statusColor[\"Free\"]}40`,\r\n radius: seatCircle.radius - 0.5,\r\n });\r\n }\r\n else if (this.targetSeat.status == \"NoForSale\" && this.targetSeat.onBlocker) {\r\n seatCircle.set({\r\n fill: this.targetSeat.statusColor[\"Free\"],\r\n radius: seatCircle.radius - 0.5,\r\n });\r\n }\r\n else if (this.targetSeat.status == \"NoForSale\" && !this.targetSeat.onBlocker) {\r\n const seatCircle = this.targetSeat.item(0);\r\n seatCircle.set({\r\n fill: `${this.targetSeat.statusColor[\"Free\"]}20`,\r\n radius: seatCircle.radius - 0.5,\r\n });\r\n }\r\n else if (this.targetSeat.status == \"Free\" && this.targetSeat.onBlocker) {\r\n const seatCircle = this.targetSeat.item(0);\r\n seatCircle.set({\r\n fill: this.targetSeat.statusColor[\"Free\"],\r\n radius: seatCircle.radius - 0.5,\r\n });\r\n }\r\n this.handler.canvas.requestRenderAll();\r\n this.targetSeat = null;\r\n }\r\n };\r\n\r\n private async changeStatus(event: any): Promise {\r\n this.handler.eventHandler.panning = false;\r\n const seat = event.target;\r\n let isSelection = false;\r\n const seatModel = this.createSeatModel(seat);\r\n const seatCircle = seat.item(0);\r\n const seatText = seat.item(1);\r\n const seatIcon = seat.item(2);\r\n const seatIcon2 = seat.item(3);\r\n if (seat.status == \"Free\" && !seat.onBlocker) {\r\n this.noForSale.push(seatModel);\r\n isSelection = true;\r\n seat.set({\r\n status: \"NoForSale\",\r\n onBlocker: true\r\n });\r\n seat.insertAt(getSvgObject('block', (seat._objects[0].radius*2), '#ffffff'), 2, true);\r\n seatCircle.set({\r\n fill: seatCircle.stroke,\r\n hoverCursor: \"pointer\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: false,\r\n });\r\n seatIcon.set({\r\n visible: true,\r\n fill: \"red\",\r\n });\r\n\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: false,\r\n });\r\n\r\n this.handler.canvas.requestRenderAll();\r\n } else if (seat.status == \"NoForSale\" && seat.onBlocker) {\r\n seat.set({\r\n status: \"Free\",\r\n onBlocker: false,\r\n });\r\n this.noForSale = this.noForSale.filter(obj => seatModel.SeatKey != obj.SeatKey);\r\n seatCircle.set({\r\n fill: `${seat.statusColor.Free}40`,\r\n stroke: seat.statusColor.Free,\r\n hoverCursor: \"pointer\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: !seatIcon2,\r\n });\r\n seatIcon.set({\r\n visible: false,\r\n });\r\n\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: true,\r\n });\r\n\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n else if (seat.status == \"NoForSale\" && !seat.onBlocker) {\r\n this.forSale.push(seatModel);\r\n isSelection = true;\r\n seat.set({\r\n status: \"Free\",\r\n onBlocker: true\r\n });\r\n seat.insertAt(getSvgObject('check', (seat._objects[0].radius*2), '#ffffff'), 2, true);\r\n seatCircle.set({\r\n fill: this.targetSeat.statusColor[\"Free\"],\r\n hoverCursor: \"pointer\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: false,\r\n });\r\n seatIcon.set({\r\n visible: true,\r\n fill: \"red\",\r\n });\r\n\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: false,\r\n });\r\n\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n else if (seat.status == \"Free\" && seat.onBlocker) {\r\n this.forSale = this.forSale.filter(seat => seat.SeatKey != seatModel.SeatKey);\r\n isSelection = true;\r\n seat.set({\r\n status: \"NoForSale\",\r\n onBlocker: false\r\n });\r\n seat.insertAt(getSvgObject('block', (seat._objects[0].radius*2), seatCircle.stroke), 2, true);\r\n seatCircle.set({\r\n fill: `${seatCircle.stroke}20`,\r\n strokeWidth: 0,\r\n hoverCursor: \"pointer\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: false,\r\n });\r\n seatIcon.set({\r\n visible: true,\r\n fill: \"red\",\r\n });\r\n\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: false,\r\n });\r\n\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n this.setTooltip(event, seat);\r\n }\r\n\r\n private async reserveInCanvas(seat: any, status: string) {\r\n const seatCircle = seat.item(0);\r\n const seatText = seat.item(1);\r\n const seatIcon = seat.item(2);\r\n const seatIcon2 = seat.item(3);\r\n seat.set({\r\n status: status,\r\n onBlocker: false\r\n });\r\n seatCircle.set({\r\n fill: seat.statusColor[status],\r\n strokeWidth: 0,\r\n hoverCursor: \"pointer\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: true,\r\n });\r\n seatIcon.set({\r\n visible: false,\r\n fill: \"red\",\r\n });\r\n\r\n if (seatIcon2){\r\n seatIcon2.set({\r\n visible: false,\r\n });\r\n }\r\n this.noForSale = this.noForSale.filter(seatS => seatS.SeatKey != seat.id);\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n\r\n private async holdInCanvas(seat: any, status: string, selectorKey: string) {\r\n // seat.insertAt(getSvgObject('block', (seat._objects[0].radius*2), '#ffffff'), 2, true);\r\n const seatCircle = seat.item(0);\r\n const seatText = seat.item(1);\r\n const seatIcon = seat.item(2);\r\n const seatIcon2 = seat.item(3);\r\n seat.set({\r\n status: \"NoForSale\",\r\n onBlocker: false\r\n });\r\n seat.insertAt(getSvgObject('block', (seat._objects[0].radius*2), seatCircle.stroke), 2, true);\r\n // store.dispatch(addSelectedSeat(seat.id));\r\n seatCircle.set({\r\n fill: `${seatCircle.stroke}20`,\r\n strokeWidth: 0,\r\n hoverCursor: \"pointer\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: false,\r\n });\r\n seatIcon.set({\r\n visible: true,\r\n fill: \"red\",\r\n });\r\n\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: false,\r\n });\r\n\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n\r\n private async releaseInCanvas(seat: any) {\r\n // store.dispatch(removeSelectSeat(seat.id));\r\n const seatCircle = seat.item(0);\r\n const seatText = seat.item(1);\r\n const seatIcon = seat.item(2);\r\n const seatIcon2 = seat.item(3);\r\n\r\n seat.set({\r\n status: \"Free\",\r\n onBlocker: false,\r\n });\r\n seatCircle.set({\r\n fill: `${seat.statusColor.Free}40`,\r\n stroke: seat.statusColor.Free,\r\n strokeWidth: 1,\r\n hoverCursor: \"pointer\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: !seatIcon2,\r\n });\r\n seatIcon.set({\r\n visible: false,\r\n });\r\n\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: true,\r\n });\r\n\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n\r\n private async changeStatusInDb(seats: any, status: string) {\r\n const data = {\r\n Status: status,\r\n Seats: seats,\r\n };\r\n return await service.seat.changeStatus(data, true);\r\n }\r\n\r\n private createSeatModel(seat: any) {\r\n const seatModel = {\r\n SeatKey: seat.id,\r\n SeatValue: seat.value,\r\n };\r\n return seatModel;\r\n }\r\n\r\n private getSeatById(seatKey: string) {\r\n const objects = this.handler.canvas.getObjects();\r\n const seat = objects.find((s: any) => s.id == seatKey);\r\n return seat;\r\n }\r\n\r\n private setTooltip(event: any, seat: any) {\r\n let onSelect;\r\n if (event.e instanceof TouchEvent){\r\n onSelect = () => this.onSelect(event);\r\n }\r\n const htmlElement = TooltipRowBlocker(seat, onSelect);\r\n this.handler.tooltipHandler.show(event.e, htmlElement)\r\n }\r\n\r\n public async onSaveChanges(){\r\n store.dispatch(setSpinning(true));\r\n if(this.forSale.length>0){\r\n await this.changeStatusInDb(this.forSale, \"Free\");\r\n }\r\n if(this.noForSale.length>0){\r\n await this.changeStatusInDb(this.noForSale, \"NoForSale\");\r\n }\r\n this.forSale = [];\r\n this.noForSale = [];\r\n store.dispatch(setSpinning(false));\r\n }\r\n}\r\nexport default Row;\r\n","import Handler from \"./Handler\";\r\nimport { Row } from \"../objects/blocker\";\r\nimport { IObjectBlocker, FabricEvent } from \"../utils\";\r\n\r\nclass BlockerHandler {\r\n private handler: any;\r\n private objectTypes: any;\r\n private object: IObjectBlocker;\r\n public selectedType: string;\r\n\r\n private callBack: any;\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n this.objectTypes = {\r\n row: new Row(handler),\r\n };\r\n }\r\n\r\n public setType(type: string) {\r\n this.selectedType = type;\r\n this.object = this.objectTypes[type];\r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n if (event.target) {\r\n this.setType(\"row\");\r\n if (this.object) {\r\n this.callBack = this.object.onHover(event);\r\n } else this.onBlur();\r\n }else{\r\n this.handler.blockerHandler.onBlur();\r\n }\r\n }\r\n\r\n public onMousedown(event: FabricEvent) {\r\n console.log('event', event)\r\n this.setType(\"row\");\r\n if (this.object) {\r\n if (this.handler.canvasEnabled) {\r\n if (event.e instanceof TouchEvent)\r\n this.callBack = this.object.onHover(event);\r\n else return this.object.onSelect(event);\r\n } else this.handler.canvasEnabled = true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public onChangeHub(valueHub: any) {\r\n if (this.object) {\r\n this.object.onChangeHub(valueHub);\r\n }\r\n }\r\n\r\n public onSelection(event: FabricEvent) {\r\n this.setType(\"row\");\r\n if (this.object) {\r\n if (this.handler.canvasEnabled) {\r\n if (event.e instanceof TouchEvent)\r\n return;\r\n else return this.object.onSelection(event);\r\n } else this.handler.canvasEnabled = true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public onBlur() {\r\n if (this.callBack) {\r\n this.callBack();\r\n this.callBack = null;\r\n }\r\n }\r\n\r\n public onMouseOut(){\r\n this.handler.blockerHandler.onBlur();\r\n }\r\n\r\n public async onSaveChanges(){\r\n this.setType(\"row\");\r\n await this.object.onSaveChanges();\r\n }\r\n}\r\n\r\nexport default BlockerHandler;\r\n","import {fabric} from \"fabric\";\r\nimport { v4 } from 'uuid';\r\n\r\nimport Handler from \"./Handler\";\r\nimport Canvas from \"../Canvas\";\r\nimport { FabricObject } from \"../utils\";\r\nimport { Circle } from \"fabric/fabric-impl\";\r\n\r\nclass UpdateSeatQuantity {\r\n handler: Handler;\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n updateProperty = (propertyName: string,\r\n newValue: any,\r\n allValuesForm: any,\r\n selectedItem: any,\r\n canvasRef: Canvas) => {\r\n // aqui se modifica la propiedad\r\n if( newValue > selectedItem._objects.length){\r\n let remainItems = newValue - selectedItem._objects.length;\r\n for (let index = 0; index < remainItems; index++) {\r\n let circle = new fabric.Circle({\r\n name: 'New Linear Seat',\r\n left: (selectedItem.stepX*(selectedItem._objects.length))+selectedItem.left,\r\n top: (selectedItem.stepY*(selectedItem._objects.length))+selectedItem.top,\r\n originX: 'left',\r\n originY: 'top',\r\n radius: 7.5,\r\n angle: 0,\r\n fill: '#cccccc',\r\n strokeWidth: 1,\r\n stroke: '#727272',\r\n transparentCorners: false,\r\n hasControls: selectedItem._objects[0].hasControls,\r\n hasBorders: selectedItem._objects[0].hasBorders,\r\n selectable: selectedItem._objects[0].selectable,\r\n lockMovementX: !selectedItem._objects[0].lockMovementX,\r\n lockMovementY: !selectedItem._objects[0].lockMovementY,\r\n hoverCursor: !selectedItem._objects[0].hoverCursor ? 'pointer' : 'move',\r\n })as FabricObject;\r\n circle.set({\r\n id: v4(),\r\n label: 'Label',\r\n displayedLabel: '',\r\n container: selectedItem._objects[0].container,\r\n editable: false,\r\n objectOption: selectedItem._objects[0].objectOption\r\n });\r\n selectedItem.addWithUpdate(circle);\r\n }\r\n this.handler.seatQuantity = newValue;\r\n }\r\n else{\r\n let objectToRemove = selectedItem._objects.slice(-1);\r\n selectedItem.removeWithUpdate(objectToRemove[0]);\r\n }\r\n selectedItem.setCoords();\r\n selectedItem.set(propertyName, newValue);\r\n canvasRef.canvas.requestRenderAll();\r\n const { onModified } = this.handler;\r\n if (onModified) onModified(selectedItem);\r\n }\r\n}\r\n\r\nexport default UpdateSeatQuantity;\r\n","import _ from \"underscore\";\r\n\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricObject, IObjectChannel, getSvgObject } from \"../../utils\";\r\nimport service from \"../../../../service\";\r\nimport { TooltipRowChannel } from \"../tooltip/Row\";\r\nimport store from \"../../../../redux/store\";\r\nimport { setSpinning } from \"../../../../redux/designerPropertiesSlice\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\n\r\ninterface SeatChannelPayload{\r\n eventId: string;\r\n seatChannels: SeatChannel[]\r\n \r\n}\r\n\r\ninterface SeatChannel{\r\n channel: Channel;\r\n seats: Seat[]\r\n}\r\n\r\ninterface Seat{\r\n seatValue: string;\r\n seatKey: string;\r\n}\r\n\r\ninterface Channel{\r\n name: string;\r\n color: string;\r\n key: string;\r\n}\r\n\r\nclass Row implements IObjectChannel {\r\n private handler: Handler;\r\n private targetSeat: FabricObject;\r\n private selectedChannels: SeatChannelPayload = { seatChannels: [], eventId: '' };\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n public onHover(event: any): any {\r\n if (event.target.superType == \"seat\") {\r\n if (event.e instanceof TouchEvent)\r\n this.handler.eventHandler.panning = false;\r\n\r\n const seat = event.target;\r\n let seatData = seat.value.split(\"-\");\r\n seat.section = seatData[0];\r\n seat.row = seatData[1];\r\n seat.seatNumber = seatData[2];\r\n const seatCircle = seat.item(0);\r\n const seatText = seat.item(1);\r\n if (this.targetSeat != seat) {\r\n this.onBlur();\r\n this.setTooltip(event, seat);\r\n seatCircle.set({\r\n radius: seatCircle.radius + 0.5,\r\n hoverCursor: \"pointer\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n });\r\n this.targetSeat = seat;\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n return this.onBlur;\r\n } else this.onBlur();\r\n }\r\n\r\n private async changeMultipleStatus(event: any): Promise {\r\n this.handler.eventHandler.panning = false;\r\n const selected = event.selected || [];\r\n if (selected.length == 0) return;\r\n selected.forEach((seat: any) => {\r\n const {\r\n properties: { selectedChannel },\r\n } = store.getState();\r\n if(selectedChannel.key === ''){\r\n return;\r\n }\r\n this.setSeat( seat, selectedChannel )\r\n });\r\n this.handler.canvas.discardActiveObject();\r\n }\r\n\r\n public async onSelection(event: any) {\r\n store.dispatch(setSpinning(true));\r\n await this.changeMultipleStatus(event);\r\n store.dispatch(setSpinning(false));\r\n }\r\n\r\n public async onSelect(event: any) {\r\n store.dispatch(setSpinning(true));\r\n if (event.target.superType == \"seat\") {\r\n await this.changeStatus(event);\r\n }\r\n store.dispatch(setSpinning(false));\r\n }\r\n\r\n public async onChangeHub(valueHub: any): Promise {\r\n console.log(\"valueHub\", valueHub)\r\n valueHub.seats.forEach((item: any) => {\r\n const seat = this.getSeatById(item.seatKey);\r\n if (seat) {\r\n this.holdInCanvas(seat, item);\r\n if(window.redseats.responseCallback)\r\n window.redseats.responseCallback();\r\n }\r\n });\r\n }\r\n\r\n private onBlur = () => {\r\n if (this.targetSeat) {\r\n this.handler.tooltipHandler.hide();\r\n const seatCircle = this.targetSeat.item(0);\r\n seatCircle.set({\r\n radius: seatCircle.radius - 0.5,\r\n });\r\n\r\n this.handler.canvas.requestRenderAll();\r\n this.targetSeat = null;\r\n }\r\n };\r\n\r\n private async changeStatus(event: any): Promise {\r\n this.handler.eventHandler.panning = false;\r\n const seat = event.target;\r\n const {\r\n properties: { selectedChannel },\r\n } = store.getState();\r\n if(selectedChannel.key === ''){\r\n return;\r\n }\r\n this.setSeat(seat, selectedChannel);\r\n\r\n this.handler.canvas.requestRenderAll();\r\n\r\n this.setTooltip(event, seat);\r\n }\r\n\r\n private async holdInCanvas(seat: any, hub: any) {\r\n const seatCircle = seat.item(0);\r\n const seatText = seat.item(1);\r\n const seatIcon = seat.item(2);\r\n const seatIcon2 = seat.item(3);\r\n \r\n\r\n if(!hub.channel.key){\r\n seatCircle.set({\r\n fill: `${seat.statusColor[\"Free\"]}40`,\r\n stroke: seat.statusColor[\"Free\"],\r\n strokeWidth: 1,\r\n hoverCursor: \"pointer\",\r\n });\r\n seat.set({\r\n channel: {}\r\n });\r\n }\r\n else{\r\n seatCircle.set({\r\n fill: hub.channel.color,\r\n stroke: hub.channel.color,\r\n strokeWidth: 1,\r\n hoverCursor: \"pointer\",\r\n });\r\n seat.set({\r\n channel: hub.channel\r\n });\r\n }\r\n\r\n \r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: true,\r\n });\r\n\r\n seatIcon.set({\r\n hoverCursor: \"pointer\",\r\n visible: false,\r\n });\r\n\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: false,\r\n });\r\n\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n\r\n private async changeStatusInDb(channels: any) {\r\n channels.eventId = window.redseats.eventKey;\r\n await service.channel.changeSeatChannels(channels);\r\n }\r\n\r\n private getSeatById(seatKey: string) {\r\n const objects = this.handler.canvas.getObjects();\r\n const seat = objects.find((s: any) => s.id == seatKey);\r\n return seat;\r\n }\r\n\r\n private setTooltip(event: any, seat: any) {\r\n let onSelect;\r\n if (event.e instanceof TouchEvent) {\r\n onSelect = () => this.onSelect(event);\r\n }\r\n const htmlElement = TooltipRowChannel(seat, onSelect);\r\n this.handler.tooltipHandler.show(event.e, htmlElement);\r\n }\r\n\r\n public async onSaveChanges() {\r\n store.dispatch(setSpinning(true));\r\n if (this.selectedChannels.seatChannels.length > 0) {\r\n let channelIndex = this.selectedChannels.seatChannels.findIndex( channel => channel.channel.key === 'sn');\r\n if(channelIndex >= 0){\r\n this.selectedChannels.seatChannels[channelIndex].channel.key = null;\r\n }\r\n await this.changeStatusInDb(this.selectedChannels);\r\n }\r\n this.selectedChannels.seatChannels = [];\r\n store.dispatch(setSpinning(false));\r\n }\r\n\r\n private addSeatChannels( seat: any ){\r\n let channelIndex = this.selectedChannels.seatChannels.findIndex( channel => channel.channel.key === seat.channel.key);\r\n if(channelIndex >= 0){\r\n this.selectedChannels.seatChannels[channelIndex].seats.push({seatValue: seat.value,\r\n seatKey:seat.id});\r\n }\r\n else{\r\n this.selectedChannels.seatChannels.push({\r\n channel: {\r\n color:seat.channel.color,\r\n key: seat.channel.key,\r\n name: seat.channel.name\r\n },\r\n seats: [{seatValue: seat.value,\r\n seatKey:seat.id}]\r\n })\r\n }\r\n }\r\n\r\n private removeSeatChannels( seat: any ){\r\n if(seat.channel){\r\n let channelIndex = this.selectedChannels.seatChannels.findIndex( channel => channel.channel.key === seat.channel.key);\r\n if(channelIndex >= 0){\r\n let seatIndex = this.selectedChannels.seatChannels[channelIndex].seats.findIndex( seatC => seatC.seatKey === seat.id );\r\n if(seatIndex >= 0){\r\n this.selectedChannels.seatChannels[channelIndex].seats.splice(seatIndex, 1);\r\n }\r\n }\r\n }\r\n }\r\n\r\n private setSeat( seat: any, selectedChannel: Channel ){\r\n this.removeSeatChannels( seat );\r\n const seatCircle = seat.item(0);\r\n const seatText = seat.item(1);\r\n const seatIcon = seat.item(2);\r\n console.log(\"selectedChannel.color\", selectedChannel.color)\r\n seatCircle.set({\r\n fill: selectedChannel.key === 'sn' ? `${seat.statusColor[\"Free\"]}40` : selectedChannel.color,\r\n stroke: selectedChannel.key === 'sn' ? seat.statusColor[\"Free\"] : selectedChannel.color,\r\n hoverCursor: \"pointer\",\r\n });\r\n seat.set({\r\n channel: {\r\n color: selectedChannel.color,\r\n name: selectedChannel.name,\r\n key: selectedChannel.key\r\n }\r\n });\r\n if(selectedChannel.key === 'sn'){\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: true,\r\n });\r\n seatIcon.set({\r\n hoverCursor: \"pointer\",\r\n visible: false,\r\n fill: \"#FFFFFF\",\r\n });\r\n }\r\n else{\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: false,\r\n });\r\n seatIcon.set({\r\n hoverCursor: \"pointer\",\r\n visible: true,\r\n fill: \"#FFFFFF\",\r\n });\r\n }\r\n this.addSeatChannels( seat );\r\n }\r\n}\r\nexport default Row;\r\n","import Handler from \"./Handler\";\r\nimport { Row } from \"../objects/channels\";\r\nimport { IObjectChannel, FabricEvent } from \"../utils\";\r\n\r\nclass ChannelHandler {\r\n private handler: any;\r\n private objectTypes: any;\r\n private object: IObjectChannel;\r\n public selectedType: string;\r\n\r\n private callBack: any;\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n this.objectTypes = {\r\n row: new Row(handler),\r\n };\r\n }\r\n\r\n public setType(type: string) {\r\n this.selectedType = type;\r\n this.object = this.objectTypes[type];\r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n if (event.target) {\r\n this.setType(\"row\");\r\n if (this.object) {\r\n this.callBack = this.object.onHover(event);\r\n } else this.onBlur();\r\n }else{\r\n this.handler.channelHandler.onBlur();\r\n }\r\n }\r\n\r\n public onMousedown(event: FabricEvent) {\r\n console.log('event', event)\r\n this.setType(\"row\");\r\n if (this.object) {\r\n if (this.handler.canvasEnabled) {\r\n if (event.e instanceof TouchEvent)\r\n this.callBack = this.object.onHover(event);\r\n else return this.object.onSelect(event);\r\n } else this.handler.canvasEnabled = true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public onChangeHub(valueHub: any) {\r\n if (this.object) {\r\n this.object.onChangeHub(valueHub);\r\n }\r\n }\r\n\r\n public onSelection(event: FabricEvent) {\r\n this.setType(\"row\");\r\n if (this.object) {\r\n if (this.handler.canvasEnabled) {\r\n if (event.e instanceof TouchEvent)\r\n return;\r\n else return this.object.onSelection(event);\r\n } else this.handler.canvasEnabled = true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public onBlur() {\r\n if (this.callBack) {\r\n this.callBack();\r\n this.callBack = null;\r\n }\r\n }\r\n\r\n public onMouseOut(){\r\n this.handler.channelHandler.onBlur();\r\n }\r\n\r\n public async onSaveChanges(){\r\n this.setType(\"row\");\r\n await this.object.onSaveChanges();\r\n }\r\n}\r\n\r\nexport default ChannelHandler;\r\n","import _ from \"underscore\";\r\n\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricObject, IObjectDetail } from \"../../utils\";\r\nimport { TooltipRowDetail } from \"../tooltip/Row\";\r\nimport store from \"../../../../redux/store\";\r\n\r\nclass Row implements IObjectDetail {\r\n private handler: Handler;\r\n private targetSeat: FabricObject;\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n public onHover(event: any): any {\r\n if (event.target.superType === \"seat\") {\r\n if (event.e instanceof TouchEvent)\r\n this.handler.eventHandler.panning = false;\r\n\r\n const seat = event.target;\r\n if (this.targetSeat != seat) {\r\n this.onBlur();\r\n const seatCircle = seat.item(0);\r\n this.setTooltip(event, seat);\r\n if (seat.status == \"Free\" && seat.available) {\r\n seatCircle.set({\r\n fill: `${seatCircle.stroke}90`,\r\n radius: seatCircle.radius + 0.5,\r\n });\r\n }\r\n this.targetSeat = seat;\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n return this.onBlur;\r\n } else this.onBlur();\r\n }\r\n\r\n public async onChangeHub(valueHub: any): Promise {\r\n const {\r\n properties: { channels },\r\n } = store.getState();\r\n\r\n valueHub.seats.forEach((item: any) => {\r\n const seat = this.getSeatById(item.rowKey, item.seatKey);\r\n if (seat) {\r\n if (item.status == \"Free\" && (valueHub.channel.key == null || channels.includes(valueHub.channel.key))) {\r\n this.releaseInCanvas(seat);\r\n } else {\r\n this.holdInCanvas(seat, valueHub.channel.key == null ? item.status : \"NoForSale\", valueHub.selectorKey);\r\n }\r\n if (window.redseats.responseCallback)\r\n window.redseats.responseCallback();\r\n }\r\n });\r\n }\r\n\r\n private onBlur = () => {\r\n if (this.targetSeat) {\r\n this.handler.tooltipHandler.hide();\r\n if (this.targetSeat.status == \"Free\" && this.targetSeat.available) {\r\n const seatCircle = this.targetSeat.item(0);\r\n seatCircle.set({\r\n fill: `${seatCircle.stroke}40`,\r\n radius: seatCircle.radius - 0.5,\r\n });\r\n }\r\n this.handler.canvas.requestRenderAll();\r\n this.targetSeat = null;\r\n }\r\n };\r\n\r\n\r\n private async holdInCanvas(seat: any, status: string, selectorKey: string) {\r\n const selector = JSON.parse(sessionStorage.getItem(\"rs_selector\"));\r\n const isHoldByMe: boolean = selector.key == selectorKey;\r\n const {\r\n properties: { selection },\r\n } = store.getState();\r\n seat.set({\r\n status: status,\r\n isHoldByMe: isHoldByMe,\r\n });\r\n const seatCircle = seat.item(0);\r\n const seatText = seat.item(1);\r\n const seatIcon = seat.item(2);\r\n const seatIcon2 = seat.item(3);\r\n const colorFill = seat.statusColor[status];\r\n if (isHoldByMe) {\r\n let index = 0;\r\n selection.some((category, i) => {\r\n if (category.key === seat.category.key) {\r\n index = i\r\n }\r\n });\r\n seatCircle.set({\r\n fill: seatCircle.stroke,\r\n hoverCursor: \"pointer\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: false,\r\n });\r\n seatIcon.set({\r\n visible: true,\r\n fill: \"red\",\r\n });\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: false,\r\n });\r\n } else {\r\n seatCircle.set({\r\n fill: colorFill,\r\n stroke: \"#FFFFFF\",\r\n hoverCursor: \"default\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"default\",\r\n visible: true,\r\n });\r\n seatIcon.set({\r\n visible: false,\r\n });\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: false,\r\n });\r\n }\r\n\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n\r\n private async releaseInCanvas(seat: any) {\r\n const {\r\n properties: { selection },\r\n } = store.getState();\r\n seat.set({\r\n status: \"Free\",\r\n isHoldByMe: false,\r\n });\r\n const seatCircle = seat.item(0);\r\n const seatText = seat.item(1);\r\n const seatIcon = seat.item(2);\r\n const seatIcon2 = seat.item(3);\r\n let index = 0;\r\n selection.some((category, i) => {\r\n if (category.key === seat.category.key) {\r\n index = i\r\n }\r\n });\r\n seatCircle.set({\r\n fill: `${seat.statusColor.Free}40`,\r\n stroke: seat.statusColor.Free,\r\n hoverCursor: \"pointer\",\r\n });\r\n seatText.set({\r\n hoverCursor: \"pointer\",\r\n visible: !seatIcon2,\r\n });\r\n seatIcon.set({\r\n visible: false,\r\n });\r\n\r\n if (seatIcon2)\r\n seatIcon2.set({\r\n visible: true,\r\n });\r\n\r\n this.handler.canvas.requestRenderAll();\r\n }\r\n\r\n\r\n private getSeatById(rowKey: string, seatKey: string) {\r\n const objects = this.handler.canvas.getObjects();\r\n const seat = objects.find((s: any) => s.id == seatKey);\r\n return seat;\r\n }\r\n\r\n private setTooltip(event: any, seat: any) {\r\n const show = _.partial(this.handler.tooltipHandler.show, event.e);\r\n window.redseats.responseCallback = _.partial(\r\n this.showTooltip,\r\n show,\r\n seat,\r\n this,\r\n event\r\n );\r\n\r\n const seatCallback = this.createSeatCallback(seat);\r\n window.redseats.getTooltipInfo(seatCallback);\r\n }\r\n\r\n private showTooltip(\r\n show: any,\r\n seat: any,\r\n rowInstance: any,\r\n event: any,\r\n tooltipInfo: any\r\n ) {\r\n let onSelect;\r\n if (event.e instanceof TouchEvent)\r\n onSelect = () => rowInstance.onSelect(event);\r\n\r\n window.redseats.responseCallback = _.partial(\r\n window.redseats.responseCallback,\r\n tooltipInfo\r\n );\r\n\r\n const htmlElement = TooltipRowDetail(seat, tooltipInfo, onSelect);\r\n show(htmlElement);\r\n }\r\n\r\n private createSeatCallback(seat: any) {\r\n return {\r\n value: seat.value,\r\n status: seat.status,\r\n categoryKey: seat.category.key,\r\n category: seat.category.name,\r\n row: seat.rowLabel,\r\n seat: seat.label,\r\n section: seat.sectionLabel,\r\n };\r\n }\r\n}\r\nexport default Row;\r\n","import _ from \"underscore\";\r\n\r\nimport { Handler } from \"../../handlers\";\r\nimport { FabricEvent, FabricObject, IObjectSelector } from \"../../utils\";\r\n\r\nclass PolygonZone implements IObjectSelector {\r\n private handler: Handler;\r\n private targetSeat: FabricObject;\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n }\r\n\r\n public onMouseDblClick(event: FabricEvent) {\r\n\r\n }\r\n\r\n public onHover(event: any): any {\r\n }\r\n\r\n public async onSelect(event: any) {\r\n const {target} = event;\r\n const shape = target.item(0);\r\n const text = target.item(1);\r\n shape.set({visible: false});\r\n text.set({visible: false});\r\n this.handler.activeZoneSelector = target;\r\n this.handler.zoomHandler.zoomToCenterWithObject(target, null, false);\r\n }\r\n\r\n public async onChangeHub(valueHub: any): Promise {\r\n }\r\n}\r\n\r\nexport default PolygonZone;\r\n","import Handler from \"./Handler\";\r\nimport { Row } from \"../objects/detail\";\r\nimport { IObjectSelector, FabricEvent } from \"../utils\";\r\nimport { PolygonZone } from \"../objects/detail\";\r\n\r\nclass DetailHandler {\r\n private handler: any;\r\n private objectTypes: any;\r\n private object: IObjectSelector;\r\n public selectedType: string;\r\n\r\n private callBack: any;\r\n\r\n constructor(handler: Handler) {\r\n this.handler = handler;\r\n this.objectTypes = {\r\n row: new Row(handler),\r\n polygonZone: new PolygonZone(handler)\r\n };\r\n }\r\n\r\n public setType(type: string) {\r\n this.selectedType = type;\r\n this.object = this.objectTypes[type];\r\n }\r\n\r\n public onMousemove(event: FabricEvent) {\r\n if (event.target) {\r\n switch (event.target.superType) {\r\n case \"seat\":\r\n this.setType(\"row\");\r\n if (this.object) {\r\n this.callBack = this.object.onHover(event);\r\n } else this.onBlur();\r\n break;\r\n default:\r\n break;\r\n }\r\n }else{\r\n this.handler.detailHandler.onBlur();\r\n }\r\n }\r\n\r\n public onMousedown(event: FabricEvent) {\r\n console.log('onMOUSEDOWN', event.target)\r\n if (event.target) {\r\n const {target: {superType} } = event;\r\n switch (superType) {\r\n case \"seat\":\r\n this.setType(\"row\");\r\n console.log('ON MOUSE DOWN SEAT')\r\n if (this.object) {\r\n if (event.e instanceof TouchEvent)\r\n this.callBack = this.object.onHover(event);\r\n else return this.object.onSelect(event);\r\n }\r\n break;\r\n case \"polygonZone\":\r\n this.setType(superType)\r\n if (this.object) {\r\n this.object.onSelect(event);\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n public onChangeHub(valueHub: any) {\r\n if (this.object) {\r\n this.object.onChangeHub(valueHub);\r\n }\r\n }\r\n\r\n public onBlur() {\r\n if (this.callBack) {\r\n this.callBack();\r\n this.callBack = null;\r\n }\r\n }\r\n\r\n public onMouseOut(){\r\n this.handler.detailHandler.onBlur();\r\n }\r\n}\r\n\r\nexport default DetailHandler;\r\n","import { fabric } from 'fabric';\r\n\r\nimport {\r\n\tArrow,\r\n\tGif,\r\n\tChart,\r\n\tElement,\r\n\tIframe,\r\n\tVideo,\r\n\tNode,\r\n\tLink,\r\n\tCurvedLink,\r\n\tOrthogonalLink,\r\n\tLine,\r\n\tCube,\r\n} from './objects/fabric';\r\nimport { FabricObject } from './utils';\r\nimport { Code } from './objects/fabric/Element';\r\nimport Svg, { SvgOption } from './objects/fabric/Svg';\r\n\r\nexport interface ObjectSchema {\r\n\tcreate: (...option: any) => fabric.Object;\r\n}\r\n\r\nexport interface CanvasObjectSchema {\r\n\t[key: string]: ObjectSchema;\r\n}\r\n\r\nexport const createCanvasObject = (objectSchema: CanvasObjectSchema) => objectSchema;\r\n\r\nconst CanvasObject: CanvasObjectSchema = {\r\n\tgroup: {\r\n\t\tcreate: ({ objects, ...option }: { objects: FabricObject[] }) => new fabric.Group(objects, option),\r\n\t},\r\n\t'i-text': {\r\n\t\tcreate: ({ text, ...option }: { text: string }) => new fabric.IText(text, option),\r\n\t},\r\n\ttext: {\r\n\t\tcreate: ({ text, ...option }: { text: string }) => new fabric.Text(text, option),\r\n\t},\r\n\ttextbox: {\r\n\t\tcreate: ({ text, ...option }: { text: string }) => new fabric.Textbox(text, option),\r\n\t},\r\n\ttriangle: {\r\n\t\tcreate: (option: any) => new fabric.Triangle(option),\r\n\t},\r\n\tellipse: {\r\n\t\tcreate: (option: any) => new fabric.Ellipse(option),\r\n\t},\r\n\tcircle: {\r\n\t\tcreate: (option: any) => new fabric.Circle(option),\r\n\t},\r\n\trect: {\r\n\t\tcreate: (option: any) => new fabric.Rect(option),\r\n\t},\r\n\tcube: {\r\n\t\tcreate: (option: any) => new Cube(option),\r\n\t},\r\n\timage: {\r\n\t\tcreate: ({ element = new Image(), ...option }) =>\r\n\t\t\tnew fabric.Image(element, {\r\n\t\t\t\t...option,\r\n\t\t\t\tcrossOrigin: 'anonymous',\r\n\t\t\t}),\r\n\t},\r\n\tpolygon: {\r\n\t\tcreate: ({ points, ...option }: { points: any }) =>\r\n\t\t\tnew fabric.Polygon(points, {\r\n\t\t\t\t...option,\r\n\t\t\t\tperPixelTargetFind: true,\r\n\t\t\t}),\r\n\t},\r\n\tline: {\r\n\t\tcreate: ({ points, ...option }: { points: any }) => new Line(points, option),\r\n\t},\r\n\tarrow: {\r\n\t\tcreate: ({ points, ...option }: { points: any }) => new Arrow(points, option),\r\n\t},\r\n\tchart: {\r\n\t\tcreate: (option: any) =>\r\n\t\t\tnew Chart(\r\n\t\t\t\toption.chartOption || {\r\n\t\t\t\t\txAxis: {},\r\n\t\t\t\t\tyAxis: {},\r\n\t\t\t\t\tseries: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\ttype: 'line',\r\n\t\t\t\t\t\t\tdata: [\r\n\t\t\t\t\t\t\t\t[0, 1],\r\n\t\t\t\t\t\t\t\t[1, 2],\r\n\t\t\t\t\t\t\t\t[2, 3],\r\n\t\t\t\t\t\t\t\t[3, 4],\r\n\t\t\t\t\t\t\t],\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t],\r\n\t\t\t\t},\r\n\t\t\t\toption,\r\n\t\t\t),\r\n\t},\r\n\telement: {\r\n\t\tcreate: ({ code, ...option }: { code: Code }) => new Element(code, option),\r\n\t},\r\n\tiframe: {\r\n\t\tcreate: ({ src, ...option }: { src: string }) => new Iframe(src, option),\r\n\t},\r\n\tvideo: {\r\n\t\tcreate: ({ src, file, ...option }: { src: string; file: File }) => new Video(src || file, option),\r\n\t},\r\n\tgif: {\r\n\t\tcreate: (option: any) => new Gif(option),\r\n\t},\r\n\tnode: {\r\n\t\tcreate: (option: any) => new Node(option),\r\n\t},\r\n\tlink: {\r\n\t\tcreate: (fromNode, fromPort, toNode, toPort, option) => new Link(fromNode, fromPort, toNode, toPort, option),\r\n\t},\r\n\tcurvedLink: {\r\n\t\tcreate: (fromNode, fromPort, toNode, toPort, option) =>\r\n\t\t\tnew CurvedLink(fromNode, fromPort, toNode, toPort, option),\r\n\t},\r\n\torthogonalLink: {\r\n\t\tcreate: (fromNode, fromPort, toNode, toPort, option) =>\r\n\t\t\tnew OrthogonalLink(fromNode, fromPort, toNode, toPort, option),\r\n\t},\r\n\tsvg: {\r\n\t\tcreate: (option: SvgOption) => new Svg(option),\r\n\t},\r\n};\r\n\r\nexport default CanvasObject;\r\n","import { fabric } from \"fabric\";\r\nimport warning from \"warning\";\r\nimport { v4 } from \"uuid\";\r\nimport { union } from \"lodash\";\r\n\r\nimport {\r\n ElementHandler,\r\n ImageHandler,\r\n ChartHandler,\r\n CropHandler,\r\n AnimationHandler,\r\n ContextmenuHandler,\r\n TooltipHandler,\r\n ZoomHandler,\r\n WorkareaHandler,\r\n TransactionHandler,\r\n LinkHandler,\r\n AlignmentHandler,\r\n GuidelineHandler,\r\n GridHandler,\r\n PortHandler,\r\n NodeHandler,\r\n EventHandler,\r\n DrawingHandler,\r\n PreviewHandler,\r\n InteractionHandler,\r\n ShortcutHandler,\r\n SelectorHandler,\r\n BlockerHandler,\r\n ChannelHandler,\r\n DetailHandler,\r\n UpdateSeatQuantity,\r\n} from \".\";\r\n\r\nimport {\r\n FabricObject,\r\n FabricImage,\r\n WorkareaObject,\r\n WorkareaOption,\r\n InteractionMode,\r\n CustomObjectType,\r\n CanvasOption,\r\n GridOption,\r\n GuidelineOption,\r\n KeyEvent,\r\n FabricObjectOption,\r\n FabricElement,\r\n FabricCanvas,\r\n FabricGroup,\r\n FabricObjects,\r\n} from \"../utils\";\r\nimport CanvasObject from \"../CanvasObject\";\r\nimport { NodeObject } from \"../objects/fabric/Node\";\r\nimport { TransactionEvent } from \"./TransactionHandler\";\r\nimport { LinkObject } from \"../objects/fabric/Link\";\r\nimport { PortObject } from \"../objects/fabric/Port\";\r\nimport { LinkOption } from \"./LinkHandler\";\r\nimport { defaults } from \"../constants\";\r\nimport { clone } from \"underscore\";\r\n\r\nexport interface HandlerCallback {\r\n /**\r\n * When has been added object in Canvas, Called function\r\n *\r\n */\r\n onAdd?: (object: FabricObject) => void;\r\n /**\r\n * Return contextmenu element\r\n *\r\n */\r\n onContext?: (\r\n el: HTMLDivElement,\r\n e: React.MouseEvent,\r\n target?: FabricObject\r\n ) => Promise | any;\r\n /**\r\n * Return tooltip element\r\n *\r\n */\r\n onTooltip?: (target?: FabricObject) => Promise | any;\r\n /**\r\n * When zoom, Called function\r\n */\r\n onZoom?: (zoomRatio: number) => void;\r\n /**\r\n * When clicked object, Called function\r\n *\r\n */\r\n onClick?: (canvas: FabricCanvas, target: FabricObject) => void;\r\n /**\r\n * When double clicked object, Called function\r\n *\r\n */\r\n onDblClick?: (canvas: FabricCanvas, target: FabricObject) => void;\r\n /**\r\n * When modified object, Called function\r\n */\r\n onModified?: (target: FabricObject) => void;\r\n /**\r\n * When select object, Called function\r\n *\r\n */\r\n onSelect?: (target: FabricObject) => void;\r\n /**\r\n * When has been removed object in Canvas, Called function\r\n *\r\n */\r\n onRemove?: (target: FabricObject) => void;\r\n /**\r\n * When has been undo or redo, Called function\r\n *\r\n */\r\n onTransaction?: (transaction: TransactionEvent) => void;\r\n /**\r\n * When has been changed interaction mode, Called function\r\n *\r\n */\r\n onInteraction?: (interactionMode: InteractionMode) => void;\r\n /**\r\n * When canvas has been loaded\r\n *\r\n */\r\n onLoad?: (handler: Handler, canvas?: fabric.Canvas) => void;\r\n\r\n onZone?: (exited: boolean) => void;\r\n}\r\n\r\nexport interface HandlerOption {\r\n /**\r\n * Canvas id\r\n * @type {string}\r\n */\r\n id?: string;\r\n /**\r\n * Canvas object\r\n * @type {FabricCanvas}\r\n */\r\n canvas?: FabricCanvas;\r\n /**\r\n * Canvas parent element\r\n * @type {HTMLDivElement}\r\n */\r\n container?: HTMLDivElement;\r\n /**\r\n * Canvas editable\r\n * @type {boolean}\r\n */\r\n editable?: boolean;\r\n /**\r\n * Canvas interaction mode\r\n * @type {InteractionMode}\r\n */\r\n interactionMode?: InteractionMode;\r\n /**\r\n * Persist properties for object\r\n * @type {string[]}\r\n */\r\n propertiesToInclude?: string[];\r\n /**\r\n * Minimum zoom ratio\r\n * @type {number}\r\n */\r\n minZoom?: number;\r\n /**\r\n * Maximum zoom ratio\r\n * @type {number}\r\n */\r\n maxZoom?: number;\r\n /**\r\n * Workarea option\r\n * @type {WorkareaOption}\r\n */\r\n workareaOption?: WorkareaOption;\r\n /**\r\n * Canvas option\r\n * @type {CanvasOption}\r\n */\r\n canvasOption?: CanvasOption;\r\n /**\r\n * Grid option\r\n * @type {GridOption}\r\n */\r\n gridOption?: GridOption;\r\n /**\r\n * Default option for Fabric Object\r\n * @type {FabricObjectOption}\r\n */\r\n objectOption?: FabricObjectOption;\r\n /**\r\n * Guideline option\r\n * @type {GuidelineOption}\r\n */\r\n guidelineOption?: GuidelineOption;\r\n /**\r\n * Whether to use zoom\r\n * @type {boolean}\r\n */\r\n zoomEnabled?: boolean;\r\n /**\r\n * ActiveSelection option\r\n * @type {Partial>}\r\n */\r\n activeSelectionOption?: Partial>;\r\n /**\r\n * Canvas width\r\n * @type {number}\r\n */\r\n width?: number;\r\n /**\r\n * Canvas height\r\n * @type {number}\r\n */\r\n height?: number;\r\n /**\r\n * Keyboard event in Canvas\r\n * @type {KeyEvent}\r\n */\r\n keyEvent?: KeyEvent;\r\n /**\r\n * Append custom objects\r\n * @type {{ [key: string]: any }}\r\n */\r\n fabricObjects?: FabricObjects;\r\n [key: string]: any;\r\n}\r\n\r\nexport type HandlerOptions = HandlerOption & HandlerCallback;\r\n\r\n/**\r\n * Main handler for Canvas\r\n * @class Handler\r\n * @implements {HandlerOptions}\r\n */\r\nclass Handler implements HandlerOptions {\r\n public id: string;\r\n public canvas: FabricCanvas;\r\n public workarea: WorkareaObject;\r\n public container: HTMLDivElement;\r\n public editable: boolean;\r\n public enablePanning: boolean;\r\n public interactionMode: InteractionMode;\r\n public selectedObject: CustomObjectType;\r\n public minZoom: number;\r\n public maxZoom: number;\r\n public propertiesToInclude?: string[] = defaults.propertiesToInclude;\r\n public workareaOption?: WorkareaOption = defaults.workareaOption;\r\n public canvasOption?: CanvasOption = defaults.canvasOption;\r\n public gridOption?: GridOption = defaults.gridOption;\r\n public objectOption?: FabricObjectOption = defaults.objectOption;\r\n public guidelineOption?: GuidelineOption = defaults.guidelineOption;\r\n public keyEvent?: KeyEvent = defaults.keyEvent;\r\n public activeSelectionOption?: Partial<\r\n FabricObjectOption\r\n > = defaults.activeSelectionOption;\r\n public fabricObjects?: FabricObjects = CanvasObject;\r\n public zoomEnabled?: boolean;\r\n public canvasEnabled?: boolean;\r\n public width?: number;\r\n public height?: number;\r\n\r\n public onAdd?: (object: FabricObject) => void;\r\n public onContext?: (\r\n el: HTMLDivElement,\r\n e: React.MouseEvent,\r\n target?: FabricObject\r\n ) => Promise;\r\n public onTooltip?: (target?: FabricObject) => Promise;\r\n public onZoom?: (zoomRatio: number) => void;\r\n public onClick?: (canvas: FabricCanvas, target: FabricObject) => void;\r\n public onDblClick?: (canvas: FabricCanvas, target: FabricObject) => void;\r\n public onModified?: (target: FabricObject) => void;\r\n public onSelect?: (target: FabricObject) => void;\r\n public onRemove?: (target: FabricObject) => void;\r\n public onTransaction?: (transaction: TransactionEvent) => void;\r\n public onInteraction?: (interactionMode: InteractionMode) => void;\r\n public onLoad?: (handler: Handler, canvas?: fabric.Canvas) => void;\r\n public onZone?: (exited: boolean) => void;\r\n\r\n public imageHandler: ImageHandler;\r\n public chartHandler: ChartHandler;\r\n public elementHandler: ElementHandler;\r\n public cropHandler: CropHandler;\r\n public animationHandler: AnimationHandler;\r\n public contextmenuHandler: ContextmenuHandler;\r\n public tooltipHandler: TooltipHandler;\r\n public zoomHandler: ZoomHandler;\r\n public workareaHandler: WorkareaHandler;\r\n public interactionHandler: InteractionHandler;\r\n public transactionHandler: TransactionHandler;\r\n public gridHandler: GridHandler;\r\n public portHandler: PortHandler;\r\n public linkHandler: LinkHandler;\r\n public nodeHandler: NodeHandler;\r\n public alignmentHandler: AlignmentHandler;\r\n public guidelineHandler: GuidelineHandler;\r\n public eventHandler: EventHandler;\r\n public drawingHandler: DrawingHandler;\r\n public previewHandler: PreviewHandler;\r\n public shortcutHandler: ShortcutHandler;\r\n public selectorHandler: SelectorHandler;\r\n public blockerHandler: BlockerHandler;\r\n public channelHandler: ChannelHandler;\r\n public detailHandler: DetailHandler;\r\n public updateSeatQuantity: UpdateSeatQuantity;\r\n\r\n public objectMap: Record = {};\r\n public objects: FabricObject[];\r\n public activeLine?: any;\r\n public activeShape?: any;\r\n public isZoneActive?: boolean = false;\r\n public activeShapePolygon?: any;\r\n public activeZone?: any;\r\n public activeZoneSelector?: any;\r\n public zoom = 1;\r\n public selectedTarget?: FabricObject;\r\n public pointArray: any[];\r\n public lineArray: any[];\r\n public isCut = false;\r\n public isDown = false; ///\r\n public objText?: any; ///\r\n public objIcon?: any; ///\r\n public originPointer?: any; ///\r\n public seatQuantity = 0;\r\n public group?: FabricGroup; ///\r\n public rowGroup?: FabricGroup; ///\r\n public seatGroup?: FabricGroup; ///\r\n public previewGroup?: FabricGroup; ///\r\n private isRequsetAnimFrame = false;\r\n private requestFrame: any;\r\n /**\r\n * Copied object\r\n *\r\n * @private\r\n * @type {*}\r\n */\r\n private clipboard: any;\r\n\r\n constructor(options: HandlerOptions) {\r\n this.initialize(options);\r\n }\r\n\r\n /**\r\n * Initialize handler\r\n *\r\n * @author salgum1114\r\n * @param {HandlerOptions} options\r\n */\r\n public initialize(options: HandlerOptions) {\r\n this.initOption(options);\r\n this.initCallback(options);\r\n this.initHandler();\r\n }\r\n\r\n /**\r\n * Init class fields\r\n * @param {HandlerOptions} options\r\n */\r\n public initOption = (options: HandlerOptions) => {\r\n this.id = options.id;\r\n this.canvas = options.canvas;\r\n this.container = options.container;\r\n this.editable = options.editable;\r\n this.interactionMode = options.interactionMode;\r\n this.minZoom = options.minZoom;\r\n this.maxZoom = options.maxZoom;\r\n this.zoomEnabled = options.zoomEnabled;\r\n this.width = options.width;\r\n this.height = options.height;\r\n this.enablePanning = options.enablePanning;\r\n this.objects = [];\r\n this.setPropertiesToInclude(options.propertiesToInclude);\r\n this.setWorkareaOption(options.workareaOption);\r\n this.setCanvasOption(options.canvasOption);\r\n this.setGridOption(options.gridOption);\r\n this.setObjectOption(options.objectOption);\r\n this.setFabricObjects(options.fabricObjects);\r\n this.setGuidelineOption(options.guidelineOption);\r\n this.setActiveSelectionOption(options.activeSelectionOption);\r\n this.setKeyEvent(options.keyEvent);\r\n };\r\n\r\n /**\r\n * Initialize callback\r\n * @param {HandlerOptions} options\r\n */\r\n public initCallback = (options: HandlerOptions) => {\r\n this.onAdd = options.onAdd;\r\n this.onTooltip = options.onTooltip;\r\n this.onZoom = options.onZoom;\r\n this.onContext = options.onContext;\r\n this.onClick = options.onClick;\r\n this.onModified = options.onModified;\r\n this.onDblClick = options.onDblClick;\r\n this.onSelect = options.onSelect;\r\n this.onRemove = options.onRemove;\r\n this.onTransaction = options.onTransaction;\r\n this.onInteraction = options.onInteraction;\r\n this.onLoad = options.onLoad;\r\n this.onZone = options.onZone;\r\n };\r\n\r\n /**\r\n * Initialize handlers\r\n *\r\n */\r\n public initHandler = () => {\r\n this.workareaHandler = new WorkareaHandler(this);\r\n this.imageHandler = new ImageHandler(this);\r\n this.chartHandler = new ChartHandler(this);\r\n this.elementHandler = new ElementHandler(this);\r\n this.cropHandler = new CropHandler(this);\r\n this.animationHandler = new AnimationHandler(this);\r\n this.contextmenuHandler = new ContextmenuHandler(this);\r\n this.tooltipHandler = new TooltipHandler(this);\r\n this.zoomHandler = new ZoomHandler(this);\r\n this.interactionHandler = new InteractionHandler(this);\r\n this.transactionHandler = new TransactionHandler(this);\r\n this.gridHandler = new GridHandler(this);\r\n this.portHandler = new PortHandler(this);\r\n this.linkHandler = new LinkHandler(this);\r\n this.nodeHandler = new NodeHandler(this);\r\n this.alignmentHandler = new AlignmentHandler(this);\r\n this.guidelineHandler = new GuidelineHandler(this);\r\n this.eventHandler = new EventHandler(this);\r\n this.drawingHandler = new DrawingHandler(this);\r\n this.previewHandler = new PreviewHandler(this);\r\n this.shortcutHandler = new ShortcutHandler(this);\r\n this.selectorHandler = new SelectorHandler(this);\r\n this.blockerHandler = new BlockerHandler(this);\r\n this.channelHandler = new ChannelHandler(this);\r\n this.detailHandler = new DetailHandler(this);\r\n this.updateSeatQuantity = new UpdateSeatQuantity(this); ///\r\n };\r\n\r\n /**\r\n * Get primary object\r\n * @returns {FabricObject[]}\r\n */\r\n public getObjects = (): FabricObject[] => {\r\n const objects = this.canvas.getObjects().filter((obj: FabricObject) => {\r\n if (obj.id === \"workarea\") {\r\n return false;\r\n } else if (obj.id === \"grid\") {\r\n return false;\r\n } else if (obj.superType === \"port\") {\r\n return false;\r\n } else if (!obj.id) {\r\n return false;\r\n }\r\n return true;\r\n }) as FabricObject[];\r\n if (objects.length) {\r\n objects.forEach((obj) => (this.objectMap[obj.id] = obj));\r\n } else {\r\n this.objectMap = {};\r\n }\r\n return objects;\r\n };\r\n\r\n /**\r\n * Set key pair\r\n * @param {keyof FabricObject} key\r\n * @param {*} value\r\n * @returns\r\n */\r\n public set = (key: keyof FabricObject, value: any) => {\r\n const activeObject = this.canvas.getActiveObject() as any;\r\n if (!activeObject) {\r\n return;\r\n }\r\n activeObject.set(key, value);\r\n activeObject.setCoords();\r\n this.canvas.requestRenderAll();\r\n const { id, superType, type, player, width, height } = activeObject as any;\r\n if (superType === \"element\") {\r\n if (key === \"visible\") {\r\n if (value) {\r\n activeObject.element.style.display = \"block\";\r\n } else {\r\n activeObject.element.style.display = \"none\";\r\n }\r\n }\r\n const el = this.elementHandler.findById(id);\r\n // update the element\r\n this.elementHandler.setScaleOrAngle(el, activeObject);\r\n this.elementHandler.setSize(el, activeObject);\r\n this.elementHandler.setPosition(el, activeObject);\r\n if (type === \"video\" && player) {\r\n player.setPlayerSize(width, height);\r\n }\r\n }\r\n const { onModified } = this;\r\n if (onModified) {\r\n onModified(activeObject);\r\n }\r\n };\r\n\r\n /**\r\n * Set option\r\n * @param {Partial} option\r\n * @returns\r\n */\r\n public setObject = (option: Partial) => {\r\n const activeObject = this.canvas.getActiveObject() as any;\r\n if (!activeObject) {\r\n return;\r\n }\r\n Object.keys(option).forEach((key) => {\r\n if (option[key] !== activeObject[key]) {\r\n activeObject.set(key, option[key]);\r\n activeObject.setCoords();\r\n }\r\n });\r\n this.canvas.requestRenderAll();\r\n const { id, superType, type, player, width, height } = activeObject;\r\n if (superType === \"element\") {\r\n if (\"visible\" in option) {\r\n if (option.visible) {\r\n activeObject.element.style.display = \"block\";\r\n } else {\r\n activeObject.element.style.display = \"none\";\r\n }\r\n }\r\n const el = this.elementHandler.findById(id);\r\n // update the element\r\n this.elementHandler.setScaleOrAngle(el, activeObject);\r\n this.elementHandler.setSize(el, activeObject);\r\n this.elementHandler.setPosition(el, activeObject);\r\n if (type === \"video\" && player) {\r\n player.setPlayerSize(width, height);\r\n }\r\n }\r\n const { onModified } = this;\r\n if (onModified) {\r\n onModified(activeObject);\r\n }\r\n };\r\n\r\n /**\r\n * Set key pair by object\r\n * @param {FabricObject} obj\r\n * @param {string} key\r\n * @param {*} value\r\n * @returns\r\n */\r\n public setByObject = (obj: any, key: string, value: any) => {\r\n if (!obj) {\r\n return;\r\n }\r\n obj.set(key, value);\r\n obj.setCoords();\r\n this.canvas.renderAll();\r\n const { id, superType, type, player, width, height } = obj as any;\r\n if (superType === \"element\") {\r\n if (key === \"visible\") {\r\n if (value) {\r\n obj.element.style.display = \"block\";\r\n } else {\r\n obj.element.style.display = \"none\";\r\n }\r\n }\r\n const el = this.elementHandler.findById(id);\r\n // update the element\r\n this.elementHandler.setScaleOrAngle(el, obj);\r\n this.elementHandler.setSize(el, obj);\r\n this.elementHandler.setPosition(el, obj);\r\n if (type === \"video\" && player) {\r\n player.setPlayerSize(width, height);\r\n }\r\n }\r\n const { onModified } = this;\r\n if (onModified) {\r\n onModified(obj);\r\n }\r\n };\r\n\r\n /**\r\n * Set key pair by id\r\n * @param {string} id\r\n * @param {string} key\r\n * @param {*} value\r\n */\r\n public setById = (id: string, key: string, value: any) => {\r\n const findObject = this.findById(id);\r\n this.setByObject(findObject, key, value);\r\n };\r\n\r\n /**\r\n * Set partial by object\r\n * @param {FabricObject} obj\r\n * @param {FabricObjectOption} option\r\n * @returns\r\n */\r\n public setByPartial = (obj: FabricObject, option: FabricObjectOption) => {\r\n if (!obj) {\r\n return;\r\n }\r\n obj.set(option);\r\n obj.setCoords();\r\n this.canvas.renderAll();\r\n const { id, superType, type, player, width, height } = obj as any;\r\n if (superType === \"element\") {\r\n if (\"visible\" in option) {\r\n if (option.visible) {\r\n obj.element.style.display = \"block\";\r\n } else {\r\n obj.element.style.display = \"none\";\r\n }\r\n }\r\n const el = this.elementHandler.findById(id);\r\n // update the element\r\n this.elementHandler.setScaleOrAngle(el, obj);\r\n this.elementHandler.setSize(el, obj);\r\n this.elementHandler.setPosition(el, obj);\r\n if (type === \"video\" && player) {\r\n player.setPlayerSize(width, height);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Set shadow\r\n * @param {fabric.Shadow} option\r\n * @returns\r\n */\r\n public setShadow = (option: fabric.IShadowOptions) => {\r\n const activeObject = this.canvas.getActiveObject() as FabricObject;\r\n if (!activeObject) {\r\n return;\r\n }\r\n activeObject.setShadow(option as fabric.Shadow);\r\n this.canvas.requestRenderAll();\r\n const { onModified } = this;\r\n if (onModified) {\r\n onModified(activeObject);\r\n }\r\n };\r\n\r\n /**\r\n * Set the image\r\n * @param {FabricImage} obj\r\n * @param {(File | string)} [source]\r\n * @returns\r\n */\r\n public setImage = (obj: FabricImage, source?: File | string) => {\r\n if (!source) {\r\n this.loadImage(obj, null);\r\n obj.set(\"file\", null);\r\n obj.set(\"src\", null);\r\n return;\r\n }\r\n if (source instanceof File) {\r\n const reader = new FileReader();\r\n reader.onload = () => {\r\n this.loadImage(obj, reader.result as string);\r\n obj.set(\"file\", source);\r\n obj.set(\"src\", null);\r\n };\r\n reader.readAsDataURL(source);\r\n } else {\r\n this.loadImage(obj, source);\r\n obj.set(\"file\", null);\r\n obj.set(\"src\", source);\r\n }\r\n };\r\n\r\n /**\r\n * Set image by id\r\n * @param {string} id\r\n * @param {*} source\r\n */\r\n public setImageById = (id: string, source: any) => {\r\n const findObject = this.findById(id) as FabricImage;\r\n this.setImage(findObject, source);\r\n };\r\n\r\n /**\r\n * Set visible\r\n * @param {boolean} [visible]\r\n * @returns\r\n */\r\n public setVisible = (visible?: boolean) => {\r\n const activeObject = this.canvas.getActiveObject() as FabricElement;\r\n if (!activeObject) {\r\n return;\r\n }\r\n if (activeObject.superType === \"element\") {\r\n if (visible) {\r\n activeObject.element.style.display = \"block\";\r\n } else {\r\n activeObject.element.style.display = \"none\";\r\n }\r\n }\r\n activeObject.set({\r\n visible,\r\n });\r\n this.canvas.renderAll();\r\n };\r\n\r\n /**\r\n * Set the position on Object\r\n *\r\n * @param {FabricObject} obj\r\n * @param {boolean} [centered]\r\n */\r\n public centerObject = (obj: FabricObject, centered?: boolean) => {\r\n if (centered) {\r\n this.canvas.centerObject(obj);\r\n obj.setCoords();\r\n } else {\r\n this.setByPartial(obj, {\r\n left:\r\n obj.left / this.canvas.getZoom() -\r\n obj.width / 2 -\r\n this.canvas.viewportTransform[4] / this.canvas.getZoom(),\r\n top:\r\n obj.top / this.canvas.getZoom() -\r\n obj.height / 2 -\r\n this.canvas.viewportTransform[5] / this.canvas.getZoom(),\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Add object\r\n * @param {FabricObjectOption} obj\r\n * @param {boolean} [centered=true]\r\n * @param {boolean} [loaded=false]\r\n * @returns\r\n */\r\n public add = (\r\n obj: FabricObjectOption,\r\n centered = true,\r\n loaded = false,\r\n isSubtarget = false\r\n ) => {\r\n const { editable, onAdd, gridOption, objectOption } = this;\r\n const option: any = {\r\n hasControls: editable,\r\n hasBorders: editable,\r\n selectable: editable,\r\n lockMovementX: !editable,\r\n lockMovementY: !editable,\r\n hoverCursor: !editable ? obj.hoverCursor ?? \"default\" : \"move\",\r\n };\r\n\r\n if (obj.type === \"i-text\") {\r\n option.editable = false;\r\n } else {\r\n option.editable = editable;\r\n }\r\n if (editable && this.workarea.layout === \"fullscreen\") {\r\n option.scaleX = this.workarea.scaleX;\r\n option.scaleY = this.workarea.scaleY;\r\n }\r\n const newOption = Object.assign(\r\n {},\r\n objectOption,\r\n obj,\r\n {\r\n container: this.container.id,\r\n editable,\r\n },\r\n option\r\n );\r\n\r\n let createdObj: any;\r\n // Create canvas object\r\n if (obj.type === \"image\") {\r\n createdObj = this.addImage(newOption);\r\n } else if (obj.type === \"group\") {\r\n const objects = this.addGroup(newOption, centered, loaded);\r\n const groupOption = Object.assign({}, newOption, {\r\n objects,\r\n name: \"New Group\",\r\n });\r\n createdObj = this.fabricObjects[obj.type].create(groupOption);\r\n } else {\r\n createdObj = this.fabricObjects[obj.type].create(newOption);\r\n }\r\n\r\n if (!isSubtarget) {\r\n this.canvas.add(createdObj);\r\n if (!editable && !(obj.superType === \"element\")) {\r\n createdObj.on(\"mousedown\", this.eventHandler.object.mousedown);\r\n }\r\n if (createdObj.dblclick) {\r\n createdObj.on(\"mousedblclick\", this.eventHandler.object.mousedblclick);\r\n }\r\n }\r\n\r\n this.objects = this.getObjects();\r\n if (this.objects.some((object) => object.type === \"gif\")) {\r\n this.startRequestAnimFrame();\r\n } else {\r\n this.stopRequestAnimFrame();\r\n }\r\n if (createdObj.superType === \"node\") {\r\n this.portHandler.create(createdObj as NodeObject);\r\n if (createdObj.iconButton) {\r\n this.canvas.add(createdObj.iconButton);\r\n }\r\n }\r\n if (!editable && createdObj.animation && createdObj.animation.autoplay) {\r\n this.animationHandler.play(createdObj.id);\r\n }\r\n if (createdObj.superType === \"node\") {\r\n createdObj.setShadow({\r\n color: createdObj.stroke,\r\n } as fabric.Shadow);\r\n }\r\n\r\n if (createdObj.type === \"svg\" || createdObj.superType === \"svg\") {\r\n if (createdObj._objects.length) {\r\n createdObj._objects.forEach((object: any) => {\r\n object.set({ fill: createdObj.fill })\r\n });\r\n }\r\n }\r\n\r\n if (gridOption.enabled) {\r\n this.gridHandler.setCoords(createdObj);\r\n }\r\n if (!this.transactionHandler.active && !loaded) {\r\n this.transactionHandler.save(\"add\");\r\n }\r\n if (onAdd && editable && !loaded) {\r\n onAdd(createdObj);\r\n }\r\n\r\n return createdObj;\r\n };\r\n\r\n /**\r\n * Add group object\r\n *\r\n * @param {FabricGroup} obj\r\n * @param {boolean} [centered=true]\r\n * @param {boolean} [loaded=false]\r\n * @returns\r\n */\r\n public addGroup = (obj: FabricGroup, centered = true, loaded = false) => {\r\n return obj.objects.map((child) => {\r\n return this.add(child, centered, loaded, true);\r\n });\r\n };\r\n\r\n /**\r\n * Add iamge object\r\n * @param {FabricImage} obj\r\n * @returns\r\n */\r\n public addImage = (obj: FabricImage) => {\r\n const { objectOption } = this;\r\n const { filters = [], ...otherOption } = obj;\r\n const image = new Image();\r\n if (obj.src) {\r\n image.src = obj.src;\r\n }\r\n const createdObj = new fabric.Image(image, {\r\n ...objectOption,\r\n ...otherOption,\r\n }) as FabricImage;\r\n createdObj.set({\r\n filters: this.imageHandler.createFilters(filters),\r\n });\r\n this.setImage(createdObj, obj.src || obj.file);\r\n return createdObj;\r\n };\r\n\r\n /**\r\n * Remove object\r\n * @param {FabricObject} target\r\n * @returns {any}\r\n */\r\n public remove = (target?: FabricObject) => {\r\n const activeObject = target || (this.canvas.getActiveObject() as any);\r\n if (this.selectedTarget && this.selectedTarget.superType === \"link\") {\r\n this.linkHandler.remove(this.selectedTarget as LinkObject);\r\n if (!this.transactionHandler.active) {\r\n this.transactionHandler.save(\"remove\");\r\n }\r\n return;\r\n }\r\n if (!activeObject) {\r\n return;\r\n }\r\n if (\r\n typeof activeObject.deletable !== \"undefined\" &&\r\n !activeObject.deletable\r\n ) {\r\n return;\r\n }\r\n if (activeObject.type !== \"activeSelection\") {\r\n this.canvas.discardActiveObject();\r\n if (activeObject.superType === \"element\") {\r\n this.elementHandler.removeById(activeObject.id);\r\n }\r\n if (activeObject.superType === \"link\") {\r\n this.linkHandler.remove(activeObject);\r\n } else if (activeObject.superType === \"node\") {\r\n if (activeObject.toPort) {\r\n if (activeObject.toPort.links.length) {\r\n activeObject.toPort.links.forEach((link: any) => {\r\n this.linkHandler.remove(link, \"from\");\r\n });\r\n }\r\n this.canvas.remove(activeObject.toPort);\r\n }\r\n if (activeObject.fromPort && activeObject.fromPort.length) {\r\n activeObject.fromPort.forEach((port: any) => {\r\n if (port.links.length) {\r\n port.links.forEach((link: any) => {\r\n this.linkHandler.remove(link, \"to\");\r\n });\r\n }\r\n this.canvas.remove(port);\r\n });\r\n }\r\n }\r\n this.canvas.remove(activeObject);\r\n } else {\r\n const { _objects: activeObjects } = activeObject;\r\n const existDeleted = activeObjects.some(\r\n (obj: any) => typeof obj.deletable !== \"undefined\" && !obj.deletable\r\n );\r\n if (existDeleted) {\r\n return;\r\n }\r\n this.canvas.discardActiveObject();\r\n activeObjects.forEach((obj: any) => {\r\n if (obj.superType === \"element\") {\r\n this.elementHandler.removeById(obj.id);\r\n } else if (obj.superType === \"node\") {\r\n if (obj.toPort) {\r\n if (obj.toPort.links.length) {\r\n obj.toPort.links.forEach((link: any) => {\r\n this.linkHandler.remove(link, \"from\");\r\n });\r\n }\r\n this.canvas.remove(obj.toPort);\r\n }\r\n if (obj.fromPort && obj.fromPort.length) {\r\n obj.fromPort.forEach((port: any) => {\r\n if (port.links.length) {\r\n port.links.forEach((link: any) => {\r\n this.linkHandler.remove(link, \"to\");\r\n });\r\n }\r\n this.canvas.remove(port);\r\n });\r\n }\r\n }\r\n this.canvas.remove(obj);\r\n });\r\n }\r\n if (!this.transactionHandler.active) {\r\n this.transactionHandler.save(\"remove\");\r\n }\r\n this.objects = this.getObjects();\r\n const { onRemove } = this;\r\n if (onRemove) {\r\n onRemove(activeObject);\r\n }\r\n };\r\n\r\n /**\r\n * Remove object by id\r\n * @param {string} id\r\n */\r\n public removeById = (id: string) => {\r\n const findObject = this.findById(id);\r\n if (findObject) {\r\n this.remove(findObject);\r\n }\r\n };\r\n\r\n /**\r\n * Delete at origin object list\r\n * @param {string} id\r\n */\r\n public removeOriginById = (id: string) => {\r\n const object = this.findOriginByIdWithIndex(id);\r\n if (object.index > 0) {\r\n this.objects.splice(object.index, 1);\r\n }\r\n };\r\n\r\n /**\r\n * Duplicate object\r\n * @returns\r\n */\r\n public duplicate = () => {\r\n const {\r\n onAdd,\r\n propertiesToInclude,\r\n gridOption: { grid = 10 },\r\n } = this;\r\n const activeObject = this.canvas.getActiveObject() as FabricObject;\r\n if (!activeObject) {\r\n return;\r\n }\r\n if (\r\n typeof activeObject.cloneable !== \"undefined\" &&\r\n !activeObject.cloneable\r\n ) {\r\n return;\r\n }\r\n activeObject.clone((clonedObj: FabricObject) => {\r\n this.canvas.discardActiveObject();\r\n clonedObj.set({\r\n left: clonedObj.left + grid,\r\n top: clonedObj.top + grid,\r\n evented: true,\r\n });\r\n\r\n if (clonedObj.type === \"activeSelection\") {\r\n const activeSelection = clonedObj as fabric.ActiveSelection;\r\n activeSelection.canvas = this.canvas;\r\n activeSelection.forEachObject((obj: any) => {\r\n obj.set(\"id\", v4());\r\n if (obj.type == \"group\") {\r\n obj._objects.map((o: any) => {\r\n o.set(\"id\", v4());\r\n return o;\r\n });\r\n }\r\n this.canvas.add(obj);\r\n this.objects = this.getObjects();\r\n if (obj.dblclick) {\r\n obj.on(\"mousedblclick\", this.eventHandler.object.mousedblclick);\r\n }\r\n });\r\n if (onAdd) {\r\n onAdd(activeSelection);\r\n }\r\n activeSelection.setCoords();\r\n } else {\r\n if (activeObject.id === clonedObj.id) {\r\n clonedObj.set(\"id\", v4());\r\n\r\n if (clonedObj.type == \"group\") {\r\n clonedObj._objects.map((obj: any) => {\r\n obj.set(\"id\", v4());\r\n return obj;\r\n });\r\n }\r\n }\r\n\r\n this.canvas.add(clonedObj);\r\n this.objects = this.getObjects();\r\n if (clonedObj.dblclick) {\r\n clonedObj.on(\"mousedblclick\", this.eventHandler.object.mousedblclick);\r\n }\r\n if (onAdd) {\r\n onAdd(clonedObj);\r\n }\r\n }\r\n this.canvas.setActiveObject(clonedObj);\r\n this.portHandler.create(clonedObj as NodeObject);\r\n this.canvas.requestRenderAll();\r\n }, propertiesToInclude);\r\n };\r\n\r\n /**\r\n * Duplicate object by id\r\n * @param {string} id\r\n * @returns\r\n */\r\n public duplicateById = (id: string) => {\r\n const {\r\n onAdd,\r\n propertiesToInclude,\r\n gridOption: { grid = 10 },\r\n } = this;\r\n const findObject = this.findById(id);\r\n if (findObject) {\r\n if (\r\n typeof findObject.cloneable !== \"undefined\" &&\r\n !findObject.cloneable\r\n ) {\r\n return false;\r\n }\r\n findObject.clone((cloned: FabricObject) => {\r\n cloned.set({\r\n left: cloned.left + grid,\r\n top: cloned.top + grid,\r\n id: v4(),\r\n evented: true,\r\n });\r\n this.canvas.add(cloned);\r\n this.objects = this.getObjects();\r\n if (onAdd) {\r\n onAdd(cloned);\r\n }\r\n if (cloned.dblclick) {\r\n cloned.on(\"mousedblclick\", this.eventHandler.object.mousedblclick);\r\n }\r\n this.canvas.setActiveObject(cloned);\r\n this.portHandler.create(cloned as NodeObject);\r\n this.canvas.requestRenderAll();\r\n }, propertiesToInclude);\r\n }\r\n return true;\r\n };\r\n\r\n /**\r\n * Cut object\r\n *\r\n */\r\n public cut = () => {\r\n this.copy();\r\n this.remove();\r\n this.isCut = true;\r\n };\r\n\r\n /**\r\n * Copy to clipboard\r\n *\r\n * @param {*} value\r\n */\r\n public copyToClipboard = (value: any) => {\r\n const textarea = document.createElement(\"textarea\");\r\n document.body.appendChild(textarea);\r\n textarea.value = value;\r\n textarea.select();\r\n document.execCommand(\"copy\");\r\n document.body.removeChild(textarea);\r\n this.canvas.wrapperEl.focus();\r\n };\r\n\r\n /**\r\n * Copy object\r\n *\r\n * @returns\r\n */\r\n public copy = () => {\r\n const { propertiesToInclude } = this;\r\n const activeObject = this.canvas.getActiveObject() as FabricObject;\r\n if (activeObject && activeObject.superType === \"link\") {\r\n return false;\r\n }\r\n if (activeObject) {\r\n if (\r\n typeof activeObject.cloneable !== \"undefined\" &&\r\n !activeObject.cloneable\r\n ) {\r\n return false;\r\n }\r\n if (activeObject.type === \"activeSelection\") {\r\n const activeSelection = activeObject as fabric.ActiveSelection;\r\n if (\r\n activeSelection\r\n .getObjects()\r\n .some((obj: any) => obj.superType === \"node\")\r\n ) {\r\n if (this.keyEvent.clipboard) {\r\n const links = [] as any[];\r\n const objects = activeSelection\r\n .getObjects()\r\n .map((obj: any, index: number) => {\r\n if (typeof obj.cloneable !== \"undefined\" && !obj.cloneable) {\r\n return null;\r\n }\r\n if (obj.fromPort.length) {\r\n obj.fromPort.forEach((port: any) => {\r\n if (port.links.length) {\r\n port.links.forEach((link: any) => {\r\n const linkTarget = {\r\n fromNodeIndex: index,\r\n fromPortId: port.id,\r\n type: \"curvedLink\",\r\n superType: \"link\",\r\n } as any;\r\n const findIndex = activeSelection\r\n .getObjects()\r\n .findIndex(\r\n (compObj: any) => compObj.id === link.toNode.id\r\n );\r\n if (findIndex >= 0) {\r\n linkTarget.toNodeIndex = findIndex;\r\n links.push(linkTarget);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n return {\r\n name: obj.name,\r\n description: obj.description,\r\n superType: obj.superType,\r\n type: obj.type,\r\n nodeClazz: obj.nodeClazz,\r\n configuration: obj.configuration,\r\n properties: {\r\n left:\r\n activeObject.left + activeObject.width / 2 + obj.left ||\r\n 0,\r\n top:\r\n activeObject.top + activeObject.height / 2 + obj.top || 0,\r\n iconName: obj.descriptor.icon,\r\n },\r\n };\r\n });\r\n this.copyToClipboard(\r\n JSON.stringify(objects.concat(links), null, \"\\t\")\r\n );\r\n return true;\r\n }\r\n this.clipboard = activeObject;\r\n return true;\r\n }\r\n }\r\n activeObject.clone((cloned: FabricObject) => {\r\n if (this.keyEvent.clipboard) {\r\n if (cloned.superType === \"node\") {\r\n const node = {\r\n name: cloned.name,\r\n description: cloned.description,\r\n superType: cloned.superType,\r\n type: cloned.type,\r\n nodeClazz: cloned.nodeClazz,\r\n configuration: cloned.configuration,\r\n properties: {\r\n left: cloned.left || 0,\r\n top: cloned.top || 0,\r\n iconName: cloned.descriptor.icon,\r\n },\r\n };\r\n const objects = [node];\r\n this.copyToClipboard(JSON.stringify(objects, null, \"\\t\"));\r\n } else {\r\n this.copyToClipboard(\r\n JSON.stringify(cloned.toObject(propertiesToInclude), null, \"\\t\")\r\n );\r\n }\r\n } else {\r\n this.clipboard = cloned;\r\n }\r\n }, propertiesToInclude);\r\n }\r\n return true;\r\n };\r\n\r\n /**\r\n * Paste object\r\n *\r\n * @returns\r\n */\r\n public paste = () => {\r\n const {\r\n onAdd,\r\n propertiesToInclude,\r\n gridOption: { grid = 10 },\r\n clipboard,\r\n isCut,\r\n } = this;\r\n const padding = isCut ? 0 : grid;\r\n if (!clipboard) {\r\n return false;\r\n }\r\n if (typeof clipboard.cloneable !== \"undefined\" && !clipboard.cloneable) {\r\n return false;\r\n }\r\n this.isCut = false;\r\n if (clipboard.type === \"activeSelection\") {\r\n if (clipboard.getObjects().some((obj: any) => obj.superType === \"node\")) {\r\n this.canvas.discardActiveObject();\r\n const objects = [] as any[];\r\n const linkObjects = [] as LinkOption[];\r\n clipboard.getObjects().forEach((obj: any) => {\r\n if (typeof obj.cloneable !== \"undefined\" && !obj.cloneable) {\r\n return;\r\n }\r\n const clonedObj = obj.duplicate();\r\n if (clonedObj.type === \"SwitchNode\") {\r\n clonedObj.set({\r\n left: obj.left + padding + padding,\r\n top: obj.top + padding,\r\n });\r\n } else {\r\n clonedObj.set({\r\n left: obj.left + padding,\r\n top: obj.top + padding,\r\n });\r\n }\r\n if (obj.fromPort.length) {\r\n obj.fromPort.forEach((port: PortObject) => {\r\n if (port.links.length) {\r\n port.links.forEach((link: LinkObject) => {\r\n const linkTarget = {\r\n fromNode: clonedObj.id,\r\n fromPort: port.id,\r\n } as any;\r\n const findIndex = clipboard\r\n .getObjects()\r\n .findIndex((compObj: any) => compObj.id === link.toNode.id);\r\n if (findIndex >= 0) {\r\n linkTarget.toNodeIndex = findIndex;\r\n linkObjects.push(linkTarget);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n if (clonedObj.dblclick) {\r\n clonedObj.on(\r\n \"mousedblclick\",\r\n this.eventHandler.object.mousedblclick\r\n );\r\n }\r\n this.canvas.add(clonedObj);\r\n this.objects = this.getObjects();\r\n this.portHandler.create(clonedObj);\r\n objects.push(clonedObj);\r\n });\r\n if (linkObjects.length) {\r\n linkObjects.forEach((linkObject: any) => {\r\n const { fromNode, fromPort, toNodeIndex } = linkObject;\r\n const toNode = objects[toNodeIndex];\r\n const link = {\r\n type: \"curvedLink\",\r\n fromNodeId: fromNode,\r\n fromPortId: fromPort,\r\n toNodeId: toNode.id,\r\n toPortId: toNode.toPort.id,\r\n };\r\n this.linkHandler.create(link);\r\n });\r\n }\r\n const activeSelection = new fabric.ActiveSelection(objects, {\r\n canvas: this.canvas,\r\n ...this.activeSelectionOption,\r\n });\r\n if (isCut) {\r\n this.clipboard = null;\r\n } else {\r\n this.clipboard = activeSelection;\r\n }\r\n if (!this.transactionHandler.active) {\r\n this.transactionHandler.save(\"paste\");\r\n }\r\n this.canvas.setActiveObject(activeSelection);\r\n this.drawingHandler.setType(\"activeSelection\")\r\n this.canvas.renderAll();\r\n return true;\r\n }\r\n }\r\n clipboard.clone((clonedObj: any) => {\r\n this.canvas.discardActiveObject();\r\n clonedObj.set({\r\n left: clonedObj.left + padding,\r\n top: clonedObj.top + padding,\r\n id: isCut ? clipboard.id : v4(),\r\n evented: true,\r\n });\r\n if (clonedObj.type === \"activeSelection\") {\r\n clonedObj.canvas = this.canvas;\r\n clonedObj.forEachObject((obj: any) => {\r\n obj.set(\"id\", isCut ? obj.id : v4());\r\n if (!isCut && obj.type == \"group\") {\r\n obj._objects.map((o: any) => {\r\n o.set(\"id\", v4());\r\n return o;\r\n });\r\n }\r\n this.canvas.add(obj);\r\n if (obj.dblclick) {\r\n obj.on(\"mousedblclick\", this.eventHandler.object.mousedblclick);\r\n }\r\n });\r\n } else {\r\n if (clonedObj.superType === \"node\") {\r\n clonedObj = clonedObj.duplicate();\r\n }\r\n if (!isCut && clonedObj.type == \"group\") {\r\n clonedObj._objects.map((o: any) => {\r\n o.set(\"id\", v4());\r\n return o;\r\n });\r\n }\r\n this.canvas.add(clonedObj);\r\n if (clonedObj.dblclick) {\r\n clonedObj.on(\"mousedblclick\", this.eventHandler.object.mousedblclick);\r\n }\r\n }\r\n const newClipboard = clipboard.set({\r\n top: clonedObj.top,\r\n left: clonedObj.left,\r\n });\r\n if (isCut) {\r\n this.clipboard = null;\r\n } else {\r\n this.clipboard = newClipboard;\r\n }\r\n if (clonedObj.superType === \"node\") {\r\n this.portHandler.create(clonedObj);\r\n }\r\n if (!this.transactionHandler.active) {\r\n this.transactionHandler.save(\"paste\");\r\n }\r\n // TODO...\r\n // After toGroup svg elements not rendered.\r\n this.objects = this.getObjects();\r\n if (onAdd) {\r\n onAdd(clonedObj);\r\n }\r\n clonedObj.setCoords();\r\n this.canvas.setActiveObject(clonedObj);\r\n if (clonedObj.type === \"activeSelection\") {\r\n this.drawingHandler.setType(\"activeSelection\")\r\n }\r\n this.canvas.requestRenderAll();\r\n }, propertiesToInclude);\r\n return true;\r\n };\r\n\r\n /**\r\n * Load the image\r\n * @param {FabricImage} obj\r\n * @param {string} src\r\n */\r\n public loadImage = (obj: FabricImage, src: string) => {\r\n let url = src;\r\n if (!url) {\r\n url = \"./images/sample/transparentBg.png\";\r\n }\r\n fabric.util.loadImage(url, (source) => {\r\n if (obj.type !== \"image\") {\r\n obj.setPatternFill(\r\n {\r\n source,\r\n repeat: \"repeat\",\r\n },\r\n null\r\n );\r\n obj.setCoords();\r\n this.canvas.renderAll();\r\n return;\r\n }\r\n obj.setElement(source);\r\n obj.setCoords();\r\n this.canvas.renderAll();\r\n });\r\n };\r\n\r\n /**\r\n * Find object by object\r\n * @param {FabricObject} obj\r\n */\r\n public find = (obj: FabricObject) => this.findById(obj.id);\r\n\r\n /**\r\n * Find object by id\r\n * @param {string} id\r\n * @returns {(FabricObject | null)}\r\n */\r\n public findById = (id: string): FabricObject | null => {\r\n let findObject;\r\n const exist = this.objects.some((obj) => {\r\n if (obj.id === id) {\r\n findObject = obj;\r\n return true;\r\n }\r\n return false;\r\n });\r\n if (!exist) {\r\n warning(true, \"Not found object by id.\");\r\n return null;\r\n }\r\n return findObject;\r\n };\r\n\r\n /**\r\n * Find object in origin list\r\n * @param {string} id\r\n * @returns\r\n */\r\n public findOriginById = (id: string) => {\r\n let findObject: FabricObject;\r\n const exist = this.objects.some((obj) => {\r\n if (obj.id === id) {\r\n findObject = obj;\r\n return true;\r\n }\r\n return false;\r\n });\r\n if (!exist) {\r\n console.warn(\"Not found object by id.\");\r\n return null;\r\n }\r\n return findObject;\r\n };\r\n\r\n /**\r\n * Return origin object list\r\n * @param {string} id\r\n * @returns\r\n */\r\n public findOriginByIdWithIndex = (id: string) => {\r\n let findObject;\r\n let index = -1;\r\n const exist = this.objects.some((obj, i) => {\r\n if (obj.id === id) {\r\n findObject = obj;\r\n index = i;\r\n return true;\r\n }\r\n return false;\r\n });\r\n if (!exist) {\r\n console.warn(\"Not found object by id.\");\r\n return {};\r\n }\r\n return {\r\n object: findObject,\r\n index,\r\n };\r\n };\r\n\r\n /**\r\n * Select object\r\n * @param {FabricObject} obj\r\n * @param {boolean} [find]\r\n */\r\n public select = (obj: FabricObject, find?: boolean) => {\r\n let findObject = obj;\r\n if (find) {\r\n findObject = this.find(obj);\r\n }\r\n if (findObject) {\r\n this.canvas.discardActiveObject();\r\n this.canvas.setActiveObject(findObject);\r\n this.canvas.requestRenderAll();\r\n }\r\n };\r\n\r\n /**\r\n * Select by id\r\n * @param {string} id\r\n */\r\n public selectById = (id: string) => {\r\n const findObject = this.findById(id);\r\n if (findObject) {\r\n this.canvas.discardActiveObject();\r\n this.canvas.setActiveObject(findObject);\r\n this.canvas.requestRenderAll();\r\n }\r\n };\r\n\r\n /**\r\n * Select all\r\n * @returns\r\n */\r\n public selectAll = () => {\r\n this.canvas.discardActiveObject();\r\n const filteredObjects = this.canvas.getObjects().filter((obj: any) => {\r\n if (obj.id === \"workarea\") {\r\n return false;\r\n } else if (!obj.evented) {\r\n return false;\r\n } else if (obj.superType === \"link\") {\r\n return false;\r\n } else if (obj.superType === \"port\") {\r\n return false;\r\n } else if (obj.superType === \"element\") {\r\n return false;\r\n } else if (obj.locked) {\r\n return false;\r\n }\r\n return true;\r\n });\r\n if (!filteredObjects.length) {\r\n return;\r\n }\r\n if (filteredObjects.length === 1) {\r\n this.canvas.setActiveObject(filteredObjects[0]);\r\n this.canvas.renderAll();\r\n return;\r\n }\r\n const activeSelection = new fabric.ActiveSelection(filteredObjects, {\r\n canvas: this.canvas,\r\n ...this.activeSelectionOption,\r\n });\r\n this.canvas.setActiveObject(activeSelection);\r\n this.canvas.renderAll();\r\n };\r\n\r\n /**\r\n * Save origin width, height\r\n * @param {FabricObject} obj\r\n * @param {number} width\r\n * @param {number} height\r\n */\r\n public originScaleToResize = (\r\n obj: FabricObject,\r\n width: number,\r\n height: number\r\n ) => {\r\n if (obj.id === \"workarea\") {\r\n this.setByPartial(obj, {\r\n workareaWidth: obj.width,\r\n workareaHeight: obj.height,\r\n });\r\n }\r\n this.setByPartial(obj, {\r\n scaleX: width / obj.width,\r\n scaleY: height / obj.height,\r\n });\r\n };\r\n\r\n /**\r\n * When set the width, height, Adjust the size\r\n * @param {number} width\r\n * @param {number} height\r\n */\r\n public scaleToResize = (width: number, height: number) => {\r\n const activeObject = this.canvas.getActiveObject() as FabricObject;\r\n const { id } = activeObject;\r\n const obj = {\r\n id,\r\n scaleX: width / activeObject.width,\r\n scaleY: height / activeObject.height,\r\n };\r\n this.setObject(obj);\r\n activeObject.setCoords();\r\n this.canvas.requestRenderAll();\r\n };\r\n\r\n /**\r\n * Import json\r\n * @param {*} json\r\n * @param {(canvas: FabricCanvas) => void} [callback]\r\n */\r\n public importJSON = async (\r\n json: any,\r\n type: any,\r\n callback?: (canvas: FabricCanvas) => void\r\n ) => {\r\n // debugger\r\n if (typeof json === \"string\") {\r\n json = JSON.parse(json);\r\n }\r\n let prevLeft = 0;\r\n let prevTop = 0;\r\n this.canvas.setBackgroundColor(\r\n this.canvasOption.backgroundColor,\r\n this.canvas.renderAll.bind(this.canvas)\r\n );\r\n const workareaExist = json.filter(\r\n (obj: FabricObjectOption) => obj.id === \"workarea\"\r\n );\r\n if (!this.workarea) {\r\n this.workareaHandler.initialize();\r\n }\r\n if (!workareaExist.length) {\r\n this.canvas.centerObject(this.workarea);\r\n this.workarea.setCoords();\r\n prevLeft = this.workarea.left;\r\n prevTop = this.workarea.top;\r\n } else {\r\n const workarea = workareaExist[0];\r\n prevLeft = workarea.left;\r\n prevTop = workarea.top;\r\n this.workarea.set(workarea);\r\n await this.workareaHandler.setImage(workarea.src, true);\r\n this.workarea.setCoords();\r\n }\r\n json.forEach((obj: FabricObjectOption) => {\r\n if (obj.id === \"workarea\") {\r\n return;\r\n }\r\n const canvasWidth = this.canvas.getWidth();\r\n const canvasHeight = this.canvas.getHeight();\r\n const {\r\n width,\r\n height,\r\n scaleX,\r\n scaleY,\r\n layout,\r\n left,\r\n top,\r\n } = this.workarea;\r\n if (layout === \"fullscreen\") {\r\n const leftRatio = canvasWidth / (width * scaleX);\r\n const topRatio = canvasHeight / (height * scaleY);\r\n obj.left *= leftRatio;\r\n obj.top *= topRatio;\r\n obj.scaleX *= leftRatio;\r\n obj.scaleY *= topRatio;\r\n } else {\r\n const diffLeft = left - prevLeft;\r\n const diffTop = top - prevTop;\r\n obj.left += diffLeft;\r\n obj.top += diffTop;\r\n }\r\n if (obj.superType === \"element\") {\r\n obj.id = v4();\r\n }\r\n this.add(obj, false, true);\r\n this.canvas.renderAll();\r\n });\r\n this.objects = this.getObjects();\r\n if (type !== \"preview\") {\r\n this.transactionHandler.save(\"loaded\");\r\n }\r\n if (callback) {\r\n callback(this.canvas);\r\n }\r\n return Promise.resolve(this.canvas);\r\n };\r\n\r\n /**\r\n * Export json\r\n */\r\n public exportJSON = () =>\r\n this.canvas.toObject(this.propertiesToInclude).objects as FabricObject[];\r\n\r\n /**\r\n * Active selection to group\r\n * @returns\r\n */\r\n public toGroup = (target?: FabricObject) => {\r\n const activeObject =\r\n target || (this.canvas.getActiveObject() as fabric.ActiveSelection);\r\n if (!activeObject) {\r\n return null;\r\n }\r\n if (activeObject.type !== \"activeSelection\") {\r\n return null;\r\n }\r\n const group = activeObject.toGroup() as FabricObject;\r\n group.set({\r\n id: v4(),\r\n name: \"New group\",\r\n type: \"group\",\r\n ...this.objectOption,\r\n });\r\n this.objects = this.getObjects();\r\n if (!this.transactionHandler.active) {\r\n this.transactionHandler.save(\"group\");\r\n }\r\n if (this.onSelect) {\r\n this.onSelect(group);\r\n }\r\n this.canvas.renderAll();\r\n return group;\r\n };\r\n\r\n /**\r\n * Group to active selection\r\n * @returns\r\n */\r\n public toActiveSelection = (target?: FabricObject) => {\r\n const activeObject =\r\n target || (this.canvas.getActiveObject() as fabric.Group);\r\n if (!activeObject) {\r\n return;\r\n }\r\n if (activeObject.type !== \"group\") {\r\n return;\r\n }\r\n const activeSelection = activeObject.toActiveSelection();\r\n this.objects = this.getObjects();\r\n if (!this.transactionHandler.active) {\r\n this.transactionHandler.save(\"ungroup\");\r\n }\r\n if (this.onSelect) {\r\n this.onSelect(activeSelection);\r\n }\r\n this.canvas.renderAll();\r\n return activeSelection;\r\n };\r\n\r\n /**\r\n * Bring forward\r\n */\r\n public bringForward = () => {\r\n const activeObject = this.canvas.getActiveObject() as FabricObject;\r\n if (activeObject) {\r\n this.canvas.bringForward(activeObject);\r\n if (!this.transactionHandler.active) {\r\n this.transactionHandler.save(\"bringForward\");\r\n }\r\n const { onModified } = this;\r\n if (onModified) {\r\n onModified(activeObject);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Bring to front\r\n */\r\n public bringToFront = () => {\r\n const activeObject = this.canvas.getActiveObject() as FabricObject;\r\n if (activeObject) {\r\n this.canvas.bringToFront(activeObject);\r\n if (!this.transactionHandler.active) {\r\n this.transactionHandler.save(\"bringToFront\");\r\n }\r\n const { onModified } = this;\r\n if (onModified) {\r\n onModified(activeObject);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Send backwards\r\n * @returns\r\n */\r\n public sendBackwards = () => {\r\n const activeObject = this.canvas.getActiveObject() as FabricObject;\r\n if (activeObject) {\r\n const firstObject = this.canvas.getObjects()[1] as FabricObject;\r\n if (firstObject.id === activeObject.id) {\r\n return;\r\n }\r\n if (!this.transactionHandler.active) {\r\n this.transactionHandler.save(\"sendBackwards\");\r\n }\r\n this.canvas.sendBackwards(activeObject);\r\n const { onModified } = this;\r\n if (onModified) {\r\n onModified(activeObject);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Send to back\r\n */\r\n public sendToBack = () => {\r\n const activeObject = this.canvas.getActiveObject() as FabricObject;\r\n if (activeObject) {\r\n this.canvas.sendToBack(activeObject);\r\n this.canvas.sendToBack(this.canvas.getObjects()[1]);\r\n if (!this.transactionHandler.active) {\r\n this.transactionHandler.save(\"sendToBack\");\r\n }\r\n const { onModified } = this;\r\n if (onModified) {\r\n onModified(activeObject);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Clear canvas\r\n * @param {boolean} [includeWorkarea=false]\r\n */\r\n public clear = (includeWorkarea = false) => {\r\n const ids = this.canvas.getObjects().reduce((prev, curr: any) => {\r\n if (curr.superType === \"element\") {\r\n prev.push(curr.id);\r\n return prev;\r\n }\r\n return prev;\r\n }, []);\r\n this.elementHandler.removeByIds(ids);\r\n if (includeWorkarea) {\r\n this.canvas.clear();\r\n this.workarea = null;\r\n } else {\r\n this.canvas.discardActiveObject();\r\n this.canvas.getObjects().forEach((obj: any) => {\r\n if (obj.id === \"grid\" || obj.id === \"workarea\") {\r\n return;\r\n }\r\n this.canvas.remove(obj);\r\n });\r\n }\r\n this.objects = this.getObjects();\r\n this.canvas.renderAll();\r\n };\r\n\r\n /**\r\n * Start request animation frame\r\n */\r\n public startRequestAnimFrame = () => {\r\n if (!this.isRequsetAnimFrame) {\r\n this.isRequsetAnimFrame = true;\r\n const render = () => {\r\n this.canvas.renderAll();\r\n this.requestFrame = fabric.util.requestAnimFrame(render);\r\n };\r\n fabric.util.requestAnimFrame(render);\r\n }\r\n };\r\n\r\n /**\r\n * Stop request animation frame\r\n */\r\n public stopRequestAnimFrame = () => {\r\n this.isRequsetAnimFrame = false;\r\n const cancelRequestAnimFrame = (() =>\r\n window.cancelAnimationFrame ||\r\n // || window.webkitCancelRequestAnimationFrame\r\n // || window.mozCancelRequestAnimationFrame\r\n // || window.oCancelRequestAnimationFrame\r\n // || window.msCancelRequestAnimationFrame\r\n clearTimeout)();\r\n cancelRequestAnimFrame(this.requestFrame);\r\n };\r\n\r\n /**\r\n * Save target object as image\r\n * @param {FabricObject} targetObject\r\n * @param {string} [option={ name: 'New Image', format: 'png', quality: 1 }]\r\n */\r\n public saveImage = (\r\n targetObject: FabricObject,\r\n option = { name: \"New Image\", format: \"png\", quality: 1 }\r\n ) => {\r\n let dataUrl;\r\n let target = targetObject;\r\n if (target) {\r\n dataUrl = target.toDataURL(option);\r\n } else {\r\n target = this.canvas.getActiveObject() as FabricObject;\r\n if (target) {\r\n dataUrl = target.toDataURL(option);\r\n }\r\n }\r\n if (dataUrl) {\r\n const anchorEl = document.createElement(\"a\");\r\n anchorEl.href = dataUrl;\r\n anchorEl.download = `${option.name}.png`;\r\n document.body.appendChild(anchorEl); // required for firefox\r\n anchorEl.click();\r\n anchorEl.remove();\r\n }\r\n };\r\n\r\n /**\r\n * Save canvas as image\r\n * @param {string} [option={ name: 'New Image', format: 'png', quality: 1 }]\r\n */\r\n public saveCanvasImage = (\r\n option = { name: \"New Image\", format: \"jpeg\", quality: 1, multiplier: 3, enableRetinaScaling: true}\r\n ) => {\r\n const dataUrl = this.canvas.toDataURL(option);\r\n\r\n if (dataUrl) {\r\n const anchorEl = document.createElement(\"a\");\r\n anchorEl.href = dataUrl;\r\n anchorEl.download = `${option.name}.jpeg`;\r\n document.body.appendChild(anchorEl); // required for firefox\r\n anchorEl.click();\r\n anchorEl.remove();\r\n }\r\n };\r\n\r\n public getCanvasImage = (\r\n option = { name: \"New Image\", format: \"png\", quality: 1 }\r\n ) => {\r\n return this.canvas.toDataURL(option);\r\n };\r\n\r\n /**\r\n * Sets \"angle\" of an instance with centered rotation\r\n *\r\n * @param {number} angle\r\n */\r\n public rotate = (angle: number) => {\r\n const activeObject = this.canvas.getActiveObject();\r\n if (activeObject) {\r\n this.set(\"rotation\", angle);\r\n activeObject.rotate(angle);\r\n this.canvas.requestRenderAll();\r\n }\r\n };\r\n\r\n /**\r\n * Destroy canvas\r\n *\r\n */\r\n public destroy = () => {\r\n this.eventHandler.destroy();\r\n this.guidelineHandler.destroy();\r\n this.contextmenuHandler.destory();\r\n this.tooltipHandler.destroy();\r\n this.clear(true);\r\n };\r\n\r\n /**\r\n * Set canvas option\r\n *\r\n * @param {CanvasOption} canvasOption\r\n */\r\n public setCanvasOption = (canvasOption: CanvasOption) => {\r\n this.canvasOption = Object.assign({}, this.canvasOption, canvasOption);\r\n this.canvas.setBackgroundColor(\r\n canvasOption.backgroundColor,\r\n this.canvas.renderAll.bind(this.canvas)\r\n );\r\n if (\r\n typeof canvasOption.width !== \"undefined\" &&\r\n typeof canvasOption.height !== \"undefined\"\r\n ) {\r\n if (this.eventHandler) {\r\n this.eventHandler.resize(canvasOption.width, canvasOption.height);\r\n } else {\r\n this.canvas.setWidth(canvasOption.width).setHeight(canvasOption.height);\r\n }\r\n }\r\n if (typeof canvasOption.selection !== \"undefined\") {\r\n this.canvas.selection = canvasOption.selection;\r\n }\r\n if (typeof canvasOption.hoverCursor !== \"undefined\") {\r\n this.canvas.hoverCursor = canvasOption.hoverCursor;\r\n }\r\n if (typeof canvasOption.defaultCursor !== \"undefined\") {\r\n this.canvas.defaultCursor = canvasOption.defaultCursor;\r\n }\r\n if (typeof canvasOption.preserveObjectStacking !== \"undefined\") {\r\n this.canvas.preserveObjectStacking = canvasOption.preserveObjectStacking;\r\n }\r\n };\r\n\r\n /**\r\n * Set keyboard event\r\n *\r\n * @param {KeyEvent} keyEvent\r\n */\r\n public setKeyEvent = (keyEvent: KeyEvent) => {\r\n this.keyEvent = Object.assign({}, this.keyEvent, keyEvent);\r\n };\r\n\r\n /**\r\n * Set fabric objects\r\n *\r\n * @param {FabricObjects} fabricObjects\r\n */\r\n public setFabricObjects = (fabricObjects: FabricObjects) => {\r\n this.fabricObjects = Object.assign({}, this.fabricObjects, fabricObjects);\r\n };\r\n\r\n /**\r\n * Set workarea option\r\n *\r\n * @param {WorkareaOption} workareaOption\r\n */\r\n public setWorkareaOption = (workareaOption: WorkareaOption) => {\r\n this.workareaOption = Object.assign(\r\n {},\r\n this.workareaOption,\r\n workareaOption\r\n );\r\n if (this.workarea) {\r\n this.workarea.set({\r\n ...workareaOption,\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Set guideline option\r\n *\r\n * @param {GuidelineOption} guidelineOption\r\n */\r\n public setGuidelineOption = (guidelineOption: GuidelineOption) => {\r\n this.guidelineOption = Object.assign(\r\n {},\r\n this.guidelineOption,\r\n guidelineOption\r\n );\r\n if (this.guidelineHandler) {\r\n this.guidelineHandler.initialize();\r\n }\r\n };\r\n\r\n /**\r\n * Set grid option\r\n *\r\n * @param {GridOption} gridOption\r\n */\r\n public setGridOption = (gridOption: GridOption) => {\r\n this.gridOption = Object.assign({}, this.gridOption, gridOption);\r\n };\r\n\r\n /**\r\n * Set object option\r\n *\r\n * @param {FabricObjectOption} objectOption\r\n */\r\n public setObjectOption = (objectOption: FabricObjectOption) => {\r\n this.objectOption = Object.assign({}, this.objectOption, objectOption);\r\n };\r\n\r\n /**\r\n * Set activeSelection option\r\n *\r\n * @param {Partial>} activeSelectionOption\r\n */\r\n public setActiveSelectionOption = (\r\n activeSelectionOption: Partial>\r\n ) => {\r\n this.activeSelectionOption = Object.assign(\r\n {},\r\n this.activeSelectionOption,\r\n activeSelectionOption\r\n );\r\n };\r\n\r\n /**\r\n * Set propertiesToInclude\r\n *\r\n * @param {string[]} propertiesToInclude\r\n */\r\n public setPropertiesToInclude = (propertiesToInclude: string[]) => {\r\n this.propertiesToInclude = union(\r\n propertiesToInclude,\r\n this.propertiesToInclude\r\n );\r\n };\r\n\r\n public deleteIncompletePolygon() {\r\n if (this.activeShapePolygon) {\r\n this.canvas.remove(this.activeShapePolygon)\r\n }\r\n if (this.lineArray && this.lineArray.length > 0) {\r\n this.lineArray.forEach(element => {\r\n this.canvas.remove(element)\r\n });\r\n }\r\n if (this.pointArray && this.pointArray.length > 0) {\r\n this.pointArray.forEach(element => {\r\n this.canvas.remove(element)\r\n });\r\n }\r\n }\r\n}\r\n\r\nexport default Handler;\r\n","import React, { Component } from 'react';\r\nimport { fabric } from 'fabric';\r\nimport { v4 } from 'uuid';\r\nimport ResizeObserver from 'resize-observer-polyfill';\r\n\r\nimport Handler, { HandlerOptions } from './handlers/Handler';\r\nimport { FabricCanvas } from './utils';\r\nimport { defaults } from './constants';\r\nimport '../../assets/styles/core/_tooltip.scss';\r\n\r\nexport type CanvasProps = HandlerOptions & {\r\n\tresponsive?: boolean;\r\n\tstyle?: React.CSSProperties;\r\n\tref?: React.RefAttributes;\r\n};\r\n\r\ninterface IState {\r\n\tid: string;\r\n\tloaded: boolean;\r\n}\r\n\r\nclass Canvas extends Component {\r\n\tpublic handler: Handler;\r\n\tpublic canvas: FabricCanvas;\r\n\tpublic container = React.createRef();\r\n\tprivate resizeObserver: ResizeObserver;\r\n\tstatic defaultProps: CanvasProps = {\r\n\t\tid: v4(),\r\n\t\teditable: true,\r\n\t\tzoomEnabled: true,\r\n\t\tminZoom: 30,\r\n\t\tmaxZoom: 300,\r\n\t\tresponsive: true,\r\n\t\twidth: 0,\r\n\t\theight: 0,\r\n\t};\r\n\r\n\tstate: IState = {\r\n\t\tid: v4(),\r\n\t\tloaded: false,\r\n\t};\r\n\r\n\tcomponentDidMount() {\r\n\t\tconst { editable, canvasOption, width, height, responsive, ...other } = this.props;\r\n\t\tconst { id } = this.state;\r\n\t\tconst mergedCanvasOption = Object.assign({}, defaults.canvasOption, canvasOption, {\r\n\t\t\twidth,\r\n\t\t\theight,\r\n\t\t\tselection: editable\r\n\t\t});\r\n\t\tthis.canvas = new fabric.Canvas(`canvas_${id}`, mergedCanvasOption);\r\n\t\tthis.canvas.setBackgroundColor(mergedCanvasOption.backgroundColor, this.canvas.renderAll.bind(this.canvas));\r\n\t\tthis.canvas.renderAll();\r\n\t\tthis.handler = new Handler({\r\n\t\t\tid,\r\n\t\t\twidth,\r\n\t\t\theight,\r\n\t\t\teditable,\r\n\t\t\tcanvas: this.canvas,\r\n\t\t\tcontainer: this.container.current,\r\n\t\t\tcanvasOption: mergedCanvasOption,\r\n\t\t\t...other,\r\n\t\t});\r\n\t\tif (this.props.responsive) {\r\n\t\t\tthis.createObserver();\r\n\t\t} else {\r\n\t\t\tthis.handleLoad();\r\n\t\t}\r\n\t}\r\n\r\n\tcomponentDidUpdate(prevProps: CanvasProps) {\r\n\t\tif (this.props.width !== prevProps.width || this.props.height !== prevProps.height) {\r\n\t\t\tthis.handler.eventHandler.resize(this.props.width, this.props.height);\r\n\t\t}\r\n\t\tif (this.props.editable !== prevProps.editable) {\r\n\t\t\tthis.handler.editable = this.props.editable;\r\n\t\t}\r\n\t\tif (this.props.responsive !== prevProps.responsive) {\r\n\t\t\tif (!this.props.responsive) {\r\n\t\t\t\tthis.destroyObserver();\r\n\t\t\t} else {\r\n\t\t\t\tthis.destroyObserver();\r\n\t\t\t\tthis.createObserver();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (JSON.stringify(this.props.canvasOption) !== JSON.stringify(prevProps.canvasOption)) {\r\n\t\t\tthis.handler.setCanvasOption(this.props.canvasOption);\r\n\t\t}\r\n\t\tif (JSON.stringify(this.props.keyEvent) !== JSON.stringify(prevProps.keyEvent)) {\r\n\t\t\tthis.handler.setKeyEvent(this.props.keyEvent);\r\n\t\t}\r\n\t\tif (JSON.stringify(this.props.fabricObjects) !== JSON.stringify(prevProps.fabricObjects)) {\r\n\t\t\tthis.handler.setFabricObjects(this.props.fabricObjects);\r\n\t\t}\r\n\t\tif (JSON.stringify(this.props.workareaOption) !== JSON.stringify(prevProps.workareaOption)) {\r\n\t\t\tthis.handler.setWorkareaOption(this.props.workareaOption);\r\n\t\t}\r\n\t\tif (JSON.stringify(this.props.guidelineOption) !== JSON.stringify(prevProps.guidelineOption)) {\r\n\t\t\tthis.handler.setGuidelineOption(this.props.guidelineOption);\r\n\t\t}\r\n\t\tif (JSON.stringify(this.props.objectOption) !== JSON.stringify(prevProps.objectOption)) {\r\n\t\t\tthis.handler.setObjectOption(this.props.objectOption);\r\n\t\t}\r\n\t\tif (JSON.stringify(this.props.gridOption) !== JSON.stringify(prevProps.gridOption)) {\r\n\t\t\tthis.handler.setGridOption(this.props.gridOption);\r\n\t\t}\r\n\t\tif (JSON.stringify(this.props.propertiesToInclude) !== JSON.stringify(prevProps.propertiesToInclude)) {\r\n\t\t\tthis.handler.setPropertiesToInclude(this.props.propertiesToInclude);\r\n\t\t}\r\n\t\tif (JSON.stringify(this.props.activeSelectionOption) !== JSON.stringify(prevProps.activeSelectionOption)) {\r\n\t\t\tthis.handler.setActiveSelectionOption(this.props.activeSelectionOption);\r\n\t\t}\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tthis.destroyObserver();\r\n\t\tthis.handler.destroy();\r\n\t}\r\n\r\n\tcreateObserver = () => {\r\n\t\tthis.resizeObserver = new ResizeObserver((entries: ResizeObserverEntry[]) => {\r\n\t\t\tconst { width = 0, height = 0 } = (entries[0] && entries[0].contentRect) || {};\r\n\t\t\tthis.handler.eventHandler.resize(width, height, this.props.centerWorkarea);\r\n\t\t\tif (!this.state.loaded) {\r\n\t\t\t\tthis.handleLoad();\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.resizeObserver.observe(this.container.current);\r\n\t};\r\n\r\n\tdestroyObserver = () => {\r\n\t\tif (this.resizeObserver) {\r\n\t\t\tthis.resizeObserver.disconnect();\r\n\t\t\tthis.resizeObserver = null;\r\n\t\t}\r\n\t};\r\n\r\n\thandleLoad = () => {\r\n\t\tthis.setState(\r\n\t\t\t{\r\n\t\t\t\tloaded: true,\r\n\t\t\t},\r\n\t\t\t() => {\r\n\t\t\t\tif (this.props.onLoad) {\r\n\t\t\t\t\tthis.props.onLoad(this.handler, this.canvas);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t);\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { id } = this.state;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default Canvas;\r\n","import React, { Component } from 'react';\r\n\r\nclass Icon extends Component {\r\n\r\n static defaultProps = {\r\n name: null,\r\n color: '',\r\n className: '',\r\n size: 1,\r\n innerIcon: null,\r\n innerColor: '',\r\n innerClassName: '',\r\n innerSize: 1,\r\n prefix: 'fas',\r\n };\r\n\r\n getIconHtml = (prefix, name, className, size, color) => {\r\n const iconClassName = `${prefix} fa-${name} ${className}`;\r\n const iconStyle = Object.assign({}, this.props.style, {\r\n fontSize: `${size}em`,\r\n color,\r\n });\r\n return ();\r\n }\r\n\r\n render() {\r\n const { color, size, className, innerIcon, innerColor, innerSize, innerClassName, prefix } = this.props;\r\n let { name } = this.props;\r\n if (name && name.startsWith('icon-')) {\r\n name = name.substr('icon-'.length);\r\n }\r\n const iconHtml = this.getIconHtml(prefix, name, className, size, color);\r\n let innerIconHtml = null;\r\n if (innerIcon) {\r\n innerIconHtml = this.getIconHtml(innerIcon, innerClassName, innerSize, innerColor);\r\n } else {\r\n return iconHtml;\r\n }\r\n return (\r\n \r\n {iconHtml}\r\n {innerIconHtml}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default Icon;\r\n","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Popover, Button } from 'antd';\r\nimport { SwatchesPicker } from 'react-color';\r\nclass ColorPicker extends Component {\r\n\tconstructor() {\r\n\t\tsuper(...arguments);\r\n\t\tthis.handlers = {\r\n\t\t\tonChange: color => {\r\n\t\t\t\tconst { onChange, valueType } = this.props;\r\n\t\t\t\tlet newColor;\r\n\t\t\t\tif (valueType === 'string') {\r\n\t\t\t\t\tnewColor = `rgba(${color.rgb.r},${color.rgb.g},${color.rgb.b},${color.rgb.a})`;\r\n\t\t\t\t}\r\n\t\t\t\telse if (valueType === 'hex') {\r\n\t\t\t\t\tnewColor = this.rgbToHex(color.rgb.r, color.rgb.g, color.rgb.b);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tnewColor = color.rgb;\r\n\t\t\t\t}\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tcolor: newColor,\r\n\t\t\t\t}, () => {\r\n\t\t\t\t\tonChange(newColor);\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t};\r\n\t\tthis.state = {\r\n\t\t\tcolor: this.props.value || 'rgba(255, 255, 255, 1)',\r\n\t\t};\r\n\t\tthis.getBackgroundColor = color => {\r\n\t\t\tif (typeof color === 'string') {\r\n\t\t\t\treturn color;\r\n\t\t\t}\r\n\t\t\treturn `rgba(${color.r},${color.g},${color.b},${color.a})`;\r\n\t\t};\r\n\t}\r\n\r\n\trgbToHex = (r, g, b) => {\r\n\t\tconst toHex = (component) => {\r\n\t\t const hex = component.toString(16);\r\n\t\t return hex.length === 1 ? '0' + hex : hex;\r\n\t\t};\r\n\t\treturn `#${toHex(r)}${toHex(g)}${toHex(b)}`;\r\n\t };\r\n\r\n\tUNSAFE_componentWillReceiveProps(nextProps) {\r\n\t\tthis.setState({\r\n\t\t\tcolor: nextProps.value || this.state.color,\r\n\t\t});\r\n\t}\r\n\trender() {\r\n\t\tconst { color } = this.state;\r\n\t\tconst { onChange } = this.handlers;\r\n\t\treturn (}>\r\n\t\t\t\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n

{i18n.t('propertyBar.zones.category')}

\r\n \r\n \r\n \r\n {form('category', {initialValue: objectGroup.category.key})(\r\n ,\r\n )}\r\n \r\n \r\n \r\n

{i18n.t('propertyBar.shapes.labelTitle')}

\r\n \r\n \r\n \r\n {form('sectionLabel', {\r\n initialValue: objectGroup.section.label,\r\n rules: [{\r\n required: true,\r\n message: i18n.t('validations.messageInput')\r\n }],\r\n })()}\r\n \r\n \r\n {form('displayedSectionLabel', {\r\n initialValue: objectGroup.section.displayedLabel,\r\n rules: [{\r\n message: i18n.t('validations.messageInput')\r\n }],\r\n })()}\r\n \r\n \r\n {form('leftText', {\r\n initialValue: objectText.left,\r\n })()}\r\n \r\n \r\n {form('topText', {\r\n initialValue: objectText.top,\r\n })()}\r\n \r\n \r\n {form('fontSizeText', {\r\n initialValue: objectText.fontSize || '16',\r\n })(\r\n ,\r\n )}\r\n \r\n \r\n {form('fillText', {\r\n initialValue: objectText.fill || 'rgba(0, 0, 0, 1)',\r\n })()}\r\n \r\n \r\n {form('angleText', {\r\n initialValue: objectText.angle\r\n })()}\r\n \r\n \r\n \r\n );\r\n}\r\n\r\nexport {InputShapeZonesHandler};\r\n","import React, { useState } from \"react\";\r\n\r\nimport {\r\n Button,\r\n Checkbox,\r\n Col,\r\n Form,\r\n Input,\r\n InputNumber,\r\n Row,\r\n Select,\r\n Slider,\r\n Switch,\r\n Tooltip,\r\n} from \"antd\";\r\nimport i18n from \"i18next\";\r\nimport ColorPicker from \"../../tools/common/ColorPicker\";\r\nimport {\r\n iconDownStairs,\r\n iconBathGentle,\r\n iconBathLadies,\r\n iconExit,\r\n iconFood,\r\n iconRestrooms,\r\n iconStage,\r\n iconUpstairs,\r\n} from \"../icons/Icons\";\r\n\r\nconst InputShapesHandler = ({\r\n canvasRef,\r\n form,\r\n objectShape,\r\n objectText,\r\n objectShapeIcon,\r\n objectGroup,\r\n changeDisplayedLabel,\r\n displayedLabel,\r\n}) => {\r\n const [objectShapeType] = useState(objectShape.type);\r\n\r\n return (\r\n \r\n {/* \r\n

{i18n.t(\"mapeditor.actions.object\")}

\r\n
\r\n \r\n \r\n \r\n\r\n \r\n {\" \"}\r\n \r\n\r\n \r\n canvasRef.handler?.remove()}\r\n >\r\n \r\n \r\n \r\n
\r\n */}\r\n\r\n \r\n

{i18n.t(\"mapeditor.tools.superposition\")}

\r\n
\r\n \r\n canvasRef.handler.bringForward()}\r\n className=\"btn_props \"\r\n >\r\n \r\n \r\n \r\n \r\n canvasRef.handler.sendBackwards()}\r\n className=\"btn_props \"\r\n >\r\n \r\n \r\n \r\n \r\n canvasRef.handler.bringToFront()}\r\n className=\"btn_props \"\r\n >\r\n \r\n \r\n \r\n \r\n canvasRef.handler.sendToBack()}\r\n className=\"btn_props\"\r\n >\r\n \r\n \r\n \r\n
\r\n \r\n\r\n \r\n

{i18n.t(\"propertyBar.shapes.title\")}

\r\n \r\n {form(\"name\", {\r\n initialValue: objectShape.name,\r\n })()}\r\n \r\n {/* \r\n {form(\"locked\", {\r\n rules: [{ type: \"boolean\" }],\r\n valuePropName: \"checked\",\r\n initialValue: objectShape.locked,\r\n })()}\r\n */}\r\n { objectGroup.superType === \"ellipse\" &&\r\n
\r\n \r\n {form(\"rx\", {\r\n rules: [\r\n {\r\n type: \"number\",\r\n required: true,\r\n message: i18n.t(\"validations.messageInput\"),\r\n min: 1,\r\n },\r\n ],\r\n initialValue: objectShape.rx,\r\n })()}\r\n \r\n \r\n {form(\"ry\", {\r\n rules: [\r\n {\r\n type: \"number\",\r\n required: true,\r\n message: i18n.t(\"validations.messageInput\"),\r\n min: 1,\r\n },\r\n ],\r\n initialValue: objectShape.ry,\r\n })()}\r\n \r\n
\r\n }\r\n { objectGroup.superType !== \"ellipse\" &&\r\n
\r\n \r\n {form(\"width\", {\r\n rules: [\r\n {\r\n type: \"number\",\r\n required: true,\r\n message: i18n.t(\"validations.messageInput\"),\r\n min: 1,\r\n },\r\n ],\r\n initialValue: objectShape.width,\r\n })()}\r\n \r\n \r\n {form(\"height\", {\r\n rules: [\r\n {\r\n type: \"number\",\r\n required: true,\r\n message: i18n.t(\"validations.messageInput\"),\r\n min: 1,\r\n },\r\n ],\r\n initialValue: objectShape.height,\r\n })()}\r\n \r\n
\r\n }\r\n {/* \r\n {form(\"left\", {\r\n rules: [\r\n {\r\n required: true,\r\n message: i18n.t(\"validations.messageInput\"),\r\n },\r\n ],\r\n initialValue: objectGroup.left,\r\n })()}\r\n */}\r\n {/* \r\n {form(\"top\", {\r\n rules: [\r\n {\r\n required: true,\r\n message: i18n.t(\"validations.messageInput\"),\r\n },\r\n ],\r\n initialValue: objectGroup.top,\r\n })()}\r\n */}\r\n \r\n {form(\"opacity\", {\r\n initialValue: objectShape.opacity,\r\n })()}\r\n \r\n \r\n {form(\"angle\", {\r\n rules: [\r\n {\r\n type: \"number\",\r\n min: -180,\r\n max: 180,\r\n },\r\n ],\r\n initialValue: objectGroup.angle,\r\n })()}\r\n \r\n \r\n {form(\"fill\", {\r\n initialValue: objectShape.fill || \"rgba(0, 0, 0, 1)\",\r\n })()}\r\n \r\n \r\n {form(\"strokeWidthShape\", {\r\n initialValue: objectShape.strokeWidth || 1,\r\n })()}\r\n \r\n \r\n {form(\"stroke\", {\r\n initialValue: objectShape.stroke || \"rgba(255, 255, 255, 0)\",\r\n })()}\r\n \r\n {objectShapeType === \"groupRectangleZone\" ? (\r\n \r\n {form(\"borderRadius\", {\r\n initialValue: objectShape.rx || 0,\r\n })()}\r\n \r\n ) : null}\r\n \r\n\r\n \r\n \r\n {form(\"visibleText\", {\r\n rules: [{ type: \"boolean\" }],\r\n valuePropName: \"checked\",\r\n initialValue: objectGroup.visibleText,\r\n value: objectGroup.visibleText,\r\n })()}\r\n \r\n \r\n {objectGroup.visibleText && (\r\n \r\n \r\n {form(\"textText\", {\r\n initialValue: objectText.text,\r\n })()}\r\n \r\n \r\n {form(\"leftText\", {\r\n initialValue: objectText.left,\r\n })()}\r\n \r\n \r\n {form(\"topText\", {\r\n initialValue: objectText.top,\r\n })()}\r\n \r\n \r\n {form(\"fontSizeText\", {\r\n initialValue: objectText.fontSize || \"16\",\r\n })(\r\n \r\n )}\r\n \r\n \r\n {form(\"fillText\", {\r\n initialValue: objectText.fill || \"rgba(0, 0, 0, 1)\",\r\n })()}\r\n \r\n \r\n {form(\"angleText\", {\r\n initialValue: objectText.angle,\r\n })()}\r\n \r\n \r\n )}\r\n \r\n

{i18n.t(\"propertyBar.icon.name\")}

\r\n \r\n \r\n \r\n {form(\"visibleIcon\", {\r\n rules: [{ type: \"boolean\" }],\r\n valuePropName: \"checked\",\r\n initialValue: objectGroup.visibleIcon,\r\n value: objectGroup.visibleIcon,\r\n })()}\r\n \r\n \r\n {objectGroup.visibleIcon && (\r\n \r\n \r\n {form(\"typeIconIcon\", { initialValue: objectShapeIcon.svg })(\r\n \r\n )}\r\n \r\n \r\n {form(\"leftIcon\", {\r\n initialValue: objectShapeIcon.left,\r\n })()}\r\n \r\n \r\n {form(\"topIcon\", {\r\n initialValue: objectShapeIcon.top,\r\n })()}\r\n \r\n \r\n {form(\"scaled\", {\r\n initialValue: objectShapeIcon.scaled,\r\n })()}\r\n \r\n \r\n {form(\"fillIcon\", {\r\n initialValue: objectShapeIcon.fill || \"rgba(0, 0, 0, 1)\",\r\n })()}\r\n \r\n \r\n {form(\"rotateIcon\", {\r\n initialValue: objectShapeIcon.rotated,\r\n })()}\r\n \r\n \r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport { InputShapesHandler };\r\n","import React from \"react\";\r\nimport { Form, Slider } from \"antd\";\r\n\r\nimport i18n from \"i18next\";\r\nimport ColorPicker from \"../../tools/common/ColorPicker\";\r\n\r\nconst InputIconsHandler = ({ form, data, canvasRef }) => {\r\n const addNewIcon = (icon) => {\r\n canvasRef.handler.drawingHandler.onInit();\r\n canvasRef.handler.drawingHandler.updateProperties(\"iconType\", icon);\r\n };\r\n\r\n const icon1 = `\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t`;\r\n const icon2 = ``;\r\n const icon3 = ``;\r\n const icon4 = ``;\r\n const icon5 = ``;\r\n const icon6 = ``;\r\n const icon_6 = ``;\r\n const icon7 = ``;\r\n const icon9 = ``;\r\n const icon8 = ``;\r\n const icon10 = ``;\r\n const icon11 = ``;\r\n const icon12 = ``;\r\n const icon13 = ``;\r\n const icon14 = ``;\r\n\r\n return (\r\n <>\r\n

{i18n.t(\"propertyBar.shapes.title\")}

\r\n
\r\n addNewIcon(icon1)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n addNewIcon(icon2)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n addNewIcon(icon3)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n addNewIcon(icon4)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n addNewIcon(icon7)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n addNewIcon(icon5)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n addNewIcon(icon6)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n addNewIcon(icon8)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n addNewIcon(icon9)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n addNewIcon(icon10)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n addNewIcon(icon11)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n addNewIcon(icon12)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n addNewIcon(icon13)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n addNewIcon(icon14)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n {form(\"scaleX\", {\r\n initialValue: data.scaleX,\r\n })()}\r\n \r\n \r\n {form(\"fill\", {\r\n initialValue: data._objects[0].fill || \"rgba(0, 0, 0, 1)\",\r\n })()}\r\n \r\n \r\n );\r\n};\r\nexport { InputIconsHandler };\r\n","import React from \"react\";\r\nimport {\r\n Col,\r\n Input,\r\n Row,\r\n Select,\r\n Checkbox,\r\n Tag,\r\n Form,\r\n Slider,\r\n InputNumber,\r\n} from \"antd\";\r\nimport i18n from \"i18next\";\r\nimport { useSelector } from \"react-redux\";\r\n\r\nimport ColorPicker from \"../../tools/common/ColorPicker\";\r\n\r\nconst InputSeatsRowHandler = ({ form, objectShape }) => {\r\n const categories = useSelector((state) => state.properties.categories);\r\n const seatLabelOptions = [\r\n { key: 0, name: \"Seleccione tipo de distribución\" },\r\n { key: 1, name: \"1, 2, 3, ...\" },\r\n {key: 2, name: \"1, 3, 5, ...\"},\r\n {key: 3, name: \"2, 4, 6, ...\"},\r\n // {key: 4, name: \"1, 3, 5, ..., 6, 4, 2\"},\r\n // {key: 5, name: \"..., 5, 3, 1, 2, 4, 6, ...\"},\r\n // {key: 6, name: \"A, B, C, ...\"},\r\n // {key: 7, name: \"a, b, c, ...\"},\r\n ];\r\n\r\n return(\r\n \r\n

Propiedades de fila

\r\n \r\n \r\n {form('rowCategory', {initialValue: objectShape.category.key})(\r\n ,\r\n )}\r\n \r\n \r\n {form('seatsQuantity', {\r\n initialValue: objectShape.seatsQuantity,\r\n })()}\r\n \r\n \r\n {form('seatsSpacing', {\r\n initialValue: objectShape.seatsSpacing,\r\n })()}\r\n \r\n \r\n {form('seatsCurve', {\r\n initialValue: objectShape.seatsCurve,\r\n })()}\r\n \r\n \r\n

Etiquetado de sección

\r\n \r\n \r\n {form('sectionLabel', {\r\n initialValue: objectShape.section.label,\r\n disabled: objectShape.zoneID\r\n })()}\r\n \r\n \r\n {form('displayedSectionLabel', {\r\n initialValue: objectShape.section.displayedLabel,\r\n })()}\r\n \r\n \r\n

Etiquetado de filas

\r\n \r\n \r\n {form('enabledRowLabel', {\r\n rules: [{type: 'boolean',},],\r\n valuePropName: 'checked',\r\n initialValue: objectShape.row.enabled\r\n })(\r\n )}\r\n \r\n { objectShape.row.enabled && (\r\n <>\r\n \r\n {form('rowLabel', {\r\n initialValue: objectShape.row.label,\r\n })()}\r\n \r\n \r\n {form('displayedRowLabel', {\r\n initialValue: objectShape.row.displayedLabel,\r\n })()}\r\n \r\n \r\n \r\n \r\n {form('labelPositionLeft', {\r\n rules: [{type: 'boolean',},],\r\n valuePropName: 'checked',\r\n initialValue: objectShape.row.position.left\r\n })(\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {form('labelPositionRight', {\r\n rules: [{type: 'boolean',},],\r\n valuePropName: 'checked',\r\n initialValue: objectShape.row.position.right\r\n })(\r\n )}\r\n \r\n \r\n \r\n \r\n\r\n )\r\n\r\n }\r\n\r\n \r\n

Etiquetado de asientos

\r\n \r\n \r\n {form('seatLabeling', {initialValue: objectShape.seat.key})(\r\n ,\r\n )}\r\n \r\n { objectShape.seat.key != 0 &&\r\n <>\r\n \r\n {form('startsAt', {initialValue: objectShape.seat.startsAt})(\r\n \r\n )}\r\n \r\n \r\n {form('reverse', {initialValue: objectShape.seat.reverse,\r\n valuePropName: 'checked',})(\r\n \r\n )}\r\n \r\n \r\n }\r\n\r\n \r\n
\r\n );\r\n}\r\n\r\nexport { InputSeatsRowHandler };\r\n","import React, {useState} from 'react';\r\nimport {Col, Input, Row, Select, Form, Checkbox, Radio } from \"antd\";\r\nimport { useSelector } from 'react-redux'\r\n\r\nconst InputSeatsHandler = ({form, objectShape}) => {\r\n const [accesible, setAccesible] = useState(objectShape.accesible);\r\n const [companion, setCompanion] = useState(objectShape.companion);\r\n const [restrictedView, setRestrictedView] = useState(objectShape.restrictedView);\r\n\r\n console.log('objectShape.accesible', objectShape.accesible)\r\n console.log('objectShape.companion', objectShape.companion)\r\n const onCheckedAccesible = (e) => {\r\n console.log('e', e)\r\n const { target: { checked }} = e;\r\n setAccesible(checked);\r\n if(checked){\r\n setCompanion(!checked);\r\n }\r\n }\r\n\r\n const onCheckedCompanion = (e) => {\r\n console.log('e', e)\r\n const { target: { checked }} = e;\r\n setCompanion(checked);\r\n if(checked){\r\n setAccesible(!checked);\r\n }\r\n }\r\n\r\n const onCheckedRestrictedView = (e) => {\r\n console.log('e', e)\r\n const { target: { checked }} = e;\r\n setRestrictedView(checked);\r\n }\r\n\r\n\r\n const categories = useSelector(state => state.properties.categories);\r\n return(\r\n \r\n

Propiedades de asiento

\r\n \r\n \r\n {form('seatCategory', {initialValue: objectShape.category.key})(\r\n ,\r\n )}\r\n \r\n \r\n

Etiquetado de asientos

\r\n \r\n \r\n {form('seatLabel', {\r\n initialValue: objectShape.label,\r\n })()}\r\n \r\n \r\n {form('displayedSeatLabel', {\r\n initialValue: objectShape.displayedLabel,\r\n })()}\r\n \r\n \r\n

Iconos

\r\n \r\n \r\n {form('restrictedView', {\r\n rules: [{type: 'boolean',},],\r\n initialValue: objectShape.restrictedView,\r\n checked: objectShape.restrictedView\r\n })(\r\n )}\r\n \r\n \r\n {form('accesible', {\r\n initialValue: objectShape.accesible,\r\n value: objectShape.accesible,\r\n })(\r\n )}\r\n \r\n \r\n {form('companion', {\r\n initialValue: objectShape.companion,\r\n value: objectShape.companion,\r\n })(\r\n )}\r\n \r\n \r\n
\r\n );\r\n}\r\n\r\nexport {InputSeatsHandler};\r\n","import React from 'react';\r\n\r\nimport {Col, Row} from 'antd';\r\nimport i18n from 'i18next';\r\nimport {InputTextHandler} from \"./inputTextHandler\";\r\nimport {InputShapeZonesHandler} from \"./inputShapeZonesHandler\";\r\nimport {InputShapesHandler} from \"./inputShapesHandler\";\r\nimport {InputIconsHandler} from \"./inputIconsHandler\";\r\nimport { InputSeatsRowHandler } from './inputSeatsRowHandler';\r\nimport { InputSeatsHandler } from './inputSeatsHandler';\r\n\r\nconst ListProperties = () => {\r\n\treturn {\r\n\t\trender(canvasRef, form, data, changeDisplayedLabel, displayedLabel, typeCapacity, changeTypeCapacity) {\r\n\t\t\tconst { getFieldDecorator } = form;\r\n\r\n\t\t\treturn (\r\n\t\t\t\t<>\r\n\t\t\t\t\t{(data._objects) ?\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t{(data.superType === 'rect' || data.superType === 'triangle' || data.superType === 'ellipse' || data.superType === 'polygon') ?\r\n\t\t\t\t\t\t\t\t\t\ti18n.t('propertyBar.generalProperties')\r\n\t\t\t\t\t\t\t\t\t\t: (data.superType === 'rectangleZone' || data.superType === 'circleZone' || data.superType === 'polygonZone') ?\r\n\t\t\t\t\t\t\t\t\t\t\ti18n.t('propertyBar.generalZonesProperties')\r\n\t\t\t\t\t\t\t\t\t\t: (data.superType === 'groupSeatsLinear') ?\r\n\t\t\t\t\t\t\t\t\t\t\ti18n.t('propertyBar.seatsLinearProperties')\r\n\t\t\t\t\t\t\t\t\t\t: (data._objects[0].superType === 'seatsCurve') ?\r\n\t\t\t\t\t\t\t\t\t\t\ti18n.t('propertyBar.seatsCurveProperties')\r\n\t\t\t\t\t\t\t\t\t\t: (data._objects[0].superType === 'seatsRow') ?\r\n\t\t\t\t\t\t\t\t\t\t\ti18n.t('propertyBar.seatsRowProperties')\r\n\t\t\t\t\t\t\t\t\t\t: (data._objects[0].superType === 'circleTable') ?\r\n\t\t\t\t\t\t\t\t\t\t\ti18n.t('propertyBar.circleTableProperties')\r\n\t\t\t\t\t\t\t\t\t\t: (data._objects[0].superType === 'rectTable') ?\r\n\t\t\t\t\t\t\t\t\t\t\ti18n.t('propertyBar.rectangleTableProperties')\r\n\t\t\t\t\t\t\t\t\t\t: (data.superType === 'svg') ?\r\n\t\t\t\t\t\t\t\t\t\t\ti18n.t('propertyBar.iconProperties')\r\n\t\t\t\t\t\t\t\t\t\t: null\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\t{/* propiedades para zonas Generales */}\r\n\t\t\t\t\t\t\t{(data.superType === 'rectangleZone' || data.superType === 'circleZone' || data.superType === 'polygonZone') ?\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t: null}\r\n\t\t\t\t\t\t\t{(data.superType === 'row') ?\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t: null\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t{(data.superType === 'seat') ?\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t: null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t{/* propiedades para figuras */}\r\n\t\t\t\t\t\t\t{(data.superType === 'rect' || data.superType === 'ellipse' || data.superType === 'triangle' || data.superType === 'polygon') ?\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t: (data.superType === 'svg') ?\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t: null }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t: (data.superType === 'text') ?\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t

{i18n.t('propertyBar.textProperties')}

\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t: null\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n}\r\nexport { ListProperties };\r\n","import React, { Component } from 'react';\r\nimport { Upload, message } from 'antd';\r\nimport i18n from \"i18next\";\r\nconst { Dragger } = Upload;\r\n\r\nclass FileUpload extends Component {\r\n\tconstructor() {\r\n\t\tsuper(...arguments);\r\n\t\tthis.state = {\r\n\t\t\tfileList: this.props.value ? [this.props.value] : [],\r\n\t\t};\r\n\t}\r\n\tUNSAFE_componentWillReceiveProps(nextProps) {\r\n\t\tthis.setState({\r\n\t\t\tfileList: nextProps.value ? [nextProps.value] : [],\r\n\t\t});\r\n\t}\r\n\trender() {\r\n\t\tconst { accept, limit } = this.props;\r\n\t\tconst { fileList } = this.state;\r\n\t\tconst props = {\r\n\t\t\taccept,\r\n\t\t\tname: 'file',\r\n\t\t\tmultiple: false,\r\n\t\t\tonChange: info => {\r\n\t\t\t\tconst isLimit = info.file.size / 1024 / 1024 < limit;\r\n\t\t\t\tif (!isLimit) {\r\n\t\t\t\t\tmessage.error(`Limited to ${limit}MB or less`);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tconst { onChange } = this.props;\r\n\t\t\t\tonChange(info.file);\r\n\t\t\t},\r\n\t\t\tonRemove: file => {\r\n\t\t\t\tthis.setState(({ fileList }) => {\r\n\t\t\t\t\tconst index = fileList.indexOf(file);\r\n\t\t\t\t\tconst newFileList = fileList.slice();\r\n\t\t\t\t\tnewFileList.splice(index, 1);\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tfileList: newFileList,\r\n\t\t\t\t\t};\r\n\t\t\t\t}, () => {\r\n\t\t\t\t\tconst { onChange } = this.props;\r\n\t\t\t\t\tonChange(null);\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\tbeforeUpload: file => {\r\n\t\t\t\tconst isLimit = file.size / 1024 / 1024 < limit;\r\n\t\t\t\tif (!isLimit) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tfileList: [file],\r\n\t\t\t\t});\r\n\t\t\t\treturn false;\r\n\t\t\t},\r\n\t\t\tfileList,\r\n\t\t};\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t

\r\n\t\t\t\t

{i18n.t('mapeditor.canvas.fileuploadClick')}

\r\n\t\t\t\t{i18n.t('mapeditor.canvas.fileuploadSize')}
\r\n\t\t\t\t{i18n.t('mapeditor.canvas.fileuploadWeight')}\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n}\r\n\r\nFileUpload.defaultProps = {\r\n\tlimit: 5,\r\n};\r\nexport default FileUpload;\r\n","import React from \"react\";\r\nimport { Col, Row, Button } from \"antd\";\r\nimport i18n from \"i18next\";\r\nimport {\r\n FaCircle,\r\n FaCircleNotch,\r\n FaExclamationCircle,\r\n FaCheck,\r\n} from \"react-icons/all\";\r\n\r\nimport FileUpload from \"../../tools/common/FileUpload\";\r\n\r\nconst MapProperty = () => {\r\n\r\n return {\r\n render(canvasRef, form, data, properties, zoneActive) {\r\n console.log('canvasRef', canvasRef)\r\n const { getFieldDecorator } = form;\r\n if (!data) return null;\r\n return (\r\n \r\n \r\n

{i18n.t(\"mapeditor.map.title\")}

\r\n \r\n \r\n
    \r\n {properties.numberSeats > 0 ? (\r\n
  • \r\n \r\n \r\n \r\n  \r\n {`${properties.numberSeats} ${i18n.t(\r\n \"mapeditor.map.places\"\r\n )}`}\r\n
  • \r\n ) : (\r\n
  • \r\n \r\n \r\n \r\n {i18n.t(\"mapeditor.map.not-places\")}\r\n
  • \r\n )}\r\n {properties.categories.length > 0 ? (\r\n
  • \r\n \r\n \r\n \r\n  \r\n {`${properties.categories.length} ${i18n.t(\r\n \"mapeditor.map.categories\"\r\n )}`}\r\n
  • \r\n ) : (\r\n
  • \r\n \r\n \r\n \r\n {i18n.t(\"mapeditor.map.not-categories\")}\r\n
  • \r\n )}\r\n {properties.numberSeats > 0 && (\r\n <>\r\n {properties.duplicates > 0 ? (\r\n
  • \r\n \r\n \r\n \r\n  \r\n {`${properties.duplicates} ${i18n.t(\r\n \"mapeditor.map.duplicate-places\"\r\n )}`}\r\n
  • \r\n ) : (\r\n
  • \r\n \r\n \r\n \r\n {i18n.t(\"mapeditor.map.not-duplicate-places\")}\r\n
  • \r\n )}\r\n {properties.unlabeled > 0 ? (\r\n
  • \r\n \r\n \r\n \r\n {`${properties.unlabeled} ${i18n.t(\r\n \"mapeditor.map.unlabeled\"\r\n )}`}\r\n
  • \r\n ) : (\r\n
  • \r\n \r\n \r\n \r\n {i18n.t(\"mapeditor.map.all-places-labeled\")}\r\n
  • \r\n )}\r\n {properties.notCategorized > 0 ? (\r\n
  • \r\n \r\n \r\n \r\n {`${properties.notCategorized} ${i18n.t(\r\n \"mapeditor.map.not-categories-places\"\r\n )}`}\r\n
  • \r\n ) : (\r\n
  • \r\n \r\n \r\n \r\n {i18n.t(\"mapeditor.map.all-places-categorized\")}\r\n
  • \r\n )}\r\n \r\n )}\r\n
\r\n \r\n {properties.zoneActive == false &&\r\n <>\r\n \r\n

{i18n.t(\"mapeditor.canvas.title\")}

\r\n \r\n \r\n {getFieldDecorator(\"file\", {\r\n rules: [\r\n {\r\n required: false,\r\n },\r\n ],\r\n initialValue: data.file,\r\n })()}\r\n \r\n \r\n }\r\n
\r\n );\r\n },\r\n };\r\n};\r\n\r\nexport { MapProperty };\r\n","import { ListProperties } from './listProperties';\r\nimport { ImageFilterProperty } from './imageFilterProperty';\r\nimport {MapProperty} from \"./mapProperty\";\r\nimport {GroupProperty} from \"./GroupProperty\";\r\nexport const PropertyDefinition = {\r\n\tdefault: {\r\n\t\tdefault: {\r\n\t\t\ttitle: 'Default',\r\n\t\t\tcomponent: MapProperty(),\r\n\t\t},\r\n\t},\r\n\tgroup: {\r\n\t\tgeneral: {\r\n\t\t\ttitle: 'General',\r\n\t\t\tcomponent: GroupProperty(),\r\n\t\t},\r\n\t},\r\n\ttext: {\r\n\t\ttext: {\r\n\t\t\ttitle: 'Text',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t},\r\n\ttext: {\r\n\t\ttext: {\r\n\t\t\ttitle: 'Text',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t},\r\n\timage: {\r\n\t\timage: {\r\n\t\t\ttitle: 'Image',\r\n\t\t\tcomponent: MapProperty(),\r\n\t\t},\r\n\t\tfilter: {\r\n\t\t\ttitle: 'Filter',\r\n\t\t\tcomponent: ImageFilterProperty(),\r\n\t\t}\r\n\t},\r\n\ttriangle: {\r\n\t\tgeneral: {\r\n\t\t\ttitle: 'General',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t},\r\n\trect: {\r\n\t\tgeneral: {\r\n\t\t\ttitle: 'General',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t},\r\n\trectangleZone: {\r\n\t\tgeneral: {\r\n\t\t\ttitle: 'General',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t},\r\n\trectTable: {\r\n\t\tgeneral: {\r\n\t\t\ttitle: 'General',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t},\r\n\trow: {\r\n\t\tgeneral: {\r\n\t\t\ttitle: 'General',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t},\r\n\tseat: {\r\n\t\tgeneral: {\r\n\t\t\ttitle: 'General',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t},\r\n\tseatsCurve: {\r\n\t\tgeneral: {\r\n\t\t\ttitle: 'General',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t},\r\n\tmultipleRows: {\r\n\t\tgeneral: {\r\n\t\t\ttitle: 'General',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t},\r\n\tellipse: {\r\n\t\tgeneral: {\r\n\t\t\ttitle: 'General',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t},\r\n\tcircleZone: {\r\n\t\tgeneral: {\r\n\t\t\ttitle: 'General',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t},\r\n\tcircularTable: {\r\n\t\tgeneral: {\r\n\t\t\ttitle: 'General',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t},\r\n\tpolygon: {\r\n\t\tgeneral: {\r\n\t\t\ttitle: 'General',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t},\r\n\tpolygonZone: {\r\n\t\tgeneral: {\r\n\t\t\ttitle: 'General',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t},\r\n\telement: {\r\n\t\tgeneral: {\r\n\t\t\ttitle: 'General',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t},\r\n\tsvg: {\r\n\t\tgeneral: {\r\n\t\t\ttitle: 'General',\r\n\t\t\tcomponent: ListProperties(),\r\n\t\t},\r\n\t}\r\n};\r\n","import React from 'react';\r\nimport { Input, Slider, Col, InputNumber, Row } from 'antd';\r\nimport i18n from \"i18next\";\r\n\r\nconst GroupProperty = () => { \r\n\treturn {\r\n\t\trender(canvasRef, form, data) {\r\n\t\t\tconst { getFieldDecorator } = form;\r\n\t\t\treturn (\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t

{i18n.t('propertyBar.groupProperties')}

\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t

{i18n.t('propertyBar.group.title')}

\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t

{i18n.t('propertyBar.shapes.name')}

\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{getFieldDecorator('name', {\r\n\t\t\t\t\t\t\trules: [\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\trequired: false,\r\n\t\t\t\t\t\t\t\t\tmessage: 'Please input name',\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\tinitialValue: data.name,\r\n\t\t\t\t\t\t})()}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t

{i18n.t('propertyBar.group.width')}

\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{getFieldDecorator('width', {\r\n\t\t\t\t\t\t\trules: [\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\trequired: true,\r\n\t\t\t\t\t\t\t\t\tmessage: 'Please input width',\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\tinitialValue: data.width * data.scaleX,\r\n\t\t\t\t\t\t})()}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t

{i18n.t('propertyBar.group.height')}

\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{getFieldDecorator('height', {\r\n\t\t\t\t\t\t\trules: [\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\trequired: true,\r\n\t\t\t\t\t\t\t\t\tmessage: 'Please input height',\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\tinitialValue: data.height * data.scaleY,\r\n\t\t\t\t\t\t})()}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t

{i18n.t('propertyBar.group.left')}

\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{getFieldDecorator('left', {\r\n\t\t\t\t\t\t\trules: [\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\trequired: true,\r\n\t\t\t\t\t\t\t\t\tmessage: 'Please input x position',\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\tinitialValue: data.left,\r\n\t\t\t\t\t\t})()}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t

{i18n.t('propertyBar.group.top')}

\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{getFieldDecorator('top', {\r\n\t\t\t\t\t\t\trules: [\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\trequired: true,\r\n\t\t\t\t\t\t\t\t\tmessage: 'Please input y position',\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\tinitialValue: data.top,\r\n\t\t\t\t\t\t})()}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t

{i18n.t('propertyBar.group.angle')}

\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{getFieldDecorator('angle', {\r\n\t\t\t\t\t\t\trules: [\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\ttype: 'number',\r\n\t\t\t\t\t\t\t\t\trequired: true,\r\n\t\t\t\t\t\t\t\t\tmessage: 'Please input rotation',\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t],\r\n\t\t\t\t\t\t\tinitialValue: data.angle,\r\n\t\t\t\t\t\t})()}\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n }\r\n\r\nexport { GroupProperty };\r\n","import React from 'react';\r\nimport { Row, Col, Form, Tag, Slider } from 'antd';\r\nimport i18n from 'i18next';\r\n\r\nconst ImageFilterProperty = () => { \r\n return {\r\n render(canvasRef, form, data) {\r\n const { getFieldDecorator } = form;\r\n const { filters } = data;\r\n return (\r\n \r\n \r\n \r\n

Background Styles

\r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.grayscale', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[0],\r\n })(\r\n \r\n {'G'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.invert', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[1],\r\n })(\r\n \r\n {'I'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.sepia', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[3],\r\n })(\r\n \r\n {'S'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.brownie', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[4],\r\n })(\r\n \r\n {'B'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n
\r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.vintage', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[9],\r\n })(\r\n \r\n {'V'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.blackwhite', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[19],\r\n })(\r\n \r\n {'B'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.technicolor', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[14],\r\n })(\r\n \r\n {'T'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.polaroid', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[15],\r\n })(\r\n \r\n {'P'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.sharpen', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[12],\r\n })(\r\n \r\n {'S'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.emboss', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[13],\r\n })(\r\n \r\n {'E'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.gamma.enabled', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[17],\r\n })(\r\n \r\n {'G'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.gamma.r', {\r\n initialValue: filters[17] ? filters[17].gamma[0] : 1,\r\n })(\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.gamma.g', {\r\n initialValue: filters[17] ? filters[17].gamma[1] : 1,\r\n })(\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.gamma.b', {\r\n initialValue: filters[17] ? filters[17].gamma[2] : 1,\r\n })(\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.brightness.enabled', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[5],\r\n })(\r\n \r\n {'B'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.brightness.brightness', {\r\n initialValue: filters[5] ? filters[5].brightness : 0.1,\r\n })(\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.contrast.enabled', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[6],\r\n })(\r\n \r\n {'C'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.contrast.contrast', {\r\n initialValue: filters[6] ? filters[6].contrast : 0,\r\n })(\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.saturation.enabled', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[7],\r\n })(\r\n \r\n {'S'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.saturation.saturation', {\r\n initialValue: filters[7] ? filters[7].saturation : 0,\r\n })(\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.hue.enabled', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[21],\r\n })(\r\n \r\n {'H'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.hue.rotation', {\r\n initialValue: filters[21] ? filters[21].rotation : 0,\r\n })(\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.noise.enabled', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[8],\r\n })(\r\n \r\n {'N'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.noise.noise', {\r\n initialValue: filters[8] ? filters[8].noise : 100,\r\n })(\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.pixelate.enabled', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[10],\r\n })(\r\n \r\n {'P'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.pixelate.blocksize', {\r\n initialValue: filters[10] ? filters[10].blocksize : 4,\r\n })(\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.blur.enabled', {\r\n valuePropName: 'checked',\r\n initialValue: !!filters[11],\r\n })(\r\n \r\n {'B'}\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n getFieldDecorator('filters.blur.value', {\r\n initialValue: filters[11] ? filters[11].value : 0.1,\r\n })(\r\n ,\r\n )\r\n }\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n }\r\n}\r\n\r\nexport { ImageFilterProperty };\r\n","import React from \"react\";\r\nimport { Form } from \"antd\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport Scrollbar from \"../../tools/common/Scrollbar\";\r\nimport { PropertyDefinition } from \"./propertyDefinition\";\r\n\r\nconst DefaultProperties = ({ canvasRef, form, validation: {duplicates, notCategorized, unlabeled, numberSeats}, zoneActive, exitSubzone }) => {\r\n\r\n const {categories} = useSelector((state) => state.properties);\r\n\r\n if (canvasRef) {\r\n return (\r\n \r\n
\r\n
    \r\n {Object.keys(PropertyDefinition.default).map((key) => {\r\n return (\r\n
  • \r\n {PropertyDefinition.default[key].component.render(\r\n canvasRef,\r\n form,\r\n canvasRef.handler.workarea,\r\n {\r\n categories: categories,\r\n numberSeats,\r\n duplicates: duplicates.length,\r\n notCategorized: notCategorized.length,\r\n unlabeled: unlabeled.length,\r\n zoneActive\r\n }\r\n )}\r\n
  • \r\n );\r\n })}\r\n
\r\n
\r\n
\r\n );\r\n }\r\n return null;\r\n};\r\n\r\nexport default Form.create({\r\n onValuesChange: (props, changedValues, allValues) => {\r\n const { onChange, selectedItem } = props;\r\n onChange(\r\n selectedItem,\r\n changedValues,\r\n { workarea: allValues }\r\n );\r\n },\r\n})(DefaultProperties);\r\n","import React, { Component } from 'react';\r\nimport { Form } from 'antd';\r\n\r\nimport {PropertyDefinition} from './propertyDefinition';\r\nimport Scrollbar from '../../tools/common/Scrollbar';\r\n\r\nclass ObjectProperties extends Component {\r\n\r\n\tUNSAFE_componentWillReceiveProps(nextProps) {\r\n\t\tif (this.props.selectedItem && nextProps.selectedItem) {\r\n\t\t\tnextProps.form.resetFields();\r\n\t\t}\r\n\t}\r\n\r\n\trender() {\r\n\t\tlet { canvasRef,\r\n\t\t\tselectedItem, form,\r\n\t\t\tchangeDisplayedLabel, displayedLabel,\r\n\t\t\tchangeTypeCapacity, typeCapacity\r\n\t\t} = this.props;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\t
    \r\n\t\t\t\t\t\t{selectedItem && PropertyDefinition[selectedItem.superType] ? (\r\n\t\t\t\t\t\t\tObject.keys(PropertyDefinition[selectedItem.superType]).map(key => {\r\n\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t
  • \r\n\t\t\t\t\t\t\t\t\t\t{PropertyDefinition[selectedItem.superType][key].component.render(\r\n\t\t\t\t\t\t\t\t\t\t\tcanvasRef,\r\n\t\t\t\t\t\t\t\t\t\t\tform,\r\n\t\t\t\t\t\t\t\t\t\t\tselectedItem,\r\n\t\t\t\t\t\t\t\t\t\t\tchangeDisplayedLabel,\r\n\t\t\t\t\t\t\t\t\t\t\tdisplayedLabel,\r\n\t\t\t\t\t\t\t\t\t\t\tchangeTypeCapacity,\r\n\t\t\t\t\t\t\t\t\t\t\ttypeCapacity\r\n\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t
  • \r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t) : null }\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default Form.create({\r\n\tonValuesChange: (props, changedValues, allValues) => {\r\n\t\tconst { onChange, selectedItem } = props;\r\n\t\tonChange(selectedItem, changedValues, allValues);\r\n\t},\r\n})(ObjectProperties);\r\n","import React from 'react';\r\nimport {Col, Row, Form, InputNumber} from \"antd\";\r\nimport i18n from \"i18next\";\r\nimport { useSelector } from 'react-redux'\r\n\r\nconst InputToolRow = ({rowSeatSpacing, rowSpacingHandler, rowSeatSize, rowSeatSizeHandler}) => {\r\n\r\n return(\r\n \r\n

Configuración de fila

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n\r\nexport {InputToolRow};\r\n","import React, { useState } from \"react\";\r\nimport { Form } from \"antd\";\r\nimport { Col, Row } from \"antd\";\r\nimport { InputToolRow } from \"./inputToolRow\";\r\n// import { PropertyDefinitionTool } from './propertyDefinitionTool';\r\nimport Scrollbar from \"../../tools/common/Scrollbar\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport {\r\n setRowSpacing,\r\n setRowSeatSize,\r\n} from \"../../../redux/designerPropertiesSlice\";\r\n\r\nexport const ToolProperties = ({ selectedTool }) => {\r\n const rowSeatSpacing = useSelector(\r\n (state) => state.properties.rowSeatSpacing\r\n );\r\n const rowSeatSize = useSelector((state) => state.properties.rowSeatSize);\r\n\r\n const dispatch = useDispatch();\r\n\r\n const rowSpacingHandler = (e) => {\r\n dispatch(setRowSpacing(e));\r\n };\r\n\r\n const rowSeatSizeHandler = (e) => {\r\n dispatch(setRowSeatSize(e));\r\n };\r\n\r\n return (\r\n \r\n
\r\n
    \r\n

    \r\n {selectedTool === \"row\" ? \"Fila\" : null} \r\n

    \r\n {selectedTool === \"row\" ? (\r\n \r\n ) : null}\r\n
\r\n
\r\n
\r\n );\r\n};\r\n","import React, {useState} from 'react';\r\nimport {Col, Input, Row, Select, Form, Checkbox, Radio, InputNumber } from \"antd\";\r\nimport { useSelector } from 'react-redux'\r\n\r\nconst InputActiveSelectionHandler = ({form, selectedItem, canvasRef}) => {\r\n\r\n const categories = useSelector(state => state.properties.categories);\r\n\r\n const [category, setCategory] = useState(0);\r\n const [sectionName, setSectionName] = useState('');\r\n const [displayedSectionName, setDisplayedSectionName] = useState('');\r\n const [seatLabeling, setSeatLabeling] = useState(0);\r\n const [rowLabel, setRowLabel] = useState(0);\r\n const [rowLabelLeft, setRowLabelLeft] = useState(false);\r\n const [rowLabelRight, setRowLabelRight] = useState(false);\r\n const [startsAt, setStarstAt] = useState(1);\r\n const [reverse, setReverse] = useState(false);\r\n\r\n const seatLabelOptions = [\r\n { key: 0, name: \"Seleccione tipo de distribución\" },\r\n { key: 1, name: \"1, 2, 3, ...\" },\r\n {key: 2, name: \"1, 3, 5, ...\"},\r\n {key: 3, name: \"2, 4, 6, ...\"},\r\n ];\r\n\r\n const rowLabelOptions = [\r\n { key: 0, name: \"Seleccione etiquetado de fila\" },\r\n {key: 1, name: \"A, B, C, ...\"},\r\n ];\r\n\r\n const handleReverseChange = (e) => {\r\n const checked = e.target.checked;\r\n setReverse(checked);\r\n };\r\n const handlSetRowLabelLeft = (e) => {\r\n const checked = e.target.checked;\r\n setRowLabelLeft(checked);\r\n };\r\n const handleSetRowLabelRight = (e) => {\r\n const checked = e.target.checked;\r\n setRowLabelRight(checked);\r\n };\r\n\r\n return(\r\n
    \r\n \r\n

    Propiedades de asiento

    \r\n \r\n \r\n {form('categories', {\r\n initialValue: category})(\r\n ,\r\n )}\r\n \r\n \r\n

    Etiquetado de filas

    \r\n \r\n \r\n {form('sectionName', {\r\n initialValue: sectionName})( setSectionName(e.target.value)}/>)}\r\n \r\n \r\n {form('displayedSectionName', {\r\n initialValue: displayedSectionName})( setDisplayedSectionName(e.target.value)} />)}\r\n \r\n \r\n {form('rowLabel', {\r\n initialValue: rowLabel})(\r\n ,\r\n )}\r\n \r\n \r\n \r\n \r\n {form('labelPositionLeft', {\r\n rules: [{type: 'boolean',},],\r\n valuePropName: 'checked',\r\n initialValue: rowLabelLeft\r\n })(\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {form('labelPositionRight', {\r\n rules: [{type: 'boolean',},],\r\n valuePropName: 'checked',\r\n initialValue: rowLabelRight\r\n })(\r\n )}\r\n \r\n \r\n

    Etiquetado de asientos

    \r\n \r\n \r\n {form('seatLabeling', {\r\n initialValue: seatLabeling})(\r\n ,\r\n )}\r\n \r\n \r\n \r\n \r\n {form('starstAt', {\r\n initialValue: startsAt})(\r\n setStarstAt(e)} />\r\n )}\r\n \r\n \r\n \r\n \r\n {form('reverse', {\r\n valuePropName: 'checked', initialValue: reverse})(\r\n \r\n )}\r\n \r\n \r\n
    \r\n
\r\n );\r\n}\r\n\r\nexport {InputActiveSelectionHandler};\r\n","import React, { Component } from 'react';\r\nimport { Form } from 'antd';\r\nimport Scrollbar from '../../tools/common/Scrollbar';\r\nimport {InputActiveSelectionHandler} from './inputActiveSelectionHandler'\r\n\r\nclass ActiveSelectionProperties extends Component {\r\n\r\n\tUNSAFE_componentWillReceiveProps(nextProps) {\r\n\t\tif (this.props.selectedItem && nextProps.selectedItem) {\r\n\t\t\tnextProps.form.resetFields();\r\n\t\t}\r\n\t}\r\n\r\n\trender() {\r\n\t\tlet { \r\n\t\t\tselectedItem, form,canvasRef\r\n\t\t} = this.props;\r\n const { getFieldDecorator } = form;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t
\r\n \r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default Form.create({\r\n\tonValuesChange: (props, changedValues, allValues) => {\r\n\t\tconst { onChange, selectedItem } = props;\r\n\t\tonChange(selectedItem, changedValues, allValues);\r\n\t},\r\n})(ActiveSelectionProperties);","import React, { useState } from \"react\";\r\nimport DefaultProperties from \"./properties/defaultProperties\";\r\nimport ObjectProperties from \"./properties/objectProperties\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport { ToolProperties } from \"./properties/toolProperties\";\r\nimport ActiveSelectionProperties from \"./properties/activeSelectionProperties\";\r\nimport {\r\n\tsetZoneActive\r\n } from \"../../redux/designerPropertiesSlice\";\r\n\r\nconst PropertyBar = ({onChange,\r\n\tselectedItem,\r\n\tselectedTool,\r\n\tcanvasRef,\r\n\tselectedProperties,\r\n\taction,\r\n\tvalidation}) => {\r\n\r\n\tconst [displayedLabel, setDisplayedLabel] = useState(false);\r\n\tconst [typeCapacity, setTypeCapacity] = useState(false);\r\n\r\n\tconst dispatch = useDispatch();\r\n\r\n\tconst zoneActive = useSelector(\r\n\t (state) => state.properties.zoneActive\r\n\t);\r\n\r\n\tconst changeDisplayedLabel = (value) => {\r\n\t\tsetDisplayedLabel(value);\r\n\t };\r\n\r\n\tconst changeTypeCapacity = (value) => {\r\n\t\tsetTypeCapacity(value);\r\n\t};\r\nconsole.log(\"selectedProperties\", selectedProperties)\r\n\r\n return(\r\n \t
\r\n\t\t{selectedProperties ===\"default\" && }\r\n\t\t{selectedProperties === \"node\" && \r\n\t\t}\r\n\t\t{selectedProperties === \"menu\" && \r\n\t\t}\r\n\t\t{selectedProperties === \"activeSelection\" && \r\n\t\t}\r\n\t
\r\n\t);\r\n}\r\n\r\nexport default PropertyBar;","import React from \"react\";\r\n\r\nimport { Button } from \"antd\";\r\nimport classnames from \"classnames\";\r\nimport Canvas from \"../canvas/Canvas\";\r\n\r\nconst Preview = ({\r\n onChangePreview,\r\n onTooltip,\r\n onClick,\r\n preview,\r\n objects,\r\n canvasRef,\r\n}) => {\r\n const previewClassName = classnames(\"container-preview\", { preview });\r\n return (\r\n preview && (\r\n {\r\n canvasRef = c;\r\n }}\r\n style={{\r\n overflow: \"hidden\",\r\n display: \"flex\",\r\n alignItems: \"flex-start\",\r\n }}\r\n >\r\n {\r\n handler.interactionMode = \"preview\";\r\n handler.importJSON(objects, \"preview\");\r\n handler.workarea.hoverCursor = \"default\";\r\n }}\r\n onTooltip={onTooltip}\r\n onClick={onClick}\r\n minZoom={10}\r\n maxZoom={1000}\r\n />\r\n \r\n \r\n \r\n \r\n )\r\n );\r\n};\r\n\r\nexport default Preview;\r\n","import React, {useRef} from 'react';\r\n\r\nconst Joystick = ({canvasRef}) => {\r\n\r\n const joystick = useRef();\r\n let mousePosition;\r\n // we manage joystick position with offset\r\n let offset = [0,0];\r\n let isDown,isArrow = false;\r\n let element = joystick.current;\r\n\r\n const handleDown = (e) => {\r\n element = joystick.current\r\n isDown = true;\r\n isArrow = false;\r\n offset = [element.offsetLeft - e.clientX, element.offsetTop - e.clientY];\r\n }\r\n\r\n const handleTop = (e) => {\r\n element = joystick.current\r\n isArrow = true;\r\n isDown = false;\r\n if (isArrow) mousePosition = {x: e.clientX, y: e.clientY}\r\n console.log('element.offsetLeft', element)\r\n offset = [\r\n element.offsetLeft - e.clientX,\r\n element.offsetTop - e.clientY\r\n ];\r\n if (e.clientX <= 200 && e.clientX >= 130) mousePosition = {x: e.clientX, y: e.clientY}\r\n if (e.clientY <= 450 && e.clientY >= 560) mousePosition = {x: e.clientX, y: e.clientY}\r\n canvasRef.canvas.relativePan({x: 0, y: mousePosition.y + offset[1] + 50})\r\n }\r\n\r\n const handleRight = (e) => {\r\n element = joystick.current\r\n isArrow = true;\r\n isDown = false;\r\n if (isArrow) mousePosition = {x: e.clientX, y: e.clientY}\r\n offset = [\r\n element.offsetLeft - e.clientX,\r\n element.offsetTop - e.clientY\r\n ];\r\n if (e.clientX <= 200 && e.clientX >= 130) mousePosition = {x: e.clientX, y: e.clientY}\r\n if (e.clientY <= 450 && e.clientY >= 560) mousePosition = {x: e.clientX, y: e.clientY}\r\n canvasRef.canvas.relativePan({x: mousePosition.x + offset[0] - 50, y: 0})\r\n }\r\n\r\n const handleLeft = (e) => {\r\n element = joystick.current\r\n isArrow = true;\r\n isDown = false;\r\n if (isArrow) mousePosition = {x: e.clientX, y: e.clientY}\r\n offset = [\r\n element.offsetLeft - e.clientX,\r\n element.offsetTop - e.clientY\r\n ];\r\n if (e.clientX <= 200 && e.clientX >= 130)\r\n mousePosition = {x: e.clientX, y: e.clientY}\r\n if (e.clientY <= 450 && e.clientY >= 560)\r\n mousePosition = {x: e.clientX, y: e.clientY}\r\n canvasRef.canvas.relativePan({x: mousePosition.x + offset[0] + 50, y: 0})\r\n }\r\n\r\n const handleBottom = (e) => {\r\n element = joystick.current\r\n isArrow = true;\r\n isDown = false;\r\n if (isArrow) mousePosition = {x: e.clientX, y: e.clientY}\r\n offset = [\r\n element.offsetLeft - e.clientX,\r\n element.offsetTop - e.clientY\r\n ];\r\n if (e.clientX <= 200 && e.clientX >= 130) mousePosition = {x: e.clientX, y: e.clientY}\r\n if (e.clientY <= 450 && e.clientY >= 560) mousePosition = {x: e.clientX, y: e.clientY}\r\n canvasRef.canvas.relativePan({x: 0, y: mousePosition.y + offset[1] - 50})\r\n }\r\n\r\n document.addEventListener('mouseup', function() {\r\n if(!joystick.current) return;\r\n isDown = false;\r\n joystick.current.style.left = \"4.5px\";\r\n joystick.current.style.top = \"4.5px\";\r\n joystick.current.style.transition = \".1s ease-in-out\";\r\n }, true);\r\n\r\n document.addEventListener('mousemove', function(e) {\r\n e.preventDefault();\r\n if (isDown) {\r\n if (e.clientX <= 200 && e.clientX >= 130) {\r\n mousePosition = {\r\n x: e.clientX,\r\n y: e.clientY\r\n }\r\n }\r\n if (e.clientY <= 450 && e.clientY >= 560) {\r\n mousePosition = {\r\n x: e.clientX,\r\n y: e.clientY\r\n }\r\n }\r\n element.style.left = (mousePosition.x + offset[0]) + 'px';\r\n element.style.top = (mousePosition.y + offset[1]) + 'px';\r\n canvasRef.canvas.relativePan({x: mousePosition.x + offset[0], y: mousePosition.y + offset[1]})\r\n }\r\n }, true);\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n
\r\n
\r\n
\r\n {/*
*/}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n );\r\n}\r\n\r\nexport default Joystick;\r\n","import React, { Component } from \"react\";\r\nimport { Button, Switch, Tooltip } from \"antd\";\r\nimport i18n from \"i18next\";\r\n\r\nimport { code } from \"../canvas/constants\";\r\nimport { ExpandOutlined } from \"@ant-design/icons\";\r\nimport Joystick from \"./joystick\";\r\n\r\nimport { connect } from \"react-redux\";\r\n\r\nclass Footer extends Component {\r\n componentDidMount() {\r\n const { canvasRef } = this.props;\r\n this.waitForCanvasRender(canvasRef);\r\n }\r\n\r\n componentWillUnmount() {\r\n const { canvasRef } = this.props;\r\n this.detachEventListener(canvasRef);\r\n }\r\n\r\n waitForCanvasRender = (canvas) => {\r\n setTimeout(() => {\r\n if (canvas) {\r\n this.attachEventListener(canvas);\r\n return;\r\n }\r\n const { canvasRef } = this.props;\r\n this.waitForCanvasRender(canvasRef);\r\n }, 5);\r\n };\r\n\r\n attachEventListener = (canvasRef) => {\r\n canvasRef.canvas.wrapperEl.addEventListener(\r\n \"keydown\",\r\n this.events.keydown,\r\n false\r\n );\r\n };\r\n\r\n detachEventListener = (canvasRef) => {\r\n canvasRef.canvas.wrapperEl.removeEventListener(\r\n \"keydown\",\r\n this.events.keydown\r\n );\r\n };\r\n\r\n events = {\r\n keydown: (e) => {\r\n if (this.props.canvasRef.canvas.wrapperEl !== document.activeElement)\r\n return false;\r\n if (e.code === code.KEY_Q) this.handlers.selection();\r\n if (e.code === code.KEY_W) this.handlers.grab();\r\n },\r\n };\r\n\r\n render() {\r\n const { canvasRef, preview, zoomRatio, onChangePreview } = this.props;\r\n if (!canvasRef) return null;\r\n const zoomValue = parseInt((zoomRatio * 100).toFixed(2), 10);\r\n return (\r\n <>\r\n {this.props.zoneActive === false && <>\r\n
\r\n \r\n \r\n \r\n {\r\n canvasRef.handler.zoomHandler.zoomOut();\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n {\r\n canvasRef.handler.zoomHandler.zoomOneToOne();\r\n }}\r\n >{`${zoomValue}%`}\r\n \r\n \r\n {\r\n canvasRef.handler.zoomHandler.zoomToFitV2();\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n {\r\n canvasRef.handler.zoomHandler.zoomIn();\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n \r\n }\r\n \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state) => {\r\n return {\r\n zoneActive: state.properties.zoneActive,\r\n };\r\n};\r\n\r\nexport default connect(mapStateToProps)(Footer);\r\n","export const getSeats = (handler) => {\r\n return (\r\n handler\r\n .getObjects()\r\n .filter((item) => item.superType == \"row\")\r\n ?.flatMap((row) => row._objects)\r\n ?.filter((object) => object.superType == \"seat\") ?? []\r\n );\r\n };\r\n\r\n // setNumber = (seats) => (numberSeats = seats.length);\r\n\r\nexport const getDuplicates = (seats) => {\r\n const findDuplicates = seats.reduce((acc, seat) => {\r\n acc[seat.value] = ++acc[seat.value] || 0;\r\n return acc;\r\n }, {});\r\n\r\n return seats.filter((seat) => {\r\n return findDuplicates[seat.value];\r\n });\r\n };\r\n\r\nexport const getNotCategorized = (seats) => {\r\n return seats.filter((seat) => !seat.category.name);\r\n };\r\n\r\nexport const getUnlabeled = (seats) => {\r\n return seats.filter((seat) => !seat.isLabeled);\r\n };","import React, { Component } from \"react\";\r\nimport { fabric } from \"fabric\";\r\nimport { Button, Menu, Layout, Tooltip, Icon, Typography, notification } from \"antd\";\r\nimport debounce from \"lodash/debounce\";\r\nimport i18n from \"i18next\";\r\nimport { connect } from \"react-redux\";\r\n\r\nimport {\r\n setCategories,\r\n setRowSpacing,\r\n setRowSeatSize,\r\n setSpinning,\r\n setAvailableToPublish,\r\n openModal\r\n} from \"../redux/designerPropertiesSlice\";\r\nimport { actionSaveMap } from \"../constants/action\";\r\nimport { mapStatus } from \"../constants/status\";\r\n\r\nimport \"../assets/libs/fontawesome-5.2.0/css/all.css\";\r\nimport \"../assets/styles/index.scss\";\r\n\r\nimport { Header } from \"../components/mapeditor/header\";\r\nimport ToolBar from \"../components/mapeditor/toolBar\";\r\nimport { Canvas } from \"../components/canvas\";\r\nimport PropertyBar from \"../components/mapeditor/propertyBar\";\r\nimport Preview from \"../components/mapeditor/preview\";\r\nimport { code } from \"../components/canvas/constants\";\r\nimport Footer from \"../components/mapeditor/footer\";\r\nimport service from \"../service\";\r\nimport {getDuplicates, getNotCategorized, getSeats, getUnlabeled, getZoneSeats} from \"../components/canvas/utils/ValidationsUtil\"\r\nimport { Modal, Select, Avatar } from 'antd';\r\n\r\nconst propertiesToInclude = [\r\n \"id\",\r\n \"name\",\r\n \"locked\",\r\n \"file\",\r\n \"src\",\r\n \"link\",\r\n \"tooltip\",\r\n \"layout\",\r\n \"workareaWidth\",\r\n \"workareaHeight\",\r\n \"videoLoadType\",\r\n \"autoplay\",\r\n \"shadow\",\r\n \"muted\",\r\n \"loop\",\r\n \"code\",\r\n \"icon\",\r\n \"userProperty\",\r\n \"configuration\",\r\n \"superType\",\r\n \"points\",\r\n \"svg\",\r\n \"loadType\",\r\n];\r\n\r\nconst defaultOption = {\r\n fill: \"rgba(255, 255, 255, 0)\",\r\n stroke: \"rgba(0, 0, 0, 1)\",\r\n strokeUniform: true,\r\n resource: {},\r\n link: {\r\n enabled: false,\r\n type: \"resource\",\r\n state: \"new\",\r\n dashboard: {},\r\n },\r\n tooltip: {\r\n enabled: true,\r\n type: \"resource\",\r\n template: \"
{{message.name}}
\",\r\n },\r\n userProperty: {},\r\n trigger: {\r\n enabled: false,\r\n type: \"alarm\",\r\n script: \"return message.value > 0;\",\r\n effect: \"style\",\r\n },\r\n};\r\n\r\nclass MapEditor extends Component {\r\n state = {\r\n selectedItem: null,\r\n selectedTool: null,\r\n zoomRatio: 1,\r\n preview: false,\r\n loading: false,\r\n progress: 0,\r\n action: \"\",\r\n tools: {},\r\n objects: {},\r\n objCanvasPreviewOver: {},\r\n cursorName: \"\",\r\n onClickCanvas: false,\r\n itemOnCanvas: \"\",\r\n selectedProperties: \"default\",\r\n map: {},\r\n validation: {\r\n numberSeats: 0,\r\n duplicates: [],\r\n notCategorized: [],\r\n unlabeled: []\r\n },\r\n maps: [],\r\n selectedMap: {}\r\n };\r\n\r\n componentDidMount() {\r\n this.props.dispatch(setSpinning(true));\r\n this.setState({ selectedItem: null });\r\n this.setState({ selectedTool: null });\r\n this.shortcutHandlers.esc();\r\n this.initScript();\r\n }\r\n\r\n initScript = () => {\r\n window.redseats.setSettigs(process.env.REACT_APP_ENVIROMENT, \"Designer\");\r\n if (window.redseats.publicKey) this.init();\r\n else window.redseats.component.callback = this.init;\r\n };\r\n\r\n init = async () => {\r\n const map = await service.map.get();\r\n await this.loadMap(map, actionSaveMap.updateData);\r\n this.props.dispatch(setSpinning(false));\r\n };\r\n\r\n loadMap = async (map, action) => {\r\n this.setPropertiesInStore(map);\r\n this.setState({ map: map });\r\n if (map.key) {\r\n const mapCanvas = JSON.parse(map.layout);\r\n await this.handlers.onLoad(mapCanvas);\r\n await this.saveMap(action);\r\n this.setProperties();\r\n } else this.props.dispatch(setSpinning(false));\r\n }\r\n\r\n setPropertiesInStore = (map) => {\r\n this.props.dispatch(setCategories(map.categories));\r\n };\r\n\r\n saveMap = async (action) => {\r\n let result = undefined;\r\n const successfulStatus = [200, 201];\r\n let { map } = this.state;\r\n map.layout = this.handlers.onExportToJson();\r\n switch (action) {\r\n case actionSaveMap.create:\r\n result = await service.map.create(map);\r\n break;\r\n case actionSaveMap.updateData:\r\n result = await service.map.updateData(map);\r\n break;\r\n case actionSaveMap.updateLayout:\r\n this.setState({\r\n action: \"saving\",\r\n });\r\n result = await service.map.updateLayout(map);\r\n break;\r\n case actionSaveMap.publish:\r\n this.setState({\r\n action: \"publishing\",\r\n });\r\n let dataUrl = this.canvasRef.handler.getCanvasImage();\r\n map.imageUrl = dataUrl.split(',')[1];\r\n result = await service.map.publish(map);\r\n break;\r\n }\r\n\r\n if (successfulStatus.includes(result.statusCode)) {\r\n this.setState({\r\n map: { ...result.data, layout: map.layout, categories: map.categories},\r\n action: \"\",\r\n });\r\n if (action == actionSaveMap.create)\r\n window.redseats.onMapCreated(result.data.key);\r\n } else alert(\"Error al guardar mapa\");\r\n };\r\n\r\n canvasHandlers = {\r\n onAdd: (target) => {\r\n this.forceUpdate();\r\n this.onChangeCanvas();\r\n if (target.type === \"activeSelection\") {\r\n this.canvasHandlers.onSelect(null);\r\n return;\r\n }\r\n this.canvasRef.handler.select(target);\r\n },\r\n onSelect: (target) => {\r\n const { selectedItem } = this.state;\r\n if (\r\n target &&\r\n target.id &&\r\n target.id !== \"workarea\" &&\r\n target.type !== \"activeSelection\"\r\n ) {\r\n this.setState({ selectedProperties: \"node\" });\r\n if (selectedItem && target.id === selectedItem.id) return;\r\n this.setState({ selectedItem: target });\r\n return;\r\n }\r\n if(target && target.type === \"activeSelection\"){\r\n console.log(\"MapEditor\", target);\r\n this.setState({ selectedProperties: \"activeSelection\" });\r\n this.setState({ selectedItem: target });\r\n return;\r\n }\r\n this.setState({ selectedProperties: \"default\" });\r\n this.setState({ selectedItem: null });\r\n },\r\n onRemove: () => {\r\n this.onChangeCanvas();\r\n this.canvasHandlers.onSelect(null);\r\n },\r\n onModified: debounce(() => {\r\n this.forceUpdate();\r\n this.onChangeCanvas();\r\n }, 300),\r\n onZoom: (zoom) => {\r\n this.setState({ zoomRatio: zoom });\r\n },\r\n onChange: async (selectedItem, changedValues, allValues) => {\r\n this.onChangeCanvas();\r\n const changedKey = Object.keys(changedValues)[0];\r\n const changedValue = changedValues[changedKey];\r\n\r\n if (allValues.workarea) {\r\n await this.canvasHandlers.onChangeWokarea(\r\n changedKey,\r\n changedValue,\r\n allValues.workarea\r\n );\r\n this.onChangeCanvas();\r\n return;\r\n }\r\n\r\n if (\r\n changedKey === \"file\" ||\r\n changedKey === \"src\" ||\r\n changedKey === \"code\"\r\n ) {\r\n if (selectedItem.type === \"image\") {\r\n this.canvasRef.handler.setImageById(selectedItem.id, changedValue);\r\n } else if (selectedItem.superType === \"element\") {\r\n this.canvasRef.handler.elementHandler.setById(\r\n selectedItem.id,\r\n changedValue\r\n );\r\n }\r\n return;\r\n }\r\n\r\n this.canvasRef.handler.drawingHandler.updateProperties(\r\n changedKey,\r\n changedValue,\r\n allValues,\r\n selectedItem\r\n );\r\n this.setState({selectedItem: selectedItem});\r\n this.canvasRef.handler.transactionHandler.save(\"properties\");\r\n\r\n if (selectedItem.type === \"row\")\r\n this.canvasRef.handler.updateSeatQuantity.updateProperty(\r\n changedKey,\r\n changedValue,\r\n allValues,\r\n selectedItem,\r\n this.canvasRef\r\n );\r\n\r\n if (changedKey === \"trigger\") {\r\n const trigger = Object.assign(\r\n {},\r\n defaultOption.trigger,\r\n allValues.trigger\r\n );\r\n this.canvasRef.handler.set(changedKey, trigger);\r\n return;\r\n }\r\n if (changedKey === \"filters\") {\r\n const filterKey = Object.keys(changedValue)[0];\r\n const filterValue = allValues.filters[filterKey];\r\n if (filterKey === \"gamma\") {\r\n const rgb = [filterValue.r, filterValue.g, filterValue.b];\r\n this.canvasRef.handler.imageHandler.applyFilterByType(\r\n filterKey,\r\n changedValue[filterKey].enabled,\r\n {\r\n gamma: rgb,\r\n }\r\n );\r\n return;\r\n }\r\n if (filterKey === \"brightness\") {\r\n this.canvasRef.handler.imageHandler.applyFilterByType(\r\n filterKey,\r\n changedValue[filterKey].enabled,\r\n {\r\n brightness: filterValue.brightness,\r\n }\r\n );\r\n return;\r\n }\r\n if (filterKey === \"contrast\") {\r\n this.canvasRef.handler.imageHandler.applyFilterByType(\r\n filterKey,\r\n changedValue[filterKey].enabled,\r\n {\r\n contrast: filterValue.contrast,\r\n }\r\n );\r\n return;\r\n }\r\n if (filterKey === \"saturation\") {\r\n this.canvasRef.handler.imageHandler.applyFilterByType(\r\n filterKey,\r\n changedValue[filterKey].enabled,\r\n {\r\n saturation: filterValue.saturation,\r\n }\r\n );\r\n return;\r\n }\r\n if (filterKey === \"hue\") {\r\n this.canvasRef.handler.imageHandler.applyFilterByType(\r\n filterKey,\r\n changedValue[filterKey].enabled,\r\n {\r\n rotation: filterValue.rotation,\r\n }\r\n );\r\n return;\r\n }\r\n if (filterKey === \"noise\") {\r\n this.canvasRef.handler.imageHandler.applyFilterByType(\r\n filterKey,\r\n changedValue[filterKey].enabled,\r\n {\r\n noise: filterValue.noise,\r\n }\r\n );\r\n return;\r\n }\r\n if (filterKey === \"pixelate\") {\r\n this.canvasRef.handler.imageHandler.applyFilterByType(\r\n filterKey,\r\n changedValue[filterKey].enabled,\r\n {\r\n blocksize: filterValue.blocksize,\r\n }\r\n );\r\n return;\r\n }\r\n if (filterKey === \"blur\") {\r\n this.canvasRef.handler.imageHandler.applyFilterByType(\r\n filterKey,\r\n changedValue[filterKey].enabled,\r\n {\r\n value: filterValue.value,\r\n }\r\n );\r\n return;\r\n }\r\n this.canvasRef.handler.imageHandler.applyFilterByType(\r\n filterKey,\r\n changedValue[filterKey]\r\n );\r\n return;\r\n }\r\n this.canvasRef.handler.set(changedKey, selectedItem[changedKey]);\r\n },\r\n onChangeWokarea: async (changedKey, changedValue, allValues) => {\r\n if (changedKey === \"layout\") {\r\n this.canvasRef.handler.workareaHandler.setLayout(changedValue);\r\n return;\r\n }\r\n if (changedKey === \"file\" || changedKey === \"src\") {\r\n await this.canvasRef.handler.workareaHandler.setImage(changedValue);\r\n return;\r\n }\r\n if (changedKey === \"width\" || changedKey === \"height\") {\r\n this.canvasRef.handler.originScaleToResize(\r\n this.canvasRef.handler.workarea,\r\n allValues.width,\r\n allValues.height\r\n );\r\n this.canvasRef.canvas.centerObject(this.canvasRef.handler.workarea);\r\n return;\r\n }\r\n this.canvasRef.handler.workarea.set(changedKey, changedValue);\r\n this.canvasRef.canvas.requestRenderAll();\r\n },\r\n onMouseMove: (target) => {\r\n //console.log(target,'fsd');\r\n },\r\n onContext: (ref, event, target) => {\r\n if ((target && target.id === \"workarea\") || !target) return null;\r\n if (target.type === \"activeSelection\") {\r\n return (\r\n \r\n {/* {\r\n this.canvasRef.handler.toGroup();\r\n }}\r\n >\r\n \r\n {i18n.t(\"mapeditor.actions.object-group\")}\r\n */}\r\n {\r\n this.canvasRef.handler.duplicate();\r\n }}\r\n >\r\n \r\n {i18n.t(\"mapeditor.actions.clone\")}\r\n \r\n {\r\n this.canvasRef.handler.remove();\r\n }}\r\n >\r\n \r\n {i18n.t(\"mapeditor.actions.delete\")}\r\n \r\n \r\n );\r\n }\r\n if (target.type === \"group\") {\r\n return (\r\n \r\n {/* {\r\n this.canvasRef.handler.toActiveSelection();\r\n }}\r\n >\r\n \r\n {i18n.t(\"mapeditor.actions.object-ungroup\")}\r\n */}\r\n {\r\n this.canvasRef.handler.duplicate();\r\n }}\r\n >\r\n \r\n {i18n.t(\"mapeditor.actions.clone\")}\r\n \r\n {\r\n this.canvasRef.handler.remove();\r\n }}\r\n >\r\n \r\n {i18n.t(\"mapeditor.actions.delete\")}\r\n \r\n \r\n );\r\n }\r\n return (\r\n \r\n {\r\n this.canvasRef.handler.duplicateById(target.id);\r\n }}\r\n >\r\n \r\n {i18n.t(\"mapeditor.actions.clone\")}\r\n \r\n {\r\n this.canvasRef.handler.removeById(target.id);\r\n }}\r\n >\r\n \r\n {i18n.t(\"mapeditor.actions.delete\")}\r\n \r\n \r\n );\r\n },\r\n onTransaction: (transaction) => {\r\n this.forceUpdate();\r\n },\r\n onZone:(exited) => {\r\n if(!exited){\r\n this.setState({ selectedProperties: \"default\" });\r\n return;\r\n }\r\n this.setState({ selectedProperties: \"node\"});\r\n this.setState({ selectedItem: this.canvasRef.handler.activeZone });\r\n const { activeZone } = this.canvasRef.handler;\r\n this.canvasRef.handler.canvas.discardActiveObject();\r\n const objs = this.canvasRef.handler.canvas.getObjects().filter( (obj) => obj.id !== activeZone.id);\r\n objs.map( obj => obj.set( {selectable: true, opacity: 1} ) );\r\n const mapRows = this.canvasRef.canvas.getObjects(\"group\").filter( obj=> obj.superType === \"row\" );\r\n if(mapRows.length > 0){\r\n mapRows.forEach( mapRow => {\r\n const rowSeats = mapRow.getObjects(\"group\");\r\n rowSeats.forEach(seat => {\r\n seat.set({\r\n selectable: true\r\n })\r\n });\r\n })\r\n }\r\n activeZone.set({\r\n lockMovementX: false,\r\n lockMovementY: false,\r\n selectable: true\r\n });\r\n activeZone.item(0).set({\r\n fill: activeZone.item(0).originalFill,\r\n originalFill: ''\r\n });\r\n activeZone.item(1).set({\r\n visible: true\r\n });\r\n this.canvasRef.canvas.requestRenderAll();\r\n const rowGroups = this.canvasRef.canvas.getObjects(\"group\");\r\n const rows = rowGroups.filter( object => object.superType === \"row\");\r\n const zoneRows = rows.filter( row => row.zoneID === activeZone.id );\r\n if(zoneRows){\r\n zoneRows.forEach(row => {\r\n row.set({\r\n visible: false\r\n })\r\n activeZone.addWithUpdate(row);\r\n this.canvasRef.canvas.remove(row);\r\n });\r\n }\r\n // const sel = new fabric.ActiveSelection([activeZone, ...rows]);\r\n // sel.setControlsVisibility({\r\n // tl: false, //top-left\r\n // mt: false, // middle-top\r\n // tr: false, //top-right\r\n // ml: false, //middle-left\r\n // mr: false, //middle-right\r\n // bl: false, // bottom-left\r\n // mb: false, //middle-bottom\r\n // br: false, //bottom-right\r\n // mtr: true,\r\n // });\r\n this.canvasRef.canvas.setActiveObject(activeZone);\r\n this.canvasRef.handler.drawingHandler.setType(activeZone.superType);\r\n this.canvasRef.handler.activeZone = undefined;\r\n // sel.toGroup();\r\n this.canvasRef.canvas.requestRenderAll();\r\n this.onChangeCanvas();\r\n }\r\n };\r\n\r\n handlers = {\r\n onChangeSelectedProperties: (type, tool) => {\r\n this.setState({ selectedProperties: type });\r\n this.setState({ selectedItem: null });\r\n this.setState({ selectedTool: tool });\r\n },\r\n onChangePreview: (checked) => {\r\n let data;\r\n if (this.canvasRef) {\r\n data = this.canvasRef.handler.exportJSON().filter((obj) => {\r\n return obj.id;\r\n });\r\n this.setState({\r\n preview: typeof checked === \"object\" ? false : checked,\r\n objects: data,\r\n });\r\n }\r\n },\r\n onProgress: (progress) => {\r\n this.setState({ progress });\r\n },\r\n onChangeStyles: (styles) => {\r\n //delete\r\n this.onChangeCanvas();\r\n this.setState({ styles });\r\n },\r\n onChangeDataSources: (dataSources) => {\r\n //delete\r\n this.onChangeCanvas();\r\n this.setState({ dataSources });\r\n },\r\n onSaveImage: () => {\r\n this.canvasRef.handler.saveCanvasImage();\r\n },\r\n onExportToJson: () => {\r\n const objects = this.canvasRef.handler.exportJSON().filter((obj) => {\r\n return obj.id;\r\n });\r\n const exportData = {\r\n objects: {\r\n rows: objects.filter((o) => o.superType === \"row\"),\r\n polygonZones: objects.filter((o) => o.superType === \"polygonZone\"),\r\n otherObjects: objects.filter((o) => (o.superType !== \"row\" && o.superType !== \"polygonZone\")),\r\n },\r\n toolConfiguration: {\r\n rowSeatSpacing: this.props.rowSeatSpacing,\r\n rowSeatSize: this.props.rowSeatSize,\r\n },\r\n };\r\n console.log('exportData', exportData)\r\n return JSON.stringify(exportData, null, \"\\t\");\r\n },\r\n onLoad: async ({\r\n Objects,\r\n ToolConfiguration: { RowSeatSpacing, RowSeatSize },\r\n }) => {\r\n if (Objects) {\r\n this.canvasRef.handler.clear(true);\r\n const data = Objects.filter((obj) => {\r\n return obj.id;\r\n });\r\n this.props.dispatch(setRowSpacing(RowSeatSpacing));\r\n this.props.dispatch(setRowSeatSize(RowSeatSize));\r\n await this.canvasRef.handler.importJSON(data, \"editor\");\r\n }\r\n\r\n\r\n },\r\n onOpenModal: async () => {\r\n const maps = await service.map.getPublishedMaps();\r\n this.setState({ maps: maps });\r\n this.props.dispatch(openModal(true));\r\n }\r\n };\r\n\r\n shortcutHandlers = {\r\n esc: () => {\r\n document.addEventListener(\"keydown\", (e) => {\r\n if (e.code === code.ESCAPE) this.handlers.onChangePreview(false);\r\n });\r\n },\r\n };\r\n\r\n transformList = () => {\r\n return Object.values(this.state.tools).reduce(\r\n (prev, curr) => prev.concat(curr),\r\n []\r\n );\r\n };\r\n\r\n onChangeCanvas = () => {\r\n this.setProperties();\r\n const { map } = this.state;\r\n this.saveMap(\r\n map.status == mapStatus.new\r\n ? actionSaveMap.create\r\n : actionSaveMap.updateLayout\r\n );\r\n };\r\n\r\n setProperties = () => {\r\n const seats = getSeats(this.canvasRef.handler);\r\n const zones = this.canvasRef.handler.canvas.getObjects(\"group\").filter( obj => obj.superType === \"polygonZone\" );\r\n if(zones.length > 0){\r\n zones.forEach( zone => {\r\n let rows = zone.getObjects(\"group\").filter( obj => obj.superType === \"row\" );\r\n if(rows.length > 0){\r\n rows.forEach(row => {\r\n let seatsInZone = row.getObjects(\"group\");\r\n if(seatsInZone.length > 0){\r\n seats.push(...seatsInZone);\r\n }\r\n\r\n });\r\n }\r\n } )\r\n }\r\n this.setState({ validation: {\r\n duplicates: getDuplicates(seats),\r\n notCategorized: getNotCategorized(seats),\r\n unlabeled: getUnlabeled(seats),\r\n numberSeats: seats.length\r\n } });\r\n const {validation: {duplicates, notCategorized, unlabeled}} = this.state;\r\n if(seats.length > 0){\r\n this.setMapValidation(duplicates.length === 0 && notCategorized.length === 0 && unlabeled.length === 0);\r\n }\r\n };\r\n\r\n setMapValidation = ( available ) => {\r\n\t\tthis.props.dispatch(setAvailableToPublish(available));\r\n\t}\r\n\r\n render() {\r\n const {\r\n preview,\r\n selectedItem,\r\n selectedTool,\r\n zoomRatio,\r\n styles,\r\n dataSources,\r\n objects,\r\n cursorName,\r\n itemOnCanvas,\r\n selectedProperties,\r\n maps,\r\n selectedMap\r\n } = this.state;\r\n\r\n const {\r\n onAdd,\r\n onRemove,\r\n onSelect,\r\n onModified,\r\n onChange,\r\n onZoom,\r\n onMouseMove,\r\n onContext,\r\n onTransaction,\r\n onZone,\r\n } = this.canvasHandlers;\r\n\r\n const {\r\n onChangePreview,\r\n onChangeStyles,\r\n onChangeDataSources,\r\n onSaveImage,\r\n onChangeSelectedProperties,\r\n onOpenModal\r\n } = this.handlers;\r\n\r\n const screenCaptureAction = (\r\n <>\r\n \r\n \r\n \r\n \r\n );\r\n\r\n const onChangeCursorName = (name) => {\r\n this.setState({ cursorName: name });\r\n };\r\n\r\n const onChangeDataTool = (obj) => {\r\n\r\n this.setState({ itemOnCanvas: obj });\r\n };\r\n\r\n const handleModalOk = async () => {\r\n this.props.dispatch(openModal(false));\r\n this.props.dispatch(setSpinning(true));\r\n let newMap = this.state.map;\r\n const mapSelected = await service.map.getById(this.state.selectedMap.key);\r\n if(!this.state.map.key){\r\n await this.saveMap(actionSaveMap.create);\r\n newMap = this.state.map;\r\n }\r\n newMap.layout = mapSelected.layout;\r\n await this.loadMap(newMap, actionSaveMap.updateLayout);\r\n this.props.dispatch(setSpinning(false));\r\n const args = {\r\n message: 'Éxito',\r\n description:\r\n 'El mapa ha sido cargado correctamente.',\r\n duration: 4,\r\n icon: \r\n };\r\n notification.open(args);\r\n }\r\n\r\n const handleSelectChange = (value) => {\r\n const map = maps.find( map => map.key == value );\r\n this.setState({selectedMap: map})\r\n }\r\n\r\n const handleModalCancel = () => {\r\n this.props.dispatch(openModal(false));\r\n this.setState({selectedMap: {}});\r\n };\r\n\r\n const { Option } = Select;\r\n const { Title } = Typography;\r\n\r\n return (\r\n \r\n \r\n
\r\n
\r\n {\r\n this.itemsRef = c;\r\n }}\r\n canvasRef={this.canvasRef}\r\n onChangeCursorName={onChangeCursorName}\r\n onChangeDataTool={onChangeDataTool}\r\n onChangeSelectedProperties={onChangeSelectedProperties}\r\n />\r\n
\r\n\r\n
\r\n {\r\n this.canvasRef = c;\r\n }}\r\n minZoom={10}\r\n maxZoom={1000}\r\n objectOption={defaultOption}\r\n propertiesToInclude={propertiesToInclude}\r\n onModified={onModified}\r\n onZone={onZone}\r\n onAdd={onAdd}\r\n onRemove={onRemove}\r\n onSelect={onSelect}\r\n onZoom={onZoom}\r\n onMouseMove={onMouseMove}\r\n onContext={onContext}\r\n onTransaction={onTransaction}\r\n keyEvent={{ transaction: true }}\r\n cursorName={cursorName}\r\n onChangeCursorName={onChangeCursorName}\r\n onChangeDataTool={onChangeDataTool}\r\n itemOnCanvas={itemOnCanvas}\r\n centerWorkarea={true}\r\n />\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n {/* */}\r\n \r\n
\r\n\r\n \r\n \r\n \r\n option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0\r\n }\r\n >\r\n {maps.map( map => {\r\n return ()\r\n })}\r\n \r\n
\r\n { (selectedMap && selectedMap.imageUrl) && }\r\n { (selectedMap && selectedMap.imageUrl === \"\") &&\r\n <>\r\n \r\n Sin preview\r\n \r\n }\r\n
\r\n \r\n
\r\n
\r\n );\r\n }\r\n}\r\nconst mapStateToProps = (state) => {\r\n return {\r\n rowSeatSpacing: state.properties.rowSeatSpacing,\r\n rowSeatSize: state.properties.rowSeatSize,\r\n open: state.properties.open,\r\n zoneActive: state.properties.zoneActive\r\n };\r\n};\r\n\r\nexport default connect(mapStateToProps)(MapEditor);\r\n","import React, { useEffect, useRef, useState } from \"react\";\r\nimport { Layout, Button, Tooltip } from \"antd\";\r\nimport { HubConnectionBuilder } from \"@microsoft/signalr\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport i18n from \"i18next\";\r\nimport {\r\n ExpandOutlined,\r\n FullscreenExitOutlined,\r\n FullscreenOutlined,\r\n} from \"@ant-design/icons\";\r\n\r\nimport \"../assets/libs/fontawesome-5.2.0/css/all.css\";\r\nimport \"../assets/styles/index.scss\";\r\n\r\nimport { Canvas } from \"../components/canvas\";\r\nimport service from \"../service\";\r\nimport {\r\n setSpinning,\r\n setSelectedSeats,\r\n setSelection,\r\n setChannels\r\n} from \"../redux/designerPropertiesSlice\";\r\n\r\nimport { fabric } from \"fabric\";\r\n\r\nconst MapSelector = () => {\r\n const dispatch = useDispatch();\r\n const canvasRef = useRef();\r\n const [connection, setConnection] = useState(null);\r\n const [expanded, setExpanded] = useState(false);\r\n const [showExpanded, setShowExpanded] = useState(false);\r\n\r\n useEffect(() => {\r\n dispatch(setSpinning(true));\r\n initScript();\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (connection) {\r\n connection\r\n .start()\r\n .then((result) => {\r\n console.log(\"Connected!\");\r\n connection.invoke(\"AddToEvent\", window.redseats.eventKey);\r\n connection.on(\"ChangeStatus\", (value) => {\r\n canvasRef.current.handler.selectorHandler.setType(\"row\");\r\n canvasRef.current.handler.selectorHandler.onChangeHub(value);\r\n });\r\n })\r\n .catch((e) => console.log(\"Connection failed: \", e));\r\n }\r\n }, [connection]);\r\n\r\n const onExpandHandler = () => {\r\n if (!expanded) {\r\n window.redseats.onExpand(true);\r\n } else {\r\n window.redseats.onMinimize(false);\r\n }\r\n setTimeout( () => {\r\n canvasRef.current.handler.zoomHandler.zoomToFit();\r\n }, 500 );\r\n setExpanded(!expanded);\r\n };\r\n\r\n const initScript = async () => {\r\n window.redseats.setSettigs(process.env.REACT_APP_ENVIROMENT, \"Selector\");\r\n console.log('window.redseats.showFullScreenButton', window.redseats.showFullScreenButton);\r\n if (window.redseats.publicKey) await init();\r\n else window.redseats.component.callback = init;\r\n };\r\n\r\n const init = async () => {\r\n const mapEvent = await service.mapEvent.buildSelector();\r\n if (mapEvent.key) {\r\n let selectionObj = [];\r\n let categories = await window.redseats.availableCategories;\r\n let channels = await window.redseats.channels ?? [];\r\n dispatch(setChannels(channels));\r\n setShowExpanded(window.redseats.showFullScreenButton);\r\n if (mapEvent.selectedSeats.length > 0) {\r\n selectionObj = [...mapEvent.selectedSeats];\r\n }\r\n categories.forEach((category) => {\r\n if (!selectionObj.some((obj) => obj.key === category)) {\r\n selectionObj.push({\r\n key: category,\r\n seats: [],\r\n });\r\n }\r\n });\r\n dispatch(setSelection(selectionObj));\r\n dispatch(setSelectedSeats(mapEvent.selectedSeats));\r\n const mapCanvas = JSON.parse(mapEvent.mapCanvas);\r\n await handlers.onLoad(mapCanvas, categories[0]);\r\n\r\n //signalr\r\n const newConnection = new HubConnectionBuilder()\r\n .withUrl(`${process.env.REACT_APP_HUB_URL}seat`)\r\n .withAutomaticReconnect()\r\n .build();\r\n\r\n setConnection(newConnection);\r\n }\r\n };\r\n\r\n const handlers = {\r\n onLoad: async ({ Objects }, category) => {\r\n if (Objects) {\r\n canvasRef.current.handler.clear(true);\r\n const data = Objects.filter((obj) => {\r\n return obj.id;\r\n });\r\n console.log('data', data)\r\n await canvasRef.current.handler.importJSON(data, \"selector\");\r\n }\r\n canvasRef.current.handler.interactionMode = \"selector\";\r\n canvasRef.current.handler.zoomHandler.zoomToFit();\r\n canvasRef.current.handler.zoomHandler.zoomToFit();\r\n let zones = canvasRef.current.handler.canvas.getObjects(\"group\").filter( group => group.superType == \"polygonZone\" );\r\n console.log('zones', zones)\r\n if(zones.length > 0){\r\n zones.map(zone => {\r\n let groupLeft = zone.left || 0;\r\n let groupTop = zone.top || 0;\r\n let rows = zone.getObjects(\"group\");\r\n if(rows.length>0){\r\n rows.map(row => {\r\n row.set({\r\n zoneID: zone.id,\r\n left: groupLeft+(zone.width/2)+row.left,\r\n top: groupTop+(zone.height/2)+row.top,\r\n __eventListeners: zone.__eventListeners\r\n });\r\n canvasRef.current.handler.canvas.add(row);\r\n });\r\n zone._objects = zone._objects.slice(0, 2);\r\n }\r\n });\r\n }\r\n let rows = canvasRef.current.handler.canvas.getObjects(\"group\").filter( group => group.superType == \"row\" );\r\n rows.forEach(row => {\r\n let seats = row.getObjects(\"group\");\r\n seats.forEach(seat => {\r\n seat.set({\r\n rowLabel: row.row.label,\r\n sectionLabel: row.section.label,\r\n zoneID: row.zoneID,\r\n __eventListeners: row.__eventListeners\r\n })\r\n });\r\n canvasRef.current.handler.canvas.setActiveObject(row);\r\n row.toActiveSelection();\r\n canvasRef.current.handler.canvas.discardActiveObject();\r\n });\r\n zones.forEach( zone => {\r\n // canvasRef.current.handler.canvas.remove(zone);\r\n let shape = zone.item(0);\r\n if(+zone.category.key != +category){\r\n shape.set({\r\n visible: false\r\n });\r\n\r\n }\r\n else{\r\n shape.set({\r\n opacity: 0.9\r\n });\r\n }\r\n canvasRef.current.handler.canvas.bringToFront(zone);\r\n }\r\n )\r\n canvasRef.current.handler.canvas.requestRenderAll();\r\n canvasRef.current.handler.canvasEnabled = true;\r\n dispatch(setSpinning(false));\r\n },\r\n };\r\n\r\n const onSaveImage = () => {\r\n canvasRef.current.handler.saveCanvasImage();\r\n }\r\n\r\n const clickHandler = () => {\r\n canvasRef.current.handler.zoomHandler.zoomToFit();\r\n if(canvasRef.current.handler.activeZoneSelector){\r\n console.log('canvasRef.current.handler.activeZoneSelector', canvasRef.current.handler.activeZoneSelector)\r\n const shape = canvasRef.current.handler.activeZoneSelector.item(0);\r\n const text = canvasRef.current.handler.activeZoneSelector.item(1);\r\n shape.set({visible: true});\r\n text.set({visible: true});\r\n canvasRef.current.handler.activeZoneSelector = undefined;\r\n }\r\n }\r\n\r\n return (\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n {showExpanded && }\r\n \r\n \r\n \r\n {\r\n canvasRef.current.handler.zoomHandler.zoomOut(1);\r\n }}\r\n >\r\n \r\n \r\n {\r\n canvasRef.current.handler.zoomHandler.zoomIn(1);\r\n }}\r\n >\r\n \r\n \r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default MapSelector;\r\n","import React, { useEffect, useRef, useState } from \"react\";\r\nimport { Layout, Button, Select } from \"antd\";\r\nimport {\r\n AimOutlined,\r\n GroupOutlined,\r\n ExpandOutlined\r\n} from \"@ant-design/icons\";\r\nimport { HubConnectionBuilder } from \"@microsoft/signalr\";\r\nimport { useDispatch } from \"react-redux\";\r\n\r\nimport \"../assets/libs/fontawesome-5.2.0/css/all.css\";\r\nimport \"../assets/styles/index.scss\";\r\n\r\nimport { Canvas } from \"../components/canvas\";\r\nimport service from \"../service\";\r\nimport {\r\n setSpinning,\r\n setSelectedSeats,\r\n} from \"../redux/designerPropertiesSlice\";\r\n\r\nconst MapBlocker = () => {\r\n const dispatch = useDispatch();\r\n const canvasRef = useRef();\r\n const [connection, setConnection] = useState(null);\r\n const [selectionType, setSelectionType] = useState('individual');\r\n\r\n useEffect(() => {\r\n dispatch(setSpinning(true));\r\n initScript();\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (connection) {\r\n connection\r\n .start()\r\n .then((result) => {\r\n console.log(\"Connected!\");\r\n connection.invoke(\"AddToEvent\", window.redseats.eventKey);\r\n connection.on(\"ChangeStatus\", (value) => {\r\n canvasRef.current.handler.blockerHandler.setType(\"row\");\r\n canvasRef.current.handler.blockerHandler.onChangeHub(value);\r\n });\r\n })\r\n .catch((e) => console.log(\"Connection failed: \", e));\r\n }\r\n }, [connection]);\r\n\r\n const initScript = async () => {\r\n window.redseats.setSettigs(process.env.REACT_APP_ENVIROMENT, \"Blocker\");\r\n if (window.redseats.publicKey) await init();\r\n else window.redseats.component.callback = init;\r\n };\r\n\r\n const init = async () => {\r\n const mapEvent = await service.mapEvent.buildNotForSale();\r\n if (mapEvent.key) {\r\n dispatch(setSelectedSeats(mapEvent.selectedSeats));\r\n const mapCanvas = JSON.parse(mapEvent.mapCanvas);\r\n await handlers.onLoad(mapCanvas);\r\n\r\n //signalr\r\n const newConnection = new HubConnectionBuilder()\r\n .withUrl(`${process.env.REACT_APP_HUB_URL}seat`)\r\n .withAutomaticReconnect()\r\n .build();\r\n\r\n setConnection(newConnection);\r\n }\r\n };\r\n\r\n const handlers = {\r\n onLoad: async ({ Objects }) => {\r\n if (Objects) {\r\n canvasRef.current.handler.clear(true);\r\n const data = Objects.filter((obj) => {\r\n return obj.id;\r\n });\r\n await canvasRef.current.handler.importJSON(data, \"blocker\");\r\n }\r\n\r\n canvasRef.current.handler.interactionMode = \"blocker\";\r\n canvasRef.current.handler.enablePanning = true;\r\n canvasRef.current.handler.zoomHandler.zoomToFit();\r\n canvasRef.current.handler.zoomHandler.zoomToFit();\r\n canvasRef.current.handler.canvasEnabled = true;\r\n //Obtenemos las zonas en el mapa\r\n let zones = canvasRef.current.handler.canvas.getObjects(\"group\").filter( group => group.superType == \"polygonZone\" );\r\n //Si existen zonas, se procede iterara cada una\r\n if(zones.length > 0){\r\n zones.forEach(zone => {\r\n //Obtenemos las filas dentro de la zona\r\n let rows = zone.getObjects(\"group\");\r\n //Si existen filas se procede a iterar cada una\r\n if(rows.length>0){\r\n rows.forEach(row => {\r\n //Hacemos visible cada fila\r\n row.set({\r\n visible: false\r\n });\r\n //Añadimos una copia al canvas\r\n canvasRef.current.handler.canvas.add(row);\r\n //Eliminamos la fila original de la zona\r\n zone.removeWithUpdate(row);\r\n });\r\n }\r\n //Ocultamos todo el objeto de la zona\r\n zone.set({visible: false})\r\n });\r\n }\r\n //Obtenemos todas las filas del mapa\r\n let rows = canvasRef.current.handler.canvas.getObjects(\"group\").filter( group => group.superType == \"row\" );\r\n rows.forEach(row => {\r\n //Obtenemos todos los asientos de cada fila\r\n let seats = row.getObjects(\"group\");\r\n //Ocultamos sus bordes y controles, además de blockear su movimiento\r\n seats.forEach(seat => {\r\n seat.hasBorders = false;\r\n seat.hasControls = false;\r\n seat.lockMovementX = true;\r\n seat.lockMovementY = true;\r\n })\r\n //Hacemos a la fila el objeto activo\r\n canvasRef.current.handler.canvas.setActiveObject(row);\r\n //La transformamos en selección activa para dividir el grupo\r\n row.toActiveSelection();\r\n //Descartamos los objetos activos\r\n canvasRef.current.handler.canvas.discardActiveObject();\r\n });\r\n canvasRef.current.handler.canvas.getObjects(\"textbox\").forEach( label => {\r\n label.selectable = false;\r\n } );\r\n canvasRef.current.handler.canvas.getObjects(\"group\").filter( group => group.superType != \"seat\" ).forEach( object => {\r\n object.selectable = false;\r\n } );\r\n canvasRef.current.handler.canvas.requestRenderAll();\r\n dispatch(setSpinning(false));\r\n },\r\n };\r\n\r\n const onClickHangler = () => {\r\n canvasRef.current.handler.blockerHandler.onSaveChanges();\r\n }\r\n\r\n const onChangeSelect = (value) => {\r\n canvasRef.current.handler.enablePanning = value == \"individual\" ? true : false;\r\n console.log('value', value)\r\n setSelectionType( value )\r\n }\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n {\r\n canvasRef.current.handler.zoomHandler.zoomOut(1);\r\n }}\r\n >\r\n \r\n \r\n {\r\n canvasRef.current.handler.zoomHandler.zoomIn(1);\r\n }}\r\n >\r\n \r\n \r\n \r\n Individual\r\n Grupo\r\n \r\n {\r\n onClickHangler()\r\n }}\r\n >\r\n Guardar cambios\r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default MapBlocker;\r\n","import React from \"react\";\r\n\r\nconst ChannelItem = ({ channel, selectChannel, index }) => {\r\n return (\r\n selectChannel(channel, index)}\r\n >\r\n {channel.name}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default ChannelItem;\r\n","import React, { useState } from \"react\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport {\r\n setChannelList,\r\n setSelectedChannel,\r\n} from \"../../../redux/designerPropertiesSlice\";\r\nimport ChannelItem from \"./ChannelItem\";\r\nimport store from \"../../../redux/store\";\r\n\r\nconst ChannelSelector: React.FC<{ onManageClick: () => void }> = ({\r\n onManageClick,\r\n}) => {\r\n const channelList = useSelector((state: any) => state.properties.channelList);\r\n\r\n const selectChannel = (updatedChannel, index) => {\r\n const updatedList = channelList.map((channel, i) => {\r\n let channelToUpdate = { ...channel };\r\n i === index\r\n ? (channelToUpdate.selected = true)\r\n : (channelToUpdate.selected = false);\r\n return { ...channel, ...channelToUpdate };\r\n });\r\n store.dispatch(setSelectedChannel({ ...updatedChannel }));\r\n store.dispatch(setChannelList(updatedList));\r\n };\r\n\r\n return (\r\n <>\r\n
\r\n \r\n
\r\n
\r\n {channelList.map((channel, index) => (\r\n \r\n ))}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default ChannelSelector;\r\n","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport ReactAce from 'react-ace';\r\nimport debounce from 'lodash/debounce';\r\n\r\nimport 'ace-builds/src-noconflict/mode-json';\r\nimport 'ace-builds/src-noconflict/theme-github';\r\n\r\nclass InputJson extends Component {\r\n\tstatic propTypes = {\r\n\t\tdefaultValue: PropTypes.string,\r\n\t\tvalue: PropTypes.string,\r\n\t\twidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\r\n\t\theight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\r\n\t\tonChange: PropTypes.func,\r\n\t\tonValidate: PropTypes.func,\r\n\t\tdisabled: PropTypes.bool,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\twidth: '100%',\r\n\t\theight: '200px',\r\n\t\tdisabled: false,\r\n\t};\r\n\r\n\tstate = {\r\n\t\ttext: this.props.value || '',\r\n\t};\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.debouncedValidate = debounce(errors => {\r\n\t\t\tconst { onValidate } = this.props;\r\n\t\t\tif (onValidate) {\r\n\t\t\t\tonValidate(errors);\r\n\t\t\t}\r\n\t\t\tconst { onChange } = this.props;\r\n\t\t\tif (onChange) {\r\n\t\t\t\tonChange(this.state.text);\r\n\t\t\t}\r\n\t\t}, 200);\r\n\t}\r\n\r\n\tUNSAFE_componentWillReceiveProps(nextProps) {\r\n\t\tif (nextProps.value !== this.props.value) {\r\n\t\t\tthis.setState({\r\n\t\t\t\ttext: nextProps.value,\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tonChange = (value, e) => {\r\n\t\tif (this.debouncedValidate) {\r\n\t\t\tthis.debouncedValidate();\r\n\t\t}\r\n\t\tthis.setState({\r\n\t\t\ttext: value,\r\n\t\t});\r\n\t};\r\n\r\n\tonValidate = annotations => {\r\n\t\tif (annotations.length) {\r\n\t\t\tconst errors = annotations\r\n\t\t\t\t.filter(annotation => annotation.type === 'error')\r\n\t\t\t\t.map(annotation => {\r\n\t\t\t\t\treturn new Error(`${annotation.row}:${annotation.column} ${annotation.text} error`);\r\n\t\t\t\t});\r\n\t\t\tthis.debouncedValidate(errors);\r\n\t\t}\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { defaultValue, width, height, disabled } = this.props;\r\n\t\tconst { text } = this.state;\r\n\t\treturn (\r\n\t\t\t {\r\n\t\t\t\t\tthis.aceRef = c;\r\n\t\t\t\t}}\r\n\t\t\t\tmode=\"json\"\r\n\t\t\t\ttheme=\"github\"\r\n\t\t\t\twidth={width}\r\n\t\t\t\theight={height}\r\n\t\t\t\tdefaultValue={defaultValue || text}\r\n\t\t\t\tvalue={text}\r\n\t\t\t\teditorProps={{\r\n\t\t\t\t\t$blockScrolling: true,\r\n\t\t\t\t}}\r\n\t\t\t\tonChange={this.onChange}\r\n\t\t\t\tonValidate={this.onValidate}\r\n\t\t\t\treadOnly={disabled}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default InputJson;\r\n","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Modal, Button, Form } from 'antd';\r\nimport ReactAce from 'react-ace';\r\nimport i18n from 'i18next';\r\n\r\nimport Icon from '../icon/Icon';\r\n\r\nimport 'ace-builds/src-noconflict/mode-javascript';\r\nimport 'ace-builds/src-noconflict/theme-github';\r\n\r\nclass CodeModal extends Component {\r\n\thandlers = {\r\n\t\tonOk: () => {\r\n\t\t\tconst { onChange } = this.props;\r\n\t\t\tconst { tempCode } = this.state;\r\n\t\t\tonChange(tempCode);\r\n\t\t\tthis.setState({\r\n\t\t\t\tvisible: false,\r\n\t\t\t\tcode: tempCode,\r\n\t\t\t});\r\n\t\t},\r\n\t\tonCancel: () => {\r\n\t\t\tthis.modalHandlers.onHide();\r\n\t\t},\r\n\t\tonClick: () => {\r\n\t\t\tthis.modalHandlers.onShow();\r\n\t\t},\r\n\t};\r\n\r\n\tmodalHandlers = {\r\n\t\tonShow: () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tvisible: true,\r\n\t\t\t});\r\n\t\t},\r\n\t\tonHide: () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tvisible: false,\r\n\t\t\t});\r\n\t\t},\r\n\t};\r\n\r\n\tstatic propTypes = {\r\n\t\tvalue: PropTypes.any,\r\n\t\tonChange: PropTypes.func,\r\n\t\tform: PropTypes.any,\r\n\t};\r\n\r\n\tstate = {\r\n\t\tcode: this.props.value,\r\n\t\ttempCode: this.props.value,\r\n\t\tvisible: false,\r\n\t};\r\n\r\n\tUNSAFE_componentWillReceiveProps(nextProps) {\r\n\t\tthis.setState({\r\n\t\t\tcode: nextProps.value,\r\n\t\t});\r\n\t}\r\n\r\n\trender() {\r\n\t\tconst { onOk, onCancel, onClick } = this.handlers;\r\n\t\tconst { form } = this.props;\r\n\t\tconst { getFieldDecorator } = form;\r\n\t\tconst { code, visible, tempCode } = this.state;\r\n\t\tconst label = (\r\n\t\t\t\r\n\t\t\t\t{i18n.t('common.code')}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t);\r\n\t\tconst codeLabel = Code (value, styles, animations, userProperty);\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{getFieldDecorator('trigger.code', {\r\n\t\t\t\t\t\tinitialValue: code || this.props.value,\r\n\t\t\t\t\t})(
{code}
)}\r\n\t\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\tthis.jsRef = c;\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tmode=\"javascript\"\r\n\t\t\t\t\t\t\ttheme=\"github\"\r\n\t\t\t\t\t\t\twidth=\"100%\"\r\n\t\t\t\t\t\t\theight=\"200px\"\r\n\t\t\t\t\t\t\tdefaultValue={code}\r\n\t\t\t\t\t\t\tvalue={tempCode}\r\n\t\t\t\t\t\t\teditorProps={{\r\n\t\t\t\t\t\t\t\t$blockScrolling: true,\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonChange={value => {\r\n\t\t\t\t\t\t\t\tthis.setState({ tempCode: value });\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default CodeModal;\r\n","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport ReactAce from 'react-ace';\r\nimport debounce from 'lodash/debounce';\r\n\r\nimport 'ace-builds/src-noconflict/mode-javascript';\r\nimport 'ace-builds/src-noconflict/theme-github';\r\n\r\nclass InputScript extends Component {\r\n\tstatic propTypes = {\r\n\t\tdefaultValue: PropTypes.string,\r\n\t\tvalue: PropTypes.string,\r\n\t\twidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\r\n\t\theight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\r\n\t\tonChange: PropTypes.func,\r\n\t\tonValidate: PropTypes.func,\r\n\t\tdisabled: PropTypes.bool,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\twidth: '100%',\r\n\t\theight: '200px',\r\n\t\tdisabled: false,\r\n\t};\r\n\r\n\tstate = {\r\n\t\ttext: this.props.value || '',\r\n\t};\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.debouncedValidate = debounce(errors => {\r\n\t\t\tconst { onValidate } = this.props;\r\n\t\t\tif (onValidate) {\r\n\t\t\t\tonValidate(errors);\r\n\t\t\t}\r\n\t\t\tconst { onChange } = this.props;\r\n\t\t\tif (onChange) {\r\n\t\t\t\tonChange(this.state.text);\r\n\t\t\t}\r\n\t\t}, 200);\r\n\t}\r\n\r\n\tUNSAFE_componentWillReceiveProps(nextProps) {\r\n\t\tif (nextProps.value !== this.props.value) {\r\n\t\t\tthis.setState({\r\n\t\t\t\ttext: nextProps.value,\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tonChange = (value, e) => {\r\n\t\tif (this.debouncedValidate) {\r\n\t\t\tthis.debouncedValidate();\r\n\t\t}\r\n\t\tthis.setState({\r\n\t\t\ttext: value,\r\n\t\t});\r\n\t};\r\n\r\n\tonValidate = annotations => {\r\n\t\tif (annotations.length) {\r\n\t\t\tconst errors = annotations\r\n\t\t\t\t.filter(annotation => annotation.type === 'error')\r\n\t\t\t\t.map(annotation => {\r\n\t\t\t\t\treturn new Error(`${annotation.row}:${annotation.column} ${annotation.text} error`);\r\n\t\t\t\t});\r\n\t\t\tthis.debouncedValidate(errors);\r\n\t\t}\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { defaultValue, width, height, dsiabled } = this.props;\r\n\t\tconst { text } = this.state;\r\n\t\treturn (\r\n\t\t\t {\r\n\t\t\t\t\tthis.aceRef = c;\r\n\t\t\t\t}}\r\n\t\t\t\tmode=\"javascript\"\r\n\t\t\t\ttheme=\"github\"\r\n\t\t\t\twidth={width}\r\n\t\t\t\theight={height}\r\n\t\t\t\tdefaultValue={defaultValue || text}\r\n\t\t\t\tvalue={text}\r\n\t\t\t\teditorProps={{\r\n\t\t\t\t\t$blockScrolling: true,\r\n\t\t\t\t}}\r\n\t\t\t\tonChange={this.onChange}\r\n\t\t\t\tonValidate={this.onValidate}\r\n\t\t\t\treadOnly={dsiabled}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default InputScript;\r\n","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport ReactAce from 'react-ace';\r\n\r\nimport 'ace-builds/src-noconflict/mode-handlebars';\r\nimport 'ace-builds/src-noconflict/theme-github';\r\n\r\nclass InputTemplate extends Component {\r\n\tstatic propTypes = {\r\n\t\tdefaultValue: PropTypes.string,\r\n\t\tvalue: PropTypes.string,\r\n\t\twidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\r\n\t\theight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\r\n\t\tshowLineNumbers: PropTypes.bool,\r\n\t\tnewLineMode: PropTypes.bool,\r\n\t\tdisabled: PropTypes.bool,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\twidth: '100%',\r\n\t\theight: '200px',\r\n\t\tshowLineNumbers: true,\r\n\t\tnewLineMode: true,\r\n\t\tdisabled: false,\r\n\t};\r\n\r\n\tstate = {\r\n\t\ttext: this.props.value || '',\r\n\t};\r\n\r\n\tcomponentDidMount() {\r\n\t\tif (!this.props.newLineMode) {\r\n\t\t\tthis.aceRef.editor.keyBinding.addKeyboardHandler((data, hashId, keyString, keyCode, e) => {\r\n\t\t\t\tif (keyCode === 13) {\r\n\t\t\t\t\treturn { command: 'null' }; // do nothing\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tUNSAFE_componentWillReceiveProps(nextProps) {\r\n\t\tthis.setState({\r\n\t\t\ttext: nextProps.value,\r\n\t\t});\r\n\t}\r\n\r\n\tonChange = value => {\r\n\t\tconst { onChange } = this.props;\r\n\t\tif (onChange) {\r\n\t\t\tonChange(value);\r\n\t\t}\r\n\t\tthis.setState({\r\n\t\t\ttext: value,\r\n\t\t});\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { defaultValue, width, height, showLineNumbers, newLineMode, disabled } = this.props;\r\n\t\tconst { text } = this.state;\r\n\t\treturn (\r\n\t\t\t {\r\n\t\t\t\t\tthis.aceRef = c;\r\n\t\t\t\t}}\r\n\t\t\t\tmode=\"handlebars\"\r\n\t\t\t\ttheme=\"github\"\r\n\t\t\t\twidth={width}\r\n\t\t\t\theight={height}\r\n\t\t\t\tdefaultValue={defaultValue || text}\r\n\t\t\t\tvalue={text}\r\n\t\t\t\teditorProps={{\r\n\t\t\t\t\t$blockScrolling: true,\r\n\t\t\t\t}}\r\n\t\t\t\tonChange={this.onChange}\r\n\t\t\t\tonValidate={this.onValidate}\r\n\t\t\t\tmaxLines={!newLineMode ? 1 : null}\r\n\t\t\t\tsetOptions={{\r\n\t\t\t\t\tshowLineNumbers,\r\n\t\t\t\t\tnewLineMode,\r\n\t\t\t\t\treadOnly: disabled,\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default InputTemplate;\r\n","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nclass AcePreview extends Component {\r\n\tstatic propTypes = {\r\n\t\thtml: PropTypes.string,\r\n\t\tcss: PropTypes.string,\r\n\t\tjs: PropTypes.string,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\thtml: '',\r\n\t\tcss: '',\r\n\t\tjs: '',\r\n\t};\r\n\r\n\tcomponentDidMount() {\r\n\t\tconst { html, css, js } = this.props;\r\n\t\tthis.iframeRender(html, css, js);\r\n\t}\r\n\r\n\tcomponentDidUpdate(prevProps) {\r\n\t\tif (this.container) {\r\n\t\t\tconst { html, css, js } = this.props;\r\n\t\t\tif (html !== prevProps.html || css !== prevProps.css || js !== prevProps.js) {\r\n\t\t\t\tthis.iframeRender(html, css, js);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tiframeRender = (html, css, js) => {\r\n\t\twhile (this.container.hasChildNodes()) {\r\n\t\t\tthis.container.removeChild(this.container.firstChild);\r\n\t\t}\r\n\t\tconst iframe = document.createElement('iframe');\r\n\t\tiframe.width = '100%';\r\n\t\tiframe.height = '200px';\r\n\t\tthis.container.appendChild(iframe);\r\n\t\tconst style = document.createElement('style');\r\n\t\tstyle.type = 'text/css';\r\n\t\tstyle.innerHTML = css;\r\n\t\tiframe.contentDocument.head.appendChild(style);\r\n\t\tconst script = document.createElement('script');\r\n\t\tscript.type = 'text/javascript';\r\n\t\tscript.innerHTML = js;\r\n\t\tiframe.contentDocument.head.appendChild(script);\r\n\t\tiframe.contentDocument.body.innerHTML = html;\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t {\r\n\t\t\t\t\tthis.container = c;\r\n\t\t\t\t}}\r\n\t\t\t\tid=\"code-preview\"\r\n\t\t\t\tstyle={{ width: '100%', height: 200 }}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default AcePreview;\r\n","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Form, Row, Col } from 'antd';\r\nimport debounce from 'lodash/debounce';\r\nimport ReactAce from 'react-ace';\r\n\r\nimport 'ace-builds/src-noconflict/mode-html';\r\nimport 'ace-builds/src-noconflict/mode-css';\r\nimport 'ace-builds/src-noconflict/mode-javascript';\r\nimport 'ace-builds/src-noconflict/theme-github';\r\n\r\nimport AcePreview from './AcePreview';\r\n\r\nconst defaultStyle = {\r\n padding: 12,\r\n};\r\n\r\nclass AceEditor extends Component {\r\n handlers = {\r\n onChangeHTML: debounce((value) => {\r\n this.setState({\r\n html: value,\r\n htmlAnnotations: this.htmlRef.editor.getSession().getAnnotations(),\r\n }, () => {\r\n if (this.props.onChangeHTML) {\r\n this.props.onChangeHTML(value);\r\n }\r\n });\r\n }, 500),\r\n onChangeCSS: debounce((value) => {\r\n this.setState({\r\n css: value,\r\n cssAnnotations: this.cssRef.editor.getSession().getAnnotations(),\r\n }, () => {\r\n if (this.props.onChangeCSS) {\r\n this.props.onChangeCSS(value);\r\n }\r\n });\r\n }, 500),\r\n onChangeJS: debounce((value) => {\r\n this.setState({\r\n js: value,\r\n jsAnnotations: this.jsRef.editor.getSession().getAnnotations(),\r\n }, () => {\r\n if (this.props.onChangeJS) {\r\n this.props.onChangeJS(value);\r\n }\r\n });\r\n }, 500),\r\n onValidateHTML: (annotations) => {\r\n let i = annotations.length;\r\n const len = annotations.length;\r\n while (i--) {\r\n if (/doctype first\\. Expected/.test(annotations[i].text)) {\r\n annotations.splice(i, 1);\r\n } else if (/Unexpected End of file\\. Expected/.test(annotations[i].text)) {\r\n annotations.splice(i, 1);\r\n }\r\n }\r\n if (len > annotations.length) {\r\n this.htmlRef.editor.getSession().setAnnotations(annotations);\r\n }\r\n },\r\n getAnnotations: () => {\r\n const { htmlAnnotations, cssAnnotations, jsAnnotations } = this.state;\r\n return {\r\n htmlAnnotations,\r\n cssAnnotations,\r\n jsAnnotations,\r\n };\r\n },\r\n getCodes: () => {\r\n const { html, css, js } = this.state;\r\n return {\r\n html,\r\n css,\r\n js,\r\n };\r\n },\r\n }\r\n\r\n static propTypes = {\r\n isHTML: PropTypes.bool,\r\n isCSS: PropTypes.bool,\r\n isJS: PropTypes.bool,\r\n isPreview: PropTypes.bool,\r\n html: PropTypes.string,\r\n css: PropTypes.string,\r\n js: PropTypes.string,\r\n }\r\n\r\n static defaultProps = {\r\n isHTML: true,\r\n isCSS: true,\r\n isJS: true,\r\n isPreview: true,\r\n html: '',\r\n css: '',\r\n js: '',\r\n }\r\n\r\n state = {\r\n html: this.props.html,\r\n css: this.props.css,\r\n js: this.props.js,\r\n htmlAnnotations: [],\r\n cssAnnotations: [],\r\n jsAnnotations: [],\r\n }\r\n\r\n componentWillUnmount() {\r\n this.htmlRef.editor.destroy();\r\n this.cssRef.editor.destroy();\r\n this.jsRef.editor.destroy();\r\n }\r\n\r\n render() {\r\n const { isHTML, isCSS, isJS, isPreview } = this.props;\r\n const { html, css, js } = this.state;\r\n return (\r\n \r\n {\r\n isHTML ? (\r\n \r\n \r\n { this.htmlRef = c; }}\r\n mode=\"html\"\r\n theme=\"github\"\r\n width=\"100%\"\r\n height=\"200px\"\r\n defaultValue={html}\r\n value={html}\r\n editorProps={{\r\n $blockScrolling: true,\r\n }}\r\n onChange={this.handlers.onChangeHTML}\r\n />\r\n \r\n \r\n ) : null\r\n }\r\n {\r\n isCSS ? (\r\n \r\n \r\n { this.cssRef = c; }}\r\n mode=\"css\"\r\n theme=\"github\"\r\n width=\"100%\"\r\n height=\"200px\"\r\n defaultValue={css}\r\n value={css}\r\n editorProps={{\r\n $blockScrolling: true,\r\n }}\r\n onChange={this.handlers.onChangeCSS}\r\n />\r\n \r\n \r\n ) : null\r\n }\r\n {\r\n isJS ? (\r\n \r\n \r\n { this.jsRef = c; }}\r\n mode=\"javascript\"\r\n theme=\"github\"\r\n width=\"100%\"\r\n height=\"200px\"\r\n defaultValue={js}\r\n value={js}\r\n editorProps={{\r\n $blockScrolling: true,\r\n }}\r\n onChange={this.handlers.onChangeJS}\r\n />\r\n \r\n \r\n ) : null\r\n }\r\n {\r\n isPreview ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : null\r\n }\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default AceEditor;\r\n","import React, {useEffect, useState} from 'react';\r\n\r\nimport ReactAce from 'react-ace';\r\nimport debounce from 'lodash/debounce';\r\n\r\nimport 'ace-builds/src-noconflict/mode-html';\r\nimport 'ace-builds/src-noconflict/theme-github';\r\nimport aceEditor from \"../ace/AceEditor\";\r\n\r\nconst InputJson = (defaultValue, width, height, disabled, value, onChange) => {\r\n\r\n\t//let aceRef = useRef(aceEditor.aceRef);\r\n\r\n\tlet [text, setText] = useState(value || '');\r\n\r\n\tonChange = (value, e) => {\r\n\t\tif (debouncedValidate) {\r\n\t\t\tdebouncedValidate();\r\n\t\t}\r\n\t\tsetText(value);\r\n\t};\r\n\r\n\tconst onValidate = annotations => {\r\n\t\tif (annotations.length) {\r\n\t\t\tconst errors = annotations\r\n\t\t\t\t.filter(annotation => annotation.type === 'error')\r\n\t\t\t\t.map(annotation => {\r\n\t\t\t\t\treturn new Error(`${annotation.row}:${annotation.column} ${annotation.text} error`);\r\n\t\t\t\t});\r\n\t\t\tdebouncedValidate(errors);\r\n\t\t}\r\n\t};\r\n\r\n\tconst debouncedValidate = debounce(errors => {\r\n\t\tif (onValidate) onValidate(errors);\r\n\t\tif (onChange) onChange(text);\r\n\t}, 200);\r\n\r\n\tuseEffect(() => {\r\n\t\treturn (nextProps) => {\r\n\t\t\tif (nextProps.value !== this.props.value) {\r\n\t\t\t\tsetText(nextProps.value);\r\n\t\t\t}\r\n\t\t};\r\n\t}, []);\r\n\r\n\r\n\treturn (\r\n\t\t aceEditor.aceRef = c}\r\n\t\t\tmode=\"html\"\r\n\t\t\ttheme=\"github\"\r\n\t\t\twidth={width}\r\n\t\t\theight={height}\r\n\t\t\tdefaultValue={defaultValue || text}\r\n\t\t\tvalue={text}\r\n\t\t\teditorProps={{\r\n\t\t\t\t$blockScrolling: true,\r\n\t\t\t}}\r\n\t\t\tonChange={onChange}\r\n\t\t\tonValidate={onValidate}\r\n\t\t\treadOnly={disabled}\r\n\t\t/>\r\n\t);\r\n}\r\n\r\nexport default InputJson;\r\n","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Form, Modal, Button, Input } from 'antd';\r\nimport i18n from 'i18next';\r\n\r\nimport Icon from '../icon/Icon';\r\n\r\nclass UrlModal extends Component {\r\n\thandlers = {\r\n\t\tonOk: () => {\r\n\t\t\tconst { onChange } = this.props;\r\n\t\t\tconst { tempUrl } = this.state;\r\n\t\t\tonChange(tempUrl);\r\n\t\t\tthis.setState({\r\n\t\t\t\tvisible: false,\r\n\t\t\t\turl: tempUrl,\r\n\t\t\t});\r\n\t\t},\r\n\t\tonCancel: () => {\r\n\t\t\tthis.modalHandlers.onHide();\r\n\t\t},\r\n\t\tonClick: () => {\r\n\t\t\tthis.modalHandlers.onShow();\r\n\t\t},\r\n\t};\r\n\r\n\tmodalHandlers = {\r\n\t\tonShow: () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tvisible: true,\r\n\t\t\t});\r\n\t\t},\r\n\t\tonHide: () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tvisible: false,\r\n\t\t\t});\r\n\t\t},\r\n\t};\r\n\r\n\tstatic propTypes = {\r\n\t\tvalue: PropTypes.any,\r\n\t\tonChange: PropTypes.func,\r\n\t\tform: PropTypes.any,\r\n\t};\r\n\r\n\tstate = {\r\n\t\turl: this.props.value || '',\r\n\t\ttempUrl: '',\r\n\t\tvisible: false,\r\n\t};\r\n\r\n\tUNSAFE_componentWillReceiveProps(nextProps) {\r\n\t\tthis.setState({\r\n\t\t\turl: nextProps.value || '',\r\n\t\t});\r\n\t}\r\n\r\n\trender() {\r\n\t\tconst { onOk, onCancel, onClick } = this.handlers;\r\n\t\tconst { form } = this.props;\r\n\t\tconst { getFieldDecorator } = form;\r\n\t\tconst { url, visible } = this.state;\r\n\t\tconst label = (\r\n\t\t\t\r\n\t\t\t\t{i18n.t('common.url')}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t);\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{getFieldDecorator('url', {\r\n\t\t\t\t\t\trules: [\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\trequired: true,\r\n\t\t\t\t\t\t\t\tmessage: i18n.t('validation.enter-property', { arg: i18n.t('common.url') }),\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t\tinitialValue: url || '',\r\n\t\t\t\t\t})({url})}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\tthis.setState({ tempUrl: e.target.value });\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default UrlModal;\r\n","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Modal, Form, Radio } from 'antd';\r\nimport i18n from 'i18next';\r\n\r\nimport { InputHtml } from '.';\r\nimport FileUpload from './FileUpload';\r\n\r\nclass SVGModal extends Component {\r\n\tstatic propTypes = {\r\n\t\tonOk: PropTypes.func.isRequired,\r\n\t\tonCancel: PropTypes.func,\r\n\t\tvisible: PropTypes.bool.isRequired,\r\n\t};\r\n\r\n\tstate = {\r\n\t\tloadType: 'file',\r\n\t\tvisible: false,\r\n\t};\r\n\r\n\tUNSAFE_componentWillReceiveProps(nextProps) {\r\n\t\tif (nextProps.visible !== this.props.visible) {\r\n\t\t\tthis.setState({\r\n\t\t\t\tvisible: nextProps.visible,\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\thandleChangeSvgType = e => {\r\n\t\tthis.props.form.resetFields();\r\n\t\tthis.setState({\r\n\t\t\tloadType: e.target.value,\r\n\t\t});\r\n\t};\r\n\r\n\thandleOk = () => {\r\n\t\tconst { form, onOk } = this.props;\r\n\t\tform.validateFields((err, values) => {\r\n\t\t\tif (err) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (values.svg instanceof Blob) {\r\n\t\t\t\tconst reader = new FileReader();\r\n\t\t\t\treader.readAsDataURL(values.svg);\r\n\t\t\t\treader.onload = () => {\r\n\t\t\t\t\tonOk({ ...values, svg: reader.result });\r\n\t\t\t\t};\r\n\t\t\t} else {\r\n\t\t\t\tonOk(values);\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\thandleCancel = () => {\r\n\t\tconst { onCancel } = this.props;\r\n\t\tif (onCancel) {\r\n\t\t\tonCancel();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.setState({\r\n\t\t\tvisible: false,\r\n\t\t});\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { form } = this.props;\r\n\t\tconst { loadType, visible } = this.state;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{form.getFieldDecorator('loadType', {\r\n\t\t\t\t\t\t\tinitialValue: loadType,\r\n\t\t\t\t\t\t})(\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{i18n.t('common.file')}\r\n\t\t\t\t\t\t\t\t{i18n.t('common.svg')}\r\n\t\t\t\t\t\t\t,\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{form.getFieldDecorator('svg', {\r\n\t\t\t\t\t\t\trules: [\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\trequired: true,\r\n\t\t\t\t\t\t\t\t\tmessage: i18n.t('validation.enter-property', {\r\n\t\t\t\t\t\t\t\t\t\targ: loadType === 'svg' ? i18n.t('common.svg') : i18n.t('common.file'),\r\n\t\t\t\t\t\t\t\t\t}),\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t],\r\n\t\t\t\t\t\t})(loadType === 'svg' ? : )}\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default Form.create()(SVGModal);\r\n","import React, { useState } from \"react\";\r\nimport { ColorPicker } from \"../../tools/common\";\r\n\r\n\r\nconst ChannelItemManagement = ({ channel, updateList, deleteChannel, index }) => {\r\n\r\n const [channelName, setChannelName] = useState(channel.name);\r\n const [channelColor, setChannelColor] = useState(channel.color);\r\n const [channelAction, setChannelAction] = useState(channel.action);\r\n\r\n const handleInputChange = (event: React.ChangeEvent) => {\r\n setChannelName(event.target.value);\r\n if(channel.key){\r\n setChannelAction(\"Update\");\r\n updateList({ ...channel, name: event.target.value, action: \"Update\"}, index);\r\n return;\r\n }\r\n updateList({ ...channel, name: event.target.value}, index);\r\n };\r\n\r\n const handleColorChange = (newColor: string) => {\r\n setChannelColor(newColor);\r\n if(channel.key){\r\n setChannelAction(\"Update\");\r\n updateList({ ...channel, action: \"Update\", color: newColor}, index);\r\n return;\r\n }\r\n updateList({ ...channel, color: newColor}, index);\r\n };\r\n\r\n const handleDelete = () => {\r\n if(channel.key){\r\n setChannelAction(\"Delete\");\r\n updateList({ ...channel, action: \"Delete\"}, index);\r\n return;\r\n }\r\n deleteChannel(channel.timestamp);\r\n }\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n {/* { channel.assignedSeats == 0 && } */}\r\n
\r\n );\r\n };\r\n\r\nexport default ChannelItemManagement;","import React, { useState } from \"react\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport ChannelItemManagement from \"./ChannelItemManagement\";\r\n\r\nconst ChannelManagement: React.FC<{\r\n onClose: () => void;\r\n saveChannels: (channels) => void;\r\n}> = ({ onClose, saveChannels }) => {\r\n const originalChannelList = useSelector(\r\n (state: any) => state.properties.channelList\r\n );\r\n\r\n const [list, setList] = useState([...originalChannelList.slice(1)]);\r\n\r\n const createChannel = () => {\r\n let newChannel = {\r\n name: \"Nuevo canal\",\r\n color: \"red\",\r\n key: null,\r\n action: \"Create\",\r\n timestamp: Date.now(),\r\n selected: false\r\n };\r\n setList([...list, newChannel]);\r\n };\r\n\r\n const handleConfirm = async () => {\r\n const channelsToSave = list.filter((channel) => channel.action != \"None\");\r\n await saveChannels(channelsToSave);\r\n };\r\n\r\n const updateList = (updatedChannel, index) => {\r\n const updatedList = list.map((channel, i) =>\r\n i === index ? { ...channel, ...updatedChannel } : channel\r\n );\r\n setList(updatedList);\r\n };\r\n\r\n const deleteChannel = (timestamp: string) => {\r\n setList((prevList) =>\r\n prevList.filter((channel) => channel.timestamp !== timestamp)\r\n );\r\n };\r\n\r\n return (\r\n
\r\n
\r\n
\r\n

Administrar canales

\r\n \r\n
\r\n
\r\n {list.map(\r\n (channel, index) =>\r\n channel.action !== \"Delete\" && (\r\n \r\n )\r\n )}\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default ChannelManagement;\r\n","import React, { useEffect, useRef, useState } from \"react\";\r\nimport { Button, Select } from \"antd\";\r\nimport { AimOutlined, GroupOutlined, MenuOutlined, SaveOutlined } from \"@ant-design/icons\";\r\nimport { HubConnectionBuilder } from \"@microsoft/signalr\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport \"../assets/libs/fontawesome-5.2.0/css/all.css\";\r\nimport \"../assets/styles/index.scss\";\r\nimport { Canvas } from \"../components/canvas\";\r\nimport service from \"../service\";\r\nimport {\r\n setSpinning,\r\n setSelectedSeats,\r\n setChannelList,\r\n} from \"../redux/designerPropertiesSlice\";\r\nimport ChannelSelector from \"../components/canvas/channels/ChannelSelector\";\r\nimport ChannelManagement from \"../components/canvas/channels/ChannelManagement\";\r\n\r\nconst MapChannel = () => {\r\n const dispatch = useDispatch();\r\n const canvasRef = useRef();\r\n const [connection, setConnection] = useState(null);\r\n const [selectionType, setSelectionType] = useState(\"individual\");\r\n const [showManagement, setShowManagement] = useState(false);\r\n\r\n const onManageClick = () => {\r\n setShowManagement(true);\r\n };\r\n\r\n const handleCloseManagement = () => {\r\n setShowManagement(false);\r\n };\r\n\r\n useEffect(() => {\r\n dispatch(setSpinning(true));\r\n initScript();\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (connection) {\r\n connection\r\n .start()\r\n .then((result) => {\r\n console.log(\"Connected!\");\r\n connection.invoke(\"AddToEvent\", window.redseats.eventKey);\r\n connection.on(\"ChangeStatus\", (value) => {\r\n canvasRef.current.handler.channelHandler.setType(\"row\");\r\n canvasRef.current.handler.channelHandler.onChangeHub(value);\r\n });\r\n })\r\n .catch((e) => console.log(\"Connection failed: \", e));\r\n }\r\n }, [connection]);\r\n\r\n const initScript = async () => {\r\n window.redseats.setSettigs(process.env.REACT_APP_ENVIROMENT, \"Channel\");\r\n if (window.redseats.publicKey) await init();\r\n else window.redseats.component.callback = init;\r\n };\r\n\r\n const init = async () => {\r\n const mapEvent = await service.mapEvent.buildChannel();\r\n if (mapEvent.key) {\r\n await setChannels();\r\n // dispatch(setSelectedSeats(mapEvent.selectedSeats));\r\n const mapCanvas = JSON.parse(mapEvent.mapCanvas);\r\n await handlers.onLoad(mapCanvas);\r\n\r\n //signalr\r\n const newConnection = new HubConnectionBuilder()\r\n .withUrl(`${process.env.REACT_APP_HUB_URL}seat`)\r\n .withAutomaticReconnect()\r\n .build();\r\n\r\n setConnection(newConnection);\r\n }\r\n };\r\n\r\n const handlers = {\r\n onLoad: async ({ Objects }) => {\r\n if (Objects) {\r\n canvasRef.current.handler.clear(true);\r\n const data = Objects.filter((obj) => {\r\n return obj.id;\r\n });\r\n await canvasRef.current.handler.importJSON(data);\r\n }\r\n\r\n canvasRef.current.handler.interactionMode = \"channel\";\r\n canvasRef.current.handler.enablePanning = true;\r\n canvasRef.current.handler.zoomHandler.zoomToFit();\r\n canvasRef.current.handler.zoomHandler.zoomToFit();\r\n canvasRef.current.handler.canvasEnabled = true;\r\n //Obtenemos las zonas en el mapa\r\n let zones = canvasRef.current.handler.canvas\r\n .getObjects(\"group\")\r\n .filter((group) => group.superType == \"polygonZone\");\r\n //Si existen zonas, se procede iterara cada una\r\n if (zones.length > 0) {\r\n zones.forEach((zone) => {\r\n //Obtenemos las filas dentro de la zona\r\n let rows = zone.getObjects(\"group\");\r\n //Si existen filas se procede a iterar cada una\r\n if (rows.length > 0) {\r\n rows.forEach((row) => {\r\n //Hacemos visible cada fila\r\n row.set({\r\n visible: false,\r\n });\r\n //Añadimos una copia al canvas\r\n canvasRef.current.handler.canvas.add(row);\r\n //Eliminamos la fila original de la zona\r\n zone.removeWithUpdate(row);\r\n });\r\n }\r\n //Ocultamos todo el objeto de la zona\r\n zone.set({ visible: false });\r\n });\r\n }\r\n //Obtenemos todas las filas del mapa\r\n let rows = canvasRef.current.handler.canvas\r\n .getObjects(\"group\")\r\n .filter((group) => group.superType == \"row\");\r\n rows.forEach((row) => {\r\n //Obtenemos todos los asientos de cada fila\r\n let seats = row.getObjects(\"group\");\r\n //Ocultamos sus bordes y controles, además de blockear su movimiento\r\n seats.forEach((seat) => {\r\n seat.hasBorders = false;\r\n seat.hasControls = false;\r\n seat.lockMovementX = true;\r\n seat.lockMovementY = true;\r\n });\r\n //Hacemos a la fila el objeto activo\r\n canvasRef.current.handler.canvas.setActiveObject(row);\r\n //La transformamos en selección activa para dividir el grupo\r\n row.toActiveSelection();\r\n //Descartamos los objetos activos\r\n canvasRef.current.handler.canvas.discardActiveObject();\r\n });\r\n canvasRef.current.handler.canvas\r\n .getObjects(\"textbox\")\r\n .forEach((label) => {\r\n label.selectable = false;\r\n });\r\n canvasRef.current.handler.canvas\r\n .getObjects(\"group\")\r\n .filter((group) => group.superType != \"seat\")\r\n .forEach((object) => {\r\n object.selectable = false;\r\n });\r\n canvasRef.current.handler.canvas.requestRenderAll();\r\n dispatch(setSpinning(false));\r\n },\r\n };\r\n\r\n const onClickHangler = () => {\r\n canvasRef.current.handler.channelHandler.onSaveChanges();\r\n };\r\n\r\n const onChangeSelect = (value) => {\r\n canvasRef.current.handler.enablePanning =\r\n value == \"individual\" ? true : false;\r\n setSelectionType(value);\r\n };\r\n\r\n const saveChannels = async (channelsToSave) => {\r\n await service.channel.saveChannels(channelsToSave);\r\n await setChannels();\r\n await init();\r\n setShowManagement(false);\r\n };\r\n\r\n const setChannels = async () => {\r\n let channels = [\r\n { name: \"Sin canal\", color: \"#FFFFFF\", selected: false, key: \"sn\" },\r\n ];\r\n const response = await service.channel.getChannels();\r\n if (response) {\r\n response.forEach((channel) => {\r\n channel.selected = false;\r\n channel.action = \"None\";\r\n });\r\n channels = channels.concat(response);\r\n }\r\n dispatch(setChannelList(channels));\r\n };\r\n\r\n const [showAside, setShowAside] = useState(false);\r\n const handleShowAside = () => {\r\n setShowAside(!showAside);\r\n };\r\n\r\n return (\r\n
\r\n \r\n
\r\n \r\n\r\n \r\n
\r\n {\r\n canvasRef.current.handler.zoomHandler.zoomOut(1);\r\n }}\r\n >\r\n \r\n \r\n {\r\n canvasRef.current.handler.zoomHandler.zoomIn(1);\r\n }}\r\n >\r\n \r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default MapChannel;\r\n","import React, { useEffect, useRef, useState } from \"react\";\r\nimport { Button } from \"antd\";\r\nimport { HubConnectionBuilder } from \"@microsoft/signalr\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport {\r\n ExpandOutlined,\r\n FullscreenExitOutlined,\r\n FullscreenOutlined,\r\n} from \"@ant-design/icons\";\r\n\r\nimport \"../assets/libs/fontawesome-5.2.0/css/all.css\";\r\nimport \"../assets/styles/index.scss\";\r\n\r\nimport { Canvas } from \"../components/canvas\";\r\nimport service from \"../service\";\r\nimport {\r\n setSpinning,\r\n} from \"../redux/designerPropertiesSlice\";\r\n\r\nconst MapDetail = () => {\r\n const dispatch = useDispatch();\r\n const canvasRef = useRef();\r\n const [connection, setConnection] = useState(null);\r\n const [expanded, setExpanded] = useState(false);\r\n const [showExpanded, setShowExpanded] = useState(false);\r\n\r\n useEffect(() => {\r\n dispatch(setSpinning(true));\r\n initScript();\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (connection) {\r\n connection\r\n .start()\r\n .then((result) => {\r\n console.log(\"Connected!\");\r\n connection.invoke(\"AddToEvent\", window.redseats.eventKey);\r\n connection.on(\"ChangeStatus\", (value) => {\r\n canvasRef.current.handler.selectorHandler.setType(\"row\");\r\n canvasRef.current.handler.selectorHandler.onChangeHub(value);\r\n });\r\n })\r\n .catch((e) => console.log(\"Connection failed: \", e));\r\n }\r\n }, [connection]);\r\n\r\n const onExpandHandler = () => {\r\n if (!expanded) {\r\n window.redseats.onExpand(true);\r\n } else {\r\n window.redseats.onMinimize(false);\r\n }\r\n setTimeout(() => {\r\n canvasRef.current.handler.zoomHandler.zoomToFit();\r\n }, 500);\r\n setExpanded(!expanded);\r\n };\r\n\r\n const initScript = async () => {\r\n window.redseats.setSettigs(process.env.REACT_APP_ENVIROMENT, \"Detail\");\r\n if (window.redseats.publicKey) await init();\r\n else window.redseats.component.callback = init;\r\n };\r\n\r\n const init = async () => {\r\n const mapEvent = await service.mapEvent.buildDetail();\r\n if (mapEvent.key) {\r\n setShowExpanded(window.redseats.showFullScreenButton);\r\n const mapCanvas = JSON.parse(mapEvent.mapCanvas);\r\n await handlers.onLoad(mapCanvas);\r\n\r\n //signalr\r\n const newConnection = new HubConnectionBuilder()\r\n .withUrl(`${process.env.REACT_APP_HUB_URL}seat`)\r\n .withAutomaticReconnect()\r\n .build();\r\n\r\n setConnection(newConnection);\r\n }\r\n };\r\n\r\n const handlers = {\r\n onLoad: async ({ Objects }, category) => {\r\n if (Objects) {\r\n canvasRef.current.handler.clear(true);\r\n const data = Objects.filter((obj) => {\r\n return obj.id;\r\n });\r\n await canvasRef.current.handler.importJSON(data, \"detail\");\r\n }\r\n canvasRef.current.handler.interactionMode = \"detail\";\r\n canvasRef.current.handler.zoomHandler.zoomToFit();\r\n canvasRef.current.handler.zoomHandler.zoomToFit();\r\n let zones = canvasRef.current.handler.canvas.getObjects(\"group\").filter(group => group.superType == \"polygonZone\");\r\n if (zones.length > 0) {\r\n zones.map(zone => {\r\n let groupLeft = zone.left || 0;\r\n let groupTop = zone.top || 0;\r\n let rows = zone.getObjects(\"group\");\r\n if (rows.length > 0) {\r\n rows.map(row => {\r\n row.set({\r\n zoneID: zone.id,\r\n left: groupLeft + (zone.width / 2) + row.left,\r\n top: groupTop + (zone.height / 2) + row.top,\r\n __eventListeners: zone.__eventListeners\r\n });\r\n canvasRef.current.handler.canvas.add(row);\r\n });\r\n zone._objects = zone._objects.slice(0, 2);\r\n }\r\n });\r\n }\r\n let rows = canvasRef.current.handler.canvas.getObjects(\"group\").filter(group => group.superType == \"row\");\r\n rows.forEach(row => {\r\n let seats = row.getObjects(\"group\");\r\n seats.forEach(seat => {\r\n seat.set({\r\n rowLabel: row.row.label,\r\n sectionLabel: row.section.label,\r\n zoneID: row.zoneID,\r\n __eventListeners: row.__eventListeners\r\n })\r\n });\r\n canvasRef.current.handler.canvas.setActiveObject(row);\r\n row.toActiveSelection();\r\n canvasRef.current.handler.canvas.discardActiveObject();\r\n });\r\n zones.forEach(zone => {\r\n // canvasRef.current.handler.canvas.remove(zone);\r\n let shape = zone.item(0);\r\n if (+zone.category.key != +category) {\r\n shape.set({\r\n visible: false\r\n });\r\n\r\n }\r\n else {\r\n shape.set({\r\n opacity: 0.9\r\n });\r\n }\r\n canvasRef.current.handler.canvas.bringToFront(zone);\r\n }\r\n )\r\n canvasRef.current.handler.canvas.requestRenderAll();\r\n canvasRef.current.handler.canvasEnabled = true;\r\n dispatch(setSpinning(false));\r\n },\r\n };\r\n\r\n const clickHandler = () => {\r\n canvasRef.current.handler.zoomHandler.zoomToFit();\r\n if (canvasRef.current.handler.activeZoneSelector) {\r\n console.log('canvasRef.current.handler.activeZoneSelector', canvasRef.current.handler.activeZoneSelector)\r\n const shape = canvasRef.current.handler.activeZoneSelector.item(0);\r\n const text = canvasRef.current.handler.activeZoneSelector.item(1);\r\n shape.set({ visible: true });\r\n text.set({ visible: true });\r\n canvasRef.current.handler.activeZoneSelector = undefined;\r\n }\r\n }\r\n\r\n return (\r\n
\r\n
\r\n
\r\n {showExpanded && }\r\n \r\n \r\n \r\n {\r\n canvasRef.current.handler.zoomHandler.zoomOut(1);\r\n }}\r\n >\r\n \r\n \r\n {\r\n canvasRef.current.handler.zoomHandler.zoomIn(1);\r\n }}\r\n >\r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default MapDetail;\r\n","import React from \"react\";\r\nimport { Routes, Route } from \"react-router-dom\";\r\n\r\nimport Layout from \"./pages/Layout\";\r\nimport MapEditor from \"./pages/MapEditor\";\r\nimport MapSelector from \"./pages/MapSelector\";\r\nimport MapBlocker from \"./pages/MapBlocker\";\r\nimport MapChannel from \"./pages/MapChannel\";\r\nimport MapDetail from \"./pages/MapDetail\";\r\n\r\nconst App = () => {\r\n return (\r\n \r\n }>\r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n \r\n \r\n );\r\n};\r\n\r\nexport default App;\r\n","import React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\n\r\nimport esEs from \"antd/lib/locale-provider/es_ES\";\r\nimport { i18n } from \"./assets/libs/i18n\";\r\n\r\nimport App from \"./App\";\r\nimport { BrowserRouter } from \"react-router-dom\";\r\nimport { LocaleProvider } from \"antd\";\r\nimport { Provider } from \"react-redux\";\r\nimport store from \"./redux/store\";\r\n\r\nconst resources = {\r\n es: esEs,\r\n \"es-ES\": esEs,\r\n};\r\n\r\nReactDOM.render(\r\n \r\n \r\n \r\n \r\n \r\n \r\n ,\r\n document.getElementById(\"root\")\r\n);\r\n"],"sourceRoot":""}