@logicflow/extension 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +56 -387
- package/CHANGELOG.md +15 -0
- package/dist/index.css +87 -84
- package/dist/index.min.js +1 -41
- package/dist/index.min.js.map +1 -1
- package/es/NodeResize/BasicShape/Ellipse.js +0 -1
- package/es/NodeResize/BasicShape/Polygon.js +0 -1
- package/es/NodeResize/BasicShape/Rect.js +0 -1
- package/es/NodeResize/control/Control.js +0 -1
- package/es/NodeResize/control/ControlGroup.js +0 -1
- package/es/NodeResize/control/Util.js +0 -1
- package/es/NodeResize/index.js +0 -1
- package/es/NodeResize/node/DiamondResize.js +0 -1
- package/es/NodeResize/node/EllipseResize.js +0 -1
- package/es/NodeResize/node/HtmlResize.js +0 -1
- package/es/NodeResize/node/RectResize.js +0 -1
- package/es/NodeResize/node/index.js +0 -1
- package/es/bpmn/constant.js +0 -1
- package/es/bpmn/events/EndEvent.js +0 -1
- package/es/bpmn/events/StartEvent.js +0 -1
- package/es/bpmn/events/index.js +0 -1
- package/es/bpmn/flow/SequenceFlow.js +0 -1
- package/es/bpmn/flow/index.js +0 -1
- package/es/bpmn/gateways/ExclusiveGateway.js +0 -1
- package/es/bpmn/gateways/index.js +0 -1
- package/es/bpmn/getBpmnId.js +0 -1
- package/es/bpmn/index.js +0 -1
- package/es/bpmn/tasks/ServiceTask.js +0 -1
- package/es/bpmn/tasks/UserTask.js +0 -1
- package/es/bpmn/tasks/index.js +0 -1
- package/es/bpmn-adapter/bpmnIds.js +0 -1
- package/es/bpmn-adapter/index.js +0 -1
- package/es/bpmn-adapter/json2xml.js +0 -1
- package/es/bpmn-adapter/xml2json.js +0 -1
- package/es/bpmn-elements/index.js +0 -1
- package/es/bpmn-elements/presets/Event/EndEventFactory.js +0 -1
- package/es/bpmn-elements/presets/Event/IntermediateCatchEvent.js +0 -1
- package/es/bpmn-elements/presets/Event/IntermediateThrowEvent.js +0 -1
- package/es/bpmn-elements/presets/Event/StartEventFactory.js +0 -1
- package/es/bpmn-elements/presets/Event/boundaryEventFactory.js +0 -1
- package/es/bpmn-elements/presets/Event/index.js +0 -1
- package/es/bpmn-elements/presets/Flow/index.js +0 -1
- package/es/bpmn-elements/presets/Flow/manhattan.js +0 -1
- package/es/bpmn-elements/presets/Flow/sequenceFlow.js +0 -1
- package/es/bpmn-elements/presets/Gateway/gateway.js +0 -1
- package/es/bpmn-elements/presets/Gateway/index.js +0 -1
- package/es/bpmn-elements/presets/Pool/Lane.js +0 -1
- package/es/bpmn-elements/presets/Pool/Pool.js +0 -1
- package/es/bpmn-elements/presets/Pool/index.js +0 -1
- package/es/bpmn-elements/presets/Task/index.js +0 -1
- package/es/bpmn-elements/presets/Task/subProcess.js +0 -1
- package/es/bpmn-elements/presets/Task/task.js +0 -1
- package/es/bpmn-elements/presets/icons.js +0 -1
- package/es/bpmn-elements/utils.js +0 -1
- package/es/bpmn-elements-adapter/constant.js +0 -1
- package/es/bpmn-elements-adapter/index.js +0 -1
- package/es/bpmn-elements-adapter/json2xml.js +0 -1
- package/es/bpmn-elements-adapter/xml2json.js +0 -1
- package/es/components/context-menu/index.js +0 -1
- package/es/components/control/index.js +0 -1
- package/es/components/dnd-panel/index.js +0 -1
- package/es/components/highlight/index.js +0 -1
- package/es/components/menu/index.d.ts +4 -1
- package/es/components/menu/index.js +5 -5
- package/es/components/mini-map/index.js +0 -1
- package/es/components/selection-select/index.js +0 -1
- package/es/dynamic-group/index.js +0 -2
- package/es/dynamic-group/model.js +0 -1
- package/es/dynamic-group/node.js +0 -1
- package/es/dynamic-group/utils.js +0 -1
- package/es/index.css +63 -0
- package/es/index.js +0 -1
- package/es/insert-node-in-polyline/edge.js +0 -1
- package/es/insert-node-in-polyline/index.js +0 -1
- package/es/materials/curved-edge/__test__/curved-edge.test.js +0 -1
- package/es/materials/curved-edge/index.js +0 -1
- package/es/materials/group/GroupNode.js +0 -1
- package/es/materials/group/index.js +0 -1
- package/es/materials/node-selection/index.js +0 -1
- package/es/mindmap/fakerRoot.js +0 -1
- package/es/mindmap/index.js +0 -1
- package/es/mindmap/markContent.js +0 -1
- package/es/mindmap/markContentOption.js +0 -1
- package/es/mindmap/markEntity.js +0 -1
- package/es/mindmap/markRoot.js +0 -1
- package/es/mindmap/theme.js +0 -1
- package/es/rect-label-node/RectLabelNodeView.js +0 -1
- package/es/rect-label-node/index.js +0 -1
- package/es/style/index.css +63 -0
- package/es/style/index.less +72 -0
- package/es/style/raw.d.ts +1 -1
- package/es/style/raw.js +1 -2
- package/es/tools/auto-layout/index.js +0 -1
- package/es/tools/flow-path/index.js +0 -1
- package/es/tools/label/Label.js +0 -1
- package/es/tools/label/LabelModel.js +0 -1
- package/es/tools/label/LabelOverlay.js +0 -1
- package/es/tools/label/algorithm.js +0 -1
- package/es/tools/label/index.d.ts +0 -1
- package/es/tools/label/index.js +0 -5
- package/es/tools/label/mediumEditor.js +0 -1
- package/es/tools/label/utils.js +0 -1
- package/es/tools/snapshot/index.js +0 -1
- package/es/tools/snapshot/utils.js +0 -1
- package/es/turbo-adapter/index.js +0 -1
- package/lib/NodeResize/BasicShape/Ellipse.js +0 -1
- package/lib/NodeResize/BasicShape/Polygon.js +0 -1
- package/lib/NodeResize/BasicShape/Rect.js +0 -1
- package/lib/NodeResize/control/Control.js +0 -1
- package/lib/NodeResize/control/ControlGroup.js +0 -1
- package/lib/NodeResize/control/Util.js +0 -1
- package/lib/NodeResize/index.js +0 -1
- package/lib/NodeResize/node/DiamondResize.js +0 -1
- package/lib/NodeResize/node/EllipseResize.js +0 -1
- package/lib/NodeResize/node/HtmlResize.js +0 -1
- package/lib/NodeResize/node/RectResize.js +0 -1
- package/lib/NodeResize/node/index.js +0 -1
- package/lib/bpmn/constant.js +0 -1
- package/lib/bpmn/events/EndEvent.js +0 -1
- package/lib/bpmn/events/StartEvent.js +0 -1
- package/lib/bpmn/events/index.js +0 -1
- package/lib/bpmn/flow/SequenceFlow.js +0 -1
- package/lib/bpmn/flow/index.js +0 -1
- package/lib/bpmn/gateways/ExclusiveGateway.js +0 -1
- package/lib/bpmn/gateways/index.js +0 -1
- package/lib/bpmn/getBpmnId.js +0 -1
- package/lib/bpmn/index.js +0 -1
- package/lib/bpmn/tasks/ServiceTask.js +0 -1
- package/lib/bpmn/tasks/UserTask.js +0 -1
- package/lib/bpmn/tasks/index.js +0 -1
- package/lib/bpmn-adapter/bpmnIds.js +0 -1
- package/lib/bpmn-adapter/index.js +0 -1
- package/lib/bpmn-adapter/json2xml.js +0 -1
- package/lib/bpmn-adapter/xml2json.js +0 -1
- package/lib/bpmn-elements/index.js +0 -1
- package/lib/bpmn-elements/presets/Event/EndEventFactory.js +0 -1
- package/lib/bpmn-elements/presets/Event/IntermediateCatchEvent.js +0 -1
- package/lib/bpmn-elements/presets/Event/IntermediateThrowEvent.js +0 -1
- package/lib/bpmn-elements/presets/Event/StartEventFactory.js +0 -1
- package/lib/bpmn-elements/presets/Event/boundaryEventFactory.js +0 -1
- package/lib/bpmn-elements/presets/Event/index.js +0 -1
- package/lib/bpmn-elements/presets/Flow/index.js +0 -1
- package/lib/bpmn-elements/presets/Flow/manhattan.js +0 -1
- package/lib/bpmn-elements/presets/Flow/sequenceFlow.js +0 -1
- package/lib/bpmn-elements/presets/Gateway/gateway.js +0 -1
- package/lib/bpmn-elements/presets/Gateway/index.js +0 -1
- package/lib/bpmn-elements/presets/Pool/Lane.js +0 -1
- package/lib/bpmn-elements/presets/Pool/Pool.js +0 -1
- package/lib/bpmn-elements/presets/Pool/index.js +0 -1
- package/lib/bpmn-elements/presets/Task/index.js +0 -1
- package/lib/bpmn-elements/presets/Task/subProcess.js +0 -1
- package/lib/bpmn-elements/presets/Task/task.js +0 -1
- package/lib/bpmn-elements/presets/icons.js +0 -1
- package/lib/bpmn-elements/utils.js +0 -1
- package/lib/bpmn-elements-adapter/constant.js +0 -1
- package/lib/bpmn-elements-adapter/index.js +0 -1
- package/lib/bpmn-elements-adapter/json2xml.js +0 -1
- package/lib/bpmn-elements-adapter/xml2json.js +0 -1
- package/lib/components/context-menu/index.js +0 -1
- package/lib/components/control/index.js +0 -1
- package/lib/components/dnd-panel/index.js +0 -1
- package/lib/components/highlight/index.js +0 -1
- package/lib/components/menu/index.d.ts +4 -1
- package/lib/components/menu/index.js +5 -5
- package/lib/components/mini-map/index.js +0 -1
- package/lib/components/selection-select/index.js +0 -1
- package/lib/dynamic-group/index.js +0 -2
- package/lib/dynamic-group/model.js +0 -1
- package/lib/dynamic-group/node.js +0 -1
- package/lib/dynamic-group/utils.js +0 -1
- package/lib/index.css +63 -0
- package/lib/index.js +0 -1
- package/lib/insert-node-in-polyline/edge.js +0 -1
- package/lib/insert-node-in-polyline/index.js +0 -1
- package/lib/materials/curved-edge/__test__/curved-edge.test.js +0 -1
- package/lib/materials/curved-edge/index.js +0 -1
- package/lib/materials/group/GroupNode.js +0 -1
- package/lib/materials/group/index.js +0 -1
- package/lib/materials/node-selection/index.js +0 -1
- package/lib/mindmap/fakerRoot.js +0 -1
- package/lib/mindmap/index.js +0 -1
- package/lib/mindmap/markContent.js +0 -1
- package/lib/mindmap/markContentOption.js +0 -1
- package/lib/mindmap/markEntity.js +0 -1
- package/lib/mindmap/markRoot.js +0 -1
- package/lib/mindmap/theme.js +0 -1
- package/lib/rect-label-node/RectLabelNodeView.js +0 -1
- package/lib/rect-label-node/index.js +0 -1
- package/lib/style/index.css +63 -0
- package/lib/style/index.less +72 -0
- package/lib/style/raw.d.ts +1 -1
- package/lib/style/raw.js +1 -2
- package/lib/tools/auto-layout/index.js +0 -1
- package/lib/tools/flow-path/index.js +0 -1
- package/lib/tools/label/Label.js +0 -1
- package/lib/tools/label/LabelModel.js +0 -1
- package/lib/tools/label/LabelOverlay.js +0 -1
- package/lib/tools/label/algorithm.js +0 -1
- package/lib/tools/label/index.d.ts +0 -1
- package/lib/tools/label/index.js +0 -5
- package/lib/tools/label/mediumEditor.js +0 -1
- package/lib/tools/label/utils.js +0 -1
- package/lib/tools/snapshot/index.js +0 -1
- package/lib/tools/snapshot/utils.js +0 -1
- package/lib/turbo-adapter/index.js +0 -1
- package/package.json +3 -3
- package/rollup.config.js +1 -1
- package/src/components/menu/index.ts +3 -3
- package/src/dynamic-group/index.ts +0 -2
- package/src/style/index.less +72 -0
- package/src/style/raw.ts +64 -1
- package/src/tools/label/index.ts +0 -5
- package/stats.html +4842 -0
- package/es/NodeResize/BasicShape/Ellipse.js.map +0 -1
- package/es/NodeResize/BasicShape/Polygon.js.map +0 -1
- package/es/NodeResize/BasicShape/Rect.js.map +0 -1
- package/es/NodeResize/control/Control.js.map +0 -1
- package/es/NodeResize/control/ControlGroup.js.map +0 -1
- package/es/NodeResize/control/Util.js.map +0 -1
- package/es/NodeResize/index.js.map +0 -1
- package/es/NodeResize/node/DiamondResize.js.map +0 -1
- package/es/NodeResize/node/EllipseResize.js.map +0 -1
- package/es/NodeResize/node/HtmlResize.js.map +0 -1
- package/es/NodeResize/node/RectResize.js.map +0 -1
- package/es/NodeResize/node/index.js.map +0 -1
- package/es/bpmn/constant.js.map +0 -1
- package/es/bpmn/events/EndEvent.js.map +0 -1
- package/es/bpmn/events/StartEvent.js.map +0 -1
- package/es/bpmn/events/index.js.map +0 -1
- package/es/bpmn/flow/SequenceFlow.js.map +0 -1
- package/es/bpmn/flow/index.js.map +0 -1
- package/es/bpmn/gateways/ExclusiveGateway.js.map +0 -1
- package/es/bpmn/gateways/index.js.map +0 -1
- package/es/bpmn/getBpmnId.js.map +0 -1
- package/es/bpmn/index.js.map +0 -1
- package/es/bpmn/tasks/ServiceTask.js.map +0 -1
- package/es/bpmn/tasks/UserTask.js.map +0 -1
- package/es/bpmn/tasks/index.js.map +0 -1
- package/es/bpmn-adapter/bpmnIds.js.map +0 -1
- package/es/bpmn-adapter/index.js.map +0 -1
- package/es/bpmn-adapter/json2xml.js.map +0 -1
- package/es/bpmn-adapter/xml2json.js.map +0 -1
- package/es/bpmn-elements/index.js.map +0 -1
- package/es/bpmn-elements/presets/Event/EndEventFactory.js.map +0 -1
- package/es/bpmn-elements/presets/Event/IntermediateCatchEvent.js.map +0 -1
- package/es/bpmn-elements/presets/Event/IntermediateThrowEvent.js.map +0 -1
- package/es/bpmn-elements/presets/Event/StartEventFactory.js.map +0 -1
- package/es/bpmn-elements/presets/Event/boundaryEventFactory.js.map +0 -1
- package/es/bpmn-elements/presets/Event/index.js.map +0 -1
- package/es/bpmn-elements/presets/Flow/index.js.map +0 -1
- package/es/bpmn-elements/presets/Flow/manhattan.js.map +0 -1
- package/es/bpmn-elements/presets/Flow/sequenceFlow.js.map +0 -1
- package/es/bpmn-elements/presets/Gateway/gateway.js.map +0 -1
- package/es/bpmn-elements/presets/Gateway/index.js.map +0 -1
- package/es/bpmn-elements/presets/Pool/Lane.js.map +0 -1
- package/es/bpmn-elements/presets/Pool/Pool.js.map +0 -1
- package/es/bpmn-elements/presets/Pool/index.js.map +0 -1
- package/es/bpmn-elements/presets/Task/index.js.map +0 -1
- package/es/bpmn-elements/presets/Task/subProcess.js.map +0 -1
- package/es/bpmn-elements/presets/Task/task.js.map +0 -1
- package/es/bpmn-elements/presets/icons.js.map +0 -1
- package/es/bpmn-elements/utils.js.map +0 -1
- package/es/bpmn-elements-adapter/constant.js.map +0 -1
- package/es/bpmn-elements-adapter/index.js.map +0 -1
- package/es/bpmn-elements-adapter/json2xml.js.map +0 -1
- package/es/bpmn-elements-adapter/xml2json.js.map +0 -1
- package/es/components/context-menu/index.js.map +0 -1
- package/es/components/control/index.js.map +0 -1
- package/es/components/dnd-panel/index.js.map +0 -1
- package/es/components/highlight/index.js.map +0 -1
- package/es/components/menu/index.js.map +0 -1
- package/es/components/mini-map/index.js.map +0 -1
- package/es/components/selection-select/index.js.map +0 -1
- package/es/dynamic-group/index.js.map +0 -1
- package/es/dynamic-group/model.js.map +0 -1
- package/es/dynamic-group/node.js.map +0 -1
- package/es/dynamic-group/utils.js.map +0 -1
- package/es/index.js.map +0 -1
- package/es/insert-node-in-polyline/edge.js.map +0 -1
- package/es/insert-node-in-polyline/index.js.map +0 -1
- package/es/materials/curved-edge/__test__/curved-edge.test.js.map +0 -1
- package/es/materials/curved-edge/index.js.map +0 -1
- package/es/materials/group/GroupNode.js.map +0 -1
- package/es/materials/group/index.js.map +0 -1
- package/es/materials/node-selection/index.js.map +0 -1
- package/es/mindmap/fakerRoot.js.map +0 -1
- package/es/mindmap/index.js.map +0 -1
- package/es/mindmap/markContent.js.map +0 -1
- package/es/mindmap/markContentOption.js.map +0 -1
- package/es/mindmap/markEntity.js.map +0 -1
- package/es/mindmap/markRoot.js.map +0 -1
- package/es/mindmap/theme.js.map +0 -1
- package/es/rect-label-node/RectLabelNodeView.js.map +0 -1
- package/es/rect-label-node/index.js.map +0 -1
- package/es/style/raw.js.map +0 -1
- package/es/tools/auto-layout/index.js.map +0 -1
- package/es/tools/flow-path/index.js.map +0 -1
- package/es/tools/label/Label.js.map +0 -1
- package/es/tools/label/LabelModel.js.map +0 -1
- package/es/tools/label/LabelOverlay.js.map +0 -1
- package/es/tools/label/algorithm.js.map +0 -1
- package/es/tools/label/index.js.map +0 -1
- package/es/tools/label/mediumEditor.js.map +0 -1
- package/es/tools/label/style.css +0 -63
- package/es/tools/label/style.less +0 -71
- package/es/tools/label/utils.js.map +0 -1
- package/es/tools/snapshot/index.js.map +0 -1
- package/es/tools/snapshot/utils.js.map +0 -1
- package/es/turbo-adapter/index.js.map +0 -1
- package/lib/NodeResize/BasicShape/Ellipse.js.map +0 -1
- package/lib/NodeResize/BasicShape/Polygon.js.map +0 -1
- package/lib/NodeResize/BasicShape/Rect.js.map +0 -1
- package/lib/NodeResize/control/Control.js.map +0 -1
- package/lib/NodeResize/control/ControlGroup.js.map +0 -1
- package/lib/NodeResize/control/Util.js.map +0 -1
- package/lib/NodeResize/index.js.map +0 -1
- package/lib/NodeResize/node/DiamondResize.js.map +0 -1
- package/lib/NodeResize/node/EllipseResize.js.map +0 -1
- package/lib/NodeResize/node/HtmlResize.js.map +0 -1
- package/lib/NodeResize/node/RectResize.js.map +0 -1
- package/lib/NodeResize/node/index.js.map +0 -1
- package/lib/bpmn/constant.js.map +0 -1
- package/lib/bpmn/events/EndEvent.js.map +0 -1
- package/lib/bpmn/events/StartEvent.js.map +0 -1
- package/lib/bpmn/events/index.js.map +0 -1
- package/lib/bpmn/flow/SequenceFlow.js.map +0 -1
- package/lib/bpmn/flow/index.js.map +0 -1
- package/lib/bpmn/gateways/ExclusiveGateway.js.map +0 -1
- package/lib/bpmn/gateways/index.js.map +0 -1
- package/lib/bpmn/getBpmnId.js.map +0 -1
- package/lib/bpmn/index.js.map +0 -1
- package/lib/bpmn/tasks/ServiceTask.js.map +0 -1
- package/lib/bpmn/tasks/UserTask.js.map +0 -1
- package/lib/bpmn/tasks/index.js.map +0 -1
- package/lib/bpmn-adapter/bpmnIds.js.map +0 -1
- package/lib/bpmn-adapter/index.js.map +0 -1
- package/lib/bpmn-adapter/json2xml.js.map +0 -1
- package/lib/bpmn-adapter/xml2json.js.map +0 -1
- package/lib/bpmn-elements/index.js.map +0 -1
- package/lib/bpmn-elements/presets/Event/EndEventFactory.js.map +0 -1
- package/lib/bpmn-elements/presets/Event/IntermediateCatchEvent.js.map +0 -1
- package/lib/bpmn-elements/presets/Event/IntermediateThrowEvent.js.map +0 -1
- package/lib/bpmn-elements/presets/Event/StartEventFactory.js.map +0 -1
- package/lib/bpmn-elements/presets/Event/boundaryEventFactory.js.map +0 -1
- package/lib/bpmn-elements/presets/Event/index.js.map +0 -1
- package/lib/bpmn-elements/presets/Flow/index.js.map +0 -1
- package/lib/bpmn-elements/presets/Flow/manhattan.js.map +0 -1
- package/lib/bpmn-elements/presets/Flow/sequenceFlow.js.map +0 -1
- package/lib/bpmn-elements/presets/Gateway/gateway.js.map +0 -1
- package/lib/bpmn-elements/presets/Gateway/index.js.map +0 -1
- package/lib/bpmn-elements/presets/Pool/Lane.js.map +0 -1
- package/lib/bpmn-elements/presets/Pool/Pool.js.map +0 -1
- package/lib/bpmn-elements/presets/Pool/index.js.map +0 -1
- package/lib/bpmn-elements/presets/Task/index.js.map +0 -1
- package/lib/bpmn-elements/presets/Task/subProcess.js.map +0 -1
- package/lib/bpmn-elements/presets/Task/task.js.map +0 -1
- package/lib/bpmn-elements/presets/icons.js.map +0 -1
- package/lib/bpmn-elements/utils.js.map +0 -1
- package/lib/bpmn-elements-adapter/constant.js.map +0 -1
- package/lib/bpmn-elements-adapter/index.js.map +0 -1
- package/lib/bpmn-elements-adapter/json2xml.js.map +0 -1
- package/lib/bpmn-elements-adapter/xml2json.js.map +0 -1
- package/lib/components/context-menu/index.js.map +0 -1
- package/lib/components/control/index.js.map +0 -1
- package/lib/components/dnd-panel/index.js.map +0 -1
- package/lib/components/highlight/index.js.map +0 -1
- package/lib/components/menu/index.js.map +0 -1
- package/lib/components/mini-map/index.js.map +0 -1
- package/lib/components/selection-select/index.js.map +0 -1
- package/lib/dynamic-group/index.js.map +0 -1
- package/lib/dynamic-group/model.js.map +0 -1
- package/lib/dynamic-group/node.js.map +0 -1
- package/lib/dynamic-group/utils.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/insert-node-in-polyline/edge.js.map +0 -1
- package/lib/insert-node-in-polyline/index.js.map +0 -1
- package/lib/materials/curved-edge/__test__/curved-edge.test.js.map +0 -1
- package/lib/materials/curved-edge/index.js.map +0 -1
- package/lib/materials/group/GroupNode.js.map +0 -1
- package/lib/materials/group/index.js.map +0 -1
- package/lib/materials/node-selection/index.js.map +0 -1
- package/lib/mindmap/fakerRoot.js.map +0 -1
- package/lib/mindmap/index.js.map +0 -1
- package/lib/mindmap/markContent.js.map +0 -1
- package/lib/mindmap/markContentOption.js.map +0 -1
- package/lib/mindmap/markEntity.js.map +0 -1
- package/lib/mindmap/markRoot.js.map +0 -1
- package/lib/mindmap/theme.js.map +0 -1
- package/lib/rect-label-node/RectLabelNodeView.js.map +0 -1
- package/lib/rect-label-node/index.js.map +0 -1
- package/lib/style/raw.js.map +0 -1
- package/lib/tools/auto-layout/index.js.map +0 -1
- package/lib/tools/flow-path/index.js.map +0 -1
- package/lib/tools/label/Label.js.map +0 -1
- package/lib/tools/label/LabelModel.js.map +0 -1
- package/lib/tools/label/LabelOverlay.js.map +0 -1
- package/lib/tools/label/algorithm.js.map +0 -1
- package/lib/tools/label/index.js.map +0 -1
- package/lib/tools/label/mediumEditor.js.map +0 -1
- package/lib/tools/label/style.css +0 -63
- package/lib/tools/label/style.less +0 -71
- package/lib/tools/label/utils.js.map +0 -1
- package/lib/tools/snapshot/index.js.map +0 -1
- package/lib/tools/snapshot/utils.js.map +0 -1
- package/lib/turbo-adapter/index.js.map +0 -1
- package/src/tools/label/style.less +0 -71
package/dist/index.min.js
CHANGED
|
@@ -1,42 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@logicflow/core")):"function"==typeof define&&define.amd?define(["exports","@logicflow/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Extension={},t.Core)}(this,(function(t,e){"use strict";var n=40,o=40,i=40,r=40,a=40,s=40,l=100,u=80,c=100,d=80,h={rect:{radius:5,stroke:"rgb(24, 125, 255)"},circle:{r:18,stroke:"rgb(24, 125, 255)"},polygon:{stroke:"rgb(24, 125, 255)"},polyline:{stroke:"rgb(24, 125, 255)",hoverStroke:"rgb(24, 125, 255)",selectedStroke:"rgb(24, 125, 255)"},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"white",height:14,stroke:"transparent",radius:3}}},p=function(t,e){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},p(t,e)};function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var g=function(){return g=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},g.apply(this,arguments)};function v(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}function y(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a}function m(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))}function b(t,e){var n,o,i,r,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function x(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function E(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var w=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),S=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new w;function C(){return S.next()}var N=function(t){function e(e,n){return e.id||(e.id="Event_".concat(C())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),t.call(this,e,n)||this}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var e=t.prototype.getConnectedTargetRules.call(this);return e.push({message:"起始节点不能作为边的终点",validate:function(){return!1}}),e},e.extendKey="StartEventModel",e}(e.CircleNodeModel),T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.extendKey="StartEventNode",e}(e.CircleNode),A={type:"bpmn:startEvent",view:T,model:N},M=function(t){function e(e,n){return e.id||(e.id="Event_".concat(C())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),t.call(this,e,n)||this}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var e=t.prototype.getConnectedSourceRules.call(this);return e.push({message:"结束节点不能作为边的起点",validate:function(){return!1}}),e},e.extendKey="EndEventModel",e}(e.CircleNodeModel),O=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var n=this.props.model,o=n.getNodeStyle(),i=n,r=i.x,a=i.y,s=i.r,l=t.prototype.getShape.call(this);return e.h("g",{},l,e.h("circle",g(g({},o),{cx:r,cy:a,r:s-5})))},n.extendKey="EndEventView",n}(e.CircleNode),P={type:"bpmn:endEvent",view:O,model:M},k=function(t){function e(e,n){return e.id||(e.id="Flow_".concat(C())),t.call(this,e,n)||this}return f(e,t),e.extendKey="SequenceFlowModel",e}(e.PolylineEdgeModel),R=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.extendKey="SequenceFlowEdge",e}(e.PolylineEdge),D={type:"bpmn:sequenceFlow",view:R,model:k},L=function(t){function e(e,n){var o=this;return e.id||(e.id="Gateway_".concat(C())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),(o=t.call(this,e,n)||this).points=[[25,0],[50,25],[25,50],[0,25]],o}return f(e,t),e.extendKey="ExclusiveGatewayModel",e}(e.PolygonNodeModel),I=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getShape=function(){var t=this.props.model,n=t,o=n.x,i=n.y,r=n.width,a=n.height,s=n.points,l=t.getNodeStyle();return e.h("g",{transform:"matrix(1 0 0 1 ".concat(o-r/2," ").concat(i-a/2,")")},e.h("polygon",g(g({},l),{x:o,y:i,points:s})),e.h("path",g({d:"m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z"},l)))},n.extendKey="ExclusiveGatewayNode",n}(e.PolygonNode),j={type:"bpmn:exclusiveGateway",view:I,model:L},B=function(t){function e(e,n){return e.id||(e.id="Activity_".concat(C())),t.call(this,e,n)||this}return f(e,t),e.extendKey="ServiceTaskModel",e}(e.RectNodeModel),H=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getLabelShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.getNodeStyle();return e.h("svg",{x:n-i/2+5,y:o-r/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},e.h("path",{fill:a.stroke,d:"M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z"}))},n.prototype.getShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.radius,s=t.getNodeStyle();return e.h("g",{},[e.h("rect",g({x:n-i/2,y:o-r/2,rx:a,ry:a,width:i,height:r},s)),this.getLabelShape()])},n.extendKey="ServiceTaskNode",n}(e.RectNode),F={type:"bpmn:serviceTask",view:H,model:B},z=function(t){function e(e,n){return e.id||(e.id="Activity_".concat(C())),t.call(this,e,n)||this}return f(e,t),e.extendKey="UserTaskModel",e}(e.RectNodeModel),W=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getLabelShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.getNodeStyle();return e.h("svg",{x:n-i/2+5,y:o-r/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},e.h("path",{fill:a.stroke,d:"M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z"}))},n.prototype.getShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.radius,s=t.getNodeStyle();return e.h("g",{},[e.h("rect",g(g({},s),{x:n-i/2,y:o-r/2,rx:a,ry:a,width:i,height:r})),this.getLabelShape()])},n.extendKey="UserTaskNode",n}(e.RectNode),G={type:"bpmn:userTask",view:W,model:z},U={pluginName:"bpmnElement",install:function(t){t.setTheme(h),t.register(A),t.register(P),t.register(j),t.register(G),t.register(F),t.options.customBpmnEdge||(t.register(D),t.setDefaultEdgeType("bpmn:sequenceFlow"))}},X=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),V=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new X;function Y(){return V.next()}function q(t){return Object.prototype.toString.call(t)}function K(t){var e=t;return"[object Object]"===q(t)?(e={},Object.keys(t).forEach((function(n){var o=n;"-"===n.charAt(0)&&(o=n.substring(1)),e[o]=K(t[n])}))):Array.isArray(t)&&(e=[],t.forEach((function(t,n){e[n]=K(t)}))),e}var Z="\t\n";function $(t,e,n){var o=function(t){return" ".repeat(t)}(n),i="";if("#text"===e)return Z+o+t;if("#cdata-section"===e)return Z+o+"<![CDATA["+t+"]]>";if("#comment"===e)return Z+o+"\x3c!--"+t+"--\x3e";if("-"==="".concat(e).charAt(0))return" "+e.substring(1)+'="'+function(t){var e=t;try{"string"!=typeof e&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(K(t)).replace(/"/g,"'")}return e}(t)+'"';if(Array.isArray(t))t.forEach((function(t){i+=$(t,e,n+1)}));else if("[object Object]"===q(t)){var r=Object.keys(t),a="",s="";i+=(0===n?"":Z+o)+"<"+e,r.forEach((function(e){"-"===e.charAt(0)?a+=$(t[e],e,n+1):s+=$(t[e],e,n+1)})),i+=a+(""!==s?">".concat(s).concat(Z+o,"</").concat(e,">"):" />")}else i+=Z+o+"<".concat(e,">").concat(t.toString(),"</").concat(e,">");return i}function J(t){var e="";for(var n in t)e+=$(t[n],n,0);return e}var Q=function(){};(Q.ObjTree=function(){return this}).VERSION="0.23",Q.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',Q.ObjTree.prototype.attr_prefix="-",Q.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(t,"application/xml");if(!o)return;e=o.documentElement}else window.ActiveXObject&&((n=new ActiveXObject("Microsoft.XMLDOM")).async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)},Q.ObjTree.prototype.parseHTTP=function(t,e,n){var o,i={};for(var r in e)i[r]=e[r];if(i.method||(void 0===i.postBody&&void 0===i.postbody&&void 0===i.parameters?i.method="get":i.method="post"),n){i.asynchronous=!0;var a=this,s=n,l=i.onComplete;i.onComplete=function(t){var e;t&&t.responseXML&&t.responseXML.documentElement&&(e=a.parseDOM(t.responseXML.documentElement)),s(e,t),l&&l(t)}}else i.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request)i.uri=t,(u=new HTTP.Request(i))&&(o=u.transport);else if("undefined"!=typeof Ajax&&Ajax.Request){var u;(u=new Ajax.Request(t,i))&&(o=u.transport)}return n?o:o&&o.responseXML&&o.responseXML.documentElement?this.parseDOM(o.responseXML.documentElement):void 0},Q.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),11!=t.nodeType){var o={};o[t.nodeName]=n,n=o}return n}},Q.ObjTree.prototype.parseElement=function(t){if(7!=t.nodeType){if(3==t.nodeType||4==t.nodeType||8==t.nodeType){if(null==t.nodeValue.match(/[^\x00-\x20]/))return;return t.nodeValue}var e=null,n={};if(t.attributes&&t.attributes.length){e={};for(var o=0;o<t.attributes.length;o++){if("string"==typeof(s=t.attributes[o].nodeName)){var i=t.attributes[o].nodeValue;try{i=JSON.parse(t.attributes[o].nodeValue.replace(/'/g,'"'))}catch(e){i=t.attributes[o].nodeValue}i&&(void 0===n[s=this.attr_prefix+s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],i))}}}if(t.childNodes&&t.childNodes.length){var r=!0;e&&(r=!1);for(o=0;o<t.childNodes.length&&r;o++){var a=t.childNodes[o].nodeType;3!=a&&4!=a&&8!=a&&(r=!1)}if(r){e||(e="");for(o=0;o<t.childNodes.length;o++)e+=t.childNodes[o].nodeValue}else{e||(e={});for(o=0;o<t.childNodes.length;o++){var s;if("string"==typeof(s=t.childNodes[o].nodeName))(i=this.parseElement(t.childNodes[o]))&&(void 0===n[s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],i))}}}else null===e&&(e={});return e}},Q.ObjTree.prototype.addNode=function(t,e,n,o){this.__force_array[e]?(1==n&&(t[e]=[]),t[e][t[e].length]=o):1==n?t[e]=o:2==n?t[e]=[t[e],o]:t[e][t[e].length]=o},Q.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},Q.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],o=[];for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];i.charAt(0)!=this.attr_prefix?void 0===r||null==r?n[n.length]="<"+i+" />":"object"==typeof r&&r.constructor==Array?n[n.length]=this.array_to_xml(i,r):n[n.length]="object"==typeof r?this.hash_to_xml(i,r):this.scalar_to_xml(i,r):o[o.length]=" "+i.substring(1)+'="'+this.xml_escape(r)+'"'}var a=o.join(""),s=n.join("");return void 0===t||null==t||(s=n.length>0?s.match(/\n/)?"<"+t+a+">\n"+s+"</"+t+">\n":"<"+t+a+">"+s+"</"+t+">\n":"<"+t+a+" />\n"),s},Q.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],o=0;o<e.length;o++){var i=e[o];void 0===i||null==i?n[n.length]="<"+t+" />":"object"==typeof i&&i.constructor==Array?n[n.length]=this.array_to_xml(t,i):n[n.length]="object"==typeof i?this.hash_to_xml(t,i):this.scalar_to_xml(t,i)}return n.join("")},Q.ObjTree.prototype.scalar_to_xml=function(t,e){return"#text"==t?this.xml_escape(e):"<"+t+">"+this.xml_escape(e)+"</"+t+">\n"},Q.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};var tt,et=function(t){return(new Q.ObjTree).parseXML(t)};!function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow"}(tt||(tt={}));var nt=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],ot=["properties","startPoint","endPoint","pointsList"];function it(t){var e=t?ot.concat(t):ot;return function(t){return function t(n){var o={};return"string"==typeof n?n:Array.isArray(n)?n.map((function(e){return t(e)})):(Object.entries(n).forEach((function(n){var i=_(n,2),r=i[0],a=i[1];"object"!=typeof a?0===r.indexOf("-")||["#text","#cdata-section","#comment"].includes(r)?o[r]=a:o["-".concat(r)]=a:e.includes(r)?o["-".concat(r)]=t(a):o[r]=t(a)})),o)}(t)}}function rt(t){var e={};return Object.entries(t).forEach((function(t){var n=_(t,2),o=n[0],i=n[1];0===o.indexOf("-")?e[o.substring(1)]=K(i):"string"==typeof i?e[o]=i:"[object Object]"===Object.prototype.toString.call(i)?e[o]=rt(i):Array.isArray(i)?e[o]=i.map((function(t){return rt(t)})):e[o]=i})),e}function at(t,e){t["bpmndi:BPMNEdge"]=e.edges.map((function(t){var e,n=t.id,o=t.pointsList.map((function(t){return{"-x":t.x,"-y":t.y}})),i={"-id":"".concat(n,"_di"),"-bpmnElement":n,"di:waypoint":o};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(i["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),i})),t["bpmndi:BPMNShape"]=e.nodes.map((function(t){var e,n=t.id,o=100,i=80,r=t.x,a=t.y,s=ct.shapeConfigMap.get(t.type);s&&(o=s.width,i=s.height),r-=o/2,a-=i/2;var l={"-id":"".concat(n,"_di"),"-bpmnElement":n,"dc:Bounds":{"-x":r,"-y":a,"-width":o,"-height":i}};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(l["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),l}))}function st(t){var e=[],n=[],o=t["bpmn:definitions"];if(o){var i=o["bpmn:process"];Object.keys(i).forEach((function(t){if(0===t.indexOf("bpmn:")){var r=i[t];if(t===tt.FLOW){var a=o["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];n=function(t,e){var n=[];if(Array.isArray(t))t.forEach((function(t){var o;o=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(ut(o,t))}));else{var o=void 0;o=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(ut(o,t))}return n}(r,a)}else{var s=o["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];e=e.concat(function(t,e,n){var o=[];if(Array.isArray(t))t.forEach((function(t){var i=lt(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);o.push(i)}));else{var i=lt(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);o.push(i)}return o}(r,s,t))}}}))}return{nodes:e,edges:n}}function lt(t,e,n){var o,i,r=Number(t["dc:Bounds"]["-x"]),a=Number(t["dc:Bounds"]["-y"]),s=n["-name"],l=ct.shapeConfigMap.get(e);if(l&&(r+=l.width/2,a+=l.height/2),Object.entries(n).forEach((function(t){var e=_(t,2),n=e[0],i=e[1];-1===nt.indexOf(n)&&(o||(o={}),o[n]=i)})),o&&(o=rt(o)),s&&(i={x:r,y:a,value:s},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var u=t["bpmndi:BPMNLabel"]["dc:Bounds"];i.x=Number(u["-x"])+Number(u["-width"])/2,i.y=Number(u["-y"])+Number(u["-height"])/2}var c={id:t["-bpmnElement"],type:e,x:r,y:a,properties:o};return i&&(c.text=i),c}function ut(t,e){var n,o,i="".concat(e["-name"]);if(i){var r=t["bpmndi:BPMNLabel"]["dc:Bounds"],a=0;i.split("\n").forEach((function(t){a<t.length&&(a=t.length)})),n={value:i,x:Number(r["-x"])+10*a/2,y:Number(r["-y"])+7}}Object.entries(e).forEach((function(t){var e=_(t,2),n=e[0],i=e[1];-1===nt.indexOf(n)&&(o||(o={}),o[n]=i)})),o&&(o=rt(o));var s={id:e["-id"],type:tt.FLOW,pointsList:t["di:waypoint"].map((function(t){return{x:Number(t["-x"]),y:Number(t["-y"])}})),sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:o};return n&&(s.text=n),s}var ct=function(){function t(t){var e=t.lf,n=this;this.adapterOut=function(t,e){var o=g({},n.processAttributes);!function(t,e,n){var o=new Map;e.nodes.forEach((function(e){var i,r={"-id":e.id};if((null===(i=e.text)||void 0===i?void 0:i.value)&&(r["-name"]=e.text.value),e.properties){var a=it(n)(e.properties);Object.assign(r,a)}o.set(e.id,r),t[e.type]?Array.isArray(t[e.type])?t[e.type].push(r):t[e.type]=[t[e.type],r]:t[e.type]=r}));var i=e.edges.map((function(t){var e,i,r=o.get(t.targetNodeId);r["bpmn:incoming"]?Array.isArray(r["bpmn:incoming"])?r["bpmn:incoming"].push(t.id):r["bpmn:incoming"]=[r["bpmn:incoming"],t.id]:r["bpmn:incoming"]=t.id;var a={"-id":t.id,"-sourceRef":t.sourceNodeId,"-targetRef":t.targetNodeId};if((null===(e=t.text)||void 0===e?void 0:e.value)&&(a["-name"]=null===(i=t.text)||void 0===i?void 0:i.value),t.properties){var s=it(n)(t.properties);Object.assign(a,s)}return a}));e.edges.forEach((function(t){var e=o.get(t.sourceNodeId);e["bpmn:outgoing"]?Array.isArray(e["bpmn:outgoing"])?e["bpmn:outgoing"].push(t.id):e["bpmn:outgoing"]=[e["bpmn:outgoing"],t.id]:e["bpmn:outgoing"]=t.id})),t[tt.FLOW]=i}(o,t,e);var i={"-id":"BPMNPlane_1","-bpmnElement":o["-id"]};at(i,t);var r=n.definitionAttributes;return r["bpmn:process"]=o,r["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":i},{"bpmn:definitions":r}},this.adapterIn=function(t){if(t)return st(t)},e.adapterIn=function(t){return n.adapterIn(t)},e.adapterOut=function(t,e){return n.adapterOut(t,e)},this.processAttributes={"-isExecutable":"true","-id":"Process_".concat(Y())},this.definitionAttributes={"-id":"Definitions_".concat(Y()),"-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.0"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();ct.shapeConfigMap.set(tt.START,{width:n,height:o}),ct.shapeConfigMap.set(tt.END,{width:i,height:r}),ct.shapeConfigMap.set(tt.GATEWAY,{width:a,height:s}),ct.shapeConfigMap.set(tt.SYSTEM,{width:l,height:u}),ct.shapeConfigMap.set(tt.USER,{width:c,height:d});var dt=function(t){function e(e){var n=t.call(this,e)||this;n.adapterXmlIn=function(t){var e=et(t);return n.adapterIn(e)},n.adapterXmlOut=function(t,e){return J(n.adapterOut(t,e))};var o=e.lf;return o.adapterIn=n.adapterXmlIn,o.adapterOut=n.adapterXmlOut,n}return f(e,t),e.pluginName="bpmnXmlAdapter",e}(ct);function ht(){this.targetRules.push({message:"分组外的节点不允许连接分组内的",validate:function(t,e){var n=!!t.properties.parent,o=!!e.properties.parent;return!(!n&&o)}})}var pt=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){var t="xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}));return t},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),ft=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new pt;function gt(){return ft.next()}var vt=Object.freeze({__proto__:null,genBpmnId:gt,groupRule:ht});function yt(t){var n=_(t.useDefinition(),1)[0],o=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return f(o,t),o.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},o.prototype.getShape=function(){var o,i=this.props.model,r=i.getNodeStyle(),a=i,s=a.x,l=a.y,u=a.r,c=a.width,d=a.height,h=a.properties,p=t.prototype.getShape.call(this),f=h.definitionType,v=((null===(o=n.endEvent)||void 0===o?void 0:o.get(f))||{}).icon,y=Array.isArray(v)?e.h.apply(void 0,E(["g",{transform:"matrix(1 0 0 1 ".concat(s-c/2," ").concat(l-d/2,")")}],_(v),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(s-c/2," ").concat(l-d/2,")"),d:v,style:"fill: black; stroke-linecap: round; stroke-linejoin: round; stroke: white; stroke-width: 1px;"});return e.h("g",{},p,e.h("circle",g(g({},r),{strokeWidth:2,cx:s,cy:l,r:u-2})),y)},o}(e.CircleNode),i=function(t){function e(e,o){var i,r,a,s;e.id||(e.id="Event_".concat(gt())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var l=((null===(r=n.endEvent)||void 0===r?void 0:r.get(null===(a=e.properties)||void 0===a?void 0:a.definitionType))||{}).properties,u=void 0===l?{}:l;return e.properties=g(g({},u),e.properties),(null===(s=e.properties)||void 0===s?void 0:s.definitionType)&&(e.properties.definitionId="Definition_".concat(gt())),i=t.call(this,e,o)||this,ht.call(i),i}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var e=this,n=t.prototype.getConnectedSourceRules.call(this),o={message:"结束节点不能作为边的起点",validate:function(t,n){return console.log("_target",n),t!==e}};return n.push(o),n},e}(e.CircleNodeModel);return{type:"bpmn:endEvent",view:o,model:i}}function mt(t){var n=_(t.useDefinition(),1)[0],o=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return f(o,t),o.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},o.prototype.getShape=function(){var t,o=this.props.model,i=o.getNodeStyle(),r=o,a=r.x,s=r.y,l=r.r,u=r.width,c=r.height,d=r.properties.definitionType,h=((null===(t=n.intermediateCatchEvent)||void 0===t?void 0:t.get(d))||{}).icon,p=Array.isArray(h)?e.h.apply(void 0,E(["g",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")")}],_(h),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")"),d:h});return e.h("g",{},e.h("circle",g(g({},i),{cx:a,cy:s,r:l,strokeWidth:1.5})),e.h("circle",g(g({},i),{cx:a,cy:s,r:l-3,strokeWidth:1.5})),p)},o}(e.CircleNode),i=function(t){function e(e,o){var i,r,a,s;e.id||(e.id="Event_".concat(gt())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var l=((null===(r=n.intermediateCatchEvent)||void 0===r?void 0:r.get(null===(a=e.properties)||void 0===a?void 0:a.definitionType))||{}).properties,u=void 0===l?{}:l;return e.properties=g(g({},u),e.properties),(null===(s=e.properties)||void 0===s?void 0:s.definitionType)&&(e.properties.definitionId="Definition_".concat(gt())),i=t.call(this,e,o)||this,ht.call(i),i}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e}(e.CircleNodeModel);return{type:"bpmn:intermediateCatchEvent",view:o,model:i}}function bt(t){var n=_(t.useDefinition(),1)[0],o=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return f(o,t),o.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},o.prototype.getShape=function(){var t,o=this.props.model,i=o.getNodeStyle(),r=o,a=r.x,s=r.y,l=r.r,u=r.width,c=r.height,d=r.properties,h=d.definitionType,p=d.isInterrupting,f=((null===(t=n.startEvent)||void 0===t?void 0:t.get(h))||{}).icon,v=Array.isArray(f)?e.h.apply(void 0,E(["g",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")")}],_(f),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")"),d:f,style:"fill: white; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"});return e.h("g",{},e.h("circle",g(g({},i),{cx:a,cy:s,r:l,strokeDasharray:p?"5,5":"",strokeWidth:2})),v)},o}(e.CircleNode),i=function(t){function e(e,o){var i,r,a;e.id||(e.id="Event_".concat(gt())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var s=((null===(i=n.startEvent)||void 0===i?void 0:i.get(null===(r=e.properties)||void 0===r?void 0:r.definitionType))||{}).properties,l=void 0===s?{}:s;return e.properties=g(g({},l),e.properties),(null===(a=e.properties)||void 0===a?void 0:a.definitionType)&&(e.properties.definitionId="Definition_".concat(gt())),t.call(this,e,o)||this}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var e=this,n=t.prototype.getConnectedTargetRules.call(this),o={message:"起始节点不能作为边的终点",validate:function(t,n){return n!==e}};return n.push(o),n},e}(e.CircleNodeModel);return{type:"bpmn:startEvent",view:o,model:i}}function xt(t){var n=_(t.useDefinition(),1)[0],o=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return f(o,t),o.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},o.prototype.getShape=function(){var t,o=this.props.model,i=o.getNodeStyle(),r=o,a=r.x,s=r.y,l=r.r,u=r.width,c=r.height,d=r.properties,h=d.definitionType,p=d.cancelActivity,f=((null===(t=n.boundaryEvent)||void 0===t?void 0:t.get(h))||{}).icon,v=Array.isArray(f)?e.h.apply(void 0,E(["g",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")")}],_(f),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")"),d:f});return e.h("g",{},e.h("circle",g(g({},i),{cx:a,cy:s,r:l,strokeDasharray:p?"":"5,5",strokeWidth:1.5})),e.h("circle",g(g({},i),{cx:a,cy:s,r:l-3,strokeDasharray:p?"":"5,5",strokeWidth:1.5})),v)},o}(e.CircleNode),i=function(t){function e(e,o){var i,r,a,s;e.id||(e.id="Event_".concat(gt())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var l=((null===(r=n.boundaryEvent)||void 0===r?void 0:r.get(null===(a=e.properties)||void 0===a?void 0:a.definitionType))||{}).properties,u=void 0===l?{}:l;return e.properties=g(g({attachedToRef:"",cancelActivity:!0},u),e.properties),(null===(s=e.properties)||void 0===s?void 0:s.definitionType)&&(e.properties.definitionId="Definition_".concat(gt())),i=t.call(this,e,o)||this,ht.call(i),i}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.r=20,this.autoToFront=!1,this.zIndex=99999},e.prototype.setAttributes=function(){this.r=18},e}(e.CircleNodeModel);return{type:"bpmn:boundaryEvent",view:o,model:i}}function _t(t){var n=_(t.useDefinition(),1)[0],o=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return f(o,t),o.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},o.prototype.getShape=function(){var t,o=this.props.model,i=o.getNodeStyle(),r=o,a=r.x,s=r.y,l=r.r,u=r.width,c=r.height,d=r.properties.definitionType,h=((null===(t=n.intermediateThrowEvent)||void 0===t?void 0:t.get(d))||{}).icon,p=Array.isArray(h)?e.h.apply(void 0,E(["g",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")")}],_(h),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")"),d:h,style:"fill: black"});return e.h("g",{},e.h("circle",g(g({},i),{cx:a,cy:s,r:l,strokeWidth:1.5})),e.h("circle",g(g({},i),{cx:a,cy:s,r:l-3,strokeWidth:1.5})),p)},o}(e.CircleNode),i=function(t){function e(e,o){var i,r,a,s;e.id||(e.id="Event_".concat(gt())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var l=((null===(r=n.intermediateThrowEvent)||void 0===r?void 0:r.get(null===(a=e.properties)||void 0===a?void 0:a.definitionType))||{}).properties,u=void 0===l?{}:l;return e.properties=g(g({},u),e.properties),(null===(s=e.properties)||void 0===s?void 0:s.definitionType)&&(e.properties.definitionId="Definition_".concat(gt())),i=t.call(this,e,o)||this,ht.call(i),i}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e}(e.CircleNodeModel);return{type:"bpmn:intermediateThrowEvent",view:o,model:i}}var Et=[e.h("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),e.h("path",{d:"M 18,18 l 2.25,-7.5 m -2.25,7.5 l 5.25,1.5",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(0,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(30,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(60,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(90,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(120,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(150,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(180,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(210,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(240,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(270,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(300,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(330,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"})],wt=[e.h("circle",{cx:18,cy:18,r:10,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 4px; fill: rgb(34, 36, 42);"})],St="m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z",Ct="m 23,10 0,12.5 -12.5,0 0,5 12.5,0 0,12.5 5,0 0,-12.5 12.5,0 0,-5 -12.5,0 0,-12.5 -5,0 z",Nt=e.h("circle",{cx:25,cy:25,r:13,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2.5px; fill: white;"}),Tt="M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z",At="M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z",Mt="m44,60 m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",Ot="m47,61 m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",Pt="m 50,73 c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",kt=Object.freeze({__proto__:null,compensationIcon:"m 7.92,18 9,-6.5 0,13 z m 9.3,-0.4 8.7,-6.1 0,13 -8.7,-6.1 z",conditionalIcon:"M 10.5,8.5 l 14.5,0 l 0,18 l -14.5,0 Z M 12.5,11.5 l 10.5,0 M 12.5,14.5 l 10.5,0 M 12.5,17.5 l 10.5,0 M 12.5,20.5 l 10.5,0 M 12.5,23.5 l 10.5,0 M 12.5,26.5 l 10.5,0 ",errorIcon:"m 7.2,25.991999999999997 0.09350000000000001,-0.025300000000000003 7.3392,-9.610700000000001 7.667000000000001,8.9661 4.7003,-18.2204 -5.8707,11.6501 -7.299600000000001,-9.585400000000002 z",escalationIcon:"M 18,7.2 l 8,20 l -8,-7 l -8,7 Z",exclusiveIcon:St,inclusiveIcon:Nt,linkIcon:"m 20.52,9.468 0,4.4375 -13.5,0 0,6.75 13.5,0 0,4.4375 9.84375,-7.8125 -9.84375,-7.8125 z",loopMarker:Pt,manualTaskIcon:"M0.5,3.751L4.583,0.5009999999999999C4.583,0.5009999999999999,15.749,0.5839999999999999,16.666,0.5839999999999999S14.249,3.5009999999999994,15.166,3.5009999999999994S26.833,3.5009999999999994,27.75,3.5009999999999994C28.916,5.209,27.582,6.667999999999999,26.916,7.167999999999999S27.791,9.084999999999999,25.916,11.584999999999999C25.166,11.834999999999999,26.666,13.459999999999999,24.583000000000002,14.918C23.416,15.501,25.166,16.46,23.333000000000002,17.750999999999998C22.166,17.750999999999998,2.5000000000000036,17.833999999999996,2.5000000000000036,17.833999999999996L0.5000000000000036,16.500999999999998V3.751ZM13.5,7L27,7M13.5,11L26,11M14,14.5L25,14.5M8.2,3.1L15,3.1",messageIcon:"m 8.459999999999999,11.34 l 0,12.6 l 18.900000000000002,0 l 0,-12.6 z l 9.450000000000001,5.4 l 9.450000000000001,-5.4",parallelIcon:Ct,parallelMarker:Mt,scriptTaskIcon:"M6.402,0.5H20.902C20.902,0.5,15.069,3.333,15.069,6.083S19.486,12.083,19.486,15.25S15.319,20.333,15.319,20.333H0.235C0.235,20.333,5.235,17.665999999999997,5.235,15.332999999999998S0.6520000000000001,8.582999999999998,0.6520000000000001,6.082999999999998S6.402,0.5,6.402,0.5ZM3.5,4.5L13.5,4.5M3.8,8.5L13.8,8.5M6.3,12.5L16.3,12.5M6.5,16.5L16.5,16.5",sequentialMarker:Ot,serviceTaskIcon:Tt,signalIcon:"M 18,7.2 l 9,16.2 l -18,0 Z",style:{throw:"fill: rgb(34, 36, 42); stroke-linecap: round; stroke-linejoin: round; stroke: white; stroke-width: 1px;",catch:"fill: white; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;",nonIntermediate:"stroke-width: 1.5; stroke-dash-array: 6",intermediate:"stroke-width: 1.5"},terminateIcon:wt,timerIcon:Et,userTaskIcon:At});function Rt(t,n,o){var i=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return f(o,t),o.prototype.getShape=function(){var t=this.props.model,o=t,i=o.x,r=o.y,a=o.width,s=o.height,l=o.points,u=t.getNodeStyle();return e.h("g",{transform:"matrix(1 0 0 1 ".concat(i-a/2," ").concat(r-s/2,")")},e.h(e.Polygon,g(g({},u),{x:i,y:r,points:l})),"string"==typeof n?e.h("path",g(g({d:n},u),{fill:"rgb(34, 36, 42)",strokeWidth:1})):n)},o}(e.PolygonNode);return{type:t,view:i,model:function(t){function e(e,n){var i=this;return e.id||(e.id="Gateway_".concat(gt())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),e.properties=g(g({},o||{}),e.properties),(i=t.call(this,e,n)||this).points=[[25,0],[50,25],[25,50],[0,25]],ht.call(i),i}return f(e,t),e}(e.PolygonNodeModel)}}var Dt={parallel:Mt,sequential:Ot,loop:Pt};function Lt(t,n,o){var i=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return f(o,t),o.prototype.getLabelShape=function(){var t=this.props.model,o=t.x,i=t.y,r=t.width,a=t.height,s=t.getNodeStyle(),l=Array.isArray(n)?e.h.apply(void 0,E(["g",{transform:"matrix(1 0 0 1 ".concat(o-r/2," ").concat(i-a/2,")")}],_(n),!1)):e.h("path",{fill:s.stroke,d:n});return e.h("svg",{x:o-r/2+5,y:i-a/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},l)},o.prototype.getShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.radius,s=t.properties,l=t.getNodeStyle();return e.h("g",{},[e.h("rect",g(g({},l),{x:n-i/2,y:o-r/2,rx:a,ry:a,width:i,height:r,opacity:.95})),this.getLabelShape(),e.h("g",{transform:"matrix(1 0 0 1 ".concat(n-i/2," ").concat(o-r/2,")")},e.h("path",{fill:"white",strokeLinecap:"round",strokeLinejoin:"round",stroke:"rgb(34, 36, 42)",strokeWidth:"2",d:Dt[s.multiInstanceType]||""}))])},o}(e.RectNode),r=function(t){function e(e,n){var i,r=this;e.id||(e.id="Activity_".concat(gt()));var a=g(g({},o||{}),e.properties);return e.properties=a,r=t.call(this,e,n)||this,null===(i=null==a?void 0:a.boundaryEvents)||void 0===i||i.forEach((function(t){r.addBoundaryEvent(t)})),r.deleteProperty("boundaryEvents"),ht.call(r),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.isTaskNode=!0,this.boundaryEvents=[]},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return this.properties.isBoundaryEventTouchingTask&&(e.stroke="#00acff",e.strokeWidth=2),e},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return e.stroke="transparent",!e.hover&&(e.hover={}),e.hover.stroke="transparent",e},e.prototype.setTouching=function(t){this.setProperty("isBoundaryEventTouchingTask",t)},e.prototype.addBoundaryEvent=function(t){if(this.setTouching(!1),this.boundaryEvents.find((function(e){return e===t})))return!1;var e=this.graphModel.getNodeModelById(t);return null==e||e.setProperties({attachedToRef:this.id}),this.boundaryEvents.push(t),!0},e.prototype.deleteBoundaryEvent=function(t){this.boundaryEvents=this.boundaryEvents.filter((function(e){return e!==t}))},e}(e.RectNodeModel);return{type:t,view:i,model:r}}var It="object"==typeof global&&global&&global.Object===Object&&global,jt="object"==typeof self&&self&&self.Object===Object&&self,Bt=It||jt||Function("return this")(),Ht=Bt.Symbol,Ft=Object.prototype,zt=Ft.hasOwnProperty,Wt=Ft.toString,Gt=Ht?Ht.toStringTag:void 0;var Ut=Object.prototype.toString;var Xt="[object Null]",Vt="[object Undefined]",Yt=Ht?Ht.toStringTag:void 0;function qt(t){return null==t?void 0===t?Vt:Xt:Yt&&Yt in Object(t)?function(t){var e=zt.call(t,Gt),n=t[Gt];try{t[Gt]=void 0;var o=!0}catch(t){}var i=Wt.call(t);return o&&(e?t[Gt]=n:delete t[Gt]),i}(t):function(t){return Ut.call(t)}(t)}function Kt(t){return null!=t&&"object"==typeof t}var Zt="[object Symbol]";function $t(t){return"symbol"==typeof t||Kt(t)&&qt(t)==Zt}var Jt=NaN;function Qt(t){return"number"==typeof t?t:$t(t)?Jt:+t}function te(t,e){for(var n=-1,o=null==t?0:t.length,i=Array(o);++n<o;)i[n]=e(t[n],n,t);return i}var ee=Array.isArray,ne=1/0,oe=Ht?Ht.prototype:void 0,ie=oe?oe.toString:void 0;function re(t){if("string"==typeof t)return t;if(ee(t))return te(t,re)+"";if($t(t))return ie?ie.call(t):"";var e=t+"";return"0"==e&&1/t==-ne?"-0":e}function ae(t,e){return function(n,o){var i;if(void 0===n&&void 0===o)return e;if(void 0!==n&&(i=n),void 0!==o){if(void 0===i)return o;"string"==typeof n||"string"==typeof o?(n=re(n),o=re(o)):(n=Qt(n),o=Qt(o)),i=t(n,o)}return i}}var se=ae((function(t,e){return t+e}),0),le=/\s/;function ue(t){for(var e=t.length;e--&&le.test(t.charAt(e)););return e}var ce=/^\s+/;function de(t){return t?t.slice(0,ue(t)+1).replace(ce,""):t}function he(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var pe=NaN,fe=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,ve=/^0o[0-7]+$/i,ye=parseInt;function me(t){if("number"==typeof t)return t;if($t(t))return pe;if(he(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=he(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=de(t);var n=ge.test(t);return n||ve.test(t)?ye(t.slice(2),n?2:8):fe.test(t)?pe:+t}var be=1/0,xe=17976931348623157e292;function _e(t){return t?(t=me(t))===be||t===-be?(t<0?-1:1)*xe:t==t?t:0:0===t?t:0}function Ee(t){var e=_e(t),n=e%1;return e==e?n?e-n:e:0}function we(t){return t}var Se="[object AsyncFunction]",Ce="[object Function]",Ne="[object GeneratorFunction]",Te="[object Proxy]";function Ae(t){if(!he(t))return!1;var e=qt(t);return e==Ce||e==Ne||e==Se||e==Te}var Me,Oe=Bt["__core-js_shared__"],Pe=(Me=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+Me:"";var ke=Function.prototype.toString;function Re(t){if(null!=t){try{return ke.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var De=/^\[object .+?Constructor\]$/,Le=Function.prototype,Ie=Object.prototype,je=Le.toString,Be=Ie.hasOwnProperty,He=RegExp("^"+je.call(Be).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Fe(t){return!(!he(t)||function(t){return!!Pe&&Pe in t}(t))&&(Ae(t)?He:De).test(Re(t))}function ze(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Fe(n)?n:void 0}var We=ze(Bt,"WeakMap"),Ge=We&&new We,Ue=Ge?function(t,e){return Ge.set(t,e),t}:we,Xe=Object.create,Ve=function(){function t(){}return function(e){if(!he(e))return{};if(Xe)return Xe(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Ye(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Ve(t.prototype),o=t.apply(n,e);return he(o)?o:n}}var qe=1;function Ke(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var Ze=Math.max;function $e(t,e,n,o){for(var i=-1,r=t.length,a=n.length,s=-1,l=e.length,u=Ze(r-a,0),c=Array(l+u),d=!o;++s<l;)c[s]=e[s];for(;++i<a;)(d||i<r)&&(c[n[i]]=t[i]);for(;u--;)c[s++]=t[i++];return c}var Je=Math.max;function Qe(t,e,n,o){for(var i=-1,r=t.length,a=-1,s=n.length,l=-1,u=e.length,c=Je(r-s,0),d=Array(c+u),h=!o;++i<c;)d[i]=t[i];for(var p=i;++l<u;)d[p+l]=e[l];for(;++a<s;)(h||i<r)&&(d[p+n[a]]=t[i++]);return d}function tn(){}var en=4294967295;function nn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=en,this.__views__=[]}function on(){}nn.prototype=Ve(tn.prototype),nn.prototype.constructor=nn;var rn=Ge?function(t){return Ge.get(t)}:on,an={},sn=Object.prototype.hasOwnProperty;function ln(t){for(var e=t.name+"",n=an[e],o=sn.call(an,e)?n.length:0;o--;){var i=n[o],r=i.func;if(null==r||r==t)return i.name}return e}function un(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function cn(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}function dn(t){if(t instanceof nn)return t.clone();var e=new un(t.__wrapped__,t.__chain__);return e.__actions__=cn(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}un.prototype=Ve(tn.prototype),un.prototype.constructor=un;var hn=Object.prototype.hasOwnProperty;function pn(t){if(Kt(t)&&!ee(t)&&!(t instanceof nn)){if(t instanceof un)return t;if(hn.call(t,"__wrapped__"))return dn(t)}return new un(t)}function fn(t){var e=ln(t),n=pn[e];if("function"!=typeof n||!(e in nn.prototype))return!1;if(t===n)return!0;var o=rn(n);return!!o&&t===o[0]}pn.prototype=tn.prototype,pn.prototype.constructor=pn;var gn=Date.now;function vn(t){var e=0,n=0;return function(){var o=gn(),i=16-(o-n);if(n=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var yn=vn(Ue),mn=/\{\n\/\* \[wrapped with (.+)\] \*/,bn=/,? & /;var xn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function _n(t){return function(){return t}}var En=function(){try{var t=ze(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),wn=En?function(t,e){return En(t,"toString",{configurable:!0,enumerable:!1,value:_n(e),writable:!0})}:we,Sn=vn(wn);function Cn(t,e){for(var n=-1,o=null==t?0:t.length;++n<o&&!1!==e(t[n],n,t););return t}function Nn(t,e,n,o){for(var i=t.length,r=n+(o?1:-1);o?r--:++r<i;)if(e(t[r],r,t))return r;return-1}function Tn(t){return t!=t}function An(t,e,n){return e==e?function(t,e,n){for(var o=n-1,i=t.length;++o<i;)if(t[o]===e)return o;return-1}(t,e,n):Nn(t,Tn,n)}function Mn(t,e){return!!(null==t?0:t.length)&&An(t,e,0)>-1}var On=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function Pn(t,e,n){var o=e+"";return Sn(t,function(t,e){var n=e.length;if(!n)return t;var o=n-1;return e[o]=(n>1?"& ":"")+e[o],e=e.join(n>2?", ":" "),t.replace(xn,"{\n/* [wrapped with "+e+"] */\n")}(o,function(t,e){return Cn(On,(function(n){var o="_."+n[0];e&n[1]&&!Mn(t,o)&&t.push(o)})),t.sort()}(function(t){var e=t.match(mn);return e?e[1].split(bn):[]}(o),n)))}var kn=1,Rn=2,Dn=4,Ln=8,In=32,jn=64;function Bn(t,e,n,o,i,r,a,s,l,u){var c=e&Ln;e|=c?In:jn,(e&=~(c?jn:In))&Dn||(e&=~(kn|Rn));var d=[t,e,i,c?r:void 0,c?a:void 0,c?void 0:r,c?void 0:a,s,l,u],h=n.apply(void 0,d);return fn(t)&&yn(h,d),h.placeholder=o,Pn(h,t,e)}function Hn(t){return t.placeholder}var Fn=9007199254740991,zn=/^(?:0|[1-9]\d*)$/;function Wn(t,e){var n=typeof t;return!!(e=null==e?Fn:e)&&("number"==n||"symbol"!=n&&zn.test(t))&&t>-1&&t%1==0&&t<e}var Gn=Math.min;var Un="__lodash_placeholder__";function Xn(t,e){for(var n=-1,o=t.length,i=0,r=[];++n<o;){var a=t[n];a!==e&&a!==Un||(t[n]=Un,r[i++]=n)}return r}var Vn=1,Yn=2,qn=8,Kn=16,Zn=128,$n=512;function Jn(t,e,n,o,i,r,a,s,l,u){var c=e&Zn,d=e&Vn,h=e&Yn,p=e&(qn|Kn),f=e&$n,g=h?void 0:Ye(t);return function v(){for(var y=arguments.length,m=Array(y),b=y;b--;)m[b]=arguments[b];if(p)var x=Hn(v),_=function(t,e){for(var n=t.length,o=0;n--;)t[n]===e&&++o;return o}(m,x);if(o&&(m=$e(m,o,i,p)),r&&(m=Qe(m,r,a,p)),y-=_,p&&y<u){var E=Xn(m,x);return Bn(t,e,Jn,v.placeholder,n,m,E,s,l,u-y)}var w=d?n:this,S=h?w[t]:t;return y=m.length,s?m=function(t,e){for(var n=t.length,o=Gn(e.length,n),i=cn(t);o--;){var r=e[o];t[o]=Wn(r,n)?i[r]:void 0}return t}(m,s):f&&y>1&&m.reverse(),c&&l<y&&(m.length=l),this&&this!==Bt&&this instanceof v&&(S=g||Ye(S)),S.apply(w,m)}}var Qn=1;var to="__lodash_placeholder__",eo=1,no=2,oo=4,io=8,ro=128,ao=256,so=Math.min;var lo="Expected a function",uo=1,co=2,ho=8,po=16,fo=32,go=64,vo=Math.max;function yo(t,e,n,o,i,r,a,s){var l=e&co;if(!l&&"function"!=typeof t)throw new TypeError(lo);var u=o?o.length:0;if(u||(e&=~(fo|go),o=i=void 0),a=void 0===a?a:vo(Ee(a),0),s=void 0===s?s:Ee(s),u-=i?i.length:0,e&go){var c=o,d=i;o=i=void 0}var h=l?void 0:rn(t),p=[t,e,n,o,i,c,d,r,a,s];if(h&&function(t,e){var n=t[1],o=e[1],i=n|o,r=i<(eo|no|ro),a=o==ro&&n==io||o==ro&&n==ao&&t[7].length<=e[8]||o==(ro|ao)&&e[7].length<=e[8]&&n==io;if(!r&&!a)return t;o&eo&&(t[2]=e[2],i|=n&eo?0:oo);var s=e[3];if(s){var l=t[3];t[3]=l?$e(l,s,e[4]):s,t[4]=l?Xn(t[3],to):e[4]}(s=e[5])&&(l=t[5],t[5]=l?Qe(l,s,e[6]):s,t[6]=l?Xn(t[5],to):e[6]),(s=e[7])&&(t[7]=s),o&ro&&(t[8]=null==t[8]?e[8]:so(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(p,h),t=p[0],e=p[1],n=p[2],o=p[3],i=p[4],!(s=p[9]=void 0===p[9]?l?0:t.length:vo(p[9]-u,0))&&e&(ho|po)&&(e&=~(ho|po)),e&&e!=uo)f=e==ho||e==po?function(t,e,n){var o=Ye(t);return function i(){for(var r=arguments.length,a=Array(r),s=r,l=Hn(i);s--;)a[s]=arguments[s];var u=r<3&&a[0]!==l&&a[r-1]!==l?[]:Xn(a,l);return(r-=u.length)<n?Bn(t,e,Jn,i.placeholder,void 0,a,u,void 0,void 0,n-r):Ke(this&&this!==Bt&&this instanceof i?o:t,this,a)}}(t,e,s):e!=fo&&e!=(uo|fo)||i.length?Jn.apply(void 0,p):function(t,e,n,o){var i=e&Qn,r=Ye(t);return function e(){for(var a=-1,s=arguments.length,l=-1,u=o.length,c=Array(u+s),d=this&&this!==Bt&&this instanceof e?r:t;++l<u;)c[l]=o[l];for(;s--;)c[l++]=arguments[++a];return Ke(d,i?n:this,c)}}(t,e,n,o);else var f=function(t,e,n){var o=e&qe,i=Ye(t);return function e(){return(this&&this!==Bt&&this instanceof e?i:t).apply(o?n:this,arguments)}}(t,e,n);return Pn((h?Ue:yn)(f,p),t,e)}var mo=128;function bo(t,e,n){return e=n?void 0:e,e=t&&null==e?t.length:e,yo(t,mo,void 0,void 0,void 0,void 0,e)}function xo(t,e,n){"__proto__"==e&&En?En(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function _o(t,e){return t===e||t!=t&&e!=e}var Eo=Object.prototype.hasOwnProperty;function wo(t,e,n){var o=t[e];Eo.call(t,e)&&_o(o,n)&&(void 0!==n||e in t)||xo(t,e,n)}function So(t,e,n,o){var i=!n;n||(n={});for(var r=-1,a=e.length;++r<a;){var s=e[r],l=o?o(n[s],t[s],s,n,t):void 0;void 0===l&&(l=t[s]),i?xo(n,s,l):wo(n,s,l)}return n}var Co=Math.max;function No(t,e,n){return e=Co(void 0===e?t.length-1:e,0),function(){for(var o=arguments,i=-1,r=Co(o.length-e,0),a=Array(r);++i<r;)a[i]=o[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=o[i];return s[e]=n(a),Ke(t,this,s)}}function To(t,e){return Sn(No(t,e,we),t+"")}var Ao=9007199254740991;function Mo(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Ao}function Oo(t){return null!=t&&Mo(t.length)&&!Ae(t)}function Po(t,e,n){if(!he(n))return!1;var o=typeof e;return!!("number"==o?Oo(n)&&Wn(e,n.length):"string"==o&&e in n)&&_o(n[e],t)}function ko(t){return To((function(e,n){var o=-1,i=n.length,r=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(r=t.length>3&&"function"==typeof r?(i--,r):void 0,a&&Po(n[0],n[1],a)&&(r=i<3?void 0:r,i=1),e=Object(e);++o<i;){var s=n[o];s&&t(e,s,o,r)}return e}))}var Ro=Object.prototype;function Do(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ro)}function Lo(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}function Io(t){return Kt(t)&&"[object Arguments]"==qt(t)}var jo=Object.prototype,Bo=jo.hasOwnProperty,Ho=jo.propertyIsEnumerable,Fo=Io(function(){return arguments}())?Io:function(t){return Kt(t)&&Bo.call(t,"callee")&&!Ho.call(t,"callee")};function zo(){return!1}var Wo="object"==typeof t&&t&&!t.nodeType&&t,Go=Wo&&"object"==typeof module&&module&&!module.nodeType&&module,Uo=Go&&Go.exports===Wo?Bt.Buffer:void 0,Xo=(Uo?Uo.isBuffer:void 0)||zo,Vo={};function Yo(t){return function(e){return t(e)}}Vo["[object Float32Array]"]=Vo["[object Float64Array]"]=Vo["[object Int8Array]"]=Vo["[object Int16Array]"]=Vo["[object Int32Array]"]=Vo["[object Uint8Array]"]=Vo["[object Uint8ClampedArray]"]=Vo["[object Uint16Array]"]=Vo["[object Uint32Array]"]=!0,Vo["[object Arguments]"]=Vo["[object Array]"]=Vo["[object ArrayBuffer]"]=Vo["[object Boolean]"]=Vo["[object DataView]"]=Vo["[object Date]"]=Vo["[object Error]"]=Vo["[object Function]"]=Vo["[object Map]"]=Vo["[object Number]"]=Vo["[object Object]"]=Vo["[object RegExp]"]=Vo["[object Set]"]=Vo["[object String]"]=Vo["[object WeakMap]"]=!1;var qo="object"==typeof t&&t&&!t.nodeType&&t,Ko=qo&&"object"==typeof module&&module&&!module.nodeType&&module,Zo=Ko&&Ko.exports===qo&&It.process,$o=function(){try{var t=Ko&&Ko.require&&Ko.require("util").types;return t||Zo&&Zo.binding&&Zo.binding("util")}catch(t){}}(),Jo=$o&&$o.isTypedArray,Qo=Jo?Yo(Jo):function(t){return Kt(t)&&Mo(t.length)&&!!Vo[qt(t)]},ti=Object.prototype.hasOwnProperty;function ei(t,e){var n=ee(t),o=!n&&Fo(t),i=!n&&!o&&Xo(t),r=!n&&!o&&!i&&Qo(t),a=n||o||i||r,s=a?Lo(t.length,String):[],l=s.length;for(var u in t)!e&&!ti.call(t,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||r&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Wn(u,l))||s.push(u);return s}function ni(t,e){return function(n){return t(e(n))}}var oi=ni(Object.keys,Object),ii=Object.prototype.hasOwnProperty;function ri(t){if(!Do(t))return oi(t);var e=[];for(var n in Object(t))ii.call(t,n)&&"constructor"!=n&&e.push(n);return e}function ai(t){return Oo(t)?ei(t):ri(t)}var si=Object.prototype.hasOwnProperty,li=ko((function(t,e){if(Do(e)||Oo(e))So(e,ai(e),t);else for(var n in e)si.call(e,n)&&wo(t,n,e[n])}));var ui=Object.prototype.hasOwnProperty;function ci(t){if(!he(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Do(t),n=[];for(var o in t)("constructor"!=o||!e&&ui.call(t,o))&&n.push(o);return n}function di(t){return Oo(t)?ei(t,!0):ci(t)}var hi=ko((function(t,e){So(e,di(e),t)})),pi=ko((function(t,e,n,o){So(e,di(e),t,o)})),fi=ko((function(t,e,n,o){So(e,ai(e),t,o)})),gi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vi=/^\w*$/;function yi(t,e){if(ee(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!$t(t))||(vi.test(t)||!gi.test(t)||null!=e&&t in Object(e))}var mi=ze(Object,"create");var bi=Object.prototype.hasOwnProperty;var xi=Object.prototype.hasOwnProperty;function _i(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function Ei(t,e){for(var n=t.length;n--;)if(_o(t[n][0],e))return n;return-1}_i.prototype.clear=function(){this.__data__=mi?mi(null):{},this.size=0},_i.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},_i.prototype.get=function(t){var e=this.__data__;if(mi){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return bi.call(e,t)?e[t]:void 0},_i.prototype.has=function(t){var e=this.__data__;return mi?void 0!==e[t]:xi.call(e,t)},_i.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=mi&&void 0===e?"__lodash_hash_undefined__":e,this};var wi=Array.prototype.splice;function Si(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}Si.prototype.clear=function(){this.__data__=[],this.size=0},Si.prototype.delete=function(t){var e=this.__data__,n=Ei(e,t);return!(n<0)&&(n==e.length-1?e.pop():wi.call(e,n,1),--this.size,!0)},Si.prototype.get=function(t){var e=this.__data__,n=Ei(e,t);return n<0?void 0:e[n][1]},Si.prototype.has=function(t){return Ei(this.__data__,t)>-1},Si.prototype.set=function(t,e){var n=this.__data__,o=Ei(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};var Ci=ze(Bt,"Map");function Ni(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map}function Ti(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}Ti.prototype.clear=function(){this.size=0,this.__data__={hash:new _i,map:new(Ci||Si),string:new _i}},Ti.prototype.delete=function(t){var e=Ni(this,t).delete(t);return this.size-=e?1:0,e},Ti.prototype.get=function(t){return Ni(this,t).get(t)},Ti.prototype.has=function(t){return Ni(this,t).has(t)},Ti.prototype.set=function(t,e){var n=Ni(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};var Ai="Expected a function";function Mi(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Ai);var n=function(){var o=arguments,i=e?e.apply(this,o):o[0],r=n.cache;if(r.has(i))return r.get(i);var a=t.apply(this,o);return n.cache=r.set(i,a)||r,a};return n.cache=new(Mi.Cache||Ti),n}Mi.Cache=Ti;var Oi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pi=/\\(\\)?/g,ki=function(t){var e=Mi(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Oi,(function(t,n,o,i){e.push(o?i.replace(Pi,"$1"):n||t)})),e}));function Ri(t){return null==t?"":re(t)}function Di(t,e){return ee(t)?t:yi(t,e)?[t]:ki(Ri(t))}var Li=1/0;function Ii(t){if("string"==typeof t||$t(t))return t;var e=t+"";return"0"==e&&1/t==-Li?"-0":e}function ji(t,e){for(var n=0,o=(e=Di(e,t)).length;null!=t&&n<o;)t=t[Ii(e[n++])];return n&&n==o?t:void 0}function Bi(t,e,n){var o=null==t?void 0:ji(t,e);return void 0===o?n:o}function Hi(t,e){for(var n=-1,o=e.length,i=Array(o),r=null==t;++n<o;)i[n]=r?void 0:Bi(t,e[n]);return i}function Fi(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t}var zi=Ht?Ht.isConcatSpreadable:void 0;function Wi(t){return ee(t)||Fo(t)||!!(zi&&t&&t[zi])}function Gi(t,e,n,o,i){var r=-1,a=t.length;for(n||(n=Wi),i||(i=[]);++r<a;){var s=t[r];e>0&&n(s)?e>1?Gi(s,e-1,n,o,i):Fi(i,s):o||(i[i.length]=s)}return i}function Ui(t){return(null==t?0:t.length)?Gi(t,1):[]}function Xi(t){return Sn(No(t,void 0,Ui),t+"")}var Vi=Xi(Hi),Yi=ni(Object.getPrototypeOf,Object),qi="[object Object]",Ki=Function.prototype,Zi=Object.prototype,$i=Ki.toString,Ji=Zi.hasOwnProperty,Qi=$i.call(Object);function tr(t){if(!Kt(t)||qt(t)!=qi)return!1;var e=Yi(t);if(null===e)return!0;var n=Ji.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&$i.call(n)==Qi}var er="[object DOMException]",nr="[object Error]";function or(t){if(!Kt(t))return!1;var e=qt(t);return e==nr||e==er||"string"==typeof t.message&&"string"==typeof t.name&&!tr(t)}var ir=To((function(t,e){try{return Ke(t,void 0,e)}catch(t){return or(t)?t:new Error(t)}})),rr="Expected a function";function ar(t,e){var n;if("function"!=typeof e)throw new TypeError(rr);return t=Ee(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var sr=To((function(t,e,n){var o=1;if(n.length){var i=Xn(n,Hn(sr));o|=32}return yo(t,o,e,n,i)}));sr.placeholder={};var lr=Xi((function(t,e){return Cn(e,(function(e){e=Ii(e),xo(t,e,sr(t[e],t))})),t})),ur=To((function(t,e,n){var o=3;if(n.length){var i=Xn(n,Hn(ur));o|=32}return yo(e,o,t,n,i)}));function cr(t,e,n){var o=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var r=Array(i);++o<i;)r[o]=t[o+e];return r}function dr(t,e,n){var o=t.length;return n=void 0===n?o:n,!e&&n>=o?t:cr(t,e,n)}ur.placeholder={};var hr=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function pr(t){return hr.test(t)}var fr="\\ud800-\\udfff",gr="["+fr+"]",vr="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",yr="\\ud83c[\\udffb-\\udfff]",mr="[^"+fr+"]",br="(?:\\ud83c[\\udde6-\\uddff]){2}",xr="[\\ud800-\\udbff][\\udc00-\\udfff]",_r="(?:"+vr+"|"+yr+")"+"?",Er="[\\ufe0e\\ufe0f]?",wr=Er+_r+("(?:\\u200d(?:"+[mr,br,xr].join("|")+")"+Er+_r+")*"),Sr="(?:"+[mr+vr+"?",vr,br,xr,gr].join("|")+")",Cr=RegExp(yr+"(?="+yr+")|"+Sr+wr,"g");function Nr(t){return pr(t)?function(t){return t.match(Cr)||[]}(t):function(t){return t.split("")}(t)}function Tr(t){return function(e){var n=pr(e=Ri(e))?Nr(e):void 0,o=n?n[0]:e.charAt(0),i=n?dr(n,1).join(""):e.slice(1);return o[t]()+i}}var Ar=Tr("toUpperCase");function Mr(t){return Ar(Ri(t).toLowerCase())}function Or(t,e,n,o){var i=-1,r=null==t?0:t.length;for(o&&r&&(n=t[++i]);++i<r;)n=e(n,t[i],i,t);return n}function Pr(t){return function(e){return null==t?void 0:t[e]}}var kr=Pr({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Rr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Dr=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");function Lr(t){return(t=Ri(t))&&t.replace(Rr,kr).replace(Dr,"")}var Ir=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var jr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Br="\\ud800-\\udfff",Hr="\\u2700-\\u27bf",Fr="a-z\\xdf-\\xf6\\xf8-\\xff",zr="A-Z\\xc0-\\xd6\\xd8-\\xde",Wr="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Gr="["+Wr+"]",Ur="\\d+",Xr="["+Hr+"]",Vr="["+Fr+"]",Yr="[^"+Br+Wr+Ur+Hr+Fr+zr+"]",qr="(?:\\ud83c[\\udde6-\\uddff]){2}",Kr="[\\ud800-\\udbff][\\udc00-\\udfff]",Zr="["+zr+"]",$r="(?:"+Vr+"|"+Yr+")",Jr="(?:"+Zr+"|"+Yr+")",Qr="(?:['’](?:d|ll|m|re|s|t|ve))?",ta="(?:['’](?:D|LL|M|RE|S|T|VE))?",ea="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",na="[\\ufe0e\\ufe0f]?",oa=na+ea+("(?:\\u200d(?:"+["[^"+Br+"]",qr,Kr].join("|")+")"+na+ea+")*"),ia="(?:"+[Xr,qr,Kr].join("|")+")"+oa,ra=RegExp([Zr+"?"+Vr+"+"+Qr+"(?="+[Gr,Zr,"$"].join("|")+")",Jr+"+"+ta+"(?="+[Gr,Zr+$r,"$"].join("|")+")",Zr+"?"+$r+"+"+Qr,Zr+"+"+ta,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ur,ia].join("|"),"g");function aa(t,e,n){return t=Ri(t),void 0===(e=n?void 0:e)?function(t){return jr.test(t)}(t)?function(t){return t.match(ra)||[]}(t):function(t){return t.match(Ir)||[]}(t):t.match(e)||[]}var sa=RegExp("['’]","g");function la(t){return function(e){return Or(aa(Lr(e).replace(sa,"")),t,"")}}var ua=la((function(t,e,n){return e=e.toLowerCase(),t+(n?Mr(e):e)}));var ca=Bt.isFinite,da=Math.min;function ha(t){var e=Math[t];return function(t,n){if(t=me(t),(n=null==n?0:da(Ee(n),292))&&ca(t)){var o=(Ri(t)+"e").split("e");return+((o=(Ri(e(o[0]+"e"+(+o[1]+n)))+"e").split("e"))[0]+"e"+(+o[1]-n))}return e(t)}}var pa=ha("ceil");function fa(t){var e=pn(t);return e.__chain__=!0,e}var ga=Math.ceil,va=Math.max;function ya(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function ma(t){var e=this.__data__=new Si(t);this.size=e.size}function ba(t,e){return t&&So(e,ai(e),t)}ma.prototype.clear=function(){this.__data__=new Si,this.size=0},ma.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},ma.prototype.get=function(t){return this.__data__.get(t)},ma.prototype.has=function(t){return this.__data__.has(t)},ma.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Si){var o=n.__data__;if(!Ci||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ti(o)}return n.set(t,e),this.size=n.size,this};var xa="object"==typeof t&&t&&!t.nodeType&&t,_a=xa&&"object"==typeof module&&module&&!module.nodeType&&module,Ea=_a&&_a.exports===xa?Bt.Buffer:void 0,wa=Ea?Ea.allocUnsafe:void 0;function Sa(t,e){if(e)return t.slice();var n=t.length,o=wa?wa(n):new t.constructor(n);return t.copy(o),o}function Ca(t,e){for(var n=-1,o=null==t?0:t.length,i=0,r=[];++n<o;){var a=t[n];e(a,n,t)&&(r[i++]=a)}return r}function Na(){return[]}var Ta=Object.prototype.propertyIsEnumerable,Aa=Object.getOwnPropertySymbols,Ma=Aa?function(t){return null==t?[]:(t=Object(t),Ca(Aa(t),(function(e){return Ta.call(t,e)})))}:Na;var Oa=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Fi(e,Ma(t)),t=Yi(t);return e}:Na;function Pa(t,e,n){var o=e(t);return ee(t)?o:Fi(o,n(t))}function ka(t){return Pa(t,ai,Ma)}function Ra(t){return Pa(t,di,Oa)}var Da=ze(Bt,"DataView"),La=ze(Bt,"Promise"),Ia=ze(Bt,"Set"),ja="[object Map]",Ba="[object Promise]",Ha="[object Set]",Fa="[object WeakMap]",za="[object DataView]",Wa=Re(Da),Ga=Re(Ci),Ua=Re(La),Xa=Re(Ia),Va=Re(We),Ya=qt;(Da&&Ya(new Da(new ArrayBuffer(1)))!=za||Ci&&Ya(new Ci)!=ja||La&&Ya(La.resolve())!=Ba||Ia&&Ya(new Ia)!=Ha||We&&Ya(new We)!=Fa)&&(Ya=function(t){var e=qt(t),n="[object Object]"==e?t.constructor:void 0,o=n?Re(n):"";if(o)switch(o){case Wa:return za;case Ga:return ja;case Ua:return Ba;case Xa:return Ha;case Va:return Fa}return e});var qa=Ya,Ka=Object.prototype.hasOwnProperty;var Za=Bt.Uint8Array;function $a(t){var e=new t.constructor(t.byteLength);return new Za(e).set(new Za(t)),e}var Ja=/\w*$/;var Qa=Ht?Ht.prototype:void 0,ts=Qa?Qa.valueOf:void 0;function es(t,e){var n=e?$a(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var ns="[object Boolean]",os="[object Date]",is="[object Map]",rs="[object Number]",as="[object RegExp]",ss="[object Set]",ls="[object String]",us="[object Symbol]",cs="[object ArrayBuffer]",ds="[object DataView]",hs="[object Float32Array]",ps="[object Float64Array]",fs="[object Int8Array]",gs="[object Int16Array]",vs="[object Int32Array]",ys="[object Uint8Array]",ms="[object Uint8ClampedArray]",bs="[object Uint16Array]",xs="[object Uint32Array]";function _s(t,e,n){var o,i=t.constructor;switch(e){case cs:return $a(t);case ns:case os:return new i(+t);case ds:return function(t,e){var n=e?$a(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case hs:case ps:case fs:case gs:case vs:case ys:case ms:case bs:case xs:return es(t,n);case is:return new i;case rs:case ls:return new i(t);case as:return function(t){var e=new t.constructor(t.source,Ja.exec(t));return e.lastIndex=t.lastIndex,e}(t);case ss:return new i;case us:return o=t,ts?Object(ts.call(o)):{}}}function Es(t){return"function"!=typeof t.constructor||Do(t)?{}:Ve(Yi(t))}var ws=$o&&$o.isMap,Ss=ws?Yo(ws):function(t){return Kt(t)&&"[object Map]"==qa(t)};var Cs=$o&&$o.isSet,Ns=Cs?Yo(Cs):function(t){return Kt(t)&&"[object Set]"==qa(t)},Ts=1,As=2,Ms=4,Os="[object Arguments]",Ps="[object Function]",ks="[object GeneratorFunction]",Rs="[object Object]",Ds={};function Ls(t,e,n,o,i,r){var a,s=e&Ts,l=e&As,u=e&Ms;if(n&&(a=i?n(t,o,i,r):n(t)),void 0!==a)return a;if(!he(t))return t;var c=ee(t);if(c){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Ka.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!s)return cn(t,a)}else{var d=qa(t),h=d==Ps||d==ks;if(Xo(t))return Sa(t,s);if(d==Rs||d==Os||h&&!i){if(a=l||h?{}:Es(t),!s)return l?function(t,e){return So(t,Oa(t),e)}(t,function(t,e){return t&&So(e,di(e),t)}(a,t)):function(t,e){return So(t,Ma(t),e)}(t,ba(a,t))}else{if(!Ds[d])return i?t:{};a=_s(t,d,s)}}r||(r=new ma);var p=r.get(t);if(p)return p;r.set(t,a),Ns(t)?t.forEach((function(o){a.add(Ls(o,e,n,o,t,r))})):Ss(t)&&t.forEach((function(o,i){a.set(i,Ls(o,e,n,i,t,r))}));var f=c?void 0:(u?l?Ra:ka:l?di:ai)(t);return Cn(f||t,(function(o,i){f&&(o=t[i=o]),wo(a,i,Ls(o,e,n,i,t,r))})),a}Ds[Os]=Ds["[object Array]"]=Ds["[object ArrayBuffer]"]=Ds["[object DataView]"]=Ds["[object Boolean]"]=Ds["[object Date]"]=Ds["[object Float32Array]"]=Ds["[object Float64Array]"]=Ds["[object Int8Array]"]=Ds["[object Int16Array]"]=Ds["[object Int32Array]"]=Ds["[object Map]"]=Ds["[object Number]"]=Ds[Rs]=Ds["[object RegExp]"]=Ds["[object Set]"]=Ds["[object String]"]=Ds["[object Symbol]"]=Ds["[object Uint8Array]"]=Ds["[object Uint8ClampedArray]"]=Ds["[object Uint16Array]"]=Ds["[object Uint32Array]"]=!0,Ds["[object Error]"]=Ds[Ps]=Ds["[object WeakMap]"]=!1;function Is(t){return Ls(t,5)}function js(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],o=t;o--;)e[o-1]=arguments[o];return Fi(ee(n)?cn(n):[n],Gi(e,1))}function Bs(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Ti;++e<n;)this.add(t[e])}function Hs(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1}function Fs(t,e){return t.has(e)}Bs.prototype.add=Bs.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Bs.prototype.has=function(t){return this.__data__.has(t)};var zs=1,Ws=2;function Gs(t,e,n,o,i,r){var a=n&zs,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var u=r.get(t),c=r.get(e);if(u&&c)return u==e&&c==t;var d=-1,h=!0,p=n&Ws?new Bs:void 0;for(r.set(t,e),r.set(e,t);++d<s;){var f=t[d],g=e[d];if(o)var v=a?o(g,f,d,e,t,r):o(f,g,d,t,e,r);if(void 0!==v){if(v)continue;h=!1;break}if(p){if(!Hs(e,(function(t,e){if(!Fs(p,e)&&(f===t||i(f,t,n,o,r)))return p.push(e)}))){h=!1;break}}else if(f!==g&&!i(f,g,n,o,r)){h=!1;break}}return r.delete(t),r.delete(e),h}function Us(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n}function Xs(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var Vs=1,Ys=2,qs="[object Boolean]",Ks="[object Date]",Zs="[object Error]",$s="[object Map]",Js="[object Number]",Qs="[object RegExp]",tl="[object Set]",el="[object String]",nl="[object Symbol]",ol="[object ArrayBuffer]",il="[object DataView]",rl=Ht?Ht.prototype:void 0,al=rl?rl.valueOf:void 0;var sl=1,ll=Object.prototype.hasOwnProperty;var ul=1,cl="[object Arguments]",dl="[object Array]",hl="[object Object]",pl=Object.prototype.hasOwnProperty;function fl(t,e,n,o,i,r){var a=ee(t),s=ee(e),l=a?dl:qa(t),u=s?dl:qa(e),c=(l=l==cl?hl:l)==hl,d=(u=u==cl?hl:u)==hl,h=l==u;if(h&&Xo(t)){if(!Xo(e))return!1;a=!0,c=!1}if(h&&!c)return r||(r=new ma),a||Qo(t)?Gs(t,e,n,o,i,r):function(t,e,n,o,i,r,a){switch(n){case il:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ol:return!(t.byteLength!=e.byteLength||!r(new Za(t),new Za(e)));case qs:case Ks:case Js:return _o(+t,+e);case Zs:return t.name==e.name&&t.message==e.message;case Qs:case el:return t==e+"";case $s:var s=Us;case tl:var l=o&Vs;if(s||(s=Xs),t.size!=e.size&&!l)return!1;var u=a.get(t);if(u)return u==e;o|=Ys,a.set(t,e);var c=Gs(s(t),s(e),o,i,r,a);return a.delete(t),c;case nl:if(al)return al.call(t)==al.call(e)}return!1}(t,e,l,n,o,i,r);if(!(n&ul)){var p=c&&pl.call(t,"__wrapped__"),f=d&&pl.call(e,"__wrapped__");if(p||f){var g=p?t.value():t,v=f?e.value():e;return r||(r=new ma),i(g,v,n,o,r)}}return!!h&&(r||(r=new ma),function(t,e,n,o,i,r){var a=n&sl,s=ka(t),l=s.length;if(l!=ka(e).length&&!a)return!1;for(var u=l;u--;){var c=s[u];if(!(a?c in e:ll.call(e,c)))return!1}var d=r.get(t),h=r.get(e);if(d&&h)return d==e&&h==t;var p=!0;r.set(t,e),r.set(e,t);for(var f=a;++u<l;){var g=t[c=s[u]],v=e[c];if(o)var y=a?o(v,g,c,e,t,r):o(g,v,c,t,e,r);if(!(void 0===y?g===v||i(g,v,n,o,r):y)){p=!1;break}f||(f="constructor"==c)}if(p&&!f){var m=t.constructor,b=e.constructor;m==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(p=!1)}return r.delete(t),r.delete(e),p}(t,e,n,o,i,r))}function gl(t,e,n,o,i){return t===e||(null==t||null==e||!Kt(t)&&!Kt(e)?t!=t&&e!=e:fl(t,e,n,o,gl,i))}var vl=1,yl=2;function ml(t,e,n,o){var i=n.length,r=i,a=!o;if(null==t)return!r;for(t=Object(t);i--;){var s=n[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<r;){var l=(s=n[i])[0],u=t[l],c=s[1];if(a&&s[2]){if(void 0===u&&!(l in t))return!1}else{var d=new ma;if(o)var h=o(u,c,l,t,e,d);if(!(void 0===h?gl(c,u,vl|yl,o,d):h))return!1}}return!0}function bl(t){return t==t&&!he(t)}function xl(t){for(var e=ai(t),n=e.length;n--;){var o=e[n],i=t[o];e[n]=[o,i,bl(i)]}return e}function _l(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function El(t){var e=xl(t);return 1==e.length&&e[0][2]?_l(e[0][0],e[0][1]):function(n){return n===t||ml(n,t,e)}}function wl(t,e){return null!=t&&e in Object(t)}function Sl(t,e,n){for(var o=-1,i=(e=Di(e,t)).length,r=!1;++o<i;){var a=Ii(e[o]);if(!(r=null!=t&&n(t,a)))break;t=t[a]}return r||++o!=i?r:!!(i=null==t?0:t.length)&&Mo(i)&&Wn(a,i)&&(ee(t)||Fo(t))}function Cl(t,e){return null!=t&&Sl(t,e,wl)}var Nl=1,Tl=2;function Al(t,e){return yi(t)&&bl(e)?_l(Ii(t),e):function(n){var o=Bi(n,t);return void 0===o&&o===e?Cl(n,t):gl(e,o,Nl|Tl)}}function Ml(t){return function(e){return null==e?void 0:e[t]}}function Ol(t){return yi(t)?Ml(Ii(t)):function(t){return function(e){return ji(e,t)}}(t)}function Pl(t){return"function"==typeof t?t:null==t?we:"object"==typeof t?ee(t)?Al(t[0],t[1]):El(t):Ol(t)}function kl(t,e,n){var o=n.length;if(null==t)return!o;for(t=Object(t);o--;){var i=n[o],r=e[i],a=t[i];if(void 0===a&&!(i in t)||!r(a))return!1}return!0}function Rl(t,e,n,o){for(var i=-1,r=null==t?0:t.length;++i<r;){var a=t[i];e(o,a,n(a),t)}return o}function Dl(t){return function(e,n,o){for(var i=-1,r=Object(e),a=o(e),s=a.length;s--;){var l=a[t?s:++i];if(!1===n(r[l],l,r))break}return e}}var Ll=Dl();function Il(t,e){return t&&Ll(t,e,ai)}function jl(t,e){return function(n,o){if(null==n)return n;if(!Oo(n))return t(n,o);for(var i=n.length,r=e?i:-1,a=Object(n);(e?r--:++r<i)&&!1!==o(a[r],r,a););return n}}var Bl=jl(Il);function Hl(t,e,n,o){return Bl(t,(function(t,i,r){e(o,t,n(t),r)})),o}function Fl(t,e){return function(n,o){var i=ee(n)?Rl:Hl,r=e?e():{};return i(n,t,Pl(o),r)}}var zl=Object.prototype.hasOwnProperty,Wl=Fl((function(t,e,n){zl.call(t,n)?++t[n]:xo(t,n,1)}));function Gl(t,e,n){var o=yo(t,8,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return o.placeholder=Gl.placeholder,o}Gl.placeholder={};function Ul(t,e,n){var o=yo(t,16,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return o.placeholder=Ul.placeholder,o}Ul.placeholder={};var Xl=function(){return Bt.Date.now()},Vl="Expected a function",Yl=Math.max,ql=Math.min;function Kl(t,e,n){var o,i,r,a,s,l,u=0,c=!1,d=!1,h=!0;if("function"!=typeof t)throw new TypeError(Vl);function p(e){var n=o,r=i;return o=i=void 0,u=e,a=t.apply(r,n)}function f(t){var n=t-l;return void 0===l||n>=e||n<0||d&&t-u>=r}function g(){var t=Xl();if(f(t))return v(t);s=setTimeout(g,function(t){var n=e-(t-l);return d?ql(n,r-(t-u)):n}(t))}function v(t){return s=void 0,h&&o?p(t):(o=i=void 0,a)}function y(){var t=Xl(),n=f(t);if(o=arguments,i=this,l=t,n){if(void 0===s)return function(t){return u=t,s=setTimeout(g,e),c?p(t):a}(l);if(d)return clearTimeout(s),s=setTimeout(g,e),p(l)}return void 0===s&&(s=setTimeout(g,e)),a}return e=me(e)||0,he(n)&&(c=!!n.leading,r=(d="maxWait"in n)?Yl(me(n.maxWait)||0,e):r,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,o=l=i=s=void 0},y.flush=function(){return void 0===s?a:v(Xl())},y}var Zl=Object.prototype,$l=Zl.hasOwnProperty,Jl=To((function(t,e){t=Object(t);var n=-1,o=e.length,i=o>2?e[2]:void 0;for(i&&Po(e[0],e[1],i)&&(o=1);++n<o;)for(var r=e[n],a=di(r),s=-1,l=a.length;++s<l;){var u=a[s],c=t[u];(void 0===c||_o(c,Zl[u])&&!$l.call(t,u))&&(t[u]=r[u])}return t}));function Ql(t,e,n){(void 0!==n&&!_o(t[e],n)||void 0===n&&!(e in t))&&xo(t,e,n)}function tu(t){return Kt(t)&&Oo(t)}function eu(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function nu(t){return So(t,di(t))}function ou(t,e,n,o,i){t!==e&&Ll(e,(function(r,a){if(i||(i=new ma),he(r))!function(t,e,n,o,i,r,a){var s=eu(t,n),l=eu(e,n),u=a.get(l);if(u)Ql(t,n,u);else{var c=r?r(s,l,n+"",t,e,a):void 0,d=void 0===c;if(d){var h=ee(l),p=!h&&Xo(l),f=!h&&!p&&Qo(l);c=l,h||p||f?ee(s)?c=s:tu(s)?c=cn(s):p?(d=!1,c=Sa(l,!0)):f?(d=!1,c=es(l,!0)):c=[]:tr(l)||Fo(l)?(c=s,Fo(s)?c=nu(s):he(s)&&!Ae(s)||(c=Es(l))):d=!1}d&&(a.set(l,c),i(c,l,o,r,a),a.delete(l)),Ql(t,n,c)}}(t,e,a,n,ou,o,i);else{var s=o?o(eu(t,a),r,a+"",t,e,i):void 0;void 0===s&&(s=r),Ql(t,a,s)}}),di)}function iu(t,e,n,o,i,r){return he(t)&&he(e)&&(r.set(e,t),ou(t,e,void 0,iu,r),r.delete(e)),t}var ru=ko((function(t,e,n,o){ou(t,e,n,o)})),au=To((function(t){return t.push(void 0,iu),Ke(ru,void 0,t)}));function su(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}var lu=To((function(t,e){return su(t,1,e)})),uu=To((function(t,e,n){return su(t,me(e)||0,n)}));function cu(t,e,n){for(var o=-1,i=null==t?0:t.length;++o<i;)if(n(e,t[o]))return!0;return!1}var du=200;function hu(t,e,n,o){var i=-1,r=Mn,a=!0,s=t.length,l=[],u=e.length;if(!s)return l;n&&(e=te(e,Yo(n))),o?(r=cu,a=!1):e.length>=du&&(r=Fs,a=!1,e=new Bs(e));t:for(;++i<s;){var c=t[i],d=null==n?c:n(c);if(c=o||0!==c?c:0,a&&d==d){for(var h=u;h--;)if(e[h]===d)continue t;l.push(c)}else r(e,d,o)||l.push(c)}return l}var pu=To((function(t,e){return tu(t)?hu(t,Gi(e,1,tu,!0)):[]}));function fu(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var gu=To((function(t,e){var n=fu(e);return tu(n)&&(n=void 0),tu(t)?hu(t,Gi(e,1,tu,!0),Pl(n)):[]})),vu=To((function(t,e){var n=fu(e);return tu(n)&&(n=void 0),tu(t)?hu(t,Gi(e,1,tu,!0),void 0,n):[]})),yu=ae((function(t,e){return t/e}),1);function mu(t,e,n,o){for(var i=t.length,r=o?i:-1;(o?r--:++r<i)&&e(t[r],r,t););return n?cr(t,o?0:r,o?r+1:i):cr(t,o?r+1:0,o?i:r)}function bu(t){return"function"==typeof t?t:we}function xu(t,e){return(ee(t)?Cn:Bl)(t,bu(e))}function _u(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}var Eu=Dl(!0);function wu(t,e){return t&&Eu(t,e,ai)}var Su=jl(wu,!0);function Cu(t,e){return(ee(t)?_u:Su)(t,bu(e))}function Nu(t){return function(e){var n=qa(e);return"[object Map]"==n?Us(e):"[object Set]"==n?function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}(e):function(t,e){return te(e,(function(e){return[e,t[e]]}))}(e,t(e))}}var Tu=Nu(ai),Au=Nu(di),Mu=Pr({"&":"&","<":"<",">":">",'"':""","'":"'"}),Ou=/[&<>"']/g,Pu=RegExp(Ou.source);function ku(t){return(t=Ri(t))&&Pu.test(t)?t.replace(Ou,Mu):t}var Ru=/[\\^$.*+?()[\]{}|]/g,Du=RegExp(Ru.source);function Lu(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(!e(t[n],n,t))return!1;return!0}function Iu(t,e){var n=!0;return Bl(t,(function(t,o,i){return n=!!e(t,o,i)})),n}var ju=4294967295;function Bu(t){return t?ya(Ee(t),0,ju):0}function Hu(t,e){var n=[];return Bl(t,(function(t,o,i){e(t,o,i)&&n.push(t)})),n}function Fu(t,e){return(ee(t)?Ca:Hu)(t,Pl(e))}function zu(t){return function(e,n,o){var i=Object(e);if(!Oo(e)){var r=Pl(n);e=ai(e),n=function(t){return r(i[t],t,i)}}var a=t(e,n,o);return a>-1?i[r?e[a]:a]:void 0}}var Wu=Math.max;function Gu(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var i=null==n?0:Ee(n);return i<0&&(i=Wu(o+i,0)),Nn(t,Pl(e),i)}var Uu=zu(Gu);function Xu(t,e,n){var o;return n(t,(function(t,n,i){if(e(t,n,i))return o=n,!1})),o}var Vu=Math.max,Yu=Math.min;function qu(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var i=o-1;return void 0!==n&&(i=Ee(n),i=n<0?Vu(o+i,0):Yu(i,o-1)),Nn(t,Pl(e),i,!0)}var Ku=zu(qu);function Zu(t){return t&&t.length?t[0]:void 0}function $u(t,e){var n=-1,o=Oo(t)?Array(t.length):[];return Bl(t,(function(t,i,r){o[++n]=e(t,i,r)})),o}function Ju(t,e){return(ee(t)?te:$u)(t,Pl(e))}var Qu=1/0;var tc=1/0;var ec=ha("floor");function nc(t){return Xi((function(e){var n=e.length,o=n,i=un.prototype.thru;for(t&&e.reverse();o--;){var r=e[o];if("function"!=typeof r)throw new TypeError("Expected a function");if(i&&!a&&"wrapper"==ln(r))var a=new un([],!0)}for(o=a?o:n;++o<n;){var s=ln(r=e[o]),l="wrapper"==s?rn(r):void 0;a=l&&fn(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?a[ln(l[0])].apply(a,l[3]):1==r.length&&fn(r)?a[s]():a.thru(r)}return function(){var t=arguments,o=t[0];if(a&&1==t.length&&ee(o))return a.plant(o).value();for(var i=0,r=n?e[i].apply(this,t):o;++i<n;)r=e[i].call(this,r);return r}}))}var oc=nc(),ic=nc(!0);function rc(t,e){return Ca(e,(function(e){return Ae(t[e])}))}var ac=Object.prototype.hasOwnProperty,sc=Fl((function(t,e,n){ac.call(t,n)?t[n].push(e):xo(t,n,[e])}));function lc(t,e){return t>e}function uc(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=me(e),n=me(n)),t(e,n)}}var cc=uc(lc),dc=uc((function(t,e){return t>=e})),hc=Object.prototype.hasOwnProperty;function pc(t,e){return null!=t&&hc.call(t,e)}function fc(t,e){return null!=t&&Sl(t,e,pc)}var gc=Math.max,vc=Math.min;var yc="[object String]";function mc(t){return"string"==typeof t||!ee(t)&&Kt(t)&&qt(t)==yc}function bc(t,e){return te(e,(function(e){return t[e]}))}function xc(t){return null==t?[]:bc(t,ai(t))}var _c=Math.max;var Ec=Math.max;var wc=Math.min;function Sc(t,e,n){for(var o=n?cu:Mn,i=t[0].length,r=t.length,a=r,s=Array(r),l=1/0,u=[];a--;){var c=t[a];a&&e&&(c=te(c,Yo(e))),l=wc(c.length,l),s[a]=!n&&(e||i>=120&&c.length>=120)?new Bs(a&&c):void 0}c=t[0];var d=-1,h=s[0];t:for(;++d<i&&u.length<l;){var p=c[d],f=e?e(p):p;if(p=n||0!==p?p:0,!(h?Fs(h,f):o(u,f,n))){for(a=r;--a;){var g=s[a];if(!(g?Fs(g,f):o(t[a],f,n)))continue t}h&&h.push(f),u.push(p)}}return u}function Cc(t){return tu(t)?t:[]}var Nc=To((function(t){var e=te(t,Cc);return e.length&&e[0]===t[0]?Sc(e):[]})),Tc=To((function(t){var e=fu(t),n=te(t,Cc);return e===fu(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?Sc(n,Pl(e)):[]})),Ac=To((function(t){var e=fu(t),n=te(t,Cc);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?Sc(n,void 0,e):[]}));function Mc(t,e){return function(n,o){return function(t,e,n,o){return Il(t,(function(t,i,r){e(o,n(t),i,r)})),o}(n,t,e(o),{})}}var Oc=Object.prototype.toString,Pc=Mc((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Oc.call(e)),t[e]=n}),_n(we)),kc=Object.prototype,Rc=kc.hasOwnProperty,Dc=kc.toString,Lc=Mc((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Dc.call(e)),Rc.call(t,e)?t[e].push(n):t[e]=[n]}),Pl);function Ic(t,e){return e.length<2?t:ji(t,cr(e,0,-1))}function jc(t,e,n){var o=null==(t=Ic(t,e=Di(e,t)))?t:t[Ii(fu(e))];return null==o?void 0:Ke(o,t,n)}var Bc=To(jc),Hc=To((function(t,e,n){var o=-1,i="function"==typeof e,r=Oo(t)?Array(t.length):[];return Bl(t,(function(t){r[++o]=i?Ke(e,t,n):jc(t,e,n)})),r}));var Fc=$o&&$o.isArrayBuffer,zc=Fc?Yo(Fc):function(t){return Kt(t)&&"[object ArrayBuffer]"==qt(t)};function Wc(t){return!0===t||!1===t||Kt(t)&&"[object Boolean]"==qt(t)}var Gc=$o&&$o.isDate,Uc=Gc?Yo(Gc):function(t){return Kt(t)&&"[object Date]"==qt(t)};var Xc=Object.prototype.hasOwnProperty;function Vc(t){if(null==t)return!0;if(Oo(t)&&(ee(t)||"string"==typeof t||"function"==typeof t.splice||Xo(t)||Qo(t)||Fo(t)))return!t.length;var e=qa(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(Do(t))return!ri(t).length;for(var n in t)if(Xc.call(t,n))return!1;return!0}var Yc=Bt.isFinite;function qc(t){return"number"==typeof t&&t==Ee(t)}var Kc="[object Number]";function Zc(t){return"number"==typeof t||Kt(t)&&qt(t)==Kc}var $c=Oe?Ae:zo;function Jc(t){return null==t}var Qc=$o&&$o.isRegExp,td=Qc?Yo(Qc):function(t){return Kt(t)&&"[object RegExp]"==qt(t)},ed=9007199254740991;function nd(t){return void 0===t}var od=Array.prototype.join;var id=la((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),rd=Fl((function(t,e,n){xo(t,n,e)}));var ad=Math.max,sd=Math.min;var ld=la((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),ud=Tr("toLowerCase");function cd(t,e){return t<e}var dd=uc(cd),hd=uc((function(t,e){return t<=e}));function pd(t,e){var n={};return e=Pl(e),Il(t,(function(t,o,i){xo(n,e(t,o,i),t)})),n}function fd(t,e,n){for(var o=-1,i=t.length;++o<i;){var r=t[o],a=e(r);if(null!=a&&(void 0===s?a==a&&!$t(a):n(a,s)))var s=a,l=r}return l}function gd(t,e){for(var n,o=-1,i=t.length;++o<i;){var r=e(t[o]);void 0!==r&&(n=void 0===n?r:n+r)}return n}var vd=NaN;function yd(t,e){var n=null==t?0:t.length;return n?gd(t,e)/n:vd}var md=ko((function(t,e,n){ou(t,e,n)})),bd=To((function(t,e){return function(n){return jc(n,t,e)}})),xd=To((function(t,e){return function(n){return jc(t,n,e)}}));function _d(t,e,n){var o=ai(e),i=rc(e,o),r=!(he(n)&&"chain"in n&&!n.chain),a=Ae(t);return Cn(i,(function(n){var o=e[n];t[n]=o,a&&(t.prototype[n]=function(){var e=this.__chain__;if(r||e){var n=t(this.__wrapped__);return(n.__actions__=cn(this.__actions__)).push({func:o,args:arguments,thisArg:t}),n.__chain__=e,n}return o.apply(t,Fi([this.value()],arguments))})})),t}var Ed=ae((function(t,e){return t*e}),1),wd="Expected a function";function Sd(t){if("function"!=typeof t)throw new TypeError(wd);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var Cd="[object Map]",Nd="[object Set]",Td=Ht?Ht.iterator:void 0;function Ad(t){if(!t)return[];if(Oo(t))return mc(t)?Nr(t):cn(t);if(Td&&t[Td])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Td]());var e=qa(t);return(e==Cd?Us:e==Nd?Xs:xc)(t)}function Md(t,e){var n=t.length;if(n)return Wn(e+=e<0?n:0,n)?t[e]:void 0}function Od(t,e){return null==(t=Ic(t,e=Di(e,t)))||delete t[Ii(fu(e))]}function Pd(t){return tr(t)?void 0:t}var kd=Xi((function(t,e){var n={};if(null==t)return n;var o=!1;e=te(e,(function(e){return e=Di(e,t),o||(o=e.length>1),e})),So(t,Ra(t),n),o&&(n=Ls(n,7,Pd));for(var i=e.length;i--;)Od(n,e[i]);return n}));function Rd(t,e,n,o){if(!he(t))return t;for(var i=-1,r=(e=Di(e,t)).length,a=r-1,s=t;null!=s&&++i<r;){var l=Ii(e[i]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(i!=a){var c=s[l];void 0===(u=o?o(c,l,s):void 0)&&(u=he(c)?c:Wn(e[i+1])?[]:{})}wo(s,l,u),s=s[l]}return t}function Dd(t,e,n){for(var o=-1,i=e.length,r={};++o<i;){var a=e[o],s=ji(t,a);n(s,a)&&Rd(r,Di(a,t),s)}return r}function Ld(t,e){if(null==t)return{};var n=te(Ra(t),(function(t){return[t]}));return e=Pl(e),Dd(t,n,(function(t,n){return e(t,n[0])}))}function Id(t,e){if(t!==e){var n=void 0!==t,o=null===t,i=t==t,r=$t(t),a=void 0!==e,s=null===e,l=e==e,u=$t(e);if(!s&&!u&&!r&&t>e||r&&a&&l&&!s&&!u||o&&a&&l||!n&&l||!i)return 1;if(!o&&!r&&!u&&t<e||u&&n&&i&&!o&&!r||s&&n&&i||!a&&i||!l)return-1}return 0}function jd(t,e,n){e=e.length?te(e,(function(t){return ee(t)?function(e){return ji(e,1===t.length?t[0]:t)}:t})):[we];var o=-1;e=te(e,Yo(Pl));var i=$u(t,(function(t,n,i){var r=te(e,(function(e){return e(t)}));return{criteria:r,index:++o,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(i,(function(t,e){return function(t,e,n){for(var o=-1,i=t.criteria,r=e.criteria,a=i.length,s=n.length;++o<a;){var l=Id(i[o],r[o]);if(l)return o>=s?l:l*("desc"==n[o]?-1:1)}return t.index-e.index}(t,e,n)}))}function Bd(t){return Xi((function(e){return e=te(e,Yo(Pl)),To((function(n){var o=this;return t(e,(function(t){return Ke(t,o,n)}))}))}))}var Hd=Bd(te),Fd=To,zd=Math.min,Wd=Fd((function(t,e){var n=(e=1==e.length&&ee(e[0])?te(e[0],Yo(Pl)):te(Gi(e,1),Yo(Pl))).length;return To((function(o){for(var i=-1,r=zd(o.length,n);++i<r;)o[i]=e[i].call(this,o[i]);return Ke(t,this,o)}))})),Gd=Bd(Lu),Ud=Bd(Hs),Xd=9007199254740991,Vd=Math.floor;function Yd(t,e){var n="";if(!t||e<1||e>Xd)return n;do{e%2&&(n+=t),(e=Vd(e/2))&&(t+=t)}while(e);return n}var qd=Ml("length"),Kd="\\ud800-\\udfff",Zd="["+Kd+"]",$d="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Jd="\\ud83c[\\udffb-\\udfff]",Qd="[^"+Kd+"]",th="(?:\\ud83c[\\udde6-\\uddff]){2}",eh="[\\ud800-\\udbff][\\udc00-\\udfff]",nh="(?:"+$d+"|"+Jd+")"+"?",oh="[\\ufe0e\\ufe0f]?",ih=oh+nh+("(?:\\u200d(?:"+[Qd,th,eh].join("|")+")"+oh+nh+")*"),rh="(?:"+[Qd+$d+"?",$d,th,eh,Zd].join("|")+")",ah=RegExp(Jd+"(?="+Jd+")|"+rh+ih,"g");function sh(t){return pr(t)?function(t){for(var e=ah.lastIndex=0;ah.test(t);)++e;return e}(t):qd(t)}var lh=Math.ceil;function uh(t,e){var n=(e=void 0===e?" ":re(e)).length;if(n<2)return n?Yd(e,t):e;var o=Yd(e,lh(t/sh(e)));return pr(e)?dr(Nr(o),0,t).join(""):o.slice(0,t)}var ch=Math.ceil,dh=Math.floor;var hh=/^\s+/,ph=Bt.parseInt;var fh=To((function(t,e){return yo(t,32,void 0,e,Xn(e,Hn(fh)))}));fh.placeholder={};var gh=To((function(t,e){return yo(t,64,void 0,e,Xn(e,Hn(gh)))}));gh.placeholder={};var vh=Fl((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var yh=Xi((function(t,e){return null==t?{}:function(t,e){return Dd(t,e,(function(e,n){return Cl(t,n)}))}(t,e)}));function mh(t,e,n,o){for(var i=n-1,r=t.length;++i<r;)if(o(t[i],e))return i;return-1}var bh=Array.prototype.splice;function xh(t,e,n,o){var i=o?mh:An,r=-1,a=e.length,s=t;for(t===e&&(e=cn(e)),n&&(s=te(t,Yo(n)));++r<a;)for(var l=0,u=e[r],c=n?n(u):u;(l=i(s,c,l,o))>-1;)s!==t&&bh.call(s,l,1),bh.call(t,l,1);return t}function _h(t,e){return t&&t.length&&e&&e.length?xh(t,e):t}var Eh=To(_h);var wh=Array.prototype.splice;function Sh(t,e){for(var n=t?e.length:0,o=n-1;n--;){var i=e[n];if(n==o||i!==r){var r=i;Wn(i)?wh.call(t,i,1):Od(t,i)}}return t}var Ch=Xi((function(t,e){var n=null==t?0:t.length,o=Hi(t,e);return Sh(t,te(e,(function(t){return Wn(t,n)?+t:t})).sort(Id)),o})),Nh=Math.floor,Th=Math.random;function Ah(t,e){return t+Nh(Th()*(e-t+1))}var Mh=parseFloat,Oh=Math.min,Ph=Math.random;var kh=Math.ceil,Rh=Math.max;function Dh(t){return function(e,n,o){return o&&"number"!=typeof o&&Po(e,n,o)&&(n=o=void 0),e=_e(e),void 0===n?(n=e,e=0):n=_e(n),function(t,e,n,o){for(var i=-1,r=Rh(kh((e-t)/(n||1)),0),a=Array(r);r--;)a[o?r:++i]=t,t+=n;return a}(e,n,o=void 0===o?e<n?1:-1:_e(o),t)}}var Lh=Dh(),Ih=Dh(!0),jh=Xi((function(t,e){return yo(t,256,void 0,void 0,void 0,e)}));function Bh(t,e,n,o,i){return i(t,(function(t,i,r){n=o?(o=!1,t):e(n,t,i,r)})),n}function Hh(t,e,n,o){var i=null==t?0:t.length;for(o&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}var Fh=Array.prototype.reverse;function zh(t){return null==t?t:Fh.call(t)}var Wh=ha("round");function Gh(t){var e=t.length;return e?t[Ah(0,e-1)]:void 0}function Uh(t){return Gh(xc(t))}function Xh(t,e){var n=-1,o=t.length,i=o-1;for(e=void 0===e?o:e;++n<e;){var r=Ah(n,i),a=t[r];t[r]=t[n],t[n]=a}return t.length=e,t}function Vh(t,e){return Xh(cn(t),ya(e,0,t.length))}function Yh(t,e){var n=xc(t);return Xh(n,ya(e,0,n.length))}function qh(t){return Xh(cn(t))}function Kh(t){return Xh(xc(t))}var Zh=la((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));function $h(t,e){var n;return Bl(t,(function(t,o,i){return!(n=e(t,o,i))})),!!n}var Jh=To((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Po(t,e[0],e[1])?e=[]:n>2&&Po(e[0],e[1],e[2])&&(e=[e[0]]),jd(t,Gi(e,1),[])})),Qh=4294967294,tp=Math.floor,ep=Math.min;function np(t,e,n,o){var i=0,r=null==t?0:t.length;if(0===r)return 0;for(var a=(e=n(e))!=e,s=null===e,l=$t(e),u=void 0===e;i<r;){var c=tp((i+r)/2),d=n(t[c]),h=void 0!==d,p=null===d,f=d==d,g=$t(d);if(a)var v=o||f;else v=u?f&&(o||h):s?f&&h&&(o||!p):l?f&&h&&!p&&(o||!g):!p&&!g&&(o?d<=e:d<e);v?i=c+1:r=c}return ep(r,Qh)}var op=2147483647;function ip(t,e,n){var o=0,i=null==t?o:t.length;if("number"==typeof e&&e==e&&i<=op){for(;o<i;){var r=o+i>>>1,a=t[r];null!==a&&!$t(a)&&(n?a<=e:a<e)?o=r+1:i=r}return i}return np(t,e,we,n)}function rp(t,e){for(var n=-1,o=t.length,i=0,r=[];++n<o;){var a=t[n],s=e?e(a):a;if(!n||!_o(s,l)){var l=s;r[i++]=0===a?0:a}}return r}var ap=Math.max;var sp=la((function(t,e,n){return t+(n?" ":"")+Ar(e)}));var lp=ae((function(t,e){return t-e}),0);var up=Object.prototype,cp=up.hasOwnProperty;function dp(t,e,n,o){return void 0===t||_o(t,up[n])&&!cp.call(o,n)?e:t}var hp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function pp(t){return"\\"+hp[t]}var fp=/<%=([\s\S]+?)%>/g,gp={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:fp,variable:"",imports:{_:{escape:ku}}},vp=/\b__p \+= '';/g,yp=/\b(__p \+=) '' \+/g,mp=/(__e\(.*?\)|\b__t\)) \+\n'';/g,bp=/[()=,{}\[\]\/\s]/,xp=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_p=/($^)/,Ep=/['\n\r\u2028\u2029\\]/g,wp=Object.prototype.hasOwnProperty;function Sp(t,e){return e(t)}var Cp=4294967295,Np=Math.min;function Tp(t,e){var n=t;return n instanceof nn&&(n=n.value()),Or(e,(function(t,e){return e.func.apply(e.thisArg,Fi([t],e.args))}),n)}function Ap(){return Tp(this.__wrapped__,this.__actions__)}var Mp=9007199254740991;function Op(t,e){for(var n=t.length;n--&&An(e,t[n],0)>-1;);return n}function Pp(t,e){for(var n=-1,o=t.length;++n<o&&An(e,t[n],0)>-1;);return n}var kp=/^\s+/;var Rp=/\w*$/;var Dp=Pr({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Lp=/&(?:amp|lt|gt|quot|#39);/g,Ip=RegExp(Lp.source);var jp=Ia&&1/Xs(new Ia([,-0]))[1]==1/0?function(t){return new Ia(t)}:on,Bp=200;function Hp(t,e,n){var o=-1,i=Mn,r=t.length,a=!0,s=[],l=s;if(n)a=!1,i=cu;else if(r>=Bp){var u=e?null:jp(t);if(u)return Xs(u);a=!1,i=Fs,l=new Bs}else l=e?[]:s;t:for(;++o<r;){var c=t[o],d=e?e(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var h=l.length;h--;)if(l[h]===d)continue t;e&&l.push(d),s.push(c)}else i(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s}var Fp=To((function(t){return Hp(Gi(t,1,tu,!0))})),zp=To((function(t){var e=fu(t);return tu(e)&&(e=void 0),Hp(Gi(t,1,tu,!0),Pl(e))})),Wp=To((function(t){var e=fu(t);return e="function"==typeof e?e:void 0,Hp(Gi(t,1,tu,!0),void 0,e)}));var Gp=0;var Up=Math.max;function Xp(t){if(!t||!t.length)return[];var e=0;return t=Ca(t,(function(t){if(tu(t))return e=Up(t.length,e),!0})),Lo(e,(function(e){return te(t,Ml(e))}))}function Vp(t,e){if(!t||!t.length)return[];var n=Xp(t);return null==e?n:te(n,(function(t){return Ke(e,void 0,t)}))}function Yp(t,e,n,o){return Rd(t,e,n(ji(t,e)),o)}var qp=la((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}));var Kp=To((function(t,e){return tu(t)?hu(t,e):[]}));var Zp=Xi((function(t){var e=t.length,n=e?t[0]:0,o=this.__wrapped__,i=function(e){return Hi(e,t)};return!(e>1||this.__actions__.length)&&o instanceof nn&&Wn(n)?((o=o.slice(n,+n+(e?1:0))).__actions__.push({func:Sp,args:[i],thisArg:void 0}),new un(o,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)}));function $p(t,e,n){var o=t.length;if(o<2)return o?Hp(t[0]):[];for(var i=-1,r=Array(o);++i<o;)for(var a=t[i],s=-1;++s<o;)s!=i&&(r[i]=hu(r[i]||a,t[s],e,n));return Hp(Gi(r,1),e,n)}var Jp=To((function(t){return $p(Ca(t,tu))})),Qp=To((function(t){var e=fu(t);return tu(e)&&(e=void 0),$p(Ca(t,tu),Pl(e))})),tf=To((function(t){var e=fu(t);return e="function"==typeof e?e:void 0,$p(Ca(t,tu),void 0,e)})),ef=To(Xp);function nf(t,e,n){for(var o=-1,i=t.length,r=e.length,a={};++o<i;){var s=o<r?e[o]:void 0;n(a,t[o],s)}return a}var of=To((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Vp(t,n)})),rf={chunk:function(t,e,n){e=(n?Po(t,e,n):void 0===e)?1:va(Ee(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var i=0,r=0,a=Array(ga(o/e));i<o;)a[r++]=cr(t,i,i+=e);return a},compact:function(t){for(var e=-1,n=null==t?0:t.length,o=0,i=[];++e<n;){var r=t[e];r&&(i[o++]=r)}return i},concat:js,difference:pu,differenceBy:gu,differenceWith:vu,drop:function(t,e,n){var o=null==t?0:t.length;return o?cr(t,(e=n||void 0===e?1:Ee(e))<0?0:e,o):[]},dropRight:function(t,e,n){var o=null==t?0:t.length;return o?cr(t,0,(e=o-(e=n||void 0===e?1:Ee(e)))<0?0:e):[]},dropRightWhile:function(t,e){return t&&t.length?mu(t,Pl(e),!0,!0):[]},dropWhile:function(t,e){return t&&t.length?mu(t,Pl(e),!0):[]},fill:function(t,e,n,o){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&Po(t,e,n)&&(n=0,o=i),function(t,e,n,o){var i=t.length;for((n=Ee(n))<0&&(n=-n>i?0:i+n),(o=void 0===o||o>i?i:Ee(o))<0&&(o+=i),o=n>o?0:Bu(o);n<o;)t[n++]=e;return t}(t,e,n,o)):[]},findIndex:Gu,findLastIndex:qu,first:Zu,flatten:Ui,flattenDeep:function(t){return(null==t?0:t.length)?Gi(t,tc):[]},flattenDepth:function(t,e){return(null==t?0:t.length)?Gi(t,e=void 0===e?1:Ee(e)):[]},fromPairs:function(t){for(var e=-1,n=null==t?0:t.length,o={};++e<n;){var i=t[e];o[i[0]]=i[1]}return o},head:Zu,indexOf:function(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var i=null==n?0:Ee(n);return i<0&&(i=Ec(o+i,0)),An(t,e,i)},initial:function(t){return(null==t?0:t.length)?cr(t,0,-1):[]},intersection:Nc,intersectionBy:Tc,intersectionWith:Ac,join:function(t,e){return null==t?"":od.call(t,e)},last:fu,lastIndexOf:function(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var i=o;return void 0!==n&&(i=(i=Ee(n))<0?ad(o+i,0):sd(i,o-1)),e==e?function(t,e,n){for(var o=n+1;o--;)if(t[o]===e)return o;return o}(t,e,i):Nn(t,Tn,i,!0)},nth:function(t,e){return t&&t.length?Md(t,Ee(e)):void 0},pull:Eh,pullAll:_h,pullAllBy:function(t,e,n){return t&&t.length&&e&&e.length?xh(t,e,Pl(n)):t},pullAllWith:function(t,e,n){return t&&t.length&&e&&e.length?xh(t,e,void 0,n):t},pullAt:Ch,remove:function(t,e){var n=[];if(!t||!t.length)return n;var o=-1,i=[],r=t.length;for(e=Pl(e);++o<r;){var a=t[o];e(a,o,t)&&(n.push(a),i.push(o))}return Sh(t,i),n},reverse:zh,slice:function(t,e,n){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&Po(t,e,n)?(e=0,n=o):(e=null==e?0:Ee(e),n=void 0===n?o:Ee(n)),cr(t,e,n)):[]},sortedIndex:function(t,e){return ip(t,e)},sortedIndexBy:function(t,e,n){return np(t,e,Pl(n))},sortedIndexOf:function(t,e){var n=null==t?0:t.length;if(n){var o=ip(t,e);if(o<n&&_o(t[o],e))return o}return-1},sortedLastIndex:function(t,e){return ip(t,e,!0)},sortedLastIndexBy:function(t,e,n){return np(t,e,Pl(n),!0)},sortedLastIndexOf:function(t,e){if(null==t?0:t.length){var n=ip(t,e,!0)-1;if(_o(t[n],e))return n}return-1},sortedUniq:function(t){return t&&t.length?rp(t):[]},sortedUniqBy:function(t,e){return t&&t.length?rp(t,Pl(e)):[]},tail:function(t){var e=null==t?0:t.length;return e?cr(t,1,e):[]},take:function(t,e,n){return t&&t.length?cr(t,0,(e=n||void 0===e?1:Ee(e))<0?0:e):[]},takeRight:function(t,e,n){var o=null==t?0:t.length;return o?cr(t,(e=o-(e=n||void 0===e?1:Ee(e)))<0?0:e,o):[]},takeRightWhile:function(t,e){return t&&t.length?mu(t,Pl(e),!1,!0):[]},takeWhile:function(t,e){return t&&t.length?mu(t,Pl(e)):[]},union:Fp,unionBy:zp,unionWith:Wp,uniq:function(t){return t&&t.length?Hp(t):[]},uniqBy:function(t,e){return t&&t.length?Hp(t,Pl(e)):[]},uniqWith:function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Hp(t,void 0,e):[]},unzip:Xp,unzipWith:Vp,without:Kp,xor:Jp,xorBy:Qp,xorWith:tf,zip:ef,zipObject:function(t,e){return nf(t||[],e||[],wo)},zipObjectDeep:function(t,e){return nf(t||[],e||[],Rd)},zipWith:of},af={countBy:Wl,each:xu,eachRight:Cu,every:function(t,e,n){var o=ee(t)?Lu:Iu;return n&&Po(t,e,n)&&(e=void 0),o(t,Pl(e))},filter:Fu,find:Uu,findLast:Ku,flatMap:function(t,e){return Gi(Ju(t,e),1)},flatMapDeep:function(t,e){return Gi(Ju(t,e),Qu)},flatMapDepth:function(t,e,n){return n=void 0===n?1:Ee(n),Gi(Ju(t,e),n)},forEach:xu,forEachRight:Cu,groupBy:sc,includes:function(t,e,n,o){t=Oo(t)?t:xc(t),n=n&&!o?Ee(n):0;var i=t.length;return n<0&&(n=_c(i+n,0)),mc(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&An(t,e,n)>-1},invokeMap:Hc,keyBy:rd,map:Ju,orderBy:function(t,e,n,o){return null==t?[]:(ee(e)||(e=null==e?[]:[e]),ee(n=o?void 0:n)||(n=null==n?[]:[n]),jd(t,e,n))},partition:vh,reduce:function(t,e,n){var o=ee(t)?Or:Bh,i=arguments.length<3;return o(t,Pl(e),n,i,Bl)},reduceRight:function(t,e,n){var o=ee(t)?Hh:Bh,i=arguments.length<3;return o(t,Pl(e),n,i,Su)},reject:function(t,e){return(ee(t)?Ca:Hu)(t,Sd(Pl(e)))},sample:function(t){return(ee(t)?Gh:Uh)(t)},sampleSize:function(t,e,n){return e=(n?Po(t,e,n):void 0===e)?1:Ee(e),(ee(t)?Vh:Yh)(t,e)},shuffle:function(t){return(ee(t)?qh:Kh)(t)},size:function(t){if(null==t)return 0;if(Oo(t))return mc(t)?sh(t):t.length;var e=qa(t);return"[object Map]"==e||"[object Set]"==e?t.size:ri(t).length},some:function(t,e,n){var o=ee(t)?Hs:$h;return n&&Po(t,e,n)&&(e=void 0),o(t,Pl(e))},sortBy:Jh},sf=Xl,lf={after:function(t,e){if("function"!=typeof e)throw new TypeError("Expected a function");return t=Ee(t),function(){if(--t<1)return e.apply(this,arguments)}},ary:bo,before:ar,bind:sr,bindKey:ur,curry:Gl,curryRight:Ul,debounce:Kl,defer:lu,delay:uu,flip:function(t){return yo(t,512)},memoize:Mi,negate:Sd,once:function(t){return ar(2,t)},overArgs:Wd,partial:fh,partialRight:gh,rearg:jh,rest:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return To(t,e=void 0===e?e:Ee(e))},spread:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return e=null==e?0:ap(Ee(e),0),To((function(n){var o=n[e],i=dr(n,0,e);return o&&Fi(i,o),Ke(t,this,i)}))},throttle:function(t,e,n){var o=!0,i=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return he(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),Kl(t,e,{leading:o,maxWait:e,trailing:i})},unary:function(t){return bo(t,1)},wrap:function(t,e){return fh(bu(e),t)}},uf={castArray:function(){if(!arguments.length)return[];var t=arguments[0];return ee(t)?t:[t]},clone:function(t){return Ls(t,4)},cloneDeep:Is,cloneDeepWith:function(t,e){return Ls(t,5,e="function"==typeof e?e:void 0)},cloneWith:function(t,e){return Ls(t,4,e="function"==typeof e?e:void 0)},conformsTo:function(t,e){return null==e||kl(t,e,ai(e))},eq:_o,gt:cc,gte:dc,isArguments:Fo,isArray:ee,isArrayBuffer:zc,isArrayLike:Oo,isArrayLikeObject:tu,isBoolean:Wc,isBuffer:Xo,isDate:Uc,isElement:function(t){return Kt(t)&&1===t.nodeType&&!tr(t)},isEmpty:Vc,isEqual:function(t,e){return gl(t,e)},isEqualWith:function(t,e,n){var o=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===o?gl(t,e,void 0,n):!!o},isError:or,isFinite:function(t){return"number"==typeof t&&Yc(t)},isFunction:Ae,isInteger:qc,isLength:Mo,isMap:Ss,isMatch:function(t,e){return t===e||ml(t,e,xl(e))},isMatchWith:function(t,e,n){return n="function"==typeof n?n:void 0,ml(t,e,xl(e),n)},isNaN:function(t){return Zc(t)&&t!=+t},isNative:function(t){if($c(t))throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Fe(t)},isNil:Jc,isNull:function(t){return null===t},isNumber:Zc,isObject:he,isObjectLike:Kt,isPlainObject:tr,isRegExp:td,isSafeInteger:function(t){return qc(t)&&t>=-9007199254740991&&t<=ed},isSet:Ns,isString:mc,isSymbol:$t,isTypedArray:Qo,isUndefined:nd,isWeakMap:function(t){return Kt(t)&&"[object WeakMap]"==qa(t)},isWeakSet:function(t){return Kt(t)&&"[object WeakSet]"==qt(t)},lt:dd,lte:hd,toArray:Ad,toFinite:_e,toInteger:Ee,toLength:Bu,toNumber:me,toPlainObject:nu,toSafeInteger:function(t){return t?ya(Ee(t),-9007199254740991,Mp):0===t?t:0},toString:Ri},cf={add:se,ceil:pa,divide:yu,floor:ec,max:function(t){return t&&t.length?fd(t,we,lc):void 0},maxBy:function(t,e){return t&&t.length?fd(t,Pl(e),lc):void 0},mean:function(t){return yd(t,we)},meanBy:function(t,e){return yd(t,Pl(e))},min:function(t){return t&&t.length?fd(t,we,cd):void 0},minBy:function(t,e){return t&&t.length?fd(t,Pl(e),cd):void 0},multiply:Ed,round:Wh,subtract:lp,sum:function(t){return t&&t.length?gd(t,we):0},sumBy:function(t,e){return t&&t.length?gd(t,Pl(e)):0}},df=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=me(n))==n?n:0),void 0!==e&&(e=(e=me(e))==e?e:0),ya(me(t),e,n)},hf=function(t,e,n){return e=_e(e),void 0===n?(n=e,e=0):n=_e(n),function(t,e,n){return t>=vc(e,n)&&t<gc(e,n)}(t=me(t),e,n)},pf=function(t,e,n){if(n&&"boolean"!=typeof n&&Po(t,e,n)&&(e=n=void 0),void 0===n&&("boolean"==typeof e?(n=e,e=void 0):"boolean"==typeof t&&(n=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=_e(t),void 0===e?(e=t,t=0):e=_e(e)),t>e){var o=t;t=e,e=o}if(n||t%1||e%1){var i=Ph();return Oh(t+i*(e-t+Mh("1e-"+((i+"").length-1))),e)}return Ah(t,e)},ff={assign:li,assignIn:hi,assignInWith:pi,assignWith:fi,at:Vi,create:function(t,e){var n=Ve(t);return null==e?n:ba(n,e)},defaults:Jl,defaultsDeep:au,entries:Tu,entriesIn:Au,extend:hi,extendWith:pi,findKey:function(t,e){return Xu(t,Pl(e),Il)},findLastKey:function(t,e){return Xu(t,Pl(e),wu)},forIn:function(t,e){return null==t?t:Ll(t,bu(e),di)},forInRight:function(t,e){return null==t?t:Eu(t,bu(e),di)},forOwn:function(t,e){return t&&Il(t,bu(e))},forOwnRight:function(t,e){return t&&wu(t,bu(e))},functions:function(t){return null==t?[]:rc(t,ai(t))},functionsIn:function(t){return null==t?[]:rc(t,di(t))},get:Bi,has:fc,hasIn:Cl,invert:Pc,invertBy:Lc,invoke:Bc,keys:ai,keysIn:di,mapKeys:pd,mapValues:function(t,e){var n={};return e=Pl(e),Il(t,(function(t,o,i){xo(n,o,e(t,o,i))})),n},merge:md,mergeWith:ru,omit:kd,omitBy:function(t,e){return Ld(t,Sd(Pl(e)))},pick:yh,pickBy:Ld,result:function(t,e,n){var o=-1,i=(e=Di(e,t)).length;for(i||(i=1,t=void 0);++o<i;){var r=null==t?void 0:t[Ii(e[o])];void 0===r&&(o=i,r=n),t=Ae(r)?r.call(t):r}return t},set:function(t,e,n){return null==t?t:Rd(t,e,n)},setWith:function(t,e,n,o){return o="function"==typeof o?o:void 0,null==t?t:Rd(t,e,n,o)},toPairs:Tu,toPairsIn:Au,transform:function(t,e,n){var o=ee(t),i=o||Xo(t)||Qo(t);if(e=Pl(e),null==n){var r=t&&t.constructor;n=i?o?new r:[]:he(t)&&Ae(r)?Ve(Yi(t)):{}}return(i?Cn:Il)(t,(function(t,o,i){return e(n,t,o,i)})),n},unset:function(t,e){return null==t||Od(t,e)},update:function(t,e,n){return null==t?t:Yp(t,e,bu(n))},updateWith:function(t,e,n,o){return o="function"==typeof o?o:void 0,null==t?t:Yp(t,e,bu(n),o)},values:xc,valuesIn:function(t){return null==t?[]:bc(t,di(t))}},gf={at:Zp,chain:fa,commit:function(){return new un(this.value(),this.__chain__)},lodash:pn,next:function(){void 0===this.__values__&&(this.__values__=Ad(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},plant:function(t){for(var e,n=this;n instanceof tn;){var o=dn(n);o.__index__=0,o.__values__=void 0,e?i.__wrapped__=o:e=o;var i=o;n=n.__wrapped__}return i.__wrapped__=t,e},reverse:function(){var t=this.__wrapped__;if(t instanceof nn){var e=t;return this.__actions__.length&&(e=new nn(this)),(e=e.reverse()).__actions__.push({func:Sp,args:[zh],thisArg:void 0}),new un(e,this.__chain__)}return this.thru(zh)},tap:function(t,e){return e(t),t},thru:Sp,toIterator:function(){return this},toJSON:Ap,value:Ap,valueOf:Ap,wrapperChain:function(){return fa(this)}},vf={camelCase:ua,capitalize:Mr,deburr:Lr,endsWith:function(t,e,n){t=Ri(t),e=re(e);var o=t.length,i=n=void 0===n?o:ya(Ee(n),0,o);return(n-=e.length)>=0&&t.slice(n,i)==e},escape:ku,escapeRegExp:function(t){return(t=Ri(t))&&Du.test(t)?t.replace(Ru,"\\$&"):t},kebabCase:id,lowerCase:ld,lowerFirst:ud,pad:function(t,e,n){t=Ri(t);var o=(e=Ee(e))?sh(t):0;if(!e||o>=e)return t;var i=(e-o)/2;return uh(dh(i),n)+t+uh(ch(i),n)},padEnd:function(t,e,n){t=Ri(t);var o=(e=Ee(e))?sh(t):0;return e&&o<e?t+uh(e-o,n):t},padStart:function(t,e,n){t=Ri(t);var o=(e=Ee(e))?sh(t):0;return e&&o<e?uh(e-o,n)+t:t},parseInt:function(t,e,n){return n||null==e?e=0:e&&(e=+e),ph(Ri(t).replace(hh,""),e||0)},repeat:function(t,e,n){return e=(n?Po(t,e,n):void 0===e)?1:Ee(e),Yd(Ri(t),e)},replace:function(){var t=arguments,e=Ri(t[0]);return t.length<3?e:e.replace(t[1],t[2])},snakeCase:Zh,split:function(t,e,n){return n&&"number"!=typeof n&&Po(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=Ri(t))&&("string"==typeof e||null!=e&&!td(e))&&!(e=re(e))&&pr(t)?dr(Nr(t),0,n):t.split(e,n):[]},startCase:sp,startsWith:function(t,e,n){return t=Ri(t),n=null==n?0:ya(Ee(n),0,t.length),e=re(e),t.slice(n,n+e.length)==e},template:function(t,e,n){var o=gp.imports._.templateSettings||gp;n&&Po(t,e,n)&&(e=void 0),t=Ri(t),e=pi({},e,o,dp);var i,r,a=pi({},e.imports,o.imports,dp),s=ai(a),l=bc(a,s),u=0,c=e.interpolate||_p,d="__p += '",h=RegExp((e.escape||_p).source+"|"+c.source+"|"+(c===fp?xp:_p).source+"|"+(e.evaluate||_p).source+"|$","g"),p=wp.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(h,(function(e,n,o,a,s,l){return o||(o=a),d+=t.slice(u,l).replace(Ep,pp),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),s&&(r=!0,d+="';\n"+s+";\n__p += '"),o&&(d+="' +\n((__t = ("+o+")) == null ? '' : __t) +\n'"),u=l+e.length,e})),d+="';\n";var f=wp.call(e,"variable")&&e.variable;if(f){if(bp.test(f))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(r?d.replace(vp,""):d).replace(yp,"$1").replace(mp,"$1;"),d="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(r?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=ir((function(){return Function(s,p+"return "+d).apply(void 0,l)}));if(g.source=d,or(g))throw g;return g},templateSettings:gp,toLower:function(t){return Ri(t).toLowerCase()},toUpper:function(t){return Ri(t).toUpperCase()},trim:function(t,e,n){if((t=Ri(t))&&(n||void 0===e))return de(t);if(!t||!(e=re(e)))return t;var o=Nr(t),i=Nr(e);return dr(o,Pp(o,i),Op(o,i)+1).join("")},trimEnd:function(t,e,n){if((t=Ri(t))&&(n||void 0===e))return t.slice(0,ue(t)+1);if(!t||!(e=re(e)))return t;var o=Nr(t);return dr(o,0,Op(o,Nr(e))+1).join("")},trimStart:function(t,e,n){if((t=Ri(t))&&(n||void 0===e))return t.replace(kp,"");if(!t||!(e=re(e)))return t;var o=Nr(t);return dr(o,Pp(o,Nr(e))).join("")},truncate:function(t,e){var n=30,o="...";if(he(e)){var i="separator"in e?e.separator:i;n="length"in e?Ee(e.length):n,o="omission"in e?re(e.omission):o}var r=(t=Ri(t)).length;if(pr(t)){var a=Nr(t);r=a.length}if(n>=r)return t;var s=n-sh(o);if(s<1)return o;var l=a?dr(a,0,s).join(""):t.slice(0,s);if(void 0===i)return l+o;if(a&&(s+=l.length-s),td(i)){if(t.slice(s).search(i)){var u,c=l;for(i.global||(i=RegExp(i.source,Ri(Rp.exec(i))+"g")),i.lastIndex=0;u=i.exec(c);)var d=u.index;l=l.slice(0,void 0===d?s:d)}}else if(t.indexOf(re(i),s)!=s){var h=l.lastIndexOf(i);h>-1&&(l=l.slice(0,h))}return l+o},unescape:function(t){return(t=Ri(t))&&Ip.test(t)?t.replace(Lp,Dp):t},upperCase:qp,upperFirst:Ar,words:aa},yf={attempt:ir,bindAll:lr,cond:function(t){var e=null==t?0:t.length,n=Pl;return t=e?te(t,(function(t){if("function"!=typeof t[1])throw new TypeError("Expected a function");return[n(t[0]),t[1]]})):[],To((function(n){for(var o=-1;++o<e;){var i=t[o];if(Ke(i[0],this,n))return Ke(i[1],this,n)}}))},conforms:function(t){return function(t){var e=ai(t);return function(n){return kl(n,t,e)}}(Ls(t,1))},constant:_n,defaultTo:function(t,e){return null==t||t!=t?e:t},flow:oc,flowRight:ic,identity:we,iteratee:function(t){return Pl("function"==typeof t?t:Ls(t,1))},matches:function(t){return El(Ls(t,1))},matchesProperty:function(t,e){return Al(t,Ls(e,1))},method:bd,methodOf:xd,mixin:_d,noop:on,nthArg:function(t){return t=Ee(t),To((function(e){return Md(e,t)}))},over:Hd,overEvery:Gd,overSome:Ud,property:Ol,propertyOf:function(t){return function(e){return null==t?void 0:ji(t,e)}},range:Lh,rangeRight:Ih,stubArray:Na,stubFalse:zo,stubObject:function(){return{}},stubString:function(){return""},stubTrue:function(){return!0},times:function(t,e){if((t=Ee(t))<1||t>9007199254740991)return[];var n=Cp,o=Np(t,Cp);e=bu(e),t-=Cp;for(var i=Lo(o,e);++n<t;)e(n);return i},toPath:function(t){return ee(t)?te(t,Ii):$t(t)?[t]:cn(ki(Ri(t)))},uniqueId:function(t){var e=++Gp;return Ri(t)+e}};var mf=Math.max,bf=Math.min;var xf=Math.min;
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Lodash (Custom Build) <https://lodash.com/>
|
|
5
|
-
* Build: `lodash modularize exports="es" -o ./`
|
|
6
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
7
|
-
* Released under MIT license <https://lodash.com/license>
|
|
8
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
9
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
10
|
-
*/
|
|
11
|
-
var _f,Ef=4294967295,wf=Array.prototype,Sf=Object.prototype.hasOwnProperty,Cf=Ht?Ht.iterator:void 0,Nf=Math.max,Tf=Math.min,Af=function(t){return function(e,n,o){if(null==o){var i=he(n),r=i&&ai(n),a=r&&r.length&&rc(n,r);(a?a.length:i)||(o=n,n=e,e=this)}return t(e,n,o)}}(_d);pn.after=lf.after,pn.ary=lf.ary,pn.assign=ff.assign,pn.assignIn=ff.assignIn,pn.assignInWith=ff.assignInWith,pn.assignWith=ff.assignWith,pn.at=ff.at,pn.before=lf.before,pn.bind=lf.bind,pn.bindAll=yf.bindAll,pn.bindKey=lf.bindKey,pn.castArray=uf.castArray,pn.chain=gf.chain,pn.chunk=rf.chunk,pn.compact=rf.compact,pn.concat=rf.concat,pn.cond=yf.cond,pn.conforms=yf.conforms,pn.constant=yf.constant,pn.countBy=af.countBy,pn.create=ff.create,pn.curry=lf.curry,pn.curryRight=lf.curryRight,pn.debounce=lf.debounce,pn.defaults=ff.defaults,pn.defaultsDeep=ff.defaultsDeep,pn.defer=lf.defer,pn.delay=lf.delay,pn.difference=rf.difference,pn.differenceBy=rf.differenceBy,pn.differenceWith=rf.differenceWith,pn.drop=rf.drop,pn.dropRight=rf.dropRight,pn.dropRightWhile=rf.dropRightWhile,pn.dropWhile=rf.dropWhile,pn.fill=rf.fill,pn.filter=af.filter,pn.flatMap=af.flatMap,pn.flatMapDeep=af.flatMapDeep,pn.flatMapDepth=af.flatMapDepth,pn.flatten=rf.flatten,pn.flattenDeep=rf.flattenDeep,pn.flattenDepth=rf.flattenDepth,pn.flip=lf.flip,pn.flow=yf.flow,pn.flowRight=yf.flowRight,pn.fromPairs=rf.fromPairs,pn.functions=ff.functions,pn.functionsIn=ff.functionsIn,pn.groupBy=af.groupBy,pn.initial=rf.initial,pn.intersection=rf.intersection,pn.intersectionBy=rf.intersectionBy,pn.intersectionWith=rf.intersectionWith,pn.invert=ff.invert,pn.invertBy=ff.invertBy,pn.invokeMap=af.invokeMap,pn.iteratee=yf.iteratee,pn.keyBy=af.keyBy,pn.keys=ai,pn.keysIn=ff.keysIn,pn.map=af.map,pn.mapKeys=ff.mapKeys,pn.mapValues=ff.mapValues,pn.matches=yf.matches,pn.matchesProperty=yf.matchesProperty,pn.memoize=lf.memoize,pn.merge=ff.merge,pn.mergeWith=ff.mergeWith,pn.method=yf.method,pn.methodOf=yf.methodOf,pn.mixin=Af,pn.negate=Sd,pn.nthArg=yf.nthArg,pn.omit=ff.omit,pn.omitBy=ff.omitBy,pn.once=lf.once,pn.orderBy=af.orderBy,pn.over=yf.over,pn.overArgs=lf.overArgs,pn.overEvery=yf.overEvery,pn.overSome=yf.overSome,pn.partial=lf.partial,pn.partialRight=lf.partialRight,pn.partition=af.partition,pn.pick=ff.pick,pn.pickBy=ff.pickBy,pn.property=yf.property,pn.propertyOf=yf.propertyOf,pn.pull=rf.pull,pn.pullAll=rf.pullAll,pn.pullAllBy=rf.pullAllBy,pn.pullAllWith=rf.pullAllWith,pn.pullAt=rf.pullAt,pn.range=yf.range,pn.rangeRight=yf.rangeRight,pn.rearg=lf.rearg,pn.reject=af.reject,pn.remove=rf.remove,pn.rest=lf.rest,pn.reverse=rf.reverse,pn.sampleSize=af.sampleSize,pn.set=ff.set,pn.setWith=ff.setWith,pn.shuffle=af.shuffle,pn.slice=rf.slice,pn.sortBy=af.sortBy,pn.sortedUniq=rf.sortedUniq,pn.sortedUniqBy=rf.sortedUniqBy,pn.split=vf.split,pn.spread=lf.spread,pn.tail=rf.tail,pn.take=rf.take,pn.takeRight=rf.takeRight,pn.takeRightWhile=rf.takeRightWhile,pn.takeWhile=rf.takeWhile,pn.tap=gf.tap,pn.throttle=lf.throttle,pn.thru=Sp,pn.toArray=uf.toArray,pn.toPairs=ff.toPairs,pn.toPairsIn=ff.toPairsIn,pn.toPath=yf.toPath,pn.toPlainObject=uf.toPlainObject,pn.transform=ff.transform,pn.unary=lf.unary,pn.union=rf.union,pn.unionBy=rf.unionBy,pn.unionWith=rf.unionWith,pn.uniq=rf.uniq,pn.uniqBy=rf.uniqBy,pn.uniqWith=rf.uniqWith,pn.unset=ff.unset,pn.unzip=rf.unzip,pn.unzipWith=rf.unzipWith,pn.update=ff.update,pn.updateWith=ff.updateWith,pn.values=ff.values,pn.valuesIn=ff.valuesIn,pn.without=rf.without,pn.words=vf.words,pn.wrap=lf.wrap,pn.xor=rf.xor,pn.xorBy=rf.xorBy,pn.xorWith=rf.xorWith,pn.zip=rf.zip,pn.zipObject=rf.zipObject,pn.zipObjectDeep=rf.zipObjectDeep,pn.zipWith=rf.zipWith,pn.entries=ff.toPairs,pn.entriesIn=ff.toPairsIn,pn.extend=ff.assignIn,pn.extendWith=ff.assignInWith,Af(pn,pn),pn.add=cf.add,pn.attempt=yf.attempt,pn.camelCase=vf.camelCase,pn.capitalize=vf.capitalize,pn.ceil=cf.ceil,pn.clamp=df,pn.clone=uf.clone,pn.cloneDeep=uf.cloneDeep,pn.cloneDeepWith=uf.cloneDeepWith,pn.cloneWith=uf.cloneWith,pn.conformsTo=uf.conformsTo,pn.deburr=vf.deburr,pn.defaultTo=yf.defaultTo,pn.divide=cf.divide,pn.endsWith=vf.endsWith,pn.eq=uf.eq,pn.escape=vf.escape,pn.escapeRegExp=vf.escapeRegExp,pn.every=af.every,pn.find=af.find,pn.findIndex=rf.findIndex,pn.findKey=ff.findKey,pn.findLast=af.findLast,pn.findLastIndex=rf.findLastIndex,pn.findLastKey=ff.findLastKey,pn.floor=cf.floor,pn.forEach=af.forEach,pn.forEachRight=af.forEachRight,pn.forIn=ff.forIn,pn.forInRight=ff.forInRight,pn.forOwn=ff.forOwn,pn.forOwnRight=ff.forOwnRight,pn.get=ff.get,pn.gt=uf.gt,pn.gte=uf.gte,pn.has=ff.has,pn.hasIn=ff.hasIn,pn.head=rf.head,pn.identity=we,pn.includes=af.includes,pn.indexOf=rf.indexOf,pn.inRange=hf,pn.invoke=ff.invoke,pn.isArguments=uf.isArguments,pn.isArray=ee,pn.isArrayBuffer=uf.isArrayBuffer,pn.isArrayLike=uf.isArrayLike,pn.isArrayLikeObject=uf.isArrayLikeObject,pn.isBoolean=uf.isBoolean,pn.isBuffer=uf.isBuffer,pn.isDate=uf.isDate,pn.isElement=uf.isElement,pn.isEmpty=uf.isEmpty,pn.isEqual=uf.isEqual,pn.isEqualWith=uf.isEqualWith,pn.isError=uf.isError,pn.isFinite=uf.isFinite,pn.isFunction=uf.isFunction,pn.isInteger=uf.isInteger,pn.isLength=uf.isLength,pn.isMap=uf.isMap,pn.isMatch=uf.isMatch,pn.isMatchWith=uf.isMatchWith,pn.isNaN=uf.isNaN,pn.isNative=uf.isNative,pn.isNil=uf.isNil,pn.isNull=uf.isNull,pn.isNumber=uf.isNumber,pn.isObject=he,pn.isObjectLike=uf.isObjectLike,pn.isPlainObject=uf.isPlainObject,pn.isRegExp=uf.isRegExp,pn.isSafeInteger=uf.isSafeInteger,pn.isSet=uf.isSet,pn.isString=uf.isString,pn.isSymbol=uf.isSymbol,pn.isTypedArray=uf.isTypedArray,pn.isUndefined=uf.isUndefined,pn.isWeakMap=uf.isWeakMap,pn.isWeakSet=uf.isWeakSet,pn.join=rf.join,pn.kebabCase=vf.kebabCase,pn.last=fu,pn.lastIndexOf=rf.lastIndexOf,pn.lowerCase=vf.lowerCase,pn.lowerFirst=vf.lowerFirst,pn.lt=uf.lt,pn.lte=uf.lte,pn.max=cf.max,pn.maxBy=cf.maxBy,pn.mean=cf.mean,pn.meanBy=cf.meanBy,pn.min=cf.min,pn.minBy=cf.minBy,pn.stubArray=yf.stubArray,pn.stubFalse=yf.stubFalse,pn.stubObject=yf.stubObject,pn.stubString=yf.stubString,pn.stubTrue=yf.stubTrue,pn.multiply=cf.multiply,pn.nth=rf.nth,pn.noop=yf.noop,pn.now=sf,pn.pad=vf.pad,pn.padEnd=vf.padEnd,pn.padStart=vf.padStart,pn.parseInt=vf.parseInt,pn.random=pf,pn.reduce=af.reduce,pn.reduceRight=af.reduceRight,pn.repeat=vf.repeat,pn.replace=vf.replace,pn.result=ff.result,pn.round=cf.round,pn.sample=af.sample,pn.size=af.size,pn.snakeCase=vf.snakeCase,pn.some=af.some,pn.sortedIndex=rf.sortedIndex,pn.sortedIndexBy=rf.sortedIndexBy,pn.sortedIndexOf=rf.sortedIndexOf,pn.sortedLastIndex=rf.sortedLastIndex,pn.sortedLastIndexBy=rf.sortedLastIndexBy,pn.sortedLastIndexOf=rf.sortedLastIndexOf,pn.startCase=vf.startCase,pn.startsWith=vf.startsWith,pn.subtract=cf.subtract,pn.sum=cf.sum,pn.sumBy=cf.sumBy,pn.template=vf.template,pn.times=yf.times,pn.toFinite=uf.toFinite,pn.toInteger=Ee,pn.toLength=uf.toLength,pn.toLower=vf.toLower,pn.toNumber=uf.toNumber,pn.toSafeInteger=uf.toSafeInteger,pn.toString=uf.toString,pn.toUpper=vf.toUpper,pn.trim=vf.trim,pn.trimEnd=vf.trimEnd,pn.trimStart=vf.trimStart,pn.truncate=vf.truncate,pn.unescape=vf.unescape,pn.uniqueId=yf.uniqueId,pn.upperCase=vf.upperCase,pn.upperFirst=vf.upperFirst,pn.each=af.forEach,pn.eachRight=af.forEachRight,pn.first=rf.head,Af(pn,(_f={},Il(pn,(function(t,e){Sf.call(pn.prototype,e)||(_f[e]=t)})),_f),{chain:!1}),pn.VERSION="4.17.21",(pn.templateSettings=vf.templateSettings).imports._=pn,Cn(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){pn[t].placeholder=pn})),Cn(["drop","take"],(function(t,e){nn.prototype[t]=function(n){n=void 0===n?1:Nf(Ee(n),0);var o=this.__filtered__&&!e?new nn(this):this.clone();return o.__filtered__?o.__takeCount__=Tf(n,o.__takeCount__):o.__views__.push({size:Tf(n,Ef),type:t+(o.__dir__<0?"Right":"")}),o},nn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Cn(["filter","map","takeWhile"],(function(t,e){var n=e+1,o=1==n||3==n;nn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Pl(t),type:n}),e.__filtered__=e.__filtered__||o,e}})),Cn(["head","last"],(function(t,e){var n="take"+(e?"Right":"");nn.prototype[t]=function(){return this[n](1).value()[0]}})),Cn(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");nn.prototype[t]=function(){return this.__filtered__?new nn(this):this[n](1)}})),nn.prototype.compact=function(){return this.filter(we)},nn.prototype.find=function(t){return this.filter(t).head()},nn.prototype.findLast=function(t){return this.reverse().find(t)},nn.prototype.invokeMap=To((function(t,e){return"function"==typeof t?new nn(this):this.map((function(n){return jc(n,t,e)}))})),nn.prototype.reject=function(t){return this.filter(Sd(Pl(t)))},nn.prototype.slice=function(t,e){t=Ee(t);var n=this;return n.__filtered__&&(t>0||e<0)?new nn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=Ee(e))<0?n.dropRight(-e):n.take(e-t)),n)},nn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},nn.prototype.toArray=function(){return this.take(Ef)},Il(nn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),i=pn[o?"take"+("last"==e?"Right":""):e],r=o||/^find/.test(e);i&&(pn.prototype[e]=function(){var e=this.__wrapped__,a=o?[1]:arguments,s=e instanceof nn,l=a[0],u=s||ee(e),c=function(t){var e=i.apply(pn,Fi([t],a));return o&&d?e[0]:e};u&&n&&"function"==typeof l&&1!=l.length&&(s=u=!1);var d=this.__chain__,h=!!this.__actions__.length,p=r&&!d,f=s&&!h;if(!r&&u){e=f?e:new nn(this);var g=t.apply(e,a);return g.__actions__.push({func:Sp,args:[c],thisArg:void 0}),new un(g,d)}return p&&f?t.apply(this,a):(g=this.thru(c),p?o?g.value()[0]:g.value():g)})})),Cn(["pop","push","shift","sort","splice","unshift"],(function(t){var e=wf[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",o=/^(?:pop|shift)$/.test(t);pn.prototype[t]=function(){var t=arguments;if(o&&!this.__chain__){var i=this.value();return e.apply(ee(i)?i:[],t)}return this[n]((function(n){return e.apply(ee(n)?n:[],t)}))}})),Il(nn.prototype,(function(t,e){var n=pn[e];if(n){var o=n.name+"";Sf.call(an,o)||(an[o]=[]),an[o].push({name:e,func:n})}})),an[Jn(void 0,2).name]=[{name:"wrapper",func:void 0}],nn.prototype.clone=function(){var t=new nn(this.__wrapped__);return t.__actions__=cn(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=cn(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=cn(this.__views__),t},nn.prototype.reverse=function(){if(this.__filtered__){var t=new nn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},nn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=ee(t),o=e<0,i=n?t.length:0,r=function(t,e,n){for(var o=-1,i=n.length;++o<i;){var r=n[o],a=r.size;switch(r.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=bf(e,t+a);break;case"takeRight":t=mf(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=r.start,s=r.end,l=s-a,u=o?s:a-1,c=this.__iteratees__,d=c.length,h=0,p=xf(l,this.__takeCount__);if(!n||!o&&i==l&&p==l)return Tp(t,this.__actions__);var f=[];t:for(;l--&&h<p;){for(var g=-1,v=t[u+=e];++g<d;){var y=c[g],m=y.iteratee,b=y.type,x=m(v);if(2==b)v=x;else if(!x){if(1==b)continue t;break t}}f[h++]=v}return f},pn.prototype.at=gf.at,pn.prototype.chain=gf.wrapperChain,pn.prototype.commit=gf.commit,pn.prototype.next=gf.next,pn.prototype.plant=gf.plant,pn.prototype.reverse=gf.reverse,pn.prototype.toJSON=pn.prototype.valueOf=pn.prototype.value=gf.value,pn.prototype.first=pn.prototype.head,Cf&&(pn.prototype[Cf]=gf.toIterator);var Mf,Of,Pf,kf,Rf,Df,Lf,If,jf,Bf,Hf={},Ff=[],zf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Wf=Array.isArray;function Gf(t,e){for(var n in e)t[n]=e[n];return t}function Uf(t){var e=t.parentNode;e&&e.removeChild(t)}function Xf(t,e,n){var o,i,r,a={};for(r in e)"key"==r?o=e[r]:"ref"==r?i=e[r]:a[r]=e[r];if(arguments.length>2&&(a.children=arguments.length>3?Mf.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(r in t.defaultProps)void 0===a[r]&&(a[r]=t.defaultProps[r]);return Vf(t,a,o,i,null)}function Vf(t,e,n,o,i){var r={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++Pf:i,__i:-1,__u:0};return null==i&&null!=Of.vnode&&Of.vnode(r),r}function Yf(t){return t.children}function qf(t,e){this.props=t,this.context=e}function Kf(t,e){if(null==e)return t.__?Kf(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?Kf(t):null}function Zf(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return Zf(t)}}function $f(t){(!t.__d&&(t.__d=!0)&&kf.push(t)&&!Jf.__r++||Rf!==Of.debounceRendering)&&((Rf=Of.debounceRendering)||Df)(Jf)}function Jf(){var t,e,n,o,i,r,a,s;for(kf.sort(Lf);t=kf.shift();)t.__d&&(e=kf.length,o=void 0,r=(i=(n=t).__v).__e,a=[],s=[],n.__P&&((o=Gf({},i)).__v=i.__v+1,Of.vnode&&Of.vnode(o),sg(n.__P,o,i,n.__n,n.__P.namespaceURI,32&i.__u?[r]:null,a,null==r?Kf(i):r,!!(32&i.__u),s),o.__v=i.__v,o.__.__k[o.__i]=o,lg(a,o,s),o.__e!=r&&Zf(o)),kf.length>e&&kf.sort(Lf));Jf.__r=0}function Qf(t,e,n,o,i,r,a,s,l,u,c){var d,h,p,f,g,v=o&&o.__k||Ff,y=e.length;for(n.__d=l,tg(n,e,v),l=n.__d,d=0;d<y;d++)null!=(p=n.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(h=-1===p.__i?Hf:v[p.__i]||Hf,p.__i=d,sg(t,p,h,i,r,a,s,l,u,c),f=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&cg(h.ref,null,p),c.push(p.ref,p.__c||f,p)),null==g&&null!=f&&(g=f),65536&p.__u||h.__k===p.__k?l=eg(p,l,t):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:f&&(l=f.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=l,n.__e=g}function tg(t,e,n){var o,i,r,a,s,l=e.length,u=n.length,c=u,d=0;for(t.__k=[],o=0;o<l;o++)a=o+d,null!=(i=t.__k[o]=null==(i=e[o])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?Vf(null,i,null,null,null):Wf(i)?Vf(Yf,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?Vf(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=t,i.__b=t.__b+1,s=og(i,n,a,c),i.__i=s,r=null,-1!==s&&(c--,(r=n[s])&&(r.__u|=131072)),null==r||null===r.__v?(-1==s&&d--,"function"!=typeof i.type&&(i.__u|=65536)):s!==a&&(s==a-1?d=s-a:s==a+1?d++:s>a?c>l-a?d+=s-a:d--:s<a&&d++,s!==o+d&&(i.__u|=65536))):(r=n[a])&&null==r.key&&r.__e&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=Kf(r)),dg(r,r,!1),n[a]=null,c--);if(c)for(o=0;o<u;o++)null!=(r=n[o])&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=Kf(r)),dg(r,r))}function eg(t,e,n){var o,i;if("function"==typeof t.type){for(o=t.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=t,e=eg(o[i],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=Kf(t)),n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function ng(t,e){return e=e||[],null==t||"boolean"==typeof t||(Wf(t)?t.some((function(t){ng(t,e)})):e.push(t)),e}function og(t,e,n,o){var i=t.key,r=t.type,a=n-1,s=n+1,l=e[n];if(null===l||l&&i==l.key&&r===l.type&&!(131072&l.__u))return n;if(o>(null==l||131072&l.__u?0:1))for(;a>=0||s<e.length;){if(a>=0){if((l=e[a])&&!(131072&l.__u)&&i==l.key&&r===l.type)return a;a--}if(s<e.length){if((l=e[s])&&!(131072&l.__u)&&i==l.key&&r===l.type)return s;s++}}return-1}function ig(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||zf.test(e)?n:n+"px"}function rg(t,e,n,o,i){var r;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||ig(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||ig(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||"onFocusOut"===e||"onFocusIn"===e?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?o?n.u=o.u:(n.u=If,t.addEventListener(e,r?Bf:jf,r)):t.removeEventListener(e,r?Bf:jf,r);else{if("http://www.w3.org/2000/svg"==i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function ag(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e.t)e.t=If++;else if(e.t<n.u)return;return n(Of.event?Of.event(e):e)}}}function sg(t,e,n,o,i,r,a,s,l,u){var c,d,h,p,f,g,v,y,m,b,x,_,E,w,S,C,N=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(l=!!(32&n.__u),r=[s=e.__e=n.__e]),(c=Of.__b)&&c(e);t:if("function"==typeof N)try{if(y=e.props,m="prototype"in N&&N.prototype.render,b=(c=N.contextType)&&o[c.__c],x=c?b?b.props.value:c.__:o,n.__c?v=(d=e.__c=n.__c).__=d.__E:(m?e.__c=d=new N(y,x):(e.__c=d=new qf(y,x),d.constructor=N,d.render=hg),b&&b.sub(d),d.props=y,d.state||(d.state={}),d.context=x,d.__n=o,h=d.__d=!0,d.__h=[],d._sb=[]),m&&null==d.__s&&(d.__s=d.state),m&&null!=N.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Gf({},d.__s)),Gf(d.__s,N.getDerivedStateFromProps(y,d.__s))),p=d.props,f=d.state,d.__v=e,h)m&&null==N.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),m&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(m&&null==N.getDerivedStateFromProps&&y!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,x),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,x)||e.__v===n.__v)){for(e.__v!==n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),_=0;_<d._sb.length;_++)d.__h.push(d._sb[_]);d._sb=[],d.__h.length&&a.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,x),m&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,f,g)}))}if(d.context=x,d.props=y,d.__P=t,d.__e=!1,E=Of.__r,w=0,m){for(d.state=d.__s,d.__d=!1,E&&E(e),c=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,E&&E(e),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++w<25);d.state=d.__s,null!=d.getChildContext&&(o=Gf(Gf({},o),d.getChildContext())),m&&!h&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(p,f)),Qf(t,Wf(C=null!=c&&c.type===Yf&&null==c.key?c.props.children:c)?C:[C],e,n,o,i,r,a,s,l,u),d.base=e.__e,e.__u&=-161,d.__h.length&&a.push(d),v&&(d.__E=d.__=null)}catch(t){if(e.__v=null,l||null!=r){for(e.__u|=l?160:32;s&&8===s.nodeType&&s.nextSibling;)s=s.nextSibling;r[r.indexOf(s)]=null,e.__e=s}else e.__e=n.__e,e.__k=n.__k;Of.__e(t,e,n)}else null==r&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=ug(n.__e,e,n,o,i,r,a,l,u);(c=Of.diffed)&&c(e)}function lg(t,e,n){e.__d=void 0;for(var o=0;o<n.length;o++)cg(n[o],n[++o],n[++o]);Of.__c&&Of.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Of.__e(t,e.__v)}}))}function ug(t,e,n,o,i,r,a,s,l){var u,c,d,h,p,f,g,v=n.props,y=e.props,m=e.type;if("svg"===m?i="http://www.w3.org/2000/svg":"math"===m?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=r)for(u=0;u<r.length;u++)if((p=r[u])&&"setAttribute"in p==!!m&&(m?p.localName===m:3===p.nodeType)){t=p,r[u]=null;break}if(null==t){if(null===m)return document.createTextNode(y);t=document.createElementNS(i,m,y.is&&y),r=null,s=!1}if(null===m)v===y||s&&t.data===y||(t.data=y);else{if(r=r&&Mf.call(t.childNodes),v=n.props||Hf,!s&&null!=r)for(v={},u=0;u<t.attributes.length;u++)v[(p=t.attributes[u]).name]=p.value;for(u in v)if(p=v[u],"children"==u);else if("dangerouslySetInnerHTML"==u)d=p;else if("key"!==u&&!(u in y)){if("value"==u&&"defaultValue"in y||"checked"==u&&"defaultChecked"in y)continue;rg(t,u,null,p,i)}for(u in y)p=y[u],"children"==u?h=p:"dangerouslySetInnerHTML"==u?c=p:"value"==u?f=p:"checked"==u?g=p:"key"===u||s&&"function"!=typeof p||v[u]===p||rg(t,u,p,v[u],i);if(c)s||d&&(c.__html===d.__html||c.__html===t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(d&&(t.innerHTML=""),Qf(t,Wf(h)?h:[h],e,n,o,"foreignObject"===m?"http://www.w3.org/1999/xhtml":i,r,a,r?r[0]:n.__k&&Kf(n,0),s,l),null!=r)for(u=r.length;u--;)null!=r[u]&&Uf(r[u]);s||(u="value",void 0!==f&&(f!==t[u]||"progress"===m&&!f||"option"===m&&f!==v[u])&&rg(t,u,f,v[u],i),u="checked",void 0!==g&&g!==t[u]&&rg(t,u,g,v[u],i))}return t}function cg(t,e,n){try{if("function"==typeof t){var o="function"==typeof t.__u;o&&t.__u(),o&&null==e||(t.__u=t(e))}else t.current=e}catch(t){Of.__e(t,n)}}function dg(t,e,n){var o,i;if(Of.unmount&&Of.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||cg(o,null,e)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){Of.__e(t,e)}o.base=o.__P=null}if(o=t.__k)for(i=0;i<o.length;i++)o[i]&&dg(o[i],e,n||"function"!=typeof t.type);n||null==t.__e||Uf(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function hg(t,e,n){return this.constructor(t,n)}Mf=Ff.slice,Of={__e:function(t,e,n,o){for(var i,r,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(t)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,o||{}),a=i.__d),a)return i.__E=i}catch(e){t=e}throw t}},Pf=0,qf.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Gf({},this.state),"function"==typeof t&&(t=t(Gf({},n),this.props)),t&&Gf(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),$f(this))},qf.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),$f(this))},qf.prototype.render=Yf,kf=[],Df="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Lf=function(t,e){return t.__v.__b-e.__v.__b},Jf.__r=0,If=0,jf=ag(!1),Bf=ag(!0);var pg=0;function fg(t,e,n,o,i,r){e||(e={});var a,s,l=e;if("ref"in l)for(s in l={},e)"ref"==s?a=e[s]:l[s]=e[s];var u={type:t,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--pg,__i:-1,__u:0,__source:i,__self:r};if("function"==typeof t&&(a=t.defaultProps))for(s in a)void 0===l[s]&&(l[s]=a[s]);return Of.vnode&&Of.vnode(u),u}var gg=e.LogicFlowUtil.StepDrag,vg=function(t){function n(n){var o=t.call(this)||this;return o.updatePosition=function(t){var e=t.deltaX,n=t.deltaY,i=o.nodeModel,r=i.x,a=i.y;o.nodeModel.x=r+e/2,o.nodeModel.y=a+n/2,o.nodeModel.moveText(e/2,n/2)},o.getResize=function(t){var e=t.index,n=t.deltaX,o=t.deltaY,i=t.width,r=t.height,a=t.PCTResizeInfo,s=t.pct,l=void 0===s?1:s,u=t.freezeWidth,c=void 0!==u&&u,d=t.freezeHeight,h=void 0!==d&&d,p={width:i,height:r,deltaX:n,deltaY:o};if(a){var f=0,g=0;switch(e){case 0:g=(-1*n-o)/4;break;case 1:g=(n-o)/4;break;case 2:g=(n+o)/4;break;case 3:g=(-1*n+o)/4}0!==g&&(f=Math.round(g/a.ResizeBasis.basisHeight*1e5)/1e3),a.ResizePCT.widthPCT=Math.max(Math.min(a.ResizePCT.widthPCT+f,a.ScaleLimit.maxScaleLimit),a.ScaleLimit.minScaleLimit),a.ResizePCT.heightPCT=Math.max(Math.min(a.ResizePCT.heightPCT+f,a.ScaleLimit.maxScaleLimit),a.ScaleLimit.minScaleLimit);var v=Math.round(a.ResizePCT.widthPCT*a.ResizeBasis.basisWidth/100),y=Math.round(a.ResizePCT.heightPCT*a.ResizeBasis.basisHeight/100);switch(e){case 0:n=i-v,o=r-y;break;case 1:n=v-i,o=r-y;break;case 2:n=v-i,o=y-r;break;case 3:n=i-v,o=y-r}return p.width=v,p.height=y,p.deltaX=n/l,p.deltaY=o/l,p}switch(e){case 0:p.width=c?i:i-n*l,p.height=h?r:r-o*l;break;case 1:p.width=c?i:i+n*l,p.height=h?r:r-o*l;break;case 2:p.width=c?i:i+n*l,p.height=h?r:r+o*l;break;case 3:p.width=c?i:i-n*l,p.height=h?r:r+o*l}return p},o.updateEdgePointByAnchors=function(){var t=o.nodeModel,e=t.id,n=t.anchors,i=o.getNodeEdges(e);i.sourceEdges.forEach((function(t){var e=n.find((function(e){return e.id===t.sourceAnchorId}));e&&t.updateStartPoint({x:e.x,y:e.y})})),i.targetEdges.forEach((function(t){var e=n.find((function(e){return e.id===t.targetAnchorId}));e&&t.updateEndPoint({x:e.x,y:e.y})}))},o.updateRect=function(t){var e=t.deltaX,n=t.deltaY,i=o.nodeModel,r=i.x,a=i.y,s=i.width,l=i.height,u=i.radius,c=i.PCTResizeInfo,d=o.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,g=d.maxHeight,v=o.index,y=h===f,m=p===g,b=o.getResize({index:v,deltaX:e,deltaY:n,width:s,height:l,PCTResizeInfo:c,pct:1,freezeWidth:y,freezeHeight:m});if(b.width<h||b.width>f||b.height<p||b.height>g)o.dragHandler.cancelDrag();else{o.updatePosition({deltaX:y?0:b.deltaX,deltaY:m?0:b.deltaY}),o.nodeModel.width=b.width,o.nodeModel.height=b.height,o.nodeModel.setProperties({nodeSize:{width:b.width,height:b.height}});var x={x:r,y:a,width:s,height:l,radius:u},_={x:o.nodeModel.x,y:o.nodeModel.y,width:o.nodeModel.width,height:o.nodeModel.height,radius:u};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:e,deltaY:n,beforeNode:x,afterNode:_})}},o.updateEllipse=function(t){var e=t.deltaX,n=t.deltaY,i=o.nodeModel,r=i.rx,a=i.ry,s=i.x,l=i.y,u=i.PCTResizeInfo,c=o.index,d=o.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,v=d.maxHeight,y=h===f,m=p===v,b=r,x=a,_=o.getResize({index:c,deltaX:e,deltaY:n,width:b,height:x,PCTResizeInfo:u,pct:.5,freezeWidth:y,freezeHeight:m});if(_.width<h/2||_.width>f/2||_.height<p/2||_.height>v/2)o.dragHandler.cancelDrag();else{o.updatePosition({deltaX:y?0:_.deltaX,deltaY:m?0:_.deltaY}),o.nodeModel.rx=_.width,o.nodeModel.ry=_.height,o.nodeModel.setProperties({nodeSize:{rx:_.width,ry:_.height}});var E={x:s,y:l},w={rx:_.width,ry:_.height,x:o.nodeModel.x,y:o.nodeModel.y};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:e,deltaY:n,beforeNode:g(g({},E),{rx:r,ry:a}),afterNode:w})}},o.updateDiamond=function(t){var e=t.deltaX,n=t.deltaY,i=o.nodeModel,r=i.rx,a=i.ry,s=i.x,l=i.y,u=i.PCTResizeInfo,c=o.index,d=o.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,g=d.maxHeight,v=h===f,y=p===g,m=r,b=a,x=o.getResize({index:c,deltaX:e,deltaY:n,width:m,height:b,PCTResizeInfo:u,pct:.5,freezeWidth:v,freezeHeight:y});if(x.width<h/2||x.width>f/2||x.height<p/2||x.height>g/2)o.dragHandler.cancelDrag();else{o.updatePosition({deltaX:v?0:x.deltaX,deltaY:y?0:x.deltaY}),o.nodeModel.rx=x.width,o.nodeModel.ry=x.height,o.nodeModel.setProperties({nodeSize:{rx:x.width,ry:x.height}});var _={x:s,y:l,rx:r,ry:a},E={rx:x.width,ry:x.height,x:o.nodeModel.x,y:o.nodeModel.y};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:e,deltaY:n,beforeNode:_,afterNode:E})}},o.eventEmit=function(t){var e=t.deltaX,n=t.deltaY,i=t.beforeNode,r=t.afterNode,a=o.nodeModel,s=a.id,l=a.modelType,u=a.type,c=g({id:s,modelType:l,type:u},i),d=g({id:s,modelType:l,type:u},r);o.graphModel.eventCenter.emit("node:resize",{preData:c,data:d,deltaX:e,deltaY:n,index:o.index,model:o.nodeModel})},o.onDragging=function(t){var n,i=t.deltaX,r=t.deltaY,a=o.graphModel.transformModel,s=o.nodeModel.modelType;i=(n=_(a.fixDeltaXY(i,r),2))[0],r=n[1],s===e.ModelType.RECT_NODE||s===e.ModelType.HTML_NODE?o.updateRect({deltaX:i,deltaY:r}):s===e.ModelType.ELLIPSE_NODE?o.updateEllipse({deltaX:i,deltaY:r}):s===e.ModelType.DIAMOND_NODE&&o.updateDiamond({deltaX:i,deltaY:r})},o.onDragEnd=function(){var t=o.graphModel.gridSize,e=void 0===t?1:t,n=e*Math.round(o.nodeModel.x/e),i=e*Math.round(o.nodeModel.y/e);o.nodeModel.moveTo(n,i),o.updateEdgePointByAnchors()},o.index=n.index,o.nodeModel=n.model,o.graphModel=n.graphModel,o.dragHandler=new gg({onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:1}),o}return f(n,t),n.prototype.getNodeEdges=function(t){for(var e=this.graphModel.edges,n=[],o=[],i=0;i<e.length;i++){var r=e[i];r.sourceNodeId===t?n.push(r):e[i].targetNodeId===t&&o.push(r)}return{sourceEdges:n,targetEdges:o}},n.prototype.render=function(){var t=this.props,n=t.x,o=t.y,i=t.index,r=t.model.getControlPointStyle();return fg("g",{className:"lf-resize-control-".concat(i),children:fg(e.Rect,g({className:"lf-node-control",x:n,y:o},r,{onMouseDown:this.dragHandler.handleMouseDown}))})},n}(e.Component),yg=function(t){function n(){var e=t.call(this)||this;return e.state={},e}return f(n,t),n.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,o=e.x,i=e.y,r=e.width,a=e.height,s={minX:o-r/2,minY:i-a/2,maxX:o+r/2,maxY:i+a/2},l=s.minX,u=s.minY,c=s.maxX,d=s.maxY;return[{x:l,y:u},{x:c,y:u},{x:c,y:d},{x:l,y:d}].map((function(t,o){return fg(vg,g({index:o},t,{model:e,graphModel:n}))}))},n.prototype.getGroupSolid=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.getResizeOutlineStyle();return fg(e.Rect,g({},a,{x:n,y:o,width:i,height:r}))},n.prototype.render=function(){return fg("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},n}(e.Component),mg=function(t){function e(e,n){var o=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(o.rx=i.rx,o.ry=i.ry),o}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.rx,basisHeight:this.ry},n={maxScaleLimit:Math.min(this.maxWidth/(2*this.rx)*100,this.maxHeight/(2*this.ry)*100),minScaleLimit:Math.max(this.minWidth/(2*this.rx)*100,this.minHeight/(2*this.ry)*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.EllipseNodeModel),bg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return fg(yg,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model,n=t.graphModel.editConfigModel.isSilentMode;return fg("g",{children:[this.getResizeShape(),e.isSelected&&!n?this.getControlGroup():""]})},e}(e.EllipseNode),xg={type:"ellipse",view:bg,model:mg},_g=function(t){function e(e,n){var o=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(o.rx=i.rx,o.ry=i.ry),o}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.rx,basisHeight:this.ry},n={maxScaleLimit:Math.min(this.maxWidth/(2*this.rx)*100,this.maxHeight/(2*this.ry)*100),minScaleLimit:Math.max(this.minWidth/(2*this.rx)*100,this.minHeight/(2*this.ry)*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.DiamondNodeModel),Eg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return fg(yg,{model:e,graphModel:n})},n.prototype.getResizeShape=function(){var t=this.props.model,n=t.points,o=t.getNodeStyle();return fg("g",{children:fg(e.Polygon,g({},o,{points:n}))})},n.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return fg("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},n}(e.DiamondNode),wg={type:"diamond",view:Eg,model:_g},Sg=function(t){function e(e,n){var o=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(o.width=i.width,o.height=i.height),o}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.width,basisHeight:this.height},n={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.HtmlNodeModel),Cg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return fg(yg,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return fg("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(e.HtmlNode),Ng={type:"html",view:Cg,model:Sg},Tg=function(t){function e(e,n){var o=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(o.width=i.width,o.height=i.height),o}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.width,basisHeight:this.height},n={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.RectNodeModel),Ag=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return fg(yg,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return fg("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(e.RectNode),Mg={type:"rect",view:Ag,model:Tg},Og={pluginName:"nodeResize",step:0,install:function(t){t.register(xg),t.register(wg),t.register(Ng),t.register(Mg)}},Pg=function(t){function e(){var e=t.apply(this,E([],_(arguments),!1))||this;return e.isGroup=!0,e.isFolded=!1,e.unfoldedWidth=500,e.unfoldedHeight=300,e.childrenLastFoldStatus={},e}return f(e,t),e.prototype.initNodeData=function(e){var n=this;t.prototype.initNodeData.call(this,e);var o=[];ee(e.children)&&(o=e.children),this.children=new Set(o),this.width=500,this.height=300,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=-1e4,this.radius=0,this.text.editable=!1,this.text.draggable=!1,this.isRestrict=!1,this.resizable=!1,this.autoToFront=!1,this.foldable=!1,void 0===this.properties.isFolded&&(this.properties.isFolded=!1),this.isFolded=!!this.properties.isFolded,setTimeout((function(){n.isFolded&&n.foldGroup(n.isFolded)}))},e.prototype.getResizeOutlineStyle=function(){var e=t.prototype.getResizeOutlineStyle.call(this);return e.stroke="none",e},e.prototype.foldGroup=function(t){var e=this;if(t!==this.isFolded){this.setProperty("isFolded",t),this.isFolded=t,t?(this.x=this.x-this.width/2+this.foldedWidth/2,this.y=this.y-this.height/2+this.foldedHeight/2,this.unfoldedWidth=this.width,this.unfoldedHeight=this.height,this.width=this.foldedWidth,this.height=this.foldedHeight):(this.width=this.unfoldedWidth,this.height=this.unfoldedHeight,this.x=this.x+this.width/2-this.foldedWidth/2,this.y=this.y+this.height/2-this.foldedHeight/2);var n=E(E([],_(this.incoming.edges),!1),_(this.outgoing.edges),!1);this.children.forEach((function(o){var i=e.graphModel.getElement(o);if(i){var r=i.isFolded;if(i.isGroup&&!i.isFolded&&i.foldGroup(t),i.isGroup&&!t){var a=e.childrenLastFoldStatus[o];void 0!==a&&a!==i.isFolded&&i.foldGroup(a)}e.childrenLastFoldStatus[o]=!!r,i.visible=!t;var s=i.incoming.edges,l=i.outgoing.edges;n=E(E(E([],_(n),!1),_(s),!1),_(l),!1)}})),this.foldEdge(t,n)}},e.prototype.getAnchorStyle=function(e){var n=t.prototype.getAnchorStyle.call(this,e);return n.stroke="transparent",n.fill="transparent",n.hover.fill="transparent",n.hover.stroke="transparent",n},e.prototype.foldEdge=function(t,e){var n=this;e.forEach((function(e,o){var i=e.id,r=e.sourceNodeId,a=e.targetNodeId,s=e.startPoint,l=e.endPoint,u=e.type,c=e.text,d=e.getProperties(),h={id:"".concat(i,"__").concat(o),sourceNodeId:r,targetNodeId:a,startPoint:s,endPoint:l,type:u,properties:d,text:null==c?void 0:c.value};e.virtual&&n.graphModel.deleteEdgeById(e.id);var p=n.graphModel.group.getNodeGroup(a);p||(p=n.graphModel.getNodeModelById(a));var f=n.graphModel.group.getNodeGroup(r);f||(f=n.graphModel.getNodeModelById(r)),t&&!1!==e.visible&&(n.children.has(r)||n.id===r?(h.startPoint=void 0,h.sourceNodeId=n.id):(h.endPoint=void 0,h.targetNodeId=n.id),p.id===n.id&&f.id===n.id||n.createVirtualEdge(h),e.visible=!1),t||!1!==e.visible||(p&&p.isGroup&&p.isFolded?(h.targetNodeId=p.id,h.endPoint=void 0,n.createVirtualEdge(h)):f&&f.isGroup&&f.isFolded?(h.sourceNodeId=f.id,h.startPoint=void 0,n.createVirtualEdge(h)):e.visible=!0)}))},e.prototype.createVirtualEdge=function(t){t.pointsList=void 0;var e=this.graphModel.addEdge(t);e.virtual=!0,e.text.editable=!1,e.isFoldedEdge=!0},e.prototype.isInRange=function(t){var e=t.minX,n=t.minY,o=t.maxX,i=t.maxY;return e>=this.x-this.width/2&&o<=this.x+this.width/2&&n>=this.y-this.height/2&&i<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(t){var e=t.x1,n=t.y1,o=t.x2,i=t.y2;return{x:e>=this.x-this.width/2&&o<=this.x+this.width/2,y:n>=this.y-this.height/2&&i<=this.y+this.height/2}},e.prototype.setAllowAppendChild=function(t){this.setProperty("groupAddable",t)},e.prototype.addChild=function(t){this.children.add(t),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},e.prototype.removeChild=function(t){this.children.delete(t),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},e.prototype.getData=function(){var e=this,n=t.prototype.getData.call(this);n.children=[],console.log("this.children",this.children),this.children.forEach((function(t){var o=e.graphModel.getNodeModelById(t);o&&!o.virtual&&n.children.push(t)}));var o=n.properties;return null==o||delete o.groupAddable,null==o||delete o.isFolded,n},e.prototype.getHistoryData=function(){var e=t.prototype.getData.call(this);e.children=E([],_(this.children),!1),e.isGroup=!0;var n=e.properties;return null==n||delete n.groupAddable,(null==n?void 0:n.isFolded)&&(e.x=e.x+this.unfoldedWidth/2-this.foldedWidth/2,e.y=e.y+this.unfoldedHeight/2-this.foldedHeight/2),e},e.prototype.isAllowAppendIn=function(t){return console.info("_nodeData",t),!0},e.prototype.toBack=function(){this.zIndex--},e}(Tg),kg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getControlGroup=function(){var e=this.props.model,n=e.resizable,o=e.properties;return n&&!o.isFolded?t.prototype.getControlGroup.call(this):null},n.prototype.getAddableShape=function(){var t=this.props.model,n=t.width,o=t.height,i=t.x,r=t.y,a=t.radius,s=t.properties,l=t.getAddableOutlineStyle;if(!s.groupAddable)return null;var u=this.props.model.getNodeStyle().strokeWidth,c=void 0===u?0:u,d=l(),h=n+c+8,p=o+c+8;return e.h("rect",g(g({},d),{width:h,height:p,x:i-h/2,y:r-p/2,rx:a,ry:a}))},n.prototype.getFoldIcon=function(){var t=this.props.model,n=t.x-t.width/2+5,o=t.y-t.height/2+5;if(!t.foldable)return null;var i=e.h("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:t.properties.isFolded?"M ".concat(n+3,",").concat(o+6," ").concat(n+11,",").concat(o+6," M").concat(n+7,",").concat(o+2," ").concat(n+7,",").concat(o+10):"M ".concat(n+3,",").concat(o+6," ").concat(n+11,",").concat(o+6," ")});return e.h("g",{},[e.h("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:t.x-t.width/2+5,y:t.y-t.height/2+5,onClick:function(){t.foldGroup(!t.properties.isFolded)}}),i])},n.prototype.getResizeShape=function(){return e.h("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},n}(Ag),Rg={type:"group",view:kg,model:Pg},Dg=-1e4,Lg=function(){function t(t){var e=t.lf,n=this;this.topGroupZIndex=Dg,this.nodeGroupMap=new Map,this.graphRendered=function(t){var e=t.data;e&&e.nodes&&(e.nodes.forEach((function(t){t.children&&t.children.forEach((function(e){n.nodeGroupMap.set(e,t.id)}))})),n.checkAndCorrectTopGroupZIndex(e.nodes))},this.appendNodeToGroup=function(t){var e=t.data,o=n.nodeGroupMap.get(e.id);if(o){var i=n.lf.getNodeModelById(o);i.removeChild(e.id),n.nodeGroupMap.delete(e.id),i.setAllowAppendChild(!1)}var r=n.lf.getNodeModelById(e.id),a=null==r?void 0:r.getBounds();if(a&&r){var s=n.getGroup(a,e);if(r.isGroup&&(e.children.forEach((function(t){n.nodeGroupMap.set(t,e.id)})),n.checkAndCorrectTopGroupZIndex([e]),n.nodeSelected({data:e,isSelected:!1,isMultiple:!1})),!s)return;if(!s.isAllowAppendIn(e))return void n.lf.emit("group:not-allowed",{group:s.getData(),node:e});s.addChild(e.id),n.nodeGroupMap.set(e.id,s.id),s.setAllowAppendChild(!1)}},this.deleteGroupChild=function(t){var e=t.data;e.children&&e.children.forEach((function(t){n.nodeGroupMap.delete(t),n.lf.deleteNode(t)}));var o=n.nodeGroupMap.get(e.id);o&&(n.lf.getNodeModelById(o).removeChild(e.id),n.nodeGroupMap.delete(e.id))},this.setActiveGroup=function(t){var e=t.data,o=n.lf.getNodeModelById(e.id),i=null==o?void 0:o.getBounds();if(o&&i){var r=n.getGroup(i,e);if(n.activeGroup&&n.activeGroup.setAllowAppendChild(!1),!r||o.isGroup&&r.id===e.id)return;if(!r.isAllowAppendIn(e))return;n.activeGroup=r,n.activeGroup.setAllowAppendChild(!0)}},this.findNodeAndChildMaxZIndex=function(t){var e=Dg;return t.isGroup&&(e=Math.max(e,t.zIndex)),t.children&&t.children.forEach((function(t){"object"==typeof t&&(t=t.id);var o=n.lf.getNodeModelById(t);if(null==o?void 0:o.isGroup){var i=n.findNodeAndChildMaxZIndex(o);e=Math.max(i,e)}})),e},this.checkAndCorrectTopGroupZIndex=function(t){var e=Dg;if(t.forEach((function(t){var o=n.lf.getNodeModelById(t.id);if(o){var i=n.findNodeAndChildMaxZIndex(o);i>e&&(e=i)}})),!(n.topGroupZIndex>=e)){for(var o=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})),i=n.topGroupZIndex,r=0;r<o.length;r++){var a=o[r];a.zIndex>i&&(i=a.zIndex)}n.topGroupZIndex=i}},this.nodeSelected=function(t){var e=t.data,o=t.isMultiple,i=t.isSelected,r=n.lf.getNodeModelById(e.id);if(n.toFrontGroup(r),n.topGroupZIndex>-1e3){n.topGroupZIndex=Dg;for(var a=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})).sort((function(t,e){return t.zIndex-e.zIndex})),s=0,l=0;l<a.length;l++){var u=a[l];u.zIndex!==s&&(n.topGroupZIndex++,s=u.zIndex),u.setZIndex(n.topGroupZIndex)}}if(o&&i)if(null==r?void 0:r.isGroup)r.children.forEach((function(t){var e=n.lf.graphModel.getElement(t);null==e||e.setSelected(!1)}));else{var c=n.nodeGroupMap.get(e.id);if(c){var d=n.lf.getNodeModelById(c);(null==d?void 0:d.isSelected)&&(null==r||r.setSelected(!1))}}},this.toFrontGroup=function(t){t&&t.isGroup&&(n.topGroupZIndex++,t.setZIndex(n.topGroupZIndex),t.children&&t.children.forEach((function(t){var e=n.lf.getNodeModelById(t);n.toFrontGroup(e)})))},e.register(Rg),this.lf=e,e.graphModel.addNodeMoveRules((function(t,o,i){if(t.isGroup){var r=n.getNodeAllChild(t);return e.graphModel.moveNodes(r,o,i,!0),!0}var a=e.getNodeModelById(n.nodeGroupMap.get(t.id));if(a&&a.isRestrict){var s=t.getBounds(),l=s.minX,u=s.minY,c=s.maxX,d=s.maxY;return a.isAllowMoveTo({x1:l+o,y1:u+i,x2:c+o,y2:d+i})}return!0})),e.graphModel.group=this,e.on("node:add,node:drop,node:dnd-add",this.appendNodeToGroup),e.on("node:delete",this.deleteGroupChild),e.on("node:dnd-drag,node:drag",this.setActiveGroup),e.on("node:click",this.nodeSelected),e.on("graph:rendered",this.graphRendered),e.addElements=function(t,o){var i=t.nodes,r=t.edges,a={},s={nodes:[],edges:[]},l=[];return xu(i,(function(t){var i=t.id,r=t.children,u=v(t,["children"]),c=e.addNode(u);if(!c)return{nodes:[],edges:[]};i&&(a[i]=c.id),s.nodes.push(c);var d=n.createAllChildNodes(a,r,c,o).edgesArray;l.push.apply(l,E([],_(d),!1))})),l.forEach((function(t){n.createEdgeModel(t,a,o)})),xu(r,(function(t){var e=n.createEdgeModel(t,a,0);s.edges.push(e)})),s}}return t.prototype.createAllChildNodes=function(t,n,o,i){var r=this,a=this.lf,s=[],l=[],u=[];null==n||n.forEach((function(n){var c=a.getNodeModelById(n);if(c){var d=c.x,h=c.y,p=c.properties,f=c.type,g=c.rotate,v=c.children,y={x:d+i,y:h+i,properties:p,type:f,rotate:g},m=e.EventType.NODE_GROUP_COPY||"node:group-copy-add",b=a.addNode(y,m);if(o.addChild(b.id),t[n]=b.id,u.push(b),c.incoming.edges.forEach((function(t){l.push(t)})),c.outgoing.edges.forEach((function(t){l.push(t)})),v instanceof Set){var x=r.createAllChildNodes(t,v,b,i),w=x.nodesArray,S=x.edgesArray;u.push.apply(u,E([],_(w),!1)),s.push.apply(s,E([],_(S),!1))}}}));var c=l.filter((function(e){return t[e.sourceNodeId]&&t[e.targetNodeId]})).map((function(t){return t.getData()}));return{nodesArray:u,edgesArray:s.concat(c)}},t.prototype.createEdgeModel=function(t,e,n){var o=this.lf,i=t.sourceNodeId,r=t.targetNodeId;e[i]&&(i=e[i]),e[r]&&(r=e[r]);var a=t.type,s=t.startPoint,l=t.endPoint,u=t.pointsList,c=t.text,d={x:((null==s?void 0:s.x)||0)+n,y:((null==s?void 0:s.y)||0)+n},h={x:((null==l?void 0:l.x)||0)+n,y:((null==l?void 0:l.y)||0)+n},p=[];u&&u.length>0&&(p=u.map((function(t){return t.x+=n,t.y+=n,t})));var f={type:a,startPoint:d,endPoint:h,sourceNodeId:i,targetNodeId:r,pointsList:p};return he(c)&&!Vc(c)&&(f.text=g(g({},c),{x:(null==c?void 0:c.x)+n,y:(null==c?void 0:c.y)+n})),o.graphModel.addEdge(f)},t.prototype.getNodeAllChild=function(t){var e=this,n=[];return t.children&&t.children.forEach((function(t){n.push(t);var o=e.lf.getNodeModelById(t);(null==o?void 0:o.isGroup)&&(n=n.concat(e.getNodeAllChild(o)))})),n},t.prototype.getGroup=function(t,e){var n=this.lf.graphModel.nodes.filter((function(n){return n.isGroup&&n.isInRange(t)&&n.id!==e.id}));if(0!==n.length){if(1===n.length)return n[0];for(var o=n[n.length-1],i=n.length-2;i>=0;i--)n[i].zIndex>o.zIndex&&(o=n[i]);return o}},t.prototype.getNodeGroup=function(t){var e=this.nodeGroupMap.get(t);if(e)return this.lf.getNodeModelById(e)},t.prototype.render=function(){},t.prototype.destroy=function(){},t.pluginName="group",t}();function Ig(){var t=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getFoldIcon=function(){var t=this.props.model,n=t,o=n.x,i=n.y,r=n.width,a=n.height,s=n.properties,l=n.foldable,u=t.x-t.width/2+5,c=t.y-t.height/2+5;if(!l)return null;var d=e.h("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:s.isFolded?"M ".concat(u+3,",").concat(c+6," ").concat(u+11,",").concat(c+6," M").concat(u+7,",").concat(c+2," ").concat(u+7,",").concat(c+10):"M ".concat(u+3,",").concat(c+6," ").concat(u+11,",").concat(c+6," ")});return e.h("g",{},[e.h("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:o-r/2+5,y:i-a/2+5,onClick:function(e){var n,o;null===(o=(n=e.stopPropagation()(t)).foldGroup)||void 0===o||o.call(n,!s.isFolded)}}),d])},n.prototype.getResizeShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.getNodeStyle(),s=g(g({},a),{x:n-i/2,y:o-r/2,width:i,height:r,stroke:"black",strokeWidth:2,strokeDasharray:"0 0"});return e.h("g",{},[e.h("rect",g({},s)),this.getFoldIcon()])},n}(kg),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.foldable=!0,this.resizable=!0,this.width=400,this.height=200,this.resetWidthHeight(),this.isTaskNode=!0,this.boundaryEvents=[]},e.prototype.resetWidthHeight=function(){var t,e,n=null===(t=this.properties.iniProp)||void 0===t?void 0:t.width,o=null===(e=this.properties.iniProp)||void 0===e?void 0:e.height;n&&(this.width=n),o&&(this.height=o)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return e.stroke="#989891",e.strokeWidth=1,e.strokeDasharray="3 3",this.isSelected&&(e.stroke="rgb(124, 15, 255)"),this.properties.isBoundaryEventTouchingTask&&(e.stroke="#00acff",e.strokeWidth=2),e},e.prototype.addChild=function(e){var n=this.graphModel.getElement(e);null==n||n.setProperties({parent:this.id}),t.prototype.addChild.call(this,e)},e.prototype.getAnchorStyle=function(){var e=t.prototype.getAnchorStyle.call(this);return e.stroke="#000",e.fill="#fff",e.hover||(e.hover={}),e.hover.stroke="transparent",e},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return e.stroke="transparent",e.hover||(e.hover={}),e.hover.stroke="transparent",e},e.prototype.setTouching=function(t){this.setProperty("isBoundaryEventTouchingTask",t)},e.prototype.addBoundaryEvent=function(t){if(this.setTouching(!1),this.boundaryEvents.find((function(e){return e===t})))return!1;var e=this.graphModel.getNodeModelById(t);return null==e||e.setProperties({attachedToRef:this.id}),this.boundaryEvents.push(t),!0},e.prototype.deleteBoundaryEvent=function(t){this.boundaryEvents=this.boundaryEvents.filter((function(e){return e!==t}))},e}(Pg);return{type:"bpmn:subProcess",view:t,model:n}}function jg(t){var e=Lt("bpmn:serviceTask",Tt),n=Lt("bpmn:userTask",At);t.register(e),t.register(n),t.register(Ig()),function(t){function e(t,e){var n=t.x,o=t.y,i=t.width,r=t.height,a=t.id,s=n-i/2,l=n+i/2,u=o-r/2,c=o+r/2,d=e.x,h=e.y;return d>s-5&&d<l+5&&h>u-5&&h<c+5&&!(d>s+5&&d<l-5&&h>u+5&&h<c-5)?a:null}t.on("node:drag,node:dnd-drag",(function(n){var o,i,r=n.data;if("bpmn:boundaryEvent"===r.type){var a=t.graphModel.nodes;try{for(var s=x(a),l=s.next();!l.done;l=s.next()){var u=l.value;u.isTaskNode&&(e(u,r)?u.setTouching(!0):u.setTouching(!1))}}catch(t){o={error:t}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}})),t.on("node:drop,node:dnd-add",(function(n){var o,i,r=n.data,a=r.type,s=r.id;if("bpmn:boundaryEvent"===a){var l=t.graphModel.nodes;try{for(var u=x(l),c=u.next();!c.done;c=u.next()){var d,h=c.value;if(h.isTaskNode)if(null!==(d=e(h,r))){var p=t.graphModel.getNodeModelById(s),f=t.graphModel.getNodeModelById(d),g=p.properties.attachedToRef;return g&&g!==d&&t.graphModel.getNodeModelById(g).deleteBoundaryEvent(s),void f.addBoundaryEvent(s)}}}catch(t){o={error:t}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}}})),t.graphModel.addNodeMoveRules((function(e,n,o){if(e.isTaskNode){var i=e.boundaryEvents;return t.graphModel.moveNodes(i,n,o,!0),!0}return!0}))}(t)}function Bg(t){var n=function(e){function n(n,o){n.id||(n.id="Flow_".concat(gt()));var i=g(g(g({},t||{}),n.properties),{isDefaultFlow:!1});return n.properties=i,e.call(this,n,o)||this}return f(n,e),n.extendKey="SequenceFlowModel",n}(e.PolylineEdgeModel),o=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getStartArrow=function(){return this.props.model.properties.isDefaultFlow?e.h("path",{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}):e.h("path",{d:""})},n.extendKey="SequenceFlowEdge",n}(e.PolylineEdge);return{type:"bpmn:sequenceFlow",view:o,model:n}}var Hg=Bg();var Fg=[{nodes:["startEvent","intermediateCatchEvent","boundaryEvent"],definition:[{type:"bpmn:timerEventDefinition",icon:Et,properties:{definitionType:"bpmn:timerEventDefinition",timerValue:"",timerType:""}}]}];function zg(t){function e(e){e.forEach((function(e){var n,o;n=e.nodes,o=e.definition,n.forEach((function(e){(null==t?void 0:t[e])||(t[e]=new Map);var n=null==t?void 0:t[e];o.forEach((function(t){n.set(t.type,t)}))}))}))}return function(){return[t,e]}}var Wg=function(){function t(t){var e=t.lf;e.definition={},e.useDefinition=zg(e.definition);var n=_(e.useDefinition(),2),o=n[0],i=n[1];console.log("_definition",o),i(Fg),function(t){t.register(bt(t)),t.register(yt(t)),t.register(mt(t)),t.register(_t(t)),t.register(xt(t))}(e),function(t){var e=Rt("bpmn:exclusiveGateway",St),n=Rt("bpmn:parallelGateway",Ct),o=Rt("bpmn:inclusiveGateway",Nt);t.register(e),t.register(o),t.register(n)}(e),function(t){t.register(Hg)}(e),jg(e),e.setDefaultEdgeType("bpmn:sequenceFlow")}return t.pluginName="BpmnElementsPlugin",t}(),Gg=40,Ug=40,Xg=40,Vg=40,Yg=100,qg=80,Kg=100,Zg=80,$g=100,Jg=80,Qg=100,tv=80,ev=100,nv=80,ov=100,iv=80,rv=100,av=80,sv=100,lv=80,uv=function(){};(uv.ObjTree=function(){return this}).VERSION="0.23",uv.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',uv.ObjTree.prototype.attr_prefix="-",uv.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(t,"application/xml");if(!o)return;e=o.documentElement}else window.ActiveXObject&&((n=new ActiveXObject("Microsoft.XMLDOM")).async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)},uv.ObjTree.prototype.parseHTTP=function(t,e,n){var o,i={};for(var r in e)i[r]=e[r];if(i.method||(void 0===i.postBody&&void 0===i.postbody&&void 0===i.parameters?i.method="get":i.method="post"),n){i.asynchronous=!0;var a=this,s=n,l=i.onComplete;i.onComplete=function(t){var e;t&&t.responseXML&&t.responseXML.documentElement&&(e=a.parseDOM(t.responseXML.documentElement)),s(e,t),l&&l(t)}}else i.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request)i.uri=t,(u=new HTTP.Request(i))&&(o=u.transport);else if("undefined"!=typeof Ajax&&Ajax.Request){var u;(u=new Ajax.Request(t,i))&&(o=u.transport)}return n?o:o&&o.responseXML&&o.responseXML.documentElement?this.parseDOM(o.responseXML.documentElement):void 0},uv.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),11!==t.nodeType){var o={};o[t.nodeName]=n,n=o}return n}},uv.ObjTree.prototype.parseElement=function(t){if(7!==t.nodeType){if(3===t.nodeType||4===t.nodeType||8===t.nodeType){if(null==t.nodeValue.match(/[^\x00-\x20]/))return;return t.nodeValue}var e=null,n={};if(t.attributes&&t.attributes.length){e={};for(var o=0;o<t.attributes.length;o++){if("string"==typeof(s=t.attributes[o].nodeName)){var i=t.attributes[o].nodeValue;try{i=JSON.parse(t.attributes[o].nodeValue.replace(/'/g,'"'))}catch(e){i=t.attributes[o].nodeValue}null!=i&&(void 0===n[s=this.attr_prefix+s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],i))}}}if(t.childNodes&&t.childNodes.length){var r=!0;e&&(r=!1);for(o=0;o<t.childNodes.length&&r;o++){var a=t.childNodes[o].nodeType;3!==a&&4!==a&&8!==a&&(r=!1)}if(r){e||(e="");for(o=0;o<t.childNodes.length;o++)e+=t.childNodes[o].nodeValue}else{e||(e={});for(o=0;o<t.childNodes.length;o++){var s;if("string"==typeof(s=t.childNodes[o].nodeName))(i=this.parseElement(t.childNodes[o]))&&(void 0===n[s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],i))}}}else null===e&&(e={});return e}},uv.ObjTree.prototype.addNode=function(t,e,n,o){this.__force_array[e]?(1===n&&(t[e]=[]),t[e][t[e].length]=o):1===n?t[e]=o:2===n?t[e]=[t[e],o]:t[e][t[e].length]=o},uv.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},uv.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],o=[];for(var i in e)if(fc(e,i)){var r=e[i];i.charAt(0)!==this.attr_prefix?void 0===r||null==r?n[n.length]="<".concat(i," />"):"object"==typeof r&&r.constructor===Array?n[n.length]=this.array_to_xml(i,r):n[n.length]="object"==typeof r?this.hash_to_xml(i,r):this.scalar_to_xml(i,r):o[o.length]=" ".concat(i.substring(1),'="').concat(this.xml_escape(r),'"')}var a=o.join(""),s=n.join("");return void 0===t||null==t||(s=n.length>0?s.match(/\n/)?"<".concat(t).concat(a,">\n").concat(s,"</").concat(t,">\n"):"<".concat(t).concat(a,">").concat(s,"</").concat(t,">\n"):"<".concat(t).concat(a," />\n")),s},uv.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],o=0;o<e.length;o++){var i=e[o];void 0===i||null==i?n[n.length]="<".concat(t," />"):"object"==typeof i&&i.constructor===Array?n[n.length]=this.array_to_xml(t,i):n[n.length]="object"==typeof i?this.hash_to_xml(t,i):this.scalar_to_xml(t,i)}return n.join("")},uv.ObjTree.prototype.scalar_to_xml=function(t,e){return"#text"===t?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e),"</").concat(t,">\n")},uv.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};function cv(t){return Object.prototype.toString.call(t)}function dv(t){return" ".repeat(t)}function hv(t){return"[object Object]"===cv(t)?Object.keys(t).reduce((function(e,n){var o=n;return"-"===n.charAt(0)&&(o=n.substring(1)),e[o]=hv(t[n]),e}),{}):Array.isArray(t)?t.map((function(t){return hv(t)})):t}var pv,fv="\t\n";function gv(t,e,n){var o=dv(n),i="",r=fv+o;if("-json"===e)return"";if("#text"===e)return r+t;if("#cdata-section"===e)return"".concat(r,"<![CDATA[").concat(t,"]]>");if("#comment"===e)return"".concat(r,"\x3c!--").concat(t,"--\x3e");if("-"==="".concat(e).charAt(0))return" ".concat(e.substring(1),'="').concat(function(t){var e=t;try{"string"!=typeof e&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(hv(t)).replace(/"/g,"'")}return e}(t),'"');if(Array.isArray(t))i+=t.map((function(t){return gv(t,e,n+1)})).join("");else if("[object Object]"===cv(t)){var a=Object.keys(t),s="",l=t["-json"]?fv+dv(n+1)+t["-json"]:"";i+="".concat(0===n?"":r,"<").concat(e),a.forEach((function(e){"-"===e.charAt(0)?s+=gv(t[e],e,n+1):l+=gv(t[e],e,n+1)})),i+=s+(""!==l?">".concat(l).concat(r,"</").concat(e,">"):" />")}else i+="".concat(r,"<").concat(e,">").concat(t.toString(),"</").concat(e,">");return i}!function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",t.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",t.BOUNDARY="bpmn:boundaryEvent",t.PARALLEL_GATEWAY="bpmn:parallelGateway",t.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",t.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow",t.SUBPROCESS="bpmn:subProcess"}(pv||(pv={}));var vv=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],yv=["properties","startPoint","endPoint","pointsList"],mv={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},bv=function(t,e){return Object.keys(e||{}).forEach((function(n){if(t[n]){var o=e[n],i=o.in,r=o.out;i&&(t[n].in=i),r&&(t[n].out=r)}else t[n]=e[n]})),t},xv={"bpmn:startEvent":{out:function(t){var e,n,o=t.properties;return(null===(n=null===(e=xv[o.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:intermediateCatchEvent":{out:function(t){var e,n,o=t.properties;return(null===(n=null===(e=xv[o.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:intermediateThrowEvent":{out:function(t){var e,n,o=t.properties;return(null===(n=null===(e=xv[o.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:boundaryEvent":{out:function(t){var e,n,o=t.properties;return(null===(n=null===(e=xv[o.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:sequenceFlow":{out:function(t){var e=t.properties,n=e.expressionType,o=e.condition;return o?"cdata"===n?{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${'.concat(o,"}]]></bpmn:conditionExpression>")}:{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression">'.concat(o,"</bpmn:conditionExpression>")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,o=e.timerValue,i=e.definitionId;return{json:'<bpmn:timerEventDefinition id="'.concat(i,'"').concat(n&&o?">".concat("<bpmn:".concat(n,' xsi:type="bpmn:tFormalExpression">').concat(o,"</bpmn:").concat(n,">"),"</bpmn:timerEventDefinition>"):"/>")}},in:function(t,e){var n,o,i,r=t,a=e["-id"],s="",l="";try{for(var u=x(Object.keys(e)),c=u.next();!c.done;c=u.next()){var d=c.value;d.includes("bpmn:")&&(s=_(d.split(":"),2)[1],l=null===(i=e[d])||void 0===i?void 0:i["#text"])}}catch(t){n={error:t}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}return{"-definitionId":a,"-definitionType":r,"-timerType":s,"-timerValue":l}}},"bpmn:conditionExpression":{in:function(t,e){var n,o="",i="";return e["#cdata-section"]?(i="cdata",o=(null===(n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))||void 0===n?void 0:n[1])||""):e["#text"]&&(i="normal",o=e["#text"]),{"-condition":o,"-expressionType":i}}}};function _v(t){var e=null!=t?t:{},n=e.retainedAttrsFields,o=e.excludeFields,i=e.transformer,r=new Set(E(E([],_(yv),!1),_(n||[]),!1)),a={in:new Set(E(E([],_(mv.in),!1),_((null==o?void 0:o.in)||[]),!1)),out:new Set(E(E([],_(mv.out),!1),_((null==o?void 0:o.out)||[]),!1))};return xv=bv(xv,i),function(t){var e=t.nodes,n=t.edges;return function t(o,i){var s,l;if(1!==(null==o?void 0:o.flag)){var u;if((u=xv[o.type])&&u.out){var c=u.out(o),d=Object.keys(c);d.length>0&&d.forEach((function(t){o[t]=c[t]}))}(null==o?void 0:o.children)&&(o.children=o.children.map((function(t){return e.find((function(e){return e.id===t}))||n.find((function(e){return e.id===t}))||{}})));var h={};if("string"==typeof o)return o;if(Array.isArray(o))return o.map((function(e){return t(e,"")})).filter((function(t){return null!=t}));try{for(var p=x(Object.entries(o)),f=p.next();!f.done;f=p.next()){var g=_(f.value,2),v=g[0],y=g[1];if(1===(null==y?void 0:y.flag))return;var m=[i,v].filter((function(t){return t})).join(".");a.out.has(m)||("object"!=typeof y?0===v.indexOf("-")||["#text","#cdata-section","#comment"].includes(v)?h[v]=y:h["-".concat(v)]=y:r.has(m)?h["-".concat(v)]=t(y,m):h[v]=t(y,m))}}catch(t){s={error:t}}finally{try{f&&!f.done&&(l=p.return)&&l.call(p)}finally{if(s)throw s.error}}return h}}(t,"")}}function Ev(t){var e,n,o={};try{for(var i=x(Object.entries(t)),r=i.next();!r.done;r=i.next()){var a=_(r.value,2),s=a[0],l=a[1];0===s.indexOf("-")?o[s.substring(1)]=hv(l):"string"==typeof l?o[s]=l:"[object Object]"===Object.prototype.toString.call(l)?o[s]=Ev(l):Array.isArray(l)?o[s]=l.map((function(t){return Ev(t)})):o[s]=l}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return o}function wv(t,e){t["bpmndi:BPMNEdge"]=e.edges.map((function(t){var e,n=t.id,o=t.pointsList.map((function(t){return{"-x":t.x,"-y":t.y}})),i={"-id":"".concat(n,"_di"),"-bpmnElement":n,"di:waypoint":o};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(i["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),i})),t["bpmndi:BPMNShape"]=e.nodes.map((function(t){var e,n=t.id,o=100,i=80,r=t.x,a=t.y,s=Av.shapeConfigMap.get(t.type);s&&(o=s.width,i=s.height),r-=o/2,a-=i/2;var l={"-id":"".concat(n,"_di"),"-bpmnElement":n,"dc:Bounds":{"-x":r,"-y":a,"-width":o,"-height":i}};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(l["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),l}))}var Sv=["bpmn:incoming","bpmn:outgoing"];function Cv(t,e){var n=[],o=[],i=new Map,r=null!=e?e:{},a=r.transformer,s=r.excludeFields,l={in:new Set(E(E([],_(mv.in),!1),_((null==s?void 0:s.in)||[]),!1)),out:new Set(E(E([],_(mv.out),!1),_((null==s?void 0:s.out)||[]),!1))};xv=bv(xv,a);var u,c,d=t["bpmn:definitions"];if(d){var h=d["bpmn:process"];u=h,c=[function(t){function e(t){t["-children"]||(t["-children"]=[]),Object.keys(t).forEach((function(e){var n;0!==e.indexOf("bpmn:")||Sv.includes(e)||(h[e]||(h[e]=[]),!Array.isArray(h[e])&&(h[e]=[h[e]]),Array.isArray(t[e])?(n=h[e]).push.apply(n,E([],_(t[e]),!1)):h[e].push(t[e]),Array.isArray(t[e])?t[e].forEach((function(n){!e.includes("Flow")&&t["-children"].push(n["-id"])})):!e.includes("Flow")&&t["-children"].push(t[e]["-id"]),delete t[e])}))}if("bpmn:subProcess"===t){var n=h[t];Array.isArray(n)?n.forEach((function(n){"bpmn:subProcess"===t&&e(n)})):e(n)}},function(t){function e(t){var n;i.set(t["-id"],t),Array.isArray(t)?t.forEach((function(t){e(t)})):"object"==typeof t&&(n=t,Object.keys(n).forEach((function(t){var o,i;if(t.includes("bpmn:")){var r={};xv[t]&&xv[t].in?(r=null===(i=(o=xv[t]).in)||void 0===i?void 0:i.call(o,t,pn.cloneDeep(n[t])),delete n[t]):e(n[t]);var a=void 0;(a=Reflect.ownKeys(r)).length>0&&a.forEach((function(t){Reflect.set(n,t,r[t])}))}})))}e(h[t])},function(t){if(0===t.indexOf("bpmn:")){var e=h[t];if("bpmn:sequenceFlow"===t){var r=d["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];o=function(t,e){var n=[];if(Array.isArray(t))t.forEach((function(t){var o;o=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(Tv(o,t))}));else{var o=void 0;o=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(Tv(o,t))}return n}(e,r)}else{var a=d["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if("bpmn:boundaryEvent"===t){var s=h[t],l=function(t){var e=t["-attachedToRef"],n=i.get(e);n["-boundaryEvents"]||(n["-boundaryEvents"]=[]),n["-boundaryEvents"].push(t["-id"])};Array.isArray(s)?s.forEach((function(t){l(t)})):l(s)}n=n.concat(function(t,e,n){var o=[];if(Array.isArray(t))t.forEach((function(t){var i=Nv(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);o.push(i)}));else{var i=Nv(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);o.push(i)}return o}(e,a,t))}}}],c.forEach((function(t){try{Object.keys(u).forEach((function(e){try{t(e)}catch(t){console.error(t)}}))}catch(t){console.error(t)}}))}var p=function(t,e,n){Object.keys(t).forEach((function(o){var i=n?"".concat(n,".").concat(o):o;e.has(i)?delete t[o]:"object"==typeof t[o]&&p(t[o],e,i)}))};return n.forEach((function(t){var n,o;if(null===(n=null==e?void 0:e.mapping)||void 0===n?void 0:n.in){var i=null===(o=null==e?void 0:e.mapping)||void 0===o?void 0:o.in,r=t.type;i[r]&&(t.type=i[r])}p(t,l.in,"")})),o.forEach((function(t){var n,o;if(null===(n=null==e?void 0:e.mapping)||void 0===n?void 0:n.in){var i=null===(o=null==e?void 0:e.mapping)||void 0===o?void 0:o.in,r=t.type;i[r]&&(t.type=i[r])}p(t,l.in,"")})),{nodes:n,edges:o}}function Nv(t,e,n){var o=Number(t["dc:Bounds"]["-x"]),i=Number(t["dc:Bounds"]["-y"]),r=n["-children"],a=n["-name"],s=Av.shapeConfigMap.get(e);s&&(o+=s.width/2,i+=s.height/2);var l,u={};if(Object.entries(n).forEach((function(t){var e=_(t,2),n=e[0],o=e[1];vv.includes(n)||(u[n]=o)})),u=Ev(u),a&&(l={x:o,y:i,value:a},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var c=t["bpmndi:BPMNLabel"]["dc:Bounds"];l.x=Number(c["-x"])+Number(c["-width"])/2,l.y=Number(c["-y"])+Number(c["-height"])/2}var d={id:t["-bpmnElement"],type:e,x:o,y:i,properties:u};return r&&(d.children=r),l&&(d.text=l),d}function Tv(t,e){var n,o="".concat(e["-name"]);if(o){var i=t["bpmndi:BPMNLabel"]["dc:Bounds"],r=0;o.split("\n").forEach((function(t){r<t.length&&(r=t.length)})),n={value:o,x:Number(i["-x"])+10*r/2,y:Number(i["-y"])+7}}var a={};Object.entries(e).forEach((function(t){var e=_(t,2),n=e[0],o=e[1];vv.includes(n)||(a[n]=o)})),a=Ev(a);var s=t["di:waypoint"].map((function(t){return{x:Number(t["-x"]),y:Number(t["-y"])}})),l={id:e["-id"],type:pv.FLOW,pointsList:s,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:a};return n&&(l.text=n),l}var Av=function(){function t(t){var e=t.lf,n=this;this.adapterOut=function(t,e){var o,i,r=g({},n.processAttributes);!function(t,e,n){var o,i=new Map,r=_v(n)(e);r.nodes.forEach((function(e){var n=e["-id"],o=e["-type"],r=e.text,a=e.children,s=v(e,["-id","-type","text","children"]),l={"-id":n};(null==r?void 0:r["-value"])&&(l["-name"]=r["-value"]),s["-json"]&&(l["-json"]=s["-json"]),s["-properties"]&&Object.assign(l,s["-properties"]),a&&(l.children=a),t[o]||(t[o]=[]),t[o].push(l),i.set(n,l)}));var a=r.edges.map((function(t){var e=t["-id"],n=t["-sourceNodeId"],o=t["-targetNodeId"],r=t.text,a=v(t,["-id","-sourceNodeId","-targetNodeId","text"]),s=i.get(o);s["bpmn:incoming"]||(s["bpmn:incoming"]=[]),s["bpmn:incoming"].push(e);var l={"-id":e,"-sourceRef":n,"-targetRef":o};return(null==r?void 0:r["-value"])&&(l["-name"]=r["-value"]),a["-json"]&&(l["-json"]=a["-json"]),a["-properties"]&&Object.assign(l,a["-properties"]),l}));e.edges.forEach((function(t){var e=t.sourceNodeId,n=t.id,o=i.get(e);o["bpmn:outgoing"]||(o["bpmn:outgoing"]=[]),o["bpmn:outgoing"].push(n)})),null===(o=t["bpmn:subProcess"])||void 0===o||o.forEach((function(e){var n={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},o=[];e.children.forEach((function(o){var r,a=i.get(o["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach((function(t){a[t]&&a[t].forEach((function(e){n[t].add(e)}))}));var s=null===(r=t[o["-type"]])||void 0===r?void 0:r.findIndex((function(t){return t["-id"]===o["-id"]}));s>=0&&t[o["-type"]].splice(s,1),i.delete(o["-id"]),e[o["-type"]]||(e[o["-type"]]=[]),e[o["-type"]].push(a)}));var r=n["bpmn:incoming"];n["bpmn:outgoing"].forEach((function(t){r.has(t)&&o.push(t)}));for(var s,l=function(t){var n=a.findIndex((function(e){return e["-id"]===o[t]}));n>=0?(e["bpmn:sequenceFlow"]||(e["bpmn:sequenceFlow"]=[]),e["bpmn:sequenceFlow"].push(a[n]),a.splice(n,1)):t++,s=t},u=0;u<o.length;)l(u),u=s;delete e.children})),t[pv.FLOW]=a}(r,t,e);var a={"-id":"BPMNPlane_1","-bpmnElement":r["-id"]};wv(a,t);var s=n.definitionAttributes;s["bpmn:process"]=r,s["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":a};var l={"bpmn:definitions":s};if(null===(o=null==e?void 0:e.mapping)||void 0===o?void 0:o.out){var u=null===(i=null==e?void 0:e.mapping)||void 0===i?void 0:i.out,c=function(t){Array.isArray(t)&&t.forEach((function(t){return c(t)})),"object"==typeof t&&Object.keys(t).forEach((function(e){var n;(n=u[e])?(t[n]=pn.cloneDeep(t[e]),delete t[e],c(t[n])):c(t[e])}))};c(l)}return l},this.adapterIn=function(t,e){if(t)return Cv(t,e)},e.adapterIn=this.adapterIn,e.adapterOut=this.adapterOut,this.processAttributes={"-isExecutable":"true","-id":"Process"},this.definitionAttributes={"-id":"Definitions","-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.10"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();Av.shapeConfigMap.set(pv.START,{width:Gg,height:Ug}),Av.shapeConfigMap.set(pv.END,{width:Xg,height:Vg}),Av.shapeConfigMap.set(pv.INTERMEDIATE_CATCH,{width:Kg,height:Zg}),Av.shapeConfigMap.set(pv.INTERMEDIATE_THROW,{width:Kg,height:Zg}),Av.shapeConfigMap.set(pv.BOUNDARY,{width:Yg,height:qg}),Av.shapeConfigMap.set(pv.PARALLEL_GATEWAY,{width:$g,height:Jg}),Av.shapeConfigMap.set(pv.INCLUSIVE_GATEWAY,{width:Qg,height:tv}),Av.shapeConfigMap.set(pv.EXCLUSIVE_GATEWAY,{width:ev,height:nv}),Av.shapeConfigMap.set(pv.SYSTEM,{width:ov,height:iv}),Av.shapeConfigMap.set(pv.USER,{width:rv,height:av}),Av.shapeConfigMap.set(pv.SUBPROCESS,{width:sv,height:lv});var Mv=function(t){function e(e){var n=t.call(this,e)||this;n.adapterXmlIn=function(t){var e,o=(e=t,(new uv.ObjTree).parseXML(e));return n.adapterIn(o,n.props)},n.adapterXmlOut=function(t){return function(t){var e="";for(var n in t)e+=gv(t[n],n,0);return e}(n.adapterOut(t,n.props))};var o=e.lf,i=e.props;return o.adapterIn=n.adapterXmlIn,o.adapterOut=n.adapterXmlOut,n.props=i,n}return f(e,t),e.pluginName="BPMNAdapter",e}(Av),Ov={SEQUENCE_FLOW:1,START_EVENT:2,END_EVENT:3,USER_TASK:4,EXCLUSIVE_GATEWAY:6},Pv={1:"bpmn:sequenceFlow",2:"bpmn:startEvent",3:"bpmn:endEvent",4:"bpmn:userTask",6:"bpmn:exclusiveGateway"};function kv(t){switch(t){case"bpmn:sequenceFlow":return Ov.SEQUENCE_FLOW;case"bpmn:startEvent":return Ov.START_EVENT;case"bpmn:endEvent":return Ov.END_EVENT;case"bpmn:userTask":return Ov.USER_TASK;case"bpmn:exclusiveGateway":return Ov.EXCLUSIVE_GATEWAY;default:return t}}var Rv,Dv,Lv,Iv=[],jv=Of,Bv=jv.__b,Hv=jv.__r,Fv=jv.diffed,zv=jv.__c,Wv=jv.unmount,Gv=jv.__;function Uv(){for(var t;t=Iv.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Yv),t.__H.__h.forEach(qv),t.__H.__h=[]}catch(e){t.__H.__h=[],jv.__e(e,t.__v)}}jv.__b=function(t){Rv=null,Bv&&Bv(t)},jv.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Gv&&Gv(t,e)},jv.__r=function(t){Hv&&Hv(t);var e=(Rv=t.__c).__H;e&&(Dv===Rv?(e.__h=[],Rv.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.i=t.__N=void 0}))):(e.__h.forEach(Yv),e.__h.forEach(qv),e.__h=[])),Dv=Rv},jv.diffed=function(t){Fv&&Fv(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Iv.push(e)&&Lv===jv.requestAnimationFrame||((Lv=jv.requestAnimationFrame)||Vv)(Uv)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.i=void 0}))),Dv=Rv=null},jv.__c=function(t,e){e.some((function(t){try{t.__h.forEach(Yv),t.__h=t.__h.filter((function(t){return!t.__||qv(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],jv.__e(n,t.__v)}})),zv&&zv(t,e)},jv.unmount=function(t){Wv&&Wv(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{Yv(t)}catch(t){e=t}})),n.__H=void 0,e&&jv.__e(e,n.__v))};var Xv="function"==typeof requestAnimationFrame;function Vv(t){var e,n=function(){clearTimeout(o),Xv&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,100);Xv&&(e=requestAnimationFrame(n))}function Yv(t){var e=Rv,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Rv=e}function qv(t){var e=Rv;t.__c=t.__(),Rv=e}function Kv(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var o in e)if("__source"!==o&&t[o]!==e[o])return!0;return!1}function Zv(t,e){this.props=t,this.context=e}(Zv.prototype=new qf).isPureReactComponent=!0,Zv.prototype.shouldComponentUpdate=function(t,e){return Kv(this.props,t)||Kv(this.state,e)};var $v=Of.__b;Of.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),$v&&$v(t)};var Jv=Of.__e;Of.__e=function(t,e,n,o){if(t.then)for(var i,r=e;r=r.__;)if((i=r.__c)&&i.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),i.__c(t,e);Jv(t,e,n,o)};var Qv=Of.unmount;function ty(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),t.__c.__H=null),null!=(t=function(t,e){for(var n in e)t[n]=e[n];return t}({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return ty(t,e,n)}))),t}function ey(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return ey(t,e,n)})),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function ny(){this.__u=0,this.t=null,this.__b=null}function oy(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function iy(){this.u=null,this.o=null}Of.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),Qv&&Qv(t)},(ny.prototype=new qf).__c=function(t,e){var n=e.__c,o=this;null==o.t&&(o.t=[]),o.t.push(n);var i=oy(o.__v),r=!1,a=function(){r||(r=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(! --o.__u){if(o.state.__a){var t=o.state.__a;o.__v.__k[0]=ey(t,t.__c.__P,t.__c.__O)}var e;for(o.setState({__a:o.__b=null});e=o.t.pop();)e.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(a,a)},ny.prototype.componentWillUnmount=function(){this.t=[]},ny.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=ty(this.__b,n,o.__O=o.__P)}this.__b=null}var i=e.__a&&Xf(Yf,null,t.fallback);return i&&(i.__u&=-33),[Xf(Yf,null,e.__a?null:t.children),i]};var ry=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};(iy.prototype=new qf).__a=function(t){var e=this,n=oy(e.__v),o=e.o.get(t);return o[0]++,function(i){var r=function(){e.props.revealOrder?(o.push(i),ry(e,t,o)):i()};n?n(r):r()}},iy.prototype.render=function(t){this.u=null,this.o=new Map;var e=ng(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},iy.prototype.componentDidUpdate=iy.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){ry(t,n,e)}))};var ay="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,sy=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,ly=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,uy=/[A-Z0-9]/g,cy="undefined"!=typeof document,dy=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(t)};qf.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(qf.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var hy=Of.event;function py(){}function fy(){return this.cancelBubble}function gy(){return this.defaultPrevented}Of.event=function(t){return hy&&(t=hy(t)),t.persist=py,t.isPropagationStopped=fy,t.isDefaultPrevented=gy,t.nativeEvent=t};var vy={enumerable:!1,configurable:!0,get:function(){return this.class}},yy=Of.vnode;Of.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,o={};for(var i in e){var r=e[i];if(!("value"===i&&"defaultValue"in e&&null==r||cy&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var a=i.toLowerCase();"defaultValue"===i&&"value"in e&&null==e.value?i="value":"download"===i&&!0===r?r="":"translate"===a&&"no"===r?r=!1:"ondoubleclick"===a?i="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||dy(e.type)?"onfocus"===a?i="onfocusin":"onblur"===a?i="onfocusout":ly.test(i)?i=a:-1===n.indexOf("-")&&sy.test(i)?i=i.replace(uy,"-$&").toLowerCase():null===r&&(r=void 0):a=i="oninput","oninput"===a&&o[i=a]&&(i="oninputCapture"),o[i]=r}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=ng(e.children).forEach((function(t){t.props.selected=-1!=o.value.indexOf(t.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=ng(e.children).forEach((function(t){t.props.selected=o.multiple?-1!=o.defaultValue.indexOf(t.props.value):o.defaultValue==t.props.value}))),e.class&&!e.className?(o.class=e.class,Object.defineProperty(o,"className",vy)):(e.className&&!e.class||e.class&&e.className)&&(o.class=o.className=e.className),t.props=o}(t),t.$$typeof=ay,yy&&yy(t)};var my=Of.__r;Of.__r=function(t){my&&my(t),t.__c};var by=Of.diffed;Of.diffed=function(t){by&&by(t);var e=t.props,n=t.__e;null!=n&&"textarea"===t.type&&"value"in e&&e.value!==n.value&&(n.value=null==e.value?"":e.value)};var xy,_y,Ey,wy,Sy,Cy,Ny,Ty=200;!function(t){t[t.DEFAULT=1]="DEFAULT",t[t.TEXT_EDIT=2]="TEXT_EDIT",t[t.SHOW_MENU=3]="SHOW_MENU",t[t.ALLOW_CONNECT=4]="ALLOW_CONNECT",t[t.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"}(xy||(xy={})),function(t){t.NODE="node",t.EDGE="edge",t.GRAPH="graph"}(_y||(_y={})),function(t){t.NODE="node",t.CIRCLE_NODE="circle-node",t.POLYGON_NODE="polygon-node",t.RECT_NODE="rect-node",t.TEXT_NODE="text-node",t.ELLIPSE_NODE="ellipse-node",t.DIAMOND_NODE="diamond-node",t.HTML_NODE="html-node",t.CUSTOM_HTML_NODE="custom-html-node",t.EDGE="edge",t.LINE_EDGE="line-edge",t.POLYLINE_EDGE="polyline-edge",t.BEZIER_EDGE="bezier-edge",t.GRAPH="graph"}(Ey||(Ey={})),function(t){t.ELEMENT_CLICK="element:click",t.NODE_ADD="node:add",t.NODE_DELETE="node:delete",t.NODE_CLICK="node:click",t.NODE_DBCLICK="node:dbclick",t.NODE_GROUP_COPY="node:group-copy-add",t.NODE_DND_ADD="node:dnd-add",t.NODE_DND_DRAG="node:dnd-drag",t.NODE_MOUSEDOWN="node:mousedown",t.NODE_DRAGSTART="node:dragstart",t.NODE_DRAG="node:drag",t.NODE_DROP="node:drop",t.NODE_MOUSEUP="node:mouseup",t.NODE_MOUSEMOVE="node:mousemove",t.NODE_MOUSEENTER="node:mouseenter",t.NODE_MOUSELEAVE="node:mouseleave",t.NODE_CONTEXTMENU="node:contextmenu",t.NODE_ROTATE="node:rotate",t.NODE_RESIZE="node:resize",t.NODE_PROPERTIES_CHANGE="node:properties-change",t.NODE_PROPERTIES_DELETE="node:properties-delete",t.EDGE_ADD="edge:add",t.EDGE_DELETE="edge:delete",t.EDGE_CLICK="edge:click",t.EDGE_DBCLICK="edge:dbclick",t.EDGE_MOUSEENTER="edge:mouseenter",t.EDGE_MOUSELEAVE="edge:mouseleave",t.EDGE_CONTEXTMENU="edge:contextmenu",t.EDGE_ADJUST="edge:adjust",t.EDGE_EXCHANGE_NODE="edge:exchange-node",t.ANCHOR_DRAGSTART="anchor:dragstart",t.ANCHOR_DRAG="anchor:drag",t.ANCHOR_DROP="anchor:drop",t.ANCHOR_DRAGEND="anchor:dragend",t.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",t.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",t.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",t.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",t.ADJUST_POINT_DRAG="adjustPoint:drag",t.ADJUST_POINT_DROP="adjustPoint:drop",t.ADJUST_POINT_DRAGEND="adjustPoint:dragend",t.BLANK_MOUSEDOWN="blank:mousedown",t.BLANK_DRAGSTART="blank:dragstart",t.BLANK_DRAG="blank:drag",t.BLANK_DROP="blank:drop",t.BLANK_MOUSEMOVE="blank:mousemove",t.BLANK_MOUSEUP="blank:mouseup",t.BLANK_CLICK="blank:click",t.BLANK_CONTEXTMENU="blank:contextmenu",t.SELECTION_MOUSEDOWN="selection:mousedown",t.SELECTION_DRAGSTART="selection:dragstart",t.SELECTION_DRAG="selection:drag",t.SELECTION_DROP="selection:drop",t.SELECTION_MOUSEMOVE="selection:mousemove",t.SELECTION_MOUSEUP="selection:mouseup",t.SELECTION_CONTEXTMENU="selection:contextmenu",t.CONNECTION_NOT_ALLOWED="connection:not-allowed",t.TEXT_MOUSEDOWN="text:mousedown",t.TEXT_DRAGSTART="text:dragstart",t.TEXT_DRAG="text:drag",t.TEXT_DROP="text:drop",t.TEXT_CLICK="text:click",t.TEXT_DBCLICK="text:dbclick",t.TEXT_BLUR="text:blur",t.TEXT_MOUSEMOVE="text:mousemove",t.TEXT_MOUSEUP="text:mouseup",t.TEXT_FOCUS="text:focus",t.TEXT_ADD="text:add",t.TEXT_UPDATE="text:update",t.TEXT_CLEAR="text:clear",t.LABEL_MOUSEDOWN="label:mousedown",t.LABEL_DRAGSTART="label:dragstart",t.LABEL_DRAG="label:drag",t.LABEL_DROP="label:drop",t.LABEL_CLICK="label:click",t.LABEL_DBCLICK="label:dbclick",t.LABEL_BLUR="label:blur",t.LABEL_MOUSEMOVE="label:mousemove",t.LABEL_MOUSEUP="label:mouseup",t.LABEL_FOCUS="label:focus",t.LABEL_ADD="label:add",t.LABEL_UPDATE="label:update",t.LABEL_CLEAR="label:clear",t.LABEL_DELETE="label:delete",t.LABEL_SHOULD_ADD="label:should-add",t.LABEL_BATCH_ADD="label:batch-add",t.LABEL_SHOULD_UPDATE="label:should-update",t.LABEL_SHOULD_DELETE="label:should-delete",t.LABEL_BATCH_DELETE="label:batch-delete",t.LABEL_NOT_ALLOWED_ADD="label:not-allowed-add",t.HISTORY_CHANGE="history:change",t.GRAPH_TRANSFORM="graph:transform",t.GRAPH_RENDERED="graph:rendered",t.GRAPH_UPDATED="graph:updated"}(wy||(wy={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.INCREASE=1]="INCREASE"}(Sy||(Sy={})),function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(Cy||(Cy={})),function(t){t.TEXT="text",t.LABEL="label"}(Ny||(Ny={}));var Ay={node:!1,edge:!1},My={node:!0,edge:!0};function Oy(t){try{return JSON.parse(JSON.stringify(t))}catch(e){return t}}Bi(window,"navigator.userAgent","").match(/MSIE|Trident/);var Py=function(){function t(t){var e=t.onDragStart,n=void 0===e?on:e,o=t.onDragging,i=void 0===o?on:o,r=t.onDragEnd,a=void 0===r?on:r,s=t.eventType,l=void 0===s?"":s,u=t.eventCenter,c=t.step,d=void 0===c?1:c,h=t.isStopPropagation,p=void 0===h||h,f=t.model,g=t.data,v=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(t){var e,n,o=null===window||void 0===window?void 0:window.document;if(0===t.button){v.isStopPropagation&&t.stopPropagation(),v.isStartDragging=!0,v.startX=t.clientX,v.startY=t.clientY,o.addEventListener("mousemove",v.handleMouseMove,!1),o.addEventListener("mouseup",v.handleMouseUp,!1);var i=null===(e=v.model)||void 0===e?void 0:e.getData();null===(n=v.eventCenter)||void 0===n||n.emit(wy["".concat(v.eventType,"_MOUSEDOWN")],{e:t,data:v.data||i}),v.startTime=(new Date).getTime()}},this.handleMouseMove=function(t){var e,n;if(v.isStopPropagation&&t.stopPropagation(),v.isStartDragging&&(v.sumDeltaX+=t.clientX-v.startX,v.sumDeltaY+=t.clientY-v.startY,v.startX=t.clientX,v.startY=t.clientY,v.step<=1||Math.abs(v.sumDeltaX)>v.step||Math.abs(v.sumDeltaY)>v.step)){var o=v.sumDeltaX%v.step,i=v.sumDeltaY%v.step,r=v.sumDeltaX-o,a=v.sumDeltaY-i;v.sumDeltaX=o,v.sumDeltaY=i;var s=null===(e=v.model)||void 0===e?void 0:e.getData();v.isDragging||(null===(n=v.eventCenter)||void 0===n||n.emit(wy["".concat(v.eventType,"_DRAGSTART")],{e:t,data:v.data||s}),v.onDragStart({event:t})),v.isDragging=!0,Promise.resolve().then((function(){var e,n;v.onDragging({deltaX:r,deltaY:a,event:t}),null===(e=v.eventCenter)||void 0===e||e.emit(wy["".concat(v.eventType,"_MOUSEMOVE")],{deltaX:r,deltaY:a,e:t,data:v.data||s}),null===(n=v.eventCenter)||void 0===n||n.emit(wy["".concat(v.eventType,"_DRAG")],{e:t,data:v.data||s})}))}},this.handleMouseUp=function(t){var e=window.document;v.isStartDragging=!1,v.isStopPropagation&&t.stopPropagation(),Promise.resolve().then((function(){var n,o,i;e.removeEventListener("mousemove",v.handleMouseMove,!1),e.removeEventListener("mouseup",v.handleMouseUp,!1);var r=null===(n=v.model)||void 0===n?void 0:n.getData();null===(o=v.eventCenter)||void 0===o||o.emit(wy["".concat(v.eventType,"_MOUSEUP")],{e:t,data:v.data||r}),v.isDragging&&(v.isDragging=!1,v.onDragEnd({event:t}),null===(i=v.eventCenter)||void 0===i||i.emit(wy["".concat(v.eventType,"_DROP")],{e:t,data:v.data||r}))}))},this.cancelDrag=function(){var t=null===window||void 0===window?void 0:window.document;t.removeEventListener("mousemove",v.handleMouseMove,!1),t.removeEventListener("mouseup",v.handleMouseUp,!1),v.onDragEnd({event:void 0}),v.isDragging=!1},this.onDragStart=n,this.onDragging=i,this.onDragEnd=a,this.step=d,this.isStopPropagation=p,this.eventType=l,this.eventCenter=u,this.model=f,this.data=g}return t.prototype.setStep=function(t){this.step=t},t.prototype.setModel=function(t){this.model=t},t}(),ky=function(t,e,n){var o=t.x,i=t.y,r=e.x,a=e.y,s=n.x,l=n.y,u=(l-a)/(s-r),c=a-u*r;return o>=r&&o<=s&&i>=a&&i<=l&&Math.abs(i-u*o+c)<Number.EPSILON},Ry="An invariant failed, however the error is obfuscated because this is a production build.",Dy=[];Object.freeze(Dy);var Ly={};function Iy(){return++ib.mobxGuid}function jy(t){throw By(!1,t),"X"}function By(t,e){if(!t)throw new Error("[mobx] "+(e||Ry))}function Hy(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}Object.freeze(Ly);var Fy=function(){};function zy(t){return null!==t&&"object"==typeof t}function Wy(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function Gy(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Uy(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(t){return zy(t)&&!0===t[n]}}function Xy(t){return t instanceof Map}function Vy(t){return t instanceof Set}function Yy(t){var e=new Set;for(var n in t)e.add(n);return Object.getOwnPropertySymbols(t).forEach((function(n){Object.getOwnPropertyDescriptor(t,n).enumerable&&e.add(n)})),Array.from(e)}function qy(t){return t&&t.toString?t.toString():new String(t).toString()}function Ky(t){return null===t?null:"object"==typeof t?""+t:t}var Zy="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,$y=Symbol("mobx administration"),Jy=function(){function t(t){void 0===t&&(t="Atom@"+Iy()),this.name=t,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=Nm.NOT_TRACKING}return t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(t){return t()}))},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(t){return t()}))},t.prototype.reportObserved=function(){return cb(this)},t.prototype.reportChanged=function(){lb(),function(t){if(t.lowestObserverState===Nm.STALE)return;t.lowestObserverState=Nm.STALE,t.observers.forEach((function(e){e.dependenciesState===Nm.UP_TO_DATE&&(e.isTracing!==Tm.NONE&&db(e,t),e.onBecomeStale()),e.dependenciesState=Nm.STALE}))}(this),ub()},t.prototype.toString=function(){return this.name},t}(),Qy=Uy("Atom",Jy);function tm(t,e,n){void 0===e&&(e=Fy),void 0===n&&(n=Fy);var o,i=new Jy(t);return e!==Fy&&Nb("onBecomeObserved",i,e,o),n!==Fy&&Cb(i,n),i}var em={identity:function(t,e){return t===e},structural:function(t,e){return vx(t,e)},default:function(t,e){return Object.is(t,e)},shallow:function(t,e){return vx(t,e,1)}},nm=function(t,e){return nm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},nm(t,e)};
|
|
12
|
-
/*! *****************************************************************************
|
|
13
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
14
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
15
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
16
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
-
|
|
18
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
19
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
20
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
21
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
22
|
-
|
|
23
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
24
|
-
and limitations under the License.
|
|
25
|
-
***************************************************************************** */var om=function(){return om=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},om.apply(this,arguments)};function im(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function rm(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function am(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(rm(arguments[e]));return t}var sm=Symbol("mobx did run lazy initializers"),lm=Symbol("mobx pending decorators"),um={},cm={};function dm(t){var e,n;if(!0!==t[sm]){var o=t[lm];if(o){Gy(t,sm,!0);var i=am(Object.getOwnPropertySymbols(o),Object.keys(o));try{for(var r=im(i),a=r.next();!a.done;a=r.next()){var s=o[a.value];s.propertyCreator(t,s.prop,s.descriptor,s.decoratorTarget,s.decoratorArguments)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}}}function hm(t,e){return function(){var n,o,i=function(o,i,r,a){if(!0===a)return e(o,i,r,o,n),null;if(!Object.prototype.hasOwnProperty.call(o,lm)){var s=o[lm];Gy(o,lm,om({},s))}return o[lm][i]={prop:i,propertyCreator:e,descriptor:r,decoratorTarget:o,decoratorArguments:n},function(t,e){var n=e?um:cm;return n[t]||(n[t]={configurable:!0,enumerable:e,get:function(){return dm(this),this[t]},set:function(e){dm(this),this[t]=e}})}(i,t)};return(2===(o=arguments).length||3===o.length)&&("string"==typeof o[1]||"symbol"==typeof o[1])||4===o.length&&!0===o[3]?(n=Dy,i.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),i)}}function pm(t,e,n){return Pb(t)?t:Array.isArray(t)?Sm.array(t,{name:n}):Wy(t)?Sm.object(t,void 0,{name:n}):Xy(t)?Sm.map(t,{name:n}):Vy(t)?Sm.set(t,{name:n}):t}function fm(t){return t}function gm(t){By(t);var e=hm(!0,(function(e,n,o,i,r){var a=o?o.initializer?o.initializer.call(e):o.value:void 0;sx(e).addObservableProp(n,a,t)})),n=("undefined"!=typeof process&&process.env,e);return n.enhancer=t,n}var vm={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function ym(t){return null==t?vm:"string"==typeof t?{name:t,deep:!0,proxy:!0}:t}Object.freeze(vm);var mm=gm(pm),bm=gm((function(t,e,n){return null==t||hx(t)||Jb(t)||nx(t)||rx(t)?t:Array.isArray(t)?Sm.array(t,{name:n,deep:!1}):Wy(t)?Sm.object(t,void 0,{name:n,deep:!1}):Xy(t)?Sm.map(t,{name:n,deep:!1}):Vy(t)?Sm.set(t,{name:n,deep:!1}):jy(!1)})),xm=gm(fm),_m=gm((function(t,e,n){return vx(t,e)?e:t}));function Em(t){return t.defaultDecorator?t.defaultDecorator.enhancer:!1===t.deep?fm:pm}var wm={box:function(t,e){arguments.length>2&&Cm("box");var n=ym(e);return new Km(t,Em(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&Cm("array");var n=ym(e);return function(t,e,n,o){void 0===n&&(n="ObservableArray@"+Iy());void 0===o&&(o=!1);var i=new qb(n,e,o);!function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}(i.values,$y,i);var r=new Proxy(i.values,Yb);if(i.proxy=r,t&&t.length){var a=Ym(!0);i.spliceWithArray(0,0,t),qm(a)}return r}(t,Em(n),n.name)},map:function(t,e){arguments.length>2&&Cm("map");var n=ym(e);return new ex(t,Em(n),n.name)},set:function(t,e){arguments.length>2&&Cm("set");var n=ym(e);return new ix(t,Em(n),n.name)},object:function(t,e,n){"string"==typeof arguments[1]&&Cm("object");var o=ym(n);if(!1===o.proxy)return Tb({},t,e,o);var i=Ab(o),r=function(t){var e=new Proxy(t,Fb);return t[$y].proxy=e,e}(Tb({},void 0,void 0,o));return Mb(r,t,e,i),r},ref:xm,shallow:bm,deep:mm,struct:_m},Sm=function(t,e,n){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return mm.apply(null,arguments);if(Pb(t))return t;var o=Wy(t)?Sm.object(t,e,n):Array.isArray(t)?Sm.array(t,e):Xy(t)?Sm.map(t,e):Vy(t)?Sm.set(t,e):t;if(o!==t)return o;jy(!1)};function Cm(t){jy("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}Object.keys(wm).forEach((function(t){return Sm[t]=wm[t]}));var Nm,Tm,Am=hm(!1,(function(t,e,n,o,i){var r=n.get,a=n.set,s=i[0]||{};sx(t).addComputedProp(t,e,om({get:r,set:a,context:t},s))})),Mm=Am({equals:em.structural}),Om=function(t,e,n){if("string"==typeof e)return Am.apply(null,arguments);if(null!==t&&"object"==typeof t&&1===arguments.length)return Am.apply(null,arguments);var o="object"==typeof e?e:{};return o.get=t,o.set="function"==typeof e?e:o.set,o.name=o.name||t.name||"",new $m(o)};Om.struct=Mm,function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"}(Nm||(Nm={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(Tm||(Tm={}));var Pm=function(t){this.cause=t};function km(t){return t instanceof Pm}function Rm(t){switch(t.dependenciesState){case Nm.UP_TO_DATE:return!1;case Nm.NOT_TRACKING:case Nm.STALE:return!0;case Nm.POSSIBLY_STALE:for(var e=Fm(!0),n=Bm(),o=t.observing,i=o.length,r=0;r<i;r++){var a=o[r];if(Jm(a)){if(ib.disableErrorBoundaries)a.get();else try{a.get()}catch(t){return Hm(n),zm(e),!0}if(t.dependenciesState===Nm.STALE)return Hm(n),zm(e),!0}}return Wm(t),Hm(n),zm(e),!1}}function Dm(t){var e=t.observers.size>0;ib.computationDepth>0&&e&&jy(!1),ib.allowStateChanges||!e&&"strict"!==ib.enforceActions||jy(!1)}function Lm(t,e,n){var o=Fm(!0);Wm(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++ib.runId;var i,r=ib.trackingDerivation;if(ib.trackingDerivation=t,!0===ib.disableErrorBoundaries)i=e.call(n);else try{i=e.call(n)}catch(t){i=new Pm(t)}return ib.trackingDerivation=r,function(t){for(var e=t.observing,n=t.observing=t.newObserving,o=Nm.UP_TO_DATE,i=0,r=t.unboundDepsCount,a=0;a<r;a++){0===(s=n[a]).diffValue&&(s.diffValue=1,i!==a&&(n[i]=s),i++),s.dependenciesState>o&&(o=s.dependenciesState)}n.length=i,t.newObserving=null,r=e.length;for(;r--;){0===(s=e[r]).diffValue&&ab(s,t),s.diffValue=0}for(;i--;){var s;1===(s=n[i]).diffValue&&(s.diffValue=0,rb(s,t))}o!==Nm.UP_TO_DATE&&(t.dependenciesState=o,t.onBecomeStale())}(t),zm(o),i}function Im(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)ab(e[n],t);t.dependenciesState=Nm.NOT_TRACKING}function jm(t){var e=Bm();try{return t()}finally{Hm(e)}}function Bm(){var t=ib.trackingDerivation;return ib.trackingDerivation=null,t}function Hm(t){ib.trackingDerivation=t}function Fm(t){var e=ib.allowStateReads;return ib.allowStateReads=t,e}function zm(t){ib.allowStateReads=t}function Wm(t){if(t.dependenciesState!==Nm.UP_TO_DATE){t.dependenciesState=Nm.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=Nm.UP_TO_DATE}}var Gm=0,Um=1,Xm=Object.getOwnPropertyDescriptor((function(){}),"name");function Vm(t,e,n){var o=function(){return function(t,e,n,o){var i=function(){var t=!1,e=0,n=Bm();lb();var o=Ym(!0),i=Fm(!0),r={prevDerivation:n,prevAllowStateChanges:o,prevAllowStateReads:i,notifySpy:t,startTime:e,actionId:Um++,parentActionId:Gm};return Gm=r.actionId,r}();try{return e.apply(n,o)}catch(t){throw i.error=t,t}finally{!function(t){Gm!==t.actionId&&jy("invalid action stack. did you forget to finish an action?");Gm=t.parentActionId,void 0!==t.error&&(ib.suppressReactionErrors=!0);qm(t.prevAllowStateChanges),zm(t.prevAllowStateReads),ub(),Hm(t.prevDerivation),t.notifySpy&&!1;ib.suppressReactionErrors=!1}(i)}}(0,e,n||this,arguments)};return o.isMobxAction=!0,o}function Ym(t){var e=ib.allowStateChanges;return ib.allowStateChanges=t,e}function qm(t){ib.allowStateChanges=t}Xm&&Xm.configurable;var Km=function(t){function e(e,n,o,i,r){void 0===o&&(o="ObservableValue@"+Iy()),void 0===i&&(i=!0),void 0===r&&(r=em.default);var a=t.call(this,o)||this;return a.enhancer=n,a.name=o,a.equals=r,a.hasUnreportedChange=!1,a.value=n(e,void 0,o),a}return function(t,e){function n(){this.constructor=t}nm(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.prototype.set=function(t){this.value;if((t=this.prepareNewValue(t))!==ib.UNCHANGED){false,this.setNewValue(t)}},e.prototype.prepareNewValue=function(t){if(Dm(this),zb(this)){var e=Gb(this,{object:this,type:"update",newValue:t});if(!e)return ib.UNCHANGED;t=e.newValue}return t=this.enhancer(t,this.value,this.name),this.equals(this.value,t)?ib.UNCHANGED:t},e.prototype.setNewValue=function(t){var e=this.value;this.value=t,this.reportChanged(),Ub(this)&&Vb(this,{type:"update",object:this,newValue:t,oldValue:e})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(t){return Wb(this,t)},e.prototype.observe=function(t,e){return e&&t({object:this,type:"update",newValue:this.value,oldValue:void 0}),Xb(this,t)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return Ky(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(Jy),Zm=Uy("ObservableValue",Km),$m=function(){function t(t){this.dependenciesState=Nm.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=Nm.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+Iy(),this.value=new Pm(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Tm.NONE,By(t.get,"missing option for computed: get"),this.derivation=t.get,this.name=t.name||"ComputedValue@"+Iy(),t.set&&(this.setter=Vm(this.name,t.set)),this.equals=t.equals||(t.compareStructural||t.struct?em.structural:em.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState!==Nm.UP_TO_DATE)return;t.lowestObserverState=Nm.POSSIBLY_STALE,t.observers.forEach((function(e){e.dependenciesState===Nm.UP_TO_DATE&&(e.dependenciesState=Nm.POSSIBLY_STALE,e.isTracing!==Tm.NONE&&db(e,t),e.onBecomeStale())}))}(this)},t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(t){return t()}))},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(t){return t()}))},t.prototype.get=function(){this.isComputing&&jy("Cycle detected in computation "+this.name+": "+this.derivation),0!==ib.inBatch||0!==this.observers.size||this.keepAlive?(cb(this),Rm(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState===Nm.STALE)return;t.lowestObserverState=Nm.STALE,t.observers.forEach((function(e){e.dependenciesState===Nm.POSSIBLY_STALE?e.dependenciesState=Nm.STALE:e.dependenciesState===Nm.UP_TO_DATE&&(t.lowestObserverState=Nm.UP_TO_DATE)}))}(this)):Rm(this)&&(this.warnAboutUntrackedRead(),lb(),this.value=this.computeValue(!1),ub());var t=this.value;if(km(t))throw t.cause;return t},t.prototype.peek=function(){var t=this.computeValue(!1);if(km(t))throw t.cause;return t},t.prototype.set=function(t){if(this.setter){By(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,t)}finally{this.isRunningSetter=!1}}else By(!1,!1)},t.prototype.trackAndCompute=function(){var t=this.value,e=this.dependenciesState===Nm.NOT_TRACKING,n=this.computeValue(!0),o=e||km(t)||km(n)||!this.equals(t,n);return o&&(this.value=n),o},t.prototype.computeValue=function(t){var e;if(this.isComputing=!0,ib.computationDepth++,t)e=Lm(this,this.derivation,this.scope);else if(!0===ib.disableErrorBoundaries)e=this.derivation.call(this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new Pm(t)}return ib.computationDepth--,this.isComputing=!1,e},t.prototype.suspend=function(){this.keepAlive||(Im(this),this.value=void 0)},t.prototype.observe=function(t,e){var n=this,o=!0,i=void 0;return function(t,e){void 0===e&&(e=Ly);var n,o=e&&e.name||t.name||"Autorun@"+Iy();if(e.scheduler||e.delay){var i=function(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:Sb}(e),r=!1;n=new pb(o,(function(){r||(r=!0,i((function(){r=!1,n.isDisposed||n.track(a)})))}),e.onError,e.requiresObservable)}else n=new pb(o,(function(){this.track(a)}),e.onError,e.requiresObservable);function a(){t(n)}return n.schedule(),n.getDisposer()}((function(){var r=n.get();if(!o||e){var a=Bm();t({type:"update",object:n,newValue:r,oldValue:i}),Hm(a)}o=!1,i=r}))},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return Ky(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(),Jm=Uy("ComputedValue",$m),Qm=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},tb={};function eb(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:tb}var nb=!0,ob=!1,ib=function(){var t=eb();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(nb=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==(new Qm).version&&(nb=!1),nb?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Qm):(setTimeout((function(){ob||jy("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Qm)}();function rb(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function ab(t,e){t.observers.delete(e),0===t.observers.size&&sb(t)}function sb(t){!1===t.isPendingUnobservation&&(t.isPendingUnobservation=!0,ib.pendingUnobservations.push(t))}function lb(){ib.inBatch++}function ub(){if(0==--ib.inBatch){vb();for(var t=ib.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,0===n.observers.size&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof $m&&n.suspend())}ib.pendingUnobservations=[]}}function cb(t){var e=ib.trackingDerivation;return null!==e?(e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t,t.isBeingObserved||(t.isBeingObserved=!0,t.onBecomeObserved())),!0):(0===t.observers.size&&ib.inBatch>0&&sb(t),!1)}function db(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===Tm.BREAK){var n=[];hb(function(t,e){return Ob(px(t,e))}(t),n,1),new Function("debugger;\n/*\nTracing '"+t.name+"'\n\nYou are entering this break point because derivation '"+t.name+"' is being traced and '"+e.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(t instanceof $m?t.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function hb(t,e,n){e.length>=1e3?e.push("(and many more)"):(e.push(""+new Array(n).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return hb(t,e,n+1)})))}var pb=function(){function t(t,e,n,o){void 0===t&&(t="Reaction@"+Iy()),void 0===o&&(o=!1),this.name=t,this.onInvalidate=e,this.errorHandler=n,this.requiresObservable=o,this.observing=[],this.newObserving=[],this.dependenciesState=Nm.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+Iy(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=Tm.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,ib.pendingReactions.push(this),vb())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(lb(),this._isScheduled=!1,Rm(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(t){this.reportExceptionInDerivation(t)}}ub()}},t.prototype.track=function(t){if(!this.isDisposed){lb(),this._isRunning=!0;var e=Lm(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&Im(this),km(e)&&this.reportExceptionInDerivation(e.cause),ub()}},t.prototype.reportExceptionInDerivation=function(t){var e=this;if(this.errorHandler)this.errorHandler(t,this);else{if(ib.disableErrorBoundaries)throw t;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";ib.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,t),ib.globalReactionErrorHandlers.forEach((function(n){return n(t,e)}))}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(lb(),Im(this),ub()))},t.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t[$y]=this,t},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(t){void 0===t&&(t=!1),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;"boolean"==typeof t[t.length-1]&&(n=t.pop());var o=function(t){switch(t.length){case 0:return ib.trackingDerivation;case 1:return px(t[0]);case 2:return px(t[0],t[1])}}(t);if(!o)return jy(!1);o.isTracing===Tm.NONE&&console.log("[mobx.trace] '"+o.name+"' tracing enabled");o.isTracing=n?Tm.BREAK:Tm.LOG}(this,t)},t}(),fb=100,gb=function(t){return t()};function vb(){ib.inBatch>0||ib.isRunningReactions||gb(yb)}function yb(){ib.isRunningReactions=!0;for(var t=ib.pendingReactions,e=0;t.length>0;){++e===fb&&(console.error("Reaction doesn't converge to a stable state after "+fb+" iterations. Probably there is a cycle in the reactive function: "+t[0]),t.splice(0));for(var n=t.splice(0),o=0,i=n.length;o<i;o++)n[o].runReaction()}ib.isRunningReactions=!1}var mb=Uy("Reaction",pb);function bb(t){var e=gb;gb=function(n){return t((function(){return e(n)}))}}function xb(){jy(!1)}function _b(t){return function(e,n,o){if(o){if(o.value)return{value:Vm(0,o.value),enumerable:!1,configurable:!0,writable:!0};var i=o.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return Vm(0,i.call(this))}}}return function(t){return function(e,n,o){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:function(){},set:function(e){Gy(this,n,Eb(t,e))}})}}(t).apply(this,arguments)}}var Eb=function(t,e,n,o){return 1===arguments.length&&"function"==typeof t?Vm(t.name,t):2===arguments.length&&"function"==typeof e?Vm(0,e):1===arguments.length&&"string"==typeof t?_b(t):!0!==o?_b(e).apply(null,arguments):void Gy(t,e,Vm(t.name,n.value,this))};function wb(t,e,n){Gy(t,e,Vm(0,n.bind(t)))}Eb.bound=function(t,e,n,o){return!0===o?(wb(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return wb(this,e,n.value||n.initializer.call(this)),this[e]},set:xb}:{enumerable:!1,configurable:!0,set:function(t){wb(this,e,t)},get:function(){}}};var Sb=function(t){return t()};function Cb(t,e,n){return Nb("onBecomeUnobserved",t,e,n)}function Nb(t,e,n,o){var i="function"==typeof o?px(e,n):px(e),r="function"==typeof o?o:n,a=t+"Listeners";return i[a]?i[a].add(r):i[a]=new Set([r]),"function"!=typeof i[t]?jy(!1):function(){var t=i[a];t&&(t.delete(r),0===t.size&&delete i[a])}}function Tb(t,e,n,o){var i=Ab(o=ym(o));return dm(t),sx(t,o.name,i.enhancer),e&&Mb(t,e,n,i),t}function Ab(t){return t.defaultDecorator||(!1===t.deep?xm:mm)}function Mb(t,e,n,o){var i,r;lb();try{var a=Zy(e);try{for(var s=im(a),l=s.next();!l.done;l=s.next()){var u=l.value,c=Object.getOwnPropertyDescriptor(e,u);0;var d=n&&u in n?n[u]:c.get?Am:o;0;var h=d(t,u,c,!0);h&&Object.defineProperty(t,u,h)}}catch(t){i={error:t}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}}finally{ub()}}function Ob(t){var e,n,o={name:t.name};return t.observing&&t.observing.length>0&&(o.dependencies=(e=t.observing,n=[],e.forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n).map(Ob)),o}function Pb(t){return 1!==arguments.length&&jy(!1),function(t,e){return null!=t&&(void 0!==e?!!hx(t)&&t[$y].values.has(e):hx(t)||!!t[$y]||Qy(t)||mb(t)||Jm(t))}(t)}function kb(t,e,n){if(2!==arguments.length||rx(t))if(hx(t)){var o=t[$y];o.values.get(e)?o.write(e,n):o.addObservableProp(e,n,o.defaultEnhancer)}else if(nx(t))t.set(e,n);else if(rx(t))t.add(e);else{if(!Jb(t))return jy(!1);"number"!=typeof e&&(e=parseInt(e,10)),By(e>=0,"Not a valid index: '"+e+"'"),lb(),e>=t.length&&(t.length=e+1),t[e]=n,ub()}else{lb();var i=e;try{for(var r in i)kb(t,r,i[r])}finally{ub()}}}var Rb={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Db(t,e,n,o){return o.detectCycles&&t.set(e,n),n}function Lb(t,e,n){if(!e.recurseEverything&&!Pb(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if(Zm(t))return Lb(t.get(),e,n);var o;if(Pb(t)&&(hx(o=t)?o[$y].getKeys():nx(o)||rx(o)?Array.from(o.keys()):Jb(o)?o.map((function(t,e){return e})):jy(!1)),!0===e.detectCycles&&null!==t&&n.has(t))return n.get(t);if(Jb(t)||Array.isArray(t)){var i=Db(n,t,[],e),r=t.map((function(t){return Lb(t,e,n)}));i.length=r.length;for(var a=0,s=r.length;a<s;a++)i[a]=r[a];return i}if(rx(t)||Object.getPrototypeOf(t)===Set.prototype){if(!1===e.exportMapsAsObjects){var l=Db(n,t,new Set,e);return t.forEach((function(t){l.add(Lb(t,e,n))})),l}var u=Db(n,t,[],e);return t.forEach((function(t){u.push(Lb(t,e,n))})),u}if(nx(t)||Object.getPrototypeOf(t)===Map.prototype){if(!1===e.exportMapsAsObjects){var c=Db(n,t,new Map,e);return t.forEach((function(t,o){c.set(o,Lb(t,e,n))})),c}var d=Db(n,t,{},e);return t.forEach((function(t,o){d[o]=Lb(t,e,n)})),d}var h=Db(n,t,{},e);return Yy(t).forEach((function(o){h[o]=Lb(t[o],e,n)})),h}function Ib(t,e){var n;return"boolean"==typeof e&&(e={detectCycles:e}),e||(e=Rb),e.detectCycles=void 0===e.detectCycles?!0===e.recurseEverything:!0===e.detectCycles,e.detectCycles&&(n=new Map),Lb(t,e,n)}function jb(t,e){void 0===e&&(e=void 0),lb();try{return t.apply(e)}finally{ub()}}function Bb(t){return t[$y]}function Hb(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t}var Fb={has:function(t,e){if(e===$y||"constructor"===e||e===sm)return!0;var n=Bb(t);return Hb(e)?n.has(e):e in t},get:function(t,e){if(e===$y||"constructor"===e||e===sm)return t[e];var n=Bb(t),o=n.values.get(e);if(o instanceof Jy){var i=o.get();return void 0===i&&n.has(e),i}return Hb(e)&&n.has(e),t[e]},set:function(t,e,n){return!!Hb(e)&&(kb(t,e,n),!0)},deleteProperty:function(t,e){return!!Hb(e)&&(Bb(t).remove(e),!0)},ownKeys:function(t){return Bb(t).keysAtom.reportObserved(),Reflect.ownKeys(t)},preventExtensions:function(t){return jy("Dynamic observable objects cannot be frozen"),!1}};function zb(t){return void 0!==t.interceptors&&t.interceptors.length>0}function Wb(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),Hy((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function Gb(t,e){var n=Bm();try{for(var o=am(t.interceptors||[]),i=0,r=o.length;i<r&&(By(!(e=o[i](e))||e.type,"Intercept handlers should return nothing or a change object"),e);i++);return e}finally{Hm(n)}}function Ub(t){return void 0!==t.changeListeners&&t.changeListeners.length>0}function Xb(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),Hy((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function Vb(t,e){var n=Bm(),o=t.changeListeners;if(o){for(var i=0,r=(o=o.slice()).length;i<r;i++)o[i](e);Hm(n)}}var Yb={get:function(t,e){return e===$y?t[$y]:"length"===e?t[$y].getArrayLength():"number"==typeof e?Kb.get.call(t,e):"string"!=typeof e||isNaN(e)?Kb.hasOwnProperty(e)?Kb[e]:t[e]:Kb.get.call(t,parseInt(e))},set:function(t,e,n){return"length"===e&&t[$y].setArrayLength(n),"number"==typeof e&&Kb.set.call(t,e,n),"symbol"==typeof e||isNaN(e)?t[e]=n:Kb.set.call(t,parseInt(e),n),!0},preventExtensions:function(t){return jy("Observable arrays cannot be frozen"),!1}};var qb=function(){function t(t,e,n){this.owned=n,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new Jy(t||"ObservableArray@"+Iy()),this.enhancer=function(n,o){return e(n,o,t+"[..]")}}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.dehanceValues=function(t){return void 0!==this.dehancer&&t.length>0?t.map(this.dehancer):t},t.prototype.intercept=function(t){return Wb(this,t)},t.prototype.observe=function(t,e){return void 0===e&&(e=!1),e&&t({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Xb(this,t)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(t){if("number"!=typeof t||t<0)throw new Error("[mobx.array] Out of range: "+t);var e=this.values.length;if(t!==e)if(t>e){for(var n=new Array(t-e),o=0;o<t-e;o++)n[o]=void 0;this.spliceWithArray(e,0,n)}else this.spliceWithArray(t,e-t)},t.prototype.updateArrayLength=function(t,e){if(t!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=e},t.prototype.spliceWithArray=function(t,e,n){var o=this;Dm(this.atom);var i=this.values.length;if(void 0===t?t=0:t>i?t=i:t<0&&(t=Math.max(0,i+t)),e=1===arguments.length?i-t:null==e?0:Math.max(0,Math.min(e,i-t)),void 0===n&&(n=Dy),zb(this)){var r=Gb(this,{object:this.proxy,type:"splice",index:t,removedCount:e,added:n});if(!r)return Dy;e=r.removedCount,n=r.added}n=0===n.length?n:n.map((function(t){return o.enhancer(t,void 0)}));var a=this.spliceItemsIntoValues(t,e,n);return 0===e&&0===n.length||this.notifyArraySplice(t,n,a),this.dehanceValues(a)},t.prototype.spliceItemsIntoValues=function(t,e,n){var o;if(n.length<1e4)return(o=this.values).splice.apply(o,am([t,e],n));var i=this.values.slice(t,t+e);return this.values=this.values.slice(0,t).concat(n,this.values.slice(t+e)),i},t.prototype.notifyArrayChildUpdate=function(t,e,n){var o=!this.owned&&!1,i=Ub(this),r=i||o?{object:this.proxy,type:"update",index:t,newValue:e,oldValue:n}:null;this.atom.reportChanged(),i&&Vb(this,r)},t.prototype.notifyArraySplice=function(t,e,n){var o=!this.owned&&!1,i=Ub(this),r=i||o?{object:this.proxy,type:"splice",index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;this.atom.reportChanged(),i&&Vb(this,r)},t}(),Kb={intercept:function(t){return this[$y].intercept(t)},observe:function(t,e){return void 0===e&&(e=!1),this[$y].observe(t,e)},clear:function(){return this.splice(0)},replace:function(t){var e=this[$y];return e.spliceWithArray(0,e.values.length,t)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var i=this[$y];switch(arguments.length){case 0:return[];case 1:return i.spliceWithArray(t);case 2:return i.spliceWithArray(t,e)}return i.spliceWithArray(t,e,n)},spliceWithArray:function(t,e,n){return this[$y].spliceWithArray(t,e,n)},push:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[$y];return n.spliceWithArray(n.values.length,0,t),n.values.length},pop:function(){return this.splice(Math.max(this[$y].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[$y];return n.spliceWithArray(0,0,t),n.values.length},reverse:function(){var t=this.slice();return t.reverse.apply(t,arguments)},sort:function(t){var e=this.slice();return e.sort.apply(e,arguments)},remove:function(t){var e=this[$y],n=e.dehanceValues(e.values).indexOf(t);return n>-1&&(this.splice(n,1),!0)},get:function(t){var e=this[$y];if(e){if(t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t]);console.warn("[mobx.array] Attempt to read an array index ("+t+") that is out of bounds ("+e.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},set:function(t,e){var n=this[$y],o=n.values;if(t<o.length){Dm(n.atom);var i=o[t];if(zb(n)){var r=Gb(n,{type:"update",object:n.proxy,index:t,newValue:e});if(!r)return;e=r.newValue}(e=n.enhancer(e,i))!==i&&(o[t]=e,n.notifyArrayChildUpdate(t,e,i))}else{if(t!==o.length)throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+o.length);n.spliceWithArray(t,0,[e])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(t){"function"==typeof Array.prototype[t]&&(Kb[t]=function(){var e=this[$y];e.atom.reportObserved();var n=e.dehanceValues(e.values);return n[t].apply(n,arguments)})})),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach((function(t){"function"==typeof Array.prototype[t]&&(Kb[t]=function(e,n){var o=this,i=this[$y];return i.atom.reportObserved(),i.dehanceValues(i.values)[t]((function(t,i){return e.call(n,t,i,o)}),n)})})),["reduce","reduceRight"].forEach((function(t){Kb[t]=function(){var e=this,n=this[$y];n.atom.reportObserved();var o=arguments[0];return arguments[0]=function(t,i,r){return i=n.dehanceValue(i),o(t,i,r,e)},n.values[t].apply(n.values,arguments)}}));var Zb,$b=Uy("ObservableArrayAdministration",qb);function Jb(t){return zy(t)&&$b(t[$y])}var Qb,tx={},ex=function(){function t(t,e,n){if(void 0===e&&(e=pm),void 0===n&&(n="ObservableMap@"+Iy()),this.enhancer=e,this.name=n,this[Zb]=tx,this._keysAtom=tm(this.name+".keys()"),this[Symbol.toStringTag]="Map","function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(t)}return t.prototype._has=function(t){return this._data.has(t)},t.prototype.has=function(t){var e=this;if(!ib.trackingDerivation)return this._has(t);var n=this._hasMap.get(t);if(!n){var o=n=new Km(this._has(t),fm,this.name+"."+qy(t)+"?",!1);this._hasMap.set(t,o),Cb(o,(function(){return e._hasMap.delete(t)}))}return n.get()},t.prototype.set=function(t,e){var n=this._has(t);if(zb(this)){var o=Gb(this,{type:n?"update":"add",object:this,newValue:e,name:t});if(!o)return this;e=o.newValue}return n?this._updateValue(t,e):this._addValue(t,e),this},t.prototype.delete=function(t){var e=this;if((Dm(this._keysAtom),zb(this))&&!(o=Gb(this,{type:"delete",object:this,name:t})))return!1;if(this._has(t)){var n=Ub(this),o=n?{type:"delete",object:this,oldValue:this._data.get(t).value,name:t}:null;return jb((function(){e._keysAtom.reportChanged(),e._updateHasMapEntry(t,!1),e._data.get(t).setNewValue(void 0),e._data.delete(t)})),n&&Vb(this,o),!0}return!1},t.prototype._updateHasMapEntry=function(t,e){var n=this._hasMap.get(t);n&&n.setNewValue(e)},t.prototype._updateValue=function(t,e){var n=this._data.get(t);if((e=n.prepareNewValue(e))!==ib.UNCHANGED){var o=!1,i=Ub(this),r=i?{type:"update",object:this,oldValue:n.value,name:t,newValue:e}:null;o,n.setNewValue(e),i&&Vb(this,r)}},t.prototype._addValue=function(t,e){var n=this;Dm(this._keysAtom),jb((function(){var o=new Km(e,n.enhancer,n.name+"."+qy(t),!1);n._data.set(t,o),e=o.value,n._updateHasMapEntry(t,!0),n._keysAtom.reportChanged()}));var o=Ub(this);o&&Vb(this,o?{type:"add",object:this,name:t,newValue:e}:null)},t.prototype.get=function(t){return this.has(t)?this.dehanceValue(this._data.get(t).get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},t.prototype.values=function(){var t=this,e=this.keys();return xx({next:function(){var n=e.next(),o=n.done,i=n.value;return{done:o,value:o?void 0:t.get(i)}}})},t.prototype.entries=function(){var t=this,e=this.keys();return xx({next:function(){var n=e.next(),o=n.done,i=n.value;return{done:o,value:o?void 0:[i,t.get(i)]}}})},t.prototype[(Zb=$y,Symbol.iterator)]=function(){return this.entries()},t.prototype.forEach=function(t,e){var n,o;try{for(var i=im(this),r=i.next();!r.done;r=i.next()){var a=rm(r.value,2),s=a[0],l=a[1];t.call(e,l,s,this)}}catch(t){n={error:t}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}},t.prototype.merge=function(t){var e=this;return nx(t)&&(t=t.toJS()),jb((function(){var n=Ym(!0);try{Wy(t)?Yy(t).forEach((function(n){return e.set(n,t[n])})):Array.isArray(t)?t.forEach((function(t){var n=rm(t,2),o=n[0],i=n[1];return e.set(o,i)})):Xy(t)?(t.constructor!==Map&&jy("Cannot initialize from classes that inherit from Map: "+t.constructor.name),t.forEach((function(t,n){return e.set(n,t)}))):null!=t&&jy("Cannot initialize map from "+t)}finally{qm(n)}})),this},t.prototype.clear=function(){var t=this;jb((function(){jm((function(){var e,n;try{for(var o=im(t.keys()),i=o.next();!i.done;i=o.next()){var r=i.value;t.delete(r)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}))}))},t.prototype.replace=function(t){var e=this;return jb((function(){var n,o,i,r,a=function(t){if(Xy(t)||nx(t))return t;if(Array.isArray(t))return new Map(t);if(Wy(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}return jy("Cannot convert to map from '"+t+"'")}(t),s=new Map,l=!1;try{for(var u=im(e._data.keys()),c=u.next();!c.done;c=u.next()){var d=c.value;if(!a.has(d))if(e.delete(d))l=!0;else{var h=e._data.get(d);s.set(d,h)}}}catch(t){n={error:t}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}try{for(var p=im(a.entries()),f=p.next();!f.done;f=p.next()){var g=rm(f.value,2),v=(d=g[0],h=g[1],e._data.has(d));if(e.set(d,h),e._data.has(d)){var y=e._data.get(d);s.set(d,y),v||(l=!0)}}}catch(t){i={error:t}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}if(!l)if(e._data.size!==s.size)e._keysAtom.reportChanged();else for(var m=e._data.keys(),b=s.keys(),x=m.next(),_=b.next();!x.done;){if(x.value!==_.value){e._keysAtom.reportChanged();break}x=m.next(),_=b.next()}e._data=s})),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.toPOJO=function(){var t,e,n={};try{for(var o=im(this),i=o.next();!i.done;i=o.next()){var r=rm(i.value,2),a=r[0],s=r[1];n["symbol"==typeof a?a:qy(a)]=s}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n},t.prototype.toJS=function(){return new Map(this)},t.prototype.toJSON=function(){return this.toPOJO()},t.prototype.toString=function(){var t=this;return this.name+"[{ "+Array.from(this.keys()).map((function(e){return qy(e)+": "+t.get(e)})).join(", ")+" }]"},t.prototype.observe=function(t,e){return Xb(this,t)},t.prototype.intercept=function(t){return Wb(this,t)},t}(),nx=Uy("ObservableMap",ex),ox={},ix=function(){function t(t,e,n){if(void 0===e&&(e=pm),void 0===n&&(n="ObservableSet@"+Iy()),this.name=n,this[Qb]=ox,this._data=new Set,this._atom=tm(this.name),this[Symbol.toStringTag]="Set","function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(t,o){return e(t,o,n)},t&&this.replace(t)}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.clear=function(){var t=this;jb((function(){jm((function(){var e,n;try{for(var o=im(t._data.values()),i=o.next();!i.done;i=o.next()){var r=i.value;t.delete(r)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}))}))},t.prototype.forEach=function(t,e){var n,o;try{for(var i=im(this),r=i.next();!r.done;r=i.next()){var a=r.value;t.call(e,a,a,this)}}catch(t){n={error:t}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e=this;if((Dm(this._atom),zb(this))&&!(o=Gb(this,{type:"add",object:this,newValue:t})))return this;if(!this.has(t)){jb((function(){e._data.add(e.enhancer(t,void 0)),e._atom.reportChanged()}));var n=Ub(this),o=n?{type:"add",object:this,newValue:t}:null;n&&Vb(this,o)}return this},t.prototype.delete=function(t){var e=this;if(zb(this)&&!(o=Gb(this,{type:"delete",object:this,oldValue:t})))return!1;if(this.has(t)){var n=Ub(this),o=n?{type:"delete",object:this,oldValue:t}:null;return jb((function(){e._atom.reportChanged(),e._data.delete(t)})),n&&Vb(this,o),!0}return!1},t.prototype.has=function(t){return this._atom.reportObserved(),this._data.has(this.dehanceValue(t))},t.prototype.entries=function(){var t=0,e=Array.from(this.keys()),n=Array.from(this.values());return xx({next:function(){var o=t;return t+=1,o<n.length?{value:[e[o],n[o]],done:!1}:{done:!0}}})},t.prototype.keys=function(){return this.values()},t.prototype.values=function(){this._atom.reportObserved();var t=this,e=0,n=Array.from(this._data.values());return xx({next:function(){return e<n.length?{value:t.dehanceValue(n[e++]),done:!1}:{done:!0}}})},t.prototype.replace=function(t){var e=this;return rx(t)&&(t=t.toJS()),jb((function(){var n=Ym(!0);try{Array.isArray(t)||Vy(t)?(e.clear(),t.forEach((function(t){return e.add(t)}))):null!=t&&jy("Cannot initialize set from "+t)}finally{qm(n)}})),this},t.prototype.observe=function(t,e){return Xb(this,t)},t.prototype.intercept=function(t){return Wb(this,t)},t.prototype.toJS=function(){return new Set(this)},t.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},t.prototype[(Qb=$y,Symbol.iterator)]=function(){return this.values()},t}(),rx=Uy("ObservableSet",ix),ax=function(){function t(t,e,n,o){void 0===e&&(e=new Map),this.target=t,this.values=e,this.name=n,this.defaultEnhancer=o,this.keysAtom=new Jy(n+".keys")}return t.prototype.read=function(t){return this.values.get(t).get()},t.prototype.write=function(t,e){var n=this.target,o=this.values.get(t);if(o instanceof $m)o.set(e);else{if(zb(this)){if(!(a=Gb(this,{type:"update",object:this.proxy||n,name:t,newValue:e})))return;e=a.newValue}if((e=o.prepareNewValue(e))!==ib.UNCHANGED){var i=Ub(this),r=!1,a=i?{type:"update",object:this.proxy||n,oldValue:o.value,name:t,newValue:e}:null;r,o.setNewValue(e),i&&Vb(this,a)}}},t.prototype.has=function(t){var e=this.pendingKeys||(this.pendingKeys=new Map),n=e.get(t);if(n)return n.get();var o=!!this.values.get(t);return n=new Km(o,fm,this.name+"."+qy(t)+"?",!1),e.set(t,n),n.get()},t.prototype.addObservableProp=function(t,e,n){void 0===n&&(n=this.defaultEnhancer);var o=this.target;if(zb(this)){var i=Gb(this,{object:this.proxy||o,name:t,type:"add",newValue:e});if(!i)return;e=i.newValue}var r=new Km(e,n,this.name+"."+qy(t),!1);this.values.set(t,r),e=r.value,Object.defineProperty(o,t,function(t){return lx[t]||(lx[t]={configurable:!0,enumerable:!0,get:function(){return this[$y].read(t)},set:function(e){this[$y].write(t,e)}})}(t)),this.notifyPropertyAddition(t,e)},t.prototype.addComputedProp=function(t,e,n){var o=this.target;n.name=n.name||this.name+"."+qy(e),this.values.set(e,new $m(n)),(t===o||function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||!1!==n.configurable&&!1!==n.writable}(t,e))&&Object.defineProperty(t,e,function(t){return ux[t]||(ux[t]={configurable:ib.computedConfigurable,enumerable:!1,get:function(){return cx(this).read(t)},set:function(e){cx(this).write(t,e)}})}(e))},t.prototype.remove=function(t){if(this.values.has(t)){var e=this.target;if(zb(this))if(!(s=Gb(this,{object:this.proxy||e,name:t,type:"remove"})))return;try{lb();var n=Ub(this),o=!1,i=this.values.get(t),r=i&&i.get();if(i&&i.set(void 0),this.keysAtom.reportChanged(),this.values.delete(t),this.pendingKeys){var a=this.pendingKeys.get(t);a&&a.set(!1)}delete this.target[t];var s=n?{type:"remove",object:this.proxy||e,oldValue:r,name:t}:null;o,n&&Vb(this,s)}finally{ub()}}},t.prototype.illegalAccess=function(t,e){console.warn("Property '"+e+"' of '"+t+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},t.prototype.observe=function(t,e){return Xb(this,t)},t.prototype.intercept=function(t){return Wb(this,t)},t.prototype.notifyPropertyAddition=function(t,e){var n=Ub(this),o=n?{type:"add",object:this.proxy||this.target,name:t,newValue:e}:null;if(n&&Vb(this,o),this.pendingKeys){var i=this.pendingKeys.get(t);i&&i.set(!0)}this.keysAtom.reportChanged()},t.prototype.getKeys=function(){var t,e;this.keysAtom.reportObserved();var n=[];try{for(var o=im(this.values),i=o.next();!i.done;i=o.next()){var r=rm(i.value,2),a=r[0];r[1]instanceof Km&&n.push(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n},t}();function sx(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n=pm),Object.prototype.hasOwnProperty.call(t,$y))return t[$y];Wy(t)||(e=(t.constructor.name||"ObservableObject")+"@"+Iy()),e||(e="ObservableObject@"+Iy());var o=new ax(t,new Map,qy(e),n);return Gy(t,$y,o),o}var lx=Object.create(null),ux=Object.create(null);function cx(t){var e=t[$y];return e||(dm(t),t[$y])}var dx=Uy("ObservableObjectAdministration",ax);function hx(t){return!!zy(t)&&(dm(t),dx(t[$y]))}function px(t,e){if("object"==typeof t&&null!==t){if(Jb(t))return void 0!==e&&jy(!1),t[$y].atom;if(rx(t))return t[$y];if(nx(t)){var n=t;return void 0===e?n._keysAtom:((o=n._data.get(e)||n._hasMap.get(e))||jy(!1),o)}var o;if(dm(t),e&&!t[$y]&&t[e],hx(t))return e?((o=t[$y].values.get(e))||jy(!1),o):jy(!1);if(Qy(t)||Jm(t)||mb(t))return t}else if("function"==typeof t&&mb(t[$y]))return t[$y];return jy(!1)}function fx(t,e){return t||jy("Expecting some object"),void 0!==e?fx(px(t,e)):Qy(t)||Jm(t)||mb(t)||nx(t)||rx(t)?t:(dm(t),t[$y]?t[$y]:void jy(!1))}var gx=Object.prototype.toString;function vx(t,e,n){return void 0===n&&(n=-1),yx(t,e,n)}function yx(t,e,n,o,i){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var r=typeof t;if("function"!==r&&"object"!==r&&"object"!=typeof e)return!1;var a=gx.call(t);if(a!==gx.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++}t=mx(t),e=mx(e);var s="[object Array]"===a;if(!s){if("object"!=typeof t||"object"!=typeof e)return!1;var l=t.constructor,u=e.constructor;if(l!==u&&!("function"==typeof l&&l instanceof l&&"function"==typeof u&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1}if(0===n)return!1;n<0&&(n=-1),i=i||[];for(var c=(o=o||[]).length;c--;)if(o[c]===t)return i[c]===e;if(o.push(t),i.push(e),s){if((c=t.length)!==e.length)return!1;for(;c--;)if(!yx(t[c],e[c],n-1,o,i))return!1}else{var d=Object.keys(t),h=void 0;if(c=d.length,Object.keys(e).length!==c)return!1;for(;c--;)if(!bx(e,h=d[c])||!yx(t[h],e[h],n-1,o,i))return!1}return o.pop(),i.pop(),!0}function mx(t){return Jb(t)?t.slice():Xy(t)||nx(t)||Vy(t)||rx(t)?Array.from(t.entries()):t}function bx(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function xx(t){return t[Symbol.iterator]=_x,t}function _x(){return this}if("undefined"==typeof Proxy||"undefined"==typeof Symbol)throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:function(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}},extras:{getDebugName:function(t,e){return(void 0!==e?px(t,e):hx(t)||nx(t)||rx(t)?fx(t):px(t)).name}},$mobx:$y});var Ex=function(){return Ex=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Ex.apply(this,arguments)},wx=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},Sx=function(){function t(t,e){var n;this.BaseType=_y.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=Ny.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.points="",this.pointsList=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.isAnimation=!1,this.isShowAdjustPoint=!1,this.zIndex=0,this.state=xy.DEFAULT,this.modelType=Ey.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=e,this.properties=null!==(n=t.properties)&&void 0!==n?n:{},this.initEdgeData(t),this.setAttributes()}return t.prototype.initEdgeData=function(t){if(t.properties||(t.properties={}),!t.id){var e=this.graphModel.idGenerator,n=e&&e(t.type),o=this.createId();t.id=o||n||JE()}this.arrowConfig.markerEnd="url(#marker-end-".concat(t.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(t.id,")");var i=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=i,li(this,tE(t)),this.graphModel.overlapMode===Sy.INCREASE&&(this.zIndex=t.zIndex||iw()),this.setAnchors(),this.initPoints(),this.formatText(t)},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.getEdgeStyle=function(){return Ex(Ex({},this.graphModel.theme.baseEdge),this.style)},t.prototype.getAdjustPointStyle=function(){return Ex({},this.graphModel.theme.edgeAdjust)},t.prototype.getTextStyle=function(){return Is(this.graphModel.theme.edgeText)},t.prototype.getEdgeAnimationStyle=function(){return Is(this.graphModel.theme.edgeAnimation)},t.prototype.getArrowStyle=function(){var t=this.getEdgeStyle(),e=this.getEdgeAnimationStyle(),n=this.graphModel.theme.arrow,o=this.isAnimation?e.stroke:t.stroke;return Ex(Ex(Ex({},t),{fill:o,stroke:o}),n)},t.prototype.getOutlineStyle=function(){return Is(this.graphModel.theme.outline)},t.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(t.prototype,"sourceNode",{get:function(){var t,e;return null===(e=null===(t=this.graphModel)||void 0===t?void 0:t.nodesMap[this.sourceNodeId])||void 0===e?void 0:e.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"targetNode",{get:function(){var t,e;return null===(e=null===(t=this.graphModel)||void 0===t?void 0:t.nodesMap[this.targetNodeId])||void 0===e?void 0:e.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),t.prototype.getBeginAnchor=function(t,e,n){var o,i,r=xE(t);if(n){if(o=Uu(r,(function(t){return t.id===n})))return o;console.warn("未在节点上找到指定的起点锚点".concat(n,",已使用默认锚点作为起点"))}return r.forEach((function(t){var n=eE(t,e);(void 0===i||n<i)&&(i=n,o=t)})),o},t.prototype.getEndAnchor=function(t,e){var n,o,i=this,r=xE(t);if(e){if(n=Uu(r,(function(t){return t.id===e})))return n;console.warn("未在节点上找到指定的终点锚点".concat(e,",已使用默认锚点作为终点"))}return r.forEach((function(t){if(i.startPoint){var e=eE(t,i.startPoint);(void 0===o||e<o)&&(o=e,n=t)}})),n},t.prototype.getProperties=function(){return Ib(this.properties)},t.prototype.getData=function(){var t=this.properties;Pb(t)&&(t=Ib(t));var e={id:this.id,type:this.type,properties:t,sourceNodeId:this.sourceNodeId,targetNodeId:this.targetNodeId,startPoint:li({},this.startPoint),endPoint:li({},this.endPoint)};this.graphModel.overlapMode===Sy.INCREASE&&(e.zIndex=this.zIndex);var n=this.text,o=n.x,i=n.y,r=n.value;return r&&(e.text={x:o,y:i,value:r}),e},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.setProperty=function(t,e){var n,o=Ib(this.properties);this.properties=Ex(Ex({},o),((n={})[t]=Oy(e),n)),this.setAttributes()},t.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},t.prototype.setProperties=function(t){this.properties=Ex(Ex({},Ib(this.properties)),Oy(t)),this.setAttributes()},t.prototype.changeEdgeId=function(t){var e=this.arrowConfig,n=e.markerEnd,o=e.markerStart;o&&o==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(t,")")),n&&n==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(t,")")),this.id=t},t.prototype.setStyle=function(t,e){var n;this.style=Ex(Ex({},this.style),((n={})[t]=Oy(e),n))},t.prototype.setStyles=function(t){this.style=Ex(Ex({},this.style),Oy(t))},t.prototype.updateStyles=function(t){this.style=Ex({},Oy(t))},t.prototype.setTextMode=function(t){this.textMode=t},t.prototype.formatText=function(t){var e,n,o,i=this.textPosition,r=i.x,a=i.y,s=t.text,l={value:"",x:r,y:a,draggable:!1,editable:!0};s&&("string"==typeof s?l=Ex(Ex({},l),{value:s}):(l=Ex(Ex({},l),{x:null!==(e=s.x)&&void 0!==e?e:r,y:null!==(n=s.y)&&void 0!==n?n:a,value:null!==(o=s.value)&&void 0!==o?o:""}),nd(s.draggable)||(l.draggable=s.draggable),nd(s.editable)||(l.editable=s.editable))),this.text=l},t.prototype.resetTextPosition=function(){var t=this.textPosition,e=t.x,n=t.y;this.text.x=e,this.text.y=n},t.prototype.moveText=function(t,e){var n=this.text,o=n.x,i=n.y,r=n.value,a=n.draggable,s=n.editable;this.text={value:r,editable:s,draggable:a,x:o+t,y:i+e}},t.prototype.setText=function(t){t&&li(this.text,t)},t.prototype.updateText=function(t){this.text=Ex(Ex({},Ib(this.text)),{value:t})},t.prototype.setAnchors=function(){if(!this.sourceAnchorId||!this.startPoint){if(!(t=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId)))throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:t.x,y:t.y}),this.sourceAnchorId||(this.sourceAnchorId=t.id)}if(!this.targetAnchorId||!this.endPoint){var t;if(!(t=this.getEndAnchor(this.targetNode,this.targetAnchorId)))throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:t.x,y:t.y}),this.targetAnchorId||(this.targetAnchorId=t.id)}},t.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},t.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t},t.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},t.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},t.prototype.openEdgeAnimation=function(){this.isAnimation=!0},t.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},t.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},t.prototype.updateStartPoint=function(t){this.startPoint=t},t.prototype.moveStartPoint=function(t,e){this.startPoint&&(this.startPoint.x+=t,this.startPoint.y+=e)},t.prototype.updateEndPoint=function(t){this.endPoint=t},t.prototype.moveEndPoint=function(t,e){this.endPoint&&(this.endPoint.x+=t,this.endPoint.y+=e)},t.prototype.setZIndex=function(t){void 0===t&&(t=0),this.zIndex=t},t.prototype.initPoints=function(){},t.prototype.updateAttributes=function(t){li(this,t)},t.prototype.getAdjustStart=function(){return this.startPoint},t.prototype.getAdjustEnd=function(){return this.endPoint},t.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint;this.updateStartPoint({x:e.x,y:e.y}),this.updateEndPoint({x:n.x,y:n.y})},t.BaseType=_y.EDGE,wx([Sm],t.prototype,"type",void 0),wx([Sm],t.prototype,"sourceNodeId",void 0),wx([Sm],t.prototype,"targetNodeId",void 0),wx([Sm],t.prototype,"startPoint",void 0),wx([Sm],t.prototype,"endPoint",void 0),wx([Sm],t.prototype,"textMode",void 0),wx([Sm],t.prototype,"text",void 0),wx([Sm],t.prototype,"properties",void 0),wx([Sm],t.prototype,"points",void 0),wx([Sm],t.prototype,"pointsList",void 0),wx([Sm],t.prototype,"isSelected",void 0),wx([Sm],t.prototype,"isHovered",void 0),wx([Sm],t.prototype,"isHitable",void 0),wx([Sm],t.prototype,"isHittable",void 0),wx([Sm],t.prototype,"draggable",void 0),wx([Sm],t.prototype,"visible",void 0),wx([Sm],t.prototype,"isAnimation",void 0),wx([Sm],t.prototype,"isShowAdjustPoint",void 0),wx([Sm],t.prototype,"zIndex",void 0),wx([Sm],t.prototype,"state",void 0),wx([Sm],t.prototype,"style",void 0),wx([Sm],t.prototype,"arrowConfig",void 0),wx([Om],t.prototype,"sourceNode",null),wx([Om],t.prototype,"targetNode",null),wx([Om],t.prototype,"textPosition",null),wx([Eb],t.prototype,"setProperty",null),wx([Eb],t.prototype,"deleteProperty",null),wx([Eb],t.prototype,"setProperties",null),wx([Eb],t.prototype,"changeEdgeId",null),wx([Eb],t.prototype,"setStyle",null),wx([Eb],t.prototype,"setStyles",null),wx([Eb],t.prototype,"updateStyles",null),wx([Eb],t.prototype,"setTextMode",null),wx([Eb],t.prototype,"formatText",null),wx([Eb],t.prototype,"resetTextPosition",null),wx([Eb],t.prototype,"moveText",null),wx([Eb],t.prototype,"setText",null),wx([Eb],t.prototype,"updateText",null),wx([Eb],t.prototype,"setAnchors",null),wx([Eb],t.prototype,"setSelected",null),wx([Eb],t.prototype,"setHovered",null),wx([Eb],t.prototype,"setHitable",null),wx([Eb],t.prototype,"setHittable",null),wx([Eb],t.prototype,"openEdgeAnimation",null),wx([Eb],t.prototype,"closeEdgeAnimation",null),wx([Eb],t.prototype,"setElementState",null),wx([Eb],t.prototype,"updateStartPoint",null),wx([Eb],t.prototype,"moveStartPoint",null),wx([Eb],t.prototype,"updateEndPoint",null),wx([Eb],t.prototype,"moveEndPoint",null),wx([Eb],t.prototype,"setZIndex",null),wx([Eb],t.prototype,"initPoints",null),wx([Eb],t.prototype,"updateAttributes",null),wx([Eb],t.prototype,"getAdjustStart",null),wx([Eb],t.prototype,"getAdjustEnd",null),wx([Eb],t.prototype,"updateAfterAdjustStartAndEnd",null),t}(),Cx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Nx=function(){return Nx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Nx.apply(this,arguments)},Tx=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},Ax=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a};!function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Ey.BEZIER_EDGE,o.path="",o.initEdgeData(e),o.setAttributes(),o}Cx(e,t),e.prototype.initEdgeData=function(e){this.offset=100,t.prototype.initEdgeData.call(this,e)},e.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.bezier,n=t.prototype.getEdgeStyle.call(this),o=this.properties.style,i=void 0===o?{}:o;return Nx(Nx(Nx({},n),Is(e)),Is(i))},e.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var t=0,e=0;return this.pointsList.forEach((function(n){var o=n.x,i=n.y;t+=o,e+=i})),{x:t/this.pointsList.length,y:e/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e.prototype.getData=function(){var e=t.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return Nx(Nx({},e),{pointsList:n})},e.prototype.getControls=function(){var t=this.startPoint,e=this.endPoint;return J_({start:t,end:e,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset})},e.prototype.getPath=function(t){var e=Ax(t,4),n=e[0],o=e[1],i=e[2],r=e[3];return"M ".concat(n.x," ").concat(n.y,"\n C ").concat(o.x," ").concat(o.y,",\n ").concat(i.x," ").concat(i.y,",\n ").concat(r.x," ").concat(r.y)},e.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var t=this.getControls(),e=t.sNext,n=t.ePre;this.updatePath(e,n)},e.prototype.updatePath=function(t,e){t=Is(t),e=Is(e);var n={x:this.startPoint.x,y:this.startPoint.y},o={x:this.endPoint.x,y:this.endPoint.y};if(!t||!e){var i=this.getControls();t=i.sNext,e=i.ePre}this.pointsList=[n,t,e,o],this.path=this.getPath(this.pointsList)},e.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},e.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e;var n=Ax(this.pointsList,3),o=n[1],i=n[2];o.x+=t,o.y+=e,this.updatePath(o,i)},e.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e;var n=Ax(this.pointsList,3),o=n[1],i=n[2];i.x+=t,i.y+=e,this.updatePath(o,i)},e.prototype.updateAdjustAnchor=function(t,e){var n;"sNext"===e?this.pointsList[1]=t:"ePre"===e&&(this.pointsList[2]=t),this.path=this.getPath(this.pointsList),(null===(n=this.text)||void 0===n?void 0:n.value)&&this.setText(li({},this.text,this.textPosition))},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,o=t.sourceNode,i=t.targetNode,r=J_({start:e,end:n,sourceNode:o,targetNode:i,offset:this.offset}),a=r.sNext,s=r.ePre;this.pointsList=[e,a,s,n],this.initPoints()},Tx([Sm],e.prototype,"path",void 0),Tx([Eb],e.prototype,"initPoints",null),Tx([Eb],e.prototype,"updatePoints",null),Tx([Eb],e.prototype,"updateStartPoint",null),Tx([Eb],e.prototype,"updateEndPoint",null),Tx([Eb],e.prototype,"moveStartPoint",null),Tx([Eb],e.prototype,"moveEndPoint",null),Tx([Eb],e.prototype,"updateAdjustAnchor",null),Tx([Eb],e.prototype,"getAdjustStart",null),Tx([Eb],e.prototype,"getAdjustEnd",null),Tx([Eb],e.prototype,"updateAfterAdjustStartAndEnd",null)}(Sx);var Mx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ox=function(){return Ox=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Ox.apply(this,arguments)},Px=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},kx=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))};!function(t){function e(){var e=t.apply(this,kx([],Px(arguments),!1))||this;return e.modelType=Ey.LINE_EDGE,e}Mx(e,t),e.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.line,n=t.prototype.getEdgeStyle.call(this),o=this.properties.style,i=void 0===o?{}:o;return Ox(Ox(Ox({},n),Is(e)),Is(i))},e.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}}}(Sx);var Rx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Dx=function(){return Dx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Dx.apply(this,arguments)},Lx=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},Ix=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},jx=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))};!function(t){function e(){var e=t.apply(this,jx([],Ix(arguments),!1))||this;return e.modelType=Ey.POLYLINE_EDGE,e.draggingPointList=[],e}Rx(e,t),e.prototype.initEdgeData=function(e){this.offset=30,t.prototype.initEdgeData.call(this,e)},e.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.polyline,n=t.prototype.getEdgeStyle.call(this),o=this.properties.style,i=void 0===o?{}:o;return Dx(Dx(Dx({},n),Is(e)),Is(i))},e.prototype.getTextPosition=function(){var t,e=null===(t=this.text)||void 0===t?void 0:t.value;if(this.dbClickPosition&&!e){var n=this.dbClickPosition;return{x:n.x,y:n.y}}var o=K_(this.points),i=Ix(U_(o),2),r=i[0],a=i[1];return{x:(r.x+a.x)/2,y:(r.y+a.y)/2}},e.prototype.getAfterAnchor=function(t,e,n){var o,i;return n.forEach((function(n){var r;t===Cy.HORIZONTAL?r=Math.abs(e.y-n.y):t===Cy.VERTICAL&&(r=Math.abs(e.x-n.x)),(!i||i>r)&&(i=r,o=n)})),o},e.prototype.getCrossPoint=function(t,e,n){var o;return t===Cy.HORIZONTAL?o={x:n.x,y:e.y}:t===Cy.VERTICAL&&(o={x:e.x,y:n.y}),o},e.prototype.removeCrossPoints=function(t,e,n){var o=n.map((function(t){return t}));if(1===t){var i=o[t],r=o[e],a=o[t-1];if(X_(a,i,this.sourceNode)){if(V_(i,r,this.sourceNode))(s=Y_(i,r,this.sourceNode))&&(o[t]=s,o.splice(t-1,1),t--,e--)}else this.sourceNode.anchors.forEach((function(e){(e.x===a.x&&e.x===i.x||e.y===a.y&&e.y===i.y)&&(EE(e.x,e.y,i.x,i.y)<EE(a.x,a.y,i.x,i.y)&&(o[t-1]=e))}))}if(e===n.length-2){var s,l=o[t],u=o[e],c=o[e+1];if(X_(u,c,this.targetNode)){if(V_(l,u,this.targetNode))(s=Y_(l,u,this.targetNode))&&(o[e]=s,o.splice(e+1,1))}else this.targetNode.anchors.forEach((function(t){(t.x===c.x&&t.x===u.x||t.y===c.y&&t.y===u.y)&&(EE(t.x,t.y,u.x,u.y)<EE(c.x,c.y,u.x,u.y)&&(o[e+1]=t))}))}return o},e.prototype.getDraggingPoints=function(t,e,n,o,i){var r=i.map((function(t){return t})),a=this.getAfterAnchor(t,n,o),s=this.getCrossPoint(t,n,a);return"start"===e?(r.unshift(s),r.unshift(a)):(r.push(s),r.push(a)),r},e.prototype.updateCrossPoints=function(t){var e=t.map((function(t){return t})),n=t[0],o=t[1],i=t[e.length-2],r=t[e.length-1],a=this.sourceNode,s=this.targetNode,l=a.modelType,u=s.modelType,c=q_(n,o),d=e[0];switch(l){case Ey.RECT_NODE:if(0!==a.radius)TE(n,a)||(d=CE(n,c,a));break;case Ey.CIRCLE_NODE:d=NE(n,c,a);break;case Ey.ELLIPSE_NODE:d=AE(n,c,a);break;case Ey.DIAMOND_NODE:case Ey.POLYGON_NODE:d=ME(n,c,a)}d&&(e[0]=d);var h=q_(i,r),p=e[e.length-1];switch(u){case Ey.RECT_NODE:if(0!==s.radius)TE(r,s)||(p=CE(r,h,s));break;case Ey.CIRCLE_NODE:p=NE(r,h,s);break;case Ey.ELLIPSE_NODE:p=AE(r,h,s);break;case Ey.DIAMOND_NODE:case Ey.POLYGON_NODE:p=ME(r,h,s)}return p&&(e[e.length-1]=p),e},e.prototype.getData=function(){var e=t.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return Object.assign({},e,{pointsList:n})},e.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.pointsList.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" "):this.updatePoints()},e.prototype.updatePoints=function(){var t=G_({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=t,this.points=t.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ")},e.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e,this.updatePoints()},e.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e,this.updatePoints()},e.prototype.updatePointsList=function(t,e){this.pointsList.forEach((function(n){n.x+=t,n.y+=e}));var n=this.pointsList[0];this.startPoint=Object.assign({},n);var o=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},o),this.initPoints()},e.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map((function(t){return t}))},e.prototype.dragAppendSimple=function(t,e){var n;this.isDragging=!0;var o=t.start,i=t.end,r=t.startIndex,a=t.endIndex,s=t.direction,l=this.pointsList,u=l;return s===Cy.HORIZONTAL?(l[r]={x:o.x,y:o.y+e.y},l[a]={x:i.x,y:i.y+e.y},u=this.pointsList.map((function(t){return t}))):s===Cy.VERTICAL&&(l[r]={x:o.x+e.x,y:o.y},l[a]={x:i.x+e.x,y:i.y},u=this.pointsList.map((function(t){return t}))),this.updatePointsAfterDrag(u),this.draggingPointList=u,(null===(n=this.text)||void 0===n?void 0:n.value)&&this.setText(li({},this.text,this.textPosition)),{start:li({},l[r]),end:li({},l[a]),startIndex:r,endIndex:a,direction:s}},e.prototype.dragAppend=function(t,e){var n;this.isDragging=!0;var o=t.start,i=t.end,r=t.startIndex,a=t.endIndex,s=t.direction,l=this.pointsList;if(s===Cy.HORIZONTAL){l[r]={x:o.x,y:o.y+e.y},l[a]={x:i.x,y:i.y+e.y};var u=this.pointsList.map((function(t){return t}));if(0!==r&&a!==this.pointsList.length-1&&(u=this.removeCrossPoints(r,a,u)),0===r){var c={x:o.x,y:o.y+e.y};if(!wE(c,this.sourceNode)){var d=this.sourceNode.anchors;u=this.getDraggingPoints(s,"start",c,d,u)}}if(a===this.pointsList.length-1){var h={x:i.x,y:i.y+e.y};if(!wE(h,this.targetNode)){d=this.targetNode.anchors;u=this.getDraggingPoints(s,"end",h,d,u)}}this.updatePointsAfterDrag(u),this.draggingPointList=u}else if(s===Cy.VERTICAL){l[r]={x:o.x+e.x,y:o.y},l[a]={x:i.x+e.x,y:i.y};u=this.pointsList.map((function(t){return t}));if(0!==r&&a!==this.pointsList.length-1&&(u=this.removeCrossPoints(r,a,u)),0===r){c={x:o.x+e.x,y:o.y};if(!wE(c,this.sourceNode)){d=this.sourceNode.anchors;u=this.getDraggingPoints(s,"start",c,d,u)}}if(a===this.pointsList.length-1){h={x:i.x+e.x,y:i.y};if(!wE(h,this.targetNode)){d=this.targetNode.anchors;u=this.getDraggingPoints(s,"end",h,d,u)}}this.updatePointsAfterDrag(u),this.draggingPointList=u}return(null===(n=this.text)||void 0===n?void 0:n.value)&&this.setText(li({},this.text,this.textPosition)),{start:li({},l[r]),end:li({},l[a]),startIndex:r,endIndex:a,direction:s}},e.prototype.dragAppendEnd=function(){if(this.draggingPointList){var t=W_(K_(this.points));this.pointsList=t.map((function(t){return t})),this.draggingPointList=[];var e=t[0];this.startPoint=li({},e);var n=t[t.length-1];this.endPoint=li({},n)}this.isDragging=!1},e.prototype.updatePointsAfterDrag=function(t){var e=this.updateCrossPoints(t);this.points=e.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ")},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,o=t.sourceNode,i=t.targetNode;this.pointsList=G_({x:e.x,y:e.y},{x:n.x,y:n.y},o,i,this.offset||0),this.initPoints()},Lx([Sm],e.prototype,"dbClickPosition",void 0),Lx([Eb],e.prototype,"initPoints",null),Lx([Eb],e.prototype,"updatePoints",null),Lx([Eb],e.prototype,"updateStartPoint",null),Lx([Eb],e.prototype,"moveStartPoint",null),Lx([Eb],e.prototype,"updateEndPoint",null),Lx([Eb],e.prototype,"moveEndPoint",null),Lx([Eb],e.prototype,"updatePointsList",null),Lx([Eb],e.prototype,"dragAppendStart",null),Lx([Eb],e.prototype,"dragAppendSimple",null),Lx([Eb],e.prototype,"dragAppend",null),Lx([Eb],e.prototype,"dragAppendEnd",null),Lx([Eb],e.prototype,"updatePointsAfterDrag",null),Lx([Eb],e.prototype,"getAdjustStart",null),Lx([Eb],e.prototype,"getAdjustEnd",null),Lx([Eb],e.prototype,"updateAfterAdjustStartAndEnd",null)}(Sx);var Bx=function(){return Bx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Bx.apply(this,arguments)},Hx=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},Fx=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},zx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},Wx=function(){function t(t,e){var n;this.BaseType=_y.NODE,this.id="",this.type="",this.x=0,this.y=0,this.textMode=Ny.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this._width=100,this._height=80,this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.anchorsOffset=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isShowAnchor=!1,this.isDragging=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.rotatable=!0,this.resizable=!0,this.zIndex=1,this.state=xy.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=Ey.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=e,this.properties=null!==(n=t.properties)&&void 0!==n?n:{},this.initNodeData(t),this.setAttributes()}return Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t;var e=this.x,n=void 0===e?0:e,o=this.y,i=void 0===o?0:o;this.transform=new mE(-n,-i).rotate(t).translate(n,i).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),t.prototype.initNodeData=function(t){if(t.properties||(t.properties={}),!t.id){var e=this.graphModel.idGenerator,n=e&&e(t.type),o=this.createId();t.id=o||n||JE()}this.formatText(t),li(this,OE(t)),this.graphModel.overlapMode===Sy.INCREASE&&(this.zIndex=t.zIndex||iw())},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.setTextMode=function(t){this.textMode=t},t.prototype.formatText=function(t){var e,n,o,i=t.x,r=t.y,a=t.text,s={value:"",x:i,y:r,draggable:!1,editable:!0};a&&("string"==typeof a?s.value=a:(s=Bx(Bx({},s),{x:null!==(e=a.x)&&void 0!==e?e:i,y:null!==(n=a.y)&&void 0!==n?n:r,value:null!==(o=a.value)&&void 0!==o?o:""}),nd(a.draggable)||(s.draggable=a.draggable),nd(a.editable)||(s.draggable=a.draggable))),t.text=s},t.prototype.resize=function(t){var e=t.width,n=t.height,o=t.deltaX,i=t.deltaY;return this.move(o/2,i/2),this.width=e,this.height=n,this.setProperties({width:e,height:n}),this.getData()},t.prototype.proportionalResize=function(){},t.prototype.getData=function(){var t=this.text,e=t.x,n=t.y,o=t.value,i=this.properties;Pb(i)&&(i=Ib(i));var r={id:this.id,type:this.type,x:this.x,y:this.y,properties:i};return this.rotate&&(r.rotate=this.rotate),this.graphModel.overlapMode===Sy.INCREASE&&(r.zIndex=this.zIndex),o&&(r.text={x:e,y:n,value:o}),r},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.getProperties=function(){return Ib(this.properties)},t.prototype.getOuterGAttributes=function(){return{className:""}},t.prototype.getNodeStyle=function(){return Bx(Bx({},this.graphModel.theme.baseNode),this.style)},t.prototype.getTextStyle=function(){var t=this.graphModel.theme.nodeText,e=this.properties.textStyle,n=void 0===e?{}:e;return Bx(Bx({},Is(t)),Is(n))},t.prototype.getRotateControlStyle=function(){return Is(this.graphModel.theme.rotateControl)},t.prototype.getResizeControlStyle=function(){return Is(this.graphModel.theme.resizeControl)},t.prototype.getResizeOutlineStyle=function(){return Is(this.graphModel.theme.resizeOutline)},t.prototype.getAnchorStyle=function(t){return Is(this.graphModel.theme.anchor)},t.prototype.getAnchorLineStyle=function(t){return Is(this.graphModel.theme.anchorLine)},t.prototype.getOutlineStyle=function(){return Is(this.graphModel.theme.outline)},t.prototype.isAllowConnectedAsSource=function(t,e,n,o){var i=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var r=!0,a="",s=0;s<i.length;s++){var l=i[s];if(!l.validate.call(this,this,t,e,n,o)){r=!1,a=l.message;break}}return{isAllPass:r,msg:a}},t.prototype.getConnectedSourceRules=function(){return this.sourceRules},t.prototype.isAllowConnectedAsTarget=function(t,e,n,o){var i=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var r=!0,a="",s=0;s<i.length;s++){var l=i[s];if(!l.validate.call(this,t,this,e,n,o)){r=!1,a=l.message;break}}return{isAllPass:r,msg:a}},t.prototype.isAllowMoveNode=function(t,e){var n,o,i=!0,r=!0,a=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var s=Fx(a),l=s.next();!l.done;l=s.next()){var u=(0,l.value)(this,t,e);if(!u)return!1;if("object"==typeof u){var c=u;if(!c.x&&!c.y)return!1;i=i&&c.x,r=r&&c.y}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return{x:i,y:r}},t.prototype.getConnectedTargetRules=function(){return this.targetRules},t.prototype.getAnchorsByOffset=function(){var t=this,e=t.anchorsOffset,n=t.id,o=t.x,i=t.y;return e&&e.length>0?e.map((function(t,e){return t.length?{id:"".concat(n,"_").concat(e),x:o+t[0],y:i+t[1]}:Bx(Bx({},t),{x:o+t.x,y:i+t.y,id:t.id||"".concat(n,"_").concat(e)})})):this.getDefaultAnchor()},t.prototype.getDefaultAnchor=function(){return[]},t.prototype.getTargetAnchor=function(t){return _E(t,this)},t.prototype.getBounds=function(){return{minX:this.x-this.width/2,minY:this.y-this.height/2,maxX:this.x+this.width/2,maxY:this.y+this.height/2}},Object.defineProperty(t.prototype,"anchors",{get:function(){var t=this.getAnchorsByOffset(),e=this,n=e.x,o=e.y,i=e.rotate;return t.forEach((function(t){var e=t.x,r=t.y,a=zx(new gE([e,r,1]).translate(-n,-o).rotate(i).translate(n,o)[0],2),s=a[0],l=a[1];t.x=s,t.y=l})),t},enumerable:!1,configurable:!0}),t.prototype.getAnchorInfo=function(t){if(!Jc(t))for(var e=0;e<this.anchors.length;e++){var n=this.anchors[e];if(n.id===t)return n}},t.prototype.addNodeMoveRules=function(t){this.moveRules.includes(t)||this.moveRules.push(t)},t.prototype.isAllowMoveByXORY=function(t,e,n){var o,i;if(n)o=!0,i=!0;else{var r=this.isAllowMoveNode(t,e);"boolean"==typeof r?(o=r,i=r):(o=r.x,i=r.y)}return{isAllowMoveX:o,isAllowMoveY:i}},t.prototype.move=function(t,e,n){void 0===n&&(n=!1);var o=this.isAllowMoveByXORY(t,e,n),i=o.isAllowMoveX,r=o.isAllowMoveY;return i&&(this.x=this.x+t,this.text&&this.moveText(t,0)),r&&(this.y=this.y+e,this.text&&this.moveText(0,e)),i||r},t.prototype.getMoveDistance=function(t,e,n){void 0===n&&(n=!1);var o=this.isAllowMoveByXORY(t,e,n),i=o.isAllowMoveX,r=o.isAllowMoveY,a=0,s=0;return i&&t&&(this.x=this.x+t,this.text&&this.moveText(t,0),a=t),r&&e&&(this.y=this.y+e,this.text&&this.moveText(0,e),s=e),[a,s]},t.prototype.moveTo=function(t,e,n){void 0===n&&(n=!1);var o=t-this.x,i=e-this.y;return!(!n&&!this.isAllowMoveNode(o,i))&&(this.text&&this.moveText(o,i),this.x=t,this.y=e,!0)},t.prototype.moveText=function(t,e){var n=this.text,o=n.x,i=n.y,r=n.value,a=n.draggable,s=n.editable;this.text={value:r,editable:s,draggable:a,x:o+t,y:i+e}},t.prototype.updateText=function(t){this.text=Bx(Bx({},Ib(this.text)),{value:t})},t.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},t.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t,this.setIsShowAnchor(t)},t.prototype.setIsShowAnchor=function(t){void 0===t&&(t=!0),this.isShowAnchor=t},t.prototype.setRotatable=function(t){void 0===t&&(t=!0),this.rotatable=t},t.prototype.setResizable=function(t){void 0===t&&(t=!0),this.resizable=t},t.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},t.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},t.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},t.prototype.updateProperties=function(t,e){var n=Ib(this.properties);this.properties=t,this.setAttributes(),this.graphModel.eventCenter.emit(wy.NODE_PROPERTIES_CHANGE,{id:this.id,keys:e,preProperties:n,properties:t})},t.prototype.setProperty=function(t,e){var n,o=Ib(this.properties),i=Bx(Bx({},o),((n={})[t]=Oy(e),n));this.updateProperties(i,[t])},t.prototype.setProperties=function(t){var e=Ib(this.properties),n=Bx(Bx({},e),Oy(t)),o=[];pd(t,(function(t,n){(fc(e,n)&&e[n]!==t||!fc(e,n))&&o.push(n)})),this.updateProperties(n,o)},t.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},t.prototype.setStyle=function(t,e){var n;this.style=Bx(Bx({},this.style),((n={})[t]=Oy(e),n))},t.prototype.setStyles=function(t){this.style=Bx(Bx({},this.style),Oy(t))},t.prototype.updateStyles=function(t){this.style=Bx({},Oy(t))},t.prototype.setZIndex=function(t){void 0===t&&(t=1),this.zIndex=t},t.prototype.updateAttributes=function(t){li(this,t)},t.BaseType=_y.NODE,Hx([Sm],t.prototype,"type",void 0),Hx([Sm],t.prototype,"x",void 0),Hx([Sm],t.prototype,"y",void 0),Hx([Sm],t.prototype,"textMode",void 0),Hx([Sm],t.prototype,"text",void 0),Hx([Sm],t.prototype,"properties",void 0),Hx([Sm],t.prototype,"_width",void 0),Hx([Sm],t.prototype,"_height",void 0),Hx([Sm],t.prototype,"anchorsOffset",void 0),Hx([Sm],t.prototype,"isSelected",void 0),Hx([Sm],t.prototype,"isHovered",void 0),Hx([Sm],t.prototype,"isShowAnchor",void 0),Hx([Sm],t.prototype,"isDragging",void 0),Hx([Sm],t.prototype,"isHitable",void 0),Hx([Sm],t.prototype,"isHittable",void 0),Hx([Sm],t.prototype,"draggable",void 0),Hx([Sm],t.prototype,"visible",void 0),Hx([Sm],t.prototype,"rotatable",void 0),Hx([Sm],t.prototype,"resizable",void 0),Hx([Sm],t.prototype,"zIndex",void 0),Hx([Sm],t.prototype,"state",void 0),Hx([Sm],t.prototype,"autoToFront",void 0),Hx([Sm],t.prototype,"style",void 0),Hx([Sm],t.prototype,"transform",void 0),Hx([Sm],t.prototype,"_rotate",void 0),Hx([Om],t.prototype,"incoming",null),Hx([Om],t.prototype,"outgoing",null),Hx([Eb],t.prototype,"setTextMode",null),Hx([Eb],t.prototype,"addNodeMoveRules",null),Hx([Eb],t.prototype,"move",null),Hx([Eb],t.prototype,"getMoveDistance",null),Hx([Eb],t.prototype,"moveTo",null),Hx([Eb],t.prototype,"moveText",null),Hx([Eb],t.prototype,"updateText",null),Hx([Eb],t.prototype,"setSelected",null),Hx([Eb],t.prototype,"setHovered",null),Hx([Eb],t.prototype,"setIsShowAnchor",null),Hx([Eb],t.prototype,"setRotatable",null),Hx([Eb],t.prototype,"setResizable",null),Hx([Eb],t.prototype,"setHitable",null),Hx([Eb],t.prototype,"setHittable",null),Hx([Eb],t.prototype,"setElementState",null),Hx([Eb],t.prototype,"setProperty",null),Hx([Eb],t.prototype,"setProperties",null),Hx([Eb],t.prototype,"deleteProperty",null),Hx([Eb],t.prototype,"setStyle",null),Hx([Eb],t.prototype,"setStyles",null),Hx([Eb],t.prototype,"updateStyles",null),Hx([Eb],t.prototype,"setZIndex",null),Hx([Eb],t.prototype,"updateAttributes",null),t}(),Gx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ux=function(){return Ux=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Ux.apply(this,arguments)},Xx=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a};!function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Ey.CIRCLE_NODE,o.r=50,o.setAttributes(),o}Gx(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties.r;e&&(this.r=e)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.circle,o=this.properties.style,i=void 0===o?{}:o;return Ux(Ux(Ux({},e),Is(n)),Is(i))},e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,o=t.r;return[{x:e,y:n-o,id:"".concat(this.id,"_0")},{x:e+o,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o,id:"".concat(this.id,"_2")},{x:e-o,y:n,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(t){var e=t.width,n=t.deltaX,o=t.deltaY;return this.move(n/2,o/2),this.r=e,this.setProperties({r:e}),this.getData()},Xx([Sm],e.prototype,"r",void 0),Xx([Om],e.prototype,"width",null),Xx([Om],e.prototype,"height",null)}(Wx);var Vx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Yx=function(){return Yx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Yx.apply(this,arguments)},qx=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},Kx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a};!function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Ey.DIAMOND_NODE,o.rx=30,o.ry=50,o.setAttributes(),o}Vx(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.rx,o=e.ry;n&&(this.rx=n),o&&(this.ry=o)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.diamond,o=this.properties.style,i=void 0===o?{}:o;return Yx(Yx(Yx({},e),Is(n)),Is(i))},Object.defineProperty(e.prototype,"points",{get:function(){var t=this,e=t.x,n=t.y,o=t.rx,i=t.ry;return[[e,n-i],[e+o,n],[e,n+i],[e-o,n]]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointsPosition",{get:function(){return Ju(this.points,(function(t){var e=Kx(t,2);return{x:e[0],y:e[1]}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return xu(this.points,(function(n){var o=Kx(n,1)[0];o<t&&(t=o),o>e&&(e=o)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return xu(this.points,(function(n){var o=Kx(n,2)[1];o<t&&(t=o),o>e&&(e=o)})),e-t},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this;return Ju(this.points,(function(e,n){var o=Kx(e,2);return{x:o[0],y:o[1],id:"".concat(t.id,"_").concat(n)}}))},e.prototype.resize=function(t){var e=t.width,n=t.height,o=t.deltaX,i=t.deltaY;return this.move(o/2,i/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},qx([Sm],e.prototype,"rx",void 0),qx([Sm],e.prototype,"ry",void 0),qx([Om],e.prototype,"points",null),qx([Om],e.prototype,"pointsPosition",null),qx([Om],e.prototype,"width",null),qx([Om],e.prototype,"height",null)}(Wx);var Zx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),$x=function(){return $x=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},$x.apply(this,arguments)},Jx=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a};!function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Ey.ELLIPSE_NODE,o.rx=30,o.ry=45,o.setAttributes(),o}Zx(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.rx,o=e.ry;n&&(this.rx=n),o&&(this.ry=o)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.ellipse,o=this.properties.style,i=void 0===o?{}:o;return $x($x($x({},e),Is(n)),Is(i))},Object.defineProperty(e.prototype,"width",{get:function(){return 2*this.rx},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 2*this.ry},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,o=t.rx,i=t.ry;return[{x:e,y:n-i,id:"".concat(this.id,"_0")},{x:e+o,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+i,id:"".concat(this.id,"_2")},{x:e-o,y:n,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(t){var e=t.width,n=t.height,o=t.deltaX,i=t.deltaY;return this.move(o/2,i/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},Jx([Sm],e.prototype,"rx",void 0),Jx([Sm],e.prototype,"ry",void 0),Jx([Om],e.prototype,"width",null),Jx([Om],e.prototype,"height",null)}(Wx);var Qx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),t_=function(){return t_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},t_.apply(this,arguments)},e_=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},n_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a};!function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Ey.POLYGON_NODE,o.points=[[50,0],[100,50],[50,100],[0,50]],o.setAttributes(),o}Qx(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.points,o=e.width,i=e.height,r=n||this.points;this.points=function(t,e,n){if(!t)return[];var o=Math.min.apply(Math,oE([],nE(t.map((function(t){return t[0]}))),!1)),i=Math.max.apply(Math,oE([],nE(t.map((function(t){return t[0]}))),!1)),r=Math.min.apply(Math,oE([],nE(t.map((function(t){return t[1]}))),!1)),a=Math.max.apply(Math,oE([],nE(t.map((function(t){return t[1]}))),!1)),s=-o,l=-r,u=t.map((function(t){var e=nE(t,2),n=e[0],o=e[1];return[n+s,o+l]})),c=i-o,d=a-r,h=e?e/c:1,p=n?n/d:1,f=Math.min(h,p);return u.map((function(t){var e=nE(t,2),n=e[0],o=e[1];return[n*f,o*f]}))}(r,o,i)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.polygon,o=this.properties.style,i=void 0===o?{}:o;return t_(t_(t_({},e),Is(n)),Is(i))},Object.defineProperty(e.prototype,"pointsPosition",{get:function(){var t=this,e=t.x,n=t.y,o=t.width,i=t.height;return this.points.map((function(t){return{x:t[0]+e-o/2,y:t[1]+n-i/2}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var o=n_(n,1)[0];o<t&&(t=o),o>e&&(e=o)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var o=n_(n,2)[1];o<t&&(t=o),o>e&&(e=o)})),e-t},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this,e=this,n=e.x,o=e.y,i=e.width,r=e.height;return e.points.map((function(e,a){var s=n_(e,2),l=s[0],u=s[1];return{x:n+l-i/2,y:o+u-r/2,id:"".concat(t.id,"_").concat(a)}}))},e.prototype.resize=function(t){var e=this,n=t.width,o=t.height,i=t.deltaX,r=t.deltaY;this.move(i/2,r/2);var a=Ju(this.points,(function(t){var i=n_(t,2),r=i[0],a=i[1];return[r*n/e.width,a*o/e.height]}));return this.points=a,this.properties.points=a,this.getData()},e_([Sm],e.prototype,"points",void 0),e_([Om],e.prototype,"pointsPosition",null),e_([Om],e.prototype,"width",null),e_([Om],e.prototype,"height",null)}(Wx);var o_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),i_=function(){return i_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},i_.apply(this,arguments)},r_=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a};!function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Ey.RECT_NODE,o.radius=0,o.setAttributes(),o}o_(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.width,o=e.height,i=e.radius;Jc(n)||(this.width=n),Jc(o)||(this.height=o),Jc(i)||(this.radius=i)},e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,o=t.width,i=t.height;return[{x:e,y:n-i/2,id:"".concat(this.id,"_0")},{x:e+o/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+i/2,id:"".concat(this.id,"_2")},{x:e-o/2,y:n,id:"".concat(this.id,"_3")}]},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.rect,o=this.properties.style,i=void 0===o?{}:o;return i_(i_(i_({},e),Is(n)),Is(i))},r_([Sm],e.prototype,"radius",void 0)}(Wx);var a_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),s_=function(){return s_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s_.apply(this,arguments)},l_=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},u_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},c_=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))};!function(t){function e(){var e=t.apply(this,c_([],u_(arguments),!1))||this;return e.modelType=Ey.TEXT_NODE,e}a_(e,t),e.prototype.getTextStyle=function(){var e=t.prototype.getTextStyle.call(this),n=this.graphModel.theme.text,o=this.properties.textStyle;return s_(s_(s_({},e),Is(n)),Is(o))},Object.defineProperty(e.prototype,"width",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return kE({rows:t,fontSize:e,rowsLength:t.length}).width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return kE({rows:t,fontSize:e,rowsLength:t.length}).height},enumerable:!1,configurable:!0}),l_([Om],e.prototype,"width",null),l_([Om],e.prototype,"height",null)}(Wx);var d_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();!function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Ey.HTML_NODE,o.setAttributes(),o}d_(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.width,o=e.height;n&&(this.width=n),o&&(this.height=o)},e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,o=t.width,i=t.height;return[{x:e,y:n-i/2,id:"".concat(this.id,"_0")},{x:e+o/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+i/2,id:"".concat(this.id,"_2")},{x:e-o/2,y:n,id:"".concat(this.id,"_3")}]}}(Wx);var h_=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},p_={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,textEdit:!1,nodeTextEdit:!1,edgeTextEdit:!1,textDraggable:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},f_=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustEdgeStart","adjustEdgeEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","autoExpand","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","textEdit","nodeTextEdit","edgeTextEdit","textDraggable","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","textMode","nodeTextMode","edgeTextMode","nodeTextMultiple","edgeTextMultiple","nodeTextVertical","edgeTextVertical"],g_=function(){function t(t){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopMoveGraph=!1,this.stopScrollGraph=!1,this.textMode=Ny.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!1,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=Ny.TEXT,this.edgeTextMode=Ny.TEXT,this.edgeTextEdit=!0,this.edgeTextDraggable=!1,this.edgeTextMultiple=!1,this.edgeTextVertical=!1,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.adjustNodePosition=!0,this.autoExpand=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustEdgeStart=!1,this.adjustEdgeEnd=!1,this.edgeSelectedOutline=!0,this.multipleSelectKey="",li(this,this.computeConfig(t))}return t.prototype.updateEditConfig=function(t){var e=this.computeConfig(t);li(this,e)},t.prototype.computeConfig=function(t){var e=t.isSilentMode,n=t.textDraggable,o=t.textMode,i=t.textEdit,r=t.adjustEdgeStartAndEnd,a={};if(!1===e&&li(a,this.stagedConfig),!0===e&&e!==this.isSilentMode){var s=yh(p_,f_);this.stagedConfig=yh(this,f_),li(a,s)}nd(i)||li(a,{nodeTextEdit:i,edgeTextEdit:i}),nd(n)||li(a,{nodeTextDraggable:n,edgeTextDraggable:n}),o&&li(a,{nodeTextMode:o,edgeTextMode:o}),Wc(r)&&li(a,{adjustEdgeStart:r,adjustEdgeEnd:r});var l=yh(t,f_);return li(a,l)},t.prototype.updateTextMode=function(t){this.textMode=t,this.edgeTextMode=t,this.nodeTextMode=t},t.prototype.getConfig=function(){return yh(this,f_)},h_([Sm],t.prototype,"isSilentMode",void 0),h_([Sm],t.prototype,"stopZoomGraph",void 0),h_([Sm],t.prototype,"stopMoveGraph",void 0),h_([Sm],t.prototype,"stopScrollGraph",void 0),h_([Sm],t.prototype,"textMode",void 0),h_([Sm],t.prototype,"textEdit",void 0),h_([Sm],t.prototype,"textDraggable",void 0),h_([Sm],t.prototype,"nodeTextEdit",void 0),h_([Sm],t.prototype,"nodeTextDraggable",void 0),h_([Sm],t.prototype,"nodeTextMultiple",void 0),h_([Sm],t.prototype,"nodeTextVertical",void 0),h_([Sm],t.prototype,"nodeTextMode",void 0),h_([Sm],t.prototype,"edgeTextMode",void 0),h_([Sm],t.prototype,"edgeTextEdit",void 0),h_([Sm],t.prototype,"edgeTextDraggable",void 0),h_([Sm],t.prototype,"edgeTextMultiple",void 0),h_([Sm],t.prototype,"edgeTextVertical",void 0),h_([Sm],t.prototype,"hideAnchors",void 0),h_([Sm],t.prototype,"allowRotate",void 0),h_([Sm],t.prototype,"allowResize",void 0),h_([Sm],t.prototype,"hoverOutline",void 0),h_([Sm],t.prototype,"nodeSelectedOutline",void 0),h_([Sm],t.prototype,"adjustNodePosition",void 0),h_([Sm],t.prototype,"autoExpand",void 0),h_([Sm],t.prototype,"adjustEdge",void 0),h_([Sm],t.prototype,"adjustEdgeMiddle",void 0),h_([Sm],t.prototype,"adjustEdgeStartAndEnd",void 0),h_([Sm],t.prototype,"adjustEdgeStart",void 0),h_([Sm],t.prototype,"adjustEdgeEnd",void 0),h_([Sm],t.prototype,"edgeSelectedOutline",void 0),h_([Eb],t.prototype,"updateEditConfig",null),h_([Eb],t.prototype,"updateTextMode",null),t}(),v_=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){var o=this;null==t||t.split(",").forEach((function(t){t=t.trim(),o._events[t]||(o._events[t]=[]),o._events[t].push({callback:e,once:!!n})}))},t.prototype.once=function(t,e){var n=this;null==t||t.split(",").forEach((function(t){t=t.trim(),n.on(t,e,!0)}))},t.prototype.emit=function(t,e){var n=this;null==t||t.split(",").forEach((function(t){var o=n._events[t]||[],i=n._events["*"]||[],r=function(o){for(var i=o.length,r=0;r<i;r++)if(o[r]){var a=o[r],s=a.callback;a.once&&(o.splice(r,1),0===o.length&&delete n._events[t],i--,r--),s.apply(n,[e])}};r(o),r(i)}))},t.prototype.off=function(t,e){var n=this;t||(this._events={}),t.split(",").forEach((function(t){if(e){for(var o=n._events[t]||[],i=o.length,r=0;r<i;r++)o[r].callback===e&&(o.splice(r,1),i--,r--);0===o.length&&delete n._events[t]}else delete n._events[t]}))},t.prototype.getEvents=function(){return this._events},t}(),y_=function(){return y_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},y_.apply(this,arguments)},m_=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},b_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},x_=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))};!function(){function t(t){this.modelMap=new Map,this.nodeModelMap=new Map,this.edgeModelMap=new Map,this.elementsModelMap=new Map,this.nodeMoveRules=[],this.nodes=[],this.edges=[],this.overlapMode=Sy.DEFAULT,this.gridSize=1,this.partial=!1;var e,n=t.container,o=t.partial,i=t.background,r=void 0===i?{}:i,a=t.grid,s=t.idGenerator,l=t.edgeGenerator,u=t.animation,c=t.customTrajectory;this.rootEl=n,this.partial=!!o,this.background=r,"object"==typeof a&&(this.gridSize=a.size||1),this.theme=tw(t.style),this.edgeType=t.edgeType||"polyline",this.animation=(e=u)&&"boolean"!=typeof e?md(Is(Ay),e):Is(!0===e?My:Ay),this.overlapMode=t.overlapMode||Sy.DEFAULT,this.width=t.width||this.rootEl.getBoundingClientRect().width,this.height=t.height||this.rootEl.getBoundingClientRect().height,this.eventCenter=new v_,this.editConfigModel=new g_(t),this.transformModel=new N_(this.eventCenter,t),this.flowId=JE(),this.idGenerator=s,this.edgeGenerator=function(t,e){if("function"!=typeof e)return function(e,n,o){return Object.assign({type:t.edgeType},o)};return function(n,o,i){var r=e(n,o,i);return r?"string"==typeof r?Object.assign({},i,{type:r}):Object.assign({type:r},i):{type:t.edgeType}}}(this,l),this.customTrajectory=c}Object.defineProperty(t.prototype,"nodesMap",{get:function(){return this.nodes.reduce((function(t,e,n){return t[e.id]={index:n,model:e},t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgesMap",{get:function(){return this.edges.reduce((function(t,e,n){return t[e.id]={index:n,model:e},t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"modelsMap",{get:function(){return x_(x_([],b_(this.nodes),!1),b_(this.edges),!1).reduce((function(t,e){return t[e.id]=e,t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sortElements",{get:function(){for(var t=x_(x_([],b_(this.nodes),!1),b_(this.edges),!1).sort((function(t,e){return t.zIndex-e.zIndex})),e=[],n=[-200,-200],o=[this.width+Ty,this.height+Ty],i=0;i<t.length;i++){var r=t[i];r.visible&&(!this.partial||r.isSelected||this.isElementInArea(r,n,o,!1,!1))&&e.push(r)}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textEditElement",{get:function(){var t=this.nodes.find((function(t){return t.state===xy.TEXT_EDIT})),e=this.edges.find((function(t){return t.state===xy.TEXT_EDIT}));return t||e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectElements",{get:function(){var t=new Map;return this.nodes.forEach((function(e){e.isSelected&&t.set(e.id,e)})),this.edges.forEach((function(e){e.isSelected&&t.set(e.id,e)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectNodes",{get:function(){var t=[];return this.nodes.forEach((function(e){e.isSelected&&t.push(e)})),t},enumerable:!1,configurable:!0}),t.prototype.getAreaElement=function(t,e,n,o,i){var r=this;void 0===n&&(n=!0),void 0===o&&(o=!0),void 0===i&&(i=!1);var a=[];return xu(x_(x_([],b_(this.nodes),!1),b_(this.edges),!1),(function(s){var l=r.isElementInArea(s,t,e,n,o);i&&!s.visible||!l||a.push(s)})),a},t.prototype.getModel=function(t){return this.modelMap.get(t)},t.prototype.getNodeModelById=function(t){var e;return this.fakeNode&&t===this.fakeNode.id?this.fakeNode:null===(e=this.nodesMap[t])||void 0===e?void 0:e.model},t.prototype.getPointByClient=function(t){var e=t.x,n=t.y,o=this.rootEl.getBoundingClientRect(),i={x:e-o.left,y:n-o.top},r=b_(this.transformModel.HtmlPointToCanvasPoint([i.x,i.y]),2);return{domOverlayPosition:i,canvasOverlayPosition:{x:r[0],y:r[1]}}},t.prototype.isElementInArea=function(t,e,n,o,i){var r;if(void 0===o&&(o=!0),void 0===i&&(i=!0),t.BaseType===_y.NODE){for(var a=SE(t),s=a.minX,l=a.minY,u=a.maxX,c=a.maxY,d=[{x:s,y:l},{x:u,y:l},{x:u,y:c},{x:s,y:c}],h=i,p=0;p<d.length;p++){var f=d[p],g=f.x,v=f.y;if(g=(r=b_(this.transformModel.CanvasPointToHtmlPoint([g,v]),2))[0],v=r[1],aE([g,v],e,n)!==i){h=!i;break}}return h}if(t.BaseType===_y.EDGE){var y=t.startPoint,m=t.endPoint,b=this.transformModel.CanvasPointToHtmlPoint([y.x,y.y]),x=this.transformModel.CanvasPointToHtmlPoint([m.x,m.y]),_=aE(b,e,n),E=aE(x,e,n);return o?_&&E:_||E}return!1},t.prototype.graphDataToModel=function(t){var e=this;if(this.width&&this.height||this.resize(),!t)return this.nodes=[],void(this.edges=[]);if(t.nodes?this.nodes=Ju(t.nodes,(function(t){return e.getModelAfterSnapToGrid(t)})):this.nodes=[],t.edges){var n=this.edgeType;this.edges=Ju(t.edges,(function(t){var o,i=e.getModel(null!==(o=t.type)&&void 0!==o?o:n);if(!i)throw new Error("找不到".concat(t.type,"对应的边。"));var r=new i(t,e);return e.edgeModelMap.set(r.id,r),e.elementsModelMap.set(r.id,r),r}))}else this.edges=[]},t.prototype.modelToGraphData=function(){var t=[];this.edges.forEach((function(e){var n=e.getData();n&&!e.virtual&&t.push(n)}));var e=[];return this.nodes.forEach((function(t){var n=t.getData();n&&!t.virtual&&e.push(n)})),{nodes:e,edges:t}},t.prototype.modelToHistoryData=function(){for(var t=!1,e=[],n=0;n<this.nodes.length;n++){var o=this.nodes[n];if(o.isDragging){t=!0;break}e.push(o.getHistoryData())}if(t)return!1;for(var i=!1,r=[],a=0;a<this.edges.length;a++){var s=this.edges[a];if(s.isDragging){i=!0;break}r.push(s.getHistoryData())}return!i&&{nodes:e,edges:r}},t.prototype.getEdgeModelById=function(t){var e;return null===(e=this.edgesMap[t])||void 0===e?void 0:e.model},t.prototype.getElement=function(t){return this.modelsMap[t]},t.prototype.getNodeEdges=function(t){for(var e=[],n=0;n<this.edges.length;n++){var o=this.edges[n],i=o.sourceNodeId===t,r=o.targetNodeId===t;(i||r)&&e.push(o)}return e},t.prototype.getSelectElements=function(t){void 0===t&&(t=!0);var e=this.selectElements,n={nodes:[],edges:[]};return e.forEach((function(o){if(o.BaseType===_y.NODE&&n.nodes.push(o.getData()),o.BaseType===_y.EDGE){var i=o.getData(),r=e.get(i.sourceNodeId)&&e.get(i.targetNodeId);(t||r)&&n.edges.push(i)}})),n},t.prototype.updateAttributes=function(t,e){var n=this.getElement(t);null==n||n.updateAttributes(e)},t.prototype.changeNodeId=function(t,e){return e||(e=JE()),this.nodesMap[e]?(console.warn("当前流程图已存在节点".concat(e,", 修改失败")),""):this.nodesMap[t]?(this.edges.forEach((function(n){n.sourceNodeId===t&&(n.sourceNodeId=e),n.targetNodeId===t&&(n.targetNodeId=e)})),this.nodesMap[t].model.id=e,this.nodesMap[e]=this.nodesMap[t],e):(console.warn("当前流程图找不到节点".concat(t,", 修改失败")),"")},t.prototype.changeEdgeId=function(t,e){return e||(e=JE()),this.edgesMap[e]?(console.warn("当前流程图已存在边: ".concat(e,", 修改失败")),""):this.edgesMap[t]?(this.edges.forEach((function(n){n.id===t&&n.changeEdgeId(e)})),e):(console.warn("当前流程图找不到边: ".concat(e,", 修改失败")),"")},t.prototype.getTextModel=function(t){var e=this.editConfigModel,n=e.textMode,o=e.nodeTextMode,i=e.edgeTextMode;return t.BaseType===_y.NODE?t.textMode||o||n||Ny.TEXT:t.BaseType===_y.EDGE?t.textMode||i||n||Ny.TEXT:void 0},t.prototype.setTextMode=function(t,e){this.editConfigModel.updateEditConfig({textMode:t})},t.prototype.setFakeNode=function(t){this.fakeNode=t},t.prototype.removeFakeNode=function(){this.fakeNode=null},t.prototype.setModel=function(t,e){return this.modelMap.set(t,e)},t.prototype.toFront=function(t){var e,n,o,i=(null===(e=this.nodesMap[t])||void 0===e?void 0:e.model)||(null===(n=this.edgesMap[t])||void 0===n?void 0:n.model);i&&(this.overlapMode===Sy.DEFAULT&&(null===(o=this.topElement)||void 0===o||o.setZIndex(),i.setZIndex(9999),this.topElement=i),this.overlapMode===Sy.INCREASE&&this.setElementZIndex(t,"top"))},t.prototype.setElementZIndex=function(t,e){var n,o,i=(null===(n=this.nodesMap[t])||void 0===n?void 0:n.model)||(null===(o=this.edgesMap[t])||void 0===o?void 0:o.model);if(i){var r=void 0;"number"==typeof e?r=e:("top"===e&&(r=iw()),"bottom"===e&&(r=rw())),i.setZIndex(r)}},t.prototype.deleteNode=function(t){var e=this.nodesMap[t].model.getData();this.deleteEdgeBySource(t),this.deleteEdgeByTarget(t),this.nodes.splice(this.nodesMap[t].index,1),this.eventCenter.emit(wy.NODE_DELETE,{data:e})},t.prototype.addNode=function(t,e,n){void 0===e&&(e=wy.NODE_ADD);var o=Oy(t),i=o.id;i&&this.nodesMap[i]&&delete o.id;var r=this.getModelAfterSnapToGrid(o);this.nodes.push(r);var a={data:r.getData()};return n&&(a.e=n),this.eventCenter.emit(e,a),r},t.prototype.getModelAfterSnapToGrid=function(t){var e=this.getModel(t.type);if(!e)throw new Error("找不到".concat(t.type,"对应的节点,请确认是否已注册此类型节点。"));var n=t.x,o=t.y;n&&o&&(t.x=iE(n,this.gridSize),t.y=iE(o,this.gridSize),"object"==typeof t.text&&null!==t.text&&(t.text.x+=t.x-n,t.text.y+=t.y-o));var i=new e(t,this);return this.nodeModelMap.set(i.id,i),this.elementsModelMap.set(i.id,i),i},t.prototype.cloneNode=function(t){var e=this.getNodeModelById(t),n=null==e?void 0:e.getData();if(n){n.x+=30,n.y+=30,n.id="","object"==typeof n.text&&null!==n.text&&(n.text.x+=30,n.text.y+=30);var o=this.addNode(n);return o.setSelected(!0),null==e||e.setSelected(!1),o.getData()}},t.prototype.moveNode=function(t,e,n,o){var i;void 0===o&&(o=!1);var r=this.nodesMap[t];if(r){var a=r.model;e=(i=b_(a.getMoveDistance(e,n,o),2))[0],n=i[1],this.moveEdge(t,e,n)}else console.warn("不存在id为".concat(t,"的节点"))},t.prototype.moveNode2Coordinate=function(t,e,n,o){void 0===o&&(o=!1);var i=this.nodesMap[t];if(i){var r=i.model,a=e-r.x,s=n-r.y;this.moveNode(t,a,s,o)}else console.warn("不存在id为".concat(t,"的节点"))},t.prototype.editText=function(t){this.setElementStateById(t,xy.TEXT_EDIT)},t.prototype.addEdge=function(t){var e=Oy(t),n=e.type;n||(n=this.edgeType),e.id&&this.edgesMap[e.id]&&delete e.id;var o=this.getModel(n);if(!o)throw new Error("找不到".concat(n,"对应的边,请确认是否已注册此类型边。"));var i=new o(y_(y_({},e),{type:n}),this);this.edgeModelMap.set(i.id,i),this.elementsModelMap.set(i.id,i);var r=i.getData();return this.edges.push(i),this.eventCenter.emit(wy.EDGE_ADD,{data:r}),i},t.prototype.moveEdge=function(t,e,n){for(var o=0;o<this.edges.length;o++){var i=this.edges[o],r=i.textPosition,a=r.x,s=r.y,l=this.edges[o].sourceNodeId===t,u=this.edges[o].targetNodeId===t;l&&i.moveStartPoint(e,n),u&&i.moveEndPoint(e,n),(l||u)&&this.handleEdgeTextMove(i,a,s)}},t.prototype.handleEdgeTextMove=function(t,e,n){var o;if(t.customTextPosition)t.resetTextPosition();else{if(t.modelType===Ey.POLYLINE_EDGE&&(null===(o=t.text)||void 0===o?void 0:o.value)){var i=t.text,r=Q_(i,t.points);t.moveText(r.x-i.x,r.y-i.y)}var a=t.textPosition,s=a.x,l=a.y;t.moveText(s-e,l-n)}},t.prototype.deleteEdgeBySourceAndTarget=function(t,e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].sourceNodeId===t&&this.edges[n].targetNodeId===e){var o=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(wy.EDGE_DELETE,{data:o})}},t.prototype.deleteEdgeById=function(t){if(this.edgesMap[t]){var e=this.edgesMap[t].index,n=this.edgesMap[t].model.getData();this.edges.splice(e,1),this.eventCenter.emit(wy.EDGE_DELETE,{data:n})}},t.prototype.deleteEdgeBySource=function(t){for(var e=0;e<this.edges.length;e++)if(this.edges[e].sourceNodeId===t){var n=this.edges[e].getData();this.edges.splice(e,1),e--,this.eventCenter.emit(wy.EDGE_DELETE,{data:n})}},t.prototype.deleteEdgeByTarget=function(t){for(var e=0;e<this.edges.length;e++)if(this.edges[e].targetNodeId===t){var n=this.edges[e].getData();this.edges.splice(e,1),e--,this.eventCenter.emit(wy.EDGE_DELETE,{data:n})}},t.prototype.setElementStateById=function(t,e,n){this.nodes.forEach((function(o){o.id===t?o.setElementState(e,n):o.setElementState(xy.DEFAULT)})),this.edges.forEach((function(o){o.id===t?o.setElementState(e,n):o.setElementState(xy.DEFAULT)}))},t.prototype.updateText=function(t,e){var n=Uu(x_(x_([],b_(this.nodes),!1),b_(this.edges),!1),(function(e){return e.id===t}));null==n||n.updateText(e)},t.prototype.selectNodeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var o=null===(n=this.nodesMap[t])||void 0===n?void 0:n.model;null==o||o.setSelected(!0)},t.prototype.selectEdgeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var o=null===(n=this.edgesMap[t])||void 0===n?void 0:n.model;null==o||o.setSelected(!0)},t.prototype.selectElementById=function(t,e){void 0===e&&(e=!1),e||this.clearSelectElements();var n=this.getElement(t);null==n||n.setSelected(!0)},t.prototype.clearSelectElements=function(){var t;this.selectElements.forEach((function(t){null==t||t.setSelected(!1)})),this.selectElements.clear(),this.overlapMode===Sy.DEFAULT&&(null===(t=this.topElement)||void 0===t||t.setZIndex())},t.prototype.moveNodes=function(t,e,n,o){var i,r,a,s=this;void 0===o&&(o=!1);for(var l=t.reduce((function(t,i){var r,a=null===(r=s.nodesMap[i])||void 0===r?void 0:r.model;return a&&(t[i]=a.getMoveDistance(e,n,o)),t}),{}),u=0;u<this.edges.length;u++){var c=this.edges[u],d=c.textPosition,h=d.x,p=d.y,f=l[c.sourceNodeId],g=l[c.targetNodeId],v=void 0,y=void 0;f&&g&&c.modelType===Ey.POLYLINE_EDGE?(v=(i=b_(f,2))[0],y=i[1],c.updatePointsList(v,y)):(f&&(v=(r=b_(f,2))[0],y=r[1],c.moveStartPoint(v,y)),g&&(v=(a=b_(g,2))[0],y=a[1],c.moveEndPoint(v,y))),(f||g)&&this.handleEdgeTextMove(c,h,p)}},t.prototype.addNodeMoveRules=function(t){this.nodeMoveRules.includes(t)||this.nodeMoveRules.push(t)},t.prototype.setDefaultEdgeType=function(t){this.edgeType=t},t.prototype.changeNodeType=function(t,e){var n=this.getNodeModelById(t);if(n){var o=n.getData();o.type=e;var i=this.getModel(e);if(!i)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));var r=new i(o,this);this.nodes.splice(this.nodesMap[t].index,1,r),this.getNodeEdges(t).forEach((function(e){if(e.sourceNodeId===t){var n=PE(r,e.startPoint,r.width,r.height);e.updateStartPoint(n)}if(e.targetNodeId===t){n=PE(r,e.endPoint,r.width,r.height);e.updateEndPoint(n)}}))}else console.warn("找不到id为".concat(t,"的节点"))},t.prototype.changeEdgeType=function(t,e){var n=this.getEdgeModelById(t);if(n){if(n.type!==e){var o=n.getData();o.type=e;var i=this.getModel(e);if(!i)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));delete o.pointsList;var r=new i(o,this);this.edges.splice(this.edgesMap[t].index,1,r)}}else console.warn("找不到id为".concat(t,"的边"))},t.prototype.getNodeIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetNodeId===t&&e.push(n)})),e},t.prototype.getNodeOutgoingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceNodeId===t&&e.push(n)})),e},t.prototype.getAnchorIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetAnchorId===t&&e.push(n)})),e},t.prototype.getAnchorOutgoingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceAnchorId===t&&e.push(n)})),e},t.prototype.getNodeIncomingNode=function(t){var e=this,n=[];return this.edges.forEach((function(o){var i;o.targetNodeId===t&&n.push(null===(i=e.nodesMap[o.sourceNodeId])||void 0===i?void 0:i.model)})),n},t.prototype.getNodeOutgoingNode=function(t){var e=this,n=[];return this.edges.forEach((function(o){o.sourceNodeId===t&&n.push(e.nodesMap[o.targetNodeId].model)})),n},t.prototype.setTheme=function(t){this.theme=ew(y_(y_({},this.theme),t))},t.prototype.resize=function(t,e){this.width=t||this.rootEl.getBoundingClientRect().width,this.height=e||this.rootEl.getBoundingClientRect().height,this.width&&this.height||console.warn("渲染画布的时候无法获取画布宽高,请确认在container已挂载到DOM。@see https://github.com/didi/LogicFlow/issues/675")},t.prototype.clearData=function(){this.nodes=[],this.edges=[]},t.prototype.getVirtualRectSize=function(){var t=this.nodes,e=[],n=[];t.forEach((function(t){var o=t.x,i=t.y,r=t.width,a=t.height,s=t.getNodeStyle().strokeWidth,l=void 0===s?0:s,u=o+r/2+l,c=o-r/2-l,d=i+a/2+l,h=i-a/2-l;e=e.concat([u,c].filter((function(t){return!Number.isNaN(t)}))),n=n.concat([d,h].filter((function(t){return!Number.isNaN(t)})))}));var o=Math.min.apply(Math,x_([],b_(e),!1)),i=Math.max.apply(Math,x_([],b_(e),!1)),r=Math.min.apply(Math,x_([],b_(n),!1)),a=i-o||0,s=Math.max.apply(Math,x_([],b_(n),!1))-r||0;return{width:a,height:s,x:o+a/2,y:r+s/2}},t.prototype.translateCenter=function(){var t=this,e=t.nodes,n=t.width,o=t.height,i=t.rootEl,r=t.transformModel;if(e.length){var a=n||i.clientWidth,s=o||i.clientHeight,l=this.getVirtualRectSize(),u=l.x,c=l.y;r.focusOn(u,c,a,s)}},t.prototype.fitView=function(t,e){void 0===t&&(t=20),void 0===e&&(e=20);var n=this,o=n.nodes,i=n.width,r=n.height,a=n.rootEl,s=n.transformModel;if(o.length){var l=i||a.clientWidth,u=r||a.clientHeight,c=this.getVirtualRectSize(),d=c.width,h=c.height,p=c.x,f=c.y,g=(d+e)/l,v=(h+t)/u,y=1/Math.max(g,v),m=[l/2,u/2];s.zoom(y,m),s.focusOn(p,f,l,u)}},t.prototype.openEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.openEdgeAnimation()},t.prototype.closeEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.closeEdgeAnimation()},t.prototype.getPartial=function(){return this.partial},t.prototype.setPartial=function(t){this.partial=t},m_([Sm],t.prototype,"width",void 0),m_([Sm],t.prototype,"height",void 0),m_([Sm],t.prototype,"edgeType",void 0),m_([Sm],t.prototype,"nodes",void 0),m_([Sm],t.prototype,"edges",void 0),m_([Sm],t.prototype,"fakeNode",void 0),m_([Sm],t.prototype,"overlapMode",void 0),m_([Sm],t.prototype,"background",void 0),m_([Sm],t.prototype,"gridSize",void 0),m_([Sm],t.prototype,"transformModel",void 0),m_([Sm],t.prototype,"editConfigModel",void 0),m_([Sm],t.prototype,"partial",void 0),m_([Om],t.prototype,"nodesMap",null),m_([Om],t.prototype,"edgesMap",null),m_([Om],t.prototype,"modelsMap",null),m_([Om],t.prototype,"sortElements",null),m_([Om],t.prototype,"textEditElement",null),m_([Om],t.prototype,"selectElements",null),m_([Om],t.prototype,"selectNodes",null),m_([Eb],t.prototype,"setTextMode",null),m_([Eb],t.prototype,"setFakeNode",null),m_([Eb],t.prototype,"removeFakeNode",null),m_([Eb],t.prototype,"setModel",null),m_([Eb],t.prototype,"toFront",null),m_([Eb],t.prototype,"setElementZIndex",null),m_([Eb],t.prototype,"deleteNode",null),m_([Eb],t.prototype,"addNode",null),m_([Eb],t.prototype,"cloneNode",null),m_([Eb],t.prototype,"moveNode",null),m_([Eb],t.prototype,"moveNode2Coordinate",null),m_([Eb],t.prototype,"editText",null),m_([Eb],t.prototype,"addEdge",null),m_([Eb],t.prototype,"moveEdge",null),m_([Eb],t.prototype,"deleteEdgeBySourceAndTarget",null),m_([Eb],t.prototype,"deleteEdgeById",null),m_([Eb],t.prototype,"deleteEdgeBySource",null),m_([Eb],t.prototype,"deleteEdgeByTarget",null),m_([Eb],t.prototype,"setElementStateById",null),m_([Eb],t.prototype,"updateText",null),m_([Eb],t.prototype,"selectNodeById",null),m_([Eb],t.prototype,"selectEdgeById",null),m_([Eb],t.prototype,"selectElementById",null),m_([Eb],t.prototype,"clearSelectElements",null),m_([Eb],t.prototype,"moveNodes",null),m_([Eb],t.prototype,"setDefaultEdgeType",null),m_([Eb],t.prototype,"changeNodeType",null),m_([Eb],t.prototype,"changeEdgeType",null),m_([Eb],t.prototype,"getNodeIncomingEdge",null),m_([Eb],t.prototype,"getNodeOutgoingEdge",null),m_([Eb],t.prototype,"getAnchorIncomingEdge",null),m_([Eb],t.prototype,"getAnchorOutgoingEdge",null),m_([Eb],t.prototype,"getNodeIncomingNode",null),m_([Eb],t.prototype,"getNodeOutgoingNode",null),m_([Eb],t.prototype,"setTheme",null),m_([Eb],t.prototype,"resize",null),m_([Eb],t.prototype,"clearData",null),m_([Eb],t.prototype,"translateCenter",null),m_([Eb],t.prototype,"fitView",null),m_([Eb],t.prototype,"openEdgeAnimation",null),m_([Eb],t.prototype,"closeEdgeAnimation",null),m_([Eb],t.prototype,"setPartial",null)}();var __=function(){return __=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},__.apply(this,arguments)},E_=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a};!function(){function t(t){this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=t}t.prototype.getStyle=function(){return __({},this.graphModel.theme.snapline)},t.prototype.getCenterSnapLine=function(t,e){for(var n=t.x,o=t.y,i=!1,r=!1,a=0;a<e.length;a++){var s=e[a];if(s.id!==t.id&&(n===s.x&&(i=!0),o===s.y&&(r=!0),i&&r))break}return{isShowVertical:i,isShowHorizontal:r,position:{x:n,y:o}}},t.prototype.getHorizontalSnapline=function(t,e){var n,o=!1,i=0,r=t.id;if(r){var a=this.graphModel.fakeNode;if(a&&a.id===r)n=SE(a);else{var s=this.graphModel.getNodeModelById(r);s&&(n=SE(s))}}for(var l=0;l<e.length;l++){var u=e[l];if(u.id!==t.id){var c=SE(u);if(c.minY===(null==n?void 0:n.minY)||c.maxY===(null==n?void 0:n.minY)){o=!0,i=n.minY;break}if(c.minY===(null==n?void 0:n.maxY)||c.maxY===(null==n?void 0:n.maxY)){o=!0,i=n.maxY;break}}}return{isShowHorizontal:o,isShowVertical:this.isShowVertical,position:__(__({},this.position),{y:i})}},t.prototype.getVerticalSnapline=function(t,e){var n,o=!1,i=0,r=t.id;if(r){var a=this.graphModel.fakeNode;if(a&&a.id===r)n=SE(a);else{var s=this.graphModel.getNodeModelById(r);s&&(n=SE(s))}}for(var l=0;l<e.length;l++){var u=e[l];if(u.id!==t.id){var c=SE(u);if(c.minX===(null==n?void 0:n.minX)||c.maxX===(null==n?void 0:n.minX)){o=!0,i=n.minX;break}if(c.minX===(null==n?void 0:n.maxX)||c.maxX===(null==n?void 0:n.maxX)){o=!0,i=n.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:o,position:__(__({},this.position),{x:i})}},t.prototype.getSnapLinePosition=function(t,e){var n=this.getCenterSnapLine(t,e),o=n.isShowHorizontal,i=n.isShowVertical;if(!o){var r=this.getHorizontalSnapline(t,e);r.isShowHorizontal&&(n.isShowHorizontal=r.isShowHorizontal,n.position.y=r.position.y)}if(!i){var a=this.getVerticalSnapline(t,e);a.isShowVertical&&(n.isShowVertical=a.isShowVertical,n.position.x=a.position.x)}return n},t.prototype.setSnaplineInfo=function(t){var e=t.isShowHorizontal,n=t.isShowVertical,o=t.position;this.position=o,this.isShowHorizontal=e,this.isShowVertical=n},t.prototype.clearSnapline=function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1},t.prototype.setNodeSnapLine=function(t){var e=this.graphModel.nodes,n=this.getSnapLinePosition(t,e);this.setSnaplineInfo(n)},E_([Sm],t.prototype,"isShowHorizontal",void 0),E_([Sm],t.prototype,"isShowVertical",void 0),E_([Sm],t.prototype,"position",void 0),E_([Eb],t.prototype,"clearSnapline",null),E_([Eb],t.prototype,"setNodeSnapLine",null)}();var w_=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},S_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},C_={false:[-1/0,-1/0,1/0,1/0],true:[-1/0,-1/0,1/0,1/0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},N_=function(){function t(t,e){this.MINI_SCALE_SIZE=.2,this.MAX_SCALE_SIZE=16,this.SCALE_X=1,this.SKEW_Y=0,this.SKEW_X=0,this.SCALE_Y=1,this.TRANSLATE_X=0,this.TRANSLATE_Y=0,this.ZOOM_SIZE=.04,this.translateLimitMinX=-1/0,this.translateLimitMinY=-1/0,this.translateLimitMaxX=1/0,this.translateLimitMaxY=1/0,this.eventCenter=t;var n=e.stopMoveGraph,o=void 0!==n&&n;this.updateTranslateLimits(o)}return t.prototype.setZoomMiniSize=function(t){this.MINI_SCALE_SIZE=t},t.prototype.setZoomMaxSize=function(t){this.MAX_SCALE_SIZE=t},t.prototype.HtmlPointToCanvasPoint=function(t){var e=S_(t,2),n=e[0],o=e[1];return[(n-this.TRANSLATE_X)/this.SCALE_X,(o-this.TRANSLATE_Y)/this.SCALE_Y]},t.prototype.CanvasPointToHtmlPoint=function(t){var e=S_(t,2),n=e[0],o=e[1];return[n*this.SCALE_X+this.TRANSLATE_X,o*this.SCALE_Y+this.TRANSLATE_Y]},t.prototype.moveCanvasPointByHtml=function(t,e,n){var o=S_(t,2),i=o[0],r=o[1];return[i+e/this.SCALE_X,r+n/this.SCALE_Y]},t.prototype.fixDeltaXY=function(t,e){return[t/this.SCALE_X,e/this.SCALE_Y]},t.prototype.getTransformStyle=function(){var t=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(t,")")}},t.prototype.zoom=function(t,e){void 0===t&&(t=!1);var n=this.SCALE_X,o=this.SCALE_Y;return"number"==typeof t?(n=t,o=t):t?(n+=this.ZOOM_SIZE,o+=this.ZOOM_SIZE):(n-=this.ZOOM_SIZE,o-=this.ZOOM_SIZE),n<this.MINI_SCALE_SIZE||n>this.MAX_SCALE_SIZE||(e&&(this.TRANSLATE_X-=(n-this.SCALE_X)*e[0],this.TRANSLATE_Y-=(o-this.SCALE_Y)*e[1]),this.SCALE_X=n,this.SCALE_Y=o,this.emitGraphTransform("zoom")),"".concat(100*this.SCALE_X,"%")},t.prototype.emitGraphTransform=function(t){this.eventCenter.emit(wy.GRAPH_TRANSFORM,{type:t,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},t.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},t.prototype.translate=function(t,e){this.TRANSLATE_X+t<=this.translateLimitMaxX&&this.TRANSLATE_X+t>=this.translateLimitMinX&&(this.TRANSLATE_X+=t),this.TRANSLATE_Y+e<=this.translateLimitMaxY&&this.TRANSLATE_Y+e>=this.translateLimitMinY&&(this.TRANSLATE_Y+=e),this.emitGraphTransform("translate")},t.prototype.focusOn=function(t,e,n,o){var i=S_(this.CanvasPointToHtmlPoint([t,e]),2),r=i[0],a=i[1],s=S_([n/2-r,o/2-a],2),l=s[0],u=s[1];this.TRANSLATE_X+=l,this.TRANSLATE_Y+=u,this.emitGraphTransform("focusOn")},t.prototype.updateTranslateLimits=function(t){var e;e=S_(Array.isArray(t)&&4===t.length?t:C_[t.toString()],4),this.translateLimitMinX=e[0],this.translateLimitMinY=e[1],this.translateLimitMaxX=e[2],this.translateLimitMaxY=e[3]},w_([Sm],t.prototype,"SCALE_X",void 0),w_([Sm],t.prototype,"SKEW_Y",void 0),w_([Sm],t.prototype,"SKEW_X",void 0),w_([Sm],t.prototype,"SCALE_Y",void 0),w_([Sm],t.prototype,"TRANSLATE_X",void 0),w_([Sm],t.prototype,"TRANSLATE_Y",void 0),w_([Sm],t.prototype,"ZOOM_SIZE",void 0),w_([Eb],t.prototype,"zoom",null),w_([Eb],t.prototype,"resetZoom",null),w_([Eb],t.prototype,"translate",null),w_([Eb],t.prototype,"focusOn",null),t}(),T_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},A_=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))},M_=function(t){var e=[],n={};return t.forEach((function(t){var e="".concat(t.x,"-").concat(t.y);t.id=e,n[e]=t})),Object.keys(n).forEach((function(t){e.push(n[t])})),e},O_=function(t,e){return 0===t.width&&0===t.height?t:{x:t.x,y:t.y,centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}},P_=function(t,e,n){var o=function(t,e){var n=Math.abs(t.x-e.centerX),o=Math.abs(t.y-e.centerY);return n/e.width>o/e.height?Cy.HORIZONTAL:Cy.VERTICAL}(n,e);return o===Cy.HORIZONTAL?{x:n.x>t.centerX?t.maxX:t.minX,y:n.y}:{x:n.x,y:n.y>t.centerY?t.maxY:t.minY}},k_=function(t,e){var n=Math.min(t.minX,e.minX),o=Math.min(t.minY,e.minY),i=Math.max(t.maxX,e.maxX),r=Math.max(t.maxY,e.maxY);return{x:(n+i)/2,y:(o+r)/2,centerX:(n+i)/2,centerY:(o+r)/2,minX:n,minY:o,maxX:i,maxY:r,height:r-o,width:i-n}},R_=function(t){var e=t.minX,n=t.minY,o=t.maxX,i=t.maxY;return[{x:e,y:n},{x:o,y:n},{x:o,y:i},{x:e,y:i}]},D_=function(t,e){var n=t.x,o=t.y;return n<e.minX||n>e.maxX||o<e.minY||o>e.maxY},L_=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},I_=function(t,e,n,o,i){return L_(t,e)+L_(t,n)+function(t,e){var n=0;return e.forEach((function(e){e&&(t.x===e.x&&(n+=-2),t.y===e.y&&(n+=-2))})),n}(t,[e,n,o,i])},j_=function(t,e,n,o,i){i||(i=0),t.unshift(e[o]),n[o]&&n[o]!==o&&i<=100&&j_(t,e,n,n[o],i+1)},B_=function(t,e,n,o){var i=e.x-t.x,r=e.y-t.y,a=o.x-n.x,s=o.y-n.y,l=(-r*(t.x-n.x)+i*(t.y-n.y))/(-a*r+i*s),u=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*r+i*s);return l>=0&&l<=1&&u>=0&&u<=1},H_=function(t,e,n){if(0===n.width&&0===n.height)return!1;var o=T_(R_(n),4),i=o[0],r=o[1],a=o[2],s=o[3];return B_(t,e,i,r)||B_(t,e,i,s)||B_(t,e,r,a)||B_(t,e,a,s)},F_=function(t,e,n,o,i,r,a){var s=[],l=[e],u={},c={},d={};e.id&&(c[e.id]=0,d[e.id]=I_(e,n,e));var h={};t.forEach((function(t){t.id&&(h[t.id]=t)}));for(var p=function(){var p,f,g,v,y=1/0;if(l.forEach((function(t){t.id&&d[t.id]<y&&(y=d[t.id],p=t)})),p===n&&n.id){var m=[];return j_(m,h,u,n.id),{value:m}}if(!p)return{value:[e,n]};g=p,(v=(f=l).indexOf(g))>-1&&f.splice(v,1),s.push(p),function(t,e,n,o){var i=[];return t.forEach((function(t){t!==e&&(t.x!==e.x&&t.y!==e.y||H_(t,e,n)||H_(t,e,o)||i.push(t))})),M_(i)}(t,p,o,i).forEach((function(t){if(-1===s.indexOf(t)&&(-1===l.indexOf(t)&&l.push(t),(null==p?void 0:p.id)&&(null==t?void 0:t.id))){var o=d[p.id]+L_(p,t);if(c[t.id]&&o>=c[t.id])return;u[t.id]=p.id,c[t.id]=o,d[t.id]=c[t.id]+I_(t,n,e,r,a)}}))};l.length;){var f=p();if("object"==typeof f)return f.value}return[e,n]},z_=function(t){return SE(t)},W_=function(t){for(var e=1;e<t.length-1;){var n=t[e-1],o=t[e],i=t[e+1];n.x===o.x&&o.x===i.x||n.y===o.y&&o.y===i.y?t.splice(e,1):e++}return t},G_=function(t,e,n,o,i){var r,a,s=z_(n),l=z_(o),u=O_(s,i),c=O_(l,i),d=P_(u,s,t),h=P_(c,l,e);if(r=u,a=c,2*Math.abs(r.centerX-a.centerX)<r.width+a.width&&2*Math.abs(r.centerY-a.centerY)<r.height+a.height){var p=Z_(t,e,d,h);return A_(A_([t,d],T_(p),!1),[h,e],!1)}var f=function(t,e){void 0===t&&(t=[]);var n=[],o=[];t.forEach((function(t){n.push(t.x),o.push(t.y)}));var i=Math.min.apply(Math,A_([],T_(n),!1)),r=Math.max.apply(Math,A_([],T_(n),!1)),a=Math.min.apply(Math,A_([],T_(o),!1)),s=Math.max.apply(Math,A_([],T_(o),!1)),l=r-i,u=s-a;return e&&(l+=e,u+=e),{centerX:(i+r)/2,centerY:(a+s)/2,maxX:r,maxY:s,minX:i,minY:a,x:(i+r)/2,y:(a+s)/2,height:u,width:l}}([d,h]),g=k_(u,f),v=k_(c,f),y=[];y=(y=y.concat(R_(g))).concat(R_(v));var m={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[f,g,v].forEach((function(t){y=y.concat(function(t,e){return A_(A_([],T_(function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]}(t,e.x)),!1),T_(function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]}(t,e.y)),!1)}(t,m).filter((function(t){return D_(t,u)&&D_(t,c)})))})),[{x:d.x,y:h.y},{x:h.x,y:d.y}].forEach((function(t){D_(t,u)&&D_(t,c)&&y.push(t)})),y.unshift(d),y.push(h),y=M_(y);var b=F_(y,d,h,s,l,t,e);return b.unshift(t),b.push(e),b.length>2&&(b=W_(b)),M_(b)},U_=function(t){if(1===t.length){var e=T_(t,1)[0];return[e,e]}for(var n=t[0],o=t[1],i=EE(n.x,n.y,o.x,o.y),r=1;r<t.length-1;r++){var a=t[r],s=t[r+1],l=EE(a.x,a.y,s.x,s.y);l>i&&(i=l,n=a,o=s)}return[n,o]},X_=function(t,e,n){var o=wE(t,n),i=wE(e,n);return o&&i},V_=function(t,e,n){var o=wE(t,n),i=wE(e,n);return!(o&&i)&&(o||i)},Y_=function(t,e,n){for(var o=void 0,i=SE(n),r=R_(i),a=0;a<r.length;a++){B_(t,e,r[a],r[(a+1)%r.length])&&(o=[r[a],r[(a+1)%r.length]])}if(o)return function(t,e,n,o){var i=(e.y-t.y)*(o.x-n.x)-(t.x-e.x)*(n.y-o.y);if(0===i)return!1;var r=((e.x-t.x)*(o.x-n.x)*(n.y-t.y)+(e.y-t.y)*(o.x-n.x)*t.x-(o.y-n.y)*(e.x-t.x)*n.x)/i,a=-((e.y-t.y)*(o.y-n.y)*(n.x-t.x)+(e.x-t.x)*(o.y-n.y)*t.y-(o.x-n.x)*(e.y-t.y)*n.y)/i;return(r-t.x)*(r-e.x)<=0&&(a-t.y)*(a-e.y)<=0&&(r-n.x)*(r-o.x)<=0&&(a-n.y)*(a-o.y)<=0&&{x:r,y:a}}(t,e,o[0],o[1])},q_=function(t,e){var n=void 0;return t.x===e.x?n=Cy.VERTICAL:t.y===e.y&&(n=Cy.HORIZONTAL),n},K_=function(t){var e=t.split(" "),n=[];return e&&e.forEach((function(t){var e=T_(t.split(","),2),o=e[0],i=e[1];n.push({x:Number(o),y:Number(i)})})),n},Z_=function(t,e,n,o){var i=[];if(q_(t,n)===q_(e,o))t.y===n.y?(i.push({x:n.x,y:(n.y+o.y)/2}),i.push({x:o.x,y:(n.y+o.y)/2})):(i.push({x:(n.x+o.x)/2,y:n.y}),i.push({x:(n.x+o.x)/2,y:o.y}));else{var r={x:n.x,y:o.y},a=ky(r,t,n),s=ky(r,e,o);if(a||s)r={x:o.x,y:n.y};else{var l=$_(r,t,n),u=$_(r,e,o);l&&u&&(r={x:o.x,y:n.y})}i.push(r)}return i},$_=function(t,e,n){return t.x===e.x&&t.x===n.x||t.y===e.y&&t.y===n.y},J_=function(t){var e=t.start,n=t.end,o=t.sourceNode,i=t.targetNode,r=t.offset,a=SE(o),s=SE(i),l=O_(a,r),u=O_(s,r);return{sNext:P_(l,a,e),ePre:P_(u,s,n)}},Q_=function(t,e){for(var n,o=t.x,i=t.y,r=K_(e),a=Number.MAX_SAFE_INTEGER,s=[],l=0;l<r.length;l++)s.push({start:r[l],end:r[(l+1)%r.length]});if(s.forEach((function(t){var e=t.start,r=t.end;if(e.x===r.x){var s={x:e.x,y:i};if(ky(s,e,r))(l=Math.abs(e.x-o))<a&&(a=l,n=s)}else if(e.y===r.y){var l;s={x:o,y:e.y};if(ky(s,e,r))(l=Math.abs(e.y-i))<a&&(a=l,n=s)}})),!n){var u=s[0],c=u.start,d=u.end;n={x:c.x+(d.x-c.x)/2,y:c.y+(d.y-c.y)/2}}return n},tE=function(t){return yh(t,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},eE=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};var nE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},oE=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))};function iE(t,e){return e*Math.round(t/e)||t}var rE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},aE=function(t,e,n){var o=rE(t,2),i=o[0],r=o[1],a=rE(e,2),s=a[0],l=a[1],u=rE(n,2),c=u[0],d=u[1];return i>s&&i<c&&r>l&&r<d},sE=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();function lE(t,e){return!!(t instanceof cE&&e instanceof cE)}var uE=function(t){function e(n,o,i){var r=t.call(this,3)||this;return r[0]=n,r[1]=o,r[2]=i,r.x=n,r.y=o,r.z=i,Object.setPrototypeOf(r,e.prototype),r}return sE(e,t),e.prototype.add=function(t){if(lE(this,t))return new cE(this.x+t.x,this.y+t.y);var e=this.z+t.z;return new dE((this.x+t.x)/e,(this.y+t.y)/e)},e.prototype.subtract=function(t){if(lE(this,t))return new cE(this.x-t.x,this.y-t.y);var e=this.z-t.z;return 0===e?new cE(this.x-t.x,this.y-t.y):new dE((this.x-t.x)/e,(this.y-t.y)/e)},e}(Array),cE=function(t){function e(n,o,i){var r=t.call(this,n,o,null!=i?i:0)||this;return Object.setPrototypeOf(r,e.prototype),r}return sE(e,t),e.prototype.toString=function(){return"Vector"},e.prototype.dot=function(t){var e=this;return t.reduce((function(t,n,o){return t+n*e[o]}))},e.prototype.cross=function(t){return new e(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)},e.prototype.getLength=function(){return Math.hypot(this.x,this.y)},e.prototype.normalize=function(){var t=this.getLength();return new e(this.x/t,this.y/t)},e.prototype.crossZ=function(t){return this.x*t.y-this.y*t.x},e.prototype.angle=function(t){var e=this.crossZ(t),n=Math.acos(this.normalize().dot(t.normalize()));return e>=0?n:-n},e}(uE),dE=function(t){function e(n,o){var i=t.call(this,n,o,1)||this;return Object.setPrototypeOf(i,e.prototype),i}return sE(e,t),e.prototype.toString=function(){return"Point"},e}(uE),hE=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),pE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},fE=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))},gE=function(t){function e(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var i=t.call(this,n.length)||this;return i.fill(new Array(3)),n.forEach((function(t,e){i[e]=t})),i.columns=n[0].length,i.rows=n.length,Object.setPrototypeOf(i,e.prototype),i}return hE(e,t),e.prototype.getRow=function(t){return this[t]},e.prototype.getColumn=function(t){return fE([],pE(this.map((function(e){return e[t]}))),!1)},e.prototype.transpose=function(){for(var t=[],n=0;n<this.columns;n++)t.push(this.getColumn(n));return new(e.bind.apply(e,fE([void 0],pE(t),!1)))},e.prototype.cross=function(t){var n=new Array(this.rows).fill("").map((function(){return[]}));if(this.columns===t.rows)for(var o=0;o<this.rows;o++)for(var i=this.getRow(o),r=function(e){var r=t.getColumn(e);n[o][e]=i.reduce((function(t,e,n){return t+e*r[n]}),0)},a=0;a<t.columns;a++)r(a);return new(e.bind.apply(e,fE([void 0],pE(n),!1)))},e.prototype.to2D=function(){return this.map((function(t){return[t[0],t[1]]}))},e.prototype.toPoints=function(){return this.map((function(t){return new dE(t[0],t[1])}))},e.prototype.toString=function(){var t=pE(this[0],2),e=t[0],n=t[1],o=pE(this[1],2),i=o[0],r=o[1],a=pE(this[2],2),s=a[0],l=a[1];return"matrix(".concat(e," ").concat(n," ").concat(i," ").concat(r," ").concat(s," ").concat(l,")")},e.prototype.translate=function(t,e){return this.cross(new mE(t,e))},e.prototype.rotate=function(t){return this.cross(new vE(t))},e.prototype.scale=function(t,e){return this.cross(new yE(t,e))},e}(Array),vE=function(t){function e(n){var o=t.call(this,new cE(+Math.cos(n).toFixed(2),+Math.sin(n).toFixed(2),0),new cE(-Math.sin(n).toFixed(2),+Math.cos(n).toFixed(2),0),new cE(0,0,1))||this;return Object.setPrototypeOf(o,e.prototype),o}return hE(e,t),e.prototype.inverse=function(){return this.transpose()},e}(gE),yE=function(t){function e(n,o){var i=t.call(this,new cE(n,0,0),new cE(0,o,0),new cE(0,0,1))||this;return i.sx=n,i.sy=o,Object.setPrototypeOf(i,e.prototype),i}return hE(e,t),e.prototype.inverse=function(){return new e(1/this.sx,1/this.sy)},e}(gE),mE=function(t){function e(n,o){var i=t.call(this,new cE(1,0,0),new cE(0,1,0),new cE(n,o,1))||this;return i.tx=n,i.ty=o,Object.setPrototypeOf(i,e.prototype),i}return hE(e,t),e.prototype.inverse=function(){return new e(-this.tx,-this.ty)},e}(gE);!function(t){var e=t.enforceActions,n=t.computedRequiresReaction,o=t.computedConfigurable,i=t.disableErrorBoundaries,r=t.reactionScheduler,a=t.reactionRequiresObservable,s=t.observableRequiresReaction;if(!0===t.isolateGlobalState&&((ib.pendingReactions.length||ib.inBatch||ib.isRunningReactions)&&jy("isolateGlobalState should be called before MobX is running any reactions"),ob=!0,nb&&(0==--eb().__mobxInstanceCount&&(eb().__mobxGlobals=void 0),ib=new Qm)),void 0!==e){var l=void 0;switch(e){case!0:case"observed":l=!0;break;case!1:case"never":l=!1;break;case"strict":case"always":l="strict";break;default:jy("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}ib.enforceActions=l,ib.allowStateChanges=!0!==l&&"strict"!==l}void 0!==n&&(ib.computedRequiresReaction=!!n),void 0!==a&&(ib.reactionRequiresObservable=!!a),void 0!==s&&(ib.observableRequiresReaction=!!s,ib.allowStateReads=!ib.observableRequiresReaction),void 0!==o&&(ib.computedConfigurable=!!o),void 0!==i&&(!0===i&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),ib.disableErrorBoundaries=!!i),r&&bb(r)}({isolateGlobalState:!0});var bE=function(){return bE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},bE.apply(this,arguments)},xE=function(t){return t.anchors},_E=function(t,e){for(var n,o=xE(e),i=Number.MAX_SAFE_INTEGER,r=0;r<o.length;r++){var a=EE(t.x,t.y,o[r].x,o[r].y);a<i&&(i=a,n={index:r,anchor:bE(bE({},o[r]),{x:o[r].x,y:o[r].y,id:o[r].id})})}return n},EE=function(t,e,n,o){return Math.hypot(t-n,e-o)},wE=function(t,e){var n=!1,o=SE(e);return t.x>=o.minX-0&&t.x<=o.maxX+0&&t.y>=o.minY-0&&t.y<=o.maxY+0&&(n=!0),n},SE=function(t){var e=t.x,n=t.y,o=t.width,i=t.height;return{minX:e-o/2,minY:n-i/2,maxX:e+o/2,maxY:n+i/2,x:e,y:n,width:o,height:i,centerX:e,centerY:n}},CE=function(t,e,n){var o,i=function(t){var e=t,n=e.x,o=e.y,i=e.width,r=e.height,a=e.radius;return[{x:n-i/2+a,y:o-r/2+a,r:a},{x:n+i/2-a,y:o-r/2+a,r:a},{x:n-i/2+a,y:o+r/2-a,r:a},{x:n+i/2-a,y:o+r/2-a,r:a}]}(n),r=Number.MAX_SAFE_INTEGER;return i.forEach((function(e){var n=EE(t.x,t.y,e.x,e.y);n<r&&(r=n,o=e)})),NE(t,e,o)},NE=function(t,e,n){var o,i=n.x,r=n.y,a=n.r;if(e===Cy.HORIZONTAL){var s=i-Math.sqrt(a*a-(t.y-r)*(t.y-r)),l=i+Math.sqrt(a*a-(t.y-r)*(t.y-r));o={x:Math.abs(s-t.x)<Math.abs(l-t.x)?s:l,y:t.y}}else if(e===Cy.VERTICAL){var u=r-Math.sqrt(a*a-(t.x-i)*(t.x-i)),c=r+Math.sqrt(a*a-(t.x-i)*(t.x-i)),d=Math.abs(u-t.y)<Math.abs(c-t.y)?u:c;o={x:t.x,y:d}}return o},TE=function(t,e){var n=e,o=!1,i=n.x,r=n.y,a=n.width,s=n.height,l=n.radius,u=i-a/2+l,c=i+a/2-l,d=r-s/2+l,h=r+s/2-l;return t.y===r+s/2||t.y===r-s/2?o=t.x>u&&t.x<c:t.x!==i+a/2&&t.x!==i-a/2||(o=t.y>d&&t.y<h),o},AE=function(t,e,n){var o,i=n,r=i.x,a=i.y,s=i.rx,l=i.ry;if(e===Cy.HORIZONTAL){var u=r-Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l)),c=r+Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l));o={x:Math.abs(u-t.x)<Math.abs(c-t.x)?u:c,y:t.y}}else if(e===Cy.VERTICAL){var d=a-Math.sqrt(l*l-(t.x-r)*(t.x-r)*l*l/(s*s)),h=a+Math.sqrt(l*l-(t.x-r)*(t.x-r)*l*l/(s*s)),p=Math.abs(d-t.y)<Math.abs(h-t.y)?d:h;o={x:t.x,y:p}}return o},ME=function(t,e,n){for(var o,i=n.pointsPosition,r=Number.MAX_SAFE_INTEGER,a=[],s=0;s<i.length;s++)a.push({start:i[s],end:i[(s+1)%i.length]});return a.forEach((function(n){var i=n.start,a=n.end,s=i,l=a;i.x>a.x&&(s=a,l=i);var u={x:t.x,y:t.y};if(s.x===l.x&&e===Cy.HORIZONTAL&&(u={x:s.x,y:t.y}),s.y===l.y&&e===Cy.VERTICAL&&(u={x:t.x,y:s.y}),s.x!==l.x&&s.y!==l.y){var c=(l.y-s.y)/(l.x-s.x),d=(s.x*l.y-l.x*s.y)/(s.x-l.x);e===Cy.HORIZONTAL?u={x:(t.y-d)/c,y:t.y}:e===Cy.VERTICAL&&(u={x:t.x,y:c*t.x+d})}if(ky(u,i,a)){var h=EE(u.x,u.y,t.x,t.y);h<r&&(r=h,o=u)}})),o},OE=function(t){return yh(t,["id","type","x","y","text","label","properties","virtual","rotate","resizable","rotatable"])},PE=function(t,e,n,o){var i=t.x,r=t.y;return e.x>t.x?i=t.x+n/2:e.x<t.x&&(i=t.x-n/2),e.y>t.y?r=t.y+o/2:e.y<t.y&&(r=t.y-o/2),{x:i,y:r}},kE=function(t){var e=t.rows,n=t.rowsLength,o=t.fontSize,i=0;return e&&e.forEach((function(t){var e=function(t){if(!t)return 0;for(var e=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);t.match(/[A-Z]/)?e+=1.5:e+=o>=1&&o<=126||o>=65376&&o<=65439?1:2}return e}(t);i=e>i?e:i})),{width:Math.ceil(i/2)*o+o/4,height:n*(o+2)+o/4}};let RE;const DE=new Uint8Array(16);function LE(){if(!RE&&(RE="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!RE))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return RE(DE)}var IE=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const jE=[];for(let t=0;t<256;++t)jE.push((t+256).toString(16).slice(1));function BE(t,e=0){return jE[t[e+0]]+jE[t[e+1]]+jE[t[e+2]]+jE[t[e+3]]+"-"+jE[t[e+4]]+jE[t[e+5]]+"-"+jE[t[e+6]]+jE[t[e+7]]+"-"+jE[t[e+8]]+jE[t[e+9]]+"-"+jE[t[e+10]]+jE[t[e+11]]+jE[t[e+12]]+jE[t[e+13]]+jE[t[e+14]]+jE[t[e+15]]}function HE(t){if(!function(t){return"string"==typeof t&&IE.test(t)}(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}function FE(t,e,n){function o(t,o,i,r){var a;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}(t)),"string"==typeof o&&(o=HE(o)),16!==(null===(a=o)||void 0===a?void 0:a.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let s=new Uint8Array(16+t.length);if(s.set(o),s.set(t,o.length),s=n(s),s[6]=15&s[6]|e,s[8]=63&s[8]|128,i){r=r||0;for(let t=0;t<16;++t)i[r+t]=s[t];return i}return BE(s)}try{o.name=t}catch(t){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}function zE(t){return 14+(t+64>>>9<<4)+1}function WE(t,e){const n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function GE(t,e,n,o,i,r){return WE((a=WE(WE(e,t),WE(o,r)))<<(s=i)|a>>>32-s,n);var a,s}function UE(t,e,n,o,i,r,a){return GE(e&n|~e&o,t,e,i,r,a)}function XE(t,e,n,o,i,r,a){return GE(e&o|n&~o,t,e,i,r,a)}function VE(t,e,n,o,i,r,a){return GE(e^n^o,t,e,i,r,a)}function YE(t,e,n,o,i,r,a){return GE(n^(e|~o),t,e,i,r,a)}FE("v3",48,(function(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return function(t){const e=[],n=32*t.length,o="0123456789abcdef";for(let i=0;i<n;i+=8){const n=t[i>>5]>>>i%32&255,r=parseInt(o.charAt(n>>>4&15)+o.charAt(15&n),16);e.push(r)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[zE(e)-1]=e;let n=1732584193,o=-271733879,i=-1732584194,r=271733878;for(let e=0;e<t.length;e+=16){const a=n,s=o,l=i,u=r;n=UE(n,o,i,r,t[e],7,-680876936),r=UE(r,n,o,i,t[e+1],12,-389564586),i=UE(i,r,n,o,t[e+2],17,606105819),o=UE(o,i,r,n,t[e+3],22,-1044525330),n=UE(n,o,i,r,t[e+4],7,-176418897),r=UE(r,n,o,i,t[e+5],12,1200080426),i=UE(i,r,n,o,t[e+6],17,-1473231341),o=UE(o,i,r,n,t[e+7],22,-45705983),n=UE(n,o,i,r,t[e+8],7,1770035416),r=UE(r,n,o,i,t[e+9],12,-1958414417),i=UE(i,r,n,o,t[e+10],17,-42063),o=UE(o,i,r,n,t[e+11],22,-1990404162),n=UE(n,o,i,r,t[e+12],7,1804603682),r=UE(r,n,o,i,t[e+13],12,-40341101),i=UE(i,r,n,o,t[e+14],17,-1502002290),o=UE(o,i,r,n,t[e+15],22,1236535329),n=XE(n,o,i,r,t[e+1],5,-165796510),r=XE(r,n,o,i,t[e+6],9,-1069501632),i=XE(i,r,n,o,t[e+11],14,643717713),o=XE(o,i,r,n,t[e],20,-373897302),n=XE(n,o,i,r,t[e+5],5,-701558691),r=XE(r,n,o,i,t[e+10],9,38016083),i=XE(i,r,n,o,t[e+15],14,-660478335),o=XE(o,i,r,n,t[e+4],20,-405537848),n=XE(n,o,i,r,t[e+9],5,568446438),r=XE(r,n,o,i,t[e+14],9,-1019803690),i=XE(i,r,n,o,t[e+3],14,-187363961),o=XE(o,i,r,n,t[e+8],20,1163531501),n=XE(n,o,i,r,t[e+13],5,-1444681467),r=XE(r,n,o,i,t[e+2],9,-51403784),i=XE(i,r,n,o,t[e+7],14,1735328473),o=XE(o,i,r,n,t[e+12],20,-1926607734),n=VE(n,o,i,r,t[e+5],4,-378558),r=VE(r,n,o,i,t[e+8],11,-2022574463),i=VE(i,r,n,o,t[e+11],16,1839030562),o=VE(o,i,r,n,t[e+14],23,-35309556),n=VE(n,o,i,r,t[e+1],4,-1530992060),r=VE(r,n,o,i,t[e+4],11,1272893353),i=VE(i,r,n,o,t[e+7],16,-155497632),o=VE(o,i,r,n,t[e+10],23,-1094730640),n=VE(n,o,i,r,t[e+13],4,681279174),r=VE(r,n,o,i,t[e],11,-358537222),i=VE(i,r,n,o,t[e+3],16,-722521979),o=VE(o,i,r,n,t[e+6],23,76029189),n=VE(n,o,i,r,t[e+9],4,-640364487),r=VE(r,n,o,i,t[e+12],11,-421815835),i=VE(i,r,n,o,t[e+15],16,530742520),o=VE(o,i,r,n,t[e+2],23,-995338651),n=YE(n,o,i,r,t[e],6,-198630844),r=YE(r,n,o,i,t[e+7],10,1126891415),i=YE(i,r,n,o,t[e+14],15,-1416354905),o=YE(o,i,r,n,t[e+5],21,-57434055),n=YE(n,o,i,r,t[e+12],6,1700485571),r=YE(r,n,o,i,t[e+3],10,-1894986606),i=YE(i,r,n,o,t[e+10],15,-1051523),o=YE(o,i,r,n,t[e+1],21,-2054922799),n=YE(n,o,i,r,t[e+8],6,1873313359),r=YE(r,n,o,i,t[e+15],10,-30611744),i=YE(i,r,n,o,t[e+6],15,-1560198380),o=YE(o,i,r,n,t[e+13],21,1309151649),n=YE(n,o,i,r,t[e+4],6,-145523070),r=YE(r,n,o,i,t[e+11],10,-1120210379),i=YE(i,r,n,o,t[e+2],15,718787259),o=YE(o,i,r,n,t[e+9],21,-343485551),n=WE(n,a),o=WE(o,s),i=WE(i,l),r=WE(r,u)}return[n,o,i,r]}(function(t){if(0===t.length)return[];const e=8*t.length,n=new Uint32Array(zE(e));for(let o=0;o<e;o+=8)n[o>>5]|=(255&t[o/8])<<o%32;return n}(t),8*t.length))}));var qE={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function KE(t,e,n){if(qE.randomUUID&&!e&&!t)return qE.randomUUID();const o=(t=t||{}).random||(t.rng||LE)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=o[t];return e}return BE(o)}function ZE(t,e,n,o){switch(t){case 0:return e&n^~e&o;case 1:case 3:return e^n^o;case 2:return e&n^e&o^n&o}}function $E(t,e){return t<<e|t>>>32-e}FE("v5",80,(function(t){const e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const o=t.length/4+2,i=Math.ceil(o/16),r=new Array(i);for(let e=0;e<i;++e){const n=new Uint32Array(16);for(let o=0;o<16;++o)n[o]=t[64*e+4*o]<<24|t[64*e+4*o+1]<<16|t[64*e+4*o+2]<<8|t[64*e+4*o+3];r[e]=n}r[i-1][14]=8*(t.length-1)/Math.pow(2,32),r[i-1][14]=Math.floor(r[i-1][14]),r[i-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<i;++t){const o=new Uint32Array(80);for(let e=0;e<16;++e)o[e]=r[t][e];for(let t=16;t<80;++t)o[t]=$E(o[t-3]^o[t-8]^o[t-14]^o[t-16],1);let i=n[0],a=n[1],s=n[2],l=n[3],u=n[4];for(let t=0;t<80;++t){const n=Math.floor(t/20),r=$E(i,5)+ZE(n,a,s,l)+u+e[n]+o[t]>>>0;u=l,l=s,s=$E(a,30)>>>0,a=i,i=r}n[0]=n[0]+i>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+l>>>0,n[4]=n[4]+u>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));var JE=function(){return KE()},QE={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#000",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},tw=function(t){var e=Is(QE);return t&&(e=md(e,t)),e},ew=tw,nw=1e3,ow=999,iw=function(){return++nw},rw=function(){return--ow},aw=function(){return aw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},aw.apply(this,arguments)},sw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a};function lw(t){var e=t.x,n=t.y,o=t.width,i=t.height,r=t.className,a=t.strokeWidth,s=t.radius,l=void 0===s?0:s,u=e-o/2,c=n-i/2,d={};return d["stroke-width"]=a,xu(Tu(t),(function(t){var e=sw(t,2),n=e[0],o=e[1];"object"!=typeof o&&(d[n]=o)})),d.className=r?"lf-basic-shape ".concat(r):"lf-basic-shape",l&&(d.rx=l,d.ry=l),d.x=u,d.y=c,fg("rect",aw({},d))}var uw,cw=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),dw=function(){return dw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},dw.apply(this,arguments)},hw=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n},pw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a};!function(t){t[t.LEFT_TOP=0]="LEFT_TOP",t[t.RIGHT_TOP=1]="RIGHT_TOP",t[t.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",t[t.LEFT_BOTTOM=3]="LEFT_BOTTOM"}(uw||(uw={}));var fw=function(t){function e(e){var n=t.call(this)||this;n.updateEdgePointByAnchors=function(){var t=n.nodeModel,e=t.id,o=t.anchors;xu(n.graphModel.getNodeEdges(e),(function(t){if(t.sourceNodeId===e)(n=Uu(o,(function(e){return e.id===t.sourceAnchorId})))&&t.updateStartPoint({x:n.x,y:n.y});else if(t.targetNodeId===e){var n;(n=Uu(o,(function(e){return e.id===t.targetAnchorId})))&&t.updateEndPoint({x:n.x,y:n.y})}}))},n.triggerResizeEvent=function(t,e,o,i,r,a){n.graphModel.eventCenter.emit(wy.NODE_RESIZE,{preData:t,data:e,deltaX:o,deltaY:i,index:r,model:a})},n.recalcResizeInfo=function(t,e,n,o,i){void 0===n&&(n=1),void 0===o&&(o=!1),void 0===i&&(i=!1);var r=Is(e),a=r.deltaX,s=r.deltaY,l=r.width,u=r.height,c=r.PCTResizeInfo;if(c){var d=0,h=0;switch(t){case uw.LEFT_TOP:h=(-1*a-s)/4;break;case uw.RIGHT_TOP:h=(a-s)/4;break;case uw.RIGHT_BOTTOM:h=(a+s)/4;break;case uw.LEFT_BOTTOM:h=(-1*a+s)/4}0!==h&&(d=Math.round(h/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var p=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),f=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(t){case uw.LEFT_TOP:a=l-p,s=u-f;break;case uw.RIGHT_TOP:a=p-l,s=u-f;break;case uw.RIGHT_BOTTOM:a=p-l,s=f-u;break;case uw.LEFT_BOTTOM:a=l-p,s=f-u}return r}switch(t){case uw.LEFT_TOP:r.width=o?l:l-a*n,r.height=i?u:u-s*n;break;case uw.RIGHT_TOP:r.width=o?l:l+a*n,r.height=i?u:u-s*n;break;case uw.RIGHT_BOTTOM:r.width=o?l:l+a*n,r.height=i?u:u+s*n;break;case uw.LEFT_BOTTOM:r.width=o?l:l-a*n,r.height=i?u:u+s*n}return r},n.resizeNode=function(t){var e=t.deltaX,o=t.deltaY,i=n.index,r=n.props,a=r.model,s=r.graphModel;gw({deltaX:e,deltaY:o,index:i,nodeModel:a,graphModel:s,cancelCallback:function(){n.dragHandler.cancelDrag()}})},n.onDragging=function(t){var e=t.deltaX,o=t.deltaY,i=n.graphModel.transformModel,r=pw(i.fixDeltaXY(e,o),2),a=r[0],s=r[1];n.resizeNode({deltaX:a,deltaY:s})},n.onDragEnd=function(){var t=n.nodeModel.x,e=n.nodeModel.y;n.nodeModel.moveTo(t,e),n.updateEdgePointByAnchors()};var o=e.index,i=e.model,r=e.graphModel;return n.index=o,n.nodeModel=i,n.graphModel=r,n.dragHandler=new Py({onDragging:n.onDragging,onDragEnd:n.onDragEnd,step:r.gridSize}),n}return cw(e,t),e.prototype.render=function(){var t=this.props,e=t.x,n=t.y,o=t.direction,i=t.model.getResizeControlStyle(),r=i.width,a=i.height,s=hw(i,["width","height"]);return fg("g",{className:"lf-resize-control lf-resize-control-".concat(o),children:[fg(lw,dw({className:"lf-resize-control-content",x:e,y:n,width:null!=r?r:7,height:null!=a?a:7},s)),fg(lw,{className:"lf-resize-control-content",x:e,y:n,width:25,height:25,fill:"transparent",stroke:"transparent",onMouseDown:this.dragHandler.handleMouseDown})]})},e}(qf);!function(t){function e(){return t.call(this)||this}cw(e,t),e.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,o=SE(e),i=o.minX,r=o.minY,a=o.maxX,s=o.maxY;return Ju([{index:uw.LEFT_TOP,direction:"nw",x:i,y:r},{index:uw.RIGHT_TOP,direction:"ne",x:a,y:r},{index:uw.RIGHT_BOTTOM,direction:"se",x:a,y:s},{index:uw.LEFT_BOTTOM,direction:"sw",x:i,y:s}],(function(t){return fg(fw,dw({},t,{model:e,graphModel:n}))}))},e.prototype.getResizeOutline=function(){var t=this.props.model,e=t.x,n=t.y,o=t.width,i=t.height,r=t.getResizeOutlineStyle();return fg(lw,dw({},r,{x:e,y:n,width:o,height:i}))},e.prototype.render=function(){return fg("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})}}(qf);var gw=function(t){var e=t.deltaX,n=t.deltaY,o=t.index,i=t.nodeModel,r=t.graphModel,a=t.cancelCallback,s=i.r,l=i.rx,u=i.ry,c=i.width,d=i.height,h=i.PCTResizeInfo,p=i.minWidth,f=i.minHeight,g=i.maxWidth,v=i.maxHeight,y=p===g,m=function(t,e,n,o,i){void 0===n&&(n=1),void 0===o&&(o=!1),void 0===i&&(i=!1);var r=Is(e),a=r.deltaX,s=r.deltaY,l=r.width,u=r.height,c=r.PCTResizeInfo;if(c){var d=0,h=0;switch(t){case uw.LEFT_TOP:h=(-1*a-s)/4;break;case uw.RIGHT_TOP:h=(a-s)/4;break;case uw.RIGHT_BOTTOM:h=(a+s)/4;break;case uw.LEFT_BOTTOM:h=(-1*a+s)/4}0!==h&&(d=Math.round(h/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var p=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),f=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(t){case uw.LEFT_TOP:a=l-p,s=u-f;break;case uw.RIGHT_TOP:a=p-l,s=u-f;break;case uw.RIGHT_BOTTOM:a=p-l,s=f-u;break;case uw.LEFT_BOTTOM:a=l-p,s=f-u}return r}switch(t){case uw.LEFT_TOP:r.width=o?l:l-a*n,r.height=i?u:u-s*n;break;case uw.RIGHT_TOP:r.width=o?l:l+a*n,r.height=i?u:u-s*n;break;case uw.RIGHT_BOTTOM:r.width=o?l:l+a*n,r.height=i?u:u+s*n;break;case uw.LEFT_BOTTOM:r.width=o?l:l-a*n,r.height=i?u:u+s*n}return r}(o,{width:s||l||c,height:s||u||d,deltaX:e,deltaY:n,PCTResizeInfo:h},s||l&&u?.5:1,y,f===v);if(m.width<p||m.width>g||m.height<f||m.height>v)null==a||a();else{m.deltaX=y?0:m.deltaX,m.deltaY=y?0:m.deltaY;var b=i.getData(),x=i.resize(m);!function(t,e){var n=t.id,o=t.anchors;xu(e.getNodeEdges(n),(function(t){if(t.sourceNodeId===n)(e=Uu(o,(function(e){return e.id===t.sourceAnchorId})))&&t.updateStartPoint({x:e.x,y:e.y});else if(t.targetNodeId===n){var e;(e=Uu(o,(function(e){return e.id===t.targetAnchorId})))&&t.updateEndPoint({x:e.x,y:e.y})}}))}(i,r),function(t,e,n,o,i,r,a){a.eventCenter.emit(wy.NODE_RESIZE,{preData:t,data:e,deltaX:n,deltaY:o,index:i,model:r})}(b,x,e,n,o,i,r)}};function vw(t,e,n){var o=e.x,i=e.y,r=t.x-o,a=t.y-i;return{x:r*Math.cos(n)-a*Math.sin(n)+o,y:r*Math.sin(n)+a*Math.cos(n)+i}}var yw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.componentDidMount=function(){t.prototype.componentDidMount.call(this);var e=this.props,n=e.model,o=e.graphModel,i=o.eventCenter,r=new Map;i.on("node:rotate",(function(t){var e=t.model;if(e.id===n.id){var i={x:n.x,y:n.y};xu(Array.from(n.children),(function(t){var n=o.getNodeModelById(t);if(n){var a={x:n.x,y:n.y};r.has(n.id)?a=r.get(n.id):r.set(n.id,a);var s=e.rotate*(180/Math.PI);s<0&&(s+=360);var l=s*(Math.PI/180),u=vw(a,i,l);n.moveTo(u.x,u.y),n.rotate=e.rotate}}))}})),i.on("node:resize",(function(t){var e=t.deltaX,i=t.deltaY,r=t.index;t.model.id===n.id&&xu(Array.from(n.children),(function(t){var n=o.getNodeModelById(t);n&&gw({deltaX:e,deltaY:i,index:r,nodeModel:n,graphModel:o,cancelCallback:function(){}})}))}))},n.prototype.getResizeControl=function(){var e=this.props.model,n=e.resizable,o=e.isCollapsed;return n&&!o?t.prototype.getResizeControl.call(this):null},n.prototype.getAppendAreaShape=function(){var t=this.props.model,n=t.width,o=t.height,i=t.x,r=t.y,a=t.radius;if(!t.groupAddable)return null;var s=t.getNodeStyle().strokeWidth,l=void 0===s?0:s,u=t.getAddableOutlineStyle(),c=n+l+8,d=o+l+8;return e.h("rect",g(g({},u),{width:c,height:d,x:i-c/2,y:r-d/2,rx:a,ry:a}))},n.prototype.getCollapseIcon=function(t,e){return"M ".concat(t+3,",").concat(e+6," ").concat(t+11,",").concat(e+6," M").concat(t+7,",").concat(e+2," ").concat(t+7,",").concat(e+10)},n.prototype.getExpandIcon=function(t,e){return"M ".concat(t+3,",").concat(e+6," ").concat(t+11,",").concat(e+6," ")},n.prototype.getOperateIcon=function(){var t=this.props.model,n=t.x,o=t.y,i=n-t.width/2+10,r=o-t.height/2+10;if(!t.collapsible)return null;var a=(null==t?void 0:t.isCollapsed)?this.getCollapseIcon(i,r):this.getExpandIcon(i,r),s=e.h("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:a});return e.h("g",{},[e.h("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#f4f5f6",stroke:"#cecece",cursor:"pointer",x:i,y:r,onClick:function(){t.toggleCollapse(!t.isCollapsed)}}),s])},n.prototype.getShape=function(){return e.h("g",{},[this.getAppendAreaShape(),t.prototype.getShape.call(this),this.getOperateIcon()])},n}(e.RectNode),mw=function(t){function n(e,n){var o=t.call(this,e,n)||this;return o.isGroup=!0,o.isRestrict=!1,o.collapsible=!0,o.isCollapsed=!1,o.groupAddable=!1,o.transformWidthContainer=!0,o.childrenLastCollapseStateDict=new Map,o.childrenLastCollapseStateDict=new Map,o.initNodeData(e),o.setAttributes(),o}return f(n,t),n.prototype.initNodeData=function(e){var n;t.prototype.initNodeData.call(this,e);var o=null!==(n=e.properties)&&void 0!==n?n:{},i=o.children,r=o.width,a=o.height,s=o.collapsedWidth,l=o.collapsedHeight,u=o.collapsible,c=o.isCollapsed,d=o.zIndex,h=o.isRestrict,p=o.autoResize,f=o.autoToFront;this.children=i?new Set(i):new Set,this.zIndex=null!=d?d:-1e4,this.isCollapsed=null!=c&&c;var g=null!=r?r:400,v=null!=a?a:230;this.width=g,this.height=v,this.expandWidth=g,this.expandHeight=v,this.collapsedWidth=null!=s?s:80,this.collapsedHeight=null!=l?l:60,this.isRestrict=null!=h&&h,this.autoResize=null!=p&&p,this.collapsible=null==u||u,this.autoToFront=null!=f&&f,this.text.editable=!1,this.text.draggable=!1},n.prototype.setAttributes=function(){t.prototype.setAttributes.call(this),this.isCollapsed&&this.toggleCollapse(!0)},n.prototype.getData=function(){var e=this,n=t.prototype.getData.call(this),o=[];return xu(Array.from(this.children),(function(t){var n=e.graphModel.getNodeModelById(t);n&&!n.virtual&&o.push(t)})),n.children=o,n.properties&&(n.properties.children=o,n.properties.isCollapsed=this.isCollapsed),n},n.prototype.getHistoryData=function(){var e=t.prototype.getHistoryData.call(this);e.children=Array.from(this.children),e.isGroup=!0;var n=this,o=n.x,i=n.y,r=n.collapsedWidth,a=n.collapsedHeight,s=n.expandWidth,l=n.expandHeight;return n.isCollapsed&&(e.x=o+s/2-r/2,e.y=i+l/2-a/2),e},n.prototype.toggleCollapse=function(t){var n=this,o=!!t;this.isCollapsed=o,o?this.collapse():this.expand();var i=E(E([],_(this.incoming.edges),!1),_(this.outgoing.edges),!1);xu(Array.from(this.children),(function(o){var r,a,s=n.graphModel.elementsModelMap.get(o);if(s){var l=s.isCollapsed;if(s.isGroup){var u=s;if(u.isCollapsed||u.toggleCollapse(t),!t){var c=null===(r=n.childrenLastCollapseStateDict)||void 0===r?void 0:r.get(o);void 0!==c&&c!==s.isCollapsed&&u.toggleCollapse(c)}}if(null===(a=n.childrenLastCollapseStateDict)||void 0===a||a.set(o,!!l),s.visible=!t,s.BaseType===e.ElementType.NODE){var d=s.incoming.edges,h=s.outgoing.edges;i=E(E(E([],_(i),!1),_(d),!1),_(h),!1)}}})),this.collapseEdge(o,i)},n.prototype.collapse=function(){var t=this,e=t.x,n=t.y,o=t.text,i=t.width,r=t.height,a=t.collapsedWidth,s=t.collapsedHeight;this.x=e-i/2+a/2,this.y=n-r/2+s/2,this.text.x=o.x-i/2+a/2,this.text.y=o.y-r/2+s/2,this.expandWidth=i,this.expandHeight=r,this.width=a,this.height=s},n.prototype.expand=function(){var t=this,e=t.x,n=t.y,o=t.text,i=t.expandWidth,r=t.expandHeight,a=t.collapsedWidth,s=t.collapsedHeight;this.width=i,this.height=r,this.x=e+this.width/2-a/2,this.y=n+this.height/2-s/2,this.text.x=o.x+this.width/2-a/2,this.text.y=o.y+this.height/2-s/2},n.prototype.createVirtualEdge=function(t){t.pointsList=void 0;var e=this.graphModel.addEdge(t);e.virtual=!0,e.text.editable=!1,e.isCollapsedEdge=!0},n.prototype.collapseEdge=function(t,e){var n=this,o=this.graphModel;xu(e,(function(e,i){var r,a=e.getData(),s=a.targetNodeId,l=a.sourceNodeId,u=g(g({},a),{id:"".concat(a.id,"__").concat(i),text:null===(r=a.text)||void 0===r?void 0:r.value});e.virtual&&o.deleteEdgeById(e.id);var c=o.dynamicGroup.getGroupByNodeId(s);c||(c=o.getNodeModelById(s));var d=o.dynamicGroup.getGroupByNodeId(l);d||(d=o.getNodeModelById(l)),t&&e.visible&&(n.children.has(l)||n.id===l?(u.startPoint=void 0,u.sourceNodeId=n.id):(u.endPoint=void 0,u.targetNodeId=n.id),c.id===n.id&&d.id===n.id||n.createVirtualEdge(u),e.visible=!1),t||e.visible||(c&&c.isGroup&&c.isCollapsed?(u.targetNodeId=c.id,u.endPoint=void 0,n.createVirtualEdge(u)):d&&d.isGroup&&d.isCollapsed?(u.sourceNodeId=d.id,u.startPoint=void 0,n.createVirtualEdge(u)):e.visible=!0)}))},n.prototype.isAllowAppendIn=function(t){return console.info("_nodeData",t),!0},n.prototype.setAllowAppendChild=function(t){this.groupAddable=t},n.prototype.addChild=function(t){this.children.add(t);var e=this.getData();this.graphModel.eventCenter.emit("group:add-node",{data:e})},n.prototype.removeChild=function(t){this.children.delete(t);var e=this.getData();this.graphModel.eventCenter.emit("group:remove-node",{data:e})},n.prototype.toBack=function(){this.zIndex--},n.prototype.getResizeOutlineStyle=function(){var e=t.prototype.getResizeOutlineStyle.call(this);return e.stroke="none",e},n.prototype.getAnchorStyle=function(){var e=t.prototype.getAnchorStyle.call(this);return e.stroke="transparent",e.fill="transparent",e.hover&&(e.hover.fill="transparent",e.hover.stroke="transparent"),e},n.prototype.getAddableOutlineStyle=function(){return{stroke:"#feb663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},y([e.observable],n.prototype,"isCollapsed",void 0),y([e.observable],n.prototype,"groupAddable",void 0),y([e.observable],n.prototype,"transformWidthContainer",void 0),n}(e.RectNodeModel);var bw,xw={type:"dynamic-group",view:yw,model:mw},_w=-1e4,Ew=function(){function t(t){var e=t.lf,n=t.options,o=this;this.topGroupZIndex=_w,this.nodeGroupMap=new Map,this.addNodeToGroup=function(t){var e=t.data,n=o.nodeGroupMap.get(e.id);n&&((s=o.lf.getNodeModelById(n)).removeChild(e.id),o.nodeGroupMap.delete(e.id),s.setAllowAppendChild(!1));var i=o.lf.getNodeModelById(e.id),r=null==i?void 0:i.getBounds();if(i&&r){if(i.isGroup){var a=i;xu(Array.from(a.children),(function(t){o.nodeGroupMap.set(t,e.id)})),o.calibrateTopGroupZIndex([e]),o.onNodeSelect({data:e,isSelected:!1,isMultiple:!1})}var s;if(s=o.getGroupByBounds(r,e)){var l=s.isAllowAppendIn(e);console.log("isAllowAppendIn",l),l?(s.addChild(e.id),o.nodeGroupMap.set(e.id,s.id),s.setAllowAppendChild(!0)):o.lf.emit("group:not-allowed",{group:s.getData(),node:e})}}},this.removeNodeFromGroup=function(t){var e=t.data;e.isGroup&&e.children&&xu(Array.from(e.children),(function(t){o.nodeGroupMap.delete(t),o.lf.deleteNode(t)}));var n=o.nodeGroupMap.get(e.id);if(n){var i=o.lf.getNodeModelById(n);i&&i.removeChild(e.id),o.nodeGroupMap.delete(e.id)}},this.setActiveGroup=function(t){var e=t.data,n=o.lf.getNodeModelById(e.id),i=null==n?void 0:n.getBounds();if(n&&i){var r=o.getGroupByBounds(i,e);if(o.activeGroup&&o.activeGroup.setAllowAppendChild(!1),!r||n.isGroup&&r.id===e.id)return;if(!r.isAllowAppendIn(e))return;o.activeGroup=r,console.log("this.activeGroup",o.activeGroup),o.activeGroup.setAllowAppendChild(!0)}},this.onNodeSelect=function(t){var e=t.data,n=t.isMultiple,i=t.isSelected,r=o.lf.getNodeModelById(e.id);if(o.sendNodeToFront(r),o.topGroupZIndex>-1e3){var a=o.lf.graphModel.nodes;o.topGroupZIndex=_w;var s=Jh(Fu(a,(function(t){return!!t.isGroup})),"zIndex"),l=0;xu(s,(function(t){t.zIndex!==l&&(o.topGroupZIndex++,l=t.zIndex),t.setZIndex(o.topGroupZIndex)}))}if(n&&i)if(null==r?void 0:r.isGroup){var u=r.children;xu(Array.from(u),(function(t){var e=o.lf.getNodeModelById(t);null==e||e.setSelected(!1)}))}else{var c=o.nodeGroupMap.get(e.id);if(c){var d=o.lf.getNodeModelById(c);(null==d?void 0:d.isSelected)&&(null==r||r.setSelected(!1))}}},this.onGraphRendered=function(t){var e=t.data;console.log("data",e),xu(e.nodes,(function(t){t.children&&xu(t.children,(function(e){o.nodeGroupMap.set(e,t.id)}))})),o.calibrateTopGroupZIndex(e.nodes)},e.register(xw),this.lf=e,console.log("options",n),li(this,n),this.init()}return t.prototype.getNodesInGroup=function(t){var e=this,n=[];return t.isGroup&&xu(Array.from(t.children),(function(t){n.push(t);var o=e.lf.getNodeModelById(t);(null==o?void 0:o.isGroup)&&(n=n.concat(e.getNodesInGroup(o)))})),n},t.prototype.getGroupByNodeId=function(t){var e=this.nodeGroupMap.get(t);if(e)return this.lf.getNodeModelById(e)},t.prototype.getGroupByBounds=function(t,e){var n=Fu(this.lf.graphModel.nodes,(function(n){return!!n.isGroup&&function(t,e){var n=t.minX,o=t.minY,i=t.maxX,r=t.maxY,a=e.x,s=e.y,l=e.width,u=e.height;return n>=a-l/2&&i<=a+l/2&&o>=s-u/2&&r<=s+u/2}(t,n)&&n.id!==e.id})),o=n.length;if(o<=1)return n[0];for(var i=n[o-1],r=o-2;r>=0;r--)i=n[r];return i},t.prototype.sendNodeToFront=function(t){var e=this;if(t&&t.isGroup&&(this.topGroupZIndex++,t.setZIndex(this.topGroupZIndex),t.children)){var n=t.children;xu(Array.from(n),(function(t){var n=e.lf.getNodeModelById(t);e.sendNodeToFront(n)}))}},t.prototype.getMaxZIndex=function(t){var e=this,n=_w;if(t.isGroup&&(n=Math.max(n,t.zIndex)),t.children){var o=t.children;xu(Array.from(o),(function(t){var o=e.lf.getNodeModelById(t);if(null==o?void 0:o.isGroup){var i=e.getMaxZIndex(o);n=Math.max(n,i)}}))}return n},t.prototype.calibrateTopGroupZIndex=function(t){var e=this,n=_w;if(xu(t,(function(t){var o=e.lf.getNodeModelById(t.id);if(o){var i=e.getMaxZIndex(o);i>n&&(n=i)}})),!(this.topGroupZIndex>=n)){var o=Fu(this.lf.graphModel.nodes,(function(t){return!!t.isGroup})),i=this.topGroupZIndex;xu(o,(function(t){t.zIndex>i&&(i=t.zIndex)})),this.topGroupZIndex=i}},t.prototype.initGroupChildNodes=function(t,n,o,i){var r=this,a=[],s=[],l=[];xu(Array.from(n),(function(u){var c=r.lf.getNodeModelById(u);if(c){var d=c.getData(),h=e.EventType.NODE_GROUP_COPY||"node:group-copy-add",p=e.transformNodeData(d,i),f=r.lf.addNode(p,h);if(o.addChild(f.id),t[u]=f.id,a.push(f),l.push.apply(l,E([],_(E(E([],_(f.incoming.edges),!1),_(f.outgoing.edges),!1)),!1)),n instanceof Set){var g=r.initGroupChildNodes(t,n,f,i),v=g.childNodes,y=g.edgesData;a.push.apply(a,E([],_(v),!1)),s.push.apply(s,E([],_(y),!1))}}})),console.log("allRelatedEdges --\x3e>",l);var u=Ju(Fu(l,(function(e){return fc(t,e.sourceNodeId)&&fc(t,e.targetNodeId)})),(function(t){return t.getData()}));return{childNodes:a,edgesData:s.concat(u)}},t.prototype.createEdge=function(t,n,o){var i,r,a=t.sourceNodeId,s=t.targetNodeId,l=null!==(i=n[a])&&void 0!==i?i:a,u=null!==(r=n[s])&&void 0!==r?r:s,c=Is(t);return t.id&&"object"==typeof t.text&&null!==t.text&&(c=e.transformEdgeData(t,o)),this.lf.graphModel.addEdge(g(g({},c),{sourceNodeId:l,targetNodeId:u}))},t.prototype.init=function(){var t=this,e=this.lf,n=e.graphModel;n.addNodeMoveRules((function(e,o,i){if(e.isGroup){var r=t.getNodesInGroup(e);return n.moveNodes(r,o,i,!0),!0}var a=t.nodeGroupMap.get(e.id),s=t.lf.getNodeModelById(a);if(s&&s.isRestrict){console.log("deltaX ---\x3e>>",o),console.log("deltaY ---\x3e>>",i);var l=s.getBounds();console.log("groupBounds",JSON.stringify(l));var u=e.getBounds();return console.log("bounds",JSON.stringify(u)),function(t,e,n,o){var i=t.minX,r=t.minY,a=t.maxX,s=t.maxY,l=e.x,u=e.y,c=e.width,d=e.height,h=i+c/2,p=r+d/2,f=a-c/2,g=s-d/2;return{x:l>h&&l<f||l===h&&n>0||l===f&&n<0,y:u>p&&u<g||u===p&&o>0||u===g&&o<0}}(l,e,o,i)}return!0})),n.dynamicGroup=this,e.on("node:add,node:drop,node:dnd-add",this.addNodeToGroup),e.on("node:delete",this.removeNodeFromGroup),e.on("node:drag,node:dnd-drag",this.setActiveGroup),e.on("node:click",this.onNodeSelect),e.on("graph:rendered",this.onGraphRendered),e.on("graph:updated",(function(t){var e=t.data;return console.log("data",e)})),e.on("group:add-node",(function(t){var e=t.data;return console.log("group:add-node",e)})),e.addElements=function(n,o){var i=n.nodes,r=n.edges;void 0===o&&(o=40);var a={},s={nodes:[],edges:[]},l=[];return xu(i,(function(n){var i=n.id,r=n.children,u=v(n,["children"]),c=e.addNode(u);if(i&&(a[i]=c.id),s.nodes.push(c),c.isGroup){var d=t.initGroupChildNodes(a,r,c,o).edgesData;l.push.apply(l,E([],_(d),!1))}})),xu(l,(function(e){t.createEdge(e,a,o)})),console.log("selectedEdges ---\x3e>>",r),xu(r,(function(e){s.edges.push(t.createEdge(e,a,o))})),s},this.render()},t.prototype.render=function(){},t.prototype.destroy=function(){this.lf.off("node:add,node:drop,node:dnd-add",this.addNodeToGroup),this.lf.off("node:delete",this.removeNodeFromGroup),this.lf.off("node:drag,node:dnd-drag",this.setActiveGroup),this.lf.off("node:click",this.onNodeSelect),this.lf.off("graph:rendered",this.onGraphRendered)},t.pluginName="dynamicGroup",t}();!function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(bw||(bw={}));var ww=function(t,e,n,o){return void 0===o&&(o=0),Nw(t,e,n)<=o};function Sw(t){return t*t}function Cw(t,e){return Sw(t.x-e.x)+Sw(t.y-e.y)}var Nw=function(t,e,n){return Math.sqrt(function(t,e,n){var o=Cw(e,n);if(0===o)return Cw(t,e);var i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/o;return i=Math.max(0,Math.min(1,i)),Cw(t,{x:e.x+i*(n.x-e.x),y:e.y+i*(n.y-e.y)})}(t,e,n))},Tw=function(t,e,n){var o=function(t){var e=t.x,n=t.y,o=t.width,i=t.height;return{minX:e-o/2,minY:n-i/2,maxX:e+o/2,maxY:n+i/2,x:e,y:n,width:o,height:i,centerX:e,centerY:n}}(t),i=function(t,e){var n;return t.x===e.x?n=bw.VERTICAL:t.y===e.y&&(n=bw.HORIZONTAL),n}(e,n),r=Math.max(e.x,n.x),a=Math.min(e.x,n.x),s=Math.max(e.y,n.y),l=Math.min(e.y,n.y),u=t.x,c=t.y,d=t.width,h=t.height;if(i===bw.HORIZONTAL){if(r>=o.maxX&&a<=o.minX)return{startCrossPoint:{x:e.x>n.x?u+d/2:u-d/2,y:e.y},endCrossPoint:{x:e.x>n.x?u-d/2:u+d/2,y:e.y}}}else if(i===bw.VERTICAL&&s>=o.maxY&&l<=o.minY)return{startCrossPoint:{x:e.x,y:e.y>n.y?c+h/2:c-h/2},endCrossPoint:{x:e.x,y:e.y>n.y?c-h/2:c+h/2}}},Aw=function(t,e,n){void 0===n&&(n=0);for(var o=t.x,i=t.y,r=e.pointsList,a=0;a<r.length-1;a++)if(ww({x:o,y:i},r[a],r[a+1],n)){var s=Tw(t,r[a],r[a+1]);if(s)return{crossIndex:a+1,crossPoints:s}}return{crossIndex:-1,crossPoints:{startCrossPoint:{x:0,y:0},endCrossPoint:{x:0,y:0}}}},Mw=function(){function t(t){var e=t.lf;this._lf=e,this.deviation=20,this.dndAdd=!0,this.dropAdd=!0,this.eventHandler()}return t.prototype.eventHandler=function(){var t=this;this.dndAdd&&this._lf.on("node:dnd-add",(function(e){var n=e.data;t.insetNode(n)})),this.dropAdd&&this._lf.on("node:drop",(function(e){for(var n=e.data,o=t._lf.graphModel.edges,i=n.id,r=!0,a=0;a<o.length;a++)if(o[a].sourceNodeId===i||o[a].targetNodeId===i){r=!1;break}r&&t.insetNode(n)}))},t.prototype.checkRuleBeforeInsetNode=function(t,n,o,i,r){var a=this._lf.getNodeModelById(t),s=this._lf.getNodeModelById(n),l=a.getAnchorInfo(o),u=s.getAnchorInfo(i),c=a.isAllowConnectedAsSource(r,l,u),d=s.isAllowConnectedAsTarget(r,l,u),h=e.formatAnchorConnectValidateData(c),p=h.isAllPass,f=h.msg,g=e.formatAnchorConnectValidateData(d),v=g.isAllPass;return{isPass:p&&v,sourceMsg:f,targetMsg:g.msg}},t.prototype.insetNode=function(t){var n=this,o=this._lf.graphModel.edges,i=this._lf.getNodeModelById(t.id),r=null==i?void 0:i.getDefaultAnchor();if(!r||0===r.length)this._lf.graphModel.eventCenter.emit(e.EventType.CONNECTION_NOT_ALLOWED,{data:t,msg:"自定义类型节点不显示锚点,也不允许其他节点连接到此节点"});else if(i)for(var a=0;a<o.length;a++){var s=Aw(i,o[a],this.deviation),l=s.crossIndex,u=s.crossPoints;if(l>=0){var c=o[a],d=c.sourceNodeId,h=c.targetNodeId,p=c.id,f=c.type,g=c.pointsList,v=c.sourceAnchorId,y=c.targetAnchorId,m=Is(g[0]),b=Is(u.startCrossPoint);this._lf.deleteEdge(p);var x=this.checkRuleBeforeInsetNode(d,h,v,y,t);if(this._lf.addEdge({type:f,sourceNodeId:d,targetNodeId:t.id,startPoint:m,endPoint:b,pointsList:E(E([],_(g.slice(0,l)),!1),[u.startCrossPoint],!1)}),this._lf.addEdge({type:f,sourceNodeId:t.id,targetNodeId:h,startPoint:Is(u.endCrossPoint),endPoint:Is(g[g.length-1]),pointsList:E([u.endCrossPoint],_(g.slice(l)),!1)}),x.isPass)break;this._lf.graphModel.eventCenter.emit(e.EventType.CONNECTION_NOT_ALLOWED,{data:t,msg:x.targetMsg||x.sourceMsg}),setTimeout((function(){n._lf.undo()}),200);break}}},t.pluginName="insertNodeInPolyline",t}(),Ow="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Pw={},kw={get exports(){return Pw},set exports(t){Pw=t}};
|
|
26
|
-
/*!
|
|
27
|
-
Copyright (c) 2018 Jed Watson.
|
|
28
|
-
Licensed under the MIT License (MIT), see
|
|
29
|
-
http://jedwatson.github.io/classnames
|
|
30
|
-
*/
|
|
31
|
-
!function(t){!function(){var e={}.hasOwnProperty;function n(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=i(t,o(n)))}return t}function o(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var o="";for(var r in t)e.call(t,r)&&t[r]&&(o=i(o,r));return o}function i(t,e){return e?t?t+" "+e:t+e:t}t.exports?(n.default=n,t.exports=n):window.classNames=n}()}(kw);var Rw=Pw,Dw=function(t){function n(n){var o=t.call(this,n)||this;o.textRef=e.createRef(),o.setHoverOn=function(){var t=o.props.element;t.isDragging||o.state.isHovered||(o.setState({isHovered:!0}),t.setHovered(!0))},o.setHoverOff=function(){var t=o.props.element;o.state.isHovered&&(o.setState({isHovered:!1}),t.setHovered(!1))},o.handleMouseDown=function(t){var e,n=o.props,i=n.label,r=n.graphModel.editConfigModel.nodeTextDraggable;(null!==(e=i.draggable)&&void 0!==e?e:r)&&!o.state.isDragging&&(o.setState({isDragging:!0}),o.stepDrag.handleMouseDown(t))},o.handleDragging=function(t){var e=t.deltaX,n=t.deltaY,i=o.props,r=i.label,a=i.element,s=i.graphModel,l=_(s.transformModel.fixDeltaXY(e,n),2),u=l[0],c=l[1],d=a.properties._label,h=Gu(d,(function(t){return t.id===r.id})),p=d[h];d[h]=g(g({},p),{x:p.x+u,y:p.y+c});var f=s.getElement(a.id);null==f||f.setProperty("_label",d),s.eventCenter.emit("label:drag",{data:r.getData(),model:r})},o.handleDragEnd=function(){o.setState({isDragging:!1})},o.handleDbClick=function(t){var n=o.props,i=n.label,r=n.element;if(n.graphModel.eventCenter.emit("label:dblclick",{data:i.getData(),e:t,model:r}),i.editable){if(r.setSelected(),r.setElementState(e.ElementState.TEXT_EDIT),o.setState({isEditing:!0}),o.textRef.current){o.textRef.current.contentEditable="true",o.textRef.current.focus();var a=document.createRange(),s=window.getSelection();a.selectNodeContents(o.textRef.current),a.collapse(!1),null==s||s.removeAllRanges(),null==s||s.addRange(a)}}else r.setSelected(!0)},o.handleBlur=function(t){var e=o.props,n=e.label,i=e.element;e.graphModel.eventCenter.emit("label:blur",{e:t,model:i,data:n.getData(),element:o.textRef.current}),o.setState({isDragging:!1,isHovered:!1})},o.reCalcLabelSize=function(){};var i=n.label,r=n.graphModel,a=r.gridSize,s=r.eventCenter;return o.stepDrag=new e.StepDrag({onDragging:o.handleDragging,onDragEnd:o.handleDragEnd,step:a,eventType:"LABEL",model:i,eventCenter:s}),o.state={isEditing:!1,isHovered:!1,isDragging:!1},o}return f(n,t),n.prototype.componentDidMount=function(){var t=this,n=this.props,o=n.label,i=n.element,r=n.graphModel;r.eventCenter.on("blank:click,node:click,edge:click",(function(){var n,a,s,l;if(t.state.isEditing){t.setState({isEditing:!1});var u=null!==(a=null===(n=t.textRef.current)||void 0===n?void 0:n.innerText)&&void 0!==a?a:"",c=null!==(l=null===(s=t.textRef.current)||void 0===s?void 0:s.innerHTML)&&void 0!==l?l:"",d=i.properties._label,h=Gu(d,(function(t){return t.id===o.id})),p=d[h];d[h]=g(g({},p),{value:u,content:c});var f=r.getElement(i.id);null==f||f.setProperty("_label",d),i.setElementState(e.ElementState.DEFAULT)}t.textRef.current&&(t.textRef.current.contentEditable="false")}))},n.prototype.componentDidUpdate=function(){console.log("Label componentDidUpdate")},n.prototype.componentWillUnmount=function(){this.props.graphModel.eventCenter.off("blank:click,node:click,edge:click")},n.prototype.render=function(){var t,e=this.props,n=e.label,o=e.element,i=e.graphModel,r=this.state,a=r.isDragging,s=r.isHovered,l=r.isEditing,u=i.transformModel.getTransformStyle().transform,c=n.id,d=n.x,h=n.y,p=n.zIndex,f=n.vertical,v=n.style,y=n.rotate,m=n.content,b=n.labelWidth,x=n.textOverflowMode,_=null!=b?b:"node"===o.BaseType?o.width-20:80,E={left:"".concat(d-_/2,"px"),top:"".concat(h-10,"px"),width:"".concat(_,"px"),height:"20px",zIndex:null!=p?p:1,transform:y?"".concat(u," rotate(").concat(y,"deg)"):"".concat(u," rotate(").concat(f?-.25:0,"turn)")};return fg("div",{id:"element-container-".concat(c),className:Rw("lf-label-editor-container"),style:E,onMouseDown:this.handleMouseDown,onDblClick:this.handleDbClick,onBlur:this.handleBlur,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,children:fg("div",{ref:this.textRef,id:"editor-container-".concat(c),className:Rw("lf-label-editor",(t={"lf-label-editor-dragging":a,"lf-label-editor-editing":l,"lf-label-editor-hover":!l&&s},t["lf-label-editor-".concat(x)]=!l,t)),style:g({maxWidth:"".concat(_,"px"),width:"".concat(_,"px")},v),dangerouslySetInnerHTML:{__html:m}})})},n=y([e.observer],n)}(e.Component),Lw=e.LogicFlowUtil.createUuid,Iw=function(){function t(t,e,n){var o;this.type="label",this.content="",this.value="",this.style={},this.vertical=!1,this.editable=!0,this.draggable=!0,this.textOverflowMode="default",this.element=e,this.graphModel=n,this.id=null!==(o=t.id)&&void 0!==o?o:Lw(),this.initLabelData(t)}return t.prototype.initLabelData=function(t){li(this,t)},t.prototype.getData=function(){return{id:this.id,x:this.x,y:this.y,content:this.content,value:this.value,rotate:this.rotate,style:e.toJS(this.style),draggable:this.draggable,editable:this.editable,labelWidth:this.labelWidth,textOverflowMode:this.textOverflowMode,vertical:this.vertical}},y([e.observable],t.prototype,"x",void 0),y([e.observable],t.prototype,"y",void 0),y([e.observable],t.prototype,"content",void 0),y([e.observable],t.prototype,"value",void 0),y([e.observable],t.prototype,"rotate",void 0),y([e.observable],t.prototype,"style",void 0),y([e.observable],t.prototype,"zIndex",void 0),y([e.observable],t.prototype,"vertical",void 0),y([e.observable],t.prototype,"editable",void 0),y([e.observable],t.prototype,"draggable",void 0),y([e.observable],t.prototype,"labelWidth",void 0),y([e.observable],t.prototype,"textOverflowMode",void 0),t}(),jw={},Bw={get exports(){return jw},set exports(t){jw=t}};!function(t){
|
|
32
|
-
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
|
|
33
|
-
"classList"in document.createElement("_")||function(t){if("Element"in t){var e="classList",n="prototype",o=t.Element[n],i=Object,r=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},a=Array[n].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1},s=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},l=function(t,e){if(""===e)throw new s("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new s("INVALID_CHARACTER_ERR","String contains an invalid character");return a.call(t,e)},u=function(t){for(var e=r.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],o=0,i=n.length;o<i;o++)this.push(n[o]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},c=u[n]=[],d=function(){return new u(this)};if(s[n]=Error[n],c.item=function(t){return this[t]||null},c.contains=function(t){return-1!==l(this,t+="")},c.add=function(){var t,e=arguments,n=0,o=e.length,i=!1;do{-1===l(this,t=e[n]+"")&&(this.push(t),i=!0)}while(++n<o);i&&this._updateClassName()},c.remove=function(){var t,e,n=arguments,o=0,i=n.length,r=!1;do{for(e=l(this,t=n[o]+"");-1!==e;)this.splice(e,1),r=!0,e=l(this,t)}while(++o<i);r&&this._updateClassName()},c.toggle=function(t,e){t+="";var n=this.contains(t),o=n?!0!==e&&"remove":!1!==e&&"add";return o&&this[o](t),!0===e||!1===e?e:!n},c.toString=function(){return this.join(" ")},i.defineProperty){var h={get:d,enumerable:!0,configurable:!0};try{i.defineProperty(o,e,h)}catch(t){-2146823252===t.number&&(h.enumerable=!1,i.defineProperty(o,e,h))}}else i[n].__defineGetter__&&o.__defineGetter__(e,d)}}(self)
|
|
34
|
-
/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */,function(t){if(t.URL=t.URL||t.webkitURL,t.Blob&&t.URL)try{return void new Blob}catch(t){}var e=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||function(t){var e=function(t){return Object.prototype.toString.call(t).match(/^\[object\s(.*)\]$/)[1]},n=function(){this.data=[]},o=function(t,e,n){this.data=t,this.size=t.length,this.type=e,this.encoding=n},i=n.prototype,r=o.prototype,a=t.FileReaderSync,s=function(t){this.code=this[this.name=t]},l="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),u=l.length,c=t.URL||t.webkitURL||t,d=c.createObjectURL,h=c.revokeObjectURL,p=c,f=t.btoa,g=t.atob,v=t.ArrayBuffer,y=t.Uint8Array,m=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(o.fake=r.fake=!0;u--;)s.prototype[l[u]]=u+1;return c.createObjectURL||(p=t.URL=function(t){var e,n=document.createElementNS("http://www.w3.org/1999/xhtml","a");return n.href=t,"origin"in n||("data:"===n.protocol.toLowerCase()?n.origin=null:(e=t.match(m),n.origin=e&&e[1])),n}),p.createObjectURL=function(t){var e,n=t.type;return null===n&&(n="application/octet-stream"),t instanceof o?(e="data:"+n,"base64"===t.encoding?e+";base64,"+t.data:"URI"===t.encoding?e+","+decodeURIComponent(t.data):f?e+";base64,"+f(t.data):e+","+encodeURIComponent(t.data)):d?d.call(c,t):void 0},p.revokeObjectURL=function(t){"data:"!==t.substring(0,5)&&h&&h.call(c,t)},i.append=function(t){var n=this.data;if(y&&(t instanceof v||t instanceof y)){for(var i="",r=new y(t),l=0,u=r.length;l<u;l++)i+=String.fromCharCode(r[l]);n.push(i)}else if("Blob"===e(t)||"File"===e(t)){if(!a)throw new s("NOT_READABLE_ERR");var c=new a;n.push(c.readAsBinaryString(t))}else t instanceof o?"base64"===t.encoding&&g?n.push(g(t.data)):"URI"===t.encoding?n.push(decodeURIComponent(t.data)):"raw"===t.encoding&&n.push(t.data):("string"!=typeof t&&(t+=""),n.push(unescape(encodeURIComponent(t))))},i.getBlob=function(t){return arguments.length||(t=null),new o(this.data.join(""),t,"raw")},i.toString=function(){return"[object BlobBuilder]"},r.slice=function(t,e,n){var i=arguments.length;return i<3&&(n=null),new o(this.data.slice(t,i>1?e:this.data.length),n,this.encoding)},r.toString=function(){return"[object Blob]"},r.close=function(){this.size=0,delete this.data},n}(t);t.Blob=function(t,n){var o=n&&n.type||"",i=new e;if(t)for(var r=0,a=t.length;r<a;r++)Uint8Array&&t[r]instanceof Uint8Array?i.append(t[r].buffer):i.append(t[r]);var s=i.getBlob(o);return!s.slice&&s.webkitSlice&&(s.slice=s.webkitSlice),s};var n=Object.getPrototypeOf||function(t){return t.__proto__};t.Blob.prototype=n(new t.Blob)}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||Ow.content||Ow),function(e,n){"undefined"!=typeof process&&process&&process.versions&&process.versions.electron?e.MediumEditor=n:t.exports=n}(Ow,function(){function t(t,e){return this.init(t,e)}var e,n,o,i,r,a,s,l,u,c,d;return t.extensions={},function(e){function n(t,e){var n,o=Array.prototype.slice.call(arguments,2);e=e||{};for(var i=0;i<o.length;i++){var r=o[i];if(r)for(n in r)r.hasOwnProperty(n)&&void 0!==r[n]&&(t||!1===e.hasOwnProperty(n))&&(e[n]=r[n])}return e}var o=!1;try{var i=document.createElement("div"),r=document.createTextNode(" ");i.appendChild(r),o=i.contains(r)}catch(t){}var a={isIE:"Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&null!==new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent),isEdge:null!==/Edge\/\d+/.exec(navigator.userAgent),isFF:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isMac:e.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77,V:86},isMetaCtrlKey:function(t){return!!(a.isMac&&t.metaKey||!a.isMac&&t.ctrlKey)},isKey:function(t,e){var n=a.getKeyCode(t);return!1===Array.isArray(e)?n===e:-1!==e.indexOf(n)},getKeyCode:function(t){var e=t.which;return null===e&&(e=null!==t.charCode?t.charCode:t.keyCode),e},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var t=[!0].concat(Array.prototype.slice.call(arguments));return n.apply(this,t)},defaults:function(){var t=[!1].concat(Array.prototype.slice.call(arguments));return n.apply(this,t)},createLink:function(t,e,n,o){var i=t.createElement("a");return a.moveTextRangeIntoElement(e[0],e[e.length-1],i),i.setAttribute("href",n),o&&("_blank"===o&&i.setAttribute("rel","noopener noreferrer"),i.setAttribute("target",o)),i},findOrCreateMatchingTextNodes:function(t,e,n){for(var o=t.createTreeWalker(e,NodeFilter.SHOW_ALL,null,!1),i=[],r=0,s=!1,l=null,u=null;null!==(l=o.nextNode());)if(!(l.nodeType>3))if(3===l.nodeType){if(!s&&n.start<r+l.nodeValue.length&&(s=!0,u=a.splitStartNodeIfNeeded(l,n.start,r)),s&&a.splitEndNodeIfNeeded(l,u,n.end,r),s&&r===n.end)break;if(s&&r>n.end+1)throw new Error("PerformLinking overshot the target!");s&&i.push(u||l),r+=l.nodeValue.length,null!==u&&(r+=u.nodeValue.length,o.nextNode()),u=null}else"img"===l.tagName.toLowerCase()&&(!s&&n.start<=r&&(s=!0),s&&i.push(l));return i},splitStartNodeIfNeeded:function(t,e,n){return e!==n?t.splitText(e-n):null},splitEndNodeIfNeeded:function(t,e,n,o){var i,r;i=o+t.nodeValue.length+(e?e.nodeValue.length:0)-1,r=n-o-(e?t.nodeValue.length:0),i>=n&&o!==i&&0!==r&&(e||t).splitText(r)},splitByBlockElements:function(e){if(3!==e.nodeType&&1!==e.nodeType)return[];var n=[],o=t.util.blockContainerElementNames.join(",");if(3===e.nodeType||0===e.querySelectorAll(o).length)return[e];for(var i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(3===r.nodeType)n.push(r);else if(1===r.nodeType){0===r.querySelectorAll(o).length?n.push(r):n=n.concat(t.util.splitByBlockElements(r))}}return n},findAdjacentTextNodeWithContent:function(t,e,n){var o,i=!1,r=n.createNodeIterator(t,NodeFilter.SHOW_TEXT,null,!1);for(o=r.nextNode();o;){if(o===e)i=!0;else if(i&&3===o.nodeType&&o.nodeValue&&o.nodeValue.trim().length>0)break;o=r.nextNode()}return o},findPreviousSibling:function(t){if(!t||a.isMediumEditorElement(t))return!1;for(var e=t.previousSibling;!e&&!a.isMediumEditorElement(t.parentNode);)e=(t=t.parentNode).previousSibling;return e},isDescendant:function(t,e,n){if(!t||!e)return!1;if(t===e)return!!n;if(1!==t.nodeType)return!1;if(o||3!==e.nodeType)return t.contains(e);for(var i=e.parentNode;null!==i;){if(i===t)return!0;i=i.parentNode}return!1},isElement:function(t){return!(!t||1!==t.nodeType)},throttle:function(t,e){var n,o,i,r=null,a=0,s=function(){a=Date.now(),r=null,i=t.apply(n,o),r||(n=o=null)};return e||0===e||(e=50),function(){var l=Date.now(),u=e-(l-a);return n=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),a=l,i=t.apply(n,o),r||(n=o=null)):r||(r=setTimeout(s,u)),i}},traverseUp:function(t,e){if(!t)return!1;do{if(1===t.nodeType){if(e(t))return t;if(a.isMediumEditorElement(t))return!1}t=t.parentNode}while(t);return!1},htmlEntities:function(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},insertHTMLCommand:function(e,n){var o,i,r,s,l,u,c,d=!1,h=["insertHTML",!1,n];if(!t.util.isEdge&&e.queryCommandSupported("insertHTML"))try{return e.execCommand.apply(e,h)}catch(t){}if((o=e.getSelection()).rangeCount){if(c=(i=o.getRangeAt(0)).commonAncestorContainer,a.isMediumEditorElement(c)&&!c.firstChild)i.selectNode(c.appendChild(e.createTextNode("")));else if(3===c.nodeType&&0===i.startOffset&&i.endOffset===c.nodeValue.length||3!==c.nodeType&&c.innerHTML===i.toString()){for(;!a.isMediumEditorElement(c)&&c.parentNode&&1===c.parentNode.childNodes.length&&!a.isMediumEditorElement(c.parentNode);)c=c.parentNode;i.selectNode(c)}for(i.deleteContents(),(r=e.createElement("div")).innerHTML=n,s=e.createDocumentFragment();r.firstChild;)l=r.firstChild,u=s.appendChild(l);i.insertNode(s),u&&((i=i.cloneRange()).setStartAfter(u),i.collapse(!0),t.selection.selectRange(e,i)),d=!0}return e.execCommand.callListeners&&e.execCommand.callListeners(h,d),d},execFormatBlock:function(e,n){var o=a.getTopBlockContainer(t.selection.getSelectionStart(e));if("blockquote"===n){if(o&&Array.prototype.slice.call(o.childNodes).some((function(t){return a.isBlockContainer(t)})))return e.execCommand("outdent",!1,null);if(a.isIE)return e.execCommand("indent",!1,n)}if(o&&n===o.nodeName.toLowerCase()&&(n="p"),a.isIE&&(n="<"+n+">"),o&&"blockquote"===o.nodeName.toLowerCase()){if(a.isIE&&"<p>"===n)return e.execCommand("outdent",!1,n);if((a.isFF||a.isEdge)&&"p"===n)return Array.prototype.slice.call(o.childNodes).some((function(t){return!a.isBlockContainer(t)}))&&e.execCommand("formatBlock",!1,n),e.execCommand("outdent",!1,n)}return e.execCommand("formatBlock",!1,n)},setTargetBlank:function(t,e){var n,o=e||!1;if("a"===t.nodeName.toLowerCase())t.target="_blank",t.rel="noopener noreferrer";else for(t=t.getElementsByTagName("a"),n=0;n<t.length;n+=1)!1!==o&&o!==t[n].attributes.href.value||(t[n].target="_blank",t[n].rel="noopener noreferrer")},removeTargetBlank:function(t,e){var n;if("a"===t.nodeName.toLowerCase())t.removeAttribute("target"),t.removeAttribute("rel");else for(t=t.getElementsByTagName("a"),n=0;n<t.length;n+=1)e===t[n].attributes.href.value&&(t[n].removeAttribute("target"),t[n].removeAttribute("rel"))},addClassToAnchors:function(t,e){var n,o,i=e.split(" ");if("a"===t.nodeName.toLowerCase())for(o=0;o<i.length;o+=1)t.classList.add(i[o]);else{var r=t.getElementsByTagName("a");if(0===r.length){var s=a.getClosestTag(t,"a");t=s?[s]:[]}else t=r;for(n=0;n<t.length;n+=1)for(o=0;o<i.length;o+=1)t[n].classList.add(i[o])}},isListItem:function(t){if(!t)return!1;if("li"===t.nodeName.toLowerCase())return!0;for(var e=t.parentNode,n=e.nodeName.toLowerCase();"li"===n||!a.isBlockContainer(e)&&"div"!==n;){if("li"===n)return!0;if(!(e=e.parentNode))return!1;n=e.nodeName.toLowerCase()}return!1},cleanListDOM:function(e,n){if("li"===n.nodeName.toLowerCase()){var o=n.parentElement;"p"===o.parentElement.nodeName.toLowerCase()&&(a.unwrap(o.parentElement,e),t.selection.moveCursor(e,n.firstChild,n.firstChild.textContent.length))}},splitOffDOMTree:function(t,e,n){for(var o=e,i=null,r=!n;o!==t;){var a,s=o.parentNode,l=s.cloneNode(!1),u=r?o:s.firstChild;for(i&&(r?l.appendChild(i):a=i),i=l;u;){var c=u.nextSibling;u===o?(u.hasChildNodes()?u=u.cloneNode(!1):u.parentNode.removeChild(u),u.textContent&&i.appendChild(u),u=r?c:null):(u.parentNode.removeChild(u),(u.hasChildNodes()||u.textContent)&&i.appendChild(u),u=c)}a&&i.appendChild(a),o=s}return i},moveTextRangeIntoElement:function(t,e,n){if(!t||!e)return!1;var o=a.findCommonRoot(t,e);if(!o)return!1;if(e===t){var i=t.parentNode,r=t.nextSibling;return i.removeChild(t),n.appendChild(t),r?i.insertBefore(n,r):i.appendChild(n),n.hasChildNodes()}for(var s,l,u,c=[],d=0;d<o.childNodes.length;d++)if(u=o.childNodes[d],s){if(a.isDescendant(u,e,!0)){l=u;break}c.push(u)}else a.isDescendant(u,t,!0)&&(s=u);var h=l.nextSibling,p=o.ownerDocument.createDocumentFragment();return s===t?(s.parentNode.removeChild(s),p.appendChild(s)):p.appendChild(a.splitOffDOMTree(s,t)),c.forEach((function(t){t.parentNode.removeChild(t),p.appendChild(t)})),l===e?(l.parentNode.removeChild(l),p.appendChild(l)):p.appendChild(a.splitOffDOMTree(l,e,!0)),n.appendChild(p),l.parentNode===o?o.insertBefore(n,l):h?o.insertBefore(n,h):o.appendChild(n),n.hasChildNodes()},depthOfNode:function(t){for(var e=0,n=t;null!==n.parentNode;)n=n.parentNode,e++;return e},findCommonRoot:function(t,e){for(var n=a.depthOfNode(t),o=a.depthOfNode(e),i=t,r=e;n!==o;)n>o?(i=i.parentNode,n-=1):(r=r.parentNode,o-=1);for(;i!==r;)i=i.parentNode,r=r.parentNode;return i},isElementAtBeginningOfBlock:function(t){for(var e;!a.isBlockContainer(t)&&!a.isMediumEditorElement(t);){for(e=t;e=e.previousSibling;)if((3===e.nodeType?e.nodeValue:e.textContent).length>0)return!1;t=t.parentNode}return!0},isMediumEditorElement:function(t){return t&&t.getAttribute&&!!t.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(t){return a.traverseUp(t,(function(t){return a.isMediumEditorElement(t)}))},isBlockContainer:function(t){return t&&3!==t.nodeType&&-1!==a.blockContainerElementNames.indexOf(t.nodeName.toLowerCase())},getClosestBlockContainer:function(t){return a.traverseUp(t,(function(t){return a.isBlockContainer(t)||a.isMediumEditorElement(t)}))},getTopBlockContainer:function(t){var e=!!a.isBlockContainer(t)&&t;return a.traverseUp(t,(function(t){return a.isBlockContainer(t)&&(e=t),!(e||!a.isMediumEditorElement(t))&&(e=t,!0)})),e},getFirstSelectableLeafNode:function(t){for(;t&&t.firstChild;)t=t.firstChild;if("table"===(t=a.traverseUp(t,(function(t){return-1===a.emptyElementNames.indexOf(t.nodeName.toLowerCase())}))).nodeName.toLowerCase()){var e=t.querySelector("th, td");e&&(t=e)}return t},getFirstTextNode:function(t){return a.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),a._getFirstTextNode(t)},_getFirstTextNode:function(t){if(3===t.nodeType)return t;for(var e=0;e<t.childNodes.length;e++){var n=a._getFirstTextNode(t.childNodes[e]);if(null!==n)return n}return null},ensureUrlHasProtocol:function(t){return-1===t.indexOf("://")?"http://"+t:t},warn:function(){void 0!==e.console&&"function"==typeof e.console.warn&&e.console.warn.apply(e.console,arguments)},deprecated:function(t,e,n){var o=t+" is deprecated, please use "+e+" instead.";n&&(o+=" Will be removed in "+n),a.warn(o)},deprecatedMethod:function(t,e,n,o){a.deprecated(t,e,o),"function"==typeof this[e]&&this[e].apply(this,n)},cleanupAttrs:function(t,e){e.forEach((function(e){t.removeAttribute(e)}))},cleanupTags:function(t,e){-1!==e.indexOf(t.nodeName.toLowerCase())&&t.parentNode.removeChild(t)},unwrapTags:function(e,n){-1!==n.indexOf(e.nodeName.toLowerCase())&&t.util.unwrap(e,document)},getClosestTag:function(t,e){return a.traverseUp(t,(function(t){return t.nodeName.toLowerCase()===e.toLowerCase()}))},unwrap:function(t,e){for(var n=e.createDocumentFragment(),o=Array.prototype.slice.call(t.childNodes),i=0;i<o.length;i++)n.appendChild(o[i]);n.childNodes.length?t.parentNode.replaceChild(n,t):t.parentNode.removeChild(t)},guid:function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}};t.util=a}(window),(e=function(e){t.util.extend(this,e)}).extend=function(e){var n,o=this;n=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return o.apply(this,arguments)},t.util.extend(n,o);var i=function(){this.constructor=n};return i.prototype=o.prototype,n.prototype=new i,e&&t.util.extend(n.prototype,e),n},e.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,getInteractionElements:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(t){return this.base.options[t]}},["execAction","on","off","subscribe","trigger"].forEach((function(t){e.prototype[t]=function(){return this.base[t].apply(this.base,arguments)}})),t.Extension=e,function(){function e(e){return t.util.isBlockContainer(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}var n={findMatchingSelectionParent:function(e,n){var o,i=n.getSelection();return 0!==i.rangeCount&&(o=i.getRangeAt(0).commonAncestorContainer,t.util.traverseUp(o,e))},getSelectionElement:function(e){return this.findMatchingSelectionParent((function(e){return t.util.isMediumEditorElement(e)}),e)},exportSelection:function(t,e){if(!t)return null;var n=null,o=e.getSelection();if(o.rangeCount>0){var i,r=o.getRangeAt(0),a=r.cloneRange();a.selectNodeContents(t),a.setEnd(r.startContainer,r.startOffset),n={start:i=a.toString().length,end:i+r.toString().length},this.doesRangeStartWithImages(r,e)&&(n.startsWithImage=!0);var s=this.getTrailingImageCount(t,n,r.endContainer,r.endOffset);if(s&&(n.trailingImageCount=s),0!==i){var l=this.getIndexRelativeToAdjacentEmptyBlocks(e,t,r.startContainer,r.startOffset);-1!==l&&(n.emptyBlocksIndex=l)}}return n},importSelection:function(t,e,n,o){if(t&&e){var i=n.createRange();i.setStart(e,0),i.collapse(!0);var r,a=e,s=[],l=0,u=!1,c=!1,d=0,h=!1,p=!1,f=null;for((o||t.startsWithImage||void 0!==t.emptyBlocksIndex)&&(p=!0);!h&&a;)if(a.nodeType>3)a=s.pop();else{if(3!==a.nodeType||c){if(t.trailingImageCount&&c&&("img"===a.nodeName.toLowerCase()&&d++,d===t.trailingImageCount)){for(var g=0;a.parentNode.childNodes[g]!==a;)g++;i.setEnd(a.parentNode,g+1),h=!0}if(!h&&1===a.nodeType)for(var v=a.childNodes.length-1;v>=0;)s.push(a.childNodes[v]),v-=1}else r=l+a.length,!u&&t.start>=l&&t.start<=r&&(p||t.start<r?(i.setStart(a,t.start-l),u=!0):f=a),u&&t.end>=l&&t.end<=r&&(t.trailingImageCount?c=!0:(i.setEnd(a,t.end-l),h=!0)),l=r;h||(a=s.pop())}!u&&f&&(i.setStart(f,f.length),i.setEnd(f,f.length)),void 0!==t.emptyBlocksIndex&&(i=this.importSelectionMoveCursorPastBlocks(n,e,t.emptyBlocksIndex,i)),o&&(i=this.importSelectionMoveCursorPastAnchor(t,i)),this.selectRange(n,i)}},importSelectionMoveCursorPastAnchor:function(e,n){if(e.start===e.end&&3===n.startContainer.nodeType&&n.startOffset===n.startContainer.nodeValue.length&&t.util.traverseUp(n.startContainer,(function(t){return"a"===t.nodeName.toLowerCase()}))){for(var o=n.startContainer,i=n.startContainer.parentNode;null!==i&&"a"!==i.nodeName.toLowerCase();)i.childNodes[i.childNodes.length-1]!==o?i=null:(o=i,i=i.parentNode);if(null!==i&&"a"===i.nodeName.toLowerCase()){for(var r=null,a=0;null===r&&a<i.parentNode.childNodes.length;a++)i.parentNode.childNodes[a]===i&&(r=a);n.setStart(i.parentNode,r+1),n.collapse(!0)}}return n},importSelectionMoveCursorPastBlocks:function(n,o,i,r){var a,s,l=n.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,e,!1),u=r.startContainer,c=0;for(i=i||1,a=3===u.nodeType&&t.util.isBlockContainer(u.previousSibling)?u.previousSibling:t.util.getClosestBlockContainer(u);l.nextNode();)if(s){if(s=l.currentNode,++c===i)break;if(s.textContent.length>0)break}else a===l.currentNode&&(s=l.currentNode);return s||(s=a),r.setStart(t.util.getFirstSelectableLeafNode(s),0),r},getIndexRelativeToAdjacentEmptyBlocks:function(n,o,i,r){if(i.textContent.length>0&&r>0)return-1;var a=i;if(3!==a.nodeType&&(a=i.childNodes[r]),a){if(!t.util.isElementAtBeginningOfBlock(a))return-1;var s=t.util.findPreviousSibling(a);if(!s)return-1;if(s.nodeValue)return-1}for(var l=t.util.getClosestBlockContainer(i),u=n.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,e,!1),c=0;u.nextNode();){var d=""===u.currentNode.textContent;if((d||c>0)&&(c+=1),u.currentNode===l)return c;d||(c=0)}return c},doesRangeStartWithImages:function(t,e){if(0!==t.startOffset||1!==t.startContainer.nodeType)return!1;if("img"===t.startContainer.nodeName.toLowerCase())return!0;var n=t.startContainer.querySelector("img");if(!n)return!1;for(var o=e.createTreeWalker(t.startContainer,NodeFilter.SHOW_ALL,null,!1);o.nextNode();){var i=o.currentNode;if(i===n)break;if(i.nodeValue)return!1}return!0},getTrailingImageCount:function(t,e,n,o){if(0===o||1!==n.nodeType)return 0;if("img"!==n.nodeName.toLowerCase()&&!n.querySelector("img"))return 0;for(var i=n.childNodes[o-1];i.hasChildNodes();)i=i.lastChild;for(var r,a=t,s=[],l=0,u=!1,c=!1,d=!1,h=0;!d&&a;)if(a.nodeType>3)a=s.pop();else{if(3!==a.nodeType||c){if("img"===a.nodeName.toLowerCase()&&h++,a===i)d=!0;else if(1===a.nodeType)for(var p=a.childNodes.length-1;p>=0;)s.push(a.childNodes[p]),p-=1}else h=0,r=l+a.length,!u&&e.start>=l&&e.start<=r&&(u=!0),u&&e.end>=l&&e.end<=r&&(c=!0),l=r;d||(a=s.pop())}return h},selectionContainsContent:function(t){var e=t.getSelection();if(!e||e.isCollapsed||!e.rangeCount)return!1;if(""!==e.toString().trim())return!0;var n=this.getSelectedParentElement(e.getRangeAt(0));return!(!n||!("img"===n.nodeName.toLowerCase()||1===n.nodeType&&n.querySelector("img")))},selectionInContentEditableFalse:function(t){var e,n=this.findMatchingSelectionParent((function(t){var n=t&&t.getAttribute("contenteditable");return"true"===n&&(e=!0),"#text"!==t.nodeName&&"false"===n}),t);return!e&&n},getSelectionHtml:function(t){var e,n,o,i="",r=t.getSelection();if(r.rangeCount){for(o=t.createElement("div"),e=0,n=r.rangeCount;e<n;e+=1)o.appendChild(r.getRangeAt(e).cloneContents());i=o.innerHTML}return i},getCaretOffsets:function(t,e){var n,o;return e||(e=window.getSelection().getRangeAt(0)),n=e.cloneRange(),o=e.cloneRange(),n.selectNodeContents(t),n.setEnd(e.endContainer,e.endOffset),o.selectNodeContents(t),o.setStart(e.endContainer,e.endOffset),{left:n.toString().length,right:o.toString().length}},rangeSelectsSingleNode:function(t){var e=t.startContainer;return e===t.endContainer&&e.hasChildNodes()&&t.endOffset===t.startOffset+1},getSelectedParentElement:function(t){return t?this.rangeSelectsSingleNode(t)&&3!==t.startContainer.childNodes[t.startOffset].nodeType?t.startContainer.childNodes[t.startOffset]:3===t.startContainer.nodeType?t.startContainer.parentNode:t.startContainer:null},getSelectedElements:function(t){var e,n,o,i=t.getSelection();if(!i.rangeCount||i.isCollapsed||!i.getRangeAt(0).commonAncestorContainer)return[];if(3===(e=i.getRangeAt(0)).commonAncestorContainer.nodeType){for(n=[],o=e.commonAncestorContainer;o.parentNode&&1===o.parentNode.childNodes.length;)n.push(o.parentNode),o=o.parentNode;return n}return[].filter.call(e.commonAncestorContainer.getElementsByTagName("*"),(function(t){return"function"!=typeof i.containsNode||i.containsNode(t,!0)}))},selectNode:function(t,e){var n=e.createRange();n.selectNodeContents(t),this.selectRange(e,n)},select:function(t,e,n,o,i){var r=t.createRange();return r.setStart(e,n),o?r.setEnd(o,i):r.collapse(!0),this.selectRange(t,r),r},clearSelection:function(t,e){e?t.getSelection().collapseToStart():t.getSelection().collapseToEnd()},moveCursor:function(t,e,n){this.select(t,e,n)},getSelectionRange:function(t){var e=t.getSelection();return 0===e.rangeCount?null:e.getRangeAt(0)},selectRange:function(t,e){var n=t.getSelection();n.removeAllRanges(),n.addRange(e)},getSelectionStart:function(t){var e=t.getSelection().anchorNode;return e&&3===e.nodeType?e.parentNode:e}};t.selection=n}(),function(){function e(e,n){return!!e&&e.some((function(e){if("function"!=typeof e.getInteractionElements)return!1;var o=e.getInteractionElements();return!!o&&(Array.isArray(o)||(o=[o]),o.some((function(e){return t.util.isDescendant(e,n,!0)})))}))}var n=function(t){this.base=t,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};n.prototype={InputEventOnContenteditableSupported:!t.util.isIE&&!t.util.isEdge,attachDOMEvent:function(e,n,o,i){var r=this.base.options.contentWindow,a=this.base.options.ownerDocument;e=t.util.isElement(e)||[r,a].indexOf(e)>-1?[e]:e,Array.prototype.forEach.call(e,function(t){t.addEventListener(n,o,i),this.events.push([t,n,o,i])}.bind(this))},detachDOMEvent:function(e,n,o,i){var r,a,s=this.base.options.contentWindow,l=this.base.options.ownerDocument;e&&(e=t.util.isElement(e)||[s,l].indexOf(e)>-1?[e]:e,Array.prototype.forEach.call(e,function(t){-1!==(r=this.indexOfListener(t,n,o,i))&&(a=this.events.splice(r,1)[0])[0].removeEventListener(a[1],a[2],a[3])}.bind(this)))},indexOfListener:function(t,e,n,o){var i,r,a;for(i=0,r=this.events.length;i<r;i+=1)if((a=this.events[i])[0]===t&&a[1]===e&&a[2]===n&&a[3]===o)return i;return-1},detachAllDOMEvents:function(){for(var t=this.events.pop();t;)t[0].removeEventListener(t[1],t[2],t[3]),t=this.events.pop()},detachAllEventsFromElement:function(t){for(var e=this.events.filter((function(e){return e&&e[0].getAttribute&&e[0].getAttribute("medium-editor-index")===t.getAttribute("medium-editor-index")})),n=0,o=e.length;n<o;n++){var i=e[n];this.detachDOMEvent(i[0],i[1],i[2],i[3])}},attachAllEventsToElement:function(t){this.listeners.editableInput&&(this.contentCache[t.getAttribute("medium-editor-index")]=t.innerHTML),this.eventsCache&&this.eventsCache.forEach((function(e){this.attachDOMEvent(t,e.name,e.handler.bind(this))}),this)},enableCustomEvent:function(t){void 0!==this.disabledEvents[t]&&delete this.disabledEvents[t]},disableCustomEvent:function(t){this.disabledEvents[t]=!0},attachCustomEvent:function(t,e){this.setupListener(t),this.customEvents[t]||(this.customEvents[t]=[]),this.customEvents[t].push(e)},detachCustomEvent:function(t,e){var n=this.indexOfCustomListener(t,e);-1!==n&&this.customEvents[t].splice(n,1)},indexOfCustomListener:function(t,e){return this.customEvents[t]&&this.customEvents[t].length?this.customEvents[t].indexOf(e):-1},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(t,e,n){this.customEvents[t]&&!this.disabledEvents[t]&&this.customEvents[t].forEach((function(t){t(e,n)}))},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach((function(t){t.removeAttribute("data-medium-focused")}))},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=function(t){this.handleDocumentExecCommand(t)}.bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var t=this.options.ownerDocument;if(this.execCommandListener&&t.execCommand.listeners){var e=t.execCommand.listeners.indexOf(this.execCommandListener);-1!==e&&t.execCommand.listeners.splice(e,1),t.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var t=this.options.ownerDocument;if(!t.execCommand.listeners){var e=function(e,n){t.execCommand.listeners&&t.execCommand.listeners.forEach((function(t){t({command:e[0],value:e[2],args:e,result:n})}))},n=function(){var n=t.execCommand.orig.apply(this,arguments);if(!t.execCommand.listeners)return n;var o=Array.prototype.slice.call(arguments);return e(o,n),n};n.orig=t.execCommand,n.listeners=[],n.callListeners=e,t.execCommand=n}},unwrapExecCommand:function(){var t=this.options.ownerDocument;t.execCommand.orig&&(t.execCommand=t.execCommand.orig)},setupListener:function(t){if(!this.listeners[t]){switch(t){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache={},this.base.elements.forEach((function(t){this.contentCache[t.getAttribute("medium-editor-index")]=t.innerHTML}),this),this.InputEventOnContenteditableSupported&&this.attachToEachElement("input",this.handleInput),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":case"editableKeydownEnter":case"editableKeydownTab":case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste)}this.listeners[t]=!0}},attachToEachElement:function(t,e){this.eventsCache||(this.eventsCache=[]),this.base.elements.forEach((function(n){this.attachDOMEvent(n,t,e.bind(this))}),this),this.eventsCache.push({name:t,handler:e})},cleanupElement:function(t){var e=t.getAttribute("medium-editor-index");e&&(this.detachAllEventsFromElement(t),this.contentCache&&delete this.contentCache[e])},focusElement:function(t){t.focus(),this.updateFocus(t,{target:t,type:"focus"})},updateFocus:function(n,o){var i,r=this.base.getFocusedElement();r&&"click"===o.type&&this.lastMousedownTarget&&(t.util.isDescendant(r,this.lastMousedownTarget,!0)||e(this.base.extensions,this.lastMousedownTarget))&&(i=r),i||this.base.elements.some((function(e){return!i&&t.util.isDescendant(e,n,!0)&&(i=e),!!i}),this);var a=!t.util.isDescendant(r,n,!0)&&!e(this.base.extensions,n);i!==r&&(r&&a&&(r.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",o,r)),i&&(i.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",o,i))),a&&this.triggerCustomEvent("externalInteraction",o)},updateInput:function(t,e){if(this.contentCache){var n=t.getAttribute("medium-editor-index"),o=t.innerHTML;o!==this.contentCache[n]&&this.triggerCustomEvent("editableInput",e,t),this.contentCache[n]=o}},handleDocumentSelectionChange:function(e){if(e.currentTarget&&e.currentTarget.activeElement){var n,o=e.currentTarget.activeElement;this.base.elements.some((function(e){return!!t.util.isDescendant(e,o,!0)&&(n=e,!0)}),this),n&&this.updateInput(n,{target:o,currentTarget:n})}},handleDocumentExecCommand:function(){var t=this.base.getFocusedElement();t&&this.updateInput(t,{target:t,currentTarget:t})},handleBodyClick:function(t){this.updateFocus(t.target,t)},handleBodyFocus:function(t){this.updateFocus(t.target,t)},handleBodyMousedown:function(t){this.lastMousedownTarget=t.target},handleInput:function(t){this.updateInput(t.currentTarget,t)},handleClick:function(t){this.triggerCustomEvent("editableClick",t,t.currentTarget)},handleBlur:function(t){this.triggerCustomEvent("editableBlur",t,t.currentTarget)},handleKeypress:function(t){if(this.triggerCustomEvent("editableKeypress",t,t.currentTarget),this.keypressUpdateInput){var e={target:t.target,currentTarget:t.currentTarget};setTimeout(function(){this.updateInput(e.currentTarget,e)}.bind(this),0)}},handleKeyup:function(t){this.triggerCustomEvent("editableKeyup",t,t.currentTarget)},handleMouseover:function(t){this.triggerCustomEvent("editableMouseover",t,t.currentTarget)},handleDragging:function(t){this.triggerCustomEvent("editableDrag",t,t.currentTarget)},handleDrop:function(t){this.triggerCustomEvent("editableDrop",t,t.currentTarget)},handlePaste:function(t){this.triggerCustomEvent("editablePaste",t,t.currentTarget)},handleKeydown:function(e){return this.triggerCustomEvent("editableKeydown",e,e.currentTarget),t.util.isKey(e,t.util.keyCode.SPACE)?this.triggerCustomEvent("editableKeydownSpace",e,e.currentTarget):t.util.isKey(e,t.util.keyCode.ENTER)||e.ctrlKey&&t.util.isKey(e,t.util.keyCode.M)?this.triggerCustomEvent("editableKeydownEnter",e,e.currentTarget):t.util.isKey(e,t.util.keyCode.TAB)?this.triggerCustomEvent("editableKeydownTab",e,e.currentTarget):t.util.isKey(e,[t.util.keyCode.DELETE,t.util.keyCode.BACKSPACE])?this.triggerCustomEvent("editableKeydownDelete",e,e.currentTarget):void 0}},t.Events=n}(),n=t.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(e){n.isBuiltInButton(e)?t.Extension.call(this,this.defaults[e]):t.Extension.call(this,e)},init:function(){t.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return"function"==typeof this.action?this.action(this.base.options):this.action},getAria:function(){return"function"==typeof this.aria?this.aria(this.base.options):this.aria},getTagNames:function(){return"function"==typeof this.tagNames?this.tagNames(this.base.options):this.tagNames},createButton:function(){var t=this.document.createElement("button"),e=this.contentDefault,n=this.getAria(),o=this.getEditorOption("buttonLabels");return t.classList.add("medium-editor-action"),t.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach((function(e){t.classList.add(e)})),t.setAttribute("data-action",this.getAction()),n&&(t.setAttribute("title",n),t.setAttribute("aria-label",n)),this.attrs&&Object.keys(this.attrs).forEach((function(e){t.setAttribute(e,this.attrs[e])}),this),"fontawesome"===o&&this.contentFA&&(e=this.contentFA),t.innerHTML=e,t},handleClick:function(t){t.preventDefault(),t.stopPropagation();var e=this.getAction();e&&this.execAction(e)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")),delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var t=null;return this.useQueryState&&(t=this.base.queryCommandState(this.getAction())),t},isAlreadyApplied:function(t){var e,n,o=!1,i=this.getTagNames();return!1===this.knownState||!0===this.knownState?this.knownState:(i&&i.length>0&&(o=-1!==i.indexOf(t.nodeName.toLowerCase())),!o&&this.style&&(e=this.style.value.split("|"),n=this.window.getComputedStyle(t,null).getPropertyValue(this.style.prop),e.forEach((function(t){this.knownState||((o=-1!==n.indexOf(t))||"text-decoration"!==this.style.prop)&&(this.knownState=o)}),this)),o)}}),n.isBuiltInButton=function(e){return"string"==typeof e&&t.extensions.button.prototype.defaults.hasOwnProperty(e)},t.extensions.button=n,t.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"<b>B</b>",contentFA:'<i class="fa fa-bold"></i>'},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"<b><i>I</i></b>",contentFA:'<i class="fa fa-italic"></i>'},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"<b><u>U</u></b>",contentFA:'<i class="fa fa-underline"></i>'},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"<s>A</s>",contentFA:'<i class="fa fa-strikethrough"></i>'},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"<b>x<sup>1</sup></b>",contentFA:'<i class="fa fa-superscript"></i>'},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"<b>x<sub>1</sub></b>",contentFA:'<i class="fa fa-subscript"></i>'},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"<b>image</b>",contentFA:'<i class="fa fa-picture-o"></i>'},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"<b>html</b>",contentFA:'<i class="fa fa-code"></i>'},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"<b>1.</b>",contentFA:'<i class="fa fa-list-ol"></i>'},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"<b>•</b>",contentFA:'<i class="fa fa-list-ul"></i>'},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"<b>→</b>",contentFA:'<i class="fa fa-indent"></i>'},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"<b>←</b>",contentFA:'<i class="fa fa-outdent"></i>'},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"<b>C</b>",contentFA:'<i class="fa fa-align-center"></i>'},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"<b>J</b>",contentFA:'<i class="fa fa-align-justify"></i>'},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"<b>L</b>",contentFA:'<i class="fa fa-align-left"></i>'},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"<b>R</b>",contentFA:'<i class="fa fa-align-right"></i>'},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"<b>X</b>",contentFA:'<i class="fa fa-eraser"></i>'},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"<b>“</b>",contentFA:'<i class="fa fa-quote-right"></i>'},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"<b>0101</b>",contentFA:'<i class="fa fa-code fa-lg"></i>'},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"<b>H1</b>",contentFA:'<i class="fa fa-header"><sup>1</sup>'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"<b>H2</b>",contentFA:'<i class="fa fa-header"><sup>2</sup>'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"<b>H3</b>",contentFA:'<i class="fa fa-header"><sup>3</sup>'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"<b>H4</b>",contentFA:'<i class="fa fa-header"><sup>4</sup>'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"<b>H5</b>",contentFA:'<i class="fa fa-header"><sup>5</sup>'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"<b>H6</b>",contentFA:'<i class="fa fa-header"><sup>6</sup>'}},o=t.extensions.button.extend({init:function(){t.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"✓",formCloseLabel:"×",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return!!this.hasForm&&this.getForm().classList.contains(this.activeClass)},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var t=this.base.getExtensionByName("toolbar");t&&t.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var t=this.base.getExtensionByName("toolbar");t&&t.hideToolbarDefaultActions()},setToolbarPosition:function(){var t=this.base.getExtensionByName("toolbar");t&&t.setToolbarPosition()}}),t.extensions.form=o,i=t.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"<b>#</b>",contentFA:'<i class="fa fa-link"></i>',init:function(){t.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(e){e.preventDefault(),e.stopPropagation();var n=t.selection.getSelectionRange(this.document);return"a"===n.startContainer.nodeName.toLowerCase()||"a"===n.endContainer.nodeName.toLowerCase()||t.util.getClosestTag(t.selection.getSelectedParentElement(n),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(e){t.util.isKey(e,t.util.keyCode.K)&&t.util.isMetaCtrlKey(e)&&!e.shiftKey&&this.handleClick(e)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var t=['<input type="text" class="medium-editor-toolbar-input" placeholder="',this.placeholderText,'">'];return t.push('<a href="#" class="medium-editor-toolbar-save">',"fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':this.formSaveLabel,"</a>"),t.push('<a href="#" class="medium-editor-toolbar-close">',"fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':this.formCloseLabel,"</a>"),this.targetCheckbox&&t.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-target" id="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">','<label for="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">',this.targetCheckboxText,"</label>","</div>"),this.customClassOption&&t.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-button">',"<label>",this.customClassOptionText,"</label>","</div>"),t.join("")},isDisplayed:function(){return t.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){t.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(e){var n=this.getInput(),o=this.getAnchorTargetCheckbox(),i=this.getAnchorButtonCheckbox();if("string"==typeof(e=e||{value:""})&&(e={value:e}),this.base.saveSelection(),this.hideToolbarDefaultActions(),t.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),n.value=e.value,n.focus(),o&&(o.checked="_blank"===e.target),i){var r=e.buttonClass?e.buttonClass.split(" "):[];i.checked=-1!==r.indexOf(this.customClassOption)}},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},getFormOpts:function(){var t=this.getAnchorTargetCheckbox(),e=this.getAnchorButtonCheckbox(),n={value:this.getInput().value.trim()};return this.linkValidation&&(n.value=this.checkLinkFormat(n.value)),n.target="_self",t&&t.checked&&(n.target="_blank"),e&&e.checked&&(n.buttonClass=this.customClassOption),n},doFormSave:function(){var t=this.getFormOpts();this.completeFormSave(t)},completeFormSave:function(t){this.base.restoreSelection(),this.execAction(this.action,t),this.base.checkSelection()},ensureEncodedUri:function(t){return t===decodeURI(t)?encodeURI(t):t},ensureEncodedUriComponent:function(t){return t===decodeURIComponent(t)?encodeURIComponent(t):t},ensureEncodedParam:function(t){var e=t.split("="),n=e[0],o=e[1];return n+(void 0===o?"":"="+this.ensureEncodedUriComponent(o))},ensureEncodedQuery:function(t){return t.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(t){var e=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i.test(t),n="",o=t.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),i=o[1],r=o[2],a=o[3];if(/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/.test(t))return"tel:"+t;if(!e){var s=i.split("/")[0];(s.match(/.+(\.|:).+/)||"localhost"===s)&&(n="http://")}return n+this.ensureEncodedUri(i)+(void 0===r?"":"?"+this.ensureEncodedQuery(r))+(void 0===a?"":"#"+a)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(t){var e=t.querySelector(".medium-editor-toolbar-close"),n=t.querySelector(".medium-editor-toolbar-save"),o=t.querySelector(".medium-editor-toolbar-input");this.on(t,"click",this.handleFormClick.bind(this)),this.on(o,"keyup",this.handleTextboxKeyup.bind(this)),this.on(e,"click",this.handleCloseClick.bind(this)),this.on(n,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var t=this.document.createElement("div");return t.className="medium-editor-toolbar-form",t.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),t.innerHTML=this.getTemplate(),this.attachFormEvents(t),t},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(e){if(e.keyCode===t.util.keyCode.ENTER)return e.preventDefault(),void this.doFormSave();e.keyCode===t.util.keyCode.ESCAPE&&(e.preventDefault(),this.doFormCancel())},handleFormClick:function(t){t.stopPropagation()},handleSaveClick:function(t){t.preventDefault(),this.doFormSave()},handleCloseClick:function(t){t.preventDefault(),this.doFormCancel()}}),t.extensions.anchor=i,r=t.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,showOnEmptyLinks:!0,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getInteractionElements:function(){return this.getPreviewElement()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var t=this.document.createElement("div");return t.id="medium-editor-anchor-preview-"+this.getEditorId(),t.className="medium-editor-anchor-preview",t.innerHTML=this.getTemplate(),this.on(t,"click",this.handleClick.bind(this)),t},getTemplate:function(){return'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <a class="medium-editor-toolbar-anchor-preview-inner"></a></div>'},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview&&this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(t){return!(!this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")&&!t.getAttribute("data-disable-preview"))||(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=t.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=t.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=t,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(t){t=t||this.activeAnchor;var e,n,o,i,r,a=this.window.innerWidth,s=this.anchorPreview.offsetHeight,l=t.getBoundingClientRect(),u=this.diffLeft,c=this.diffTop,d=this.getEditorOption("elementsContainer"),h=["absolute","fixed"].indexOf(window.getComputedStyle(d).getPropertyValue("position"))>-1,p={};e=this.anchorPreview.offsetWidth/2;var f=this.base.getExtensionByName("toolbar");f&&(u=f.diffLeft,c=f.diffTop),n=u-e,h?(i=d.getBoundingClientRect(),["top","left"].forEach((function(t){p[t]=l[t]-i[t]})),p.width=l.width,p.height=l.height,l=p,a=i.width,r=d.scrollTop):r=this.window.pageYOffset,o=l.left+l.width/2,r+=s+l.top+l.height-c-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(r)+"px",this.anchorPreview.style.right="initial",o<e?(this.anchorPreview.style.left=n+e+"px",this.anchorPreview.style.right="initial"):a-o<e?(this.anchorPreview.style.left="auto",this.anchorPreview.style.right=0):(this.anchorPreview.style.left=n+o+"px",this.anchorPreview.style.right="initial")},attachToEditables:function(){this.subscribe("editableMouseover",this.handleEditableMouseover.bind(this)),this.subscribe("positionedToolbar",this.handlePositionedToolbar.bind(this))},handlePositionedToolbar:function(){this.showWhenToolbarIsVisible||this.hidePreview()},handleClick:function(t){var e=this.base.getExtensionByName("anchor"),n=this.activeAnchor;e&&n&&(t.preventDefault(),this.base.selectElement(this.activeAnchor),this.base.delay(function(){if(n){var t={value:n.attributes.href.value,target:n.getAttribute("target"),buttonClass:n.getAttribute("class")};e.showForm(t),n=null}}.bind(this))),this.hidePreview()},handleAnchorMouseout:function(){this.anchorToPreview=null,this.off(this.activeAnchor,"mouseout",this.instanceHandleAnchorMouseout),this.instanceHandleAnchorMouseout=null},handleEditableMouseover:function(e){var n=t.util.getClosestTag(e.target,"a");if(!1!==n){if(!this.showOnEmptyLinks&&(!/href=["']\S+["']/.test(n.outerHTML)||/href=["']#\S+["']/.test(n.outerHTML)))return!0;var o=this.base.getExtensionByName("toolbar");if(!this.showWhenToolbarIsVisible&&o&&o.isDisplayed&&o.isDisplayed())return!0;this.activeAnchor&&this.activeAnchor!==n&&this.detachPreviewHandlers(),this.anchorToPreview=n,this.instanceHandleAnchorMouseout=this.handleAnchorMouseout.bind(this),this.on(this.anchorToPreview,"mouseout",this.instanceHandleAnchorMouseout),this.base.delay(function(){this.anchorToPreview&&this.showPreview(this.anchorToPreview)}.bind(this))}},handlePreviewMouseover:function(){this.lastOver=(new Date).getTime(),this.hovering=!0},handlePreviewMouseout:function(t){t.relatedTarget&&/anchor-preview/.test(t.relatedTarget.className)||(this.hovering=!1)},updatePreview:function(){if(this.hovering)return!0;(new Date).getTime()-this.lastOver>this.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=(new Date).getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}}),t.extensions.anchorPreview=r,function(){var e,n,o,i,r;function a(e){return!t.util.getClosestTag(e,"a")}e=[" ","\t","\n","\r"," "," "," "," "," ","\u2028","\u2029"],o="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+(n="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw")+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+n+"))",i=new RegExp("^("+n+")$","i"),r=new RegExp(o,"gi");var s=t.Extension.extend({init:function(){t.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var t=0,e=0;e<this.window._mediumEditors.length;e++){var n=this.window._mediumEditors[e];null!==n&&void 0!==n.getExtensionByName("autoLink")&&t++}return 1===t},destroy:function(){this.document.queryCommandSupported("AutoUrlDetect")&&this.isLastInstance()&&this.document.execCommand("AutoUrlDetect",!1,!0)},onBlur:function(t,e){this.performLinking(e)},onKeypress:function(e){this.disableEventHandling||t.util.isKey(e,[t.util.keyCode.SPACE,t.util.keyCode.ENTER])&&(clearTimeout(this.performLinkingTimeout),this.performLinkingTimeout=setTimeout(function(){try{var t=this.base.exportSelection();this.performLinking(e.target)&&this.base.importSelection(t,!0)}catch(t){window.console&&window.console.error("Failed to perform linking",t),this.disableEventHandling=!0}}.bind(this),0))},performLinking:function(e){var n=t.util.splitByBlockElements(e),o=!1;0===n.length&&(n=[e]);for(var i=0;i<n.length;i++)o=this.removeObsoleteAutoLinkSpans(n[i])||o,o=this.performLinkingWithinElement(n[i])||o;return this.base.events.updateInput(e,{target:e,currentTarget:e}),o},removeObsoleteAutoLinkSpans:function(e){if(!e||3===e.nodeType)return!1;for(var n=e.querySelectorAll('span[data-auto-link="true"]'),o=!1,i=0;i<n.length;i++){var r=n[i].textContent;if(-1===r.indexOf("://")&&(r=t.util.ensureUrlHasProtocol(r)),n[i].getAttribute("data-href")!==r&&a(n[i])){o=!0;var s=r.replace(/\s+$/,"");if(n[i].getAttribute("data-href")===s){var l=r.length-s.length,u=t.util.splitOffDOMTree(n[i],this.splitTextBeforeEnd(n[i],l));n[i].parentNode.insertBefore(u,n[i].nextSibling)}else t.util.unwrap(n[i],this.document)}}return o},splitTextBeforeEnd:function(t,e){for(var n,o,i,r=this.document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null,!1),a=!0;a;)a=null!==r.lastChild();for(;e>0&&null!==i;)(o=(n=r.currentNode).nodeValue).length>e?(i=n.splitText(o.length-e),e=0):(i=r.previousNode(),e-=o.length);return i},performLinkingWithinElement:function(e){for(var n=this.findLinkableText(e),o=0;o<n.length;o++){var i=t.util.findOrCreateMatchingTextNodes(this.document,e,n[o]);this.shouldNotLink(i)||this.createAutoLink(i,n[o].href)}return!1},shouldNotLink:function(e){for(var n=!1,o=0;o<e.length&&!1===n;o++)n=!!t.util.traverseUp(e[o],(function(t){return"a"===t.nodeName.toLowerCase()||t.getAttribute&&"true"===t.getAttribute("data-auto-link")}));return n},findLinkableText:function(t){for(var n=t.textContent,o=null,a=[];null!==(o=r.exec(n));){var s=o.index+o[0].length;!(0!==o.index&&-1===e.indexOf(n[o.index-1])||s!==n.length&&-1===e.indexOf(n[s]))&&(-1!==o[0].indexOf("/")||i.test(o[0].split(".").pop().split("?").shift()))&&a.push({href:o[0],start:o.index,end:s})}return a},createAutoLink:function(e,n){n=t.util.ensureUrlHasProtocol(n);var o=t.util.createLink(this.document,e,n,this.getEditorOption("targetBlank")?"_blank":null),i=this.document.createElement("span");for(i.setAttribute("data-auto-link","true"),i.setAttribute("data-href",n),o.insertBefore(i,o.firstChild);o.childNodes.length>1;)i.appendChild(o.childNodes[1])}});t.extensions.autoLink=s}(),function(){var e="medium-editor-dragover";function n(n){var o=t.util.getContainerEditorElement(n);Array.prototype.slice.call(o.parentElement.querySelectorAll("."+e)).forEach((function(t){t.classList.remove(e)}))}var o=t.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){t.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(t){t.preventDefault(),t.dataTransfer.dropEffect="copy";var o=t.target.classList?t.target:t.target.parentElement;n(o),"dragover"===t.type&&o.classList.add(e)},handleDrop:function(t){t.preventDefault(),t.stopPropagation(),this.base.selectElement(t.target);var e=this.base.exportSelection();e.start=e.end,this.base.importSelection(e),t.dataTransfer.files&&Array.prototype.slice.call(t.dataTransfer.files).forEach((function(t){this.isAllowedFile(t)&&t.type.match("image")&&this.insertImageFile(t)}),this),n(t.target)},isAllowedFile:function(t){return this.allowedTypes.some((function(e){return!!t.type.match(e)}))},insertImageFile:function(e){if("function"==typeof FileReader){var n=new FileReader;n.readAsDataURL(e),n.addEventListener("load",function(e){var n=this.document.createElement("img");n.src=e.target.result,t.util.insertHTMLCommand(this.document,n.outerHTML)}.bind(this))}}});t.extensions.fileDragging=o}(),a=t.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){t.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach((function(t){var e=t.key.charCodeAt(0);this.keys[e]||(this.keys[e]=[]),this.keys[e].push(t)}),this)},handleKeydown:function(e){var n=t.util.getKeyCode(e);if(this.keys[n]){var o=t.util.isMetaCtrlKey(e),i=!!e.shiftKey,r=!!e.altKey;this.keys[n].forEach((function(t){t.meta!==o||t.shift!==i||t.alt!==r&&void 0!==t.alt||(e.preventDefault(),e.stopPropagation(),"function"==typeof t.command?t.command.apply(this):!1!==t.command&&this.execAction(t.command))}),this)}}}),t.extensions.keyboardCommands=a,s=t.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'<i class="fa fa-font"></i>',fonts:["","Arial","Verdana","Times New Roman"],init:function(){t.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(t){if(t.preventDefault(),t.stopPropagation(),!this.isDisplayed()){var e=this.document.queryCommandValue("fontName")+"";this.showForm(e)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(t){var e=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),e.value=t||"",e.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var t,e=this.document,n=e.createElement("div"),o=e.createElement("select"),i=e.createElement("a"),r=e.createElement("a");n.className="medium-editor-toolbar-form",n.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(n,"click",this.handleFormClick.bind(this));for(var a=0;a<this.fonts.length;a++)(t=e.createElement("option")).innerHTML=this.fonts[a],t.value=this.fonts[a],o.appendChild(t);return o.className="medium-editor-toolbar-select",n.appendChild(o),this.on(o,"change",this.handleFontChange.bind(this)),r.setAttribute("href","#"),r.className="medium-editor-toobar-save",r.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':"✓",n.appendChild(r),this.on(r,"click",this.handleSaveClick.bind(this),!0),i.setAttribute("href","#"),i.className="medium-editor-toobar-close",i.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':"×",n.appendChild(i),this.on(i,"click",this.handleCloseClick.bind(this)),n},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){t.selection.getSelectedElements(this.document).forEach((function(t){"font"===t.nodeName.toLowerCase()&&t.hasAttribute("face")&&t.removeAttribute("face")}))},handleFontChange:function(){var t=this.getSelect().value;""===t?this.clearFontName():this.execAction("fontName",{value:t})},handleFormClick:function(t){t.stopPropagation()},handleSaveClick:function(t){t.preventDefault(),this.doFormSave()},handleCloseClick:function(t){t.preventDefault(),this.doFormCancel()}}),t.extensions.fontName=s,l=t.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'<i class="fa fa-text-height"></i>',init:function(){t.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(t){if(t.preventDefault(),t.stopPropagation(),!this.isDisplayed()){var e=this.document.queryCommandValue("fontSize")+"";this.showForm(e)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(t){var e=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),e.value=t||"",e.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var t=this.document,e=t.createElement("div"),n=t.createElement("input"),o=t.createElement("a"),i=t.createElement("a");return e.className="medium-editor-toolbar-form",e.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(e,"click",this.handleFormClick.bind(this)),n.setAttribute("type","range"),n.setAttribute("min","1"),n.setAttribute("max","7"),n.className="medium-editor-toolbar-input",e.appendChild(n),this.on(n,"change",this.handleSliderChange.bind(this)),i.setAttribute("href","#"),i.className="medium-editor-toobar-save",i.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':"✓",e.appendChild(i),this.on(i,"click",this.handleSaveClick.bind(this),!0),o.setAttribute("href","#"),o.className="medium-editor-toobar-close",o.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':"×",e.appendChild(o),this.on(o,"click",this.handleCloseClick.bind(this)),e},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){t.selection.getSelectedElements(this.document).forEach((function(t){"font"===t.nodeName.toLowerCase()&&t.hasAttribute("size")&&t.removeAttribute("size")}))},handleSliderChange:function(){var t=this.getInput().value;"4"===t?this.clearFontSize():this.execAction("fontSize",{value:t})},handleFormClick:function(t){t.stopPropagation()},handleSaveClick:function(t){t.preventDefault(),this.doFormSave()},handleCloseClick:function(t){t.preventDefault(),this.doFormCancel()}}),t.extensions.fontSize=l,function(){var e="%ME_PASTEBIN%",n=null,o=null,i=function(t){t.stopPropagation()};function r(t,e,n){var o=t.clipboardData||e.clipboardData||n.dataTransfer,i={};if(!o)return i;if(o.getData){var r=o.getData("Text");r&&r.length>0&&(i["text/plain"]=r)}if(o.types)for(var a=0;a<o.types.length;a++){var s=o.types[a];i[s]=o.getData(s)}return i}var a=t.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],unwrapTags:[],init:function(){t.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&(this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.getEditorElements().forEach((function(t){this.on(t,"paste",this.handlePaste.bind(this))}),this),this.subscribe("addElement",this.handleAddElement.bind(this)))},handleAddElement:function(t,e){this.on(e,"paste",this.handlePaste.bind(this))},destroy:function(){(this.forcePlainText||this.cleanPastedHTML)&&this.removePasteBin()},handlePaste:function(t,e){if(!t.defaultPrevented){var n=r(t,this.window,this.document),o=n["text/html"],i=n["text/plain"];this.window.clipboardData&&void 0===t.clipboardData&&!o&&(o=i),(o||i)&&(t.preventDefault(),this.doPaste(o,i,e))}},doPaste:function(e,n,o){var i,r,a="";if(this.cleanPastedHTML&&e)return this.cleanPaste(e);if(n){if(this.getEditorOption("disableReturn")||o&&o.getAttribute("data-disable-return"))a=t.util.htmlEntities(n);else if((i=n.split(/[\r\n]+/g)).length>1)for(r=0;r<i.length;r+=1)""!==i[r]&&(a+="<p>"+t.util.htmlEntities(i[r])+"</p>");else a=t.util.htmlEntities(i[0]);t.util.insertHTMLCommand(this.document,a)}},handlePasteBinPaste:function(t){if(t.defaultPrevented)this.removePasteBin();else{var e=r(t,this.window,this.document),n=e["text/html"],i=e["text/plain"],a=o;if(!this.cleanPastedHTML||n)return t.preventDefault(),this.removePasteBin(),this.doPaste(n,i,a),void this.trigger("editablePaste",{currentTarget:a,target:a},a);setTimeout(function(){this.cleanPastedHTML&&(n=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(n,i,a),this.trigger("editablePaste",{currentTarget:a,target:a},a)}.bind(this),0)}},handleKeydown:function(e,n){t.util.isKey(e,t.util.keyCode.V)&&t.util.isMetaCtrlKey(e)&&(e.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(n))},createPasteBin:function(r){var a,s=t.selection.getSelectionRange(this.document),l=this.window.pageYOffset;o=r,s&&((a=s.getClientRects()).length?l+=a[0].top:void 0!==s.startContainer.getBoundingClientRect?l+=s.startContainer.getBoundingClientRect().top:l+=s.getBoundingClientRect().top),n=s;var u=this.document.createElement("div");u.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),u.setAttribute("style","border: 1px red solid; position: absolute; top: "+l+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),u.setAttribute("contentEditable",!0),u.innerHTML=e,this.document.body.appendChild(u),this.on(u,"focus",i),this.on(u,"focusin",i),this.on(u,"focusout",i),u.focus(),t.selection.selectNode(u,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(u,"paste",this.boundHandlePaste)},removePasteBin:function(){null!==n&&(t.selection.selectRange(this.document,n),n=null),null!==o&&(o=null);var e=this.getPasteBin();e&&e&&(this.off(e,"focus",i),this.off(e,"focusin",i),this.off(e,"focusout",i),this.off(e,"paste",this.boundHandlePaste),e.parentElement.removeChild(e))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var t=this.getPasteBin();if(!t)return!1;if(t.firstChild&&"mcepastebin"===t.firstChild.id)return!1;var n=t.innerHTML;return!(!n||n===e)&&n},cleanPaste:function(t){var e,n,o,i,r=/<p|<br|<div/.test(t),a=[].concat(this.preCleanReplacements||[],[[new RegExp(/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g),""],[new RegExp(/<br>$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),'<a href="$1">'],[new RegExp(/<\/p>\n+/gi),"</p>"],[new RegExp(/\n+<p/gi),"<p"],[new RegExp(/<\/?o:[a-z]*>/gi),""],[new RegExp(/<!\[if !supportLists\]>(((?!<!).)*)<!\[endif]\>/gi),"$1"]],this.cleanReplacements||[]);for(e=0;e<a.length;e+=1)t=t.replace(a[e][0],a[e][1]);if(!r)return this.pasteHTML(t);for((o=this.document.createElement("div")).innerHTML="<p>"+t.split("<br><br>").join("</p><p>")+"</p>",n=o.querySelectorAll("a,p,div,br"),e=0;e<n.length;e+=1)switch((i=n[e]).innerHTML=i.innerHTML.replace(/\n/gi," "),i.nodeName.toLowerCase()){case"p":case"div":this.filterCommonBlocks(i);break;case"br":this.filterLineBreak(i)}this.pasteHTML(o.innerHTML)},pasteHTML:function(e,n){n=t.util.defaults({},n,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags,unwrapTags:this.unwrapTags});var o,i,r,a,s=this.document.createDocumentFragment();for(s.appendChild(this.document.createElement("body")),(a=s.querySelector("body")).innerHTML=e,this.cleanupSpans(a),o=a.querySelectorAll("*"),r=0;r<o.length;r+=1)"a"===(i=o[r]).nodeName.toLowerCase()&&this.getEditorOption("targetBlank")&&t.util.setTargetBlank(i),t.util.cleanupAttrs(i,n.cleanAttrs),t.util.cleanupTags(i,n.cleanTags),t.util.unwrapTags(i,n.unwrapTags);t.util.insertHTMLCommand(this.document,a.innerHTML.replace(/ /g," "))},isCommonBlock:function(t){return t&&("p"===t.nodeName.toLowerCase()||"div"===t.nodeName.toLowerCase())},filterCommonBlocks:function(t){/^\s*$/.test(t.textContent)&&t.parentNode&&t.parentNode.removeChild(t)},filterLineBreak:function(t){this.isCommonBlock(t.previousElementSibling)?this.removeWithParent(t):!this.isCommonBlock(t.parentNode)||t.parentNode.firstChild!==t&&t.parentNode.lastChild!==t?t.parentNode&&1===t.parentNode.childElementCount&&""===t.parentNode.textContent&&this.removeWithParent(t):this.removeWithParent(t)},removeWithParent:function(t){t&&t.parentNode&&(t.parentNode.parentNode&&1===t.parentNode.childElementCount?t.parentNode.parentNode.removeChild(t.parentNode):t.parentNode.removeChild(t))},cleanupSpans:function(e){var n,o,i,r=e.querySelectorAll(".replace-with"),a=function(t){return t&&"#text"!==t.nodeName&&"false"===t.getAttribute("contenteditable")};for(n=0;n<r.length;n+=1)o=r[n],i=this.document.createElement(o.classList.contains("bold")?"b":"i"),o.classList.contains("bold")&&o.classList.contains("italic")?i.innerHTML="<i>"+o.innerHTML+"</i>":i.innerHTML=o.innerHTML,o.parentNode.replaceChild(i,o);for(r=e.querySelectorAll("span"),n=0;n<r.length;n+=1){if(o=r[n],t.util.traverseUp(o,a))return!1;t.util.unwrap(o,this.document)}}});t.extensions.paste=a}(),u=t.Extension.extend({name:"placeholder",text:"Type your text",hideOnClick:!0,init:function(){t.Extension.prototype.init.apply(this,arguments),this.initPlaceholders(),this.attachEventHandlers()},initPlaceholders:function(){this.getEditorElements().forEach(this.initElement,this)},handleAddElement:function(t,e){this.initElement(e)},initElement:function(t){t.getAttribute("data-placeholder")||t.setAttribute("data-placeholder",this.text),this.updatePlaceholder(t)},destroy:function(){this.getEditorElements().forEach(this.cleanupElement,this)},handleRemoveElement:function(t,e){this.cleanupElement(e)},cleanupElement:function(t){t.getAttribute("data-placeholder")===this.text&&t.removeAttribute("data-placeholder")},showPlaceholder:function(e){e&&(t.util.isFF&&0===e.childNodes.length?(e.classList.add("medium-editor-placeholder-relative"),e.classList.remove("medium-editor-placeholder")):(e.classList.add("medium-editor-placeholder"),e.classList.remove("medium-editor-placeholder-relative")))},hidePlaceholder:function(t){t&&(t.classList.remove("medium-editor-placeholder"),t.classList.remove("medium-editor-placeholder-relative"))},updatePlaceholder:function(t,e){if(t.querySelector("img, blockquote, ul, ol, table")||""!==t.textContent.replace(/^\s+|\s+$/g,""))return this.hidePlaceholder(t);e||this.showPlaceholder(t)},attachEventHandlers:function(){this.hideOnClick&&this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableInput",this.handleInput.bind(this)),this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("addElement",this.handleAddElement.bind(this)),this.subscribe("removeElement",this.handleRemoveElement.bind(this))},handleInput:function(t,e){var n=this.hideOnClick&&e===this.base.getFocusedElement();this.updatePlaceholder(e,n)},handleFocus:function(t,e){this.hidePlaceholder(e)},handleBlur:function(t,e){this.updatePlaceholder(e)}}),t.extensions.placeholder=u,c=t.Extension.extend({name:"toolbar",align:"center",allowMultiParagraphSelection:!0,buttons:["bold","italic","underline","anchor","h2","h3","quote"],diffLeft:0,diffTop:-10,firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last",standardizeSelectionStart:!1,static:!1,sticky:!1,stickyTopOffset:0,updateOnEmptySelection:!1,relativeContainer:null,init:function(){t.Extension.prototype.init.apply(this,arguments),this.initThrottledMethods(),this.relativeContainer?this.relativeContainer.appendChild(this.getToolbarElement()):this.getEditorOption("elementsContainer").appendChild(this.getToolbarElement())},forEachExtension:function(t,e){return this.base.extensions.forEach((function(n){if(n!==this)return t.apply(e||this,arguments)}),this)},createToolbar:function(){var t=this.document.createElement("div");return t.id="medium-editor-toolbar-"+this.getEditorId(),t.className="medium-editor-toolbar",this.static?t.className+=" static-toolbar":this.relativeContainer?t.className+=" medium-editor-relative-toolbar":t.className+=" medium-editor-stalker-toolbar",t.appendChild(this.createToolbarButtons()),this.forEachExtension((function(e){e.hasForm&&t.appendChild(e.getForm())})),this.attachEventHandlers(),t},createToolbarButtons:function(){var e,n,o,i,r,a,s=this.document.createElement("ul");return s.id="medium-editor-toolbar-actions"+this.getEditorId(),s.className="medium-editor-toolbar-actions",s.style.display="block",this.buttons.forEach((function(o){"string"==typeof o?(r=o,a=null):(r=o.name,a=o),(i=this.base.addBuiltInExtension(r,a))&&"function"==typeof i.getButton&&(n=i.getButton(this.base),e=this.document.createElement("li"),t.util.isElement(n)?e.appendChild(n):e.innerHTML=n,s.appendChild(e))}),this),(o=s.querySelectorAll("button")).length>0&&(o[0].classList.add(this.firstButtonClass),o[o.length-1].classList.add(this.lastButtonClass)),s},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getInteractionElements:function(){return this.getToolbarElement()},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=t.util.throttle(function(){this.base.isActive&&this.positionToolbarIfShown()}.bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this.static&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(e){if(e&&e.target&&t.util.isDescendant(this.getToolbarElement(),e.target))return!1;this.checkState()},handleEditableClick:function(){setTimeout(function(){this.checkState()}.bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout(function(){this.hideToolbar()}.bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return"block"===this.getToolbarActionsElement().style.display},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay(function(){this.showToolbar()}.bind(this))},hideExtensionForms:function(){this.forEachExtension((function(t){t.hasForm&&t.isDisplayed()&&t.hideForm()}))},multipleBlockElementsSelected:function(){var e=new RegExp("<("+t.util.blockContainerElementNames.join("|")+")[^>]*>","g"),n=t.selection.getSelectionHtml(this.document).replace(/<[^\/>][^>]*><\/[^>]+>/gim,"").match(e);return!!n&&n.length>1},modifySelection:function(){var e=this.window.getSelection().getRangeAt(0);if(this.standardizeSelectionStart&&e.startContainer.nodeValue&&e.startOffset===e.startContainer.nodeValue.length){var n=t.util.findAdjacentTextNodeWithContent(t.selection.getSelectionElement(this.window),e.startContainer,this.document);if(n){for(var o=0;0===n.nodeValue.substr(o,1).trim().length;)o+=1;e=t.selection.select(this.document,n,o,e.endContainer,e.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||t.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var e=t.selection.getSelectionElement(this.window);return!e||-1===this.getEditorElements().indexOf(e)||e.getAttribute("data-disable-toolbar")?this.hideToolbar():this.updateOnEmptySelection&&this.static?this.showAndUpdateToolbar():!t.selection.selectionContainsContent(this.document)||!1===this.allowMultiParagraphSelection&&this.multipleBlockElementsSelected()?this.hideToolbar():void this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension((function(t){"function"==typeof t.isActive&&"function"==typeof t.setInactive&&t.setInactive()})),this.checkActiveButtons()},checkActiveButtons:function(){var e,n=[],o=null,i=t.selection.getSelectionRange(this.document),r=function(t){"function"==typeof t.checkState?t.checkState(e):"function"==typeof t.isActive&&"function"==typeof t.isAlreadyApplied&&"function"==typeof t.setActive&&!t.isActive()&&t.isAlreadyApplied(e)&&t.setActive()};if(i&&(this.forEachExtension((function(t){"function"!=typeof t.queryCommandState||null===(o=t.queryCommandState())?n.push(t):o&&"function"==typeof t.setActive&&t.setActive()})),e=t.selection.getSelectedParentElement(i),this.getEditorElements().some((function(n){return t.util.isDescendant(n,e,!0)}))))for(;e&&(n.forEach(r),!t.util.isMediumEditorElement(e));)e=e.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var t=this.base.getFocusedElement(),e=this.window.getSelection();if(!t)return this;!this.static&&e.isCollapsed||(this.showToolbar(),this.relativeContainer||(this.static?this.positionStaticToolbar(t):this.positionToolbar(e)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))},positionStaticToolbar:function(t){this.getToolbarElement().style.left="0";var e,n=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,o=this.window.innerWidth,i=this.getToolbarElement(),r=t.getBoundingClientRect(),a=r.top+n,s=r.left+r.width/2,l=i.offsetHeight,u=i.offsetWidth,c=u/2;switch(this.sticky?n>a+t.offsetHeight-l-this.stickyTopOffset?(i.style.top=a+t.offsetHeight-l+"px",i.classList.remove("medium-editor-sticky-toolbar")):n>a-l-this.stickyTopOffset?(i.classList.add("medium-editor-sticky-toolbar"),i.style.top=this.stickyTopOffset+"px"):(i.classList.remove("medium-editor-sticky-toolbar"),i.style.top=a-l+"px"):i.style.top=a-l+"px",this.align){case"left":e=r.left;break;case"right":e=r.right-u;break;case"center":e=s-c}e<0?e=0:e+u>o&&(e=o-Math.ceil(u)-1),i.style.left=e+"px"},positionToolbar:function(t){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var e=t.getRangeAt(0),n=e.getBoundingClientRect();(!n||0===n.height&&0===n.width&&e.startContainer===e.endContainer)&&(n=1===e.startContainer.nodeType&&e.startContainer.querySelector("img")?e.startContainer.querySelector("img").getBoundingClientRect():e.startContainer.getBoundingClientRect());var o,i,r=this.window.innerWidth,a=this.getToolbarElement(),s=a.offsetHeight,l=a.offsetWidth/2,u=this.diffLeft-l,c=this.getEditorOption("elementsContainer"),d=["absolute","fixed"].indexOf(window.getComputedStyle(c).getPropertyValue("position"))>-1,h={},p={};d?(i=c.getBoundingClientRect(),["top","left"].forEach((function(t){p[t]=n[t]-i[t]})),p.width=n.width,p.height=n.height,n=p,r=i.width,h.top=c.scrollTop):h.top=this.window.pageYOffset,o=n.left+n.width/2,h.top+=n.top-s,n.top<50?(a.classList.add("medium-toolbar-arrow-over"),a.classList.remove("medium-toolbar-arrow-under"),h.top+=50+n.height-this.diffTop):(a.classList.add("medium-toolbar-arrow-under"),a.classList.remove("medium-toolbar-arrow-over"),h.top+=this.diffTop),o<l?(h.left=u+l,h.right="initial"):r-o<l?(h.left="auto",h.right=0):(h.left=u+o,h.right="initial"),["top","left","right"].forEach((function(t){a.style[t]=h[t]+(isNaN(h[t])?"":"px")}))}}),t.extensions.toolbar=c,d=t.Extension.extend({init:function(){t.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(t){var e="medium-editor-dragover";t.preventDefault(),t.dataTransfer.dropEffect="copy","dragover"===t.type?t.target.classList.add(e):"dragleave"===t.type&&t.target.classList.remove(e)},handleDrop:function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.files&&Array.prototype.slice.call(e.dataTransfer.files,0).some(function(e){var n,o;e.type.match("image")&&((n=new FileReader).readAsDataURL(e),o="medium-img-"+ +new Date,t.util.insertHTMLCommand(this.document,'<img class="medium-editor-image-loading" id="'+o+'" />'),n.onload=function(){var t=this.document.getElementById(o);t&&(t.removeAttribute("id"),t.removeAttribute("class"),t.src=n.result)}.bind(this))}.bind(this)),e.target.classList.remove("medium-editor-dragover")}}),t.extensions.imageDragging=d,function(){function e(e){var n=t.selection.getSelectionStart(this.options.ownerDocument),o=n.textContent,i=t.selection.getCaretOffsets(n);(void 0===o[i.left-1]||""===o[i.left-1].trim()||void 0!==o[i.left]&&""===o[i.left].trim())&&e.preventDefault()}function n(e,n){if(this.options.disableReturn||n.getAttribute("data-disable-return"))e.preventDefault();else if(this.options.disableDoubleReturn||n.getAttribute("data-disable-double-return")){var o=t.selection.getSelectionStart(this.options.ownerDocument);(o&&""===o.textContent.trim()&&"li"!==o.nodeName.toLowerCase()||o.previousElementSibling&&"br"!==o.previousElementSibling.nodeName.toLowerCase()&&""===o.previousElementSibling.textContent.trim())&&e.preventDefault()}}function o(e){var n=t.selection.getSelectionStart(this.options.ownerDocument);"pre"===(n&&n.nodeName.toLowerCase())&&(e.preventDefault(),t.util.insertHTMLCommand(this.options.ownerDocument," ")),t.util.isListItem(n)&&(e.preventDefault(),e.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function i(e){var n,o=t.selection.getSelectionStart(this.options.ownerDocument),i=o.nodeName.toLowerCase(),r=/^(\s+|<br\/?>)?$/i,a=/h\d/i;t.util.isKey(e,[t.util.keyCode.BACKSPACE,t.util.keyCode.ENTER])&&o.previousElementSibling&&a.test(i)&&0===t.selection.getCaretOffsets(o).left?t.util.isKey(e,t.util.keyCode.BACKSPACE)&&r.test(o.previousElementSibling.innerHTML)?(o.previousElementSibling.parentNode.removeChild(o.previousElementSibling),e.preventDefault()):!this.options.disableDoubleReturn&&t.util.isKey(e,t.util.keyCode.ENTER)&&((n=this.options.ownerDocument.createElement("p")).innerHTML="<br>",o.previousElementSibling.parentNode.insertBefore(n,o),e.preventDefault()):t.util.isKey(e,t.util.keyCode.DELETE)&&o.nextElementSibling&&o.previousElementSibling&&!a.test(i)&&r.test(o.innerHTML)&&a.test(o.nextElementSibling.nodeName.toLowerCase())?(t.selection.moveCursor(this.options.ownerDocument,o.nextElementSibling),o.previousElementSibling.parentNode.removeChild(o),e.preventDefault()):t.util.isKey(e,t.util.keyCode.BACKSPACE)&&"li"===i&&r.test(o.innerHTML)&&!o.previousElementSibling&&!o.parentElement.previousElementSibling&&o.nextElementSibling&&"li"===o.nextElementSibling.nodeName.toLowerCase()?((n=this.options.ownerDocument.createElement("p")).innerHTML="<br>",o.parentElement.parentElement.insertBefore(n,o.parentElement),t.selection.moveCursor(this.options.ownerDocument,n),o.parentElement.removeChild(o),e.preventDefault()):t.util.isKey(e,t.util.keyCode.BACKSPACE)&&!1!==t.util.getClosestTag(o,"blockquote")&&0===t.selection.getCaretOffsets(o).left?(e.preventDefault(),t.util.execFormatBlock(this.options.ownerDocument,"p")):t.util.isKey(e,t.util.keyCode.ENTER)&&!1!==t.util.getClosestTag(o,"blockquote")&&0===t.selection.getCaretOffsets(o).right?((n=this.options.ownerDocument.createElement("p")).innerHTML="<br>",o.parentElement.insertBefore(n,o.nextSibling),t.selection.moveCursor(this.options.ownerDocument,n),e.preventDefault()):t.util.isKey(e,t.util.keyCode.BACKSPACE)&&t.util.isMediumEditorElement(o.parentElement)&&!o.previousElementSibling&&o.nextElementSibling&&r.test(o.innerHTML)&&(e.preventDefault(),t.selection.moveCursor(this.options.ownerDocument,o.nextSibling),o.parentElement.removeChild(o))}function r(e){var n=t.selection.getSelectionStart(this.options.ownerDocument);n&&(t.util.isMediumEditorElement(n)&&0===n.children.length&&!t.util.isBlockContainer(n)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),!t.util.isKey(e,t.util.keyCode.ENTER)||t.util.isListItem(n)||t.util.isBlockContainer(n)||("a"===n.nodeName.toLowerCase()?this.options.ownerDocument.execCommand("unlink",!1,null):e.shiftKey||e.ctrlKey||this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function a(t,e){var n=e.parentNode.querySelector('textarea[medium-editor-textarea-id="'+e.getAttribute("medium-editor-textarea-id")+'"]');n&&(n.value=e.innerHTML.trim())}function s(t){t._mediumEditors||(t._mediumEditors=[null]),this.id||(this.id=t._mediumEditors.length),t._mediumEditors[this.id]=this}function l(t){t._mediumEditors&&t._mediumEditors[this.id]&&(t._mediumEditors[this.id]=null)}function u(e,n,o){var i=[];if(e||(e=[]),"string"==typeof e&&(e=n.querySelectorAll(e)),t.util.isElement(e)&&(e=[e]),o)for(var r=0;r<e.length;r++){var a=e[r];!t.util.isElement(a)||a.getAttribute("data-medium-editor-element")||a.getAttribute("medium-editor-textarea-id")||i.push(a)}else i=Array.prototype.slice.apply(e);return i}function c(t){var e=t.parentNode.querySelector('textarea[medium-editor-textarea-id="'+t.getAttribute("medium-editor-textarea-id")+'"]');e&&(e.classList.remove("medium-editor-hidden"),e.removeAttribute("medium-editor-textarea-id")),t.parentNode&&t.parentNode.removeChild(t)}function d(t,e,n){return t=function(t,e){return Object.keys(e).forEach((function(n){void 0===t[n]&&(t[n]=e[n])})),t}(t,{window:n.options.contentWindow,document:n.options.ownerDocument,base:n}),"function"==typeof t.init&&t.init(),t.name||(t.name=e),t}function h(){return!this.elements.every((function(t){return!!t.getAttribute("data-disable-toolbar")}))&&!1!==this.options.toolbar}function p(){return!!h.call(this)&&!1!==this.options.anchorPreview}function f(){return!1!==this.options.placeholder}function g(){return!1!==this.options.autoLink}function v(){return!1!==this.options.imageDragging}function y(){return!1!==this.options.keyboardCommands}function m(){return!this.options.extensions.imageDragging}function b(t){for(var e=this.options.ownerDocument.createElement("div"),n=Date.now(),o="medium-editor-"+n,i=t.attributes;this.options.ownerDocument.getElementById(o);)n++,o="medium-editor-"+n;e.className=t.className,e.id=o,e.innerHTML=t.value,t.setAttribute("medium-editor-textarea-id",o);for(var r=0,a=i.length;r<a;r++)e.hasAttribute(i[r].nodeName)||e.setAttribute(i[r].nodeName,i[r].value);return t.form&&this.on(t.form,"reset",function(t){t.defaultPrevented||this.resetContent(this.options.ownerDocument.getElementById(o))}.bind(this)),t.classList.add("medium-editor-hidden"),t.parentNode.insertBefore(e,t),e}function x(e,o){if(!e.getAttribute("data-medium-editor-element")){"textarea"===e.nodeName.toLowerCase()&&(e=b.call(this,e),this.instanceHandleEditableInput||(this.instanceHandleEditableInput=a.bind(this),this.subscribe("editableInput",this.instanceHandleEditableInput))),this.options.disableEditing||e.getAttribute("data-disable-editing")||(e.setAttribute("contentEditable",!0),e.setAttribute("spellcheck",this.options.spellcheck)),this.instanceHandleEditableKeydownEnter||(e.getAttribute("data-disable-return")||e.getAttribute("data-disable-double-return"))&&(this.instanceHandleEditableKeydownEnter=n.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter)),this.options.disableReturn||e.getAttribute("data-disable-return")||this.on(e,"keyup",r.bind(this));var i=t.util.guid();e.setAttribute("data-medium-editor-element",!0),e.classList.add("medium-editor-element"),e.setAttribute("role","textbox"),e.setAttribute("aria-multiline",!0),e.setAttribute("data-medium-editor-editor-index",o),e.setAttribute("medium-editor-index",i),N[i]=e.innerHTML,this.events.attachAllEventsToElement(e)}return e}function _(){this.subscribe("editableKeydownTab",o.bind(this)),this.subscribe("editableKeydownDelete",i.bind(this)),this.subscribe("editableKeydownEnter",i.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",e.bind(this)),this.instanceHandleEditableKeydownEnter||(this.options.disableReturn||this.options.disableDoubleReturn)&&(this.instanceHandleEditableKeydownEnter=n.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter))}function E(){if(this.extensions=[],Object.keys(this.options.extensions).forEach((function(t){"toolbar"!==t&&this.options.extensions[t]&&this.extensions.push(d(this.options.extensions[t],t,this))}),this),m.call(this)){var e=this.options.fileDragging;e||(e={},v.call(this)||(e.allowedTypes=[])),this.addBuiltInExtension("fileDragging",e)}var n={paste:!0,"anchor-preview":p.call(this),autoLink:g.call(this),keyboardCommands:y.call(this),placeholder:f.call(this)};Object.keys(n).forEach((function(t){n[t]&&this.addBuiltInExtension(t)}),this);var o=this.options.extensions.toolbar;if(!o&&h.call(this)){var i=t.util.extend({},this.options.toolbar,{allowMultiParagraphSelection:this.options.allowMultiParagraphSelection});o=new t.extensions.toolbar(i)}o&&this.extensions.push(d(o,"toolbar",this))}function w(e,n){return n&&[["allowMultiParagraphSelection","toolbar.allowMultiParagraphSelection"]].forEach((function(e){n.hasOwnProperty(e[0])&&void 0!==n[e[0]]&&t.util.deprecated(e[0],e[1],"v6.0.0")})),t.util.defaults({},n,e)}function S(e,n){var o,i;if(o=/^append-(.+)$/gi.exec(e))return t.util.execFormatBlock(this.options.ownerDocument,o[1]);if("fontSize"===e)return n.size&&t.util.deprecated(".size option for fontSize command",".value","6.0.0"),i=n.value||n.size,this.options.ownerDocument.execCommand("fontSize",!1,i);if("fontName"===e)return n.name&&t.util.deprecated(".name option for fontName command",".value","6.0.0"),i=n.value||n.name,this.options.ownerDocument.execCommand("fontName",!1,i);if("createLink"===e)return this.createLink(n);if("image"===e){var r=this.options.contentWindow.getSelection().toString().trim();return this.options.ownerDocument.execCommand("insertImage",!1,r)}if("html"===e){var a=this.options.contentWindow.getSelection().toString().trim();return t.util.insertHTMLCommand(this.options.ownerDocument,a)}if(/justify([A-Za-z]*)$/g.exec(e)){var s=this.options.ownerDocument.execCommand(e,!1,null),l=t.selection.getSelectedParentElement(t.selection.getSelectionRange(this.options.ownerDocument));return l&&C.call(this,t.util.getTopBlockContainer(l)),s}return i=n&&n.value,this.options.ownerDocument.execCommand(e,!1,i)}function C(e){if(e){var n,o=Array.prototype.slice.call(e.childNodes).filter((function(t){var e="div"===t.nodeName.toLowerCase();return e&&!n&&(n=t.style.textAlign),e}));o.length&&(this.saveSelection(),o.forEach((function(e){if(e.style.textAlign===n){var o=e.lastChild;if(o){t.util.unwrap(e,this.options.ownerDocument);var i=this.options.ownerDocument.createElement("BR");o.parentNode.insertBefore(i,o.nextSibling)}}}),this),e.style.textAlign=n,this.restoreSelection())}}var N={};t.prototype={init:function(t,e){return this.options=w.call(this,this.defaults,e),this.origElements=t,this.options.elementsContainer||(this.options.elementsContainer=this.options.ownerDocument.body),this.setup()},setup:function(){this.isActive||(s.call(this,this.options.contentWindow),this.events=new t.Events(this),this.elements=[],this.addElements(this.origElements),0!==this.elements.length&&(this.isActive=!0,E.call(this),_.call(this)))},destroy:function(){this.isActive&&(this.isActive=!1,this.extensions.forEach((function(t){"function"==typeof t.destroy&&t.destroy()}),this),this.events.destroy(),this.elements.forEach((function(t){this.options.spellcheck&&(t.innerHTML=t.innerHTML),t.removeAttribute("contentEditable"),t.removeAttribute("spellcheck"),t.removeAttribute("data-medium-editor-element"),t.classList.remove("medium-editor-element"),t.removeAttribute("role"),t.removeAttribute("aria-multiline"),t.removeAttribute("medium-editor-index"),t.removeAttribute("data-medium-editor-editor-index"),t.getAttribute("medium-editor-textarea-id")&&c(t)}),this),this.elements=[],this.instanceHandleEditableKeydownEnter=null,this.instanceHandleEditableInput=null,l.call(this,this.options.contentWindow))},on:function(t,e,n,o){return this.events.attachDOMEvent(t,e,n,o),this},off:function(t,e,n,o){return this.events.detachDOMEvent(t,e,n,o),this},subscribe:function(t,e){return this.events.attachCustomEvent(t,e),this},unsubscribe:function(t,e){return this.events.detachCustomEvent(t,e),this},trigger:function(t,e,n){return this.events.triggerCustomEvent(t,e,n),this},delay:function(t){var e=this;return setTimeout((function(){e.isActive&&t()}),this.options.delay)},serialize:function(){var t,e={},n=this.elements.length;for(t=0;t<n;t+=1)e[""!==this.elements[t].id?this.elements[t].id:"element-"+t]={value:this.elements[t].innerHTML.trim()};return e},getExtensionByName:function(t){var e;return this.extensions&&this.extensions.length&&this.extensions.some((function(n){return n.name===t&&(e=n,!0)})),e},addBuiltInExtension:function(e,n){var o,i=this.getExtensionByName(e);if(i)return i;switch(e){case"anchor":o=t.util.extend({},this.options.anchor,n),i=new t.extensions.anchor(o);break;case"anchor-preview":i=new t.extensions.anchorPreview(this.options.anchorPreview);break;case"autoLink":i=new t.extensions.autoLink;break;case"fileDragging":i=new t.extensions.fileDragging(n);break;case"fontname":i=new t.extensions.fontName(this.options.fontName);break;case"fontsize":i=new t.extensions.fontSize(n);break;case"keyboardCommands":i=new t.extensions.keyboardCommands(this.options.keyboardCommands);break;case"paste":i=new t.extensions.paste(this.options.paste);break;case"placeholder":i=new t.extensions.placeholder(this.options.placeholder);break;default:t.extensions.button.isBuiltInButton(e)&&(n?(o=t.util.defaults({},n,t.extensions.button.prototype.defaults[e]),i=new t.extensions.button(o)):i=new t.extensions.button(e))}return i&&this.extensions.push(d(i,e,this)),i},stopSelectionUpdates:function(){this.preventSelectionUpdates=!0},startSelectionUpdates:function(){this.preventSelectionUpdates=!1},checkSelection:function(){var t=this.getExtensionByName("toolbar");return t&&t.checkState(),this},queryCommandState:function(t){var e,n=null;(e=/^full-(.+)$/gi.exec(t))&&(t=e[1]);try{n=this.options.ownerDocument.queryCommandState(t)}catch(t){n=null}return n},execAction:function(e,n){var o,i;return(o=/^full-(.+)$/gi.exec(e))?(this.saveSelection(),this.selectAllContents(),i=S.call(this,o[1],n),this.restoreSelection()):i=S.call(this,e,n),"insertunorderedlist"!==e&&"insertorderedlist"!==e||t.util.cleanListDOM(this.options.ownerDocument,this.getSelectedParentElement()),this.checkSelection(),i},getSelectedParentElement:function(e){return void 0===e&&(e=this.options.contentWindow.getSelection().getRangeAt(0)),t.selection.getSelectedParentElement(e)},selectAllContents:function(){var e=t.selection.getSelectionElement(this.options.contentWindow);if(e){for(;1===e.children.length;)e=e.children[0];this.selectElement(e)}},selectElement:function(e){t.selection.selectNode(e,this.options.ownerDocument);var n=t.selection.getSelectionElement(this.options.contentWindow);n&&this.events.focusElement(n)},getFocusedElement:function(){var t;return this.elements.some((function(e){return!t&&e.getAttribute("data-medium-focused")&&(t=e),!!t}),this),t},exportSelection:function(){var e=t.selection.getSelectionElement(this.options.contentWindow),n=this.elements.indexOf(e),o=null;return n>=0&&(o=t.selection.exportSelection(e,this.options.ownerDocument)),null!==o&&0!==n&&(o.editableElementIndex=n),o},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(e,n){if(e){var o=this.elements[e.editableElementIndex||0];t.selection.importSelection(e,o,this.options.ownerDocument,n)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(e){var n,o=t.selection.getSelectionElement(this.options.contentWindow),i={};if(-1!==this.elements.indexOf(o)){try{if(this.events.disableCustomEvent("editableInput"),e.url&&t.util.deprecated(".url option for createLink",".value","6.0.0"),(n=e.url||e.value)&&n.trim().length>0){var r=this.options.contentWindow.getSelection();if(r){var a,s,l,u,c=r.getRangeAt(0),d=c.commonAncestorContainer;if(3===c.endContainer.nodeType&&3!==c.startContainer.nodeType&&0===c.startOffset&&c.startContainer.firstChild===c.endContainer&&(d=c.endContainer),s=t.util.getClosestBlockContainer(c.startContainer),l=t.util.getClosestBlockContainer(c.endContainer),3!==d.nodeType&&0!==d.textContent.length&&s===l){var h=s||o,p=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),a=this.exportSelection(),p.appendChild(h.cloneNode(!0)),o===h?t.selection.select(this.options.ownerDocument,h.firstChild,0,h.lastChild,3===h.lastChild.nodeType?h.lastChild.nodeValue.length:h.lastChild.childNodes.length):t.selection.select(this.options.ownerDocument,h,0,h,h.childNodes.length);var f=this.exportSelection();0===(u=t.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,p,{start:a.start-f.start,end:a.end-f.start,editableElementIndex:a.editableElementIndex})).length&&((p=this.options.ownerDocument.createDocumentFragment()).appendChild(d.cloneNode(!0)),u=[p.firstChild.firstChild,p.firstChild.lastChild]),t.util.createLink(this.options.ownerDocument,u,n.trim());var g=(p.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;t.util.insertHTMLCommand(this.options.ownerDocument,p.firstChild.innerHTML.replace(/^\s+/,"")),a.start-=g,a.end-=g,this.importSelection(a)}else this.options.ownerDocument.execCommand("createLink",!1,n);this.options.targetBlank||"_blank"===e.target?t.util.setTargetBlank(t.selection.getSelectionStart(this.options.ownerDocument),n):t.util.removeTargetBlank(t.selection.getSelectionStart(this.options.ownerDocument),n),e.buttonClass&&t.util.addClassToAnchors(t.selection.getSelectionStart(this.options.ownerDocument),e.buttonClass)}}if(this.options.targetBlank||"_blank"===e.target||e.buttonClass){(i=this.options.ownerDocument.createEvent("HTMLEvents")).initEvent("input",!0,!0,this.options.contentWindow);for(var v=0,y=this.elements.length;v<y;v+=1)this.elements[v].dispatchEvent(i)}}finally{this.events.enableCustomEvent("editableInput")}this.events.triggerCustomEvent("editableInput",i,o)}},cleanPaste:function(t){this.getExtensionByName("paste").cleanPaste(t)},pasteHTML:function(t,e){this.getExtensionByName("paste").pasteHTML(t,e)},setContent:function(t,e){if(e=e||0,this.elements[e]){var n=this.elements[e];n.innerHTML=t,this.checkContentChanged(n)}},getContent:function(t){return t=t||0,this.elements[t]?this.elements[t].innerHTML.trim():null},checkContentChanged:function(e){e=e||t.selection.getSelectionElement(this.options.contentWindow),this.events.updateInput(e,{target:e,currentTarget:e})},resetContent:function(t){if(t){var e=this.elements.indexOf(t);-1!==e&&this.setContent(N[t.getAttribute("medium-editor-index")],e)}else this.elements.forEach((function(t,e){this.setContent(N[t.getAttribute("medium-editor-index")],e)}),this)},addElements:function(t){var e=u(t,this.options.ownerDocument,!0);if(0===e.length)return!1;e.forEach((function(t){t=x.call(this,t,this.id),this.elements.push(t),this.trigger("addElement",{target:t,currentTarget:t},t)}),this)},removeElements:function(t){var e=u(t,this.options.ownerDocument).map((function(t){return t.getAttribute("medium-editor-textarea-id")&&t.parentNode?t.parentNode.querySelector('div[medium-editor-textarea-id="'+t.getAttribute("medium-editor-textarea-id")+'"]'):t}));this.elements=this.elements.filter((function(t){return-1===e.indexOf(t)||(this.events.cleanupElement(t),t.getAttribute("medium-editor-textarea-id")&&c(t),this.trigger("removeElement",{target:t,currentTarget:t},t),!1)}),this)}},t.getEditorFromElement=function(t){var e=t.getAttribute("data-medium-editor-editor-index"),n=t&&t.ownerDocument&&(t.ownerDocument.defaultView||t.ownerDocument.parentWindow);return n&&n._mediumEditors&&n._mediumEditors[e]?n._mediumEditors[e]:null}}(),t.prototype.defaults={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableExtraSpaces:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0},t.parseVersionString=function(t){var e=t.split("-"),n=e[0].split("."),o=e.length>1?e[1]:"";return{major:parseInt(n[0],10),minor:parseInt(n[1],10),revision:parseInt(n[2],10),preRelease:o,toString:function(){return[n[0],n[1],n[2]].join(".")+(o?"-"+o:"")}}},t.version=t.parseVersionString.call(this,"5.23.3"),t}())}(Bw);var Hw=jw,Fw=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},zw=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),Ww=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],o=!0,i=!1,r=void 0;try{for(var a,s=t[Symbol.iterator]();!(o=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);o=!0);}catch(t){i=!0,r=t}finally{try{!o&&s.return&&s.return()}finally{if(i)throw r}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")};
|
|
35
|
-
/*!
|
|
36
|
-
* vanilla-picker v2.12.3
|
|
37
|
-
* https://vanilla-picker.js.org
|
|
38
|
-
*
|
|
39
|
-
* Copyright 2017-2024 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
|
|
40
|
-
* Released under the ISC license.
|
|
41
|
-
*/String.prototype.startsWith=String.prototype.startsWith||function(t){return 0===this.indexOf(t)},String.prototype.padStart=String.prototype.padStart||function(t,e){for(var n=this;n.length<t;)n=e+n;return n};var Gw={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function Uw(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString())||"0"}var Xw=function(){function t(e,n,o,i){Fw(this,t);var r=this;if(void 0===e);else if(Array.isArray(e))this.rgba=e;else if(void 0===o){var a=e&&""+e;a&&function(e){if(e.startsWith("hsl")){var n=e.match(/([\-\d\.e]+)/g).map(Number),o=Ww(n,4),i=o[0],a=o[1],s=o[2],l=o[3];void 0===l&&(l=1),i/=360,a/=100,s/=100,r.hsla=[i,a,s,l]}else if(e.startsWith("rgb")){var u=e.match(/([\-\d\.e]+)/g).map(Number),c=Ww(u,4),d=c[0],h=c[1],p=c[2],f=c[3];void 0===f&&(f=1),r.rgba=[d,h,p,f]}else e.startsWith("#")?r.rgba=t.hexToRgb(e):r.rgba=t.nameToRgb(e)||t.hexToRgb(e)}(a.toLowerCase())}else this.rgba=[e,n,o,void 0===i?1:i]}return zw(t,[{key:"printRGB",value:function(t){var e=(t?this.rgba:this.rgba.slice(0,3)).map((function(t,e){return Uw(t,3===e?3:0)}));return t?"rgba("+e+")":"rgb("+e+")"}},{key:"printHSL",value:function(t){var e=[360,100,100,1],n=["","%","%",""],o=(t?this.hsla:this.hsla.slice(0,3)).map((function(t,o){return Uw(t*e[o],3===o?3:1)+n[o]}));return t?"hsla("+o+")":"hsl("+o+")"}},{key:"printHex",value:function(t){var e=this.hex;return t?e:e.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(t){3===t.length&&(t[3]=1),this._rgba=t,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(t){3===t.length&&(t[3]=1),this._hsla=t,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var t=this.rgba.map((function(t,e){return e<3?t.toString(16):Math.round(255*t).toString(16)}));return"#"+t.map((function(t){return t.padStart(2,"0")})).join("")},set:function(e){this.rgba=t.hexToRgb(e)}}],[{key:"hexToRgb",value:function(t){var e=(t.startsWith("#")?t.slice(1):t).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!e.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+t);var n=e.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(t){return parseInt(t,16)}));return n[3]=n[3]/255,n}},{key:"nameToRgb",value:function(e){var n=e.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),o=Gw[n];return void 0===o?o:t.hexToRgb(o.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(t){var e=Ww(t,4),n=e[0],o=e[1],i=e[2],r=e[3];n/=255,o/=255,i/=255;var a=Math.max(n,o,i),s=Math.min(n,o,i),l=void 0,u=void 0,c=(a+s)/2;if(a===s)l=u=0;else{var d=a-s;switch(u=c>.5?d/(2-a-s):d/(a+s),a){case n:l=(o-i)/d+(o<i?6:0);break;case o:l=(i-n)/d+2;break;case i:l=(n-o)/d+4}l/=6}return[l,u,c,r]}},{key:"hslToRgb",value:function(t){var e=Ww(t,4),n=e[0],o=e[1],i=e[2],r=e[3],a=void 0,s=void 0,l=void 0;if(0===o)a=s=l=i;else{var u=function(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t},c=i<.5?i*(1+o):i+o-i*o,d=2*i-c;a=u(d,c,n+1/3),s=u(d,c,n),l=u(d,c,n-1/3)}var h=[255*a,255*s,255*l].map(Math.round);return h[3]=r,h}}]),t}(),Vw=function(){function t(){Fw(this,t),this._events=[]}return zw(t,[{key:"add",value:function(t,e,n){t.addEventListener(e,n,!1),this._events.push({target:t,type:e,handler:n})}},{key:"remove",value:function(e,n,o){this._events=this._events.filter((function(i){var r=!0;return e&&e!==i.target&&(r=!1),n&&n!==i.type&&(r=!1),o&&o!==i.handler&&(r=!1),r&&t._doRemove(i.target,i.type,i.handler),!r}))}},{key:"destroy",value:function(){this._events.forEach((function(e){return t._doRemove(e.target,e.type,e.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(t,e,n){t.removeEventListener(e,n,!1)}}]),t}();function Yw(t,e,n){var o=!1;function i(t,e,n){return Math.max(e,Math.min(t,n))}function r(t,r,a){if(a&&(o=!0),o){t.preventDefault();var s=e.getBoundingClientRect(),l=s.width,u=s.height,c=r.clientX,d=r.clientY,h=i(c-s.left,0,l),p=i(d-s.top,0,u);n(h/l,p/u)}}function a(t,e){1===(void 0===t.buttons?t.which:t.buttons)?r(t,t,e):o=!1}function s(t,e){1===t.touches.length?r(t,t.touches[0],e):o=!1}t.add(e,"mousedown",(function(t){a(t,!0)})),t.add(e,"touchstart",(function(t){s(t,!0)})),t.add(window,"mousemove",a),t.add(e,"touchmove",s),t.add(window,"mouseup",(function(t){o=!1})),t.add(e,"touchend",(function(t){o=!1})),t.add(e,"touchcancel",(function(t){o=!1}))}var qw="keydown",Kw="mousedown",Zw="focusin";function $w(t,e){return(e||document).querySelector(t)}function Jw(t){t.preventDefault(),t.stopPropagation()}function Qw(t,e,n,o,i){t.add(e,qw,(function(t){n.indexOf(t.key)>=0&&(i&&Jw(t),o(t))}))}var tS=function(){function t(e){Fw(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new Vw,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return zw(t,[{key:"setOptions",value:function(t){var e=this;if(t){var n=this.settings;if(t instanceof HTMLElement)n.parent=t;else{n.parent&&t.parent&&n.parent!==t.parent&&(this._events.remove(n.parent),this._popupInited=!1),function(t,e,n){for(var o in t)n&&n.indexOf(o)>=0||(e[o]=t[o])}(t,n),t.onChange&&(this.onChange=t.onChange),t.onDone&&(this.onDone=t.onDone),t.onOpen&&(this.onOpen=t.onOpen),t.onClose&&(this.onClose=t.onClose);var o=t.color||t.colour;o&&this._setColor(o)}var i=n.parent;if(i&&n.popup&&!this._popupInited){var r=function(t){return e.openHandler(t)};this._events.add(i,"click",r),Qw(this._events,i,[" ","Spacebar","Enter"],r),this._popupInited=!0}else t.parent&&!n.popup&&this.show()}}},{key:"openHandler",value:function(t){if(this.show()){t&&t.preventDefault(),this.settings.parent.style.pointerEvents="none";var e=t&&t.type===qw?this._domEdit:this.domElement;setTimeout((function(){return e.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(t){var e=t&&t.type,n=!1;if(t)if(e===Kw||e===Zw){var o=(this.__containedEvent||0)+100;t.timeStamp>o&&(n=!0)}else Jw(t),n=!0;else n=!0;n&&this.hide()&&(this.settings.parent.style.pointerEvents="",e!==Kw&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(t,e){this.closeHandler(),this.setOptions(t),e&&this.openHandler()}},{key:"setColor",value:function(t,e){this._setColor(t,{silent:e})}},{key:"_setColor",value:function(t,e){if("string"==typeof t&&(t=t.trim()),t){e=e||{};var n=void 0;try{n=new Xw(t)}catch(t){if(e.failSilently)return;throw t}if(!this.settings.alpha){var o=n.hsla;o[3]=1,n.hsla=o}this.colour=this.color=n,this._setHSLA(null,null,null,null,e)}}},{key:"setColour",value:function(t,e){this.setColor(t,e)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var t=this._toggleDOM(!0);return this._setPosition(),t}var e,n,o=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',i=(e=o,(n=document.createElement("div")).innerHTML=e,n.firstElementChild);return this.domElement=i,this._domH=$w(".picker_hue",i),this._domSL=$w(".picker_sl",i),this._domA=$w(".picker_alpha",i),this._domEdit=$w(".picker_editor input",i),this._domSample=$w(".picker_sample",i),this._domOkay=$w(".picker_done button",i),this._domCancel=$w(".picker_cancel button",i),i.classList.add("layout_"+this.settings.layout),this.settings.alpha||i.classList.add("no_alpha"),this.settings.editor||i.classList.add("no_editor"),this.settings.cancelButton||i.classList.add("no_cancel"),this._ifPopup((function(){return i.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var t=this,e=this,n=this.domElement,o=this._events;function i(t,e,n){o.add(t,e,n)}i(n,"click",(function(t){return t.preventDefault()})),Yw(o,this._domH,(function(t,n){return e._setHSLA(t)})),Yw(o,this._domSL,(function(t,n){return e._setHSLA(null,t,1-n)})),this.settings.alpha&&Yw(o,this._domA,(function(t,n){return e._setHSLA(null,null,null,1-n)}));var r=this._domEdit;i(r,"input",(function(t){e._setColor(this.value,{fromEditor:!0,failSilently:!0})})),i(r,"focus",(function(t){var e=this;e.selectionStart===e.selectionEnd&&e.select()})),this._ifPopup((function(){var e=function(e){return t.closeHandler(e)};i(window,Kw,e),i(window,Zw,e),Qw(o,n,["Esc","Escape"],e);var r=function(e){t.__containedEvent=e.timeStamp};i(n,Kw,r),i(n,Zw,r),i(t._domCancel,"click",e)}));var a=function(e){t._ifPopup((function(){return t.closeHandler(e)})),t.onDone&&t.onDone(t.colour)};i(this._domOkay,"click",a),Qw(o,n,["Enter"],a)}},{key:"_setPosition",value:function(){var t=this.settings.parent,e=this.domElement;t!==e.parentNode&&t.appendChild(e),this._ifPopup((function(n){"static"===getComputedStyle(t).position&&(t.style.position="relative");var o=!0===n?"popup_right":"popup_"+n;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(t){t===o?e.classList.add(t):e.classList.remove(t)})),e.classList.add(o)}))}},{key:"_setHSLA",value:function(t,e,n,o,i){i=i||{};var r=this.colour,a=r.hsla;[t,e,n,o].forEach((function(t,e){(t||0===t)&&(a[e]=t)})),r.hsla=a,this._updateUI(i),this.onChange&&!i.silent&&this.onChange(r)}},{key:"_updateUI",value:function(t){if(this.domElement){t=t||{};var e=this.colour,n=e.hsla,o="hsl("+360*n[0]+", 100%, 50%)",i=e.hslString,r=e.hslaString,a=this._domH,s=this._domSL,l=this._domA,u=$w(".picker_selector",a),c=$w(".picker_selector",s),d=$w(".picker_selector",l);m(0,u,n[0]),this._domSL.style.backgroundColor=this._domH.style.color=o,m(0,c,n[1]),b(0,c,1-n[2]),s.style.color=i,b(0,d,1-n[3]);var h=i,p=h.replace("hsl","hsla").replace(")",", 0)"),f="linear-gradient("+[h,p]+")";if(this._domA.style.background=f+", linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",!t.fromEditor){var g=this.settings.editorFormat,v=this.settings.alpha,y=void 0;switch(g){case"rgb":y=e.printRGB(v);break;case"hsl":y=e.printHSL(v);break;default:y=e.printHex(v)}this._domEdit.value=y}this._domSample.style.color=r}function m(t,e,n){e.style.left=100*n+"%"}function b(t,e,n){e.style.top=100*n+"%"}}},{key:"_ifPopup",value:function(t,e){this.settings.parent&&this.settings.popup?t&&t(this.settings.popup):e&&e()}},{key:"_toggleDOM",value:function(t){var e=this.domElement;if(!e)return!1;var n=t?"":"none",o=e.style.display!==n;return o&&(e.style.display=n),o}}]),t}(),eS=document.createElement("style");eS.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(eS),tS.StyleElement=eS;var nS={},oS={get exports(){return nS},set exports(t){nS=t}};!function(t){t.exports=function(){var t="object",e="function",n="undefined",o=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],i=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],r=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],a=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function s(n,o){var i=typeof n[o];return i==e||!(i!=t||!n[o])||"unknown"==i}function l(e,n){return!(typeof e[n]!=t||!e[n])}function u(t,e){return typeof t[e]!=n}function c(t){return function(e,n){for(var o=n.length;o--;)if(!t(e,n[o]))return!1;return!0}}var d=c(s),h=c(l),p=c(u);function f(t){return t&&d(t,a)&&p(t,r)}function g(t){return l(t,"body")?t.body:t.getElementsByTagName("body")[0]}var v,y,m=[].forEach?function(t,e){t.forEach(e)}:function(t,e){for(var n=0,o=t.length;n<o;++n)e(t[n],n)},b={},x=typeof window!=n&&typeof document!=n,_={isHostMethod:s,isHostObject:l,isHostProperty:u,areHostMethods:d,areHostObjects:h,areHostProperties:p,isTextRange:f,getBody:g,forEach:m},E={version:"1.3.1",initialized:!1,isBrowser:x,supported:!0,util:_,features:{},modules:b,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==n||rangyAutoInitialize}};function w(t){typeof console!=n&&s(console,"log")&&console.log(t)}function S(t,e){x&&e?alert(t):w(t)}function C(t){E.initialized=!0,E.supported=!1,S("Rangy is not supported in this environment. Reason: "+t,E.config.alertOnFail)}function N(t){S("Rangy warning: "+t,E.config.alertOnWarn)}E.fail=C,E.warn=N,{}.hasOwnProperty?(_.extend=v=function(t,e,n){var o,i;for(var r in e)e.hasOwnProperty(r)&&(o=t[r],i=e[r],n&&null!==o&&"object"==typeof o&&null!==i&&"object"==typeof i&&v(o,i,!0),t[r]=i);return e.hasOwnProperty("toString")&&(t.toString=e.toString),t},_.createOptions=function(t,e){var n={};return v(n,e),t&&v(n,t),n}):C("hasOwnProperty not supported"),x||C("Rangy can only run in a browser"),function(){var t;if(x){var e=document.createElement("div");e.appendChild(document.createElement("span"));var n=[].slice;try{1==n.call(e.childNodes,0)[0].nodeType&&(t=function(t){return n.call(t,0)})}catch(t){}}t||(t=function(t){for(var e=[],n=0,o=t.length;n<o;++n)e[n]=t[n];return e}),_.toArray=t}(),x&&(s(document,"addEventListener")?y=function(t,e,n){t.addEventListener(e,n,!1)}:s(document,"attachEvent")?y=function(t,e,n){t.attachEvent("on"+e,n)}:C("Document does not have required addEventListener or attachEvent method"),_.addListener=y);var T=[];function A(t){return t.message||t.description||String(t)}function M(){if(x&&!E.initialized){var t,e=!1,n=!1;s(document,"createRange")&&(t=document.createRange(),d(t,i)&&p(t,o)&&(e=!0));var r=g(document);if(r&&"body"==r.nodeName.toLowerCase())if(r&&s(r,"createTextRange")&&f(t=r.createTextRange())&&(n=!0),e||n){var a;for(var l in E.initialized=!0,E.features={implementsDomRange:e,implementsTextRange:n},b)(a=b[l])instanceof D&&a.init(a,E);for(var u=0,c=T.length;u<c;++u)try{T[u](E)}catch(t){w("Rangy init listener threw an exception. Continuing. Detail: "+A(t))}}else C("Neither Range nor TextRange are available");else C("No body element found")}}function O(t,e,n){n&&(t+=" in module "+n.name),E.warn("DEPRECATED: "+t+" is deprecated. Please use "+e+" instead.")}function P(t,e,n,o){t[e]=function(){return O(e,n,o),t[n].apply(t,_.toArray(arguments))}}_.deprecationNotice=O,_.createAliasForDeprecatedMethod=P,E.init=M,E.addInitListener=function(t){E.initialized?t(E):T.push(t)};var k=[];function R(t){t=t||window,M();for(var e=0,n=k.length;e<n;++e)k[e](t)}function D(t,e,n){this.name=t,this.dependencies=e,this.initialized=!1,this.supported=!1,this.initializer=n}function L(t,e,n){var o=new D(t,e,(function(e){if(!e.initialized){e.initialized=!0;try{n(E,e),e.supported=!0}catch(e){w("Module '"+t+"' failed to load: "+A(e)),e.stack&&w(e.stack)}}}));return b[t]=o,o}function I(){}function j(){}E.addShimListener=function(t){k.push(t)},x&&(E.shim=E.createMissingNativeApi=R,P(E,"createMissingNativeApi","shim")),D.prototype={init:function(){for(var t,e,n=this.dependencies||[],o=0,i=n.length;o<i;++o){if(e=n[o],!((t=b[e])&&t instanceof D))throw new Error("required module '"+e+"' not found");if(t.init(),!t.supported)throw new Error("required module '"+e+"' not supported")}this.initializer(this)},fail:function(t){throw this.initialized=!0,this.supported=!1,new Error(t)},warn:function(t){E.warn("Module "+this.name+": "+t)},deprecationNotice:function(t,e){E.warn("DEPRECATED: "+t+" in module "+this.name+" is deprecated. Please use "+e+" instead")},createError:function(t){return new Error("Error in Rangy "+this.name+" module: "+t)}},E.createModule=function(t){var e,n;2==arguments.length?(e=arguments[1],n=[]):(e=arguments[2],n=arguments[1]);var o=L(t,n,e);E.initialized&&E.supported&&o.init()},E.createCoreModule=function(t,e,n){L(t,e,n)},E.RangePrototype=I,E.rangePrototype=new I,E.selectionPrototype=new j,E.createCoreModule("DomUtil",[],(function(t,e){var n="undefined",o=t.util,i=o.getBody;o.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||e.fail("document missing a Node creation method"),o.isHostMethod(document,"getElementsByTagName")||e.fail("document missing getElementsByTagName method");var r=document.createElement("div");o.areHostMethods(r,["insertBefore","appendChild","cloneNode"]||!o.areHostObjects(r,["previousSibling","nextSibling","childNodes","parentNode"]))||e.fail("Incomplete Element implementation"),o.isHostProperty(r,"innerHTML")||e.fail("Element is missing innerHTML property");var a=document.createTextNode("test");o.areHostMethods(a,["splitText","deleteData","insertData","appendData","cloneNode"]||!o.areHostObjects(r,["previousSibling","nextSibling","childNodes","parentNode"])||!o.areHostProperties(a,["data"]))||e.fail("Incomplete Text Node implementation");var s=function(t,e){for(var n=t.length;n--;)if(t[n]===e)return!0;return!1};function l(t){var e;return typeof t.namespaceURI==n||null===(e=t.namespaceURI)||"http://www.w3.org/1999/xhtml"==e}function u(t){var e=t.parentNode;return 1==e.nodeType?e:null}function c(t){for(var e=0;t=t.previousSibling;)++e;return e}function d(t){switch(t.nodeType){case 7:case 10:return 0;case 3:case 8:return t.length;default:return t.childNodes.length}}function h(t,e){var n,o=[];for(n=t;n;n=n.parentNode)o.push(n);for(n=e;n;n=n.parentNode)if(s(o,n))return n;return null}function p(t,e,n){for(var o=n?e:e.parentNode;o;){if(o===t)return!0;o=o.parentNode}return!1}function f(t,e){return p(t,e,!0)}function g(t,e,n){for(var o,i=n?t:t.parentNode;i;){if((o=i.parentNode)===e)return i;i=o}return null}function v(t){var e=t.nodeType;return 3==e||4==e||8==e}function y(t){if(!t)return!1;var e=t.nodeType;return 3==e||8==e}function m(t,e){var n=e.nextSibling,o=e.parentNode;return n?o.insertBefore(t,n):o.appendChild(t),t}function b(t,e,n){var o=t.cloneNode(!1);if(o.deleteData(0,e),t.deleteData(e,t.length-e),m(o,t),n)for(var i,r=0;i=n[r++];)i.node==t&&i.offset>e?(i.node=o,i.offset-=e):i.node==t.parentNode&&i.offset>c(t)&&++i.offset;return o}function x(t){if(9==t.nodeType)return t;if(typeof t.ownerDocument!=n)return t.ownerDocument;if(typeof t.document!=n)return t.document;if(t.parentNode)return x(t.parentNode);throw e.createError("getDocument: no document found for node")}function _(t){var o=x(t);if(typeof o.defaultView!=n)return o.defaultView;if(typeof o.parentWindow!=n)return o.parentWindow;throw e.createError("Cannot get a window object for node")}function E(t){if(typeof t.contentDocument!=n)return t.contentDocument;if(typeof t.contentWindow!=n)return t.contentWindow.document;throw e.createError("getIframeDocument: No Document object found for iframe element")}function w(t){if(typeof t.contentWindow!=n)return t.contentWindow;if(typeof t.contentDocument!=n)return t.contentDocument.defaultView;throw e.createError("getIframeWindow: No Window object found for iframe element")}function S(t){return t&&o.isHostMethod(t,"setTimeout")&&o.isHostObject(t,"document")}function C(t,e,n){var i;if(t?o.isHostProperty(t,"nodeType")?i=1==t.nodeType&&"iframe"==t.tagName.toLowerCase()?E(t):x(t):S(t)&&(i=t.document):i=document,!i)throw e.createError(n+"(): Parameter must be a Window object or DOM node");return i}function N(t){for(var e;e=t.parentNode;)t=e;return t}function T(t,n,o,i){var r,a,s,l,u;if(t==o)return n===i?0:n<i?-1:1;if(r=g(o,t,!0))return n<=c(r)?-1:1;if(r=g(t,o,!0))return c(r)<i?-1:1;if(!(a=h(t,o)))throw new Error("comparePoints error: nodes have no common ancestor");if((s=t===a?a:g(t,a,!0))===(l=o===a?a:g(o,a,!0)))throw e.createError("comparePoints got to case 4 and childA and childB are the same!");for(u=a.firstChild;u;){if(u===s)return-1;if(u===l)return 1;u=u.nextSibling}}var A,M=!1;function O(t){try{return t.parentNode,!1}catch(t){return!0}}function P(t){if(!t)return"[No node]";if(M&&O(t))return"[Broken node]";if(v(t))return'"'+t.data+'"';if(1==t.nodeType){var e=t.id?' id="'+t.id+'"':"";return"<"+t.nodeName+e+">[index:"+c(t)+",length:"+t.childNodes.length+"]["+(t.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return t.nodeName}function k(t){for(var e,n=x(t).createDocumentFragment();e=t.firstChild;)n.appendChild(e);return n}function R(t,e,n){var o=i(t),r=t.createElement("div");r.contentEditable=""+!!n,e&&(r.innerHTML=e);var a=o.firstChild;return a?o.insertBefore(r,a):o.appendChild(r),r}function D(t){return t.parentNode.removeChild(t)}function L(t){this.root=t,this._next=t}function I(t){return new L(t)}function j(t,e){this.node=t,this.offset=e}function B(t){this.code=this[t],this.codeName=t,this.message="DOMException: "+this.codeName}!function(){var e=document.createElement("b");e.innerHTML="1";var n=e.firstChild;e.innerHTML="<br />",M=O(n),t.features.crashyTextNodes=M}(),typeof window.getComputedStyle!=n?A=function(t,e){return _(t).getComputedStyle(t,null)[e]}:typeof document.documentElement.currentStyle!=n?A=function(t,e){return t.currentStyle?t.currentStyle[e]:""}:e.fail("No means of obtaining computed style properties found"),L.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var t,e,n=this._current=this._next;if(this._current)if(t=n.firstChild)this._next=t;else{for(e=null;n!==this.root&&!(e=n.nextSibling);)n=n.parentNode;this._next=e}return this._current},detach:function(){this._current=this._next=this.root=null}},j.prototype={equals:function(t){return!!t&&this.node===t.node&&this.offset==t.offset},inspect:function(){return"[DomPosition("+P(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}},B.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},B.prototype.toString=function(){return this.message},t.dom={arrayContains:s,isHtmlNamespace:l,parentElement:u,getNodeIndex:c,getNodeLength:d,getCommonAncestor:h,isAncestorOf:p,isOrIsAncestorOf:f,getClosestAncestorIn:g,isCharacterDataNode:v,isTextOrCommentNode:y,insertAfter:m,splitDataNode:b,getDocument:x,getWindow:_,getIframeWindow:w,getIframeDocument:E,getBody:i,isWindow:S,getContentDocument:C,getRootContainer:N,comparePoints:T,isBrokenNode:O,inspectNode:P,getComputedStyleProperty:A,createTestElement:R,removeNode:D,fragmentFromNodeChildren:k,createIterator:I,DomPosition:j},t.DOMException=B})),E.createCoreModule("DomRange",["DomUtil"],(function(t,e){var n=t.dom,o=t.util,i=n.DomPosition,r=t.DOMException,a=n.isCharacterDataNode,s=n.getNodeIndex,l=n.isOrIsAncestorOf,u=n.getDocument,c=n.comparePoints,d=n.splitDataNode,h=n.getClosestAncestorIn,p=n.getNodeLength,f=n.arrayContains,g=n.getRootContainer,v=t.features.crashyTextNodes,y=n.removeNode;function m(t,e){return 3!=t.nodeType&&(l(t,e.startContainer)||l(t,e.endContainer))}function b(t){return t.document||u(t.startContainer)}function x(t){return g(t.startContainer)}function _(t){return new i(t.parentNode,s(t))}function E(t){return new i(t.parentNode,s(t)+1)}function w(t,e,o){var i=11==t.nodeType?t.firstChild:t;return a(e)?o==e.length?n.insertAfter(t,e):e.parentNode.insertBefore(t,0==o?e:d(e,o)):o>=e.childNodes.length?e.appendChild(t):e.insertBefore(t,e.childNodes[o]),i}function S(t,e,n){if(Z(t),Z(e),b(e)!=b(t))throw new r("WRONG_DOCUMENT_ERR");var o=c(t.startContainer,t.startOffset,e.endContainer,e.endOffset),i=c(t.endContainer,t.endOffset,e.startContainer,e.startOffset);return n?o<=0&&i>=0:o<0&&i>0}function C(t){for(var e,n,o,i=b(t.range).createDocumentFragment();n=t.next();){if(e=t.isPartiallySelectedSubtree(),n=n.cloneNode(!e),e&&(o=t.getSubtreeIterator(),n.appendChild(C(o)),o.detach()),10==n.nodeType)throw new r("HIERARCHY_REQUEST_ERR");i.appendChild(n)}return i}function N(t,e,o){var i,r,a,s;for(o=o||{stop:!1};a=t.next();)if(t.isPartiallySelectedSubtree()){if(!1===e(a))return void(o.stop=!0);if(N(s=t.getSubtreeIterator(),e,o),s.detach(),o.stop)return}else for(i=n.createIterator(a);r=i.next();)if(!1===e(r))return void(o.stop=!0)}function T(t){for(var e;t.next();)t.isPartiallySelectedSubtree()?(T(e=t.getSubtreeIterator()),e.detach()):t.remove()}function A(t){for(var e,n,o=b(t.range).createDocumentFragment();e=t.next();){if(t.isPartiallySelectedSubtree()?(e=e.cloneNode(!1),n=t.getSubtreeIterator(),e.appendChild(A(n)),n.detach()):t.remove(),10==e.nodeType)throw new r("HIERARCHY_REQUEST_ERR");o.appendChild(e)}return o}function M(t,e,n){var o,i=!(!e||!e.length),r=!!n;i&&(o=new RegExp("^("+e.join("|")+")$"));var s=[];return N(new P(t,!1),(function(e){if((!i||o.test(e.nodeType))&&(!r||n(e))){var l=t.startContainer;if(e!=l||!a(l)||t.startOffset!=l.length){var u=t.endContainer;e==u&&a(u)&&0==t.endOffset||s.push(e)}}})),s}function O(t){return"["+(void 0===t.getName?"Range":t.getName())+"("+n.inspectNode(t.startContainer)+":"+t.startOffset+", "+n.inspectNode(t.endContainer)+":"+t.endOffset+")]"}function P(t,e){if(this.range=t,this.clonePartiallySelectedTextNodes=e,!t.collapsed){this.sc=t.startContainer,this.so=t.startOffset,this.ec=t.endContainer,this.eo=t.endOffset;var n=t.commonAncestorContainer;this.sc===this.ec&&a(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==n||a(this.sc)?h(this.sc,n,!0):this.sc.childNodes[this.so],this._last=this.ec!==n||a(this.ec)?h(this.ec,n,!0):this.ec.childNodes[this.eo-1])}}P.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var t=this._current=this._next;return t&&(this._next=t!==this._last?t.nextSibling:null,a(t)&&this.clonePartiallySelectedTextNodes&&(t===this.ec&&(t=t.cloneNode(!0)).deleteData(this.eo,t.length-this.eo),this._current===this.sc&&(t=t.cloneNode(!0)).deleteData(0,this.so))),t},remove:function(){var t,e,n=this._current;!a(n)||n!==this.sc&&n!==this.ec?n.parentNode&&y(n):(t=n===this.sc?this.so:0)!=(e=n===this.ec?this.eo:n.length)&&n.deleteData(t,e-t)},isPartiallySelectedSubtree:function(){return m(this._current,this.range)},getSubtreeIterator:function(){var t;if(this.isSingleCharacterDataNode)(t=this.range.cloneRange()).collapse(!1);else{t=new yt(b(this.range));var e=this._current,n=e,o=0,i=e,r=p(e);l(e,this.sc)&&(n=this.sc,o=this.so),l(e,this.ec)&&(i=this.ec,r=this.eo),vt(t,n,o,i,r)}return new P(t,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var k=[1,3,4,5,7,8,10],R=[2,9,11],D=[5,6,10,12],L=[1,3,4,5,7,8,10,11],I=[1,3,4,5,7,8];function j(t){return function(e,n){for(var o,i=n?e:e.parentNode;i;){if(o=i.nodeType,f(t,o))return i;i=i.parentNode}return null}}var B=j([9,11]),H=j(D),F=j([6,10,12]),z=j([1]);function W(t,e){if(F(t,e))throw new r("INVALID_NODE_TYPE_ERR")}function G(t,e){if(!f(e,t.nodeType))throw new r("INVALID_NODE_TYPE_ERR")}function U(t,e){if(e<0||e>(a(t)?t.length:t.childNodes.length))throw new r("INDEX_SIZE_ERR")}function X(t,e){if(B(t,!0)!==B(e,!0))throw new r("WRONG_DOCUMENT_ERR")}function V(t){if(H(t,!0))throw new r("NO_MODIFICATION_ALLOWED_ERR")}function Y(t,e){if(!t)throw new r(e)}function q(t,e){return e<=(a(t)?t.length:t.childNodes.length)}function K(t){return!!t.startContainer&&!!t.endContainer&&!(v&&(n.isBrokenNode(t.startContainer)||n.isBrokenNode(t.endContainer)))&&g(t.startContainer)==g(t.endContainer)&&q(t.startContainer,t.startOffset)&&q(t.endContainer,t.endOffset)}function Z(t){if(!K(t))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+t.inspect()+")")}var $=document.createElement("style"),J=!1;try{$.innerHTML="<b>x</b>",J=3==$.firstChild.nodeType}catch(t){}t.features.htmlParsingConforms=J;var Q=J?function(t){var e=this.startContainer,o=u(e);if(!e)throw new r("INVALID_STATE_ERR");var i=null;return 1==e.nodeType?i=e:a(e)&&(i=n.parentElement(e)),(i=null===i||"HTML"==i.nodeName&&n.isHtmlNamespace(u(i).documentElement)&&n.isHtmlNamespace(i)?o.createElement("body"):i.cloneNode(!1)).innerHTML=t,n.fragmentFromNodeChildren(i)}:function(t){var e=b(this).createElement("body");return e.innerHTML=t,n.fragmentFromNodeChildren(e)};function tt(t,e){Z(t);var n=t.startContainer,o=t.startOffset,i=t.endContainer,r=t.endOffset,l=n===i;a(i)&&r>0&&r<i.length&&d(i,r,e),a(n)&&o>0&&o<n.length&&(n=d(n,o,e),l?(r-=o,i=n):i==n.parentNode&&r>=s(n)&&r++,o=0),t.setStartAndEnd(n,o,i,r)}function et(t){Z(t);var e=t.commonAncestorContainer.parentNode.cloneNode(!1);return e.appendChild(t.cloneContents()),e.innerHTML}var nt=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],ot=0,it=1,rt=2,at=3,st=0,lt=1,ut=2,ct=3;function dt(t){t.START_TO_START=ot,t.START_TO_END=it,t.END_TO_END=rt,t.END_TO_START=at,t.NODE_BEFORE=st,t.NODE_AFTER=lt,t.NODE_BEFORE_AND_AFTER=ut,t.NODE_INSIDE=ct}function ht(t){dt(t),dt(t.prototype)}function pt(t,e){return function(){Z(this);var n,o=this.startContainer,i=this.startOffset,r=this.commonAncestorContainer,a=new P(this,!0);o!==r&&(o=(n=E(h(o,r,!0))).node,i=n.offset),N(a,V),a.reset();var s=t(a);return a.detach(),e(this,o,i,o,i),s}}function ft(e,n){function i(t,e){return function(n){G(n,k),G(g(n),R);var o=(t?_:E)(n);(e?r:l)(this,o.node,o.offset)}}function r(t,e,o){var i=t.endContainer,r=t.endOffset;e===t.startContainer&&o===t.startOffset||(g(e)==g(i)&&1!=c(e,o,i,r)||(i=e,r=o),n(t,e,o,i,r))}function l(t,e,o){var i=t.startContainer,r=t.startOffset;e===t.endContainer&&o===t.endOffset||(g(e)==g(i)&&-1!=c(e,o,i,r)||(i=e,r=o),n(t,i,r,e,o))}var u=function(){};u.prototype=t.rangePrototype,e.prototype=new u,o.extend(e.prototype,{setStart:function(t,e){W(t,!0),U(t,e),r(this,t,e)},setEnd:function(t,e){W(t,!0),U(t,e),l(this,t,e)},setStartAndEnd:function(){var t=arguments,e=t[0],o=t[1],i=e,r=o;switch(t.length){case 3:r=t[2];break;case 4:i=t[2],r=t[3]}W(e,!0),U(e,o),W(i,!0),U(i,r),n(this,e,o,i,r)},setBoundary:function(t,e,n){this["set"+(n?"Start":"End")](t,e)},setStartBefore:i(!0,!0),setStartAfter:i(!1,!0),setEndBefore:i(!0,!1),setEndAfter:i(!1,!1),collapse:function(t){Z(this),t?n(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):n(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(t){W(t,!0),n(this,t,0,t,p(t))},selectNode:function(t){W(t,!1),G(t,k);var e=_(t),o=E(t);n(this,e.node,e.offset,o.node,o.offset)},extractContents:pt(A,n),deleteContents:pt(T,n),canSurroundContents:function(){Z(this),V(this.startContainer),V(this.endContainer);var t=new P(this,!0),e=t._first&&m(t._first,this)||t._last&&m(t._last,this);return t.detach(),!e},splitBoundaries:function(){tt(this)},splitBoundariesPreservingPositions:function(t){tt(this,t)},normalizeBoundaries:function(){Z(this);var t,e=this.startContainer,o=this.startOffset,i=this.endContainer,r=this.endOffset,l=function(t){var e=t.nextSibling;e&&e.nodeType==t.nodeType&&(i=t,r=t.length,t.appendData(e.data),y(e))},u=function(t){var n=t.previousSibling;if(n&&n.nodeType==t.nodeType){e=t;var a=t.length;if(o=n.length,t.insertData(0,n.data),y(n),e==i)r+=o,i=e;else if(i==t.parentNode){var l=s(t);r==l?(i=t,r=a):r>l&&r--}}},c=!0;if(a(i))r==i.length?l(i):0==r&&(t=i.previousSibling)&&t.nodeType==i.nodeType&&(r=t.length,e==i&&(c=!1),t.appendData(i.data),y(i),i=t);else{if(r>0){var d=i.childNodes[r-1];d&&a(d)&&l(d)}c=!this.collapsed}if(c){if(a(e))0==o?u(e):o==e.length&&(t=e.nextSibling)&&t.nodeType==e.nodeType&&(i==t&&(i=e,r+=e.length),e.appendData(t.data),y(t));else if(o<e.childNodes.length){var h=e.childNodes[o];h&&a(h)&&u(h)}}else e=i,o=r;n(this,e,o,i,r)},collapseToPoint:function(t,e){W(t,!0),U(t,e),this.setStartAndEnd(t,e)},parentElement:function(){return Z(this),this.commonAncestorContainer?z(this.commonAncestorContainer,!0):null}}),ht(e)}function gt(t){t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset,t.commonAncestorContainer=t.collapsed?t.startContainer:n.getCommonAncestor(t.startContainer,t.endContainer)}function vt(t,e,o,i,r){t.startContainer=e,t.startOffset=o,t.endContainer=i,t.endOffset=r,t.document=n.getDocument(e),gt(t)}function yt(t){vt(this,t,0,t,0)}o.extend(t.rangePrototype,{compareBoundaryPoints:function(t,e){var n,o,i,r;Z(this),X(this.startContainer,e.startContainer);var a=t==at||t==ot?"start":"end",s=t==it||t==ot?"start":"end";return n=this[a+"Container"],o=this[a+"Offset"],i=e[s+"Container"],r=e[s+"Offset"],c(n,o,i,r)},insertNode:function(t){if(Z(this),G(t,L),V(this.startContainer),l(t,this.startContainer))throw new r("HIERARCHY_REQUEST_ERR");var e=w(t,this.startContainer,this.startOffset);this.setStartBefore(e)},cloneContents:function(){var t,e;if(Z(this),this.collapsed)return b(this).createDocumentFragment();if(this.startContainer===this.endContainer&&a(this.startContainer))return(t=this.startContainer.cloneNode(!0)).data=t.data.slice(this.startOffset,this.endOffset),(e=b(this).createDocumentFragment()).appendChild(t),e;var n=new P(this,!0);return t=C(n),n.detach(),t},canSurroundContents:function(){Z(this),V(this.startContainer),V(this.endContainer);var t=new P(this,!0),e=t._first&&m(t._first,this)||t._last&&m(t._last,this);return t.detach(),!e},surroundContents:function(t){if(G(t,I),!this.canSurroundContents())throw new r("INVALID_STATE_ERR");var e=this.extractContents();if(t.hasChildNodes())for(;t.lastChild;)t.removeChild(t.lastChild);w(t,this.startContainer,this.startOffset),t.appendChild(e),this.selectNode(t)},cloneRange:function(){Z(this);for(var t,e=new yt(b(this)),n=nt.length;n--;)e[t=nt[n]]=this[t];return e},toString:function(){Z(this);var t=this.startContainer;if(t===this.endContainer&&a(t))return 3==t.nodeType||4==t.nodeType?t.data.slice(this.startOffset,this.endOffset):"";var e=[],n=new P(this,!0);return N(n,(function(t){3!=t.nodeType&&4!=t.nodeType||e.push(t.data)})),n.detach(),e.join("")},compareNode:function(t){Z(this);var e=t.parentNode,n=s(t);if(!e)throw new r("NOT_FOUND_ERR");var o=this.comparePoint(e,n),i=this.comparePoint(e,n+1);return o<0?i>0?ut:st:i>0?lt:ct},comparePoint:function(t,e){return Z(this),Y(t,"HIERARCHY_REQUEST_ERR"),X(t,this.startContainer),c(t,e,this.startContainer,this.startOffset)<0?-1:c(t,e,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:Q,toHtml:function(){return et(this)},intersectsNode:function(t,e){if(Z(this),g(t)!=x(this))return!1;var n=t.parentNode,o=s(t);if(!n)return!0;var i=c(n,o,this.endContainer,this.endOffset),r=c(n,o+1,this.startContainer,this.startOffset);return e?i<=0&&r>=0:i<0&&r>0},isPointInRange:function(t,e){return Z(this),Y(t,"HIERARCHY_REQUEST_ERR"),X(t,this.startContainer),c(t,e,this.startContainer,this.startOffset)>=0&&c(t,e,this.endContainer,this.endOffset)<=0},intersectsRange:function(t){return S(this,t,!1)},intersectsOrTouchesRange:function(t){return S(this,t,!0)},intersection:function(t){if(this.intersectsRange(t)){var e=c(this.startContainer,this.startOffset,t.startContainer,t.startOffset),n=c(this.endContainer,this.endOffset,t.endContainer,t.endOffset),o=this.cloneRange();return-1==e&&o.setStart(t.startContainer,t.startOffset),1==n&&o.setEnd(t.endContainer,t.endOffset),o}return null},union:function(t){if(this.intersectsOrTouchesRange(t)){var e=this.cloneRange();return-1==c(t.startContainer,t.startOffset,this.startContainer,this.startOffset)&&e.setStart(t.startContainer,t.startOffset),1==c(t.endContainer,t.endOffset,this.endContainer,this.endOffset)&&e.setEnd(t.endContainer,t.endOffset),e}throw new r("Ranges do not intersect")},containsNode:function(t,e){return e?this.intersectsNode(t,!1):this.compareNode(t)==ct},containsNodeContents:function(t){return this.comparePoint(t,0)>=0&&this.comparePoint(t,p(t))<=0},containsRange:function(t){var e=this.intersection(t);return null!==e&&t.equals(e)},containsNodeText:function(t){var e=this.cloneRange();e.selectNode(t);var n=e.getNodes([3]);if(n.length>0){e.setStart(n[0],0);var o=n.pop();return e.setEnd(o,o.length),this.containsRange(e)}return this.containsNodeContents(t)},getNodes:function(t,e){return Z(this),M(this,t,e)},getDocument:function(){return b(this)},collapseBefore:function(t){this.setEndBefore(t),this.collapse(!1)},collapseAfter:function(t){this.setStartAfter(t),this.collapse(!0)},getBookmark:function(e){var o=b(this),i=t.createRange(o);e=e||n.getBody(o),i.selectNodeContents(e);var r=this.intersection(i),a=0,s=0;return r&&(i.setEnd(r.startContainer,r.startOffset),s=(a=i.toString().length)+r.toString().length),{start:a,end:s,containerNode:e}},moveToBookmark:function(t){var e=t.containerNode,n=0;this.setStart(e,0),this.collapse(!0);for(var o,i,r,a,s=[e],l=!1,u=!1;!u&&(o=s.pop());)if(3==o.nodeType)i=n+o.length,!l&&t.start>=n&&t.start<=i&&(this.setStart(o,t.start-n),l=!0),l&&t.end>=n&&t.end<=i&&(this.setEnd(o,t.end-n),u=!0),n=i;else for(r=(a=o.childNodes).length;r--;)s.push(a[r])},getName:function(){return"DomRange"},equals:function(t){return yt.rangesEqual(this,t)},isValid:function(){return K(this)},inspect:function(){return O(this)},detach:function(){}}),ft(yt,vt),o.extend(yt,{rangeProperties:nt,RangeIterator:P,copyComparisonConstants:ht,createPrototypeRange:ft,inspect:O,toHtml:et,getRangeDocument:b,rangesEqual:function(t,e){return t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset}}),t.DomRange=yt})),E.createCoreModule("WrappedRange",["DomRange"],(function(t,e){var n,o,i=t.dom,r=t.util,a=i.DomPosition,s=t.DomRange,l=i.getBody,u=i.getContentDocument,c=i.isCharacterDataNode;if(t.features.implementsDomRange&&function(){var o,a,c=s.rangeProperties;function d(t){for(var e,n=c.length;n--;)t[e=c[n]]=t.nativeRange[e];t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset}function h(t,e,n,o,i){var r=t.startContainer!==e||t.startOffset!=n,a=t.endContainer!==o||t.endOffset!=i,s=!t.equals(t.nativeRange);(r||a||s)&&(t.setEnd(o,i),t.setStart(e,n))}n=function(t){if(!t)throw e.createError("WrappedRange: Range must be specified");this.nativeRange=t,d(this)},s.createPrototypeRange(n,h),(o=n.prototype).selectNode=function(t){this.nativeRange.selectNode(t),d(this)},o.cloneContents=function(){return this.nativeRange.cloneContents()},o.surroundContents=function(t){this.nativeRange.surroundContents(t),d(this)},o.collapse=function(t){this.nativeRange.collapse(t),d(this)},o.cloneRange=function(){return new n(this.nativeRange.cloneRange())},o.refresh=function(){d(this)},o.toString=function(){return this.nativeRange.toString()};var p=document.createTextNode("test");l(document).appendChild(p);var f=document.createRange();f.setStart(p,0),f.setEnd(p,0);try{f.setStart(p,1),o.setStart=function(t,e){this.nativeRange.setStart(t,e),d(this)},o.setEnd=function(t,e){this.nativeRange.setEnd(t,e),d(this)},a=function(t){return function(e){this.nativeRange[t](e),d(this)}}}catch(t){o.setStart=function(t,e){try{this.nativeRange.setStart(t,e)}catch(n){this.nativeRange.setEnd(t,e),this.nativeRange.setStart(t,e)}d(this)},o.setEnd=function(t,e){try{this.nativeRange.setEnd(t,e)}catch(n){this.nativeRange.setStart(t,e),this.nativeRange.setEnd(t,e)}d(this)},a=function(t,e){return function(n){try{this.nativeRange[t](n)}catch(o){this.nativeRange[e](n),this.nativeRange[t](n)}d(this)}}}o.setStartBefore=a("setStartBefore","setEndBefore"),o.setStartAfter=a("setStartAfter","setEndAfter"),o.setEndBefore=a("setEndBefore","setStartBefore"),o.setEndAfter=a("setEndAfter","setStartAfter"),o.selectNodeContents=function(t){this.setStartAndEnd(t,0,i.getNodeLength(t))},f.selectNodeContents(p),f.setEnd(p,3);var g=document.createRange();g.selectNodeContents(p),g.setEnd(p,4),g.setStart(p,2),-1==f.compareBoundaryPoints(f.START_TO_END,g)&&1==f.compareBoundaryPoints(f.END_TO_START,g)?o.compareBoundaryPoints=function(t,e){return t==(e=e.nativeRange||e).START_TO_END?t=e.END_TO_START:t==e.END_TO_START&&(t=e.START_TO_END),this.nativeRange.compareBoundaryPoints(t,e)}:o.compareBoundaryPoints=function(t,e){return this.nativeRange.compareBoundaryPoints(t,e.nativeRange||e)};var v=document.createElement("div");v.innerHTML="123";var y=v.firstChild,m=l(document);m.appendChild(v),f.setStart(y,1),f.setEnd(y,2),f.deleteContents(),"13"==y.data&&(o.deleteContents=function(){this.nativeRange.deleteContents(),d(this)},o.extractContents=function(){var t=this.nativeRange.extractContents();return d(this),t}),m.removeChild(v),m=null,r.isHostMethod(f,"createContextualFragment")&&(o.createContextualFragment=function(t){return this.nativeRange.createContextualFragment(t)}),l(document).removeChild(p),o.getName=function(){return"WrappedRange"},t.WrappedRange=n,t.createNativeRange=function(t){return(t=u(t,e,"createNativeRange")).createRange()}}(),t.features.implementsTextRange){var d=function(t){var e=t.parentElement(),n=t.duplicate();n.collapse(!0);var o=n.parentElement();(n=t.duplicate()).collapse(!1);var r=n.parentElement(),a=o==r?o:i.getCommonAncestor(o,r);return a==e?a:i.getCommonAncestor(e,a)},h=function(t){return 0==t.compareEndPoints("StartToEnd",t)},p=function(t,e,n,o,r){var s=t.duplicate();s.collapse(n);var l=s.parentElement();if(i.isOrIsAncestorOf(e,l)||(l=e),!l.canHaveHTML){var u=new a(l.parentNode,i.getNodeIndex(l));return{boundaryPosition:u,nodeInfo:{nodeIndex:u.offset,containerElement:u.node}}}var d=i.getDocument(l).createElement("span");d.parentNode&&i.removeNode(d);for(var h,p,f,g,v,y=n?"StartToStart":"StartToEnd",m=r&&r.containerElement==l?r.nodeIndex:0,b=l.childNodes.length,x=b,_=x;_==b?l.appendChild(d):l.insertBefore(d,l.childNodes[_]),s.moveToElementText(d),0!=(h=s.compareEndPoints(y,t))&&m!=x;){if(-1==h){if(x==m+1)break;m=_}else x=x==m+1?m:_;_=Math.floor((m+x)/2),l.removeChild(d)}if(v=d.nextSibling,-1==h&&v&&c(v)){var E;if(s.setEndPoint(n?"EndToStart":"EndToEnd",t),/[\r\n]/.test(v.data)){var w=s.duplicate(),S=w.text.replace(/\r\n/g,"\r").length;for(E=w.moveStart("character",S);-1==(h=w.compareEndPoints("StartToEnd",w));)E++,w.moveStart("character",1)}else E=s.text.length;g=new a(v,E)}else p=(o||!n)&&d.previousSibling,g=(f=(o||n)&&d.nextSibling)&&c(f)?new a(f,0):p&&c(p)?new a(p,p.data.length):new a(l,i.getNodeIndex(d));return i.removeNode(d),{boundaryPosition:g,nodeInfo:{nodeIndex:_,containerElement:l}}},f=function(t,e){var n,o,r,a,s=t.offset,u=i.getDocument(t.node),d=l(u).createTextRange(),h=c(t.node);return h?o=(n=t.node).parentNode:(n=s<(a=t.node.childNodes).length?a[s]:null,o=t.node),(r=u.createElement("span")).innerHTML="&#feff;",n?o.insertBefore(r,n):o.appendChild(r),d.moveToElementText(r),d.collapse(!e),o.removeChild(r),h&&d[e?"moveStart":"moveEnd"]("character",s),d};(o=function(t){this.textRange=t,this.refresh()}).prototype=new s(document),o.prototype.refresh=function(){var t,e,n,o=d(this.textRange);h(this.textRange)?e=t=p(this.textRange,o,!0,!0).boundaryPosition:(t=(n=p(this.textRange,o,!0,!1)).boundaryPosition,e=p(this.textRange,o,!1,!1,n.nodeInfo).boundaryPosition),this.setStart(t.node,t.offset),this.setEnd(e.node,e.offset)},o.prototype.getName=function(){return"WrappedTextRange"},s.copyComparisonConstants(o);var g=function(t){if(t.collapsed)return f(new a(t.startContainer,t.startOffset),!0);var e=f(new a(t.startContainer,t.startOffset),!0),n=f(new a(t.endContainer,t.endOffset),!1),o=l(s.getRangeDocument(t)).createTextRange();return o.setEndPoint("StartToStart",e),o.setEndPoint("EndToEnd",n),o};if(o.rangeToTextRange=g,o.prototype.toTextRange=function(){return g(this)},t.WrappedTextRange=o,!t.features.implementsDomRange||t.config.preferTextRange){var v=Function("return this;")();void 0===v.Range&&(v.Range=o),t.createNativeRange=function(t){return t=u(t,e,"createNativeRange"),l(t).createTextRange()},t.WrappedRange=o}}t.createRange=function(n){return n=u(n,e,"createRange"),new t.WrappedRange(t.createNativeRange(n))},t.createRangyRange=function(t){return t=u(t,e,"createRangyRange"),new s(t)},r.createAliasForDeprecatedMethod(t,"createIframeRange","createRange"),r.createAliasForDeprecatedMethod(t,"createIframeRangyRange","createRangyRange"),t.addShimListener((function(e){var n=e.document;void 0===n.createRange&&(n.createRange=function(){return t.createRange(n)}),n=e=null}))})),E.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],(function(t,e){t.config.checkSelectionRanges=!0;var n,o,i="boolean",r="number",a=t.dom,s=t.util,l=s.isHostMethod,u=t.DomRange,c=t.WrappedRange,d=t.DOMException,h=a.DomPosition,p=t.features,f="Control",g=a.getDocument,v=a.getBody,y=u.rangesEqual;function m(t){return"string"==typeof t?/^backward(s)?$/i.test(t):!!t}function b(t,n){if(t){if(a.isWindow(t))return t;if(t instanceof Z)return t.win;var o=a.getContentDocument(t,e,n);return a.getWindow(o)}return window}function x(t){return b(t,"getWinSelection").getSelection()}function _(t){return b(t,"getDocSelection").document.selection}function E(t){var e=!1;return t.anchorNode&&(e=1==a.comparePoints(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)),e}var w=l(window,"getSelection"),S=s.isHostObject(document,"selection");p.implementsWinGetSelection=w,p.implementsDocSelection=S;var C=S&&(!w||t.config.preferTextRange);if(C)n=_,t.isSelectionValid=function(t){var e=b(t,"isSelectionValid").document,n=e.selection;return"None"!=n.type||g(n.createRange().parentElement())==e};else{if(!w)return e.fail("Neither document.selection or window.getSelection() detected."),!1;n=x,t.isSelectionValid=function(){return!0}}t.getNativeSelection=n;var N=n();if(!N)return e.fail("Native selection was null (possibly issue 138?)"),!1;var T=t.createNativeRange(document),A=v(document),M=s.areHostProperties(N,["anchorNode","focusNode","anchorOffset","focusOffset"]);p.selectionHasAnchorAndFocus=M;var O=l(N,"extend");p.selectionHasExtend=O;var P=l(N,"setBaseAndExtent");p.selectionHasSetBaseAndExtent=P;var k=typeof N.rangeCount==r;p.selectionHasRangeCount=k;var R=!1,D=!0,L=O?function(e,n){var o=u.getRangeDocument(n),i=t.createRange(o);i.collapseToPoint(n.endContainer,n.endOffset),e.addRange(G(i)),e.extend(n.startContainer,n.startOffset)}:null;s.areHostMethods(N,["addRange","getRangeAt","removeAllRanges"])&&typeof N.rangeCount==r&&p.implementsDomRange&&function(){var e=window.getSelection();if(e){for(var n=e.rangeCount,o=n>1,i=[],r=E(e),s=0;s<n;++s)i[s]=e.getRangeAt(s);var l=a.createTestElement(document,"",!1),u=l.appendChild(document.createTextNode(" ")),c=document.createRange();if(c.setStart(u,1),c.collapse(!0),e.removeAllRanges(),e.addRange(c),D=1==e.rangeCount,e.removeAllRanges(),!o){var d=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(d&&parseInt(d[1])>=36)R=!1;else{var h=c.cloneRange();c.setStart(u,0),h.setEnd(u,3),h.setStart(u,2),e.addRange(c),e.addRange(h),R=2==e.rangeCount}}for(a.removeNode(l),e.removeAllRanges(),s=0;s<n;++s)0==s&&r?L?L(e,i[s]):(t.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),e.addRange(i[s])):e.addRange(i[s])}}(),p.selectionSupportsMultipleRanges=R,p.collapsedNonEditableSelectionsSupported=D;var I,j,B=!1;function H(t,e,n){var o=n?"end":"start",i=n?"start":"end";t.anchorNode=e[o+"Container"],t.anchorOffset=e[o+"Offset"],t.focusNode=e[i+"Container"],t.focusOffset=e[i+"Offset"]}function F(t){var e=t.nativeSelection;t.anchorNode=e.anchorNode,t.anchorOffset=e.anchorOffset,t.focusNode=e.focusNode,t.focusOffset=e.focusOffset}function z(t){t.anchorNode=t.focusNode=null,t.anchorOffset=t.focusOffset=0,t.rangeCount=0,t.isCollapsed=!0,t._ranges.length=0,W(t)}function W(t){t.type=0==t.rangeCount?"None":o(t)?"Caret":"Range"}function G(e){var n;return e instanceof u?((n=t.createNativeRange(e.getDocument())).setEnd(e.endContainer,e.endOffset),n.setStart(e.startContainer,e.startOffset)):e instanceof c?n=e.nativeRange:p.implementsDomRange&&e instanceof a.getWindow(e.startContainer).Range&&(n=e),n}function U(t){if(!t.length||1!=t[0].nodeType)return!1;for(var e=1,n=t.length;e<n;++e)if(!a.isAncestorOf(t[0],t[e]))return!1;return!0}function X(t){var n=t.getNodes();if(!U(n))throw e.createError("getSingleElementFromRange: range "+t.inspect()+" did not consist of a single element");return n[0]}function V(t){return!!t&&void 0!==t.text}function Y(t,e){var n=new c(e);t._ranges=[n],H(t,n,!1),t.rangeCount=1,t.isCollapsed=n.collapsed,W(t)}function q(e){if(e._ranges.length=0,"None"==e.docSelection.type)z(e);else{var n=e.docSelection.createRange();if(V(n))Y(e,n);else{e.rangeCount=n.length;for(var o,i=g(n.item(0)),r=0;r<e.rangeCount;++r)(o=t.createRange(i)).selectNode(n.item(r)),e._ranges.push(o);e.isCollapsed=1==e.rangeCount&&e._ranges[0].collapsed,H(e,e._ranges[e.rangeCount-1],!1),W(e)}}}function K(t,n){for(var o=t.docSelection.createRange(),i=X(n),r=g(o.item(0)),a=v(r).createControlRange(),s=0,l=o.length;s<l;++s)a.add(o.item(s));try{a.add(i)}catch(t){throw e.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),q(t)}function Z(t,e,n){this.nativeSelection=t,this.docSelection=e,this._ranges=[],this.win=n,this.refresh()}function $(t){t.win=t.anchorNode=t.focusNode=t._ranges=null,t.rangeCount=t.anchorOffset=t.focusOffset=0,t.detached=!0,W(t)}A&&l(A,"createControlRange")&&(I=A.createControlRange(),s.areHostProperties(I,["item","add"])&&(B=!0)),p.implementsControlRange=B,o=M?function(t){return t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset}:function(t){return!!t.rangeCount&&t.getRangeAt(t.rangeCount-1).collapsed},l(N,"getRangeAt")?j=function(t,e){try{return t.getRangeAt(e)}catch(t){return null}}:M&&(j=function(e){var n=g(e.anchorNode),o=t.createRange(n);return o.setStartAndEnd(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset),o.collapsed!==this.isCollapsed&&o.setStartAndEnd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset),o}),Z.prototype=t.selectionPrototype;var J=[];function Q(t,e){for(var n,o,i=J.length;i--;)if(o=(n=J[i]).selection,"deleteAll"==e)$(o);else if(n.win==t)return"delete"==e?(J.splice(i,1),!0):o;return"deleteAll"==e&&(J.length=0),null}var tt=function(t){if(t&&t instanceof Z)return t.refresh(),t;var e=Q(t=b(t,"getNativeSelection")),o=n(t),i=S?_(t):null;return e?(e.nativeSelection=o,e.docSelection=i,e.refresh()):(e=new Z(o,i,t),J.push({win:t,selection:e})),e};t.getSelection=tt,s.createAliasForDeprecatedMethod(t,"getIframeSelection","getSelection");var et,nt=Z.prototype;function ot(t,n){for(var o,i=g(n[0].startContainer),r=v(i).createControlRange(),a=0,s=n.length;a<s;++a){o=X(n[a]);try{r.add(o)}catch(t){throw e.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}r.select(),q(t)}if(!C&&M&&s.areHostMethods(N,["removeAllRanges","addRange"])){nt.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),z(this)};var it=function(t,e){L(t.nativeSelection,e),t.refresh()};nt.addRange=k?function(e,n){if(B&&S&&this.docSelection.type==f)K(this,e);else if(m(n)&&O)it(this,e);else{var i;R?i=this.rangeCount:(this.removeAllRanges(),i=0);var r=G(e).cloneRange();try{this.nativeSelection.addRange(r)}catch(t){}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==i+1){if(t.config.checkSelectionRanges){var a=j(this.nativeSelection,this.rangeCount-1);a&&!y(a,e)&&(e=new c(a))}this._ranges[this.rangeCount-1]=e,H(this,e,rt(this.nativeSelection)),this.isCollapsed=o(this),W(this)}else this.refresh()}}:function(t,e){m(e)&&O?it(this,t):(this.nativeSelection.addRange(G(t)),this.refresh())},nt.setRanges=function(t){if(B&&S&&t.length>1)ot(this,t);else{this.removeAllRanges();for(var e=0,n=t.length;e<n;++e)this.addRange(t[e])}}}else{if(!(l(N,"empty")&&l(T,"select")&&B&&C))return e.fail("No means of selecting a Range or TextRange was found"),!1;nt.removeAllRanges=function(){try{if(this.docSelection.empty(),"None"!=this.docSelection.type){var t;if(this.anchorNode)t=g(this.anchorNode);else if(this.docSelection.type==f){var e=this.docSelection.createRange();e.length&&(t=g(e.item(0)))}t&&(v(t).createTextRange().select(),this.docSelection.empty())}}catch(t){}z(this)},nt.addRange=function(e){this.docSelection.type==f?K(this,e):(t.WrappedTextRange.rangeToTextRange(e).select(),this._ranges[0]=e,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,H(this,e,!1),W(this))},nt.setRanges=function(t){this.removeAllRanges();var e=t.length;e>1?ot(this,t):e&&this.addRange(t[0])}}if(nt.getRangeAt=function(t){if(t<0||t>=this.rangeCount)throw new d("INDEX_SIZE_ERR");return this._ranges[t].cloneRange()},C)et=function(e){var n;t.isSelectionValid(e.win)?n=e.docSelection.createRange():(n=v(e.win.document).createTextRange()).collapse(!0),e.docSelection.type==f?q(e):V(n)?Y(e,n):z(e)};else if(l(N,"getRangeAt")&&typeof N.rangeCount==r)et=function(e){if(B&&S&&e.docSelection.type==f)q(e);else if(e._ranges.length=e.rangeCount=e.nativeSelection.rangeCount,e.rangeCount){for(var n=0,i=e.rangeCount;n<i;++n)e._ranges[n]=new t.WrappedRange(e.nativeSelection.getRangeAt(n));H(e,e._ranges[e.rangeCount-1],rt(e.nativeSelection)),e.isCollapsed=o(e),W(e)}else z(e)};else{if(!M||typeof N.isCollapsed!=i||typeof T.collapsed!=i||!p.implementsDomRange)return e.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;et=function(t){var e,n=t.nativeSelection;n.anchorNode?(e=j(n,0),t._ranges=[e],t.rangeCount=1,F(t),t.isCollapsed=o(t),W(t)):z(t)}}nt.refresh=function(t){var e=t?this._ranges.slice(0):null,n=this.anchorNode,o=this.anchorOffset;if(et(this),t){var i=e.length;if(i!=this._ranges.length)return!0;if(this.anchorNode!=n||this.anchorOffset!=o)return!0;for(;i--;)if(!y(e[i],this._ranges[i]))return!0;return!1}};var rt,at=function(t,e){var n=t.getAllRanges();t.removeAllRanges();for(var o=0,i=n.length;o<i;++o)y(e,n[o])||t.addRange(n[o]);t.rangeCount||z(t)};function st(t,e){if(t.win.document!=g(e))throw new d("WRONG_DOCUMENT_ERR")}function lt(t,e){if(e<0||e>(a.isCharacterDataNode(t)?t.length:t.childNodes.length))throw new d("INDEX_SIZE_ERR")}function ut(e){return function(n,o){var i;this.rangeCount?(i=this.getRangeAt(0))["set"+(e?"Start":"End")](n,o):(i=t.createRange(this.win.document)).setStartAndEnd(n,o),this.setSingleRange(i,this.isBackward())}}function ct(t){var e=[],n=new h(t.anchorNode,t.anchorOffset),o=new h(t.focusNode,t.focusOffset),i="function"==typeof t.getName?t.getName():"Selection";if(void 0!==t.rangeCount)for(var r=0,a=t.rangeCount;r<a;++r)e[r]=u.inspect(t.getRangeAt(r));return"["+i+"(Ranges: "+e.join(", ")+")(anchor: "+n.inspect()+", focus: "+o.inspect()+"]"}nt.removeRange=B&&S?function(t){if(this.docSelection.type==f){for(var e=this.docSelection.createRange(),n=X(t),o=g(e.item(0)),i=v(o).createControlRange(),r=!1,a=0,s=e.length;a<s;++a)e.item(a)!==n||r?i.add(e.item(a)):r=!0;i.select(),q(this)}else at(this,t)}:function(t){at(this,t)},!C&&M&&p.implementsDomRange?(rt=E,nt.isBackward=function(){return rt(this)}):rt=nt.isBackward=function(){return!1},nt.isBackwards=nt.isBackward,nt.toString=function(){for(var t=[],e=0,n=this.rangeCount;e<n;++e)t[e]=""+this._ranges[e];return t.join("")},nt.collapse=function(e,n){st(this,e);var o=t.createRange(e);o.collapseToPoint(e,n),this.setSingleRange(o),this.isCollapsed=!0},nt.collapseToStart=function(){if(!this.rangeCount)throw new d("INVALID_STATE_ERR");var t=this._ranges[0];this.collapse(t.startContainer,t.startOffset)},nt.collapseToEnd=function(){if(!this.rangeCount)throw new d("INVALID_STATE_ERR");var t=this._ranges[this.rangeCount-1];this.collapse(t.endContainer,t.endOffset)},nt.selectAllChildren=function(e){st(this,e);var n=t.createRange(e);n.selectNodeContents(e),this.setSingleRange(n)},P?nt.setBaseAndExtent=function(t,e,n,o){this.nativeSelection.setBaseAndExtent(t,e,n,o),this.refresh()}:O&&(nt.setBaseAndExtent=function(e,n,o,i){lt(e,n),lt(o,i),st(this,e),st(this,o);var r=t.createRange(node),s=-1==a.comparePoints(e,n,o,i);s?r.setStartAndEnd(o,i,e,n):r.setStartAndEnd(e,n,o,i),this.setSingleRange(r,s)}),nt.deleteFromDocument=function(){if(B&&S&&this.docSelection.type==f){for(var t,e=this.docSelection.createRange();e.length;)t=e.item(0),e.remove(t),a.removeNode(t);this.refresh()}else if(this.rangeCount){var n=this.getAllRanges();if(n.length){this.removeAllRanges();for(var o=0,i=n.length;o<i;++o)n[o].deleteContents();this.addRange(n[i-1])}}},nt.eachRange=function(t,e){for(var n=0,o=this._ranges.length;n<o;++n)if(t(this.getRangeAt(n)))return e},nt.getAllRanges=function(){var t=[];return this.eachRange((function(e){t.push(e)})),t},nt.setSingleRange=function(t,e){this.removeAllRanges(),this.addRange(t,e)},nt.callMethodOnEachRange=function(t,e){var n=[];return this.eachRange((function(o){n.push(o[t].apply(o,e||[]))})),n},nt.setStart=ut(!0),nt.setEnd=ut(!1),t.rangePrototype.select=function(t){tt(this.getDocument()).setSingleRange(this,t)},nt.changeEachRange=function(t){var e=[],n=this.isBackward();this.eachRange((function(n){t(n),e.push(n)})),this.removeAllRanges(),n&&1==e.length?this.addRange(e[0],"backward"):this.setRanges(e)},nt.containsNode=function(t,e){return this.eachRange((function(n){return n.containsNode(t,e)}),!0)||!1},nt.getBookmark=function(t){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[t])}},nt.moveToBookmark=function(e){for(var n,o,i=[],r=0;n=e.rangeBookmarks[r++];)(o=t.createRange(this.win)).moveToBookmark(n),i.push(o);e.backward?this.setSingleRange(i[0],"backward"):this.setRanges(i)},nt.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},nt.restoreRanges=function(t){this.removeAllRanges();for(var e,n=0;e=t.ranges[n];++n)this.addRange(e,t.backward&&0==n)},nt.toHtml=function(){var t=[];return this.eachRange((function(e){t.push(u.toHtml(e))})),t.join("")},p.implementsTextRange&&(nt.getNativeTextRange=function(){var n;if(n=this.docSelection){var o=n.createRange();if(V(o))return o;throw e.createError("getNativeTextRange: selection is a control selection")}if(this.rangeCount>0)return t.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw e.createError("getNativeTextRange: selection contains no range")}),nt.getName=function(){return"WrappedSelection"},nt.inspect=function(){return ct(this)},nt.detach=function(){Q(this.win,"delete"),$(this)},Z.detachAll=function(){Q(null,"deleteAll")},Z.inspect=ct,Z.isDirectionBackward=m,t.Selection=Z,t.selectionPrototype=nt,t.addShimListener((function(t){void 0===t.getSelection&&(t.getSelection=function(){return tt(t)}),t=null}))}));var B=!1,H=function(t){B||(B=!0,!E.initialized&&E.config.autoInitialize&&M())};return x&&("complete"==document.readyState?H():(s(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",H,!1),y(window,"load",H))),E}()}(oS);var iS=nS,rS={},aS={get exports(){return rS},set exports(t){rS=t}};!function(t){t.exports=function(t){return t.createModule("ClassApplier",["WrappedSelection"],(function(t,e){var n=t.dom,o=n.DomPosition,i=n.arrayContains,r=t.util,a=r.forEach,s="span",l=r.isHostMethod(document,"createElementNS");function u(t,e){for(var n in t)if(t.hasOwnProperty(n)&&!1===e(n,t[n]))return!1;return!0}function c(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function d(t,e){return!!t&&new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(t)}function h(t,e){return"object"==typeof t.classList?t.classList.contains(e):d("string"==typeof t.className?t.className:t.getAttribute("class"),e)}function p(t,e){if("object"==typeof t.classList)t.classList.add(e);else{var n="string"==typeof t.className,o=n?t.className:t.getAttribute("class");o?d(o,e)||(o+=" "+e):o=e,n?t.className=o:t.setAttribute("class",o)}}var f=function(){function t(t,e,n){return e&&n?" ":""}return function(e,n){if("object"==typeof e.classList)e.classList.remove(n);else{var o="string"==typeof e.className,i=o?e.className:e.getAttribute("class");i=i.replace(new RegExp("(^|\\s)"+n+"(\\s|$)"),t),o?e.className=i:e.setAttribute("class",i)}}}();function g(t){return"string"==typeof t.className?t.className:t.getAttribute("class")}function v(t){return t&&t.split(/\s+/).sort().join(" ")}function y(t){return v(g(t))}function m(t,e){return y(t)==y(e)}function b(t,e){for(var n=e.split(/\s+/),o=0,i=n.length;o<i;++o)if(!h(t,c(n[o])))return!1;return!0}function x(t){var e=t.parentNode;return e&&1==e.nodeType&&!/^(textarea|style|script|select|iframe)$/i.test(e.nodeName)}function _(t,e,n,o,i){var r=t.node,a=t.offset,s=r,l=a;r==o&&a>i&&++l,r!=e||a!=n&&a!=n+1||(s=o,l+=i-n),r==e&&a>n+1&&--l,t.node=s,t.offset=l}function E(t,e,n){t.node==e&&t.offset>n&&--t.offset}function w(t,e,o,i){-1==o&&(o=e.childNodes.length);var r=t.parentNode,s=n.getNodeIndex(t);a(i,(function(t){_(t,r,s,e,o)})),e.childNodes.length==o?e.appendChild(t):e.insertBefore(t,e.childNodes[o])}function S(t,e){var o=t.parentNode,i=n.getNodeIndex(t);a(e,(function(t){E(t,o,i)})),n.removeNode(t)}function C(t,e,n,o,i){for(var r,a=[];r=t.firstChild;)w(r,e,n++,i),a.push(r);return o&&S(t,i),a}function N(t,e){return C(t,t.parentNode,n.getNodeIndex(t),!0,e)}function T(t,e){var n=t.cloneRange();n.selectNodeContents(e);var o=n.intersection(t);return""!=(o?o.toString():"")}function A(t){for(var e,n=t.getNodes([3]),o=0;(e=n[o])&&!T(t,e);)++o;for(var i=n.length-1;(e=n[i])&&!T(t,e);)--i;return n.slice(o,i+1)}function M(t,e){if(t.attributes.length!=e.attributes.length)return!1;for(var n,o,i,r=0,a=t.attributes.length;r<a;++r)if("class"!=(i=(n=t.attributes[r]).name)){if(null===n!=(null===(o=e.attributes.getNamedItem(i))))return!1;if(n.specified!=o.specified)return!1;if(n.specified&&n.nodeValue!==o.nodeValue)return!1}return!0}function O(t,e){for(var n,o=0,r=t.attributes.length;o<r;++o)if(n=t.attributes[o].name,(!e||!i(e,n))&&t.attributes[o].specified&&"class"!=n)return!0;return!1}var P=n.getComputedStyleProperty,k="boolean"==typeof document.createElement("div").isContentEditable?function(t){return t&&1==t.nodeType&&t.isContentEditable}:function(t){return!(!t||1!=t.nodeType||"false"==t.contentEditable)&&("true"==t.contentEditable||k(t.parentNode))};function R(t){var e;return t&&1==t.nodeType&&((e=t.parentNode)&&9==e.nodeType&&"on"==e.designMode||k(t)&&!k(t.parentNode))}function D(t){return(k(t)||1!=t.nodeType&&k(t.parentNode))&&!R(t)}var L=/^inline(-block|-table)?$/i;function I(t){return t&&1==t.nodeType&&!L.test(P(t,"display"))}var j=/[^\r\n\t\f \u200B]/;function B(t){if(0==t.data.length)return!0;if(j.test(t.data))return!1;switch(P(t.parentNode,"whiteSpace")){case"pre":case"pre-wrap":case"-moz-pre-wrap":return!1;case"pre-line":if(/[\r\n]/.test(t.data))return!1}return I(t.previousSibling)||I(t.nextSibling)}function H(t){var e,n,i=[];for(e=0;n=t[e++];)i.push(new o(n.startContainer,n.startOffset),new o(n.endContainer,n.endOffset));return i}function F(t,e){for(var n,o,i,r=0,a=t.length;r<a;++r)n=t[r],o=e[2*r],i=e[2*r+1],n.setStartAndEnd(o.node,o.offset,i.node,i.offset)}function z(t,e){return n.isCharacterDataNode(t)?0==e?!!t.previousSibling:e!=t.length||!!t.nextSibling:e>0&&e<t.childNodes.length}function W(t,o,i,r){var a,s,l=0==i;if(n.isAncestorOf(o,t))return t;if(n.isCharacterDataNode(o)){var u=n.getNodeIndex(o);if(0==i)i=u;else{if(i!=o.length)throw e.createError("splitNodeAt() should not be called with offset in the middle of a data node ("+i+" in "+o.data);i=u+1}o=o.parentNode}if(z(o,i)){a=o.cloneNode(!1),s=o.parentNode,a.id&&a.removeAttribute("id");for(var c,d=0;c=o.childNodes[i];)w(c,a,d++,r);return w(a,s,n.getNodeIndex(o)+1,r),o==t?a:W(t,s,n.getNodeIndex(a),r)}if(t!=o){a=o.parentNode;var h=n.getNodeIndex(o);return l||h++,W(t,a,h,r)}return t}function G(t,e){return t.namespaceURI==e.namespaceURI&&t.tagName.toLowerCase()==e.tagName.toLowerCase()&&m(t,e)&&M(t,e)&&"inline"==P(t,"display")&&"inline"==P(e,"display")}function U(t){var e=t?"nextSibling":"previousSibling";return function(n,o){var i=n.parentNode,r=n[e];if(r){if(r&&3==r.nodeType)return r}else if(o&&(r=i[e])&&1==r.nodeType&&G(i,r)){var a=r[t?"firstChild":"lastChild"];if(a&&3==a.nodeType)return a}return null}}var X=U(!1),V=U(!0);function Y(t){this.isElementMerge=1==t.nodeType,this.textNodes=[];var e=this.isElementMerge?t.lastChild:t;e&&(this.textNodes[0]=e)}Y.prototype={doMerge:function(t){var e=this.textNodes,o=e[0];if(e.length>1){var i,r=n.getNodeIndex(o),s=[],l=0;a(e,(function(u,c){i=u.parentNode,c>0&&(i.removeChild(u),i.hasChildNodes()||n.removeNode(i),t&&a(t,(function(t){t.node==u&&(t.node=o,t.offset+=l),t.node==i&&t.offset>r&&(--t.offset,t.offset==r+1&&c<e.length-1&&(t.node=o,t.offset=l))}))),s[c]=u.data,l+=u.data.length})),o.data=s.join("")}return o.data},getLength:function(){for(var t=this.textNodes.length,e=0;t--;)e+=this.textNodes[t].length;return e},toString:function(){var t=[];return a(this.textNodes,(function(e,n){t[n]="'"+e.data+"'"})),"[Merge("+t.join(",")+")]"}};var q=["elementTagName","ignoreWhiteSpace","applyToEditableOnly","useExistingElements","removeEmptyElements","onElementCreate"],K={};function Z(t,e,n){var o,i,r,a,s=this;s.cssClass=s.className=t;var l=null,d={};if("object"==typeof e&&null!==e){for(void 0!==e.elementTagName&&(e.elementTagName=e.elementTagName.toLowerCase()),n=e.tagNames,l=e.elementProperties,d=e.elementAttributes,i=0;a=q[i++];)e.hasOwnProperty(a)&&(s[a]=e[a]);o=e.normalize}else o=e;s.normalize=void 0===o||o,s.attrExceptions=[];var h=document.createElement(s.elementTagName);s.elementProperties=s.copyPropertiesToElement(l,h,!0),u(d,(function(t,e){s.attrExceptions.push(t),d[t]=""+e})),s.elementAttributes=d,s.elementSortedClassName=s.elementProperties.hasOwnProperty("className")?v(s.elementProperties.className+" "+t):t,s.applyToAnyTagName=!1;var p=typeof n;if("string"==p)"*"==n?s.applyToAnyTagName=!0:s.tagNames=c(n.toLowerCase()).split(/\s*,\s*/);else if("object"==p&&"number"==typeof n.length)for(s.tagNames=[],i=0,r=n.length;i<r;++i)"*"==n[i]?s.applyToAnyTagName=!0:s.tagNames.push(n[i].toLowerCase());else s.tagNames=[s.elementTagName]}function $(t,e,n){return new Z(t,e,n)}Z.prototype={elementTagName:s,elementProperties:{},elementAttributes:{},ignoreWhiteSpace:!0,applyToEditableOnly:!1,useExistingElements:!0,removeEmptyElements:!0,onElementCreate:null,copyPropertiesToElement:function(t,e,n){var o,i,r,a,s,l,u={};for(var c in t)if(t.hasOwnProperty(c))if(a=t[c],s=e[c],"className"==c)p(e,a),p(e,this.className),e[c]=v(e[c]),n&&(u[c]=a);else if("style"==c){for(o in i=s,n&&(u[c]=r={}),t[c])t[c].hasOwnProperty(o)&&(i[o]=a[o],n&&(r[o]=i[o]));this.attrExceptions.push(c)}else e[c]=a,n&&(u[c]=e[c],l=K.hasOwnProperty(c)?K[c]:c,this.attrExceptions.push(l));return n?u:""},copyAttributesToElement:function(t,e){for(var n in t)t.hasOwnProperty(n)&&!/^class(?:Name)?$/i.test(n)&&e.setAttribute(n,t[n])},appliesToElement:function(t){return i(this.tagNames,t.tagName.toLowerCase())},getEmptyElements:function(t){var e=this;return t.getNodes([1],(function(t){return e.appliesToElement(t)&&!t.hasChildNodes()}))},hasClass:function(t){return 1==t.nodeType&&(this.applyToAnyTagName||this.appliesToElement(t))&&h(t,this.className)},getSelfOrAncestorWithClass:function(t){for(;t;){if(this.hasClass(t))return t;t=t.parentNode}return null},isModifiable:function(t){return!this.applyToEditableOnly||D(t)},isIgnorableWhiteSpaceNode:function(t){return this.ignoreWhiteSpace&&t&&3==t.nodeType&&B(t)},postApply:function(t,e,n,o){var i,r,s=t[0],l=t[t.length-1],u=[],c=s,d=l,h=0,p=l.length;a(t,(function(t){(r=X(t,!o))?(i||(i=new Y(r),u.push(i)),i.textNodes.push(t),t===s&&(c=i.textNodes[0],h=c.length),t===l&&(d=i.textNodes[0],p=i.getLength())):i=null}));var f=V(l,!o);if(f&&(i||(i=new Y(l),u.push(i)),i.textNodes.push(f)),u.length){for(var g=0,v=u.length;g<v;++g)u[g].doMerge(n);e.setStartAndEnd(c,h,d,p)}},createContainer:function(t){var e=n.getDocument(t),o=l&&!n.isHtmlNamespace(t)&&t.namespaceURI?e.createElementNS(t.namespaceURI,this.elementTagName):e.createElement(this.elementTagName);return this.copyPropertiesToElement(this.elementProperties,o,!1),this.copyAttributesToElement(this.elementAttributes,o),p(o,this.className),this.onElementCreate&&this.onElementCreate(o,this),o},elementHasProperties:function(t,e){var n=this;return u(e,(function(e,o){if("className"==e)return b(t,o);if("object"==typeof o){if(!n.elementHasProperties(t[e],o))return!1}else if(t[e]!==o)return!1}))},elementHasAttributes:function(t,e){return u(e,(function(e,n){if(t.getAttribute(e)!==n)return!1}))},applyToTextNode:function(t,e){if(x(t)){var n=t.parentNode;if(1==n.childNodes.length&&this.useExistingElements&&this.appliesToElement(n)&&this.elementHasProperties(n,this.elementProperties)&&this.elementHasAttributes(n,this.elementAttributes))p(n,this.className);else{var o=t.parentNode,i=this.createContainer(o);o.insertBefore(i,t),i.appendChild(t)}}},isRemovable:function(t){return t.tagName.toLowerCase()==this.elementTagName&&y(t)==this.elementSortedClassName&&this.elementHasProperties(t,this.elementProperties)&&!O(t,this.attrExceptions)&&this.elementHasAttributes(t,this.elementAttributes)&&this.isModifiable(t)},isEmptyContainer:function(t){var e=t.childNodes.length;return 1==t.nodeType&&this.isRemovable(t)&&(0==e||1==e&&this.isEmptyContainer(t.firstChild))},removeEmptyContainers:function(t){var e=this,n=t.getNodes([1],(function(t){return e.isEmptyContainer(t)})),o=[t],i=H(o);a(n,(function(t){S(t,i)})),F(o,i)},undoToTextNode:function(t,e,n,o){if(!e.containsNode(n)){var i=e.cloneRange();i.selectNode(n),i.isPointInRange(e.endContainer,e.endOffset)&&(W(n,e.endContainer,e.endOffset,o),e.setEndAfter(n)),i.isPointInRange(e.startContainer,e.startOffset)&&(n=W(n,e.startContainer,e.startOffset,o))}this.isRemovable(n)?N(n,o):f(n,this.className)},splitAncestorWithClass:function(t,e,n){var o=this.getSelfOrAncestorWithClass(t);o&&W(o,t,e,n)},undoToAncestor:function(t,e){this.isRemovable(t)?N(t,e):f(t,this.className)},applyToRange:function(t,e){var n=this,o=H((e=e||[])||[]);t.splitBoundariesPreservingPositions(o),n.removeEmptyElements&&n.removeEmptyContainers(t);var i=A(t);if(i.length){a(i,(function(t){n.isIgnorableWhiteSpaceNode(t)||n.getSelfOrAncestorWithClass(t)||!n.isModifiable(t)||n.applyToTextNode(t,o)}));var r=i[i.length-1];t.setStartAndEnd(i[0],0,r,r.length),n.normalize&&n.postApply(i,t,o,!1),F(e,o)}var s=n.getEmptyElements(t);a(s,(function(t){p(t,n.className)}))},applyToRanges:function(t){for(var e=t.length;e--;)this.applyToRange(t[e],t);return t},applyToSelection:function(e){var n=t.getSelection(e);n.setRanges(this.applyToRanges(n.getAllRanges()))},undoToRange:function(t,e){var n=this,o=H(e=e||[]);t.splitBoundariesPreservingPositions(o),n.removeEmptyElements&&n.removeEmptyContainers(t,o);var i,r,s=A(t),l=s[s.length-1];if(s.length){n.splitAncestorWithClass(t.endContainer,t.endOffset,o),n.splitAncestorWithClass(t.startContainer,t.startOffset,o);for(var u=0,c=s.length;u<c;++u)i=s[u],(r=n.getSelfOrAncestorWithClass(i))&&n.isModifiable(i)&&n.undoToAncestor(r,o);t.setStartAndEnd(s[0],0,l,l.length),n.normalize&&n.postApply(s,t,o,!0),F(e,o)}var d=n.getEmptyElements(t);a(d,(function(t){f(t,n.className)}))},undoToRanges:function(t){for(var e=t.length;e--;)this.undoToRange(t[e],t);return t},undoToSelection:function(e){var n=t.getSelection(e),o=t.getSelection(e).getAllRanges();this.undoToRanges(o),n.setRanges(o)},isAppliedToRange:function(t){if(t.collapsed||""==t.toString())return!!this.getSelfOrAncestorWithClass(t.commonAncestorContainer);var e=t.getNodes([3]);if(e.length)for(var n,o=0;n=e[o++];)if(!this.isIgnorableWhiteSpaceNode(n)&&T(t,n)&&this.isModifiable(n)&&!this.getSelfOrAncestorWithClass(n))return!1;return!0},isAppliedToRanges:function(t){var e=t.length;if(0==e)return!1;for(;e--;)if(!this.isAppliedToRange(t[e]))return!1;return!0},isAppliedToSelection:function(e){var n=t.getSelection(e);return this.isAppliedToRanges(n.getAllRanges())},toggleRange:function(t){this.isAppliedToRange(t)?this.undoToRange(t):this.applyToRange(t)},toggleSelection:function(t){this.isAppliedToSelection(t)?this.undoToSelection(t):this.applyToSelection(t)},getElementsWithClassIntersectingRange:function(t){var e=[],n=this;return t.getNodes([3],(function(t){var o=n.getSelfOrAncestorWithClass(t);o&&!i(e,o)&&e.push(o)})),e},detach:function(){}},Z.util={hasClass:h,addClass:p,removeClass:f,getClass:g,hasSameClasses:m,hasAllClasses:b,replaceWithOwnChildren:N,elementsHaveSameNonClassAttributes:M,elementHasNonClassAttributes:O,splitNodeAt:W,isEditableElement:k,isEditingHost:R,isEditable:D},t.CssClassApplier=t.ClassApplier=Z,t.createClassApplier=$,r.createAliasForDeprecatedMethod(t,"createCssClassApplier","createClassApplier",e)})),t}(nS)}(aS);var sS={toolbar:{allowMultiParagraphSelection:!0,buttons:["bold","colorpicker","italic","underline","strikethrough","quote","justifyLeft","justifyCenter","justifyRight","justifyFull","superscript","subscript","orderedlist","unorderedlist","pre","removeFormat","outdent","indent","h2","h3"],standardizeSelectionStart:!1,updateOnEmptySelection:!1},placeholder:{text:"请输入内容",hideOnClick:!0},disableEditing:!0},lS=Hw.extensions.button.extend({name:"colorpicker",tagNames:["mark"],contentDefault:"<b>Color</b>",aria:"Color Picker",action:"colorPicker",init:function(){var t=this;iS.init(),Hw.extensions.button.prototype.init.call(this),this.colorPicker=new tS({parent:this.button,color:"#000",onDone:function(e){t.coloredText&&t.coloredText.isAppliedToSelection()&&t.coloredText.undoToSelection(),t.coloredText=iS.createClassApplier("colored",{elementTagName:"span",elementProperties:{style:{color:e.hex}},normalize:!0}),t.coloredText.toggleSelection(),t.base.checkContentChanged(),t.setInactive()}})},getButton:function(){return this.button},handleClick:function(){this.setActive(),this.colorPicker.show()},isAlreadyApplied:function(t){return"mark"===t.nodeName.toLowerCase()},isActive:function(){return this.button.classList.contains("medium-editor-button-active")},setInactive:function(){this.button.classList.remove("medium-editor-button-active")},setActive:function(){this.button.classList.add("medium-editor-button-active")}}),uS=function(t){function n(e){var n=t.call(this,e)||this;n.labelMap=new Map;var o=e.lf,i=e.graphModel;return n.lf=o,n.graphModel=i,n.state={tick:0},n}return f(n,t),n.prototype.componentDidMount=function(){var t=this,e=this.props.graphModel;this.editor=new Hw(".lf-label-editor",md(sS,{autoLink:!0,extensions:{colorPicker:new lS}})),e.eventCenter.on("text:update,node:mousemove,node:resize,node:rotate,node:drag,label:drop,node:drop",(function(){})),e.eventCenter.on("node:properties-change,node:properties-delete",(function(){t.setState({tick:t.state.tick+1})}))},n.prototype.componentDidUpdate=function(){var t;this.editor&&this.editor.elements.length>0?this.editor.addElements(".lf-label-editor"):(null===(t=this.editor)||void 0===t||t.destroy(),this.editor=new Hw(".lf-label-editor",md(sS,{autoLink:!0,extensions:{colorPicker:new lS}})))},n.prototype.componentWillUnmount=function(){var t;null===(t=this.editor)||void 0===t||t.destroy()},n.prototype.getLabels=function(){var t=this,e=this.props,n=e.lf.extension,o=e.graphModel,i=E(E([],_(o.nodes),!1),_(o.edges),!1);if(n.label){var r=[];return xu(i,(function(e){var n,i;xu(null!==(i=null===(n=e.getData().properties)||void 0===n?void 0:n._label)&&void 0!==i?i:[],(function(n){var i=t.labelMap,a=new Iw(n,e,o);i.set(a.id,a),r.push(fg(Dw,{label:a,element:e,graphModel:o},a.id))}))})),r}return null},n.prototype.render=function(){return fg("foreignObject",{id:"lf-label-overlay",class:"lf-label-overlay",children:this.getLabels()})},n.toolName="label-edit-tool",n=y([e.observer],n)}(e.Component),cS=function(){function t(t){var n,o,i,r=t.lf,a=t.options;this.labelInitPositionMap=new Map,this.lf=r,this.options=null!=a?a:{},this.textOverflowMode=null!==(n=a.textOverflowMode)&&void 0!==n?n:"default",this.isMultiple=null===(o=a.isMultiple)||void 0===o||o,this.labelWidth=a.labelWidth,this.maxCount=null!==(i=a.maxCount)&&void 0!==i?i:1/0,r.graphModel.editConfigModel.updateTextMode(e.TextMode.LABEL),this.addEventListeners(),r.tool.registerTool(uS.toolName,uS),r.tool.disableTool("text-edit-tool")}return t.prototype.formatConfig=function(t,n){var o=t.editConfigModel,i=o.nodeTextEdit,r=o.edgeTextEdit,a=o.nodeTextDraggable,s=o.edgeTextDraggable,l=this,u=l.textOverflowMode,c=l.isMultiple,d=l.maxCount,h=l.labelWidth,p=n.text,f=n.zIndex,v=n.properties,y=v._label,m=v._labelOption,b=y,x=void 0===m?{}:m,_=x.isMultiple,E=x.maxCount,w=[];if(ee(b)){var S=null!=E?E:d;w=c&&_?b.length>S?b.slice(0,S):b:[b[0]]}else if(he(b))w=[b];else if("string"==typeof b||!b){var C=g(g({},p),{content:b||p.value,draggable:"edge"===n.BaseType?s:a});w=C.value?[C]:[]}return"edge"===n.BaseType&&(w=Ju(w,(function(t){var e=t.x,n=t.y;return console.log("x, y ---\x3e>>",e,n),t}))),Ju(w,(function(t){t.id||(t.id=e.createUuid());var o=t.value,l=t.content,c=t.vertical,d=t.editable,p=t.draggable,v=t.textOverflowMode,y="node"===n.BaseType?i:r,m="node"===n.BaseType?a:s;return g(g({},t),{zIndex:f,labelWidth:h,content:null!=l?l:o,vertical:null!=c&&c,editable:y&&d,draggable:m&&p,textOverflowMode:null!=v?v:u})}))},t.prototype.setupLabels=function(t){var e=this;xu(t.sortElements,(function(n){e.rewriteInnerMethods(n);var o=e.formatConfig(t,n);n.setProperty("_label",o)}))},t.prototype.addLabel=function(t,n){var o,i,r,a=this.isMultiple,s=this.maxCount,l=t.properties,u=null!==(o=l._label)&&void 0!==o?o:[],c=null!==(i=l._labelOption)&&void 0!==i?i:{},d=u.length,h={id:e.createUuid(),x:n.x,y:n.y,content:"Label".concat(d+1),value:"Label".concat(d+1),style:{},draggable:!0,editable:!0,vertical:!1};!a||d>=(null!==(r=null==c?void 0:c.maxCount)&&void 0!==r?r:s)||(u.push(h),t.setProperty("_label",u))},t.prototype.addEventListeners=function(){var t=this,n=this.lf.graphModel,o=n.eventCenter,i=n.editConfigModel;o.on("graph:rendered",(function(e){var n=e.graphModel;t.setupLabels(n)})),o.on("node:dbclick,edge:dbclick",(function(o){var r=o.e,a=o.data,s=n.getElement(a.id),l=n.getPointByClient({x:r.clientX,y:r.clientY}).canvasOverlayPosition,u={x:l.x,y:l.y};s&&i.textMode===e.TextMode.LABEL&&t.addLabel(s,u)})),o.on("node:resize",(function(t){var e,n,o=t.preData,i=t.data,r=t.model,a=null!==(e=o.properties)&&void 0!==e?e:{},s=a.width,l=a.height,u=a._label,c=void 0===u?[]:u,d=null!==(n=i.properties)&&void 0!==n?n:{},h=d.width,p=d.height;if(s&&l&&h&&p){var f={x:o.x,y:o.y,width:s,height:l},v={x:i.x,y:i.y,width:h,height:p},y=Ju(c,(function(t){var e,n,o,i,r,a,s,l,u,c,d,h=t.x,p=t.y,y=(n=v,o={x:h,y:p},i=(e=f).x,r=e.y,a=e.width,s=e.height,l=n.x,u=n.y,c=n.width,d=n.height,{x:l+(o.x-i)/a*c,y:u+(o.y-r)/s*d});return g(g({},t),y)}));r.setProperty("_label",y)}})),o.on("node:rotate",(function(e){var n=e.model,o=n.x,i=n.y,r=n.rotate,a=n.properties._label,s={x:o,y:i},l=Ju(void 0===a?[]:a,(function(e){if(!e.id)return e;var n={x:e.x,y:e.y};t.labelInitPositionMap.has(e.id)?n=t.labelInitPositionMap.get(e.id):t.labelInitPositionMap.set(e.id,n);var o=r*(180/Math.PI);o<0&&(o+=360);var i=o*(Math.PI/180),a=vw(n,s,i);return g(g(g({},e),a),{rotate:o})}));n.setProperty("_label",l)}))},t.prototype.rewriteInnerMethods=function(t){t.moveText=function(e,n){if(t.text){var o=t.text,i=o.x,r=o.y,a=o.value,s=o.draggable,l=o.editable;t.text={value:a,editable:l,draggable:s,x:i+e,y:r+n};var u=Is(t.getProperties());if(ee(u._label)){var c=Ju(u._label,(function(t){return g(g({},t),{x:t.x+e,y:t.y+n})}));null==t||t.setProperty("_label",c)}}}},t.prototype.updateTextMode=function(t){var n=this.lf.graphModel.editConfigModel;t!==n.textMode&&(n.updateTextMode(t),t===e.TextMode.LABEL?(this.lf.tool.enableTool(uS.toolName),this.lf.tool.disableTool("text-edit-tool")):t===e.TextMode.TEXT&&(this.lf.tool.enableTool("text-edit-tool"),this.lf.tool.disableTool(uS.toolName)))},t.prototype.render=function(){},t.prototype.destroy=function(){},t.pluginName="label",t}(),dS={};function hS(t){return t.startsWith("data:text/plain")}function pS(t){return m(this,void 0,void 0,(function(){return b(this,(function(e){return dS[t]?[2,dS[t]]:[2,new Promise((function(e,n){try{fetch(t).then((function(t){return t.blob()})).then((function(o){var i=new FileReader;i.onloadend=function(){e(dS[t]=i.result)},i.onerror=n,i.readAsDataURL(o)})).catch((function(){e(dS[t]=t)}))}catch(e){return dS[t]=t}}))]}))}))}function fS(t,e){return m(this,void 0,void 0,(function(){var n,o,i;return b(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),(n=t.getAttribute(e)||"").startsWith("data:")?[2]:[4,pS(n)];case 1:return hS(o=r.sent())?[2]:(t.setAttribute(e,o),[3,3]);case 2:return i=r.sent(),console.error(i),[3,3];case 3:return[2]}}))}))}function gS(t,e){return m(this,void 0,void 0,(function(){var n,o;return b(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e.startsWith("data:")?[2]:[4,pS(e)];case 1:return hS(n=i.sent())?[2]:(t.style.backgroundImage="url(".concat(n,")"),[3,3]);case 2:return o=i.sent(),console.error(o),[3,3];case 3:return[2]}}))}))}function vS(t){return m(this,void 0,void 0,(function(){var e,n,o,i,r,a,s,l,u;return b(this,(function(c){switch(c.label){case 0:for(e=[t],o=[];e.length;)(n=e.shift()).children.length&&e.push.apply(e,E([],_(n.children),!1)),n instanceof HTMLElement&&(i=n.style,r=i.background,a=i.backgroundImage,(s=r.match(/url\(["']?(.*?)["']?\)/))&&s[1]&&(u=s[1],o.push(gS(n,u))),(l=a.match(/url\(["']?(.*?)["']?\)/))&&l[1]&&(u=l[1],o.push(gS(n,u)))),n instanceof HTMLImageElement?o.push(fS(n,"src")):n instanceof SVGImageElement&&o.push(fS(n,"href"));return[4,Promise.all(o)];case 1:return c.sent(),[2]}}))}))}function yS(t,e,n){var o=document.createElement("canvas");o.width=e,o.height=n;var i=o.getContext("2d");return i&&i.drawImage(t,0,0,t.width,t.height,0,0,e,n),o}var mS=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.customCssRules="",this.useGlobalRules=!0,e.getSnapshot=function(t,e){return m(n,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return[4,this.getSnapshot(t,e)];case 1:return[2,n.sent()]}}))}))},e.getSnapshotBlob=function(t,e){return m(n,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return[4,this.getSnapshotBlob(t,e)];case 1:return[2,n.sent()]}}))}))},e.getSnapshotBase64=function(t,e){return m(n,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return[4,this.getSnapshotBase64(t,e)];case 1:return[2,n.sent()]}}))}))}}return t.prototype.getSvgRootElement=function(t){return t.container.querySelector(".lf-canvas-overlay")},t.prototype.triggerDownload=function(t){var e=new MouseEvent("click",{view:document.defaultView,bubbles:!1,cancelable:!0}),n=document.createElement("a");n.setAttribute("download",this.fileName),n.setAttribute("href",t),n.setAttribute("target","_blank"),n.dispatchEvent(e)},t.prototype.removeAnchor=function(t){for(var e=t.childNodes,n=t.childNodes&&t.childNodes.length,o=0;o<n;o++){var i=e[o];(i.classList&&Array.from(i.classList)||[]).indexOf("lf-anchor")>-1&&(t.removeChild(t.childNodes[o]),n--,o--)}},t.prototype.removeRotateControl=function(t){for(var e=t.childNodes,n=t.childNodes&&t.childNodes.length,o=0;o<n;o++){var i=e[o];(i.classList&&Array.from(i.classList)||[]).indexOf("lf-rotate-control")>-1&&(t.removeChild(t.childNodes[o]),n--,o--)}},t.prototype.getSnapshot=function(t,e){return m(this,void 0,void 0,(function(){var n,o,i,r,a=this;return b(this,(function(s){switch(s.label){case 0:return n=this.lf.graphModel.getPartial(),o=(null!=e?e:{}).partial,i=void 0===o?n:o,r=this.lf.getEditConfig(),this.lf.updateEditConfig({isSilentMode:!0,stopScrollGraph:!0,stopMoveGraph:!0}),n===i?[3,1]:(this.lf.graphModel.setPartial(i),this.lf.graphModel.eventCenter.once("graph:updated",(function(){return m(a,void 0,void 0,(function(){return b(this,(function(o){switch(o.label){case 0:return[4,this.snapshot(t,e)];case 1:return o.sent(),this.lf.graphModel.setPartial(n),[2]}}))}))})),[3,3]);case 1:return[4,this.snapshot(t,e)];case 2:s.sent(),s.label=3;case 3:return this.lf.updateEditConfig(r),[2]}}))}))},t.prototype.snapshot=function(t,e){return m(this,void 0,void 0,(function(){var n,o,i,r,a,s,l,u,c,d=this;return b(this,(function(h){switch(h.label){case 0:return o=(n=null!=e?e:{}).fileType,i=void 0===o?"png":o,r=n.quality,this.fileName="".concat(null!=t?t:"logic-flow.".concat(Date.now()),".").concat(i),[4,vS(a=this.getSvgRootElement(this.lf))];case 1:return h.sent(),"svg"===i?(s=this.cloneSvg(a),l=(new XMLSerializer).serializeToString(s),u=new Blob([l],{type:"image/svg+xml;charset=utf-8"}),c=URL.createObjectURL(u),this.triggerDownload(c)):this.getCanvasData(a,null!=e?e:{}).then((function(t){var e=t.toDataURL("image/".concat(i),r).replace("image/".concat(i),"image/octet-stream");d.triggerDownload(e)})),[2]}}))}))},t.prototype.getSnapshotBase64=function(t,e){return m(this,void 0,void 0,(function(){var n,o=this;return b(this,(function(i){switch(i.label){case 0:return[4,vS(n=this.getSvgRootElement(this.lf))];case 1:return i.sent(),[2,new Promise((function(i){o.getCanvasData(n,{backgroundColor:t}).then((function(t){var n=t.toDataURL("image/".concat(null!=e?e:"png"));i({data:n,width:t.width,height:t.height})}))}))]}}))}))},t.prototype.getSnapshotBlob=function(t,e){return m(this,void 0,void 0,(function(){var n,o=this;return b(this,(function(i){switch(i.label){case 0:return[4,vS(n=this.getSvgRootElement(this.lf))];case 1:return i.sent(),[2,new Promise((function(i){o.getCanvasData(n,{backgroundColor:t}).then((function(t){t.toBlob((function(e){i({data:e,width:t.width,height:t.height})}),"image/".concat(null!=e?e:"png"))}))}))]}}))}))},t.prototype.getClassRules=function(){var t="";if(this.useGlobalRules)for(var e=document.styleSheets,n=0;n<e.length;n++){var o=e[n];try{for(var i=0;i<o.cssRules.length;i++)t+=o.cssRules[i].cssText}catch(t){console.log("CSS scripts from different sources have been filtered out")}}return this.customCssRules&&(t+=this.customCssRules),t},t.prototype.getCanvasData=function(t,e){return m(this,void 0,void 0,(function(){var n,o,i,r,a,s,l,u,c,d,h,p,f,g,v,y,m,x,_,E,w,S,C,N,T,A;return b(this,(function(b){return n=e.width,o=e.height,i=e.backgroundColor,r=e.padding,a=void 0===r?40:r,s=this.cloneSvg(t,!1),(l=window.devicePixelRatio||1)<1&&(l=1),u=this.lf.graphModel.rootEl.querySelector(".lf-base"),c=u.getBoundingClientRect(),d=this.lf.container.querySelector(".lf-canvas-overlay"),h=d.getBoundingClientRect(),p=c.x-h.x,f=c.y-h.y,g=this.lf.graphModel,v=g.transformModel,y=v.SCALE_X,m=v.SCALE_Y,x=v.TRANSLATE_X,_=v.TRANSLATE_Y,s.lastChild.style.transform="matrix(1, 0, 0, 1, ".concat((-p+x)*(1/y),", ").concat((-f+_)*(1/m),")"),E=Math.ceil(c.width/y),w=Math.ceil(c.height/m),(S=document.createElement("canvas")).style.width="".concat(E,"px"),S.style.height="".concat(w,"px"),S.width=E*l+2*a,S.height=w*l+2*a,(C=S.getContext("2d"))&&(C.clearRect(0,0,S.width,S.height),C.scale(l,l),i?(C.fillStyle=i,C.fillRect(0,0,S.width,S.height)):C.clearRect(0,0,S.width,S.height)),N=new Image,(T=document.createElement("style")).innerHTML=this.getClassRules(),(A=document.createElement("foreignObject")).appendChild(T),s.appendChild(A),[2,new Promise((function(t){N.onload=function(){var e=navigator.userAgent.indexOf("Firefox")>-1;try{e?createImageBitmap(N,{resizeWidth:n&&o?yS(S,n,o).width:S.width,resizeHeight:n&&o?yS(S,n,o).height:S.height}).then((function(e){null==C||C.drawImage(e,a/l,a/l),t(n&&o?yS(S,n,o):S)})):(null==C||C.drawImage(N,a/l,a/l),t(n&&o?yS(S,n,o):S))}catch(e){null==C||C.drawImage(N,a/l,a/l),t(n&&o?yS(S,n,o):S)}};var e="data:image/svg+xml;charset=utf-8,".concat((new XMLSerializer).serializeToString(s)).replace(/\n/g,"").replace(/\t/g,"").replace(/#/g,"%23");N.src=e}))]}))}))},t.prototype.cloneSvg=function(t,e){var n,o=this;void 0===e&&(e=!0);var i=t.cloneNode(!0),r=i.lastChild,a=null===(n=null==r?void 0:r.childNodes)||void 0===n?void 0:n.length;if(a)for(var s=0;s<a;s++){var l=null==r?void 0:r.childNodes[s],u=l.classList&&Array.from(l.classList);if(u&&u.indexOf("lf-base")<0)null==r||r.removeChild(r.childNodes[s]),a--,s--;else{var c=null==r?void 0:r.childNodes[s];c&&c.childNodes.forEach((function(t){var e=t;o.removeAnchor(e.firstChild),o.removeRotateControl(e.firstChild)}))}}if(e){var d=document.createElement("style");d.innerHTML=this.getClassRules();var h=document.createElement("foreignObject");h.appendChild(d),i.appendChild(h)}return i},t.pluginName="snapshot",t}(),bS=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.paths=[],e.getPathes=function(){if(!n.startNodeType)throw new Error("需要预先指定开始节点类型");return n.getPathes()},e.setRawPaths=function(t){n.setPathes(t)},e.getRawPathes=function(){return n.paths},e.setStartNodeType=function(t){n.startNodeType=t}}return t.prototype.setPathes=function(t){this.paths=t.map((function(t){return{routeId:t.routeId,name:t.name,elements:t.elements,type:t.type,similarElement:null,weight:0}}))},t.prototype.getPathes=function(){var t=this,e=this.lf.getGraphRawData(),n=new Map,o=[];e.nodes.forEach((function(e){n.set(e.id,{id:e.id,data:e,nextNodes:[]}),e.type===t.startNodeType&&o.push(e.id)})),e.edges.forEach((function(t){var e=n.get(t.sourceNodeId);null==e||e.nextNodes.push(t.targetNodeId)}));var i=[];return o.forEach((function(e){var o=n.get(e);o&&(i=i.concat(t.findPathElements(o,n,[])))})),this.getNewPathes(i)},t.prototype.findPathElements=function(t,e,n){void 0===n&&(n=[]);var o=E([],_(n),!1);if(o.push(t.id),0===t.nextNodes.length)return[o];for(var i=[],r=0;r<t.nextNodes.length;r++){var a=e.get(t.nextNodes[r]),s=void 0;if(a){var l=o.indexOf(a.id);s=-1!==l?[E(E([],_(o.slice(l)),!1),[a.id],!1)]:this.findPathElements(a,e,E([],_(o),!1)),i=i.concat(s)}}return i},t.prototype.getNewPathes=function(t){var e=this,n=[],o=new Set;t.forEach((function(t){var i=e.getNewId("path"),r=e.getNewId("路径"),a=e.isLoopPath(t),s=t.join(",");o.has(s)||(o.add(s),n.push({routeId:i,name:r,elements:t,type:a,weight:0,similarElement:""}))}));var i=JSON.parse(JSON.stringify(this.paths));return n.forEach((function(t){for(var n=0;n<i.length;n++){var o=i[n],r=e.similar2Path(E([],_(t.elements),!1),E([],_(o.elements),!1));r>t.weight&&o.weight<=r&&(t.weight=r,t.similarElement=o,r===o.weight&&o.similarElement?(o.similarElement.similarElement=null,o.similarElement.weight=0,o.similarElement=null,o.weight=0):(o.similarElement=t,o.weight=r))}})),n.forEach((function(t){t.similarElement&&t.similarElement.similarElement===t&&(t.routeId=t.similarElement.routeId,t.name=t.similarElement.name),delete t.similarElement,delete t.weight})),this.setPathes(n),n},t.prototype.similar2Path=function(t,e){var n=0,o=t.length+e.length;t.sort(),e.sort();for(var i=t.shift(),r=e.shift();void 0!==i&&void 0!==r;)i===r?(n++,i=t.shift(),r=e.shift()):i<r?i=t.shift():i>r&&(r=e.shift());return n/o*200},t.prototype.getNewId=function(t){return"".concat(t,"_").concat(C())},t.prototype.isLoopPath=function(t){var e=t.length;return t.indexOf(t[e-1])!==e-1?1:0},t.pluginName="flowPath",t}(),xS=-1,_S=0,ES=1,wS=function(){function t(t){var e=t.lf,n=this;this.levelHeight=[],this.newNodeMap=new Map,this.lf=e,this.trunk=[],e.layout=function(t){var e=n.lf.getGraphRawData();n.lf.setStartNodeType(t);var o=n.lf.getPathes();return n.levelHeight=[],n.newNodeMap=new Map,n.layout(e,o)}}return t.prototype.layout=function(t,e){var n=this,o=[];e.forEach((function(t){var e=t.elements;e.length>o.length?o=e:e.length===o.length&&JSON.stringify(e)===JSON.stringify(n.trunk)&&(o=n.trunk)})),this.trunk=o;for(var i=this.formatData(t),r={nodes:[],edges:[]},a=o.length-1;a>=0;a--)this.setNodePosition(o[a],i,r,a,1);this.lf.graphModel.graphDataToModel(r)},t.prototype.setNodePosition=function(t,e,n,o,i){var r=this,a=e[t],s=a.text,l=a.type,u=a.next,c=a.properties,d=160*o+40,h=120*i,p={id:t,x:d,text:s,y:h,type:l,properties:c};return s&&"object"==typeof s&&(p.text=g(g({},s),{x:d+s.x,y:h+s.y})),this.newNodeMap.set(p.id,{x:p.x,y:p.y,type:l}),n.nodes.push(p),a.isFixed=!0,this.addLevelHeight(o,1),u&&u.length>0&&u.forEach((function(i){if(!e[i.nodeId].isFixed){var a=r.getLevelHeight(o+1);r.addLevelHeight(o,1),r.setNodePosition(i.nodeId,e,n,o+1,a+1)}n.edges.push(g({id:i.edgeId,type:i.edgeType,sourceNodeId:t,targetNodeId:i.nodeId,properties:i.properties,text:i.text},r.getEdgeDataPoints(t,i.nodeId)))})),p},t.prototype.getEdgeDataPoints=function(t,e){var n=this.newNodeMap.get(t),o=this.newNodeMap.get(e),i=this.getShape(t),r=i.width,a=i.height,s=this.getShape(e),l=s.width,u=s.height,c=this.getRelativePosition(n,o),d={x:n.x,y:n.y},h={x:o.x,y:o.y};switch(c){case _S:d.x=n.x+r/2,h.x=o.x-l/2;break;case xS:d.y=n.y+a/2,h.x=o.x-l/2;break;case ES:d.x=n.x+r/2,h.y=o.y+u/2}return{startPoint:d,endPoint:h}},t.prototype.getRelativePosition=function(t,e){var n=t.y,o=e.y;return n<o?-1:n===o?0:1},t.prototype.getShape=function(t){var e,n,o=this.lf.getNodeModelById(t);return{height:null!==(e=null==o?void 0:o.height)&&void 0!==e?e:0,width:null!==(n=null==o?void 0:o.width)&&void 0!==n?n:0}},t.prototype.formatData=function(t){var e=t.nodes.reduce((function(t,e){var n=e.type,o=e.properties,i=e.text,r=e.x,a=e.y;return i&&"object"==typeof i&&(i.x=i.x-r,i.y=i.y-a),t[e.id]={type:n,properties:o,text:i,prev:[],next:[]},t}),{});return t.edges.forEach((function(t){var n=t.sourceNodeId,o=t.targetNodeId,i=t.id,r=t.properties,a=t.text,s=a;"object"==typeof a&&(s=a.value),e[n].next.push({edgeId:i,nodeId:o,edgeType:t.type,properties:r,text:s}),e[o].prev.push({edgeId:i,nodeId:n,properties:r,text:s})})),e},t.prototype.addLevelHeight=function(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);var o=this.levelHeight[t];o||(o={positiveHeight:0,negativeHeight:0},this.levelHeight[t]=o),n?o.negativeHeight-=e:o.positiveHeight+=e},t.prototype.getLevelHeight=function(t,e){void 0===e&&(e=!1);var n=this.levelHeight[t];return n?e?n.negativeHeight:n.positiveHeight:0},t.pluginName="AutoLayout",t}(),SS=function(){function t(t){var e=t.lf,n=this;this.controlItems=[{key:"zoom-out",iconClass:"lf-control-zoomOut",title:"缩小流程图",text:"缩小",onClick:function(){n.lf.zoom(!1)}},{key:"zoom-in",iconClass:"lf-control-zoomIn",title:"放大流程图",text:"放大",onClick:function(){n.lf.zoom(!0)}},{key:"reset",iconClass:"lf-control-fit",title:"恢复流程原有尺寸",text:"适应",onClick:function(){n.lf.resetZoom()}},{key:"undo",iconClass:"lf-control-undo",title:"回到上一步",text:"上一步",onClick:function(){n.lf.undo()}},{key:"redo",iconClass:"lf-control-redo",title:"移到下一步",text:"下一步",onClick:function(){n.lf.redo()}}],this.lf=e}return t.prototype.render=function(t,e){this.destroy();var n=this.getControlTool();this.toolEl=n,e.appendChild(n),this.domContainer=e},t.prototype.destroy=function(){this.domContainer&&this.toolEl&&this.domContainer.contains(this.toolEl)&&this.domContainer.removeChild(this.toolEl)},t.prototype.addItem=function(t){this.controlItems.push(t)},t.prototype.removeItem=function(t){var e=this.controlItems.findIndex((function(e){return e.key===t}));return-1==e?null:this.controlItems.splice(e,1)[0]},t.prototype.getControlTool=function(){var t=this,e="lf-control-item",n="lf-control-item disabled",o=document.createElement("div"),i=[];return o.className="lf-control",this.controlItems.forEach((function(o){var r=document.createElement("div"),a=document.createElement("i"),s=document.createElement("span");switch(r.className=n,o.onClick&&(r.onclick=o.onClick.bind(null,t.lf)),o.onMouseEnter&&(r.onmouseenter=o.onMouseEnter.bind(null,t.lf)),o.onMouseLeave&&(r.onmouseleave=o.onMouseLeave.bind(null,t.lf)),a.className=o.iconClass,s.className="lf-control-text",s.title=o.title,s.innerText=o.text,r.append(a,s),o.text){case"上一步":t.lf.on("history:change",(function(t){var o=t.data.undoAble;r.className=o?e:n}));break;case"下一步":t.lf.on("history:change",(function(t){var o=t.data.redoAble;r.className=o?e:n}));break;default:r.className=e}i.push(r)})),o.append.apply(o,E([],_(i),!1)),o},t.pluginName="control",t}(),CS="lf:defaultNodeMenu",NS="lf:defaultEdgeMenu",TS="lf:defaultGraphMenu",AS="lf:defaultSelectionMenu",MS=function(){function t(t){var e=t.lf,n=this;this.__currentData=null,this.lf=e,e.options.isSilentMode||(this.__menuDOM=document.createElement("ul"),this.menuTypeMap=new Map,this.init(),this.lf.setMenuConfig=function(t){n.setMenuConfig(t)},this.lf.addMenuConfig=function(t){n.addMenuConfig(t)},this.lf.setMenuByType=function(t){n.setMenuByType(t)})}return t.prototype.init=function(){var t,e,n,o,i=this,r=[{text:"删除",callback:function(t){i.lf.deleteNode(t.id)}},{text:"编辑文本",callback:function(t){i.lf.graphModel.editText(t.id)}},{text:"复制",callback:function(t){i.lf.cloneNode(t.id)}}];null===(t=this.menuTypeMap)||void 0===t||t.set(CS,r);var a=[{text:"删除",callback:function(t){i.lf.deleteEdge(t.id)}},{text:"编辑文本",callback:function(t){i.lf.graphModel.editText(t.id)}}];null===(e=this.menuTypeMap)||void 0===e||e.set(NS,a),null===(n=this.menuTypeMap)||void 0===n||n.set(TS,[]);var s=[{text:"删除",callback:function(t){i.lf.clearSelectElements(),t.edges.forEach((function(t){return i.lf.deleteEdge(t.id)})),t.nodes.forEach((function(t){return i.lf.deleteNode(t.id)}))}}];null===(o=this.menuTypeMap)||void 0===o||o.set(AS,s)},t.prototype.render=function(t,e){var n=this;t.options.isSilentMode||(this.__container=e,this.__currentData=null,this.__menuDOM&&(this.__menuDOM.className="lf-menu",e.appendChild(this.__menuDOM),this.__menuDOM.addEventListener("click",(function(t){t.stopPropagation();for(var e=t.target;-1===Array.from(e.classList).indexOf("lf-menu-item")&&-1===Array.from(e.classList).indexOf("lf-menu");)e=null==e?void 0:e.parentElement;Array.from(e.classList).indexOf("lf-menu-item")>-1?(e.onclickCallback(n.__currentData),n.__menuDOM&&(n.__menuDOM.style.display="none"),n.__currentData=null):console.warn("点击区域不在菜单项内,请检查代码!")}),!0)),this.lf.on("node:contextmenu",(function(t){var e,o,i=t.data,r=t.position,a=t.e,s=r.domOverlayPosition,l=s.x,u=s.y,c=i.id,d=n.lf.graphModel.getNodeModelById(c);if(d){var h=[],p=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(d.type);h=d&&d.menu&&Array.isArray(d.menu)?d.menu:p||(null===(o=n.menuTypeMap)||void 0===o?void 0:o.get(CS)),n.__currentData=i,n.showMenu(l,u,h,{width:d.width,height:d.height,clientX:a.clientX,clientY:a.clientY})}})),this.lf.on("edge:contextmenu",(function(t){var e,o,i,r=t.data,a=t.position,s=t.e,l=a.domOverlayPosition,u=l.x,c=l.y,d=r.id,h=n.lf.graphModel.getEdgeModelById(d);if(h){var p=[],f=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(h.type);p=h&&h.menu&&Array.isArray(h.menu)?h.menu:f||(null!==(i=null===(o=n.menuTypeMap)||void 0===o?void 0:o.get(NS))&&void 0!==i?i:[]),n.__currentData=r,n.showMenu(u,c,p,{width:h.width,height:h.height,clientX:s.clientX,clientY:s.clientY})}})),this.lf.on("blank:contextmenu",(function(t){var e,o,i=t.position,r=null!==(o=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(TS))&&void 0!==o?o:[],a=i.domOverlayPosition,s=a.x,l=a.y;n.showMenu(s,l,r)})),this.lf.on("selection:contextmenu",(function(t){var e,o=t.data,i=t.position,r=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(AS),a=i.domOverlayPosition,s=a.x,l=a.y;n.__currentData=o,n.showMenu(s,l,r)})),this.lf.on("node:mousedown",(function(){n.__menuDOM.style.display="none"})),this.lf.on("edge:click",(function(){n.__menuDOM.style.display="none"})),this.lf.on("blank:click",(function(){n.__menuDOM.style.display="none"})))},t.prototype.destroy=function(){var t;this.__menuDOM&&(null===(t=null==this?void 0:this.__container)||void 0===t||t.removeChild(this.__menuDOM),this.__menuDOM=void 0)},t.prototype.showMenu=function(t,e,n,o){if(n&&n.length){var i=this.__menuDOM;if(i){if(i.innerHTML="",i.append.apply(i,E([],_(this.__getMenuDom(n)),!1)),!i.children.length)return;if(i.style.display="block",!o)return i.style.top="".concat(e,"px"),void(i.style.left="".concat(t,"px"));var r=o.width,a=o.height,s=o.clientX,l=o.clientY,u=this.lf.graphModel,c=i.offsetWidth,d=!0,h=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,p=h-s,f=u.rootEl.getBoundingClientRect(),g=f.left+f.width;g<h&&(p=g-s),p<c&&(d=!1),i.style.left="".concat(d?t:t-r,"px");var v=i.offsetHeight,y=!0,m=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,b=m-l,x=f.top+f.height;x<m&&(b=x-l),b<v&&(y=!1),i.style.top="".concat(y?e:e-a,"px")}}},t.prototype.setMenuByType=function(t){var e;t.type&&t.menu&&(null===(e=this.menuTypeMap)||void 0===e||e.set(t.type,t.menu))},t.prototype.__getMenuDom=function(t){var e=[];return t&&t.length>0&&t.forEach((function(t){var n=document.createElement("li");if(t.className?n.className="lf-menu-item ".concat(t.className):n.className="lf-menu-item",!0===t.icon){var o=document.createElement("span");o.className="lf-menu-item-icon",n.appendChild(o)}var i=document.createElement("span");i.className="lf-menu-item-text",t.text&&(i.innerText=t.text),n.appendChild(i),n.onclickCallback=t.callback,e.push(n)})),e},t.prototype.setMenuConfig=function(t){var e,n,o;t&&(void 0!==t.nodeMenu&&(null===(e=this.menuTypeMap)||void 0===e||e.set(CS,t.nodeMenu?t.nodeMenu:[])),void 0!==t.edgeMenu&&(null===(n=this.menuTypeMap)||void 0===n||n.set(NS,t.edgeMenu?t.edgeMenu:[])),void 0!==t.graphMenu&&(null===(o=this.menuTypeMap)||void 0===o||o.set(TS,t.graphMenu?t.graphMenu:[])))},t.prototype.addMenuConfig=function(t){var e,n,o,i,r,a,s,l,u;if(t){if(Array.isArray(t.nodeMenu)){var c=null!==(n=null===(e=this.menuTypeMap)||void 0===e?void 0:e.get(CS))&&void 0!==n?n:[];null===(o=this.menuTypeMap)||void 0===o||o.set(CS,c.concat(t.nodeMenu))}if(Array.isArray(t.edgeMenu)){c=null!==(r=null===(i=this.menuTypeMap)||void 0===i?void 0:i.get(NS))&&void 0!==r?r:[];null===(a=this.menuTypeMap)||void 0===a||a.set(NS,c.concat(t.edgeMenu))}if(Array.isArray(t.graphMenu)){c=null!==(l=null===(s=this.menuTypeMap)||void 0===s?void 0:s.get(TS))&&void 0!==l?l:[];null===(u=this.menuTypeMap)||void 0===u||u.set(TS,c.concat(t.graphMenu))}}},t.prototype.changeMenuItem=function(t,e){if("add"===t)this.addMenuConfig(e);else{if("reset"!==t)throw new Error("The first parameter of changeMenuConfig should be 'add' or 'reset'");this.setMenuConfig(e)}},t.pluginName="menu",t}(),OS="menu-common",PS=function(){function t(t){var e=t.lf,n=this;this.menuTypeMap=new Map,this.listenDelete=function(){n.hideContextMenu()},this.lf=e,this.__menuDOM=document.createElement("div"),this.__menuDOM.className="lf-inner-context",this.menuTypeMap.set(OS,[]),this.lf.setContextMenuByType=function(t,e){n.setContextMenuByType(t,e)},this.lf.setContextMenuItems=function(t){n.setContextMenuItems(t)},this.lf.showContextMenu=function(t){n.showContextMenu(t)},this.lf.hideContextMenu=function(){n.hideContextMenu()}}return t.prototype.render=function(t,e){var n=this;this.container=e,t.on("node:click",(function(t){var e=t.data;n._activeData=e,n.createContextMenu()})),t.on("edge:click",(function(t){var e=t.data;n._activeData=e,n.createContextMenu()})),t.on("blank:click",(function(){n.hideContextMenu()}))},t.prototype.setContextMenuByType=function(t,e){this.menuTypeMap.set(t,e)},t.prototype.hideContextMenu=function(){this.__menuDOM.innerHTML="",this.__menuDOM.style.display="none",this.isShow&&this.container.removeChild(this.__menuDOM),this.lf.off("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!1},t.prototype.showContextMenu=function(t){t&&t.id?(this._activeData=t,this.createContextMenu()):console.warn("请检查传入的参数")},t.prototype.setContextMenuItems=function(t){this.menuTypeMap.set(OS,t)},t.prototype.getContextMenuPosition=function(){var t=this._activeData,e=this.lf.graphModel.getElement(t.id);if(e){var n,o;if("edge"===e.BaseType){n=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER;var i=e.getData();n=Math.max(i.startPoint.x,n),o=Math.min(i.startPoint.y,o),n=Math.max(i.endPoint.x,n),o=Math.min(i.endPoint.y,o),i.pointsList&&i.pointsList.forEach((function(t){n=Math.max(t.x,n),o=Math.min(t.y,o)}))}return"node"===e.BaseType&&(n=t.x+e.width/2,o=t.y-e.height/2),this.lf.graphModel.transformModel.CanvasPointToHtmlPoint([n,o])}},t.prototype.createContextMenu=function(){var t=this;if(!this.lf.options.isSilentMode){var e=E(E([],_(this.menuTypeMap.get(this._activeData.type)||[]),!1),_(this.menuTypeMap.get(OS)||[]),!1),n=document.createDocumentFragment();e.forEach((function(e){var o=document.createElement("div");o.className="lf-context-item";var i=document.createElement("img");i.src=e.icon,i.className="lf-context-img",e.className&&(o.className="".concat(o.className," ").concat(e.className)),i.addEventListener("click",(function(){t.hideContextMenu(),e.callback?e.callback(t._activeData):t.addNode({sourceId:t._activeData.id,x:t._activeData.x,y:t._activeData.y,properties:e.properties,type:e.type})})),o.appendChild(i),n.appendChild(o)})),this.__menuDOM.innerHTML="",this.__menuDOM.appendChild(n),this.showMenu()}},t.prototype.addNode=function(t,e){var n=void 0!==e;void 0===e&&(e=t.y);var o=this.lf.getNodeModelById(t.sourceId);if(o){var i=t.x-o.width+200,r=e-t.y/2-20,a=t.x+o.width+200,s=e+t.y/2+20;if(this.lf.getAreaElement([i,r],[a,s]).length)return e+=100,void this.addNode(t,e);if(t.type){var l=this.lf.addNode({type:t.type,x:t.x+200,y:e,properties:t.properties}),u=void 0,c=void 0;n&&(u={x:t.x,y:t.y+o.height/2},c={x:l.x-l.width/2,y:l.y}),this.lf.addEdge({sourceNodeId:t.sourceId,targetNodeId:l.id,startPoint:u,endPoint:c})}}},t.prototype.showMenu=function(){var t=this.getContextMenuPosition();if(t){var e=_(t,2),n=e[0],o=e[1];this.__menuDOM.style.display="flex",this.__menuDOM.style.top="".concat(o,"px"),this.__menuDOM.style.left="".concat(n+10,"px"),this.container.appendChild(this.__menuDOM),!this.isShow&&this.lf.on("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!0}},t.pluginName="contextMenu",t}(),kS=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.lf.setPatternItems=function(t){n.setPatternItems(t)}}return t.prototype.render=function(t,e){var n=this;this.destroy(),this.shapeList&&0!==this.shapeList.length?(this.panelEl=document.createElement("div"),this.panelEl.className="lf-dndpanel",this.shapeList.forEach((function(t){var e;null===(e=n.panelEl)||void 0===e||e.appendChild(n.createDndItem(t))})),e.appendChild(this.panelEl),this.domContainer=e):this.domContainer=e},t.prototype.destroy=function(){this.domContainer&&this.panelEl&&this.domContainer.contains(this.panelEl)&&this.domContainer.removeChild(this.panelEl)},t.prototype.setPatternItems=function(t){this.shapeList=t,this.domContainer&&this.render(this.lf,this.domContainer)},t.prototype.createDndItem=function(t){var e=this,n=document.createElement("div");n.className=t.className?"lf-dnd-item ".concat(t.className):"lf-dnd-item";var o=document.createElement("div");if(o.className="lf-dnd-shape",t.icon&&(o.style.backgroundImage="url(".concat(t.icon,")")),n.appendChild(o),t.label){var i=document.createElement("div");i.innerText=t.label,i.className="lf-dnd-text",n.appendChild(i)}return t.disabled?(n.classList.add("disabled"),n.onmousedown=function(){t.callback&&t.callback(e.lf,e.domContainer)},n):(n.onmousedown=function(){t.type&&e.lf.dnd.startDrag({type:t.type,properties:t.properties,text:t.text}),t.callback&&t.callback(e.lf,e.domContainer)},n.ondblclick=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-dbclick",{e:n,data:t})},n.onclick=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-click",{e:n,data:t})},n.oncontextmenu=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-contextmenu",{e:n,data:t})},n)},t.pluginName="dndPanel",t}(),RS=function(){function t(t){var e=t.lf,n=t.LogicFlow,o=t.options,i=this;this.width=200,this.height=150,this.scale=1,this.translateX=0,this.translateY=0,this.showEdge=!1,this.viewPortTop=0,this.viewPortLeft=0,this.viewPortWidth=150,this.viewPortHeight=75,this.isShow=!1,this.isShowHeader=!1,this.isShowCloseIcon=!1,this.headerTitle="导航",this.disabledPlugins=["miniMap","control","selectionSelect"],this.render=function(t,e){i.container=e,i.lf.on("history:change",(function(){i.isShow&&i.setView()})),i.lf.on("graph:transform",(function(){i.isShow&&i.setView(!1)}))},this.show=function(t,e){i.isShow||(i.createMiniMap(t,e),i.setView()),i.isShow=!0},this.hide=function(){i.isShow&&(i.removeMiniMap(),i.lf.emit("miniMap:close",{})),i.isShow=!1},this.updatePosition=function(t){if("object"==typeof t)void 0===t.left&&void 0===t.right||(i.leftPosition=t.left,i.rightPosition=t.right),void 0===t.top&&void 0===t.bottom||(i.topPosition=t.top,i.bottomPosition=t.bottom);else switch(t){case"left-top":i.leftPosition=0,i.rightPosition=void 0,i.topPosition=0,i.bottomPosition=void 0;break;case"right-top":i.leftPosition=void 0,i.rightPosition=0,i.topPosition=0,i.bottomPosition=void 0;break;case"left-bottom":i.leftPosition=0,i.rightPosition=void 0,i.topPosition=void 0,i.bottomPosition=0;break;case"right-bottom":i.leftPosition=void 0,i.rightPosition=0,i.topPosition=void 0,i.bottomPosition=0}i.updateMiniMapPosition()},this.reset=function(){i.lf.resetTranslate(),i.lf.resetZoom()},this.setShowEdge=function(t){i.showEdge!==t&&(i.showEdge=t,i.setView())},this.startDrag=function(t){document.addEventListener("mousemove",i.drag),document.addEventListener("mouseup",i.drop);var e=t.x,n=t.y;i.startPosition={x:e,y:n}},this.drag=function(t){var e=t.x,n=t.y,o=(e-i.startPosition.x)/i.scale,r=(n-i.startPosition.y)/i.scale,a=i.viewPortLeft+o+i.viewPortWidth/i.scale/2,s=i.viewPortTop+r+i.viewPortHeight/i.scale/2;i.startPosition={x:e,y:n},i.lf.focusOn({coordinate:{x:a,y:s}})},this.drop=function(){document.removeEventListener("mousemove",i.drag),document.removeEventListener("mouseup",i.drop)},this.mapClick=function(t){var e=t.offsetX,n=t.offsetY,o=i.translateX+e/i.scale,r=i.translateY+n/i.scale;i.lf.focusOn({coordinate:{x:o,y:r}})},this.lf=e,this.LFCtor=n,o&&this.setOption(o),this.viewPortWidth=e.graphModel.width,this.viewPortHeight=e.graphModel.height;var r={left:0,right:this.viewPortWidth,top:0,bottom:this.viewPortHeight};this.bounds=r,this.elementAreaBounds=r,this.viewPortBounds=r,this.initMiniMap()}return t.prototype.setOption=function(t){var e=t.width,n=void 0===e?150:e,o=t.height,i=void 0===o?220:o,r=t.showEdge,a=void 0!==r&&r,s=t.isShowHeader,l=void 0!==s&&s,u=t.isShowCloseIcon,c=void 0!==u&&u,d=t.leftPosition,h=t.topPosition,p=t.rightPosition,f=void 0===p?0:p,g=t.bottomPosition,v=void 0===g?0:g,y=t.headerTitle,m=void 0===y?"导航":y;this.width=n,this.height=i,this.showEdge=a,this.isShowHeader=l,this.isShowCloseIcon=c,this.leftPosition=d,this.rightPosition=void 0!==d?void 0:f,this.topPosition=h,this.bottomPosition=void 0!==h?void 0:v,this.headerTitle=m},t.prototype.initMiniMap=function(){var t=document.createElement("div");t.className="lf-mini-map-graph",t.style.width="".concat(this.width,"px"),t.style.height="".concat(this.height,"px"),this.lfMap=new this.LFCtor({container:t,grid:!1,isSilentMode:!0,stopZoomGraph:!0,stopScrollGraph:!0,stopMoveGraph:!1,history:!1,snapline:!1,disabledPlugins:this.disabledPlugins}),this.miniMapWrap=t,this.createViewPort(),t.addEventListener("click",this.mapClick)},t.prototype.createMiniMap=function(t,e){var n,o=document.createElement("div");this.miniMapContainer=o,o.appendChild(this.miniMapWrap),o.style.position="absolute",void 0===t&&void 0===e||(this.leftPosition=t||0,this.topPosition=e||0,this.rightPosition=void 0,this.bottomPosition=void 0),this.updateMiniMapPosition(),o.className="lf-mini-map",this.isShowCloseIcon||o.classList.add("lf-mini-map-no-close-icon"),this.isShowHeader||o.classList.add("lf-mini-map-no-header"),null===(n=this.container)||void 0===n||n.appendChild(o),this.miniMapWrap.appendChild(this.viewport);var i=document.createElement("div");i.className="lf-mini-map-header",i.innerText=this.headerTitle,o.appendChild(i);var r=document.createElement("span");r.className="lf-mini-map-close",r.addEventListener("click",this.hide),o.appendChild(r)},t.prototype.updateMiniMapPosition=function(){if(this.miniMapContainer){var t=this.miniMapContainer.style;void 0!==this.rightPosition?(t.right="".concat(this.rightPosition,"px"),t.left=""):(t.left="".concat(this.leftPosition,"px"),t.right=""),void 0!==this.bottomPosition?(t.bottom="".concat(this.bottomPosition,"px"),t.top=""):(t.top="".concat(this.topPosition,"px"),t.bottom="")}},t.prototype.removeMiniMap=function(){var t;this.miniMapContainer&&(null===(t=this.container)||void 0===t||t.removeChild(this.miniMapContainer))},t.prototype.updateBounds=function(t){t&&this.updateElementAreaBounds(t),this.updateViewPortBounds(),this.bounds={left:Math.min(this.elementAreaBounds.left,this.viewPortBounds.left),right:Math.max(this.elementAreaBounds.right,this.viewPortBounds.right),top:Math.min(this.elementAreaBounds.top,this.viewPortBounds.top),bottom:Math.max(this.elementAreaBounds.bottom,this.viewPortBounds.bottom)}},t.prototype.updateElementAreaBounds=function(t){var e={left:0,right:0,top:0,bottom:0},n=t.nodes;n&&n.length>0&&n.forEach((function(t){var n,o,i=t.x,r=t.y,a=null!==(n=t.width)&&void 0!==n?n:200,s=null!==(o=t.height)&&void 0!==o?o:200,l=i-a/2,u=i+a/2,c=r-s/2,d=r+s/2;e.left=Math.min(l,e.left),e.right=Math.max(u,e.right),e.top=Math.min(c,e.top),e.bottom=Math.max(d,e.bottom)})),this.elementAreaBounds=e},t.prototype.updateViewPortBounds=function(){var t=this.lf.getTransform(),e=t.TRANSLATE_X,n=t.TRANSLATE_Y,o=t.SCALE_X,i=t.SCALE_Y,r=this.lf.graphModel,a=r.width,s=r.height;this.viewPortBounds={left:-e/o,right:(-e+a)/o,top:-n/i,bottom:(-n+s)/i}},t.prototype.resetData=function(t){var e=t.nodes,n=t.edges;return e.forEach((function(t){t.text=void 0})),this.showEdge&&n.forEach((function(t){t.text=void 0})),{nodes:e,edges:this.showEdge?n:[]}},t.prototype.setView=function(t){var e,n;if(void 0===t&&(t=!0),t){var o=this.lf.getGraphRawData(),i=this.resetData(o),r=this.lf.viewMap,a=this.lf.graphModel.modelMap,s=this.lfMap.viewMap;try{for(var l=x(r.keys()),u=l.next();!u.done;u=l.next()){var c=u.value;s.has(c)||this.lfMap.register({type:c,view:r.get(c),model:a.get(c)})}}catch(t){e={error:t}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}this.lfMap.render(i),this.updateBounds(i)}else this.updateBounds();var d=this.bounds,h=d.left,p=d.top,f=d.right-h,g=d.bottom-p,v=this.width/f,y=this.height/g,m=Math.min(v,y);this.scale=m;var b=h-(this.width/m-f)/2,_=p-(this.height/m-g)/2;if(this.lfMap.graphModel.transformModel.translate(-b+this.translateX,-_+this.translateY),this.translateX=b,this.translateY=_,this.miniMapWrap.firstChild){var E=this.miniMapWrap.firstChild.style;E.pointerEvents="none",E.transform="matrix(".concat(m,", 0, 0, ").concat(m,", 0, 0)"),E.transformOrigin="left top",E.height="".concat(this.height/m,"px"),E.width="".concat(this.width/m,"px"),this.updateViewPort()}},t.prototype.updateViewPort=function(){var t=this.viewport.style,e=this.lf.getTransform(),n=e.TRANSLATE_X,o=e.TRANSLATE_Y,i=e.SCALE_X,r=e.SCALE_Y,a=this.lf.graphModel,s=a.width,l=a.height;this.viewPortLeft=-n/i,this.viewPortTop=-o/r,this.viewPortWidth=s/i*this.scale,this.viewPortHeight=l/r*this.scale,t.width="".concat(this.viewPortWidth,"px"),t.height="".concat(this.viewPortHeight,"px"),t.left="".concat((this.viewPortLeft-this.translateX)*this.scale,"px"),t.top="".concat((this.viewPortTop-this.translateY)*this.scale,"px")},t.prototype.createViewPort=function(){var t=document.createElement("div");t.className="lf-minimap-viewport",t.addEventListener("mousedown",this.startDrag),t.addEventListener("click",(function(t){t.stopPropagation()})),this.viewport=t},t.pluginName="miniMap",t}(),DS=function(){function t(t){var e=t.lf,n=this;this.disabled=!0,this.isDefaultStopMoveGraph=!1,this.isWholeNode=!0,this.isWholeEdge=!0,this.draw=function(t){var e=n.lf.getPointByClient(t.clientX,t.clientY).domOverlayPosition,o=e.x,i=e.y;if(n.endPoint={x:o,y:i},n.startPoint){var r=n.startPoint,a=r.x,s=r.y,l=a,u=s,c=o-a,d=i-s;o<a&&(l=o,c=a-o),i<s&&(u=i,d=s-i),n.wrapper&&(n.wrapper.style.left="".concat(l,"px"),n.wrapper.style.top="".concat(u,"px"),n.wrapper.style.width="".concat(c,"px"),n.wrapper.style.height="".concat(d,"px"))}},this.drawOff=function(){var t;if(document.removeEventListener("mousemove",n.draw),document.removeEventListener("mouseup",n.drawOff),n.wrapper&&(n.wrapper.oncontextmenu=null,null===(t=n.container)||void 0===t||t.removeChild(n.wrapper)),n.startPoint&&n.endPoint){var e=n.startPoint,o=e.x,i=e.y,r=n.endPoint,a=r.x,s=r.y,l=[Math.min(o,a),Math.min(i,s)],u=[Math.max(o,a),Math.max(i,s)];if(n.lf.emit("selection:selected-area",{topLeft:l,bottomRight:u}),Math.abs(a-o)<10&&Math.abs(s-i)<10)return;var c=n.lf.graphModel.getAreaElement(l,u,n.isWholeEdge,n.isWholeNode,!0),d=n.lf.graphModel,h=d.dynamicGroup,p=d.group;c.forEach((function(t){p&&p.getNodeGroup(t.id)||n.lf.selectElementById(t.id,!0),h&&h.getGroupByNodeId(t.id)||n.lf.selectElementById(t.id,!0)})),n.lf.emit("selection:selected",{elements:c,leftTopPoint:l,rightBottomPoint:u})}},this.lf=e;var o=e.getEditConfig().stopMoveGraph;this.isDefaultStopMoveGraph=o,e.openSelectionSelect=function(){n.openSelectionSelect()},e.closeSelectionSelect=function(){n.closeSelectionSelect()}}return t.prototype.render=function(t,e){var n=this;this.container=e,t.on("blank:mousedown",(function(o){var i=o.e;if(t.getEditConfig().stopMoveGraph&&!n.disabled&&!(2===i.button)){var r=t.getPointByClient(i.clientX,i.clientY).domOverlayPosition,a=r.x,s=r.y;n.startPoint={x:a,y:s},n.endPoint={x:a,y:s};var l=document.createElement("div");l.className="lf-selection-select",l.oncontextmenu=function(t){t.preventDefault()},l.style.top="".concat(n.startPoint.y,"px"),l.style.left="".concat(n.startPoint.x,"px"),e.appendChild(l),n.wrapper=l,document.addEventListener("mousemove",n.draw),document.addEventListener("mouseup",n.drawOff)}}))},t.prototype.setSelectionSense=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0),this.isWholeEdge=t,this.isWholeNode=e},t.prototype.openSelectionSelect=function(){this.lf.getEditConfig().stopMoveGraph||(this.isDefaultStopMoveGraph=!1,this.lf.updateEditConfig({stopMoveGraph:!0})),this.open()},t.prototype.closeSelectionSelect=function(){this.isDefaultStopMoveGraph||this.lf.updateEditConfig({stopMoveGraph:!1}),this.close()},t.prototype.open=function(){this.disabled=!1},t.prototype.close=function(){this.disabled=!0},t.pluginName="selectionSelect",t}(),LS=function(t,e){var n=[],o=[],i=function(t,o,r){t&&(r&&o.unshift.apply(o,E([],_(e.getEdgeModels({sourceNodeId:t.id,targetNodeId:null==r?void 0:r.id}).map((function(t){return t.id}))),!1)),o.includes(t.id)?n.push(o):(o.unshift(t.id),t.incoming.nodes.length?t.incoming.nodes.forEach((function(e){i(e,o.slice(),t)})):n.push(o)))},r=function(t,n,i){t&&(i&&n.push.apply(n,E([],_(e.getEdgeModels({sourceNodeId:null==i?void 0:i.id,targetNodeId:t.id}).map((function(t){return t.id}))),!1)),n.includes(t.id)?o.push(n):(n.push(t.id),t.outgoing.nodes.length?t.outgoing.nodes.forEach((function(e){r(e,n.slice(),t)})):o.push(n)))};return i(t,[]),r(t,[]),E([],_(new Set(E(E([],_(n.flat()),!1),_(o.flat()),!1))),!1)},IS=function(){function t(t){var e=t.lf,n=t.options;this.mode="path",this.enable=!0,this.tempStyles={};var o=n.mode,i=void 0===o?"path":o,r=n.enable,a=void 0===r||r;this.lf=e,this.mode=i,this.enable=a}return t.prototype.setMode=function(t){this.mode=t},t.prototype.setEnable=function(t){this.enable=t},t.prototype.highlightSingle=function(t){var e=this.lf.getModelById(t);"node"===(null==e?void 0:e.BaseType)?e.updateStyles(this.tempStyles[t]):"edge"===(null==e?void 0:e.BaseType)&&(e.updateStyles(this.tempStyles[t]),e.sourceNode.updateStyles(this.tempStyles[e.sourceNode.id]),e.targetNode.updateStyles(this.tempStyles[e.targetNode.id]))},t.prototype.highlightNeighbours=function(t){var e=this,n=this.lf.getModelById(t);if("node"===(null==n?void 0:n.BaseType)){n.updateStyles(this.tempStyles[t]);var o=n.incoming,i=o.nodes,r=o.edges,a=n.outgoing,s=a.nodes,l=a.edges;js(i,s).forEach((function(t){t.updateStyles(e.tempStyles[t.id])})),js(r,l).forEach((function(t){t.updateStyles(e.tempStyles[t.id])}))}else"edge"===(null==n?void 0:n.BaseType)&&(n.updateStyles(this.tempStyles[t]),n.sourceNode.updateStyles(this.tempStyles[n.sourceNode.id]),n.targetNode.updateStyles(this.tempStyles[n.targetNode.id]))},t.prototype.highlightPath=function(t){var e=this,n=function(t,e){var n=e.getModelById(t);return LS("node"===(null==n?void 0:n.BaseType)?n:null==n?void 0:n.targetNode,e)}(t,this.lf);n.forEach((function(t){var n;null===(n=e.lf.getModelById(t))||void 0===n||n.updateStyles(e.tempStyles[t])}))},t.prototype.highlight=function(t,e){var n=this;(void 0===e&&(e=this.mode),this.enable)&&(Object.keys(this.tempStyles).length&&this.restoreHighlight(),Object.values(this.lf.graphModel.modelsMap).forEach((function(t){var e="node"===t.BaseType?t.getNodeStyle():t.getEdgeStyle();n.tempStyles[t.id]=g({},e),t.setStyles({opacity:.1})})),{single:this.highlightSingle.bind(this),neighbour:this.highlightNeighbours.bind(this),path:this.highlightPath.bind(this)}[e](t))},t.prototype.restoreHighlight=function(){var t=this;Object.keys(this.tempStyles).length&&(Object.values(this.lf.graphModel.modelsMap).forEach((function(e){var n,o=null!==(n=t.tempStyles[e.id])&&void 0!==n?n:{};e.updateStyles(g({},o))})),this.tempStyles={})},t.prototype.render=function(){var t=this;this.lf.on("node:mouseenter",(function(e){var n=e.data;return t.highlight(n.id)})),this.lf.on("edge:mouseenter",(function(e){var n=e.data;return t.highlight(n.id)})),this.lf.on("node:mouseleave",this.restoreHighlight.bind(this)),this.lf.on("edge:mouseleave",this.restoreHighlight.bind(this)),this.lf.on("history:change",this.restoreHighlight.bind(this))},t.prototype.destroy=function(){},t.pluginName="highlight",t}(),jS={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function BS(t,e,n,o){var i,r="",a="";t[0]===e[0]?r=t[1]>e[1]?"t":"b":t[1]===e[1]&&(r=t[0]>e[0]?"l":"r"),e[0]===n[0]?a=e[1]>n[1]?"t":"b":e[1]===n[1]&&(a=e[0]>n[0]?"l":"r");var s=Math.min(Math.hypot(e[0]-t[0],e[1]-t[1])/2,Math.hypot(n[0]-e[0],n[1]-e[1])/2,o)||.2*o,l="".concat(r).concat(a),u=jS[l]||"-",c="L ".concat(t[0]," ").concat(t[1]);if("-"===u)c+="L ".concat(e[0]," ").concat(e[1]," L ").concat(n[0]," ").concat(n[1]);else{var d=_(function(t,e,n,o){var i=[t[0],t[1]],r=[t[0],t[1]];switch(n){case"tl":return"tr"===e?(i[1]+=o,r[0]+=o):"lb"===e&&(i[0]+=o,r[1]+=o),[i,r];case"tr":return"tl"===e?(i[1]+=o,r[0]-=o):"rb"===e&&(i[0]-=o,r[1]+=o),[i,r];case"bl":return"br"===e?(i[1]-=o,r[0]+=o):"lt"===e&&(i[0]+=o,r[1]-=o),[i,r];case"br":return"bl"===e?(i[1]-=o,r[0]-=o):"rt"===e&&(i[0]-=o,r[1]-=o),[i,r];default:return[]}}(e,l,u,s),2),h=d[0],p=d[1];h&&p&&(c+="L ".concat(h[0]," ").concat(h[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(p[0]," ").concat(p[1]),i=_(p,2),e[0]=i[0],e[1]=i[1])}return c}function HS(t,e){var n=0,o="";if(2===t.length)o+="M".concat(t[n][0]," ").concat(t[n++][1]," L ").concat(t[n][0]," ").concat(t[n][1]);else{for(o+="M".concat(t[n][0]," ").concat(t[n++][1]);n+1<t.length;){o+=BS(t[n-1],t[n],t[1+n++],e)}o+="L ".concat(t[n][0]," ").concat(t[n][1])}return o}var FS=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getEdge=function(){var t=this.props.model,n=t.points,o=t.isAnimation,i=t.arrowConfig,r=t.radius,a=void 0===r?5:r,s=t.getEdgeStyle(),l=t.getEdgeAnimationStyle(),u=function(t){for(var e=t,n=1;n<e.length-1;){var o=_(e[n-1],2),i=o[0],r=o[1],a=_(e[n],2),s=a[0],l=a[1],u=_(e[n+1],2),c=u[0],d=u[1];i===s&&s===c||r===l&&l===d?e.splice(n,1):n++}return e}(n.split(" ").map((function(t){return t.split(",").map((function(t){return+t}))}))),c=HS(u,a),d=g(g(g({style:o?l:{}},s),i),{fill:"none"});return e.h("path",g({d:c},d))},n}(e.PolylineEdge),zS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e}(e.PolylineEdgeModel),WS=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getLabelShape=function(){var t=this.props.model,n=t.id,o=t.x,i=t.y,r=t.width,a=t.height,s=t.properties,l=this.props.model.getNodeStyle();return e.h("svg",{x:o-r/2,y:i-a/2,width:50,height:24,style:"z-index: 0; background: none; overflow: auto;"},[s.labelText?e.h("text",{x:0,y:-5,fontSize:"16px",fill:l.stroke},s.labelText):"",s.disabledDelete?"":e.h("text",{x:s.labelText?50:0,y:-5,fontSize:"24px",cursor:"pointer",fill:l.stroke,onclick:this.handleCustomDeleteIconClick.bind(this,n)},"x")])},n.prototype.getShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.id,s=this.props.model.getNodeStyle();return e.h("g",{},[e.h("rect",g(g({},s),{x:n-i/2,y:o-r/2,width:i,height:r,id:a})),this.getLabelShape()])},n.prototype.toFront=function(){},n.prototype.handleCustomDeleteIconClick=function(t){this.props.graphModel.deleteNode(t)},n}(e.PolygonNode),GS=function(t){function e(){var e=t.apply(this,E([],_(arguments),!1))||this;return e.d=10,e}return f(e,t),e.prototype.initNodeData=function(e){e.text={value:"",x:e.x,y:e.y,draggable:!1,editable:!1},t.prototype.initNodeData.call(this,e),this.zIndex=0,this.draggable=!0},e.prototype.setAttributes=function(){var t,e=this;this.points=[],(null===(t=this.properties)||void 0===t?void 0:t.node_selection_ids).length>1&&setTimeout((function(){var t;e.updatePointsByNodes((null===(t=e.properties)||void 0===t?void 0:t.node_selection_ids)||[])}))},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return e.stroke=this.properties.strokeColor||"#008000",e.strokeDasharray="10 5",e},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.updatePoints=function(t){this.points=t},e.prototype.updateCoordinate=function(t){var e=t.x,n=t.y;this.x=e,this.y=n},e.prototype.updatePointsByNodes=function(t){var e=this,n=[],o=1/0,i=1/0,r=-1/0,a=-1/0;t.forEach((function(t){var n=e.graphModel.getNodeModelById(t);if(n){var s=n.width,l=n.height,u=n.x,c=n.y;o=Math.min(o,u-s/2-e.d),i=Math.min(i,c-l/2-e.d),r=Math.max(r,u+s/2+e.d),a=Math.max(a,c+l/2+e.d)}})),n.push([o,i],[r,i],[r,a],[o,a]),[o,i,r,a].some((function(t){return Math.abs(t)===1/0}))||(this.updatePoints(n),this.updateCoordinate({x:(r+o)/2,y:(a+i)/2}))},e}(e.PolygonNodeModel),US=function(){function t(t){var e=t.lf;this.selectNodes=[],this.d=10,e.register({type:"node-selection",view:WS,model:GS})}return Object.defineProperty(t.prototype,"selectNodesIds",{get:function(){return this.selectNodes.map((function(t){return t.id}))},enumerable:!1,configurable:!0}),t.prototype.addNodeSelection=function(){this.lf.addNode({type:"node-selection",text:"",properties:{node_selection_ids:this.selectNodesIds}}).updatePointsByNodes(this.selectNodesIds)},t.prototype.updateNodeSelection=function(){var t=this.getNodeSelection();t&&(this.lf.setProperties(t.id,{node_selection_ids:this.selectNodesIds}),this.lf.getNodeModelById(t.id).updatePointsByNodes(this.selectNodesIds))},t.prototype.getNodeSelection=function(){var t=this,e=this.selectNodesIds,n=this.lf.getGraphRawData(),o=e.filter((function(e){return e!==t.currentClickNode.id}));return n.nodes.find((function(t){if("node-selection"===t.type){var e=Bi(t,"properties.node_selection_ids",[]);return o.every((function(t){return e.includes(t)}))}return!1}))},t.prototype.render=function(t){var e=this;this.lf=t,t.on("node:click",(function(n){if(n.e.shiftKey&&"node-selection"!==n.data.type){e.currentClickNode=n.data;var o=!1;e.selectNodesIds.includes(n.data.id)&&(e.lf.getNodeModelById(n.data.id).setSelected(!1),o=!0);var i=t.getSelectElements(!0).nodes;e.selectNodes=i,1===e.selectNodes.length?o?e.updateNodeSelection():e.addNodeSelection():e.selectNodes.length>1&&e.updateNodeSelection()}})),t.graphModel.addNodeMoveRules((function(e,n,o){if("node-selection"===e.type){var i=e.properties.node_selection_ids;return t.graphModel.moveNodes(i,n,o,!0),!0}return!0}))},t.pluginName="node-selection",t}(),XS=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getLabelShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.properties;return e.h("text",{x:n-i/2+5,y:o-r/2+16,fontSize:12,fill:"blue"},a.moreText)},n.prototype.getShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=this.props.model.getNodeStyle();return e.h("g",{},[e.h("rect",g(g({},a),{fill:"#FFFFFF",x:n-i/2,y:o-r/2})),this.getLabelShape()])},n}(e.RectNode),VS={pluginName:"rectLabelNode",install:function(t){t.register({type:"rect-label",model:e.RectNodeModel,view:XS})}};t.AutoLayout=wS,t.BPMNAdapter=Mv,t.BPMNBaseAdapter=Av,t.BPMNElements=Wg,t.BoundaryEventFactory=xt,t.BpmnAdapter=ct,t.BpmnElement=U,t.BpmnXmlAdapter=dt,t.ContextMenu=PS,t.Control=SS,t.CurvedEdge=FS,t.CurvedEdgeModel=zS,t.DiamondResize=wg,t.DiamondResizeModel=_g,t.DiamondResizeView=Eg,t.DndPanel=kS,t.DynamicGroup=Ew,t.DynamicGroupNode=yw,t.DynamicGroupNodeModel=mw,t.EllipseResize=xg,t.EllipseResizeModel=mg,t.EllipseResizeView=bg,t.EndEventFactory=yt,t.EndEventModel=M,t.EndEventView=O,t.ExclusiveGatewayModel=L,t.ExclusiveGatewayView=I,t.FlowPath=bS,t.GatewayNodeFactory=Rt,t.Group=Lg,t.GroupNode=kg,t.GroupNodeModel=Pg,t.Highlight=IS,t.HtmlResize=Ng,t.HtmlResizeModel=Sg,t.HtmlResizeView=Cg,t.InsertNodeInPolyline=Mw,t.IntermediateCatchEventFactory=mt,t.IntermediateThrowEventFactory=_t,t.Label=cS,t.Menu=MS,t.MiniMap=RS,t.NodeResize=Og,t.NodeSelection=US,t.RectLabelNode=VS,t.RectResize=Mg,t.RectResizeModel=Tg,t.RectResizeView=Ag,t.SelectionSelect=DS,t.SequenceFlowModel=k,t.SequenceFlowView=R,t.ServiceTaskModel=B,t.ServiceTaskView=H,t.Snapshot=mS,t.StartEventFactory=bt,t.StartEventModel=N,t.StartEventView=T,t.SubProcessFactory=Ig,t.TaskNodeFactory=Lt,t.UserTaskModel=z,t.UserTaskView=W,t.bpmnUtils=vt,t.convertNormalToXml=_v,t.convertXmlToNormal=Ev,t.dynamicGroup=xw,t.gateway={exclusive:0,inclusive:1,parallel:2},t.gatewayComposable=[[1,1,0],[0,0,1],[0,1,1]],t.getCurvedEdgePath=HS,t.handleAttributes=K,t.icons=kt,t.lfJson2Xml=J,t.lfXml2Json=et,t.multiInstanceIcon=Dt,t.sequenceFlowFactory=Bg,t.toLogicflowData=function(t){var e={nodes:[],edges:[]},n=t.flowElementList;return n&&n.length>0&&n.forEach((function(t){if(t.type===Ov.SEQUENCE_FLOW){var n=function(t){var e=t.incoming,n=t.outgoing,o=t.properties,i=t.key,r=t.type,a=o.text,s=o.name,l=o.startPoint,u=o.endPoint,c=o.pointsList,d={id:i,type:Pv[r],sourceNodeId:e[0],targetNodeId:n[0],text:a||s,properties:{}};l&&(d.startPoint=JSON.parse(l)),u&&(d.endPoint=JSON.parse(u)),c&&(d.pointsList=JSON.parse(c));var h=["startPoint","endPoint","pointsList","text"];return Object.keys(t.properties).forEach((function(e){-1===h.indexOf(e)&&(d.properties[e]=t.properties[e])})),d}(t);e.edges.push(n)}else{var o=function(t){var e=t.properties,n=t.key,o=t.type,i=t.bounds,r=e.x,a=e.y,s=e.text;if(void 0===r){var l=_(i,2),u=l[0],c=u.x,d=u.y,h=l[1];r=(c+h.x)/2,a=(d+h.y)/2}var p={id:n,type:Pv[o],x:r,y:a,text:s,properties:{}},f=["x","y","text"];return Object.keys(t.properties).forEach((function(e){-1===f.indexOf(e)&&(p.properties[e]=t.properties[e])})),p}(t);e.nodes.push(o)}})),e},t.toNormalJson=rt,t.toTurboData=function(t){var e=new Map,n={flowElementList:[]};return t.nodes.forEach((function(t){var o=function(t){var e=t.id,n=t.type,o=t.x,i=t.y,r=t.text,a=void 0===r?"":r,s=t.properties;return{incoming:[],outgoing:[],dockers:[],type:kv(n),properties:g(g({},s),{name:a&&a.value||"",x:o,y:i,text:a}),key:e}}(t);n.flowElementList.push(o),e.set(t.id,o)})),t.edges.forEach((function(t){var o=function(t){var e=t.id,n=t.type,o=t.sourceNodeId,i=t.targetNodeId,r=t.startPoint,a=t.endPoint,s=t.pointsList,l=t.text,u=void 0===l?"":l,c=t.properties;return{incoming:[o],outgoing:[i],type:kv(n),dockers:[],properties:g(g({},c),{name:u&&u.value||"",text:u,startPoint:JSON.stringify(r),endPoint:JSON.stringify(a),pointsList:JSON.stringify(s)}),key:e}}(t);e.get(t.sourceNodeId).outgoing.push(o.key),e.get(t.targetNodeId).incoming.push(o.key),n.flowElementList.push(o)})),n},t.toXmlJson=it,t.useDefinition=zg}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@logicflow/core")):"function"==typeof define&&define.amd?define(["exports","@logicflow/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Extension={},t.Core)}(this,(function(t,e){"use strict";var n=40,o=40,i=40,r=40,a=40,s=40,l=100,u=80,c=100,d=80,h={rect:{radius:5,stroke:"rgb(24, 125, 255)"},circle:{r:18,stroke:"rgb(24, 125, 255)"},polygon:{stroke:"rgb(24, 125, 255)"},polyline:{stroke:"rgb(24, 125, 255)",hoverStroke:"rgb(24, 125, 255)",selectedStroke:"rgb(24, 125, 255)"},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"white",height:14,stroke:"transparent",radius:3}}},p=function(t,e){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},p(t,e)};function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var g=function(){return g=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},g.apply(this,arguments)};function v(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}function y(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a}function m(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))}function b(t,e){var n,o,i,r,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function x(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function E(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var w=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),S=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new w;function C(){return S.next()}var N=function(t){function e(e,n){return e.id||(e.id="Event_".concat(C())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),t.call(this,e,n)||this}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var e=t.prototype.getConnectedTargetRules.call(this);return e.push({message:"起始节点不能作为边的终点",validate:function(){return!1}}),e},e.extendKey="StartEventModel",e}(e.CircleNodeModel),T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.extendKey="StartEventNode",e}(e.CircleNode),A={type:"bpmn:startEvent",view:T,model:N},M=function(t){function e(e,n){return e.id||(e.id="Event_".concat(C())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),t.call(this,e,n)||this}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var e=t.prototype.getConnectedSourceRules.call(this);return e.push({message:"结束节点不能作为边的起点",validate:function(){return!1}}),e},e.extendKey="EndEventModel",e}(e.CircleNodeModel),O=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var n=this.props.model,o=n.getNodeStyle(),i=n,r=i.x,a=i.y,s=i.r,l=t.prototype.getShape.call(this);return e.h("g",{},l,e.h("circle",g(g({},o),{cx:r,cy:a,r:s-5})))},n.extendKey="EndEventView",n}(e.CircleNode),P={type:"bpmn:endEvent",view:O,model:M},k=function(t){function e(e,n){return e.id||(e.id="Flow_".concat(C())),t.call(this,e,n)||this}return f(e,t),e.extendKey="SequenceFlowModel",e}(e.PolylineEdgeModel),R=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.extendKey="SequenceFlowEdge",e}(e.PolylineEdge),D={type:"bpmn:sequenceFlow",view:R,model:k},L=function(t){function e(e,n){var o=this;return e.id||(e.id="Gateway_".concat(C())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),(o=t.call(this,e,n)||this).points=[[25,0],[50,25],[25,50],[0,25]],o}return f(e,t),e.extendKey="ExclusiveGatewayModel",e}(e.PolygonNodeModel),I=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getShape=function(){var t=this.props.model,n=t,o=n.x,i=n.y,r=n.width,a=n.height,s=n.points,l=t.getNodeStyle();return e.h("g",{transform:"matrix(1 0 0 1 ".concat(o-r/2," ").concat(i-a/2,")")},e.h("polygon",g(g({},l),{x:o,y:i,points:s})),e.h("path",g({d:"m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z"},l)))},n.extendKey="ExclusiveGatewayNode",n}(e.PolygonNode),j={type:"bpmn:exclusiveGateway",view:I,model:L},B=function(t){function e(e,n){return e.id||(e.id="Activity_".concat(C())),t.call(this,e,n)||this}return f(e,t),e.extendKey="ServiceTaskModel",e}(e.RectNodeModel),H=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getLabelShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.getNodeStyle();return e.h("svg",{x:n-i/2+5,y:o-r/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},e.h("path",{fill:a.stroke,d:"M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z"}))},n.prototype.getShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.radius,s=t.getNodeStyle();return e.h("g",{},[e.h("rect",g({x:n-i/2,y:o-r/2,rx:a,ry:a,width:i,height:r},s)),this.getLabelShape()])},n.extendKey="ServiceTaskNode",n}(e.RectNode),F={type:"bpmn:serviceTask",view:H,model:B},z=function(t){function e(e,n){return e.id||(e.id="Activity_".concat(C())),t.call(this,e,n)||this}return f(e,t),e.extendKey="UserTaskModel",e}(e.RectNodeModel),W=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getLabelShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.getNodeStyle();return e.h("svg",{x:n-i/2+5,y:o-r/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},e.h("path",{fill:a.stroke,d:"M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z"}))},n.prototype.getShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.radius,s=t.getNodeStyle();return e.h("g",{},[e.h("rect",g(g({},s),{x:n-i/2,y:o-r/2,rx:a,ry:a,width:i,height:r})),this.getLabelShape()])},n.extendKey="UserTaskNode",n}(e.RectNode),G={type:"bpmn:userTask",view:W,model:z},U={pluginName:"bpmnElement",install:function(t){t.setTheme(h),t.register(A),t.register(P),t.register(j),t.register(G),t.register(F),t.options.customBpmnEdge||(t.register(D),t.setDefaultEdgeType("bpmn:sequenceFlow"))}},X=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),V=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new X;function Y(){return V.next()}function q(t){return Object.prototype.toString.call(t)}function K(t){var e=t;return"[object Object]"===q(t)?(e={},Object.keys(t).forEach((function(n){var o=n;"-"===n.charAt(0)&&(o=n.substring(1)),e[o]=K(t[n])}))):Array.isArray(t)&&(e=[],t.forEach((function(t,n){e[n]=K(t)}))),e}var Z="\t\n";function $(t,e,n){var o=function(t){return" ".repeat(t)}(n),i="";if("#text"===e)return Z+o+t;if("#cdata-section"===e)return Z+o+"<![CDATA["+t+"]]>";if("#comment"===e)return Z+o+"\x3c!--"+t+"--\x3e";if("-"==="".concat(e).charAt(0))return" "+e.substring(1)+'="'+function(t){var e=t;try{"string"!=typeof e&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(K(t)).replace(/"/g,"'")}return e}(t)+'"';if(Array.isArray(t))t.forEach((function(t){i+=$(t,e,n+1)}));else if("[object Object]"===q(t)){var r=Object.keys(t),a="",s="";i+=(0===n?"":Z+o)+"<"+e,r.forEach((function(e){"-"===e.charAt(0)?a+=$(t[e],e,n+1):s+=$(t[e],e,n+1)})),i+=a+(""!==s?">".concat(s).concat(Z+o,"</").concat(e,">"):" />")}else i+=Z+o+"<".concat(e,">").concat(t.toString(),"</").concat(e,">");return i}function J(t){var e="";for(var n in t)e+=$(t[n],n,0);return e}var Q=function(){};(Q.ObjTree=function(){return this}).VERSION="0.23",Q.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',Q.ObjTree.prototype.attr_prefix="-",Q.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(t,"application/xml");if(!o)return;e=o.documentElement}else window.ActiveXObject&&((n=new ActiveXObject("Microsoft.XMLDOM")).async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)},Q.ObjTree.prototype.parseHTTP=function(t,e,n){var o,i={};for(var r in e)i[r]=e[r];if(i.method||(void 0===i.postBody&&void 0===i.postbody&&void 0===i.parameters?i.method="get":i.method="post"),n){i.asynchronous=!0;var a=this,s=n,l=i.onComplete;i.onComplete=function(t){var e;t&&t.responseXML&&t.responseXML.documentElement&&(e=a.parseDOM(t.responseXML.documentElement)),s(e,t),l&&l(t)}}else i.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request)i.uri=t,(u=new HTTP.Request(i))&&(o=u.transport);else if("undefined"!=typeof Ajax&&Ajax.Request){var u;(u=new Ajax.Request(t,i))&&(o=u.transport)}return n?o:o&&o.responseXML&&o.responseXML.documentElement?this.parseDOM(o.responseXML.documentElement):void 0},Q.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),11!=t.nodeType){var o={};o[t.nodeName]=n,n=o}return n}},Q.ObjTree.prototype.parseElement=function(t){if(7!=t.nodeType){if(3==t.nodeType||4==t.nodeType||8==t.nodeType){if(null==t.nodeValue.match(/[^\x00-\x20]/))return;return t.nodeValue}var e=null,n={};if(t.attributes&&t.attributes.length){e={};for(var o=0;o<t.attributes.length;o++){if("string"==typeof(s=t.attributes[o].nodeName)){var i=t.attributes[o].nodeValue;try{i=JSON.parse(t.attributes[o].nodeValue.replace(/'/g,'"'))}catch(e){i=t.attributes[o].nodeValue}i&&(void 0===n[s=this.attr_prefix+s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],i))}}}if(t.childNodes&&t.childNodes.length){var r=!0;e&&(r=!1);for(o=0;o<t.childNodes.length&&r;o++){var a=t.childNodes[o].nodeType;3!=a&&4!=a&&8!=a&&(r=!1)}if(r){e||(e="");for(o=0;o<t.childNodes.length;o++)e+=t.childNodes[o].nodeValue}else{e||(e={});for(o=0;o<t.childNodes.length;o++){var s;if("string"==typeof(s=t.childNodes[o].nodeName))(i=this.parseElement(t.childNodes[o]))&&(void 0===n[s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],i))}}}else null===e&&(e={});return e}},Q.ObjTree.prototype.addNode=function(t,e,n,o){this.__force_array[e]?(1==n&&(t[e]=[]),t[e][t[e].length]=o):1==n?t[e]=o:2==n?t[e]=[t[e],o]:t[e][t[e].length]=o},Q.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},Q.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],o=[];for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];i.charAt(0)!=this.attr_prefix?void 0===r||null==r?n[n.length]="<"+i+" />":"object"==typeof r&&r.constructor==Array?n[n.length]=this.array_to_xml(i,r):n[n.length]="object"==typeof r?this.hash_to_xml(i,r):this.scalar_to_xml(i,r):o[o.length]=" "+i.substring(1)+'="'+this.xml_escape(r)+'"'}var a=o.join(""),s=n.join("");return void 0===t||null==t||(s=n.length>0?s.match(/\n/)?"<"+t+a+">\n"+s+"</"+t+">\n":"<"+t+a+">"+s+"</"+t+">\n":"<"+t+a+" />\n"),s},Q.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],o=0;o<e.length;o++){var i=e[o];void 0===i||null==i?n[n.length]="<"+t+" />":"object"==typeof i&&i.constructor==Array?n[n.length]=this.array_to_xml(t,i):n[n.length]="object"==typeof i?this.hash_to_xml(t,i):this.scalar_to_xml(t,i)}return n.join("")},Q.ObjTree.prototype.scalar_to_xml=function(t,e){return"#text"==t?this.xml_escape(e):"<"+t+">"+this.xml_escape(e)+"</"+t+">\n"},Q.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};var tt,et=function(t){return(new Q.ObjTree).parseXML(t)};!function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow"}(tt||(tt={}));var nt=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],ot=["properties","startPoint","endPoint","pointsList"];function it(t){var e=t?ot.concat(t):ot;return function(t){return function t(n){var o={};return"string"==typeof n?n:Array.isArray(n)?n.map((function(e){return t(e)})):(Object.entries(n).forEach((function(n){var i=_(n,2),r=i[0],a=i[1];"object"!=typeof a?0===r.indexOf("-")||["#text","#cdata-section","#comment"].includes(r)?o[r]=a:o["-".concat(r)]=a:e.includes(r)?o["-".concat(r)]=t(a):o[r]=t(a)})),o)}(t)}}function rt(t){var e={};return Object.entries(t).forEach((function(t){var n=_(t,2),o=n[0],i=n[1];0===o.indexOf("-")?e[o.substring(1)]=K(i):"string"==typeof i?e[o]=i:"[object Object]"===Object.prototype.toString.call(i)?e[o]=rt(i):Array.isArray(i)?e[o]=i.map((function(t){return rt(t)})):e[o]=i})),e}function at(t,e){t["bpmndi:BPMNEdge"]=e.edges.map((function(t){var e,n=t.id,o=t.pointsList.map((function(t){return{"-x":t.x,"-y":t.y}})),i={"-id":"".concat(n,"_di"),"-bpmnElement":n,"di:waypoint":o};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(i["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),i})),t["bpmndi:BPMNShape"]=e.nodes.map((function(t){var e,n=t.id,o=100,i=80,r=t.x,a=t.y,s=ct.shapeConfigMap.get(t.type);s&&(o=s.width,i=s.height),r-=o/2,a-=i/2;var l={"-id":"".concat(n,"_di"),"-bpmnElement":n,"dc:Bounds":{"-x":r,"-y":a,"-width":o,"-height":i}};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(l["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),l}))}function st(t){var e=[],n=[],o=t["bpmn:definitions"];if(o){var i=o["bpmn:process"];Object.keys(i).forEach((function(t){if(0===t.indexOf("bpmn:")){var r=i[t];if(t===tt.FLOW){var a=o["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];n=function(t,e){var n=[];if(Array.isArray(t))t.forEach((function(t){var o;o=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(ut(o,t))}));else{var o=void 0;o=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(ut(o,t))}return n}(r,a)}else{var s=o["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];e=e.concat(function(t,e,n){var o=[];if(Array.isArray(t))t.forEach((function(t){var i=lt(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);o.push(i)}));else{var i=lt(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);o.push(i)}return o}(r,s,t))}}}))}return{nodes:e,edges:n}}function lt(t,e,n){var o,i,r=Number(t["dc:Bounds"]["-x"]),a=Number(t["dc:Bounds"]["-y"]),s=n["-name"],l=ct.shapeConfigMap.get(e);if(l&&(r+=l.width/2,a+=l.height/2),Object.entries(n).forEach((function(t){var e=_(t,2),n=e[0],i=e[1];-1===nt.indexOf(n)&&(o||(o={}),o[n]=i)})),o&&(o=rt(o)),s&&(i={x:r,y:a,value:s},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var u=t["bpmndi:BPMNLabel"]["dc:Bounds"];i.x=Number(u["-x"])+Number(u["-width"])/2,i.y=Number(u["-y"])+Number(u["-height"])/2}var c={id:t["-bpmnElement"],type:e,x:r,y:a,properties:o};return i&&(c.text=i),c}function ut(t,e){var n,o,i="".concat(e["-name"]);if(i){var r=t["bpmndi:BPMNLabel"]["dc:Bounds"],a=0;i.split("\n").forEach((function(t){a<t.length&&(a=t.length)})),n={value:i,x:Number(r["-x"])+10*a/2,y:Number(r["-y"])+7}}Object.entries(e).forEach((function(t){var e=_(t,2),n=e[0],i=e[1];-1===nt.indexOf(n)&&(o||(o={}),o[n]=i)})),o&&(o=rt(o));var s={id:e["-id"],type:tt.FLOW,pointsList:t["di:waypoint"].map((function(t){return{x:Number(t["-x"]),y:Number(t["-y"])}})),sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:o};return n&&(s.text=n),s}var ct=function(){function t(t){var e=t.lf,n=this;this.adapterOut=function(t,e){var o=g({},n.processAttributes);!function(t,e,n){var o=new Map;e.nodes.forEach((function(e){var i,r={"-id":e.id};if((null===(i=e.text)||void 0===i?void 0:i.value)&&(r["-name"]=e.text.value),e.properties){var a=it(n)(e.properties);Object.assign(r,a)}o.set(e.id,r),t[e.type]?Array.isArray(t[e.type])?t[e.type].push(r):t[e.type]=[t[e.type],r]:t[e.type]=r}));var i=e.edges.map((function(t){var e,i,r=o.get(t.targetNodeId);r["bpmn:incoming"]?Array.isArray(r["bpmn:incoming"])?r["bpmn:incoming"].push(t.id):r["bpmn:incoming"]=[r["bpmn:incoming"],t.id]:r["bpmn:incoming"]=t.id;var a={"-id":t.id,"-sourceRef":t.sourceNodeId,"-targetRef":t.targetNodeId};if((null===(e=t.text)||void 0===e?void 0:e.value)&&(a["-name"]=null===(i=t.text)||void 0===i?void 0:i.value),t.properties){var s=it(n)(t.properties);Object.assign(a,s)}return a}));e.edges.forEach((function(t){var e=o.get(t.sourceNodeId);e["bpmn:outgoing"]?Array.isArray(e["bpmn:outgoing"])?e["bpmn:outgoing"].push(t.id):e["bpmn:outgoing"]=[e["bpmn:outgoing"],t.id]:e["bpmn:outgoing"]=t.id})),t[tt.FLOW]=i}(o,t,e);var i={"-id":"BPMNPlane_1","-bpmnElement":o["-id"]};at(i,t);var r=n.definitionAttributes;return r["bpmn:process"]=o,r["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":i},{"bpmn:definitions":r}},this.adapterIn=function(t){if(t)return st(t)},e.adapterIn=function(t){return n.adapterIn(t)},e.adapterOut=function(t,e){return n.adapterOut(t,e)},this.processAttributes={"-isExecutable":"true","-id":"Process_".concat(Y())},this.definitionAttributes={"-id":"Definitions_".concat(Y()),"-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.0"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();ct.shapeConfigMap.set(tt.START,{width:n,height:o}),ct.shapeConfigMap.set(tt.END,{width:i,height:r}),ct.shapeConfigMap.set(tt.GATEWAY,{width:a,height:s}),ct.shapeConfigMap.set(tt.SYSTEM,{width:l,height:u}),ct.shapeConfigMap.set(tt.USER,{width:c,height:d});var dt=function(t){function e(e){var n=t.call(this,e)||this;n.adapterXmlIn=function(t){var e=et(t);return n.adapterIn(e)},n.adapterXmlOut=function(t,e){return J(n.adapterOut(t,e))};var o=e.lf;return o.adapterIn=n.adapterXmlIn,o.adapterOut=n.adapterXmlOut,n}return f(e,t),e.pluginName="bpmnXmlAdapter",e}(ct);function ht(){this.targetRules.push({message:"分组外的节点不允许连接分组内的",validate:function(t,e){var n=!!t.properties.parent,o=!!e.properties.parent;return!(!n&&o)}})}var pt=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){var t="xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}));return t},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),ft=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new pt;function gt(){return ft.next()}var vt=Object.freeze({__proto__:null,genBpmnId:gt,groupRule:ht});function yt(t){var n=_(t.useDefinition(),1)[0],o=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return f(o,t),o.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},o.prototype.getShape=function(){var o,i=this.props.model,r=i.getNodeStyle(),a=i,s=a.x,l=a.y,u=a.r,c=a.width,d=a.height,h=a.properties,p=t.prototype.getShape.call(this),f=h.definitionType,v=((null===(o=n.endEvent)||void 0===o?void 0:o.get(f))||{}).icon,y=Array.isArray(v)?e.h.apply(void 0,E(["g",{transform:"matrix(1 0 0 1 ".concat(s-c/2," ").concat(l-d/2,")")}],_(v),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(s-c/2," ").concat(l-d/2,")"),d:v,style:"fill: black; stroke-linecap: round; stroke-linejoin: round; stroke: white; stroke-width: 1px;"});return e.h("g",{},p,e.h("circle",g(g({},r),{strokeWidth:2,cx:s,cy:l,r:u-2})),y)},o}(e.CircleNode),i=function(t){function e(e,o){var i,r,a,s;e.id||(e.id="Event_".concat(gt())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var l=((null===(r=n.endEvent)||void 0===r?void 0:r.get(null===(a=e.properties)||void 0===a?void 0:a.definitionType))||{}).properties,u=void 0===l?{}:l;return e.properties=g(g({},u),e.properties),(null===(s=e.properties)||void 0===s?void 0:s.definitionType)&&(e.properties.definitionId="Definition_".concat(gt())),i=t.call(this,e,o)||this,ht.call(i),i}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var e=this,n=t.prototype.getConnectedSourceRules.call(this),o={message:"结束节点不能作为边的起点",validate:function(t,n){return t!==e}};return n.push(o),n},e}(e.CircleNodeModel);return{type:"bpmn:endEvent",view:o,model:i}}function mt(t){var n=_(t.useDefinition(),1)[0],o=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return f(o,t),o.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},o.prototype.getShape=function(){var t,o=this.props.model,i=o.getNodeStyle(),r=o,a=r.x,s=r.y,l=r.r,u=r.width,c=r.height,d=r.properties.definitionType,h=((null===(t=n.intermediateCatchEvent)||void 0===t?void 0:t.get(d))||{}).icon,p=Array.isArray(h)?e.h.apply(void 0,E(["g",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")")}],_(h),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")"),d:h});return e.h("g",{},e.h("circle",g(g({},i),{cx:a,cy:s,r:l,strokeWidth:1.5})),e.h("circle",g(g({},i),{cx:a,cy:s,r:l-3,strokeWidth:1.5})),p)},o}(e.CircleNode),i=function(t){function e(e,o){var i,r,a,s;e.id||(e.id="Event_".concat(gt())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var l=((null===(r=n.intermediateCatchEvent)||void 0===r?void 0:r.get(null===(a=e.properties)||void 0===a?void 0:a.definitionType))||{}).properties,u=void 0===l?{}:l;return e.properties=g(g({},u),e.properties),(null===(s=e.properties)||void 0===s?void 0:s.definitionType)&&(e.properties.definitionId="Definition_".concat(gt())),i=t.call(this,e,o)||this,ht.call(i),i}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e}(e.CircleNodeModel);return{type:"bpmn:intermediateCatchEvent",view:o,model:i}}function bt(t){var n=_(t.useDefinition(),1)[0],o=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return f(o,t),o.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},o.prototype.getShape=function(){var t,o=this.props.model,i=o.getNodeStyle(),r=o,a=r.x,s=r.y,l=r.r,u=r.width,c=r.height,d=r.properties,h=d.definitionType,p=d.isInterrupting,f=((null===(t=n.startEvent)||void 0===t?void 0:t.get(h))||{}).icon,v=Array.isArray(f)?e.h.apply(void 0,E(["g",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")")}],_(f),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")"),d:f,style:"fill: white; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"});return e.h("g",{},e.h("circle",g(g({},i),{cx:a,cy:s,r:l,strokeDasharray:p?"5,5":"",strokeWidth:2})),v)},o}(e.CircleNode),i=function(t){function e(e,o){var i,r,a;e.id||(e.id="Event_".concat(gt())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var s=((null===(i=n.startEvent)||void 0===i?void 0:i.get(null===(r=e.properties)||void 0===r?void 0:r.definitionType))||{}).properties,l=void 0===s?{}:s;return e.properties=g(g({},l),e.properties),(null===(a=e.properties)||void 0===a?void 0:a.definitionType)&&(e.properties.definitionId="Definition_".concat(gt())),t.call(this,e,o)||this}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var e=this,n=t.prototype.getConnectedTargetRules.call(this),o={message:"起始节点不能作为边的终点",validate:function(t,n){return n!==e}};return n.push(o),n},e}(e.CircleNodeModel);return{type:"bpmn:startEvent",view:o,model:i}}function xt(t){var n=_(t.useDefinition(),1)[0],o=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return f(o,t),o.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},o.prototype.getShape=function(){var t,o=this.props.model,i=o.getNodeStyle(),r=o,a=r.x,s=r.y,l=r.r,u=r.width,c=r.height,d=r.properties,h=d.definitionType,p=d.cancelActivity,f=((null===(t=n.boundaryEvent)||void 0===t?void 0:t.get(h))||{}).icon,v=Array.isArray(f)?e.h.apply(void 0,E(["g",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")")}],_(f),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")"),d:f});return e.h("g",{},e.h("circle",g(g({},i),{cx:a,cy:s,r:l,strokeDasharray:p?"":"5,5",strokeWidth:1.5})),e.h("circle",g(g({},i),{cx:a,cy:s,r:l-3,strokeDasharray:p?"":"5,5",strokeWidth:1.5})),v)},o}(e.CircleNode),i=function(t){function e(e,o){var i,r,a,s;e.id||(e.id="Event_".concat(gt())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var l=((null===(r=n.boundaryEvent)||void 0===r?void 0:r.get(null===(a=e.properties)||void 0===a?void 0:a.definitionType))||{}).properties,u=void 0===l?{}:l;return e.properties=g(g({attachedToRef:"",cancelActivity:!0},u),e.properties),(null===(s=e.properties)||void 0===s?void 0:s.definitionType)&&(e.properties.definitionId="Definition_".concat(gt())),i=t.call(this,e,o)||this,ht.call(i),i}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.r=20,this.autoToFront=!1,this.zIndex=99999},e.prototype.setAttributes=function(){this.r=18},e}(e.CircleNodeModel);return{type:"bpmn:boundaryEvent",view:o,model:i}}function _t(t){var n=_(t.useDefinition(),1)[0],o=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return f(o,t),o.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},o.prototype.getShape=function(){var t,o=this.props.model,i=o.getNodeStyle(),r=o,a=r.x,s=r.y,l=r.r,u=r.width,c=r.height,d=r.properties.definitionType,h=((null===(t=n.intermediateThrowEvent)||void 0===t?void 0:t.get(d))||{}).icon,p=Array.isArray(h)?e.h.apply(void 0,E(["g",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")")}],_(h),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")"),d:h,style:"fill: black"});return e.h("g",{},e.h("circle",g(g({},i),{cx:a,cy:s,r:l,strokeWidth:1.5})),e.h("circle",g(g({},i),{cx:a,cy:s,r:l-3,strokeWidth:1.5})),p)},o}(e.CircleNode),i=function(t){function e(e,o){var i,r,a,s;e.id||(e.id="Event_".concat(gt())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var l=((null===(r=n.intermediateThrowEvent)||void 0===r?void 0:r.get(null===(a=e.properties)||void 0===a?void 0:a.definitionType))||{}).properties,u=void 0===l?{}:l;return e.properties=g(g({},u),e.properties),(null===(s=e.properties)||void 0===s?void 0:s.definitionType)&&(e.properties.definitionId="Definition_".concat(gt())),i=t.call(this,e,o)||this,ht.call(i),i}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e}(e.CircleNodeModel);return{type:"bpmn:intermediateThrowEvent",view:o,model:i}}var Et=[e.h("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),e.h("path",{d:"M 18,18 l 2.25,-7.5 m -2.25,7.5 l 5.25,1.5",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(0,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(30,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(60,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(90,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(120,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(150,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(180,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(210,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(240,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(270,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(300,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(330,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"})],wt=[e.h("circle",{cx:18,cy:18,r:10,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 4px; fill: rgb(34, 36, 42);"})],St="m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z",Ct="m 23,10 0,12.5 -12.5,0 0,5 12.5,0 0,12.5 5,0 0,-12.5 12.5,0 0,-5 -12.5,0 0,-12.5 -5,0 z",Nt=e.h("circle",{cx:25,cy:25,r:13,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2.5px; fill: white;"}),Tt="M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z",At="M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z",Mt="m44,60 m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",Ot="m47,61 m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",Pt="m 50,73 c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",kt=Object.freeze({__proto__:null,compensationIcon:"m 7.92,18 9,-6.5 0,13 z m 9.3,-0.4 8.7,-6.1 0,13 -8.7,-6.1 z",conditionalIcon:"M 10.5,8.5 l 14.5,0 l 0,18 l -14.5,0 Z M 12.5,11.5 l 10.5,0 M 12.5,14.5 l 10.5,0 M 12.5,17.5 l 10.5,0 M 12.5,20.5 l 10.5,0 M 12.5,23.5 l 10.5,0 M 12.5,26.5 l 10.5,0 ",errorIcon:"m 7.2,25.991999999999997 0.09350000000000001,-0.025300000000000003 7.3392,-9.610700000000001 7.667000000000001,8.9661 4.7003,-18.2204 -5.8707,11.6501 -7.299600000000001,-9.585400000000002 z",escalationIcon:"M 18,7.2 l 8,20 l -8,-7 l -8,7 Z",exclusiveIcon:St,inclusiveIcon:Nt,linkIcon:"m 20.52,9.468 0,4.4375 -13.5,0 0,6.75 13.5,0 0,4.4375 9.84375,-7.8125 -9.84375,-7.8125 z",loopMarker:Pt,manualTaskIcon:"M0.5,3.751L4.583,0.5009999999999999C4.583,0.5009999999999999,15.749,0.5839999999999999,16.666,0.5839999999999999S14.249,3.5009999999999994,15.166,3.5009999999999994S26.833,3.5009999999999994,27.75,3.5009999999999994C28.916,5.209,27.582,6.667999999999999,26.916,7.167999999999999S27.791,9.084999999999999,25.916,11.584999999999999C25.166,11.834999999999999,26.666,13.459999999999999,24.583000000000002,14.918C23.416,15.501,25.166,16.46,23.333000000000002,17.750999999999998C22.166,17.750999999999998,2.5000000000000036,17.833999999999996,2.5000000000000036,17.833999999999996L0.5000000000000036,16.500999999999998V3.751ZM13.5,7L27,7M13.5,11L26,11M14,14.5L25,14.5M8.2,3.1L15,3.1",messageIcon:"m 8.459999999999999,11.34 l 0,12.6 l 18.900000000000002,0 l 0,-12.6 z l 9.450000000000001,5.4 l 9.450000000000001,-5.4",parallelIcon:Ct,parallelMarker:Mt,scriptTaskIcon:"M6.402,0.5H20.902C20.902,0.5,15.069,3.333,15.069,6.083S19.486,12.083,19.486,15.25S15.319,20.333,15.319,20.333H0.235C0.235,20.333,5.235,17.665999999999997,5.235,15.332999999999998S0.6520000000000001,8.582999999999998,0.6520000000000001,6.082999999999998S6.402,0.5,6.402,0.5ZM3.5,4.5L13.5,4.5M3.8,8.5L13.8,8.5M6.3,12.5L16.3,12.5M6.5,16.5L16.5,16.5",sequentialMarker:Ot,serviceTaskIcon:Tt,signalIcon:"M 18,7.2 l 9,16.2 l -18,0 Z",style:{throw:"fill: rgb(34, 36, 42); stroke-linecap: round; stroke-linejoin: round; stroke: white; stroke-width: 1px;",catch:"fill: white; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;",nonIntermediate:"stroke-width: 1.5; stroke-dash-array: 6",intermediate:"stroke-width: 1.5"},terminateIcon:wt,timerIcon:Et,userTaskIcon:At});function Rt(t,n,o){var i=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return f(o,t),o.prototype.getShape=function(){var t=this.props.model,o=t,i=o.x,r=o.y,a=o.width,s=o.height,l=o.points,u=t.getNodeStyle();return e.h("g",{transform:"matrix(1 0 0 1 ".concat(i-a/2," ").concat(r-s/2,")")},e.h(e.Polygon,g(g({},u),{x:i,y:r,points:l})),"string"==typeof n?e.h("path",g(g({d:n},u),{fill:"rgb(34, 36, 42)",strokeWidth:1})):n)},o}(e.PolygonNode);return{type:t,view:i,model:function(t){function e(e,n){var i=this;return e.id||(e.id="Gateway_".concat(gt())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),e.properties=g(g({},o||{}),e.properties),(i=t.call(this,e,n)||this).points=[[25,0],[50,25],[25,50],[0,25]],ht.call(i),i}return f(e,t),e}(e.PolygonNodeModel)}}var Dt={parallel:Mt,sequential:Ot,loop:Pt};function Lt(t,n,o){var i=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return f(o,t),o.prototype.getLabelShape=function(){var t=this.props.model,o=t.x,i=t.y,r=t.width,a=t.height,s=t.getNodeStyle(),l=Array.isArray(n)?e.h.apply(void 0,E(["g",{transform:"matrix(1 0 0 1 ".concat(o-r/2," ").concat(i-a/2,")")}],_(n),!1)):e.h("path",{fill:s.stroke,d:n});return e.h("svg",{x:o-r/2+5,y:i-a/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},l)},o.prototype.getShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.radius,s=t.properties,l=t.getNodeStyle();return e.h("g",{},[e.h("rect",g(g({},l),{x:n-i/2,y:o-r/2,rx:a,ry:a,width:i,height:r,opacity:.95})),this.getLabelShape(),e.h("g",{transform:"matrix(1 0 0 1 ".concat(n-i/2," ").concat(o-r/2,")")},e.h("path",{fill:"white",strokeLinecap:"round",strokeLinejoin:"round",stroke:"rgb(34, 36, 42)",strokeWidth:"2",d:Dt[s.multiInstanceType]||""}))])},o}(e.RectNode),r=function(t){function e(e,n){var i,r=this;e.id||(e.id="Activity_".concat(gt()));var a=g(g({},o||{}),e.properties);return e.properties=a,r=t.call(this,e,n)||this,null===(i=null==a?void 0:a.boundaryEvents)||void 0===i||i.forEach((function(t){r.addBoundaryEvent(t)})),r.deleteProperty("boundaryEvents"),ht.call(r),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.isTaskNode=!0,this.boundaryEvents=[]},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return this.properties.isBoundaryEventTouchingTask&&(e.stroke="#00acff",e.strokeWidth=2),e},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return e.stroke="transparent",!e.hover&&(e.hover={}),e.hover.stroke="transparent",e},e.prototype.setTouching=function(t){this.setProperty("isBoundaryEventTouchingTask",t)},e.prototype.addBoundaryEvent=function(t){if(this.setTouching(!1),this.boundaryEvents.find((function(e){return e===t})))return!1;var e=this.graphModel.getNodeModelById(t);return null==e||e.setProperties({attachedToRef:this.id}),this.boundaryEvents.push(t),!0},e.prototype.deleteBoundaryEvent=function(t){this.boundaryEvents=this.boundaryEvents.filter((function(e){return e!==t}))},e}(e.RectNodeModel);return{type:t,view:i,model:r}}var It="object"==typeof global&&global&&global.Object===Object&&global,jt="object"==typeof self&&self&&self.Object===Object&&self,Bt=It||jt||Function("return this")(),Ht=Bt.Symbol,Ft=Object.prototype,zt=Ft.hasOwnProperty,Wt=Ft.toString,Gt=Ht?Ht.toStringTag:void 0;var Ut=Object.prototype.toString;var Xt="[object Null]",Vt="[object Undefined]",Yt=Ht?Ht.toStringTag:void 0;function qt(t){return null==t?void 0===t?Vt:Xt:Yt&&Yt in Object(t)?function(t){var e=zt.call(t,Gt),n=t[Gt];try{t[Gt]=void 0;var o=!0}catch(t){}var i=Wt.call(t);return o&&(e?t[Gt]=n:delete t[Gt]),i}(t):function(t){return Ut.call(t)}(t)}function Kt(t){return null!=t&&"object"==typeof t}var Zt="[object Symbol]";function $t(t){return"symbol"==typeof t||Kt(t)&&qt(t)==Zt}var Jt=NaN;function Qt(t){return"number"==typeof t?t:$t(t)?Jt:+t}function te(t,e){for(var n=-1,o=null==t?0:t.length,i=Array(o);++n<o;)i[n]=e(t[n],n,t);return i}var ee=Array.isArray,ne=1/0,oe=Ht?Ht.prototype:void 0,ie=oe?oe.toString:void 0;function re(t){if("string"==typeof t)return t;if(ee(t))return te(t,re)+"";if($t(t))return ie?ie.call(t):"";var e=t+"";return"0"==e&&1/t==-ne?"-0":e}function ae(t,e){return function(n,o){var i;if(void 0===n&&void 0===o)return e;if(void 0!==n&&(i=n),void 0!==o){if(void 0===i)return o;"string"==typeof n||"string"==typeof o?(n=re(n),o=re(o)):(n=Qt(n),o=Qt(o)),i=t(n,o)}return i}}var se=ae((function(t,e){return t+e}),0),le=/\s/;function ue(t){for(var e=t.length;e--&&le.test(t.charAt(e)););return e}var ce=/^\s+/;function de(t){return t?t.slice(0,ue(t)+1).replace(ce,""):t}function he(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var pe=NaN,fe=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,ve=/^0o[0-7]+$/i,ye=parseInt;function me(t){if("number"==typeof t)return t;if($t(t))return pe;if(he(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=he(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=de(t);var n=ge.test(t);return n||ve.test(t)?ye(t.slice(2),n?2:8):fe.test(t)?pe:+t}var be=1/0,xe=17976931348623157e292;function _e(t){return t?(t=me(t))===be||t===-be?(t<0?-1:1)*xe:t==t?t:0:0===t?t:0}function Ee(t){var e=_e(t),n=e%1;return e==e?n?e-n:e:0}function we(t){return t}var Se="[object AsyncFunction]",Ce="[object Function]",Ne="[object GeneratorFunction]",Te="[object Proxy]";function Ae(t){if(!he(t))return!1;var e=qt(t);return e==Ce||e==Ne||e==Se||e==Te}var Me,Oe=Bt["__core-js_shared__"],Pe=(Me=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+Me:"";var ke=Function.prototype.toString;function Re(t){if(null!=t){try{return ke.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var De=/^\[object .+?Constructor\]$/,Le=Function.prototype,Ie=Object.prototype,je=Le.toString,Be=Ie.hasOwnProperty,He=RegExp("^"+je.call(Be).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Fe(t){return!(!he(t)||function(t){return!!Pe&&Pe in t}(t))&&(Ae(t)?He:De).test(Re(t))}function ze(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Fe(n)?n:void 0}var We=ze(Bt,"WeakMap"),Ge=We&&new We,Ue=Ge?function(t,e){return Ge.set(t,e),t}:we,Xe=Object.create,Ve=function(){function t(){}return function(e){if(!he(e))return{};if(Xe)return Xe(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Ye(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Ve(t.prototype),o=t.apply(n,e);return he(o)?o:n}}var qe=1;function Ke(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var Ze=Math.max;function $e(t,e,n,o){for(var i=-1,r=t.length,a=n.length,s=-1,l=e.length,u=Ze(r-a,0),c=Array(l+u),d=!o;++s<l;)c[s]=e[s];for(;++i<a;)(d||i<r)&&(c[n[i]]=t[i]);for(;u--;)c[s++]=t[i++];return c}var Je=Math.max;function Qe(t,e,n,o){for(var i=-1,r=t.length,a=-1,s=n.length,l=-1,u=e.length,c=Je(r-s,0),d=Array(c+u),h=!o;++i<c;)d[i]=t[i];for(var p=i;++l<u;)d[p+l]=e[l];for(;++a<s;)(h||i<r)&&(d[p+n[a]]=t[i++]);return d}function tn(){}var en=4294967295;function nn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=en,this.__views__=[]}function on(){}nn.prototype=Ve(tn.prototype),nn.prototype.constructor=nn;var rn=Ge?function(t){return Ge.get(t)}:on,an={},sn=Object.prototype.hasOwnProperty;function ln(t){for(var e=t.name+"",n=an[e],o=sn.call(an,e)?n.length:0;o--;){var i=n[o],r=i.func;if(null==r||r==t)return i.name}return e}function un(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function cn(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}function dn(t){if(t instanceof nn)return t.clone();var e=new un(t.__wrapped__,t.__chain__);return e.__actions__=cn(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}un.prototype=Ve(tn.prototype),un.prototype.constructor=un;var hn=Object.prototype.hasOwnProperty;function pn(t){if(Kt(t)&&!ee(t)&&!(t instanceof nn)){if(t instanceof un)return t;if(hn.call(t,"__wrapped__"))return dn(t)}return new un(t)}function fn(t){var e=ln(t),n=pn[e];if("function"!=typeof n||!(e in nn.prototype))return!1;if(t===n)return!0;var o=rn(n);return!!o&&t===o[0]}pn.prototype=tn.prototype,pn.prototype.constructor=pn;var gn=Date.now;function vn(t){var e=0,n=0;return function(){var o=gn(),i=16-(o-n);if(n=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var yn=vn(Ue),mn=/\{\n\/\* \[wrapped with (.+)\] \*/,bn=/,? & /;var xn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function _n(t){return function(){return t}}var En=function(){try{var t=ze(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),wn=En?function(t,e){return En(t,"toString",{configurable:!0,enumerable:!1,value:_n(e),writable:!0})}:we,Sn=vn(wn);function Cn(t,e){for(var n=-1,o=null==t?0:t.length;++n<o&&!1!==e(t[n],n,t););return t}function Nn(t,e,n,o){for(var i=t.length,r=n+(o?1:-1);o?r--:++r<i;)if(e(t[r],r,t))return r;return-1}function Tn(t){return t!=t}function An(t,e,n){return e==e?function(t,e,n){for(var o=n-1,i=t.length;++o<i;)if(t[o]===e)return o;return-1}(t,e,n):Nn(t,Tn,n)}function Mn(t,e){return!!(null==t?0:t.length)&&An(t,e,0)>-1}var On=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function Pn(t,e,n){var o=e+"";return Sn(t,function(t,e){var n=e.length;if(!n)return t;var o=n-1;return e[o]=(n>1?"& ":"")+e[o],e=e.join(n>2?", ":" "),t.replace(xn,"{\n/* [wrapped with "+e+"] */\n")}(o,function(t,e){return Cn(On,(function(n){var o="_."+n[0];e&n[1]&&!Mn(t,o)&&t.push(o)})),t.sort()}(function(t){var e=t.match(mn);return e?e[1].split(bn):[]}(o),n)))}var kn=1,Rn=2,Dn=4,Ln=8,In=32,jn=64;function Bn(t,e,n,o,i,r,a,s,l,u){var c=e&Ln;e|=c?In:jn,(e&=~(c?jn:In))&Dn||(e&=~(kn|Rn));var d=[t,e,i,c?r:void 0,c?a:void 0,c?void 0:r,c?void 0:a,s,l,u],h=n.apply(void 0,d);return fn(t)&&yn(h,d),h.placeholder=o,Pn(h,t,e)}function Hn(t){return t.placeholder}var Fn=9007199254740991,zn=/^(?:0|[1-9]\d*)$/;function Wn(t,e){var n=typeof t;return!!(e=null==e?Fn:e)&&("number"==n||"symbol"!=n&&zn.test(t))&&t>-1&&t%1==0&&t<e}var Gn=Math.min;var Un="__lodash_placeholder__";function Xn(t,e){for(var n=-1,o=t.length,i=0,r=[];++n<o;){var a=t[n];a!==e&&a!==Un||(t[n]=Un,r[i++]=n)}return r}var Vn=1,Yn=2,qn=8,Kn=16,Zn=128,$n=512;function Jn(t,e,n,o,i,r,a,s,l,u){var c=e&Zn,d=e&Vn,h=e&Yn,p=e&(qn|Kn),f=e&$n,g=h?void 0:Ye(t);return function v(){for(var y=arguments.length,m=Array(y),b=y;b--;)m[b]=arguments[b];if(p)var x=Hn(v),_=function(t,e){for(var n=t.length,o=0;n--;)t[n]===e&&++o;return o}(m,x);if(o&&(m=$e(m,o,i,p)),r&&(m=Qe(m,r,a,p)),y-=_,p&&y<u){var E=Xn(m,x);return Bn(t,e,Jn,v.placeholder,n,m,E,s,l,u-y)}var w=d?n:this,S=h?w[t]:t;return y=m.length,s?m=function(t,e){for(var n=t.length,o=Gn(e.length,n),i=cn(t);o--;){var r=e[o];t[o]=Wn(r,n)?i[r]:void 0}return t}(m,s):f&&y>1&&m.reverse(),c&&l<y&&(m.length=l),this&&this!==Bt&&this instanceof v&&(S=g||Ye(S)),S.apply(w,m)}}var Qn=1;var to="__lodash_placeholder__",eo=1,no=2,oo=4,io=8,ro=128,ao=256,so=Math.min;var lo="Expected a function",uo=1,co=2,ho=8,po=16,fo=32,go=64,vo=Math.max;function yo(t,e,n,o,i,r,a,s){var l=e&co;if(!l&&"function"!=typeof t)throw new TypeError(lo);var u=o?o.length:0;if(u||(e&=~(fo|go),o=i=void 0),a=void 0===a?a:vo(Ee(a),0),s=void 0===s?s:Ee(s),u-=i?i.length:0,e&go){var c=o,d=i;o=i=void 0}var h=l?void 0:rn(t),p=[t,e,n,o,i,c,d,r,a,s];if(h&&function(t,e){var n=t[1],o=e[1],i=n|o,r=i<(eo|no|ro),a=o==ro&&n==io||o==ro&&n==ao&&t[7].length<=e[8]||o==(ro|ao)&&e[7].length<=e[8]&&n==io;if(!r&&!a)return t;o&eo&&(t[2]=e[2],i|=n&eo?0:oo);var s=e[3];if(s){var l=t[3];t[3]=l?$e(l,s,e[4]):s,t[4]=l?Xn(t[3],to):e[4]}(s=e[5])&&(l=t[5],t[5]=l?Qe(l,s,e[6]):s,t[6]=l?Xn(t[5],to):e[6]),(s=e[7])&&(t[7]=s),o&ro&&(t[8]=null==t[8]?e[8]:so(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(p,h),t=p[0],e=p[1],n=p[2],o=p[3],i=p[4],!(s=p[9]=void 0===p[9]?l?0:t.length:vo(p[9]-u,0))&&e&(ho|po)&&(e&=~(ho|po)),e&&e!=uo)f=e==ho||e==po?function(t,e,n){var o=Ye(t);return function i(){for(var r=arguments.length,a=Array(r),s=r,l=Hn(i);s--;)a[s]=arguments[s];var u=r<3&&a[0]!==l&&a[r-1]!==l?[]:Xn(a,l);return(r-=u.length)<n?Bn(t,e,Jn,i.placeholder,void 0,a,u,void 0,void 0,n-r):Ke(this&&this!==Bt&&this instanceof i?o:t,this,a)}}(t,e,s):e!=fo&&e!=(uo|fo)||i.length?Jn.apply(void 0,p):function(t,e,n,o){var i=e&Qn,r=Ye(t);return function e(){for(var a=-1,s=arguments.length,l=-1,u=o.length,c=Array(u+s),d=this&&this!==Bt&&this instanceof e?r:t;++l<u;)c[l]=o[l];for(;s--;)c[l++]=arguments[++a];return Ke(d,i?n:this,c)}}(t,e,n,o);else var f=function(t,e,n){var o=e&qe,i=Ye(t);return function e(){return(this&&this!==Bt&&this instanceof e?i:t).apply(o?n:this,arguments)}}(t,e,n);return Pn((h?Ue:yn)(f,p),t,e)}var mo=128;function bo(t,e,n){return e=n?void 0:e,e=t&&null==e?t.length:e,yo(t,mo,void 0,void 0,void 0,void 0,e)}function xo(t,e,n){"__proto__"==e&&En?En(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function _o(t,e){return t===e||t!=t&&e!=e}var Eo=Object.prototype.hasOwnProperty;function wo(t,e,n){var o=t[e];Eo.call(t,e)&&_o(o,n)&&(void 0!==n||e in t)||xo(t,e,n)}function So(t,e,n,o){var i=!n;n||(n={});for(var r=-1,a=e.length;++r<a;){var s=e[r],l=o?o(n[s],t[s],s,n,t):void 0;void 0===l&&(l=t[s]),i?xo(n,s,l):wo(n,s,l)}return n}var Co=Math.max;function No(t,e,n){return e=Co(void 0===e?t.length-1:e,0),function(){for(var o=arguments,i=-1,r=Co(o.length-e,0),a=Array(r);++i<r;)a[i]=o[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=o[i];return s[e]=n(a),Ke(t,this,s)}}function To(t,e){return Sn(No(t,e,we),t+"")}var Ao=9007199254740991;function Mo(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Ao}function Oo(t){return null!=t&&Mo(t.length)&&!Ae(t)}function Po(t,e,n){if(!he(n))return!1;var o=typeof e;return!!("number"==o?Oo(n)&&Wn(e,n.length):"string"==o&&e in n)&&_o(n[e],t)}function ko(t){return To((function(e,n){var o=-1,i=n.length,r=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(r=t.length>3&&"function"==typeof r?(i--,r):void 0,a&&Po(n[0],n[1],a)&&(r=i<3?void 0:r,i=1),e=Object(e);++o<i;){var s=n[o];s&&t(e,s,o,r)}return e}))}var Ro=Object.prototype;function Do(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ro)}function Lo(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}function Io(t){return Kt(t)&&"[object Arguments]"==qt(t)}var jo=Object.prototype,Bo=jo.hasOwnProperty,Ho=jo.propertyIsEnumerable,Fo=Io(function(){return arguments}())?Io:function(t){return Kt(t)&&Bo.call(t,"callee")&&!Ho.call(t,"callee")};function zo(){return!1}var Wo="object"==typeof t&&t&&!t.nodeType&&t,Go=Wo&&"object"==typeof module&&module&&!module.nodeType&&module,Uo=Go&&Go.exports===Wo?Bt.Buffer:void 0,Xo=(Uo?Uo.isBuffer:void 0)||zo,Vo={};function Yo(t){return function(e){return t(e)}}Vo["[object Float32Array]"]=Vo["[object Float64Array]"]=Vo["[object Int8Array]"]=Vo["[object Int16Array]"]=Vo["[object Int32Array]"]=Vo["[object Uint8Array]"]=Vo["[object Uint8ClampedArray]"]=Vo["[object Uint16Array]"]=Vo["[object Uint32Array]"]=!0,Vo["[object Arguments]"]=Vo["[object Array]"]=Vo["[object ArrayBuffer]"]=Vo["[object Boolean]"]=Vo["[object DataView]"]=Vo["[object Date]"]=Vo["[object Error]"]=Vo["[object Function]"]=Vo["[object Map]"]=Vo["[object Number]"]=Vo["[object Object]"]=Vo["[object RegExp]"]=Vo["[object Set]"]=Vo["[object String]"]=Vo["[object WeakMap]"]=!1;var qo="object"==typeof t&&t&&!t.nodeType&&t,Ko=qo&&"object"==typeof module&&module&&!module.nodeType&&module,Zo=Ko&&Ko.exports===qo&&It.process,$o=function(){try{var t=Ko&&Ko.require&&Ko.require("util").types;return t||Zo&&Zo.binding&&Zo.binding("util")}catch(t){}}(),Jo=$o&&$o.isTypedArray,Qo=Jo?Yo(Jo):function(t){return Kt(t)&&Mo(t.length)&&!!Vo[qt(t)]},ti=Object.prototype.hasOwnProperty;function ei(t,e){var n=ee(t),o=!n&&Fo(t),i=!n&&!o&&Xo(t),r=!n&&!o&&!i&&Qo(t),a=n||o||i||r,s=a?Lo(t.length,String):[],l=s.length;for(var u in t)!e&&!ti.call(t,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||r&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Wn(u,l))||s.push(u);return s}function ni(t,e){return function(n){return t(e(n))}}var oi=ni(Object.keys,Object),ii=Object.prototype.hasOwnProperty;function ri(t){if(!Do(t))return oi(t);var e=[];for(var n in Object(t))ii.call(t,n)&&"constructor"!=n&&e.push(n);return e}function ai(t){return Oo(t)?ei(t):ri(t)}var si=Object.prototype.hasOwnProperty,li=ko((function(t,e){if(Do(e)||Oo(e))So(e,ai(e),t);else for(var n in e)si.call(e,n)&&wo(t,n,e[n])}));var ui=Object.prototype.hasOwnProperty;function ci(t){if(!he(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Do(t),n=[];for(var o in t)("constructor"!=o||!e&&ui.call(t,o))&&n.push(o);return n}function di(t){return Oo(t)?ei(t,!0):ci(t)}var hi=ko((function(t,e){So(e,di(e),t)})),pi=ko((function(t,e,n,o){So(e,di(e),t,o)})),fi=ko((function(t,e,n,o){So(e,ai(e),t,o)})),gi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vi=/^\w*$/;function yi(t,e){if(ee(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!$t(t))||(vi.test(t)||!gi.test(t)||null!=e&&t in Object(e))}var mi=ze(Object,"create");var bi=Object.prototype.hasOwnProperty;var xi=Object.prototype.hasOwnProperty;function _i(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function Ei(t,e){for(var n=t.length;n--;)if(_o(t[n][0],e))return n;return-1}_i.prototype.clear=function(){this.__data__=mi?mi(null):{},this.size=0},_i.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},_i.prototype.get=function(t){var e=this.__data__;if(mi){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return bi.call(e,t)?e[t]:void 0},_i.prototype.has=function(t){var e=this.__data__;return mi?void 0!==e[t]:xi.call(e,t)},_i.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=mi&&void 0===e?"__lodash_hash_undefined__":e,this};var wi=Array.prototype.splice;function Si(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}Si.prototype.clear=function(){this.__data__=[],this.size=0},Si.prototype.delete=function(t){var e=this.__data__,n=Ei(e,t);return!(n<0)&&(n==e.length-1?e.pop():wi.call(e,n,1),--this.size,!0)},Si.prototype.get=function(t){var e=this.__data__,n=Ei(e,t);return n<0?void 0:e[n][1]},Si.prototype.has=function(t){return Ei(this.__data__,t)>-1},Si.prototype.set=function(t,e){var n=this.__data__,o=Ei(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};var Ci=ze(Bt,"Map");function Ni(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map}function Ti(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}Ti.prototype.clear=function(){this.size=0,this.__data__={hash:new _i,map:new(Ci||Si),string:new _i}},Ti.prototype.delete=function(t){var e=Ni(this,t).delete(t);return this.size-=e?1:0,e},Ti.prototype.get=function(t){return Ni(this,t).get(t)},Ti.prototype.has=function(t){return Ni(this,t).has(t)},Ti.prototype.set=function(t,e){var n=Ni(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};var Ai="Expected a function";function Mi(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Ai);var n=function(){var o=arguments,i=e?e.apply(this,o):o[0],r=n.cache;if(r.has(i))return r.get(i);var a=t.apply(this,o);return n.cache=r.set(i,a)||r,a};return n.cache=new(Mi.Cache||Ti),n}Mi.Cache=Ti;var Oi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pi=/\\(\\)?/g,ki=function(t){var e=Mi(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Oi,(function(t,n,o,i){e.push(o?i.replace(Pi,"$1"):n||t)})),e}));function Ri(t){return null==t?"":re(t)}function Di(t,e){return ee(t)?t:yi(t,e)?[t]:ki(Ri(t))}var Li=1/0;function Ii(t){if("string"==typeof t||$t(t))return t;var e=t+"";return"0"==e&&1/t==-Li?"-0":e}function ji(t,e){for(var n=0,o=(e=Di(e,t)).length;null!=t&&n<o;)t=t[Ii(e[n++])];return n&&n==o?t:void 0}function Bi(t,e,n){var o=null==t?void 0:ji(t,e);return void 0===o?n:o}function Hi(t,e){for(var n=-1,o=e.length,i=Array(o),r=null==t;++n<o;)i[n]=r?void 0:Bi(t,e[n]);return i}function Fi(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t}var zi=Ht?Ht.isConcatSpreadable:void 0;function Wi(t){return ee(t)||Fo(t)||!!(zi&&t&&t[zi])}function Gi(t,e,n,o,i){var r=-1,a=t.length;for(n||(n=Wi),i||(i=[]);++r<a;){var s=t[r];e>0&&n(s)?e>1?Gi(s,e-1,n,o,i):Fi(i,s):o||(i[i.length]=s)}return i}function Ui(t){return(null==t?0:t.length)?Gi(t,1):[]}function Xi(t){return Sn(No(t,void 0,Ui),t+"")}var Vi=Xi(Hi),Yi=ni(Object.getPrototypeOf,Object),qi="[object Object]",Ki=Function.prototype,Zi=Object.prototype,$i=Ki.toString,Ji=Zi.hasOwnProperty,Qi=$i.call(Object);function tr(t){if(!Kt(t)||qt(t)!=qi)return!1;var e=Yi(t);if(null===e)return!0;var n=Ji.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&$i.call(n)==Qi}var er="[object DOMException]",nr="[object Error]";function or(t){if(!Kt(t))return!1;var e=qt(t);return e==nr||e==er||"string"==typeof t.message&&"string"==typeof t.name&&!tr(t)}var ir=To((function(t,e){try{return Ke(t,void 0,e)}catch(t){return or(t)?t:new Error(t)}})),rr="Expected a function";function ar(t,e){var n;if("function"!=typeof e)throw new TypeError(rr);return t=Ee(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var sr=To((function(t,e,n){var o=1;if(n.length){var i=Xn(n,Hn(sr));o|=32}return yo(t,o,e,n,i)}));sr.placeholder={};var lr=Xi((function(t,e){return Cn(e,(function(e){e=Ii(e),xo(t,e,sr(t[e],t))})),t})),ur=To((function(t,e,n){var o=3;if(n.length){var i=Xn(n,Hn(ur));o|=32}return yo(e,o,t,n,i)}));function cr(t,e,n){var o=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var r=Array(i);++o<i;)r[o]=t[o+e];return r}function dr(t,e,n){var o=t.length;return n=void 0===n?o:n,!e&&n>=o?t:cr(t,e,n)}ur.placeholder={};var hr=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function pr(t){return hr.test(t)}var fr="\\ud800-\\udfff",gr="["+fr+"]",vr="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",yr="\\ud83c[\\udffb-\\udfff]",mr="[^"+fr+"]",br="(?:\\ud83c[\\udde6-\\uddff]){2}",xr="[\\ud800-\\udbff][\\udc00-\\udfff]",_r="(?:"+vr+"|"+yr+")"+"?",Er="[\\ufe0e\\ufe0f]?",wr=Er+_r+("(?:\\u200d(?:"+[mr,br,xr].join("|")+")"+Er+_r+")*"),Sr="(?:"+[mr+vr+"?",vr,br,xr,gr].join("|")+")",Cr=RegExp(yr+"(?="+yr+")|"+Sr+wr,"g");function Nr(t){return pr(t)?function(t){return t.match(Cr)||[]}(t):function(t){return t.split("")}(t)}function Tr(t){return function(e){var n=pr(e=Ri(e))?Nr(e):void 0,o=n?n[0]:e.charAt(0),i=n?dr(n,1).join(""):e.slice(1);return o[t]()+i}}var Ar=Tr("toUpperCase");function Mr(t){return Ar(Ri(t).toLowerCase())}function Or(t,e,n,o){var i=-1,r=null==t?0:t.length;for(o&&r&&(n=t[++i]);++i<r;)n=e(n,t[i],i,t);return n}function Pr(t){return function(e){return null==t?void 0:t[e]}}var kr=Pr({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Rr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Dr=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");function Lr(t){return(t=Ri(t))&&t.replace(Rr,kr).replace(Dr,"")}var Ir=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var jr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Br="\\ud800-\\udfff",Hr="\\u2700-\\u27bf",Fr="a-z\\xdf-\\xf6\\xf8-\\xff",zr="A-Z\\xc0-\\xd6\\xd8-\\xde",Wr="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Gr="["+Wr+"]",Ur="\\d+",Xr="["+Hr+"]",Vr="["+Fr+"]",Yr="[^"+Br+Wr+Ur+Hr+Fr+zr+"]",qr="(?:\\ud83c[\\udde6-\\uddff]){2}",Kr="[\\ud800-\\udbff][\\udc00-\\udfff]",Zr="["+zr+"]",$r="(?:"+Vr+"|"+Yr+")",Jr="(?:"+Zr+"|"+Yr+")",Qr="(?:['’](?:d|ll|m|re|s|t|ve))?",ta="(?:['’](?:D|LL|M|RE|S|T|VE))?",ea="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",na="[\\ufe0e\\ufe0f]?",oa=na+ea+("(?:\\u200d(?:"+["[^"+Br+"]",qr,Kr].join("|")+")"+na+ea+")*"),ia="(?:"+[Xr,qr,Kr].join("|")+")"+oa,ra=RegExp([Zr+"?"+Vr+"+"+Qr+"(?="+[Gr,Zr,"$"].join("|")+")",Jr+"+"+ta+"(?="+[Gr,Zr+$r,"$"].join("|")+")",Zr+"?"+$r+"+"+Qr,Zr+"+"+ta,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ur,ia].join("|"),"g");function aa(t,e,n){return t=Ri(t),void 0===(e=n?void 0:e)?function(t){return jr.test(t)}(t)?function(t){return t.match(ra)||[]}(t):function(t){return t.match(Ir)||[]}(t):t.match(e)||[]}var sa=RegExp("['’]","g");function la(t){return function(e){return Or(aa(Lr(e).replace(sa,"")),t,"")}}var ua=la((function(t,e,n){return e=e.toLowerCase(),t+(n?Mr(e):e)}));var ca=Bt.isFinite,da=Math.min;function ha(t){var e=Math[t];return function(t,n){if(t=me(t),(n=null==n?0:da(Ee(n),292))&&ca(t)){var o=(Ri(t)+"e").split("e");return+((o=(Ri(e(o[0]+"e"+(+o[1]+n)))+"e").split("e"))[0]+"e"+(+o[1]-n))}return e(t)}}var pa=ha("ceil");function fa(t){var e=pn(t);return e.__chain__=!0,e}var ga=Math.ceil,va=Math.max;function ya(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function ma(t){var e=this.__data__=new Si(t);this.size=e.size}function ba(t,e){return t&&So(e,ai(e),t)}ma.prototype.clear=function(){this.__data__=new Si,this.size=0},ma.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},ma.prototype.get=function(t){return this.__data__.get(t)},ma.prototype.has=function(t){return this.__data__.has(t)},ma.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Si){var o=n.__data__;if(!Ci||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ti(o)}return n.set(t,e),this.size=n.size,this};var xa="object"==typeof t&&t&&!t.nodeType&&t,_a=xa&&"object"==typeof module&&module&&!module.nodeType&&module,Ea=_a&&_a.exports===xa?Bt.Buffer:void 0,wa=Ea?Ea.allocUnsafe:void 0;function Sa(t,e){if(e)return t.slice();var n=t.length,o=wa?wa(n):new t.constructor(n);return t.copy(o),o}function Ca(t,e){for(var n=-1,o=null==t?0:t.length,i=0,r=[];++n<o;){var a=t[n];e(a,n,t)&&(r[i++]=a)}return r}function Na(){return[]}var Ta=Object.prototype.propertyIsEnumerable,Aa=Object.getOwnPropertySymbols,Ma=Aa?function(t){return null==t?[]:(t=Object(t),Ca(Aa(t),(function(e){return Ta.call(t,e)})))}:Na;var Oa=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Fi(e,Ma(t)),t=Yi(t);return e}:Na;function Pa(t,e,n){var o=e(t);return ee(t)?o:Fi(o,n(t))}function ka(t){return Pa(t,ai,Ma)}function Ra(t){return Pa(t,di,Oa)}var Da=ze(Bt,"DataView"),La=ze(Bt,"Promise"),Ia=ze(Bt,"Set"),ja="[object Map]",Ba="[object Promise]",Ha="[object Set]",Fa="[object WeakMap]",za="[object DataView]",Wa=Re(Da),Ga=Re(Ci),Ua=Re(La),Xa=Re(Ia),Va=Re(We),Ya=qt;(Da&&Ya(new Da(new ArrayBuffer(1)))!=za||Ci&&Ya(new Ci)!=ja||La&&Ya(La.resolve())!=Ba||Ia&&Ya(new Ia)!=Ha||We&&Ya(new We)!=Fa)&&(Ya=function(t){var e=qt(t),n="[object Object]"==e?t.constructor:void 0,o=n?Re(n):"";if(o)switch(o){case Wa:return za;case Ga:return ja;case Ua:return Ba;case Xa:return Ha;case Va:return Fa}return e});var qa=Ya,Ka=Object.prototype.hasOwnProperty;var Za=Bt.Uint8Array;function $a(t){var e=new t.constructor(t.byteLength);return new Za(e).set(new Za(t)),e}var Ja=/\w*$/;var Qa=Ht?Ht.prototype:void 0,ts=Qa?Qa.valueOf:void 0;function es(t,e){var n=e?$a(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var ns="[object Boolean]",os="[object Date]",is="[object Map]",rs="[object Number]",as="[object RegExp]",ss="[object Set]",ls="[object String]",us="[object Symbol]",cs="[object ArrayBuffer]",ds="[object DataView]",hs="[object Float32Array]",ps="[object Float64Array]",fs="[object Int8Array]",gs="[object Int16Array]",vs="[object Int32Array]",ys="[object Uint8Array]",ms="[object Uint8ClampedArray]",bs="[object Uint16Array]",xs="[object Uint32Array]";function _s(t,e,n){var o,i=t.constructor;switch(e){case cs:return $a(t);case ns:case os:return new i(+t);case ds:return function(t,e){var n=e?$a(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case hs:case ps:case fs:case gs:case vs:case ys:case ms:case bs:case xs:return es(t,n);case is:return new i;case rs:case ls:return new i(t);case as:return function(t){var e=new t.constructor(t.source,Ja.exec(t));return e.lastIndex=t.lastIndex,e}(t);case ss:return new i;case us:return o=t,ts?Object(ts.call(o)):{}}}function Es(t){return"function"!=typeof t.constructor||Do(t)?{}:Ve(Yi(t))}var ws=$o&&$o.isMap,Ss=ws?Yo(ws):function(t){return Kt(t)&&"[object Map]"==qa(t)};var Cs=$o&&$o.isSet,Ns=Cs?Yo(Cs):function(t){return Kt(t)&&"[object Set]"==qa(t)},Ts=1,As=2,Ms=4,Os="[object Arguments]",Ps="[object Function]",ks="[object GeneratorFunction]",Rs="[object Object]",Ds={};function Ls(t,e,n,o,i,r){var a,s=e&Ts,l=e&As,u=e&Ms;if(n&&(a=i?n(t,o,i,r):n(t)),void 0!==a)return a;if(!he(t))return t;var c=ee(t);if(c){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Ka.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!s)return cn(t,a)}else{var d=qa(t),h=d==Ps||d==ks;if(Xo(t))return Sa(t,s);if(d==Rs||d==Os||h&&!i){if(a=l||h?{}:Es(t),!s)return l?function(t,e){return So(t,Oa(t),e)}(t,function(t,e){return t&&So(e,di(e),t)}(a,t)):function(t,e){return So(t,Ma(t),e)}(t,ba(a,t))}else{if(!Ds[d])return i?t:{};a=_s(t,d,s)}}r||(r=new ma);var p=r.get(t);if(p)return p;r.set(t,a),Ns(t)?t.forEach((function(o){a.add(Ls(o,e,n,o,t,r))})):Ss(t)&&t.forEach((function(o,i){a.set(i,Ls(o,e,n,i,t,r))}));var f=c?void 0:(u?l?Ra:ka:l?di:ai)(t);return Cn(f||t,(function(o,i){f&&(o=t[i=o]),wo(a,i,Ls(o,e,n,i,t,r))})),a}Ds[Os]=Ds["[object Array]"]=Ds["[object ArrayBuffer]"]=Ds["[object DataView]"]=Ds["[object Boolean]"]=Ds["[object Date]"]=Ds["[object Float32Array]"]=Ds["[object Float64Array]"]=Ds["[object Int8Array]"]=Ds["[object Int16Array]"]=Ds["[object Int32Array]"]=Ds["[object Map]"]=Ds["[object Number]"]=Ds[Rs]=Ds["[object RegExp]"]=Ds["[object Set]"]=Ds["[object String]"]=Ds["[object Symbol]"]=Ds["[object Uint8Array]"]=Ds["[object Uint8ClampedArray]"]=Ds["[object Uint16Array]"]=Ds["[object Uint32Array]"]=!0,Ds["[object Error]"]=Ds[Ps]=Ds["[object WeakMap]"]=!1;function Is(t){return Ls(t,5)}function js(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],o=t;o--;)e[o-1]=arguments[o];return Fi(ee(n)?cn(n):[n],Gi(e,1))}function Bs(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Ti;++e<n;)this.add(t[e])}function Hs(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1}function Fs(t,e){return t.has(e)}Bs.prototype.add=Bs.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Bs.prototype.has=function(t){return this.__data__.has(t)};var zs=1,Ws=2;function Gs(t,e,n,o,i,r){var a=n&zs,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var u=r.get(t),c=r.get(e);if(u&&c)return u==e&&c==t;var d=-1,h=!0,p=n&Ws?new Bs:void 0;for(r.set(t,e),r.set(e,t);++d<s;){var f=t[d],g=e[d];if(o)var v=a?o(g,f,d,e,t,r):o(f,g,d,t,e,r);if(void 0!==v){if(v)continue;h=!1;break}if(p){if(!Hs(e,(function(t,e){if(!Fs(p,e)&&(f===t||i(f,t,n,o,r)))return p.push(e)}))){h=!1;break}}else if(f!==g&&!i(f,g,n,o,r)){h=!1;break}}return r.delete(t),r.delete(e),h}function Us(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n}function Xs(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var Vs=1,Ys=2,qs="[object Boolean]",Ks="[object Date]",Zs="[object Error]",$s="[object Map]",Js="[object Number]",Qs="[object RegExp]",tl="[object Set]",el="[object String]",nl="[object Symbol]",ol="[object ArrayBuffer]",il="[object DataView]",rl=Ht?Ht.prototype:void 0,al=rl?rl.valueOf:void 0;var sl=1,ll=Object.prototype.hasOwnProperty;var ul=1,cl="[object Arguments]",dl="[object Array]",hl="[object Object]",pl=Object.prototype.hasOwnProperty;function fl(t,e,n,o,i,r){var a=ee(t),s=ee(e),l=a?dl:qa(t),u=s?dl:qa(e),c=(l=l==cl?hl:l)==hl,d=(u=u==cl?hl:u)==hl,h=l==u;if(h&&Xo(t)){if(!Xo(e))return!1;a=!0,c=!1}if(h&&!c)return r||(r=new ma),a||Qo(t)?Gs(t,e,n,o,i,r):function(t,e,n,o,i,r,a){switch(n){case il:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ol:return!(t.byteLength!=e.byteLength||!r(new Za(t),new Za(e)));case qs:case Ks:case Js:return _o(+t,+e);case Zs:return t.name==e.name&&t.message==e.message;case Qs:case el:return t==e+"";case $s:var s=Us;case tl:var l=o&Vs;if(s||(s=Xs),t.size!=e.size&&!l)return!1;var u=a.get(t);if(u)return u==e;o|=Ys,a.set(t,e);var c=Gs(s(t),s(e),o,i,r,a);return a.delete(t),c;case nl:if(al)return al.call(t)==al.call(e)}return!1}(t,e,l,n,o,i,r);if(!(n&ul)){var p=c&&pl.call(t,"__wrapped__"),f=d&&pl.call(e,"__wrapped__");if(p||f){var g=p?t.value():t,v=f?e.value():e;return r||(r=new ma),i(g,v,n,o,r)}}return!!h&&(r||(r=new ma),function(t,e,n,o,i,r){var a=n&sl,s=ka(t),l=s.length;if(l!=ka(e).length&&!a)return!1;for(var u=l;u--;){var c=s[u];if(!(a?c in e:ll.call(e,c)))return!1}var d=r.get(t),h=r.get(e);if(d&&h)return d==e&&h==t;var p=!0;r.set(t,e),r.set(e,t);for(var f=a;++u<l;){var g=t[c=s[u]],v=e[c];if(o)var y=a?o(v,g,c,e,t,r):o(g,v,c,t,e,r);if(!(void 0===y?g===v||i(g,v,n,o,r):y)){p=!1;break}f||(f="constructor"==c)}if(p&&!f){var m=t.constructor,b=e.constructor;m==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(p=!1)}return r.delete(t),r.delete(e),p}(t,e,n,o,i,r))}function gl(t,e,n,o,i){return t===e||(null==t||null==e||!Kt(t)&&!Kt(e)?t!=t&&e!=e:fl(t,e,n,o,gl,i))}var vl=1,yl=2;function ml(t,e,n,o){var i=n.length,r=i,a=!o;if(null==t)return!r;for(t=Object(t);i--;){var s=n[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<r;){var l=(s=n[i])[0],u=t[l],c=s[1];if(a&&s[2]){if(void 0===u&&!(l in t))return!1}else{var d=new ma;if(o)var h=o(u,c,l,t,e,d);if(!(void 0===h?gl(c,u,vl|yl,o,d):h))return!1}}return!0}function bl(t){return t==t&&!he(t)}function xl(t){for(var e=ai(t),n=e.length;n--;){var o=e[n],i=t[o];e[n]=[o,i,bl(i)]}return e}function _l(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function El(t){var e=xl(t);return 1==e.length&&e[0][2]?_l(e[0][0],e[0][1]):function(n){return n===t||ml(n,t,e)}}function wl(t,e){return null!=t&&e in Object(t)}function Sl(t,e,n){for(var o=-1,i=(e=Di(e,t)).length,r=!1;++o<i;){var a=Ii(e[o]);if(!(r=null!=t&&n(t,a)))break;t=t[a]}return r||++o!=i?r:!!(i=null==t?0:t.length)&&Mo(i)&&Wn(a,i)&&(ee(t)||Fo(t))}function Cl(t,e){return null!=t&&Sl(t,e,wl)}var Nl=1,Tl=2;function Al(t,e){return yi(t)&&bl(e)?_l(Ii(t),e):function(n){var o=Bi(n,t);return void 0===o&&o===e?Cl(n,t):gl(e,o,Nl|Tl)}}function Ml(t){return function(e){return null==e?void 0:e[t]}}function Ol(t){return yi(t)?Ml(Ii(t)):function(t){return function(e){return ji(e,t)}}(t)}function Pl(t){return"function"==typeof t?t:null==t?we:"object"==typeof t?ee(t)?Al(t[0],t[1]):El(t):Ol(t)}function kl(t,e,n){var o=n.length;if(null==t)return!o;for(t=Object(t);o--;){var i=n[o],r=e[i],a=t[i];if(void 0===a&&!(i in t)||!r(a))return!1}return!0}function Rl(t,e,n,o){for(var i=-1,r=null==t?0:t.length;++i<r;){var a=t[i];e(o,a,n(a),t)}return o}function Dl(t){return function(e,n,o){for(var i=-1,r=Object(e),a=o(e),s=a.length;s--;){var l=a[t?s:++i];if(!1===n(r[l],l,r))break}return e}}var Ll=Dl();function Il(t,e){return t&&Ll(t,e,ai)}function jl(t,e){return function(n,o){if(null==n)return n;if(!Oo(n))return t(n,o);for(var i=n.length,r=e?i:-1,a=Object(n);(e?r--:++r<i)&&!1!==o(a[r],r,a););return n}}var Bl=jl(Il);function Hl(t,e,n,o){return Bl(t,(function(t,i,r){e(o,t,n(t),r)})),o}function Fl(t,e){return function(n,o){var i=ee(n)?Rl:Hl,r=e?e():{};return i(n,t,Pl(o),r)}}var zl=Object.prototype.hasOwnProperty,Wl=Fl((function(t,e,n){zl.call(t,n)?++t[n]:xo(t,n,1)}));function Gl(t,e,n){var o=yo(t,8,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return o.placeholder=Gl.placeholder,o}Gl.placeholder={};function Ul(t,e,n){var o=yo(t,16,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return o.placeholder=Ul.placeholder,o}Ul.placeholder={};var Xl=function(){return Bt.Date.now()},Vl="Expected a function",Yl=Math.max,ql=Math.min;function Kl(t,e,n){var o,i,r,a,s,l,u=0,c=!1,d=!1,h=!0;if("function"!=typeof t)throw new TypeError(Vl);function p(e){var n=o,r=i;return o=i=void 0,u=e,a=t.apply(r,n)}function f(t){var n=t-l;return void 0===l||n>=e||n<0||d&&t-u>=r}function g(){var t=Xl();if(f(t))return v(t);s=setTimeout(g,function(t){var n=e-(t-l);return d?ql(n,r-(t-u)):n}(t))}function v(t){return s=void 0,h&&o?p(t):(o=i=void 0,a)}function y(){var t=Xl(),n=f(t);if(o=arguments,i=this,l=t,n){if(void 0===s)return function(t){return u=t,s=setTimeout(g,e),c?p(t):a}(l);if(d)return clearTimeout(s),s=setTimeout(g,e),p(l)}return void 0===s&&(s=setTimeout(g,e)),a}return e=me(e)||0,he(n)&&(c=!!n.leading,r=(d="maxWait"in n)?Yl(me(n.maxWait)||0,e):r,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,o=l=i=s=void 0},y.flush=function(){return void 0===s?a:v(Xl())},y}var Zl=Object.prototype,$l=Zl.hasOwnProperty,Jl=To((function(t,e){t=Object(t);var n=-1,o=e.length,i=o>2?e[2]:void 0;for(i&&Po(e[0],e[1],i)&&(o=1);++n<o;)for(var r=e[n],a=di(r),s=-1,l=a.length;++s<l;){var u=a[s],c=t[u];(void 0===c||_o(c,Zl[u])&&!$l.call(t,u))&&(t[u]=r[u])}return t}));function Ql(t,e,n){(void 0!==n&&!_o(t[e],n)||void 0===n&&!(e in t))&&xo(t,e,n)}function tu(t){return Kt(t)&&Oo(t)}function eu(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function nu(t){return So(t,di(t))}function ou(t,e,n,o,i){t!==e&&Ll(e,(function(r,a){if(i||(i=new ma),he(r))!function(t,e,n,o,i,r,a){var s=eu(t,n),l=eu(e,n),u=a.get(l);if(u)Ql(t,n,u);else{var c=r?r(s,l,n+"",t,e,a):void 0,d=void 0===c;if(d){var h=ee(l),p=!h&&Xo(l),f=!h&&!p&&Qo(l);c=l,h||p||f?ee(s)?c=s:tu(s)?c=cn(s):p?(d=!1,c=Sa(l,!0)):f?(d=!1,c=es(l,!0)):c=[]:tr(l)||Fo(l)?(c=s,Fo(s)?c=nu(s):he(s)&&!Ae(s)||(c=Es(l))):d=!1}d&&(a.set(l,c),i(c,l,o,r,a),a.delete(l)),Ql(t,n,c)}}(t,e,a,n,ou,o,i);else{var s=o?o(eu(t,a),r,a+"",t,e,i):void 0;void 0===s&&(s=r),Ql(t,a,s)}}),di)}function iu(t,e,n,o,i,r){return he(t)&&he(e)&&(r.set(e,t),ou(t,e,void 0,iu,r),r.delete(e)),t}var ru=ko((function(t,e,n,o){ou(t,e,n,o)})),au=To((function(t){return t.push(void 0,iu),Ke(ru,void 0,t)}));function su(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}var lu=To((function(t,e){return su(t,1,e)})),uu=To((function(t,e,n){return su(t,me(e)||0,n)}));function cu(t,e,n){for(var o=-1,i=null==t?0:t.length;++o<i;)if(n(e,t[o]))return!0;return!1}var du=200;function hu(t,e,n,o){var i=-1,r=Mn,a=!0,s=t.length,l=[],u=e.length;if(!s)return l;n&&(e=te(e,Yo(n))),o?(r=cu,a=!1):e.length>=du&&(r=Fs,a=!1,e=new Bs(e));t:for(;++i<s;){var c=t[i],d=null==n?c:n(c);if(c=o||0!==c?c:0,a&&d==d){for(var h=u;h--;)if(e[h]===d)continue t;l.push(c)}else r(e,d,o)||l.push(c)}return l}var pu=To((function(t,e){return tu(t)?hu(t,Gi(e,1,tu,!0)):[]}));function fu(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var gu=To((function(t,e){var n=fu(e);return tu(n)&&(n=void 0),tu(t)?hu(t,Gi(e,1,tu,!0),Pl(n)):[]})),vu=To((function(t,e){var n=fu(e);return tu(n)&&(n=void 0),tu(t)?hu(t,Gi(e,1,tu,!0),void 0,n):[]})),yu=ae((function(t,e){return t/e}),1);function mu(t,e,n,o){for(var i=t.length,r=o?i:-1;(o?r--:++r<i)&&e(t[r],r,t););return n?cr(t,o?0:r,o?r+1:i):cr(t,o?r+1:0,o?i:r)}function bu(t){return"function"==typeof t?t:we}function xu(t,e){return(ee(t)?Cn:Bl)(t,bu(e))}function _u(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}var Eu=Dl(!0);function wu(t,e){return t&&Eu(t,e,ai)}var Su=jl(wu,!0);function Cu(t,e){return(ee(t)?_u:Su)(t,bu(e))}function Nu(t){return function(e){var n=qa(e);return"[object Map]"==n?Us(e):"[object Set]"==n?function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}(e):function(t,e){return te(e,(function(e){return[e,t[e]]}))}(e,t(e))}}var Tu=Nu(ai),Au=Nu(di),Mu=Pr({"&":"&","<":"<",">":">",'"':""","'":"'"}),Ou=/[&<>"']/g,Pu=RegExp(Ou.source);function ku(t){return(t=Ri(t))&&Pu.test(t)?t.replace(Ou,Mu):t}var Ru=/[\\^$.*+?()[\]{}|]/g,Du=RegExp(Ru.source);function Lu(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(!e(t[n],n,t))return!1;return!0}function Iu(t,e){var n=!0;return Bl(t,(function(t,o,i){return n=!!e(t,o,i)})),n}var ju=4294967295;function Bu(t){return t?ya(Ee(t),0,ju):0}function Hu(t,e){var n=[];return Bl(t,(function(t,o,i){e(t,o,i)&&n.push(t)})),n}function Fu(t,e){return(ee(t)?Ca:Hu)(t,Pl(e))}function zu(t){return function(e,n,o){var i=Object(e);if(!Oo(e)){var r=Pl(n);e=ai(e),n=function(t){return r(i[t],t,i)}}var a=t(e,n,o);return a>-1?i[r?e[a]:a]:void 0}}var Wu=Math.max;function Gu(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var i=null==n?0:Ee(n);return i<0&&(i=Wu(o+i,0)),Nn(t,Pl(e),i)}var Uu=zu(Gu);function Xu(t,e,n){var o;return n(t,(function(t,n,i){if(e(t,n,i))return o=n,!1})),o}var Vu=Math.max,Yu=Math.min;function qu(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var i=o-1;return void 0!==n&&(i=Ee(n),i=n<0?Vu(o+i,0):Yu(i,o-1)),Nn(t,Pl(e),i,!0)}var Ku=zu(qu);function Zu(t){return t&&t.length?t[0]:void 0}function $u(t,e){var n=-1,o=Oo(t)?Array(t.length):[];return Bl(t,(function(t,i,r){o[++n]=e(t,i,r)})),o}function Ju(t,e){return(ee(t)?te:$u)(t,Pl(e))}var Qu=1/0;var tc=1/0;var ec=ha("floor");function nc(t){return Xi((function(e){var n=e.length,o=n,i=un.prototype.thru;for(t&&e.reverse();o--;){var r=e[o];if("function"!=typeof r)throw new TypeError("Expected a function");if(i&&!a&&"wrapper"==ln(r))var a=new un([],!0)}for(o=a?o:n;++o<n;){var s=ln(r=e[o]),l="wrapper"==s?rn(r):void 0;a=l&&fn(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?a[ln(l[0])].apply(a,l[3]):1==r.length&&fn(r)?a[s]():a.thru(r)}return function(){var t=arguments,o=t[0];if(a&&1==t.length&&ee(o))return a.plant(o).value();for(var i=0,r=n?e[i].apply(this,t):o;++i<n;)r=e[i].call(this,r);return r}}))}var oc=nc(),ic=nc(!0);function rc(t,e){return Ca(e,(function(e){return Ae(t[e])}))}var ac=Object.prototype.hasOwnProperty,sc=Fl((function(t,e,n){ac.call(t,n)?t[n].push(e):xo(t,n,[e])}));function lc(t,e){return t>e}function uc(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=me(e),n=me(n)),t(e,n)}}var cc=uc(lc),dc=uc((function(t,e){return t>=e})),hc=Object.prototype.hasOwnProperty;function pc(t,e){return null!=t&&hc.call(t,e)}function fc(t,e){return null!=t&&Sl(t,e,pc)}var gc=Math.max,vc=Math.min;var yc="[object String]";function mc(t){return"string"==typeof t||!ee(t)&&Kt(t)&&qt(t)==yc}function bc(t,e){return te(e,(function(e){return t[e]}))}function xc(t){return null==t?[]:bc(t,ai(t))}var _c=Math.max;var Ec=Math.max;var wc=Math.min;function Sc(t,e,n){for(var o=n?cu:Mn,i=t[0].length,r=t.length,a=r,s=Array(r),l=1/0,u=[];a--;){var c=t[a];a&&e&&(c=te(c,Yo(e))),l=wc(c.length,l),s[a]=!n&&(e||i>=120&&c.length>=120)?new Bs(a&&c):void 0}c=t[0];var d=-1,h=s[0];t:for(;++d<i&&u.length<l;){var p=c[d],f=e?e(p):p;if(p=n||0!==p?p:0,!(h?Fs(h,f):o(u,f,n))){for(a=r;--a;){var g=s[a];if(!(g?Fs(g,f):o(t[a],f,n)))continue t}h&&h.push(f),u.push(p)}}return u}function Cc(t){return tu(t)?t:[]}var Nc=To((function(t){var e=te(t,Cc);return e.length&&e[0]===t[0]?Sc(e):[]})),Tc=To((function(t){var e=fu(t),n=te(t,Cc);return e===fu(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?Sc(n,Pl(e)):[]})),Ac=To((function(t){var e=fu(t),n=te(t,Cc);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?Sc(n,void 0,e):[]}));function Mc(t,e){return function(n,o){return function(t,e,n,o){return Il(t,(function(t,i,r){e(o,n(t),i,r)})),o}(n,t,e(o),{})}}var Oc=Object.prototype.toString,Pc=Mc((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Oc.call(e)),t[e]=n}),_n(we)),kc=Object.prototype,Rc=kc.hasOwnProperty,Dc=kc.toString,Lc=Mc((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Dc.call(e)),Rc.call(t,e)?t[e].push(n):t[e]=[n]}),Pl);function Ic(t,e){return e.length<2?t:ji(t,cr(e,0,-1))}function jc(t,e,n){var o=null==(t=Ic(t,e=Di(e,t)))?t:t[Ii(fu(e))];return null==o?void 0:Ke(o,t,n)}var Bc=To(jc),Hc=To((function(t,e,n){var o=-1,i="function"==typeof e,r=Oo(t)?Array(t.length):[];return Bl(t,(function(t){r[++o]=i?Ke(e,t,n):jc(t,e,n)})),r}));var Fc=$o&&$o.isArrayBuffer,zc=Fc?Yo(Fc):function(t){return Kt(t)&&"[object ArrayBuffer]"==qt(t)};function Wc(t){return!0===t||!1===t||Kt(t)&&"[object Boolean]"==qt(t)}var Gc=$o&&$o.isDate,Uc=Gc?Yo(Gc):function(t){return Kt(t)&&"[object Date]"==qt(t)};var Xc=Object.prototype.hasOwnProperty;function Vc(t){if(null==t)return!0;if(Oo(t)&&(ee(t)||"string"==typeof t||"function"==typeof t.splice||Xo(t)||Qo(t)||Fo(t)))return!t.length;var e=qa(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(Do(t))return!ri(t).length;for(var n in t)if(Xc.call(t,n))return!1;return!0}var Yc=Bt.isFinite;function qc(t){return"number"==typeof t&&t==Ee(t)}var Kc="[object Number]";function Zc(t){return"number"==typeof t||Kt(t)&&qt(t)==Kc}var $c=Oe?Ae:zo;function Jc(t){return null==t}var Qc=$o&&$o.isRegExp,td=Qc?Yo(Qc):function(t){return Kt(t)&&"[object RegExp]"==qt(t)},ed=9007199254740991;function nd(t){return void 0===t}var od=Array.prototype.join;var id=la((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),rd=Fl((function(t,e,n){xo(t,n,e)}));var ad=Math.max,sd=Math.min;var ld=la((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),ud=Tr("toLowerCase");function cd(t,e){return t<e}var dd=uc(cd),hd=uc((function(t,e){return t<=e}));function pd(t,e){var n={};return e=Pl(e),Il(t,(function(t,o,i){xo(n,e(t,o,i),t)})),n}function fd(t,e,n){for(var o=-1,i=t.length;++o<i;){var r=t[o],a=e(r);if(null!=a&&(void 0===s?a==a&&!$t(a):n(a,s)))var s=a,l=r}return l}function gd(t,e){for(var n,o=-1,i=t.length;++o<i;){var r=e(t[o]);void 0!==r&&(n=void 0===n?r:n+r)}return n}var vd=NaN;function yd(t,e){var n=null==t?0:t.length;return n?gd(t,e)/n:vd}var md=ko((function(t,e,n){ou(t,e,n)})),bd=To((function(t,e){return function(n){return jc(n,t,e)}})),xd=To((function(t,e){return function(n){return jc(t,n,e)}}));function _d(t,e,n){var o=ai(e),i=rc(e,o),r=!(he(n)&&"chain"in n&&!n.chain),a=Ae(t);return Cn(i,(function(n){var o=e[n];t[n]=o,a&&(t.prototype[n]=function(){var e=this.__chain__;if(r||e){var n=t(this.__wrapped__);return(n.__actions__=cn(this.__actions__)).push({func:o,args:arguments,thisArg:t}),n.__chain__=e,n}return o.apply(t,Fi([this.value()],arguments))})})),t}var Ed=ae((function(t,e){return t*e}),1),wd="Expected a function";function Sd(t){if("function"!=typeof t)throw new TypeError(wd);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var Cd="[object Map]",Nd="[object Set]",Td=Ht?Ht.iterator:void 0;function Ad(t){if(!t)return[];if(Oo(t))return mc(t)?Nr(t):cn(t);if(Td&&t[Td])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Td]());var e=qa(t);return(e==Cd?Us:e==Nd?Xs:xc)(t)}function Md(t,e){var n=t.length;if(n)return Wn(e+=e<0?n:0,n)?t[e]:void 0}function Od(t,e){return null==(t=Ic(t,e=Di(e,t)))||delete t[Ii(fu(e))]}function Pd(t){return tr(t)?void 0:t}var kd=Xi((function(t,e){var n={};if(null==t)return n;var o=!1;e=te(e,(function(e){return e=Di(e,t),o||(o=e.length>1),e})),So(t,Ra(t),n),o&&(n=Ls(n,7,Pd));for(var i=e.length;i--;)Od(n,e[i]);return n}));function Rd(t,e,n,o){if(!he(t))return t;for(var i=-1,r=(e=Di(e,t)).length,a=r-1,s=t;null!=s&&++i<r;){var l=Ii(e[i]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(i!=a){var c=s[l];void 0===(u=o?o(c,l,s):void 0)&&(u=he(c)?c:Wn(e[i+1])?[]:{})}wo(s,l,u),s=s[l]}return t}function Dd(t,e,n){for(var o=-1,i=e.length,r={};++o<i;){var a=e[o],s=ji(t,a);n(s,a)&&Rd(r,Di(a,t),s)}return r}function Ld(t,e){if(null==t)return{};var n=te(Ra(t),(function(t){return[t]}));return e=Pl(e),Dd(t,n,(function(t,n){return e(t,n[0])}))}function Id(t,e){if(t!==e){var n=void 0!==t,o=null===t,i=t==t,r=$t(t),a=void 0!==e,s=null===e,l=e==e,u=$t(e);if(!s&&!u&&!r&&t>e||r&&a&&l&&!s&&!u||o&&a&&l||!n&&l||!i)return 1;if(!o&&!r&&!u&&t<e||u&&n&&i&&!o&&!r||s&&n&&i||!a&&i||!l)return-1}return 0}function jd(t,e,n){e=e.length?te(e,(function(t){return ee(t)?function(e){return ji(e,1===t.length?t[0]:t)}:t})):[we];var o=-1;e=te(e,Yo(Pl));var i=$u(t,(function(t,n,i){var r=te(e,(function(e){return e(t)}));return{criteria:r,index:++o,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(i,(function(t,e){return function(t,e,n){for(var o=-1,i=t.criteria,r=e.criteria,a=i.length,s=n.length;++o<a;){var l=Id(i[o],r[o]);if(l)return o>=s?l:l*("desc"==n[o]?-1:1)}return t.index-e.index}(t,e,n)}))}function Bd(t){return Xi((function(e){return e=te(e,Yo(Pl)),To((function(n){var o=this;return t(e,(function(t){return Ke(t,o,n)}))}))}))}var Hd=Bd(te),Fd=To,zd=Math.min,Wd=Fd((function(t,e){var n=(e=1==e.length&&ee(e[0])?te(e[0],Yo(Pl)):te(Gi(e,1),Yo(Pl))).length;return To((function(o){for(var i=-1,r=zd(o.length,n);++i<r;)o[i]=e[i].call(this,o[i]);return Ke(t,this,o)}))})),Gd=Bd(Lu),Ud=Bd(Hs),Xd=9007199254740991,Vd=Math.floor;function Yd(t,e){var n="";if(!t||e<1||e>Xd)return n;do{e%2&&(n+=t),(e=Vd(e/2))&&(t+=t)}while(e);return n}var qd=Ml("length"),Kd="\\ud800-\\udfff",Zd="["+Kd+"]",$d="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Jd="\\ud83c[\\udffb-\\udfff]",Qd="[^"+Kd+"]",th="(?:\\ud83c[\\udde6-\\uddff]){2}",eh="[\\ud800-\\udbff][\\udc00-\\udfff]",nh="(?:"+$d+"|"+Jd+")"+"?",oh="[\\ufe0e\\ufe0f]?",ih=oh+nh+("(?:\\u200d(?:"+[Qd,th,eh].join("|")+")"+oh+nh+")*"),rh="(?:"+[Qd+$d+"?",$d,th,eh,Zd].join("|")+")",ah=RegExp(Jd+"(?="+Jd+")|"+rh+ih,"g");function sh(t){return pr(t)?function(t){for(var e=ah.lastIndex=0;ah.test(t);)++e;return e}(t):qd(t)}var lh=Math.ceil;function uh(t,e){var n=(e=void 0===e?" ":re(e)).length;if(n<2)return n?Yd(e,t):e;var o=Yd(e,lh(t/sh(e)));return pr(e)?dr(Nr(o),0,t).join(""):o.slice(0,t)}var ch=Math.ceil,dh=Math.floor;var hh=/^\s+/,ph=Bt.parseInt;var fh=To((function(t,e){return yo(t,32,void 0,e,Xn(e,Hn(fh)))}));fh.placeholder={};var gh=To((function(t,e){return yo(t,64,void 0,e,Xn(e,Hn(gh)))}));gh.placeholder={};var vh=Fl((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var yh=Xi((function(t,e){return null==t?{}:function(t,e){return Dd(t,e,(function(e,n){return Cl(t,n)}))}(t,e)}));function mh(t,e,n,o){for(var i=n-1,r=t.length;++i<r;)if(o(t[i],e))return i;return-1}var bh=Array.prototype.splice;function xh(t,e,n,o){var i=o?mh:An,r=-1,a=e.length,s=t;for(t===e&&(e=cn(e)),n&&(s=te(t,Yo(n)));++r<a;)for(var l=0,u=e[r],c=n?n(u):u;(l=i(s,c,l,o))>-1;)s!==t&&bh.call(s,l,1),bh.call(t,l,1);return t}function _h(t,e){return t&&t.length&&e&&e.length?xh(t,e):t}var Eh=To(_h);var wh=Array.prototype.splice;function Sh(t,e){for(var n=t?e.length:0,o=n-1;n--;){var i=e[n];if(n==o||i!==r){var r=i;Wn(i)?wh.call(t,i,1):Od(t,i)}}return t}var Ch=Xi((function(t,e){var n=null==t?0:t.length,o=Hi(t,e);return Sh(t,te(e,(function(t){return Wn(t,n)?+t:t})).sort(Id)),o})),Nh=Math.floor,Th=Math.random;function Ah(t,e){return t+Nh(Th()*(e-t+1))}var Mh=parseFloat,Oh=Math.min,Ph=Math.random;var kh=Math.ceil,Rh=Math.max;function Dh(t){return function(e,n,o){return o&&"number"!=typeof o&&Po(e,n,o)&&(n=o=void 0),e=_e(e),void 0===n?(n=e,e=0):n=_e(n),function(t,e,n,o){for(var i=-1,r=Rh(kh((e-t)/(n||1)),0),a=Array(r);r--;)a[o?r:++i]=t,t+=n;return a}(e,n,o=void 0===o?e<n?1:-1:_e(o),t)}}var Lh=Dh(),Ih=Dh(!0),jh=Xi((function(t,e){return yo(t,256,void 0,void 0,void 0,e)}));function Bh(t,e,n,o,i){return i(t,(function(t,i,r){n=o?(o=!1,t):e(n,t,i,r)})),n}function Hh(t,e,n,o){var i=null==t?0:t.length;for(o&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}var Fh=Array.prototype.reverse;function zh(t){return null==t?t:Fh.call(t)}var Wh=ha("round");function Gh(t){var e=t.length;return e?t[Ah(0,e-1)]:void 0}function Uh(t){return Gh(xc(t))}function Xh(t,e){var n=-1,o=t.length,i=o-1;for(e=void 0===e?o:e;++n<e;){var r=Ah(n,i),a=t[r];t[r]=t[n],t[n]=a}return t.length=e,t}function Vh(t,e){return Xh(cn(t),ya(e,0,t.length))}function Yh(t,e){var n=xc(t);return Xh(n,ya(e,0,n.length))}function qh(t,e,n){return null==t?t:Rd(t,e,n)}function Kh(t){return Xh(cn(t))}function Zh(t){return Xh(xc(t))}var $h=la((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));function Jh(t,e){var n;return Bl(t,(function(t,o,i){return!(n=e(t,o,i))})),!!n}var Qh=To((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Po(t,e[0],e[1])?e=[]:n>2&&Po(e[0],e[1],e[2])&&(e=[e[0]]),jd(t,Gi(e,1),[])})),tp=4294967294,ep=Math.floor,np=Math.min;function op(t,e,n,o){var i=0,r=null==t?0:t.length;if(0===r)return 0;for(var a=(e=n(e))!=e,s=null===e,l=$t(e),u=void 0===e;i<r;){var c=ep((i+r)/2),d=n(t[c]),h=void 0!==d,p=null===d,f=d==d,g=$t(d);if(a)var v=o||f;else v=u?f&&(o||h):s?f&&h&&(o||!p):l?f&&h&&!p&&(o||!g):!p&&!g&&(o?d<=e:d<e);v?i=c+1:r=c}return np(r,tp)}var ip=2147483647;function rp(t,e,n){var o=0,i=null==t?o:t.length;if("number"==typeof e&&e==e&&i<=ip){for(;o<i;){var r=o+i>>>1,a=t[r];null!==a&&!$t(a)&&(n?a<=e:a<e)?o=r+1:i=r}return i}return op(t,e,we,n)}function ap(t,e){for(var n=-1,o=t.length,i=0,r=[];++n<o;){var a=t[n],s=e?e(a):a;if(!n||!_o(s,l)){var l=s;r[i++]=0===a?0:a}}return r}var sp=Math.max;var lp=la((function(t,e,n){return t+(n?" ":"")+Ar(e)}));var up=ae((function(t,e){return t-e}),0);var cp=Object.prototype,dp=cp.hasOwnProperty;function hp(t,e,n,o){return void 0===t||_o(t,cp[n])&&!dp.call(o,n)?e:t}var pp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function fp(t){return"\\"+pp[t]}var gp=/<%=([\s\S]+?)%>/g,vp={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:gp,variable:"",imports:{_:{escape:ku}}},yp=/\b__p \+= '';/g,mp=/\b(__p \+=) '' \+/g,bp=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xp=/[()=,{}\[\]\/\s]/,_p=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ep=/($^)/,wp=/['\n\r\u2028\u2029\\]/g,Sp=Object.prototype.hasOwnProperty;function Cp(t,e){return e(t)}var Np=4294967295,Tp=Math.min;function Ap(t,e){var n=t;return n instanceof nn&&(n=n.value()),Or(e,(function(t,e){return e.func.apply(e.thisArg,Fi([t],e.args))}),n)}function Mp(){return Ap(this.__wrapped__,this.__actions__)}var Op=9007199254740991;function Pp(t,e){for(var n=t.length;n--&&An(e,t[n],0)>-1;);return n}function kp(t,e){for(var n=-1,o=t.length;++n<o&&An(e,t[n],0)>-1;);return n}var Rp=/^\s+/;var Dp=/\w*$/;var Lp=Pr({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Ip=/&(?:amp|lt|gt|quot|#39);/g,jp=RegExp(Ip.source);var Bp=Ia&&1/Xs(new Ia([,-0]))[1]==1/0?function(t){return new Ia(t)}:on,Hp=200;function Fp(t,e,n){var o=-1,i=Mn,r=t.length,a=!0,s=[],l=s;if(n)a=!1,i=cu;else if(r>=Hp){var u=e?null:Bp(t);if(u)return Xs(u);a=!1,i=Fs,l=new Bs}else l=e?[]:s;t:for(;++o<r;){var c=t[o],d=e?e(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var h=l.length;h--;)if(l[h]===d)continue t;e&&l.push(d),s.push(c)}else i(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s}var zp=To((function(t){return Fp(Gi(t,1,tu,!0))})),Wp=To((function(t){var e=fu(t);return tu(e)&&(e=void 0),Fp(Gi(t,1,tu,!0),Pl(e))})),Gp=To((function(t){var e=fu(t);return e="function"==typeof e?e:void 0,Fp(Gi(t,1,tu,!0),void 0,e)}));var Up=0;var Xp=Math.max;function Vp(t){if(!t||!t.length)return[];var e=0;return t=Ca(t,(function(t){if(tu(t))return e=Xp(t.length,e),!0})),Lo(e,(function(e){return te(t,Ml(e))}))}function Yp(t,e){if(!t||!t.length)return[];var n=Vp(t);return null==e?n:te(n,(function(t){return Ke(e,void 0,t)}))}function qp(t,e,n,o){return Rd(t,e,n(ji(t,e)),o)}var Kp=la((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}));var Zp=To((function(t,e){return tu(t)?hu(t,e):[]}));var $p=Xi((function(t){var e=t.length,n=e?t[0]:0,o=this.__wrapped__,i=function(e){return Hi(e,t)};return!(e>1||this.__actions__.length)&&o instanceof nn&&Wn(n)?((o=o.slice(n,+n+(e?1:0))).__actions__.push({func:Cp,args:[i],thisArg:void 0}),new un(o,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)}));function Jp(t,e,n){var o=t.length;if(o<2)return o?Fp(t[0]):[];for(var i=-1,r=Array(o);++i<o;)for(var a=t[i],s=-1;++s<o;)s!=i&&(r[i]=hu(r[i]||a,t[s],e,n));return Fp(Gi(r,1),e,n)}var Qp=To((function(t){return Jp(Ca(t,tu))})),tf=To((function(t){var e=fu(t);return tu(e)&&(e=void 0),Jp(Ca(t,tu),Pl(e))})),ef=To((function(t){var e=fu(t);return e="function"==typeof e?e:void 0,Jp(Ca(t,tu),void 0,e)})),nf=To(Vp);function of(t,e,n){for(var o=-1,i=t.length,r=e.length,a={};++o<i;){var s=o<r?e[o]:void 0;n(a,t[o],s)}return a}var rf=To((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Yp(t,n)})),af={chunk:function(t,e,n){e=(n?Po(t,e,n):void 0===e)?1:va(Ee(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var i=0,r=0,a=Array(ga(o/e));i<o;)a[r++]=cr(t,i,i+=e);return a},compact:function(t){for(var e=-1,n=null==t?0:t.length,o=0,i=[];++e<n;){var r=t[e];r&&(i[o++]=r)}return i},concat:js,difference:pu,differenceBy:gu,differenceWith:vu,drop:function(t,e,n){var o=null==t?0:t.length;return o?cr(t,(e=n||void 0===e?1:Ee(e))<0?0:e,o):[]},dropRight:function(t,e,n){var o=null==t?0:t.length;return o?cr(t,0,(e=o-(e=n||void 0===e?1:Ee(e)))<0?0:e):[]},dropRightWhile:function(t,e){return t&&t.length?mu(t,Pl(e),!0,!0):[]},dropWhile:function(t,e){return t&&t.length?mu(t,Pl(e),!0):[]},fill:function(t,e,n,o){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&Po(t,e,n)&&(n=0,o=i),function(t,e,n,o){var i=t.length;for((n=Ee(n))<0&&(n=-n>i?0:i+n),(o=void 0===o||o>i?i:Ee(o))<0&&(o+=i),o=n>o?0:Bu(o);n<o;)t[n++]=e;return t}(t,e,n,o)):[]},findIndex:Gu,findLastIndex:qu,first:Zu,flatten:Ui,flattenDeep:function(t){return(null==t?0:t.length)?Gi(t,tc):[]},flattenDepth:function(t,e){return(null==t?0:t.length)?Gi(t,e=void 0===e?1:Ee(e)):[]},fromPairs:function(t){for(var e=-1,n=null==t?0:t.length,o={};++e<n;){var i=t[e];o[i[0]]=i[1]}return o},head:Zu,indexOf:function(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var i=null==n?0:Ee(n);return i<0&&(i=Ec(o+i,0)),An(t,e,i)},initial:function(t){return(null==t?0:t.length)?cr(t,0,-1):[]},intersection:Nc,intersectionBy:Tc,intersectionWith:Ac,join:function(t,e){return null==t?"":od.call(t,e)},last:fu,lastIndexOf:function(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var i=o;return void 0!==n&&(i=(i=Ee(n))<0?ad(o+i,0):sd(i,o-1)),e==e?function(t,e,n){for(var o=n+1;o--;)if(t[o]===e)return o;return o}(t,e,i):Nn(t,Tn,i,!0)},nth:function(t,e){return t&&t.length?Md(t,Ee(e)):void 0},pull:Eh,pullAll:_h,pullAllBy:function(t,e,n){return t&&t.length&&e&&e.length?xh(t,e,Pl(n)):t},pullAllWith:function(t,e,n){return t&&t.length&&e&&e.length?xh(t,e,void 0,n):t},pullAt:Ch,remove:function(t,e){var n=[];if(!t||!t.length)return n;var o=-1,i=[],r=t.length;for(e=Pl(e);++o<r;){var a=t[o];e(a,o,t)&&(n.push(a),i.push(o))}return Sh(t,i),n},reverse:zh,slice:function(t,e,n){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&Po(t,e,n)?(e=0,n=o):(e=null==e?0:Ee(e),n=void 0===n?o:Ee(n)),cr(t,e,n)):[]},sortedIndex:function(t,e){return rp(t,e)},sortedIndexBy:function(t,e,n){return op(t,e,Pl(n))},sortedIndexOf:function(t,e){var n=null==t?0:t.length;if(n){var o=rp(t,e);if(o<n&&_o(t[o],e))return o}return-1},sortedLastIndex:function(t,e){return rp(t,e,!0)},sortedLastIndexBy:function(t,e,n){return op(t,e,Pl(n),!0)},sortedLastIndexOf:function(t,e){if(null==t?0:t.length){var n=rp(t,e,!0)-1;if(_o(t[n],e))return n}return-1},sortedUniq:function(t){return t&&t.length?ap(t):[]},sortedUniqBy:function(t,e){return t&&t.length?ap(t,Pl(e)):[]},tail:function(t){var e=null==t?0:t.length;return e?cr(t,1,e):[]},take:function(t,e,n){return t&&t.length?cr(t,0,(e=n||void 0===e?1:Ee(e))<0?0:e):[]},takeRight:function(t,e,n){var o=null==t?0:t.length;return o?cr(t,(e=o-(e=n||void 0===e?1:Ee(e)))<0?0:e,o):[]},takeRightWhile:function(t,e){return t&&t.length?mu(t,Pl(e),!1,!0):[]},takeWhile:function(t,e){return t&&t.length?mu(t,Pl(e)):[]},union:zp,unionBy:Wp,unionWith:Gp,uniq:function(t){return t&&t.length?Fp(t):[]},uniqBy:function(t,e){return t&&t.length?Fp(t,Pl(e)):[]},uniqWith:function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Fp(t,void 0,e):[]},unzip:Vp,unzipWith:Yp,without:Zp,xor:Qp,xorBy:tf,xorWith:ef,zip:nf,zipObject:function(t,e){return of(t||[],e||[],wo)},zipObjectDeep:function(t,e){return of(t||[],e||[],Rd)},zipWith:rf},sf={countBy:Wl,each:xu,eachRight:Cu,every:function(t,e,n){var o=ee(t)?Lu:Iu;return n&&Po(t,e,n)&&(e=void 0),o(t,Pl(e))},filter:Fu,find:Uu,findLast:Ku,flatMap:function(t,e){return Gi(Ju(t,e),1)},flatMapDeep:function(t,e){return Gi(Ju(t,e),Qu)},flatMapDepth:function(t,e,n){return n=void 0===n?1:Ee(n),Gi(Ju(t,e),n)},forEach:xu,forEachRight:Cu,groupBy:sc,includes:function(t,e,n,o){t=Oo(t)?t:xc(t),n=n&&!o?Ee(n):0;var i=t.length;return n<0&&(n=_c(i+n,0)),mc(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&An(t,e,n)>-1},invokeMap:Hc,keyBy:rd,map:Ju,orderBy:function(t,e,n,o){return null==t?[]:(ee(e)||(e=null==e?[]:[e]),ee(n=o?void 0:n)||(n=null==n?[]:[n]),jd(t,e,n))},partition:vh,reduce:function(t,e,n){var o=ee(t)?Or:Bh,i=arguments.length<3;return o(t,Pl(e),n,i,Bl)},reduceRight:function(t,e,n){var o=ee(t)?Hh:Bh,i=arguments.length<3;return o(t,Pl(e),n,i,Su)},reject:function(t,e){return(ee(t)?Ca:Hu)(t,Sd(Pl(e)))},sample:function(t){return(ee(t)?Gh:Uh)(t)},sampleSize:function(t,e,n){return e=(n?Po(t,e,n):void 0===e)?1:Ee(e),(ee(t)?Vh:Yh)(t,e)},shuffle:function(t){return(ee(t)?Kh:Zh)(t)},size:function(t){if(null==t)return 0;if(Oo(t))return mc(t)?sh(t):t.length;var e=qa(t);return"[object Map]"==e||"[object Set]"==e?t.size:ri(t).length},some:function(t,e,n){var o=ee(t)?Hs:Jh;return n&&Po(t,e,n)&&(e=void 0),o(t,Pl(e))},sortBy:Qh},lf=Xl,uf={after:function(t,e){if("function"!=typeof e)throw new TypeError("Expected a function");return t=Ee(t),function(){if(--t<1)return e.apply(this,arguments)}},ary:bo,before:ar,bind:sr,bindKey:ur,curry:Gl,curryRight:Ul,debounce:Kl,defer:lu,delay:uu,flip:function(t){return yo(t,512)},memoize:Mi,negate:Sd,once:function(t){return ar(2,t)},overArgs:Wd,partial:fh,partialRight:gh,rearg:jh,rest:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return To(t,e=void 0===e?e:Ee(e))},spread:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return e=null==e?0:sp(Ee(e),0),To((function(n){var o=n[e],i=dr(n,0,e);return o&&Fi(i,o),Ke(t,this,i)}))},throttle:function(t,e,n){var o=!0,i=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return he(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),Kl(t,e,{leading:o,maxWait:e,trailing:i})},unary:function(t){return bo(t,1)},wrap:function(t,e){return fh(bu(e),t)}},cf={castArray:function(){if(!arguments.length)return[];var t=arguments[0];return ee(t)?t:[t]},clone:function(t){return Ls(t,4)},cloneDeep:Is,cloneDeepWith:function(t,e){return Ls(t,5,e="function"==typeof e?e:void 0)},cloneWith:function(t,e){return Ls(t,4,e="function"==typeof e?e:void 0)},conformsTo:function(t,e){return null==e||kl(t,e,ai(e))},eq:_o,gt:cc,gte:dc,isArguments:Fo,isArray:ee,isArrayBuffer:zc,isArrayLike:Oo,isArrayLikeObject:tu,isBoolean:Wc,isBuffer:Xo,isDate:Uc,isElement:function(t){return Kt(t)&&1===t.nodeType&&!tr(t)},isEmpty:Vc,isEqual:function(t,e){return gl(t,e)},isEqualWith:function(t,e,n){var o=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===o?gl(t,e,void 0,n):!!o},isError:or,isFinite:function(t){return"number"==typeof t&&Yc(t)},isFunction:Ae,isInteger:qc,isLength:Mo,isMap:Ss,isMatch:function(t,e){return t===e||ml(t,e,xl(e))},isMatchWith:function(t,e,n){return n="function"==typeof n?n:void 0,ml(t,e,xl(e),n)},isNaN:function(t){return Zc(t)&&t!=+t},isNative:function(t){if($c(t))throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Fe(t)},isNil:Jc,isNull:function(t){return null===t},isNumber:Zc,isObject:he,isObjectLike:Kt,isPlainObject:tr,isRegExp:td,isSafeInteger:function(t){return qc(t)&&t>=-9007199254740991&&t<=ed},isSet:Ns,isString:mc,isSymbol:$t,isTypedArray:Qo,isUndefined:nd,isWeakMap:function(t){return Kt(t)&&"[object WeakMap]"==qa(t)},isWeakSet:function(t){return Kt(t)&&"[object WeakSet]"==qt(t)},lt:dd,lte:hd,toArray:Ad,toFinite:_e,toInteger:Ee,toLength:Bu,toNumber:me,toPlainObject:nu,toSafeInteger:function(t){return t?ya(Ee(t),-9007199254740991,Op):0===t?t:0},toString:Ri},df={add:se,ceil:pa,divide:yu,floor:ec,max:function(t){return t&&t.length?fd(t,we,lc):void 0},maxBy:function(t,e){return t&&t.length?fd(t,Pl(e),lc):void 0},mean:function(t){return yd(t,we)},meanBy:function(t,e){return yd(t,Pl(e))},min:function(t){return t&&t.length?fd(t,we,cd):void 0},minBy:function(t,e){return t&&t.length?fd(t,Pl(e),cd):void 0},multiply:Ed,round:Wh,subtract:up,sum:function(t){return t&&t.length?gd(t,we):0},sumBy:function(t,e){return t&&t.length?gd(t,Pl(e)):0}},hf=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=me(n))==n?n:0),void 0!==e&&(e=(e=me(e))==e?e:0),ya(me(t),e,n)},pf=function(t,e,n){return e=_e(e),void 0===n?(n=e,e=0):n=_e(n),function(t,e,n){return t>=vc(e,n)&&t<gc(e,n)}(t=me(t),e,n)},ff=function(t,e,n){if(n&&"boolean"!=typeof n&&Po(t,e,n)&&(e=n=void 0),void 0===n&&("boolean"==typeof e?(n=e,e=void 0):"boolean"==typeof t&&(n=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=_e(t),void 0===e?(e=t,t=0):e=_e(e)),t>e){var o=t;t=e,e=o}if(n||t%1||e%1){var i=Ph();return Oh(t+i*(e-t+Mh("1e-"+((i+"").length-1))),e)}return Ah(t,e)},gf={assign:li,assignIn:hi,assignInWith:pi,assignWith:fi,at:Vi,create:function(t,e){var n=Ve(t);return null==e?n:ba(n,e)},defaults:Jl,defaultsDeep:au,entries:Tu,entriesIn:Au,extend:hi,extendWith:pi,findKey:function(t,e){return Xu(t,Pl(e),Il)},findLastKey:function(t,e){return Xu(t,Pl(e),wu)},forIn:function(t,e){return null==t?t:Ll(t,bu(e),di)},forInRight:function(t,e){return null==t?t:Eu(t,bu(e),di)},forOwn:function(t,e){return t&&Il(t,bu(e))},forOwnRight:function(t,e){return t&&wu(t,bu(e))},functions:function(t){return null==t?[]:rc(t,ai(t))},functionsIn:function(t){return null==t?[]:rc(t,di(t))},get:Bi,has:fc,hasIn:Cl,invert:Pc,invertBy:Lc,invoke:Bc,keys:ai,keysIn:di,mapKeys:pd,mapValues:function(t,e){var n={};return e=Pl(e),Il(t,(function(t,o,i){xo(n,o,e(t,o,i))})),n},merge:md,mergeWith:ru,omit:kd,omitBy:function(t,e){return Ld(t,Sd(Pl(e)))},pick:yh,pickBy:Ld,result:function(t,e,n){var o=-1,i=(e=Di(e,t)).length;for(i||(i=1,t=void 0);++o<i;){var r=null==t?void 0:t[Ii(e[o])];void 0===r&&(o=i,r=n),t=Ae(r)?r.call(t):r}return t},set:qh,setWith:function(t,e,n,o){return o="function"==typeof o?o:void 0,null==t?t:Rd(t,e,n,o)},toPairs:Tu,toPairsIn:Au,transform:function(t,e,n){var o=ee(t),i=o||Xo(t)||Qo(t);if(e=Pl(e),null==n){var r=t&&t.constructor;n=i?o?new r:[]:he(t)&&Ae(r)?Ve(Yi(t)):{}}return(i?Cn:Il)(t,(function(t,o,i){return e(n,t,o,i)})),n},unset:function(t,e){return null==t||Od(t,e)},update:function(t,e,n){return null==t?t:qp(t,e,bu(n))},updateWith:function(t,e,n,o){return o="function"==typeof o?o:void 0,null==t?t:qp(t,e,bu(n),o)},values:xc,valuesIn:function(t){return null==t?[]:bc(t,di(t))}},vf={at:$p,chain:fa,commit:function(){return new un(this.value(),this.__chain__)},lodash:pn,next:function(){void 0===this.__values__&&(this.__values__=Ad(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},plant:function(t){for(var e,n=this;n instanceof tn;){var o=dn(n);o.__index__=0,o.__values__=void 0,e?i.__wrapped__=o:e=o;var i=o;n=n.__wrapped__}return i.__wrapped__=t,e},reverse:function(){var t=this.__wrapped__;if(t instanceof nn){var e=t;return this.__actions__.length&&(e=new nn(this)),(e=e.reverse()).__actions__.push({func:Cp,args:[zh],thisArg:void 0}),new un(e,this.__chain__)}return this.thru(zh)},tap:function(t,e){return e(t),t},thru:Cp,toIterator:function(){return this},toJSON:Mp,value:Mp,valueOf:Mp,wrapperChain:function(){return fa(this)}},yf={camelCase:ua,capitalize:Mr,deburr:Lr,endsWith:function(t,e,n){t=Ri(t),e=re(e);var o=t.length,i=n=void 0===n?o:ya(Ee(n),0,o);return(n-=e.length)>=0&&t.slice(n,i)==e},escape:ku,escapeRegExp:function(t){return(t=Ri(t))&&Du.test(t)?t.replace(Ru,"\\$&"):t},kebabCase:id,lowerCase:ld,lowerFirst:ud,pad:function(t,e,n){t=Ri(t);var o=(e=Ee(e))?sh(t):0;if(!e||o>=e)return t;var i=(e-o)/2;return uh(dh(i),n)+t+uh(ch(i),n)},padEnd:function(t,e,n){t=Ri(t);var o=(e=Ee(e))?sh(t):0;return e&&o<e?t+uh(e-o,n):t},padStart:function(t,e,n){t=Ri(t);var o=(e=Ee(e))?sh(t):0;return e&&o<e?uh(e-o,n)+t:t},parseInt:function(t,e,n){return n||null==e?e=0:e&&(e=+e),ph(Ri(t).replace(hh,""),e||0)},repeat:function(t,e,n){return e=(n?Po(t,e,n):void 0===e)?1:Ee(e),Yd(Ri(t),e)},replace:function(){var t=arguments,e=Ri(t[0]);return t.length<3?e:e.replace(t[1],t[2])},snakeCase:$h,split:function(t,e,n){return n&&"number"!=typeof n&&Po(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=Ri(t))&&("string"==typeof e||null!=e&&!td(e))&&!(e=re(e))&&pr(t)?dr(Nr(t),0,n):t.split(e,n):[]},startCase:lp,startsWith:function(t,e,n){return t=Ri(t),n=null==n?0:ya(Ee(n),0,t.length),e=re(e),t.slice(n,n+e.length)==e},template:function(t,e,n){var o=vp.imports._.templateSettings||vp;n&&Po(t,e,n)&&(e=void 0),t=Ri(t),e=pi({},e,o,hp);var i,r,a=pi({},e.imports,o.imports,hp),s=ai(a),l=bc(a,s),u=0,c=e.interpolate||Ep,d="__p += '",h=RegExp((e.escape||Ep).source+"|"+c.source+"|"+(c===gp?_p:Ep).source+"|"+(e.evaluate||Ep).source+"|$","g"),p=Sp.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(h,(function(e,n,o,a,s,l){return o||(o=a),d+=t.slice(u,l).replace(wp,fp),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),s&&(r=!0,d+="';\n"+s+";\n__p += '"),o&&(d+="' +\n((__t = ("+o+")) == null ? '' : __t) +\n'"),u=l+e.length,e})),d+="';\n";var f=Sp.call(e,"variable")&&e.variable;if(f){if(xp.test(f))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(r?d.replace(yp,""):d).replace(mp,"$1").replace(bp,"$1;"),d="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(r?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=ir((function(){return Function(s,p+"return "+d).apply(void 0,l)}));if(g.source=d,or(g))throw g;return g},templateSettings:vp,toLower:function(t){return Ri(t).toLowerCase()},toUpper:function(t){return Ri(t).toUpperCase()},trim:function(t,e,n){if((t=Ri(t))&&(n||void 0===e))return de(t);if(!t||!(e=re(e)))return t;var o=Nr(t),i=Nr(e);return dr(o,kp(o,i),Pp(o,i)+1).join("")},trimEnd:function(t,e,n){if((t=Ri(t))&&(n||void 0===e))return t.slice(0,ue(t)+1);if(!t||!(e=re(e)))return t;var o=Nr(t);return dr(o,0,Pp(o,Nr(e))+1).join("")},trimStart:function(t,e,n){if((t=Ri(t))&&(n||void 0===e))return t.replace(Rp,"");if(!t||!(e=re(e)))return t;var o=Nr(t);return dr(o,kp(o,Nr(e))).join("")},truncate:function(t,e){var n=30,o="...";if(he(e)){var i="separator"in e?e.separator:i;n="length"in e?Ee(e.length):n,o="omission"in e?re(e.omission):o}var r=(t=Ri(t)).length;if(pr(t)){var a=Nr(t);r=a.length}if(n>=r)return t;var s=n-sh(o);if(s<1)return o;var l=a?dr(a,0,s).join(""):t.slice(0,s);if(void 0===i)return l+o;if(a&&(s+=l.length-s),td(i)){if(t.slice(s).search(i)){var u,c=l;for(i.global||(i=RegExp(i.source,Ri(Dp.exec(i))+"g")),i.lastIndex=0;u=i.exec(c);)var d=u.index;l=l.slice(0,void 0===d?s:d)}}else if(t.indexOf(re(i),s)!=s){var h=l.lastIndexOf(i);h>-1&&(l=l.slice(0,h))}return l+o},unescape:function(t){return(t=Ri(t))&&jp.test(t)?t.replace(Ip,Lp):t},upperCase:Kp,upperFirst:Ar,words:aa},mf={attempt:ir,bindAll:lr,cond:function(t){var e=null==t?0:t.length,n=Pl;return t=e?te(t,(function(t){if("function"!=typeof t[1])throw new TypeError("Expected a function");return[n(t[0]),t[1]]})):[],To((function(n){for(var o=-1;++o<e;){var i=t[o];if(Ke(i[0],this,n))return Ke(i[1],this,n)}}))},conforms:function(t){return function(t){var e=ai(t);return function(n){return kl(n,t,e)}}(Ls(t,1))},constant:_n,defaultTo:function(t,e){return null==t||t!=t?e:t},flow:oc,flowRight:ic,identity:we,iteratee:function(t){return Pl("function"==typeof t?t:Ls(t,1))},matches:function(t){return El(Ls(t,1))},matchesProperty:function(t,e){return Al(t,Ls(e,1))},method:bd,methodOf:xd,mixin:_d,noop:on,nthArg:function(t){return t=Ee(t),To((function(e){return Md(e,t)}))},over:Hd,overEvery:Gd,overSome:Ud,property:Ol,propertyOf:function(t){return function(e){return null==t?void 0:ji(t,e)}},range:Lh,rangeRight:Ih,stubArray:Na,stubFalse:zo,stubObject:function(){return{}},stubString:function(){return""},stubTrue:function(){return!0},times:function(t,e){if((t=Ee(t))<1||t>9007199254740991)return[];var n=Np,o=Tp(t,Np);e=bu(e),t-=Np;for(var i=Lo(o,e);++n<t;)e(n);return i},toPath:function(t){return ee(t)?te(t,Ii):$t(t)?[t]:cn(ki(Ri(t)))},uniqueId:function(t){var e=++Up;return Ri(t)+e}};var bf=Math.max,xf=Math.min;var _f=Math.min;var Ef,wf=4294967295,Sf=Array.prototype,Cf=Object.prototype.hasOwnProperty,Nf=Ht?Ht.iterator:void 0,Tf=Math.max,Af=Math.min,Mf=function(t){return function(e,n,o){if(null==o){var i=he(n),r=i&&ai(n),a=r&&r.length&&rc(n,r);(a?a.length:i)||(o=n,n=e,e=this)}return t(e,n,o)}}(_d);pn.after=uf.after,pn.ary=uf.ary,pn.assign=gf.assign,pn.assignIn=gf.assignIn,pn.assignInWith=gf.assignInWith,pn.assignWith=gf.assignWith,pn.at=gf.at,pn.before=uf.before,pn.bind=uf.bind,pn.bindAll=mf.bindAll,pn.bindKey=uf.bindKey,pn.castArray=cf.castArray,pn.chain=vf.chain,pn.chunk=af.chunk,pn.compact=af.compact,pn.concat=af.concat,pn.cond=mf.cond,pn.conforms=mf.conforms,pn.constant=mf.constant,pn.countBy=sf.countBy,pn.create=gf.create,pn.curry=uf.curry,pn.curryRight=uf.curryRight,pn.debounce=uf.debounce,pn.defaults=gf.defaults,pn.defaultsDeep=gf.defaultsDeep,pn.defer=uf.defer,pn.delay=uf.delay,pn.difference=af.difference,pn.differenceBy=af.differenceBy,pn.differenceWith=af.differenceWith,pn.drop=af.drop,pn.dropRight=af.dropRight,pn.dropRightWhile=af.dropRightWhile,pn.dropWhile=af.dropWhile,pn.fill=af.fill,pn.filter=sf.filter,pn.flatMap=sf.flatMap,pn.flatMapDeep=sf.flatMapDeep,pn.flatMapDepth=sf.flatMapDepth,pn.flatten=af.flatten,pn.flattenDeep=af.flattenDeep,pn.flattenDepth=af.flattenDepth,pn.flip=uf.flip,pn.flow=mf.flow,pn.flowRight=mf.flowRight,pn.fromPairs=af.fromPairs,pn.functions=gf.functions,pn.functionsIn=gf.functionsIn,pn.groupBy=sf.groupBy,pn.initial=af.initial,pn.intersection=af.intersection,pn.intersectionBy=af.intersectionBy,pn.intersectionWith=af.intersectionWith,pn.invert=gf.invert,pn.invertBy=gf.invertBy,pn.invokeMap=sf.invokeMap,pn.iteratee=mf.iteratee,pn.keyBy=sf.keyBy,pn.keys=ai,pn.keysIn=gf.keysIn,pn.map=sf.map,pn.mapKeys=gf.mapKeys,pn.mapValues=gf.mapValues,pn.matches=mf.matches,pn.matchesProperty=mf.matchesProperty,pn.memoize=uf.memoize,pn.merge=gf.merge,pn.mergeWith=gf.mergeWith,pn.method=mf.method,pn.methodOf=mf.methodOf,pn.mixin=Mf,pn.negate=Sd,pn.nthArg=mf.nthArg,pn.omit=gf.omit,pn.omitBy=gf.omitBy,pn.once=uf.once,pn.orderBy=sf.orderBy,pn.over=mf.over,pn.overArgs=uf.overArgs,pn.overEvery=mf.overEvery,pn.overSome=mf.overSome,pn.partial=uf.partial,pn.partialRight=uf.partialRight,pn.partition=sf.partition,pn.pick=gf.pick,pn.pickBy=gf.pickBy,pn.property=mf.property,pn.propertyOf=mf.propertyOf,pn.pull=af.pull,pn.pullAll=af.pullAll,pn.pullAllBy=af.pullAllBy,pn.pullAllWith=af.pullAllWith,pn.pullAt=af.pullAt,pn.range=mf.range,pn.rangeRight=mf.rangeRight,pn.rearg=uf.rearg,pn.reject=sf.reject,pn.remove=af.remove,pn.rest=uf.rest,pn.reverse=af.reverse,pn.sampleSize=sf.sampleSize,pn.set=gf.set,pn.setWith=gf.setWith,pn.shuffle=sf.shuffle,pn.slice=af.slice,pn.sortBy=sf.sortBy,pn.sortedUniq=af.sortedUniq,pn.sortedUniqBy=af.sortedUniqBy,pn.split=yf.split,pn.spread=uf.spread,pn.tail=af.tail,pn.take=af.take,pn.takeRight=af.takeRight,pn.takeRightWhile=af.takeRightWhile,pn.takeWhile=af.takeWhile,pn.tap=vf.tap,pn.throttle=uf.throttle,pn.thru=Cp,pn.toArray=cf.toArray,pn.toPairs=gf.toPairs,pn.toPairsIn=gf.toPairsIn,pn.toPath=mf.toPath,pn.toPlainObject=cf.toPlainObject,pn.transform=gf.transform,pn.unary=uf.unary,pn.union=af.union,pn.unionBy=af.unionBy,pn.unionWith=af.unionWith,pn.uniq=af.uniq,pn.uniqBy=af.uniqBy,pn.uniqWith=af.uniqWith,pn.unset=gf.unset,pn.unzip=af.unzip,pn.unzipWith=af.unzipWith,pn.update=gf.update,pn.updateWith=gf.updateWith,pn.values=gf.values,pn.valuesIn=gf.valuesIn,pn.without=af.without,pn.words=yf.words,pn.wrap=uf.wrap,pn.xor=af.xor,pn.xorBy=af.xorBy,pn.xorWith=af.xorWith,pn.zip=af.zip,pn.zipObject=af.zipObject,pn.zipObjectDeep=af.zipObjectDeep,pn.zipWith=af.zipWith,pn.entries=gf.toPairs,pn.entriesIn=gf.toPairsIn,pn.extend=gf.assignIn,pn.extendWith=gf.assignInWith,Mf(pn,pn),pn.add=df.add,pn.attempt=mf.attempt,pn.camelCase=yf.camelCase,pn.capitalize=yf.capitalize,pn.ceil=df.ceil,pn.clamp=hf,pn.clone=cf.clone,pn.cloneDeep=cf.cloneDeep,pn.cloneDeepWith=cf.cloneDeepWith,pn.cloneWith=cf.cloneWith,pn.conformsTo=cf.conformsTo,pn.deburr=yf.deburr,pn.defaultTo=mf.defaultTo,pn.divide=df.divide,pn.endsWith=yf.endsWith,pn.eq=cf.eq,pn.escape=yf.escape,pn.escapeRegExp=yf.escapeRegExp,pn.every=sf.every,pn.find=sf.find,pn.findIndex=af.findIndex,pn.findKey=gf.findKey,pn.findLast=sf.findLast,pn.findLastIndex=af.findLastIndex,pn.findLastKey=gf.findLastKey,pn.floor=df.floor,pn.forEach=sf.forEach,pn.forEachRight=sf.forEachRight,pn.forIn=gf.forIn,pn.forInRight=gf.forInRight,pn.forOwn=gf.forOwn,pn.forOwnRight=gf.forOwnRight,pn.get=gf.get,pn.gt=cf.gt,pn.gte=cf.gte,pn.has=gf.has,pn.hasIn=gf.hasIn,pn.head=af.head,pn.identity=we,pn.includes=sf.includes,pn.indexOf=af.indexOf,pn.inRange=pf,pn.invoke=gf.invoke,pn.isArguments=cf.isArguments,pn.isArray=ee,pn.isArrayBuffer=cf.isArrayBuffer,pn.isArrayLike=cf.isArrayLike,pn.isArrayLikeObject=cf.isArrayLikeObject,pn.isBoolean=cf.isBoolean,pn.isBuffer=cf.isBuffer,pn.isDate=cf.isDate,pn.isElement=cf.isElement,pn.isEmpty=cf.isEmpty,pn.isEqual=cf.isEqual,pn.isEqualWith=cf.isEqualWith,pn.isError=cf.isError,pn.isFinite=cf.isFinite,pn.isFunction=cf.isFunction,pn.isInteger=cf.isInteger,pn.isLength=cf.isLength,pn.isMap=cf.isMap,pn.isMatch=cf.isMatch,pn.isMatchWith=cf.isMatchWith,pn.isNaN=cf.isNaN,pn.isNative=cf.isNative,pn.isNil=cf.isNil,pn.isNull=cf.isNull,pn.isNumber=cf.isNumber,pn.isObject=he,pn.isObjectLike=cf.isObjectLike,pn.isPlainObject=cf.isPlainObject,pn.isRegExp=cf.isRegExp,pn.isSafeInteger=cf.isSafeInteger,pn.isSet=cf.isSet,pn.isString=cf.isString,pn.isSymbol=cf.isSymbol,pn.isTypedArray=cf.isTypedArray,pn.isUndefined=cf.isUndefined,pn.isWeakMap=cf.isWeakMap,pn.isWeakSet=cf.isWeakSet,pn.join=af.join,pn.kebabCase=yf.kebabCase,pn.last=fu,pn.lastIndexOf=af.lastIndexOf,pn.lowerCase=yf.lowerCase,pn.lowerFirst=yf.lowerFirst,pn.lt=cf.lt,pn.lte=cf.lte,pn.max=df.max,pn.maxBy=df.maxBy,pn.mean=df.mean,pn.meanBy=df.meanBy,pn.min=df.min,pn.minBy=df.minBy,pn.stubArray=mf.stubArray,pn.stubFalse=mf.stubFalse,pn.stubObject=mf.stubObject,pn.stubString=mf.stubString,pn.stubTrue=mf.stubTrue,pn.multiply=df.multiply,pn.nth=af.nth,pn.noop=mf.noop,pn.now=lf,pn.pad=yf.pad,pn.padEnd=yf.padEnd,pn.padStart=yf.padStart,pn.parseInt=yf.parseInt,pn.random=ff,pn.reduce=sf.reduce,pn.reduceRight=sf.reduceRight,pn.repeat=yf.repeat,pn.replace=yf.replace,pn.result=gf.result,pn.round=df.round,pn.sample=sf.sample,pn.size=sf.size,pn.snakeCase=yf.snakeCase,pn.some=sf.some,pn.sortedIndex=af.sortedIndex,pn.sortedIndexBy=af.sortedIndexBy,pn.sortedIndexOf=af.sortedIndexOf,pn.sortedLastIndex=af.sortedLastIndex,pn.sortedLastIndexBy=af.sortedLastIndexBy,pn.sortedLastIndexOf=af.sortedLastIndexOf,pn.startCase=yf.startCase,pn.startsWith=yf.startsWith,pn.subtract=df.subtract,pn.sum=df.sum,pn.sumBy=df.sumBy,pn.template=yf.template,pn.times=mf.times,pn.toFinite=cf.toFinite,pn.toInteger=Ee,pn.toLength=cf.toLength,pn.toLower=yf.toLower,pn.toNumber=cf.toNumber,pn.toSafeInteger=cf.toSafeInteger,pn.toString=cf.toString,pn.toUpper=yf.toUpper,pn.trim=yf.trim,pn.trimEnd=yf.trimEnd,pn.trimStart=yf.trimStart,pn.truncate=yf.truncate,pn.unescape=yf.unescape,pn.uniqueId=mf.uniqueId,pn.upperCase=yf.upperCase,pn.upperFirst=yf.upperFirst,pn.each=sf.forEach,pn.eachRight=sf.forEachRight,pn.first=af.head,Mf(pn,(Ef={},Il(pn,(function(t,e){Cf.call(pn.prototype,e)||(Ef[e]=t)})),Ef),{chain:!1}),pn.VERSION="4.17.21",(pn.templateSettings=yf.templateSettings).imports._=pn,Cn(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){pn[t].placeholder=pn})),Cn(["drop","take"],(function(t,e){nn.prototype[t]=function(n){n=void 0===n?1:Tf(Ee(n),0);var o=this.__filtered__&&!e?new nn(this):this.clone();return o.__filtered__?o.__takeCount__=Af(n,o.__takeCount__):o.__views__.push({size:Af(n,wf),type:t+(o.__dir__<0?"Right":"")}),o},nn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Cn(["filter","map","takeWhile"],(function(t,e){var n=e+1,o=1==n||3==n;nn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Pl(t),type:n}),e.__filtered__=e.__filtered__||o,e}})),Cn(["head","last"],(function(t,e){var n="take"+(e?"Right":"");nn.prototype[t]=function(){return this[n](1).value()[0]}})),Cn(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");nn.prototype[t]=function(){return this.__filtered__?new nn(this):this[n](1)}})),nn.prototype.compact=function(){return this.filter(we)},nn.prototype.find=function(t){return this.filter(t).head()},nn.prototype.findLast=function(t){return this.reverse().find(t)},nn.prototype.invokeMap=To((function(t,e){return"function"==typeof t?new nn(this):this.map((function(n){return jc(n,t,e)}))})),nn.prototype.reject=function(t){return this.filter(Sd(Pl(t)))},nn.prototype.slice=function(t,e){t=Ee(t);var n=this;return n.__filtered__&&(t>0||e<0)?new nn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=Ee(e))<0?n.dropRight(-e):n.take(e-t)),n)},nn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},nn.prototype.toArray=function(){return this.take(wf)},Il(nn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),i=pn[o?"take"+("last"==e?"Right":""):e],r=o||/^find/.test(e);i&&(pn.prototype[e]=function(){var e=this.__wrapped__,a=o?[1]:arguments,s=e instanceof nn,l=a[0],u=s||ee(e),c=function(t){var e=i.apply(pn,Fi([t],a));return o&&d?e[0]:e};u&&n&&"function"==typeof l&&1!=l.length&&(s=u=!1);var d=this.__chain__,h=!!this.__actions__.length,p=r&&!d,f=s&&!h;if(!r&&u){e=f?e:new nn(this);var g=t.apply(e,a);return g.__actions__.push({func:Cp,args:[c],thisArg:void 0}),new un(g,d)}return p&&f?t.apply(this,a):(g=this.thru(c),p?o?g.value()[0]:g.value():g)})})),Cn(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Sf[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",o=/^(?:pop|shift)$/.test(t);pn.prototype[t]=function(){var t=arguments;if(o&&!this.__chain__){var i=this.value();return e.apply(ee(i)?i:[],t)}return this[n]((function(n){return e.apply(ee(n)?n:[],t)}))}})),Il(nn.prototype,(function(t,e){var n=pn[e];if(n){var o=n.name+"";Cf.call(an,o)||(an[o]=[]),an[o].push({name:e,func:n})}})),an[Jn(void 0,2).name]=[{name:"wrapper",func:void 0}],nn.prototype.clone=function(){var t=new nn(this.__wrapped__);return t.__actions__=cn(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=cn(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=cn(this.__views__),t},nn.prototype.reverse=function(){if(this.__filtered__){var t=new nn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},nn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=ee(t),o=e<0,i=n?t.length:0,r=function(t,e,n){for(var o=-1,i=n.length;++o<i;){var r=n[o],a=r.size;switch(r.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=xf(e,t+a);break;case"takeRight":t=bf(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=r.start,s=r.end,l=s-a,u=o?s:a-1,c=this.__iteratees__,d=c.length,h=0,p=_f(l,this.__takeCount__);if(!n||!o&&i==l&&p==l)return Ap(t,this.__actions__);var f=[];t:for(;l--&&h<p;){for(var g=-1,v=t[u+=e];++g<d;){var y=c[g],m=y.iteratee,b=y.type,x=m(v);if(2==b)v=x;else if(!x){if(1==b)continue t;break t}}f[h++]=v}return f},pn.prototype.at=vf.at,pn.prototype.chain=vf.wrapperChain,pn.prototype.commit=vf.commit,pn.prototype.next=vf.next,pn.prototype.plant=vf.plant,pn.prototype.reverse=vf.reverse,pn.prototype.toJSON=pn.prototype.valueOf=pn.prototype.value=vf.value,pn.prototype.first=pn.prototype.head,Nf&&(pn.prototype[Nf]=vf.toIterator);var Of,Pf,kf,Rf,Df,Lf,If,jf,Bf,Hf,Ff={},zf=[],Wf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Gf=Array.isArray;function Uf(t,e){for(var n in e)t[n]=e[n];return t}function Xf(t){var e=t.parentNode;e&&e.removeChild(t)}function Vf(t,e,n){var o,i,r,a={};for(r in e)"key"==r?o=e[r]:"ref"==r?i=e[r]:a[r]=e[r];if(arguments.length>2&&(a.children=arguments.length>3?Of.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(r in t.defaultProps)void 0===a[r]&&(a[r]=t.defaultProps[r]);return Yf(t,a,o,i,null)}function Yf(t,e,n,o,i){var r={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++kf:i,__i:-1,__u:0};return null==i&&null!=Pf.vnode&&Pf.vnode(r),r}function qf(t){return t.children}function Kf(t,e){this.props=t,this.context=e}function Zf(t,e){if(null==e)return t.__?Zf(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?Zf(t):null}function $f(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return $f(t)}}function Jf(t){(!t.__d&&(t.__d=!0)&&Rf.push(t)&&!Qf.__r++||Df!==Pf.debounceRendering)&&((Df=Pf.debounceRendering)||Lf)(Qf)}function Qf(){var t,e,n,o,i,r,a,s;for(Rf.sort(If);t=Rf.shift();)t.__d&&(e=Rf.length,o=void 0,r=(i=(n=t).__v).__e,a=[],s=[],n.__P&&((o=Uf({},i)).__v=i.__v+1,Pf.vnode&&Pf.vnode(o),lg(n.__P,o,i,n.__n,n.__P.namespaceURI,32&i.__u?[r]:null,a,null==r?Zf(i):r,!!(32&i.__u),s),o.__v=i.__v,o.__.__k[o.__i]=o,ug(a,o,s),o.__e!=r&&$f(o)),Rf.length>e&&Rf.sort(If));Qf.__r=0}function tg(t,e,n,o,i,r,a,s,l,u,c){var d,h,p,f,g,v=o&&o.__k||zf,y=e.length;for(n.__d=l,eg(n,e,v),l=n.__d,d=0;d<y;d++)null!=(p=n.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(h=-1===p.__i?Ff:v[p.__i]||Ff,p.__i=d,lg(t,p,h,i,r,a,s,l,u,c),f=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&dg(h.ref,null,p),c.push(p.ref,p.__c||f,p)),null==g&&null!=f&&(g=f),65536&p.__u||h.__k===p.__k?l=ng(p,l,t):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:f&&(l=f.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=l,n.__e=g}function eg(t,e,n){var o,i,r,a,s,l=e.length,u=n.length,c=u,d=0;for(t.__k=[],o=0;o<l;o++)a=o+d,null!=(i=t.__k[o]=null==(i=e[o])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?Yf(null,i,null,null,null):Gf(i)?Yf(qf,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?Yf(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=t,i.__b=t.__b+1,s=ig(i,n,a,c),i.__i=s,r=null,-1!==s&&(c--,(r=n[s])&&(r.__u|=131072)),null==r||null===r.__v?(-1==s&&d--,"function"!=typeof i.type&&(i.__u|=65536)):s!==a&&(s==a-1?d=s-a:s==a+1?d++:s>a?c>l-a?d+=s-a:d--:s<a&&d++,s!==o+d&&(i.__u|=65536))):(r=n[a])&&null==r.key&&r.__e&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=Zf(r)),hg(r,r,!1),n[a]=null,c--);if(c)for(o=0;o<u;o++)null!=(r=n[o])&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=Zf(r)),hg(r,r))}function ng(t,e,n){var o,i;if("function"==typeof t.type){for(o=t.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=t,e=ng(o[i],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=Zf(t)),n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function og(t,e){return e=e||[],null==t||"boolean"==typeof t||(Gf(t)?t.some((function(t){og(t,e)})):e.push(t)),e}function ig(t,e,n,o){var i=t.key,r=t.type,a=n-1,s=n+1,l=e[n];if(null===l||l&&i==l.key&&r===l.type&&!(131072&l.__u))return n;if(o>(null==l||131072&l.__u?0:1))for(;a>=0||s<e.length;){if(a>=0){if((l=e[a])&&!(131072&l.__u)&&i==l.key&&r===l.type)return a;a--}if(s<e.length){if((l=e[s])&&!(131072&l.__u)&&i==l.key&&r===l.type)return s;s++}}return-1}function rg(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||Wf.test(e)?n:n+"px"}function ag(t,e,n,o,i){var r;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||rg(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||rg(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||"onFocusOut"===e||"onFocusIn"===e?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?o?n.u=o.u:(n.u=jf,t.addEventListener(e,r?Hf:Bf,r)):t.removeEventListener(e,r?Hf:Bf,r);else{if("http://www.w3.org/2000/svg"==i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function sg(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e.t)e.t=jf++;else if(e.t<n.u)return;return n(Pf.event?Pf.event(e):e)}}}function lg(t,e,n,o,i,r,a,s,l,u){var c,d,h,p,f,g,v,y,m,b,x,_,E,w,S,C,N=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(l=!!(32&n.__u),r=[s=e.__e=n.__e]),(c=Pf.__b)&&c(e);t:if("function"==typeof N)try{if(y=e.props,m="prototype"in N&&N.prototype.render,b=(c=N.contextType)&&o[c.__c],x=c?b?b.props.value:c.__:o,n.__c?v=(d=e.__c=n.__c).__=d.__E:(m?e.__c=d=new N(y,x):(e.__c=d=new Kf(y,x),d.constructor=N,d.render=pg),b&&b.sub(d),d.props=y,d.state||(d.state={}),d.context=x,d.__n=o,h=d.__d=!0,d.__h=[],d._sb=[]),m&&null==d.__s&&(d.__s=d.state),m&&null!=N.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Uf({},d.__s)),Uf(d.__s,N.getDerivedStateFromProps(y,d.__s))),p=d.props,f=d.state,d.__v=e,h)m&&null==N.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),m&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(m&&null==N.getDerivedStateFromProps&&y!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,x),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,x)||e.__v===n.__v)){for(e.__v!==n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),_=0;_<d._sb.length;_++)d.__h.push(d._sb[_]);d._sb=[],d.__h.length&&a.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,x),m&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,f,g)}))}if(d.context=x,d.props=y,d.__P=t,d.__e=!1,E=Pf.__r,w=0,m){for(d.state=d.__s,d.__d=!1,E&&E(e),c=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,E&&E(e),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++w<25);d.state=d.__s,null!=d.getChildContext&&(o=Uf(Uf({},o),d.getChildContext())),m&&!h&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(p,f)),tg(t,Gf(C=null!=c&&c.type===qf&&null==c.key?c.props.children:c)?C:[C],e,n,o,i,r,a,s,l,u),d.base=e.__e,e.__u&=-161,d.__h.length&&a.push(d),v&&(d.__E=d.__=null)}catch(t){if(e.__v=null,l||null!=r){for(e.__u|=l?160:32;s&&8===s.nodeType&&s.nextSibling;)s=s.nextSibling;r[r.indexOf(s)]=null,e.__e=s}else e.__e=n.__e,e.__k=n.__k;Pf.__e(t,e,n)}else null==r&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=cg(n.__e,e,n,o,i,r,a,l,u);(c=Pf.diffed)&&c(e)}function ug(t,e,n){e.__d=void 0;for(var o=0;o<n.length;o++)dg(n[o],n[++o],n[++o]);Pf.__c&&Pf.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Pf.__e(t,e.__v)}}))}function cg(t,e,n,o,i,r,a,s,l){var u,c,d,h,p,f,g,v=n.props,y=e.props,m=e.type;if("svg"===m?i="http://www.w3.org/2000/svg":"math"===m?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=r)for(u=0;u<r.length;u++)if((p=r[u])&&"setAttribute"in p==!!m&&(m?p.localName===m:3===p.nodeType)){t=p,r[u]=null;break}if(null==t){if(null===m)return document.createTextNode(y);t=document.createElementNS(i,m,y.is&&y),r=null,s=!1}if(null===m)v===y||s&&t.data===y||(t.data=y);else{if(r=r&&Of.call(t.childNodes),v=n.props||Ff,!s&&null!=r)for(v={},u=0;u<t.attributes.length;u++)v[(p=t.attributes[u]).name]=p.value;for(u in v)if(p=v[u],"children"==u);else if("dangerouslySetInnerHTML"==u)d=p;else if("key"!==u&&!(u in y)){if("value"==u&&"defaultValue"in y||"checked"==u&&"defaultChecked"in y)continue;ag(t,u,null,p,i)}for(u in y)p=y[u],"children"==u?h=p:"dangerouslySetInnerHTML"==u?c=p:"value"==u?f=p:"checked"==u?g=p:"key"===u||s&&"function"!=typeof p||v[u]===p||ag(t,u,p,v[u],i);if(c)s||d&&(c.__html===d.__html||c.__html===t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(d&&(t.innerHTML=""),tg(t,Gf(h)?h:[h],e,n,o,"foreignObject"===m?"http://www.w3.org/1999/xhtml":i,r,a,r?r[0]:n.__k&&Zf(n,0),s,l),null!=r)for(u=r.length;u--;)null!=r[u]&&Xf(r[u]);s||(u="value",void 0!==f&&(f!==t[u]||"progress"===m&&!f||"option"===m&&f!==v[u])&&ag(t,u,f,v[u],i),u="checked",void 0!==g&&g!==t[u]&&ag(t,u,g,v[u],i))}return t}function dg(t,e,n){try{if("function"==typeof t){var o="function"==typeof t.__u;o&&t.__u(),o&&null==e||(t.__u=t(e))}else t.current=e}catch(t){Pf.__e(t,n)}}function hg(t,e,n){var o,i;if(Pf.unmount&&Pf.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||dg(o,null,e)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){Pf.__e(t,e)}o.base=o.__P=null}if(o=t.__k)for(i=0;i<o.length;i++)o[i]&&hg(o[i],e,n||"function"!=typeof t.type);n||null==t.__e||Xf(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function pg(t,e,n){return this.constructor(t,n)}Of=zf.slice,Pf={__e:function(t,e,n,o){for(var i,r,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(t)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,o||{}),a=i.__d),a)return i.__E=i}catch(e){t=e}throw t}},kf=0,Kf.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Uf({},this.state),"function"==typeof t&&(t=t(Uf({},n),this.props)),t&&Uf(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),Jf(this))},Kf.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Jf(this))},Kf.prototype.render=qf,Rf=[],Lf="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,If=function(t,e){return t.__v.__b-e.__v.__b},Qf.__r=0,jf=0,Bf=sg(!1),Hf=sg(!0);var fg=0;function gg(t,e,n,o,i,r){e||(e={});var a,s,l=e;if("ref"in l)for(s in l={},e)"ref"==s?a=e[s]:l[s]=e[s];var u={type:t,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--fg,__i:-1,__u:0,__source:i,__self:r};if("function"==typeof t&&(a=t.defaultProps))for(s in a)void 0===l[s]&&(l[s]=a[s]);return Pf.vnode&&Pf.vnode(u),u}var vg=e.LogicFlowUtil.StepDrag,yg=function(t){function n(n){var o=t.call(this)||this;return o.updatePosition=function(t){var e=t.deltaX,n=t.deltaY,i=o.nodeModel,r=i.x,a=i.y;o.nodeModel.x=r+e/2,o.nodeModel.y=a+n/2,o.nodeModel.moveText(e/2,n/2)},o.getResize=function(t){var e=t.index,n=t.deltaX,o=t.deltaY,i=t.width,r=t.height,a=t.PCTResizeInfo,s=t.pct,l=void 0===s?1:s,u=t.freezeWidth,c=void 0!==u&&u,d=t.freezeHeight,h=void 0!==d&&d,p={width:i,height:r,deltaX:n,deltaY:o};if(a){var f=0,g=0;switch(e){case 0:g=(-1*n-o)/4;break;case 1:g=(n-o)/4;break;case 2:g=(n+o)/4;break;case 3:g=(-1*n+o)/4}0!==g&&(f=Math.round(g/a.ResizeBasis.basisHeight*1e5)/1e3),a.ResizePCT.widthPCT=Math.max(Math.min(a.ResizePCT.widthPCT+f,a.ScaleLimit.maxScaleLimit),a.ScaleLimit.minScaleLimit),a.ResizePCT.heightPCT=Math.max(Math.min(a.ResizePCT.heightPCT+f,a.ScaleLimit.maxScaleLimit),a.ScaleLimit.minScaleLimit);var v=Math.round(a.ResizePCT.widthPCT*a.ResizeBasis.basisWidth/100),y=Math.round(a.ResizePCT.heightPCT*a.ResizeBasis.basisHeight/100);switch(e){case 0:n=i-v,o=r-y;break;case 1:n=v-i,o=r-y;break;case 2:n=v-i,o=y-r;break;case 3:n=i-v,o=y-r}return p.width=v,p.height=y,p.deltaX=n/l,p.deltaY=o/l,p}switch(e){case 0:p.width=c?i:i-n*l,p.height=h?r:r-o*l;break;case 1:p.width=c?i:i+n*l,p.height=h?r:r-o*l;break;case 2:p.width=c?i:i+n*l,p.height=h?r:r+o*l;break;case 3:p.width=c?i:i-n*l,p.height=h?r:r+o*l}return p},o.updateEdgePointByAnchors=function(){var t=o.nodeModel,e=t.id,n=t.anchors,i=o.getNodeEdges(e);i.sourceEdges.forEach((function(t){var e=n.find((function(e){return e.id===t.sourceAnchorId}));e&&t.updateStartPoint({x:e.x,y:e.y})})),i.targetEdges.forEach((function(t){var e=n.find((function(e){return e.id===t.targetAnchorId}));e&&t.updateEndPoint({x:e.x,y:e.y})}))},o.updateRect=function(t){var e=t.deltaX,n=t.deltaY,i=o.nodeModel,r=i.x,a=i.y,s=i.width,l=i.height,u=i.radius,c=i.PCTResizeInfo,d=o.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,g=d.maxHeight,v=o.index,y=h===f,m=p===g,b=o.getResize({index:v,deltaX:e,deltaY:n,width:s,height:l,PCTResizeInfo:c,pct:1,freezeWidth:y,freezeHeight:m});if(b.width<h||b.width>f||b.height<p||b.height>g)o.dragHandler.cancelDrag();else{o.updatePosition({deltaX:y?0:b.deltaX,deltaY:m?0:b.deltaY}),o.nodeModel.width=b.width,o.nodeModel.height=b.height,o.nodeModel.setProperties({nodeSize:{width:b.width,height:b.height}});var x={x:r,y:a,width:s,height:l,radius:u},_={x:o.nodeModel.x,y:o.nodeModel.y,width:o.nodeModel.width,height:o.nodeModel.height,radius:u};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:e,deltaY:n,beforeNode:x,afterNode:_})}},o.updateEllipse=function(t){var e=t.deltaX,n=t.deltaY,i=o.nodeModel,r=i.rx,a=i.ry,s=i.x,l=i.y,u=i.PCTResizeInfo,c=o.index,d=o.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,v=d.maxHeight,y=h===f,m=p===v,b=r,x=a,_=o.getResize({index:c,deltaX:e,deltaY:n,width:b,height:x,PCTResizeInfo:u,pct:.5,freezeWidth:y,freezeHeight:m});if(_.width<h/2||_.width>f/2||_.height<p/2||_.height>v/2)o.dragHandler.cancelDrag();else{o.updatePosition({deltaX:y?0:_.deltaX,deltaY:m?0:_.deltaY}),o.nodeModel.rx=_.width,o.nodeModel.ry=_.height,o.nodeModel.setProperties({nodeSize:{rx:_.width,ry:_.height}});var E={x:s,y:l},w={rx:_.width,ry:_.height,x:o.nodeModel.x,y:o.nodeModel.y};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:e,deltaY:n,beforeNode:g(g({},E),{rx:r,ry:a}),afterNode:w})}},o.updateDiamond=function(t){var e=t.deltaX,n=t.deltaY,i=o.nodeModel,r=i.rx,a=i.ry,s=i.x,l=i.y,u=i.PCTResizeInfo,c=o.index,d=o.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,g=d.maxHeight,v=h===f,y=p===g,m=r,b=a,x=o.getResize({index:c,deltaX:e,deltaY:n,width:m,height:b,PCTResizeInfo:u,pct:.5,freezeWidth:v,freezeHeight:y});if(x.width<h/2||x.width>f/2||x.height<p/2||x.height>g/2)o.dragHandler.cancelDrag();else{o.updatePosition({deltaX:v?0:x.deltaX,deltaY:y?0:x.deltaY}),o.nodeModel.rx=x.width,o.nodeModel.ry=x.height,o.nodeModel.setProperties({nodeSize:{rx:x.width,ry:x.height}});var _={x:s,y:l,rx:r,ry:a},E={rx:x.width,ry:x.height,x:o.nodeModel.x,y:o.nodeModel.y};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:e,deltaY:n,beforeNode:_,afterNode:E})}},o.eventEmit=function(t){var e=t.deltaX,n=t.deltaY,i=t.beforeNode,r=t.afterNode,a=o.nodeModel,s=a.id,l=a.modelType,u=a.type,c=g({id:s,modelType:l,type:u},i),d=g({id:s,modelType:l,type:u},r);o.graphModel.eventCenter.emit("node:resize",{preData:c,data:d,deltaX:e,deltaY:n,index:o.index,model:o.nodeModel})},o.onDragging=function(t){var n,i=t.deltaX,r=t.deltaY,a=o.graphModel.transformModel,s=o.nodeModel.modelType;i=(n=_(a.fixDeltaXY(i,r),2))[0],r=n[1],s===e.ModelType.RECT_NODE||s===e.ModelType.HTML_NODE?o.updateRect({deltaX:i,deltaY:r}):s===e.ModelType.ELLIPSE_NODE?o.updateEllipse({deltaX:i,deltaY:r}):s===e.ModelType.DIAMOND_NODE&&o.updateDiamond({deltaX:i,deltaY:r})},o.onDragEnd=function(){var t=o.graphModel.gridSize,e=void 0===t?1:t,n=e*Math.round(o.nodeModel.x/e),i=e*Math.round(o.nodeModel.y/e);o.nodeModel.moveTo(n,i),o.updateEdgePointByAnchors()},o.index=n.index,o.nodeModel=n.model,o.graphModel=n.graphModel,o.dragHandler=new vg({onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:1}),o}return f(n,t),n.prototype.getNodeEdges=function(t){for(var e=this.graphModel.edges,n=[],o=[],i=0;i<e.length;i++){var r=e[i];r.sourceNodeId===t?n.push(r):e[i].targetNodeId===t&&o.push(r)}return{sourceEdges:n,targetEdges:o}},n.prototype.render=function(){var t=this.props,n=t.x,o=t.y,i=t.index,r=t.model.getControlPointStyle();return gg("g",{className:"lf-resize-control-".concat(i),children:gg(e.Rect,g({className:"lf-node-control",x:n,y:o},r,{onMouseDown:this.dragHandler.handleMouseDown}))})},n}(e.Component),mg=function(t){function n(){var e=t.call(this)||this;return e.state={},e}return f(n,t),n.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,o=e.x,i=e.y,r=e.width,a=e.height,s={minX:o-r/2,minY:i-a/2,maxX:o+r/2,maxY:i+a/2},l=s.minX,u=s.minY,c=s.maxX,d=s.maxY;return[{x:l,y:u},{x:c,y:u},{x:c,y:d},{x:l,y:d}].map((function(t,o){return gg(yg,g({index:o},t,{model:e,graphModel:n}))}))},n.prototype.getGroupSolid=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.getResizeOutlineStyle();return gg(e.Rect,g({},a,{x:n,y:o,width:i,height:r}))},n.prototype.render=function(){return gg("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},n}(e.Component),bg=function(t){function e(e,n){var o=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(o.rx=i.rx,o.ry=i.ry),o}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.rx,basisHeight:this.ry},n={maxScaleLimit:Math.min(this.maxWidth/(2*this.rx)*100,this.maxHeight/(2*this.ry)*100),minScaleLimit:Math.max(this.minWidth/(2*this.rx)*100,this.minHeight/(2*this.ry)*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.EllipseNodeModel),xg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return gg(mg,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model,n=t.graphModel.editConfigModel.isSilentMode;return gg("g",{children:[this.getResizeShape(),e.isSelected&&!n?this.getControlGroup():""]})},e}(e.EllipseNode),_g={type:"ellipse",view:xg,model:bg},Eg=function(t){function e(e,n){var o=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(o.rx=i.rx,o.ry=i.ry),o}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.rx,basisHeight:this.ry},n={maxScaleLimit:Math.min(this.maxWidth/(2*this.rx)*100,this.maxHeight/(2*this.ry)*100),minScaleLimit:Math.max(this.minWidth/(2*this.rx)*100,this.minHeight/(2*this.ry)*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.DiamondNodeModel),wg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return gg(mg,{model:e,graphModel:n})},n.prototype.getResizeShape=function(){var t=this.props.model,n=t.points,o=t.getNodeStyle();return gg("g",{children:gg(e.Polygon,g({},o,{points:n}))})},n.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return gg("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},n}(e.DiamondNode),Sg={type:"diamond",view:wg,model:Eg},Cg=function(t){function e(e,n){var o=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(o.width=i.width,o.height=i.height),o}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.width,basisHeight:this.height},n={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.HtmlNodeModel),Ng=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return gg(mg,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return gg("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(e.HtmlNode),Tg={type:"html",view:Ng,model:Cg},Ag=function(t){function e(e,n){var o=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(o.width=i.width,o.height=i.height),o}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.width,basisHeight:this.height},n={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.RectNodeModel),Mg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return gg(mg,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return gg("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(e.RectNode),Og={type:"rect",view:Mg,model:Ag},Pg={pluginName:"nodeResize",step:0,install:function(t){t.register(_g),t.register(Sg),t.register(Tg),t.register(Og)}},kg=function(t){function e(){var e=t.apply(this,E([],_(arguments),!1))||this;return e.isGroup=!0,e.isFolded=!1,e.unfoldedWidth=500,e.unfoldedHeight=300,e.childrenLastFoldStatus={},e}return f(e,t),e.prototype.initNodeData=function(e){var n=this;t.prototype.initNodeData.call(this,e);var o=[];ee(e.children)&&(o=e.children),this.children=new Set(o),this.width=500,this.height=300,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=-1e4,this.radius=0,this.text.editable=!1,this.text.draggable=!1,this.isRestrict=!1,this.resizable=!1,this.autoToFront=!1,this.foldable=!1,void 0===this.properties.isFolded&&(this.properties.isFolded=!1),this.isFolded=!!this.properties.isFolded,setTimeout((function(){n.isFolded&&n.foldGroup(n.isFolded)}))},e.prototype.getResizeOutlineStyle=function(){var e=t.prototype.getResizeOutlineStyle.call(this);return e.stroke="none",e},e.prototype.foldGroup=function(t){var e=this;if(t!==this.isFolded){this.setProperty("isFolded",t),this.isFolded=t,t?(this.x=this.x-this.width/2+this.foldedWidth/2,this.y=this.y-this.height/2+this.foldedHeight/2,this.unfoldedWidth=this.width,this.unfoldedHeight=this.height,this.width=this.foldedWidth,this.height=this.foldedHeight):(this.width=this.unfoldedWidth,this.height=this.unfoldedHeight,this.x=this.x+this.width/2-this.foldedWidth/2,this.y=this.y+this.height/2-this.foldedHeight/2);var n=E(E([],_(this.incoming.edges),!1),_(this.outgoing.edges),!1);this.children.forEach((function(o){var i=e.graphModel.getElement(o);if(i){var r=i.isFolded;if(i.isGroup&&!i.isFolded&&i.foldGroup(t),i.isGroup&&!t){var a=e.childrenLastFoldStatus[o];void 0!==a&&a!==i.isFolded&&i.foldGroup(a)}e.childrenLastFoldStatus[o]=!!r,i.visible=!t;var s=i.incoming.edges,l=i.outgoing.edges;n=E(E(E([],_(n),!1),_(s),!1),_(l),!1)}})),this.foldEdge(t,n)}},e.prototype.getAnchorStyle=function(e){var n=t.prototype.getAnchorStyle.call(this,e);return n.stroke="transparent",n.fill="transparent",n.hover.fill="transparent",n.hover.stroke="transparent",n},e.prototype.foldEdge=function(t,e){var n=this;e.forEach((function(e,o){var i=e.id,r=e.sourceNodeId,a=e.targetNodeId,s=e.startPoint,l=e.endPoint,u=e.type,c=e.text,d=e.getProperties(),h={id:"".concat(i,"__").concat(o),sourceNodeId:r,targetNodeId:a,startPoint:s,endPoint:l,type:u,properties:d,text:null==c?void 0:c.value};e.virtual&&n.graphModel.deleteEdgeById(e.id);var p=n.graphModel.group.getNodeGroup(a);p||(p=n.graphModel.getNodeModelById(a));var f=n.graphModel.group.getNodeGroup(r);f||(f=n.graphModel.getNodeModelById(r)),t&&!1!==e.visible&&(n.children.has(r)||n.id===r?(h.startPoint=void 0,h.sourceNodeId=n.id):(h.endPoint=void 0,h.targetNodeId=n.id),p.id===n.id&&f.id===n.id||n.createVirtualEdge(h),e.visible=!1),t||!1!==e.visible||(p&&p.isGroup&&p.isFolded?(h.targetNodeId=p.id,h.endPoint=void 0,n.createVirtualEdge(h)):f&&f.isGroup&&f.isFolded?(h.sourceNodeId=f.id,h.startPoint=void 0,n.createVirtualEdge(h)):e.visible=!0)}))},e.prototype.createVirtualEdge=function(t){t.pointsList=void 0;var e=this.graphModel.addEdge(t);e.virtual=!0,e.text.editable=!1,e.isFoldedEdge=!0},e.prototype.isInRange=function(t){var e=t.minX,n=t.minY,o=t.maxX,i=t.maxY;return e>=this.x-this.width/2&&o<=this.x+this.width/2&&n>=this.y-this.height/2&&i<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(t){var e=t.x1,n=t.y1,o=t.x2,i=t.y2;return{x:e>=this.x-this.width/2&&o<=this.x+this.width/2,y:n>=this.y-this.height/2&&i<=this.y+this.height/2}},e.prototype.setAllowAppendChild=function(t){this.setProperty("groupAddable",t)},e.prototype.addChild=function(t){this.children.add(t),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},e.prototype.removeChild=function(t){this.children.delete(t),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},e.prototype.getData=function(){var e=this,n=t.prototype.getData.call(this);n.children=[],this.children.forEach((function(t){var o=e.graphModel.getNodeModelById(t);o&&!o.virtual&&n.children.push(t)}));var o=n.properties;return null==o||delete o.groupAddable,null==o||delete o.isFolded,n},e.prototype.getHistoryData=function(){var e=t.prototype.getData.call(this);e.children=E([],_(this.children),!1),e.isGroup=!0;var n=e.properties;return null==n||delete n.groupAddable,(null==n?void 0:n.isFolded)&&(e.x=e.x+this.unfoldedWidth/2-this.foldedWidth/2,e.y=e.y+this.unfoldedHeight/2-this.foldedHeight/2),e},e.prototype.isAllowAppendIn=function(t){return!0},e.prototype.toBack=function(){this.zIndex--},e}(Ag),Rg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getControlGroup=function(){var e=this.props.model,n=e.resizable,o=e.properties;return n&&!o.isFolded?t.prototype.getControlGroup.call(this):null},n.prototype.getAddableShape=function(){var t=this.props.model,n=t.width,o=t.height,i=t.x,r=t.y,a=t.radius,s=t.properties,l=t.getAddableOutlineStyle;if(!s.groupAddable)return null;var u=this.props.model.getNodeStyle().strokeWidth,c=void 0===u?0:u,d=l(),h=n+c+8,p=o+c+8;return e.h("rect",g(g({},d),{width:h,height:p,x:i-h/2,y:r-p/2,rx:a,ry:a}))},n.prototype.getFoldIcon=function(){var t=this.props.model,n=t.x-t.width/2+5,o=t.y-t.height/2+5;if(!t.foldable)return null;var i=e.h("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:t.properties.isFolded?"M ".concat(n+3,",").concat(o+6," ").concat(n+11,",").concat(o+6," M").concat(n+7,",").concat(o+2," ").concat(n+7,",").concat(o+10):"M ".concat(n+3,",").concat(o+6," ").concat(n+11,",").concat(o+6," ")});return e.h("g",{},[e.h("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:t.x-t.width/2+5,y:t.y-t.height/2+5,onClick:function(){t.foldGroup(!t.properties.isFolded)}}),i])},n.prototype.getResizeShape=function(){return e.h("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},n}(Mg),Dg={type:"group",view:Rg,model:kg},Lg=-1e4,Ig=function(){function t(t){var e=t.lf,n=this;this.topGroupZIndex=Lg,this.nodeGroupMap=new Map,this.graphRendered=function(t){var e=t.data;e&&e.nodes&&(e.nodes.forEach((function(t){t.children&&t.children.forEach((function(e){n.nodeGroupMap.set(e,t.id)}))})),n.checkAndCorrectTopGroupZIndex(e.nodes))},this.appendNodeToGroup=function(t){var e=t.data,o=n.nodeGroupMap.get(e.id);if(o){var i=n.lf.getNodeModelById(o);i.removeChild(e.id),n.nodeGroupMap.delete(e.id),i.setAllowAppendChild(!1)}var r=n.lf.getNodeModelById(e.id),a=null==r?void 0:r.getBounds();if(a&&r){var s=n.getGroup(a,e);if(r.isGroup&&(e.children.forEach((function(t){n.nodeGroupMap.set(t,e.id)})),n.checkAndCorrectTopGroupZIndex([e]),n.nodeSelected({data:e,isSelected:!1,isMultiple:!1})),!s)return;if(!s.isAllowAppendIn(e))return void n.lf.emit("group:not-allowed",{group:s.getData(),node:e});s.addChild(e.id),n.nodeGroupMap.set(e.id,s.id),s.setAllowAppendChild(!1)}},this.deleteGroupChild=function(t){var e=t.data;e.children&&e.children.forEach((function(t){n.nodeGroupMap.delete(t),n.lf.deleteNode(t)}));var o=n.nodeGroupMap.get(e.id);o&&(n.lf.getNodeModelById(o).removeChild(e.id),n.nodeGroupMap.delete(e.id))},this.setActiveGroup=function(t){var e=t.data,o=n.lf.getNodeModelById(e.id),i=null==o?void 0:o.getBounds();if(o&&i){var r=n.getGroup(i,e);if(n.activeGroup&&n.activeGroup.setAllowAppendChild(!1),!r||o.isGroup&&r.id===e.id)return;if(!r.isAllowAppendIn(e))return;n.activeGroup=r,n.activeGroup.setAllowAppendChild(!0)}},this.findNodeAndChildMaxZIndex=function(t){var e=Lg;return t.isGroup&&(e=Math.max(e,t.zIndex)),t.children&&t.children.forEach((function(t){"object"==typeof t&&(t=t.id);var o=n.lf.getNodeModelById(t);if(null==o?void 0:o.isGroup){var i=n.findNodeAndChildMaxZIndex(o);e=Math.max(i,e)}})),e},this.checkAndCorrectTopGroupZIndex=function(t){var e=Lg;if(t.forEach((function(t){var o=n.lf.getNodeModelById(t.id);if(o){var i=n.findNodeAndChildMaxZIndex(o);i>e&&(e=i)}})),!(n.topGroupZIndex>=e)){for(var o=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})),i=n.topGroupZIndex,r=0;r<o.length;r++){var a=o[r];a.zIndex>i&&(i=a.zIndex)}n.topGroupZIndex=i}},this.nodeSelected=function(t){var e=t.data,o=t.isMultiple,i=t.isSelected,r=n.lf.getNodeModelById(e.id);if(n.toFrontGroup(r),n.topGroupZIndex>-1e3){n.topGroupZIndex=Lg;for(var a=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})).sort((function(t,e){return t.zIndex-e.zIndex})),s=0,l=0;l<a.length;l++){var u=a[l];u.zIndex!==s&&(n.topGroupZIndex++,s=u.zIndex),u.setZIndex(n.topGroupZIndex)}}if(o&&i)if(null==r?void 0:r.isGroup)r.children.forEach((function(t){var e=n.lf.graphModel.getElement(t);null==e||e.setSelected(!1)}));else{var c=n.nodeGroupMap.get(e.id);if(c){var d=n.lf.getNodeModelById(c);(null==d?void 0:d.isSelected)&&(null==r||r.setSelected(!1))}}},this.toFrontGroup=function(t){t&&t.isGroup&&(n.topGroupZIndex++,t.setZIndex(n.topGroupZIndex),t.children&&t.children.forEach((function(t){var e=n.lf.getNodeModelById(t);n.toFrontGroup(e)})))},e.register(Dg),this.lf=e,e.graphModel.addNodeMoveRules((function(t,o,i){if(t.isGroup){var r=n.getNodeAllChild(t);return e.graphModel.moveNodes(r,o,i,!0),!0}var a=e.getNodeModelById(n.nodeGroupMap.get(t.id));if(a&&a.isRestrict){var s=t.getBounds(),l=s.minX,u=s.minY,c=s.maxX,d=s.maxY;return a.isAllowMoveTo({x1:l+o,y1:u+i,x2:c+o,y2:d+i})}return!0})),e.graphModel.group=this,e.on("node:add,node:drop,node:dnd-add",this.appendNodeToGroup),e.on("node:delete",this.deleteGroupChild),e.on("node:dnd-drag,node:drag",this.setActiveGroup),e.on("node:click",this.nodeSelected),e.on("graph:rendered",this.graphRendered),e.addElements=function(t,o){var i=t.nodes,r=t.edges,a={},s={nodes:[],edges:[]},l=[];return xu(i,(function(t){var i=t.id,r=t.children,u=v(t,["children"]),c=e.addNode(u);if(!c)return{nodes:[],edges:[]};i&&(a[i]=c.id),s.nodes.push(c);var d=n.createAllChildNodes(a,r,c,o).edgesArray;l.push.apply(l,E([],_(d),!1))})),l.forEach((function(t){n.createEdgeModel(t,a,o)})),xu(r,(function(t){var e=n.createEdgeModel(t,a,0);s.edges.push(e)})),s}}return t.prototype.createAllChildNodes=function(t,n,o,i){var r=this,a=this.lf,s=[],l=[],u=[];null==n||n.forEach((function(n){var c=a.getNodeModelById(n);if(c){var d=c.x,h=c.y,p=c.properties,f=c.type,g=c.rotate,v=c.children,y={x:d+i,y:h+i,properties:p,type:f,rotate:g},m=e.EventType.NODE_GROUP_COPY||"node:group-copy-add",b=a.addNode(y,m);if(o.addChild(b.id),t[n]=b.id,u.push(b),c.incoming.edges.forEach((function(t){l.push(t)})),c.outgoing.edges.forEach((function(t){l.push(t)})),v instanceof Set){var x=r.createAllChildNodes(t,v,b,i),w=x.nodesArray,S=x.edgesArray;u.push.apply(u,E([],_(w),!1)),s.push.apply(s,E([],_(S),!1))}}}));var c=l.filter((function(e){return t[e.sourceNodeId]&&t[e.targetNodeId]})).map((function(t){return t.getData()}));return{nodesArray:u,edgesArray:s.concat(c)}},t.prototype.createEdgeModel=function(t,e,n){var o=this.lf,i=t.sourceNodeId,r=t.targetNodeId;e[i]&&(i=e[i]),e[r]&&(r=e[r]);var a=t.type,s=t.startPoint,l=t.endPoint,u=t.pointsList,c=t.text,d={x:((null==s?void 0:s.x)||0)+n,y:((null==s?void 0:s.y)||0)+n},h={x:((null==l?void 0:l.x)||0)+n,y:((null==l?void 0:l.y)||0)+n},p=[];u&&u.length>0&&(p=u.map((function(t){return t.x+=n,t.y+=n,t})));var f={type:a,startPoint:d,endPoint:h,sourceNodeId:i,targetNodeId:r,pointsList:p};return he(c)&&!Vc(c)&&(f.text=g(g({},c),{x:(null==c?void 0:c.x)+n,y:(null==c?void 0:c.y)+n})),o.graphModel.addEdge(f)},t.prototype.getNodeAllChild=function(t){var e=this,n=[];return t.children&&t.children.forEach((function(t){n.push(t);var o=e.lf.getNodeModelById(t);(null==o?void 0:o.isGroup)&&(n=n.concat(e.getNodeAllChild(o)))})),n},t.prototype.getGroup=function(t,e){var n=this.lf.graphModel.nodes.filter((function(n){return n.isGroup&&n.isInRange(t)&&n.id!==e.id}));if(0!==n.length){if(1===n.length)return n[0];for(var o=n[n.length-1],i=n.length-2;i>=0;i--)n[i].zIndex>o.zIndex&&(o=n[i]);return o}},t.prototype.getNodeGroup=function(t){var e=this.nodeGroupMap.get(t);if(e)return this.lf.getNodeModelById(e)},t.prototype.render=function(){},t.prototype.destroy=function(){},t.pluginName="group",t}();function jg(){var t=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getFoldIcon=function(){var t=this.props.model,n=t,o=n.x,i=n.y,r=n.width,a=n.height,s=n.properties,l=n.foldable,u=t.x-t.width/2+5,c=t.y-t.height/2+5;if(!l)return null;var d=e.h("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:s.isFolded?"M ".concat(u+3,",").concat(c+6," ").concat(u+11,",").concat(c+6," M").concat(u+7,",").concat(c+2," ").concat(u+7,",").concat(c+10):"M ".concat(u+3,",").concat(c+6," ").concat(u+11,",").concat(c+6," ")});return e.h("g",{},[e.h("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:o-r/2+5,y:i-a/2+5,onClick:function(e){var n,o;null===(o=(n=e.stopPropagation()(t)).foldGroup)||void 0===o||o.call(n,!s.isFolded)}}),d])},n.prototype.getResizeShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.getNodeStyle(),s=g(g({},a),{x:n-i/2,y:o-r/2,width:i,height:r,stroke:"black",strokeWidth:2,strokeDasharray:"0 0"});return e.h("g",{},[e.h("rect",g({},s)),this.getFoldIcon()])},n}(Rg),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.foldable=!0,this.resizable=!0,this.width=400,this.height=200,this.resetWidthHeight(),this.isTaskNode=!0,this.boundaryEvents=[]},e.prototype.resetWidthHeight=function(){var t,e,n=null===(t=this.properties.iniProp)||void 0===t?void 0:t.width,o=null===(e=this.properties.iniProp)||void 0===e?void 0:e.height;n&&(this.width=n),o&&(this.height=o)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return e.stroke="#989891",e.strokeWidth=1,e.strokeDasharray="3 3",this.isSelected&&(e.stroke="rgb(124, 15, 255)"),this.properties.isBoundaryEventTouchingTask&&(e.stroke="#00acff",e.strokeWidth=2),e},e.prototype.addChild=function(e){var n=this.graphModel.getElement(e);null==n||n.setProperties({parent:this.id}),t.prototype.addChild.call(this,e)},e.prototype.getAnchorStyle=function(){var e=t.prototype.getAnchorStyle.call(this);return e.stroke="#000",e.fill="#fff",e.hover||(e.hover={}),e.hover.stroke="transparent",e},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return e.stroke="transparent",e.hover||(e.hover={}),e.hover.stroke="transparent",e},e.prototype.setTouching=function(t){this.setProperty("isBoundaryEventTouchingTask",t)},e.prototype.addBoundaryEvent=function(t){if(this.setTouching(!1),this.boundaryEvents.find((function(e){return e===t})))return!1;var e=this.graphModel.getNodeModelById(t);return null==e||e.setProperties({attachedToRef:this.id}),this.boundaryEvents.push(t),!0},e.prototype.deleteBoundaryEvent=function(t){this.boundaryEvents=this.boundaryEvents.filter((function(e){return e!==t}))},e}(kg);return{type:"bpmn:subProcess",view:t,model:n}}function Bg(t){var e=Lt("bpmn:serviceTask",Tt),n=Lt("bpmn:userTask",At);t.register(e),t.register(n),t.register(jg()),function(t){function e(t,e){var n=t.x,o=t.y,i=t.width,r=t.height,a=t.id,s=n-i/2,l=n+i/2,u=o-r/2,c=o+r/2,d=e.x,h=e.y;return d>s-5&&d<l+5&&h>u-5&&h<c+5&&!(d>s+5&&d<l-5&&h>u+5&&h<c-5)?a:null}t.on("node:drag,node:dnd-drag",(function(n){var o,i,r=n.data;if("bpmn:boundaryEvent"===r.type){var a=t.graphModel.nodes;try{for(var s=x(a),l=s.next();!l.done;l=s.next()){var u=l.value;u.isTaskNode&&(e(u,r)?u.setTouching(!0):u.setTouching(!1))}}catch(t){o={error:t}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}})),t.on("node:drop,node:dnd-add",(function(n){var o,i,r=n.data,a=r.type,s=r.id;if("bpmn:boundaryEvent"===a){var l=t.graphModel.nodes;try{for(var u=x(l),c=u.next();!c.done;c=u.next()){var d,h=c.value;if(h.isTaskNode)if(null!==(d=e(h,r))){var p=t.graphModel.getNodeModelById(s),f=t.graphModel.getNodeModelById(d),g=p.properties.attachedToRef;return g&&g!==d&&t.graphModel.getNodeModelById(g).deleteBoundaryEvent(s),void f.addBoundaryEvent(s)}}}catch(t){o={error:t}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}}})),t.graphModel.addNodeMoveRules((function(e,n,o){if(e.isTaskNode){var i=e.boundaryEvents;return t.graphModel.moveNodes(i,n,o,!0),!0}return!0}))}(t)}function Hg(t){var n=function(e){function n(n,o){n.id||(n.id="Flow_".concat(gt()));var i=g(g(g({},t||{}),n.properties),{isDefaultFlow:!1});return n.properties=i,e.call(this,n,o)||this}return f(n,e),n.extendKey="SequenceFlowModel",n}(e.PolylineEdgeModel),o=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getStartArrow=function(){return this.props.model.properties.isDefaultFlow?e.h("path",{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}):e.h("path",{d:""})},n.extendKey="SequenceFlowEdge",n}(e.PolylineEdge);return{type:"bpmn:sequenceFlow",view:o,model:n}}var Fg=Hg();var zg=[{nodes:["startEvent","intermediateCatchEvent","boundaryEvent"],definition:[{type:"bpmn:timerEventDefinition",icon:Et,properties:{definitionType:"bpmn:timerEventDefinition",timerValue:"",timerType:""}}]}];function Wg(t){function e(e){e.forEach((function(e){var n,o;n=e.nodes,o=e.definition,n.forEach((function(e){(null==t?void 0:t[e])||(t[e]=new Map);var n=null==t?void 0:t[e];o.forEach((function(t){n.set(t.type,t)}))}))}))}return function(){return[t,e]}}var Gg=function(){function t(t){var e=t.lf;e.definition={},e.useDefinition=Wg(e.definition);var n=_(e.useDefinition(),2);n[0];(0,n[1])(zg),function(t){t.register(bt(t)),t.register(yt(t)),t.register(mt(t)),t.register(_t(t)),t.register(xt(t))}(e),function(t){var e=Rt("bpmn:exclusiveGateway",St),n=Rt("bpmn:parallelGateway",Ct),o=Rt("bpmn:inclusiveGateway",Nt);t.register(e),t.register(o),t.register(n)}(e),function(t){t.register(Fg)}(e),Bg(e),e.setDefaultEdgeType("bpmn:sequenceFlow")}return t.pluginName="BpmnElementsPlugin",t}(),Ug=40,Xg=40,Vg=40,Yg=40,qg=100,Kg=80,Zg=100,$g=80,Jg=100,Qg=80,tv=100,ev=80,nv=100,ov=80,iv=100,rv=80,av=100,sv=80,lv=100,uv=80,cv=function(){};(cv.ObjTree=function(){return this}).VERSION="0.23",cv.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',cv.ObjTree.prototype.attr_prefix="-",cv.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(t,"application/xml");if(!o)return;e=o.documentElement}else window.ActiveXObject&&((n=new ActiveXObject("Microsoft.XMLDOM")).async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)},cv.ObjTree.prototype.parseHTTP=function(t,e,n){var o,i={};for(var r in e)i[r]=e[r];if(i.method||(void 0===i.postBody&&void 0===i.postbody&&void 0===i.parameters?i.method="get":i.method="post"),n){i.asynchronous=!0;var a=this,s=n,l=i.onComplete;i.onComplete=function(t){var e;t&&t.responseXML&&t.responseXML.documentElement&&(e=a.parseDOM(t.responseXML.documentElement)),s(e,t),l&&l(t)}}else i.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request)i.uri=t,(u=new HTTP.Request(i))&&(o=u.transport);else if("undefined"!=typeof Ajax&&Ajax.Request){var u;(u=new Ajax.Request(t,i))&&(o=u.transport)}return n?o:o&&o.responseXML&&o.responseXML.documentElement?this.parseDOM(o.responseXML.documentElement):void 0},cv.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),11!==t.nodeType){var o={};o[t.nodeName]=n,n=o}return n}},cv.ObjTree.prototype.parseElement=function(t){if(7!==t.nodeType){if(3===t.nodeType||4===t.nodeType||8===t.nodeType){if(null==t.nodeValue.match(/[^\x00-\x20]/))return;return t.nodeValue}var e=null,n={};if(t.attributes&&t.attributes.length){e={};for(var o=0;o<t.attributes.length;o++){if("string"==typeof(s=t.attributes[o].nodeName)){var i=t.attributes[o].nodeValue;try{i=JSON.parse(t.attributes[o].nodeValue.replace(/'/g,'"'))}catch(e){i=t.attributes[o].nodeValue}null!=i&&(void 0===n[s=this.attr_prefix+s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],i))}}}if(t.childNodes&&t.childNodes.length){var r=!0;e&&(r=!1);for(o=0;o<t.childNodes.length&&r;o++){var a=t.childNodes[o].nodeType;3!==a&&4!==a&&8!==a&&(r=!1)}if(r){e||(e="");for(o=0;o<t.childNodes.length;o++)e+=t.childNodes[o].nodeValue}else{e||(e={});for(o=0;o<t.childNodes.length;o++){var s;if("string"==typeof(s=t.childNodes[o].nodeName))(i=this.parseElement(t.childNodes[o]))&&(void 0===n[s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],i))}}}else null===e&&(e={});return e}},cv.ObjTree.prototype.addNode=function(t,e,n,o){this.__force_array[e]?(1===n&&(t[e]=[]),t[e][t[e].length]=o):1===n?t[e]=o:2===n?t[e]=[t[e],o]:t[e][t[e].length]=o},cv.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},cv.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],o=[];for(var i in e)if(fc(e,i)){var r=e[i];i.charAt(0)!==this.attr_prefix?void 0===r||null==r?n[n.length]="<".concat(i," />"):"object"==typeof r&&r.constructor===Array?n[n.length]=this.array_to_xml(i,r):n[n.length]="object"==typeof r?this.hash_to_xml(i,r):this.scalar_to_xml(i,r):o[o.length]=" ".concat(i.substring(1),'="').concat(this.xml_escape(r),'"')}var a=o.join(""),s=n.join("");return void 0===t||null==t||(s=n.length>0?s.match(/\n/)?"<".concat(t).concat(a,">\n").concat(s,"</").concat(t,">\n"):"<".concat(t).concat(a,">").concat(s,"</").concat(t,">\n"):"<".concat(t).concat(a," />\n")),s},cv.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],o=0;o<e.length;o++){var i=e[o];void 0===i||null==i?n[n.length]="<".concat(t," />"):"object"==typeof i&&i.constructor===Array?n[n.length]=this.array_to_xml(t,i):n[n.length]="object"==typeof i?this.hash_to_xml(t,i):this.scalar_to_xml(t,i)}return n.join("")},cv.ObjTree.prototype.scalar_to_xml=function(t,e){return"#text"===t?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e),"</").concat(t,">\n")},cv.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};function dv(t){return Object.prototype.toString.call(t)}function hv(t){return" ".repeat(t)}function pv(t){return"[object Object]"===dv(t)?Object.keys(t).reduce((function(e,n){var o=n;return"-"===n.charAt(0)&&(o=n.substring(1)),e[o]=pv(t[n]),e}),{}):Array.isArray(t)?t.map((function(t){return pv(t)})):t}var fv,gv="\t\n";function vv(t,e,n){var o=hv(n),i="",r=gv+o;if("-json"===e)return"";if("#text"===e)return r+t;if("#cdata-section"===e)return"".concat(r,"<![CDATA[").concat(t,"]]>");if("#comment"===e)return"".concat(r,"\x3c!--").concat(t,"--\x3e");if("-"==="".concat(e).charAt(0))return" ".concat(e.substring(1),'="').concat(function(t){var e=t;try{"string"!=typeof e&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(pv(t)).replace(/"/g,"'")}return e}(t),'"');if(Array.isArray(t))i+=t.map((function(t){return vv(t,e,n+1)})).join("");else if("[object Object]"===dv(t)){var a=Object.keys(t),s="",l=t["-json"]?gv+hv(n+1)+t["-json"]:"";i+="".concat(0===n?"":r,"<").concat(e),a.forEach((function(e){"-"===e.charAt(0)?s+=vv(t[e],e,n+1):l+=vv(t[e],e,n+1)})),i+=s+(""!==l?">".concat(l).concat(r,"</").concat(e,">"):" />")}else i+="".concat(r,"<").concat(e,">").concat(t.toString(),"</").concat(e,">");return i}!function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",t.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",t.BOUNDARY="bpmn:boundaryEvent",t.PARALLEL_GATEWAY="bpmn:parallelGateway",t.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",t.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow",t.SUBPROCESS="bpmn:subProcess"}(fv||(fv={}));var yv=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],mv=["properties","startPoint","endPoint","pointsList"],bv={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},xv=function(t,e){return Object.keys(e||{}).forEach((function(n){if(t[n]){var o=e[n],i=o.in,r=o.out;i&&(t[n].in=i),r&&(t[n].out=r)}else t[n]=e[n]})),t},_v={"bpmn:startEvent":{out:function(t){var e,n,o=t.properties;return(null===(n=null===(e=_v[o.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:intermediateCatchEvent":{out:function(t){var e,n,o=t.properties;return(null===(n=null===(e=_v[o.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:intermediateThrowEvent":{out:function(t){var e,n,o=t.properties;return(null===(n=null===(e=_v[o.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:boundaryEvent":{out:function(t){var e,n,o=t.properties;return(null===(n=null===(e=_v[o.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:sequenceFlow":{out:function(t){var e=t.properties,n=e.expressionType,o=e.condition;return o?"cdata"===n?{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${'.concat(o,"}]]></bpmn:conditionExpression>")}:{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression">'.concat(o,"</bpmn:conditionExpression>")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,o=e.timerValue,i=e.definitionId;return{json:'<bpmn:timerEventDefinition id="'.concat(i,'"').concat(n&&o?">".concat("<bpmn:".concat(n,' xsi:type="bpmn:tFormalExpression">').concat(o,"</bpmn:").concat(n,">"),"</bpmn:timerEventDefinition>"):"/>")}},in:function(t,e){var n,o,i,r=t,a=e["-id"],s="",l="";try{for(var u=x(Object.keys(e)),c=u.next();!c.done;c=u.next()){var d=c.value;d.includes("bpmn:")&&(s=_(d.split(":"),2)[1],l=null===(i=e[d])||void 0===i?void 0:i["#text"])}}catch(t){n={error:t}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}return{"-definitionId":a,"-definitionType":r,"-timerType":s,"-timerValue":l}}},"bpmn:conditionExpression":{in:function(t,e){var n,o="",i="";return e["#cdata-section"]?(i="cdata",o=(null===(n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))||void 0===n?void 0:n[1])||""):e["#text"]&&(i="normal",o=e["#text"]),{"-condition":o,"-expressionType":i}}}};function Ev(t){var e=null!=t?t:{},n=e.retainedAttrsFields,o=e.excludeFields,i=e.transformer,r=new Set(E(E([],_(mv),!1),_(n||[]),!1)),a={in:new Set(E(E([],_(bv.in),!1),_((null==o?void 0:o.in)||[]),!1)),out:new Set(E(E([],_(bv.out),!1),_((null==o?void 0:o.out)||[]),!1))};return _v=xv(_v,i),function(t){var e=t.nodes,n=t.edges;return function t(o,i){var s,l;if(1!==(null==o?void 0:o.flag)){var u;if((u=_v[o.type])&&u.out){var c=u.out(o),d=Object.keys(c);d.length>0&&d.forEach((function(t){o[t]=c[t]}))}(null==o?void 0:o.children)&&(o.children=o.children.map((function(t){return e.find((function(e){return e.id===t}))||n.find((function(e){return e.id===t}))||{}})));var h={};if("string"==typeof o)return o;if(Array.isArray(o))return o.map((function(e){return t(e,"")})).filter((function(t){return null!=t}));try{for(var p=x(Object.entries(o)),f=p.next();!f.done;f=p.next()){var g=_(f.value,2),v=g[0],y=g[1];if(1===(null==y?void 0:y.flag))return;var m=[i,v].filter((function(t){return t})).join(".");a.out.has(m)||("object"!=typeof y?0===v.indexOf("-")||["#text","#cdata-section","#comment"].includes(v)?h[v]=y:h["-".concat(v)]=y:r.has(m)?h["-".concat(v)]=t(y,m):h[v]=t(y,m))}}catch(t){s={error:t}}finally{try{f&&!f.done&&(l=p.return)&&l.call(p)}finally{if(s)throw s.error}}return h}}(t,"")}}function wv(t){var e,n,o={};try{for(var i=x(Object.entries(t)),r=i.next();!r.done;r=i.next()){var a=_(r.value,2),s=a[0],l=a[1];0===s.indexOf("-")?o[s.substring(1)]=pv(l):"string"==typeof l?o[s]=l:"[object Object]"===Object.prototype.toString.call(l)?o[s]=wv(l):Array.isArray(l)?o[s]=l.map((function(t){return wv(t)})):o[s]=l}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return o}function Sv(t,e){t["bpmndi:BPMNEdge"]=e.edges.map((function(t){var e,n=t.id,o=t.pointsList.map((function(t){return{"-x":t.x,"-y":t.y}})),i={"-id":"".concat(n,"_di"),"-bpmnElement":n,"di:waypoint":o};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(i["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),i})),t["bpmndi:BPMNShape"]=e.nodes.map((function(t){var e,n=t.id,o=100,i=80,r=t.x,a=t.y,s=Mv.shapeConfigMap.get(t.type);s&&(o=s.width,i=s.height),r-=o/2,a-=i/2;var l={"-id":"".concat(n,"_di"),"-bpmnElement":n,"dc:Bounds":{"-x":r,"-y":a,"-width":o,"-height":i}};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(l["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),l}))}var Cv=["bpmn:incoming","bpmn:outgoing"];function Nv(t,e){var n=[],o=[],i=new Map,r=null!=e?e:{},a=r.transformer,s=r.excludeFields,l={in:new Set(E(E([],_(bv.in),!1),_((null==s?void 0:s.in)||[]),!1)),out:new Set(E(E([],_(bv.out),!1),_((null==s?void 0:s.out)||[]),!1))};_v=xv(_v,a);var u,c,d=t["bpmn:definitions"];if(d){var h=d["bpmn:process"];u=h,c=[function(t){function e(t){t["-children"]||(t["-children"]=[]),Object.keys(t).forEach((function(e){var n;0!==e.indexOf("bpmn:")||Cv.includes(e)||(h[e]||(h[e]=[]),!Array.isArray(h[e])&&(h[e]=[h[e]]),Array.isArray(t[e])?(n=h[e]).push.apply(n,E([],_(t[e]),!1)):h[e].push(t[e]),Array.isArray(t[e])?t[e].forEach((function(n){!e.includes("Flow")&&t["-children"].push(n["-id"])})):!e.includes("Flow")&&t["-children"].push(t[e]["-id"]),delete t[e])}))}if("bpmn:subProcess"===t){var n=h[t];Array.isArray(n)?n.forEach((function(n){"bpmn:subProcess"===t&&e(n)})):e(n)}},function(t){function e(t){var n;i.set(t["-id"],t),Array.isArray(t)?t.forEach((function(t){e(t)})):"object"==typeof t&&(n=t,Object.keys(n).forEach((function(t){var o,i;if(t.includes("bpmn:")){var r={};_v[t]&&_v[t].in?(r=null===(i=(o=_v[t]).in)||void 0===i?void 0:i.call(o,t,pn.cloneDeep(n[t])),delete n[t]):e(n[t]);var a=void 0;(a=Reflect.ownKeys(r)).length>0&&a.forEach((function(t){Reflect.set(n,t,r[t])}))}})))}e(h[t])},function(t){if(0===t.indexOf("bpmn:")){var e=h[t];if("bpmn:sequenceFlow"===t){var r=d["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];o=function(t,e){var n=[];if(Array.isArray(t))t.forEach((function(t){var o;o=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(Av(o,t))}));else{var o=void 0;o=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(Av(o,t))}return n}(e,r)}else{var a=d["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if("bpmn:boundaryEvent"===t){var s=h[t],l=function(t){var e=t["-attachedToRef"],n=i.get(e);n["-boundaryEvents"]||(n["-boundaryEvents"]=[]),n["-boundaryEvents"].push(t["-id"])};Array.isArray(s)?s.forEach((function(t){l(t)})):l(s)}n=n.concat(function(t,e,n){var o=[];if(Array.isArray(t))t.forEach((function(t){var i=Tv(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);o.push(i)}));else{var i=Tv(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);o.push(i)}return o}(e,a,t))}}}],c.forEach((function(t){try{Object.keys(u).forEach((function(e){try{t(e)}catch(t){}}))}catch(t){}}))}var p=function(t,e,n){Object.keys(t).forEach((function(o){var i=n?"".concat(n,".").concat(o):o;e.has(i)?delete t[o]:"object"==typeof t[o]&&p(t[o],e,i)}))};return n.forEach((function(t){var n,o;if(null===(n=null==e?void 0:e.mapping)||void 0===n?void 0:n.in){var i=null===(o=null==e?void 0:e.mapping)||void 0===o?void 0:o.in,r=t.type;i[r]&&(t.type=i[r])}p(t,l.in,"")})),o.forEach((function(t){var n,o;if(null===(n=null==e?void 0:e.mapping)||void 0===n?void 0:n.in){var i=null===(o=null==e?void 0:e.mapping)||void 0===o?void 0:o.in,r=t.type;i[r]&&(t.type=i[r])}p(t,l.in,"")})),{nodes:n,edges:o}}function Tv(t,e,n){var o=Number(t["dc:Bounds"]["-x"]),i=Number(t["dc:Bounds"]["-y"]),r=n["-children"],a=n["-name"],s=Mv.shapeConfigMap.get(e);s&&(o+=s.width/2,i+=s.height/2);var l,u={};if(Object.entries(n).forEach((function(t){var e=_(t,2),n=e[0],o=e[1];yv.includes(n)||(u[n]=o)})),u=wv(u),a&&(l={x:o,y:i,value:a},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var c=t["bpmndi:BPMNLabel"]["dc:Bounds"];l.x=Number(c["-x"])+Number(c["-width"])/2,l.y=Number(c["-y"])+Number(c["-height"])/2}var d={id:t["-bpmnElement"],type:e,x:o,y:i,properties:u};return r&&(d.children=r),l&&(d.text=l),d}function Av(t,e){var n,o="".concat(e["-name"]);if(o){var i=t["bpmndi:BPMNLabel"]["dc:Bounds"],r=0;o.split("\n").forEach((function(t){r<t.length&&(r=t.length)})),n={value:o,x:Number(i["-x"])+10*r/2,y:Number(i["-y"])+7}}var a={};Object.entries(e).forEach((function(t){var e=_(t,2),n=e[0],o=e[1];yv.includes(n)||(a[n]=o)})),a=wv(a);var s=t["di:waypoint"].map((function(t){return{x:Number(t["-x"]),y:Number(t["-y"])}})),l={id:e["-id"],type:fv.FLOW,pointsList:s,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:a};return n&&(l.text=n),l}var Mv=function(){function t(t){var e=t.lf,n=this;this.adapterOut=function(t,e){var o,i,r=g({},n.processAttributes);!function(t,e,n){var o,i=new Map,r=Ev(n)(e);r.nodes.forEach((function(e){var n=e["-id"],o=e["-type"],r=e.text,a=e.children,s=v(e,["-id","-type","text","children"]),l={"-id":n};(null==r?void 0:r["-value"])&&(l["-name"]=r["-value"]),s["-json"]&&(l["-json"]=s["-json"]),s["-properties"]&&Object.assign(l,s["-properties"]),a&&(l.children=a),t[o]||(t[o]=[]),t[o].push(l),i.set(n,l)}));var a=r.edges.map((function(t){var e=t["-id"],n=t["-sourceNodeId"],o=t["-targetNodeId"],r=t.text,a=v(t,["-id","-sourceNodeId","-targetNodeId","text"]),s=i.get(o);s["bpmn:incoming"]||(s["bpmn:incoming"]=[]),s["bpmn:incoming"].push(e);var l={"-id":e,"-sourceRef":n,"-targetRef":o};return(null==r?void 0:r["-value"])&&(l["-name"]=r["-value"]),a["-json"]&&(l["-json"]=a["-json"]),a["-properties"]&&Object.assign(l,a["-properties"]),l}));e.edges.forEach((function(t){var e=t.sourceNodeId,n=t.id,o=i.get(e);o["bpmn:outgoing"]||(o["bpmn:outgoing"]=[]),o["bpmn:outgoing"].push(n)})),null===(o=t["bpmn:subProcess"])||void 0===o||o.forEach((function(e){var n={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},o=[];e.children.forEach((function(o){var r,a=i.get(o["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach((function(t){a[t]&&a[t].forEach((function(e){n[t].add(e)}))}));var s=null===(r=t[o["-type"]])||void 0===r?void 0:r.findIndex((function(t){return t["-id"]===o["-id"]}));s>=0&&t[o["-type"]].splice(s,1),i.delete(o["-id"]),e[o["-type"]]||(e[o["-type"]]=[]),e[o["-type"]].push(a)}));var r=n["bpmn:incoming"];n["bpmn:outgoing"].forEach((function(t){r.has(t)&&o.push(t)}));for(var s,l=function(t){var n=a.findIndex((function(e){return e["-id"]===o[t]}));n>=0?(e["bpmn:sequenceFlow"]||(e["bpmn:sequenceFlow"]=[]),e["bpmn:sequenceFlow"].push(a[n]),a.splice(n,1)):t++,s=t},u=0;u<o.length;)l(u),u=s;delete e.children})),t[fv.FLOW]=a}(r,t,e);var a={"-id":"BPMNPlane_1","-bpmnElement":r["-id"]};Sv(a,t);var s=n.definitionAttributes;s["bpmn:process"]=r,s["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":a};var l={"bpmn:definitions":s};if(null===(o=null==e?void 0:e.mapping)||void 0===o?void 0:o.out){var u=null===(i=null==e?void 0:e.mapping)||void 0===i?void 0:i.out,c=function(t){Array.isArray(t)&&t.forEach((function(t){return c(t)})),"object"==typeof t&&Object.keys(t).forEach((function(e){var n;(n=u[e])?(t[n]=pn.cloneDeep(t[e]),delete t[e],c(t[n])):c(t[e])}))};c(l)}return l},this.adapterIn=function(t,e){if(t)return Nv(t,e)},e.adapterIn=this.adapterIn,e.adapterOut=this.adapterOut,this.processAttributes={"-isExecutable":"true","-id":"Process"},this.definitionAttributes={"-id":"Definitions","-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.10"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();Mv.shapeConfigMap.set(fv.START,{width:Ug,height:Xg}),Mv.shapeConfigMap.set(fv.END,{width:Vg,height:Yg}),Mv.shapeConfigMap.set(fv.INTERMEDIATE_CATCH,{width:Zg,height:$g}),Mv.shapeConfigMap.set(fv.INTERMEDIATE_THROW,{width:Zg,height:$g}),Mv.shapeConfigMap.set(fv.BOUNDARY,{width:qg,height:Kg}),Mv.shapeConfigMap.set(fv.PARALLEL_GATEWAY,{width:Jg,height:Qg}),Mv.shapeConfigMap.set(fv.INCLUSIVE_GATEWAY,{width:tv,height:ev}),Mv.shapeConfigMap.set(fv.EXCLUSIVE_GATEWAY,{width:nv,height:ov}),Mv.shapeConfigMap.set(fv.SYSTEM,{width:iv,height:rv}),Mv.shapeConfigMap.set(fv.USER,{width:av,height:sv}),Mv.shapeConfigMap.set(fv.SUBPROCESS,{width:lv,height:uv});var Ov=function(t){function e(e){var n=t.call(this,e)||this;n.adapterXmlIn=function(t){var e,o=(e=t,(new cv.ObjTree).parseXML(e));return n.adapterIn(o,n.props)},n.adapterXmlOut=function(t){return function(t){var e="";for(var n in t)e+=vv(t[n],n,0);return e}(n.adapterOut(t,n.props))};var o=e.lf,i=e.props;return o.adapterIn=n.adapterXmlIn,o.adapterOut=n.adapterXmlOut,n.props=i,n}return f(e,t),e.pluginName="BPMNAdapter",e}(Mv),Pv={SEQUENCE_FLOW:1,START_EVENT:2,END_EVENT:3,USER_TASK:4,EXCLUSIVE_GATEWAY:6},kv={1:"bpmn:sequenceFlow",2:"bpmn:startEvent",3:"bpmn:endEvent",4:"bpmn:userTask",6:"bpmn:exclusiveGateway"};function Rv(t){switch(t){case"bpmn:sequenceFlow":return Pv.SEQUENCE_FLOW;case"bpmn:startEvent":return Pv.START_EVENT;case"bpmn:endEvent":return Pv.END_EVENT;case"bpmn:userTask":return Pv.USER_TASK;case"bpmn:exclusiveGateway":return Pv.EXCLUSIVE_GATEWAY;default:return t}}var Dv,Lv,Iv,jv=[],Bv=Pf,Hv=Bv.__b,Fv=Bv.__r,zv=Bv.diffed,Wv=Bv.__c,Gv=Bv.unmount,Uv=Bv.__;function Xv(){for(var t;t=jv.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(qv),t.__H.__h.forEach(Kv),t.__H.__h=[]}catch(e){t.__H.__h=[],Bv.__e(e,t.__v)}}Bv.__b=function(t){Dv=null,Hv&&Hv(t)},Bv.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Uv&&Uv(t,e)},Bv.__r=function(t){Fv&&Fv(t);var e=(Dv=t.__c).__H;e&&(Lv===Dv?(e.__h=[],Dv.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.i=t.__N=void 0}))):(e.__h.forEach(qv),e.__h.forEach(Kv),e.__h=[])),Lv=Dv},Bv.diffed=function(t){zv&&zv(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==jv.push(e)&&Iv===Bv.requestAnimationFrame||((Iv=Bv.requestAnimationFrame)||Yv)(Xv)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.i=void 0}))),Lv=Dv=null},Bv.__c=function(t,e){e.some((function(t){try{t.__h.forEach(qv),t.__h=t.__h.filter((function(t){return!t.__||Kv(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],Bv.__e(n,t.__v)}})),Wv&&Wv(t,e)},Bv.unmount=function(t){Gv&&Gv(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{qv(t)}catch(t){e=t}})),n.__H=void 0,e&&Bv.__e(e,n.__v))};var Vv="function"==typeof requestAnimationFrame;function Yv(t){var e,n=function(){clearTimeout(o),Vv&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,100);Vv&&(e=requestAnimationFrame(n))}function qv(t){var e=Dv,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Dv=e}function Kv(t){var e=Dv;t.__c=t.__(),Dv=e}function Zv(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var o in e)if("__source"!==o&&t[o]!==e[o])return!0;return!1}function $v(t,e){this.props=t,this.context=e}($v.prototype=new Kf).isPureReactComponent=!0,$v.prototype.shouldComponentUpdate=function(t,e){return Zv(this.props,t)||Zv(this.state,e)};var Jv=Pf.__b;Pf.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Jv&&Jv(t)};var Qv=Pf.__e;Pf.__e=function(t,e,n,o){if(t.then)for(var i,r=e;r=r.__;)if((i=r.__c)&&i.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),i.__c(t,e);Qv(t,e,n,o)};var ty=Pf.unmount;function ey(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),t.__c.__H=null),null!=(t=function(t,e){for(var n in e)t[n]=e[n];return t}({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return ey(t,e,n)}))),t}function ny(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return ny(t,e,n)})),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function oy(){this.__u=0,this.t=null,this.__b=null}function iy(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function ry(){this.u=null,this.o=null}Pf.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),ty&&ty(t)},(oy.prototype=new Kf).__c=function(t,e){var n=e.__c,o=this;null==o.t&&(o.t=[]),o.t.push(n);var i=iy(o.__v),r=!1,a=function(){r||(r=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(! --o.__u){if(o.state.__a){var t=o.state.__a;o.__v.__k[0]=ny(t,t.__c.__P,t.__c.__O)}var e;for(o.setState({__a:o.__b=null});e=o.t.pop();)e.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(a,a)},oy.prototype.componentWillUnmount=function(){this.t=[]},oy.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=ey(this.__b,n,o.__O=o.__P)}this.__b=null}var i=e.__a&&Vf(qf,null,t.fallback);return i&&(i.__u&=-33),[Vf(qf,null,e.__a?null:t.children),i]};var ay=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};(ry.prototype=new Kf).__a=function(t){var e=this,n=iy(e.__v),o=e.o.get(t);return o[0]++,function(i){var r=function(){e.props.revealOrder?(o.push(i),ay(e,t,o)):i()};n?n(r):r()}},ry.prototype.render=function(t){this.u=null,this.o=new Map;var e=og(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},ry.prototype.componentDidUpdate=ry.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){ay(t,n,e)}))};var sy="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,ly=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,uy=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,cy=/[A-Z0-9]/g,dy="undefined"!=typeof document,hy=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(t)};Kf.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(Kf.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var py=Pf.event;function fy(){}function gy(){return this.cancelBubble}function vy(){return this.defaultPrevented}Pf.event=function(t){return py&&(t=py(t)),t.persist=fy,t.isPropagationStopped=gy,t.isDefaultPrevented=vy,t.nativeEvent=t};var yy={enumerable:!1,configurable:!0,get:function(){return this.class}},my=Pf.vnode;Pf.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,o={};for(var i in e){var r=e[i];if(!("value"===i&&"defaultValue"in e&&null==r||dy&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var a=i.toLowerCase();"defaultValue"===i&&"value"in e&&null==e.value?i="value":"download"===i&&!0===r?r="":"translate"===a&&"no"===r?r=!1:"ondoubleclick"===a?i="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||hy(e.type)?"onfocus"===a?i="onfocusin":"onblur"===a?i="onfocusout":uy.test(i)?i=a:-1===n.indexOf("-")&&ly.test(i)?i=i.replace(cy,"-$&").toLowerCase():null===r&&(r=void 0):a=i="oninput","oninput"===a&&o[i=a]&&(i="oninputCapture"),o[i]=r}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=og(e.children).forEach((function(t){t.props.selected=-1!=o.value.indexOf(t.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=og(e.children).forEach((function(t){t.props.selected=o.multiple?-1!=o.defaultValue.indexOf(t.props.value):o.defaultValue==t.props.value}))),e.class&&!e.className?(o.class=e.class,Object.defineProperty(o,"className",yy)):(e.className&&!e.class||e.class&&e.className)&&(o.class=o.className=e.className),t.props=o}(t),t.$$typeof=sy,my&&my(t)};var by=Pf.__r;Pf.__r=function(t){by&&by(t),t.__c};var xy=Pf.diffed;Pf.diffed=function(t){xy&&xy(t);var e=t.props,n=t.__e;null!=n&&"textarea"===t.type&&"value"in e&&e.value!==n.value&&(n.value=null==e.value?"":e.value)};var _y,Ey,wy,Sy,Cy,Ny,Ty,Ay=200;!function(t){t[t.DEFAULT=1]="DEFAULT",t[t.TEXT_EDIT=2]="TEXT_EDIT",t[t.SHOW_MENU=3]="SHOW_MENU",t[t.ALLOW_CONNECT=4]="ALLOW_CONNECT",t[t.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"}(_y||(_y={})),function(t){t.NODE="node",t.EDGE="edge",t.GRAPH="graph"}(Ey||(Ey={})),function(t){t.NODE="node",t.CIRCLE_NODE="circle-node",t.POLYGON_NODE="polygon-node",t.RECT_NODE="rect-node",t.TEXT_NODE="text-node",t.ELLIPSE_NODE="ellipse-node",t.DIAMOND_NODE="diamond-node",t.HTML_NODE="html-node",t.CUSTOM_HTML_NODE="custom-html-node",t.EDGE="edge",t.LINE_EDGE="line-edge",t.POLYLINE_EDGE="polyline-edge",t.BEZIER_EDGE="bezier-edge",t.GRAPH="graph"}(wy||(wy={})),function(t){t.ELEMENT_CLICK="element:click",t.NODE_ADD="node:add",t.NODE_DELETE="node:delete",t.NODE_CLICK="node:click",t.NODE_DBCLICK="node:dbclick",t.NODE_GROUP_COPY="node:group-copy-add",t.NODE_DND_ADD="node:dnd-add",t.NODE_DND_DRAG="node:dnd-drag",t.NODE_MOUSEDOWN="node:mousedown",t.NODE_DRAGSTART="node:dragstart",t.NODE_DRAG="node:drag",t.NODE_DROP="node:drop",t.NODE_MOUSEUP="node:mouseup",t.NODE_MOUSEMOVE="node:mousemove",t.NODE_MOUSEENTER="node:mouseenter",t.NODE_MOUSELEAVE="node:mouseleave",t.NODE_CONTEXTMENU="node:contextmenu",t.NODE_ROTATE="node:rotate",t.NODE_RESIZE="node:resize",t.NODE_PROPERTIES_CHANGE="node:properties-change",t.NODE_PROPERTIES_DELETE="node:properties-delete",t.EDGE_ADD="edge:add",t.EDGE_DELETE="edge:delete",t.EDGE_CLICK="edge:click",t.EDGE_DBCLICK="edge:dbclick",t.EDGE_MOUSEENTER="edge:mouseenter",t.EDGE_MOUSELEAVE="edge:mouseleave",t.EDGE_CONTEXTMENU="edge:contextmenu",t.EDGE_ADJUST="edge:adjust",t.EDGE_EXCHANGE_NODE="edge:exchange-node",t.ANCHOR_DRAGSTART="anchor:dragstart",t.ANCHOR_DRAG="anchor:drag",t.ANCHOR_DROP="anchor:drop",t.ANCHOR_DRAGEND="anchor:dragend",t.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",t.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",t.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",t.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",t.ADJUST_POINT_DRAG="adjustPoint:drag",t.ADJUST_POINT_DROP="adjustPoint:drop",t.ADJUST_POINT_DRAGEND="adjustPoint:dragend",t.BLANK_MOUSEDOWN="blank:mousedown",t.BLANK_DRAGSTART="blank:dragstart",t.BLANK_DRAG="blank:drag",t.BLANK_DROP="blank:drop",t.BLANK_MOUSEMOVE="blank:mousemove",t.BLANK_MOUSEUP="blank:mouseup",t.BLANK_CLICK="blank:click",t.BLANK_CONTEXTMENU="blank:contextmenu",t.SELECTION_MOUSEDOWN="selection:mousedown",t.SELECTION_DRAGSTART="selection:dragstart",t.SELECTION_DRAG="selection:drag",t.SELECTION_DROP="selection:drop",t.SELECTION_MOUSEMOVE="selection:mousemove",t.SELECTION_MOUSEUP="selection:mouseup",t.SELECTION_CONTEXTMENU="selection:contextmenu",t.CONNECTION_NOT_ALLOWED="connection:not-allowed",t.TEXT_MOUSEDOWN="text:mousedown",t.TEXT_DRAGSTART="text:dragstart",t.TEXT_DRAG="text:drag",t.TEXT_DROP="text:drop",t.TEXT_CLICK="text:click",t.TEXT_DBCLICK="text:dbclick",t.TEXT_BLUR="text:blur",t.TEXT_MOUSEMOVE="text:mousemove",t.TEXT_MOUSEUP="text:mouseup",t.TEXT_FOCUS="text:focus",t.TEXT_ADD="text:add",t.TEXT_UPDATE="text:update",t.TEXT_CLEAR="text:clear",t.LABEL_MOUSEDOWN="label:mousedown",t.LABEL_DRAGSTART="label:dragstart",t.LABEL_DRAG="label:drag",t.LABEL_DROP="label:drop",t.LABEL_CLICK="label:click",t.LABEL_DBCLICK="label:dbclick",t.LABEL_BLUR="label:blur",t.LABEL_MOUSEMOVE="label:mousemove",t.LABEL_MOUSEUP="label:mouseup",t.LABEL_FOCUS="label:focus",t.LABEL_ADD="label:add",t.LABEL_UPDATE="label:update",t.LABEL_CLEAR="label:clear",t.LABEL_DELETE="label:delete",t.LABEL_SHOULD_ADD="label:should-add",t.LABEL_BATCH_ADD="label:batch-add",t.LABEL_SHOULD_UPDATE="label:should-update",t.LABEL_SHOULD_DELETE="label:should-delete",t.LABEL_BATCH_DELETE="label:batch-delete",t.LABEL_NOT_ALLOWED_ADD="label:not-allowed-add",t.HISTORY_CHANGE="history:change",t.GRAPH_TRANSFORM="graph:transform",t.GRAPH_RENDERED="graph:rendered",t.GRAPH_UPDATED="graph:updated"}(Sy||(Sy={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.INCREASE=1]="INCREASE"}(Cy||(Cy={})),function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(Ny||(Ny={})),function(t){t.TEXT="text",t.LABEL="label"}(Ty||(Ty={}));var My={node:!1,edge:!1},Oy={node:!0,edge:!0};function Py(t){try{return JSON.parse(JSON.stringify(t))}catch(e){return t}}Bi(window,"navigator.userAgent","").match(/MSIE|Trident/);var ky=function(){function t(t){var e=t.onDragStart,n=void 0===e?on:e,o=t.onDragging,i=void 0===o?on:o,r=t.onDragEnd,a=void 0===r?on:r,s=t.eventType,l=void 0===s?"":s,u=t.eventCenter,c=t.step,d=void 0===c?1:c,h=t.isStopPropagation,p=void 0===h||h,f=t.model,g=t.data,v=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(t){var e,n,o=null===window||void 0===window?void 0:window.document;if(0===t.button){v.isStopPropagation&&t.stopPropagation(),v.isStartDragging=!0,v.startX=t.clientX,v.startY=t.clientY,o.addEventListener("mousemove",v.handleMouseMove,!1),o.addEventListener("mouseup",v.handleMouseUp,!1);var i=null===(e=v.model)||void 0===e?void 0:e.getData();null===(n=v.eventCenter)||void 0===n||n.emit(Sy["".concat(v.eventType,"_MOUSEDOWN")],{e:t,data:v.data||i}),v.startTime=(new Date).getTime()}},this.handleMouseMove=function(t){var e,n;if(v.isStopPropagation&&t.stopPropagation(),v.isStartDragging&&(v.sumDeltaX+=t.clientX-v.startX,v.sumDeltaY+=t.clientY-v.startY,v.startX=t.clientX,v.startY=t.clientY,v.step<=1||Math.abs(v.sumDeltaX)>v.step||Math.abs(v.sumDeltaY)>v.step)){var o=v.sumDeltaX%v.step,i=v.sumDeltaY%v.step,r=v.sumDeltaX-o,a=v.sumDeltaY-i;v.sumDeltaX=o,v.sumDeltaY=i;var s=null===(e=v.model)||void 0===e?void 0:e.getData();v.isDragging||(null===(n=v.eventCenter)||void 0===n||n.emit(Sy["".concat(v.eventType,"_DRAGSTART")],{e:t,data:v.data||s}),v.onDragStart({event:t})),v.isDragging=!0,Promise.resolve().then((function(){var e,n;v.onDragging({deltaX:r,deltaY:a,event:t}),null===(e=v.eventCenter)||void 0===e||e.emit(Sy["".concat(v.eventType,"_MOUSEMOVE")],{deltaX:r,deltaY:a,e:t,data:v.data||s}),null===(n=v.eventCenter)||void 0===n||n.emit(Sy["".concat(v.eventType,"_DRAG")],{e:t,data:v.data||s})}))}},this.handleMouseUp=function(t){var e=window.document;v.isStartDragging=!1,v.isStopPropagation&&t.stopPropagation(),Promise.resolve().then((function(){var n,o,i;e.removeEventListener("mousemove",v.handleMouseMove,!1),e.removeEventListener("mouseup",v.handleMouseUp,!1);var r=null===(n=v.model)||void 0===n?void 0:n.getData();null===(o=v.eventCenter)||void 0===o||o.emit(Sy["".concat(v.eventType,"_MOUSEUP")],{e:t,data:v.data||r}),v.isDragging&&(v.isDragging=!1,v.onDragEnd({event:t}),null===(i=v.eventCenter)||void 0===i||i.emit(Sy["".concat(v.eventType,"_DROP")],{e:t,data:v.data||r}))}))},this.cancelDrag=function(){var t=null===window||void 0===window?void 0:window.document;t.removeEventListener("mousemove",v.handleMouseMove,!1),t.removeEventListener("mouseup",v.handleMouseUp,!1),v.onDragEnd({event:void 0}),v.isDragging=!1},this.onDragStart=n,this.onDragging=i,this.onDragEnd=a,this.step=d,this.isStopPropagation=p,this.eventType=l,this.eventCenter=u,this.model=f,this.data=g}return t.prototype.setStep=function(t){this.step=t},t.prototype.setModel=function(t){this.model=t},t}(),Ry=function(t,e,n){var o=t.x,i=t.y,r=e.x,a=e.y,s=n.x,l=n.y,u=(l-a)/(s-r),c=a-u*r;return o>=r&&o<=s&&i>=a&&i<=l&&Math.abs(i-u*o+c)<Number.EPSILON},Dy="An invariant failed, however the error is obfuscated because this is a production build.",Ly=[];Object.freeze(Ly);var Iy={};function jy(){return++rb.mobxGuid}function By(t){throw Hy(!1,t),"X"}function Hy(t,e){if(!t)throw new Error("[mobx] "+(e||Dy))}function Fy(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}Object.freeze(Iy);var zy=function(){};function Wy(t){return null!==t&&"object"==typeof t}function Gy(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function Uy(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Xy(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(t){return Wy(t)&&!0===t[n]}}function Vy(t){return t instanceof Map}function Yy(t){return t instanceof Set}function qy(t){var e=new Set;for(var n in t)e.add(n);return Object.getOwnPropertySymbols(t).forEach((function(n){Object.getOwnPropertyDescriptor(t,n).enumerable&&e.add(n)})),Array.from(e)}function Ky(t){return t&&t.toString?t.toString():new String(t).toString()}function Zy(t){return null===t?null:"object"==typeof t?""+t:t}var $y="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Jy=Symbol("mobx administration"),Qy=function(){function t(t){void 0===t&&(t="Atom@"+jy()),this.name=t,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=Tm.NOT_TRACKING}return t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(t){return t()}))},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(t){return t()}))},t.prototype.reportObserved=function(){return db(this)},t.prototype.reportChanged=function(){ub(),function(t){if(t.lowestObserverState===Tm.STALE)return;t.lowestObserverState=Tm.STALE,t.observers.forEach((function(e){e.dependenciesState===Tm.UP_TO_DATE&&(e.isTracing!==Am.NONE&&hb(e,t),e.onBecomeStale()),e.dependenciesState=Tm.STALE}))}(this),cb()},t.prototype.toString=function(){return this.name},t}(),tm=Xy("Atom",Qy);function em(t,e,n){void 0===e&&(e=zy),void 0===n&&(n=zy);var o=new Qy(t);return e!==zy&&Tb("onBecomeObserved",o,e),n!==zy&&Nb(o,n),o}var nm={identity:function(t,e){return t===e},structural:function(t,e){return vx(t,e)},default:function(t,e){return Object.is(t,e)},shallow:function(t,e){return vx(t,e,1)}},om=function(t,e){return om=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},om(t,e)};var im=function(){return im=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},im.apply(this,arguments)};function rm(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function am(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function sm(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(am(arguments[e]));return t}var lm=Symbol("mobx did run lazy initializers"),um=Symbol("mobx pending decorators"),cm={},dm={};function hm(t){var e,n;if(!0!==t[lm]){var o=t[um];if(o){Uy(t,lm,!0);var i=sm(Object.getOwnPropertySymbols(o),Object.keys(o));try{for(var r=rm(i),a=r.next();!a.done;a=r.next()){var s=o[a.value];s.propertyCreator(t,s.prop,s.descriptor,s.decoratorTarget,s.decoratorArguments)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}}}function pm(t,e){return function(){var n,o,i=function(o,i,r,a){if(!0===a)return e(o,i,r,o,n),null;if(!Object.prototype.hasOwnProperty.call(o,um)){var s=o[um];Uy(o,um,im({},s))}return o[um][i]={prop:i,propertyCreator:e,descriptor:r,decoratorTarget:o,decoratorArguments:n},function(t,e){var n=e?cm:dm;return n[t]||(n[t]={configurable:!0,enumerable:e,get:function(){return hm(this),this[t]},set:function(e){hm(this),this[t]=e}})}(i,t)};return(2===(o=arguments).length||3===o.length)&&("string"==typeof o[1]||"symbol"==typeof o[1])||4===o.length&&!0===o[3]?(n=Ly,i.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),i)}}function fm(t,e,n){return kb(t)?t:Array.isArray(t)?Cm.array(t,{name:n}):Gy(t)?Cm.object(t,void 0,{name:n}):Vy(t)?Cm.map(t,{name:n}):Yy(t)?Cm.set(t,{name:n}):t}function gm(t){return t}function vm(t){Hy(t);var e=pm(!0,(function(e,n,o,i,r){var a=o?o.initializer?o.initializer.call(e):o.value:void 0;lx(e).addObservableProp(n,a,t)})),n=("undefined"!=typeof process&&process.env,e);return n.enhancer=t,n}var ym={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function mm(t){return null==t?ym:"string"==typeof t?{name:t,deep:!0,proxy:!0}:t}Object.freeze(ym);var bm=vm(fm),xm=vm((function(t,e,n){return null==t||px(t)||Qb(t)||ox(t)||ax(t)?t:Array.isArray(t)?Cm.array(t,{name:n,deep:!1}):Gy(t)?Cm.object(t,void 0,{name:n,deep:!1}):Vy(t)?Cm.map(t,{name:n,deep:!1}):Yy(t)?Cm.set(t,{name:n,deep:!1}):By(!1)})),_m=vm(gm),Em=vm((function(t,e,n){return vx(t,e)?e:t}));function wm(t){return t.defaultDecorator?t.defaultDecorator.enhancer:!1===t.deep?gm:fm}var Sm={box:function(t,e){arguments.length>2&&Nm("box");var n=mm(e);return new Zm(t,wm(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&Nm("array");var n=mm(e);return function(t,e,n,o){void 0===n&&(n="ObservableArray@"+jy());void 0===o&&(o=!1);var i=new Kb(n,e,o);!function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}(i.values,Jy,i);var r=new Proxy(i.values,qb);if(i.proxy=r,t&&t.length){var a=qm(!0);i.spliceWithArray(0,0,t),Km(a)}return r}(t,wm(n),n.name)},map:function(t,e){arguments.length>2&&Nm("map");var n=mm(e);return new nx(t,wm(n),n.name)},set:function(t,e){arguments.length>2&&Nm("set");var n=mm(e);return new rx(t,wm(n),n.name)},object:function(t,e,n){"string"==typeof arguments[1]&&Nm("object");var o=mm(n);if(!1===o.proxy)return Ab({},t,e,o);var i=Mb(o),r=function(t){var e=new Proxy(t,zb);return t[Jy].proxy=e,e}(Ab({},void 0,void 0,o));return Ob(r,t,e,i),r},ref:_m,shallow:xm,deep:bm,struct:Em},Cm=function(t,e,n){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return bm.apply(null,arguments);if(kb(t))return t;var o=Gy(t)?Cm.object(t,e,n):Array.isArray(t)?Cm.array(t,e):Vy(t)?Cm.map(t,e):Yy(t)?Cm.set(t,e):t;if(o!==t)return o;By(!1)};function Nm(t){By("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}Object.keys(Sm).forEach((function(t){return Cm[t]=Sm[t]}));var Tm,Am,Mm=pm(!1,(function(t,e,n,o,i){var r=n.get,a=n.set,s=i[0]||{};lx(t).addComputedProp(t,e,im({get:r,set:a,context:t},s))})),Om=Mm({equals:nm.structural}),Pm=function(t,e,n){if("string"==typeof e)return Mm.apply(null,arguments);if(null!==t&&"object"==typeof t&&1===arguments.length)return Mm.apply(null,arguments);var o="object"==typeof e?e:{};return o.get=t,o.set="function"==typeof e?e:o.set,o.name=o.name||t.name||"",new Jm(o)};Pm.struct=Om,function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"}(Tm||(Tm={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(Am||(Am={}));var km=function(t){this.cause=t};function Rm(t){return t instanceof km}function Dm(t){switch(t.dependenciesState){case Tm.UP_TO_DATE:return!1;case Tm.NOT_TRACKING:case Tm.STALE:return!0;case Tm.POSSIBLY_STALE:for(var e=zm(!0),n=Hm(),o=t.observing,i=o.length,r=0;r<i;r++){var a=o[r];if(Qm(a)){if(rb.disableErrorBoundaries)a.get();else try{a.get()}catch(t){return Fm(n),Wm(e),!0}if(t.dependenciesState===Tm.STALE)return Fm(n),Wm(e),!0}}return Gm(t),Fm(n),Wm(e),!1}}function Lm(t){var e=t.observers.size>0;rb.computationDepth>0&&e&&By(!1),rb.allowStateChanges||!e&&"strict"!==rb.enforceActions||By(!1)}function Im(t,e,n){var o=zm(!0);Gm(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++rb.runId;var i,r=rb.trackingDerivation;if(rb.trackingDerivation=t,!0===rb.disableErrorBoundaries)i=e.call(n);else try{i=e.call(n)}catch(t){i=new km(t)}return rb.trackingDerivation=r,function(t){for(var e=t.observing,n=t.observing=t.newObserving,o=Tm.UP_TO_DATE,i=0,r=t.unboundDepsCount,a=0;a<r;a++){0===(s=n[a]).diffValue&&(s.diffValue=1,i!==a&&(n[i]=s),i++),s.dependenciesState>o&&(o=s.dependenciesState)}n.length=i,t.newObserving=null,r=e.length;for(;r--;){0===(s=e[r]).diffValue&&sb(s,t),s.diffValue=0}for(;i--;){var s;1===(s=n[i]).diffValue&&(s.diffValue=0,ab(s,t))}o!==Tm.UP_TO_DATE&&(t.dependenciesState=o,t.onBecomeStale())}(t),Wm(o),i}function jm(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)sb(e[n],t);t.dependenciesState=Tm.NOT_TRACKING}function Bm(t){var e=Hm();try{return t()}finally{Fm(e)}}function Hm(){var t=rb.trackingDerivation;return rb.trackingDerivation=null,t}function Fm(t){rb.trackingDerivation=t}function zm(t){var e=rb.allowStateReads;return rb.allowStateReads=t,e}function Wm(t){rb.allowStateReads=t}function Gm(t){if(t.dependenciesState!==Tm.UP_TO_DATE){t.dependenciesState=Tm.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=Tm.UP_TO_DATE}}var Um=0,Xm=1,Vm=Object.getOwnPropertyDescriptor((function(){}),"name");function Ym(t,e,n){var o=function(){return function(t,e,n,o){var i=function(){var t=!1,e=0,n=Hm();ub();var o=qm(!0),i=zm(!0),r={prevDerivation:n,prevAllowStateChanges:o,prevAllowStateReads:i,notifySpy:t,startTime:e,actionId:Xm++,parentActionId:Um};return Um=r.actionId,r}();try{return e.apply(n,o)}catch(t){throw i.error=t,t}finally{!function(t){Um!==t.actionId&&By("invalid action stack. did you forget to finish an action?");Um=t.parentActionId,void 0!==t.error&&(rb.suppressReactionErrors=!0);Km(t.prevAllowStateChanges),Wm(t.prevAllowStateReads),cb(),Fm(t.prevDerivation),t.notifySpy&&!1;rb.suppressReactionErrors=!1}(i)}}(0,e,n||this,arguments)};return o.isMobxAction=!0,o}function qm(t){var e=rb.allowStateChanges;return rb.allowStateChanges=t,e}function Km(t){rb.allowStateChanges=t}Vm&&Vm.configurable;var Zm=function(t){function e(e,n,o,i,r){void 0===o&&(o="ObservableValue@"+jy()),void 0===i&&(i=!0),void 0===r&&(r=nm.default);var a=t.call(this,o)||this;return a.enhancer=n,a.name=o,a.equals=r,a.hasUnreportedChange=!1,a.value=n(e,void 0,o),a}return function(t,e){function n(){this.constructor=t}om(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.prototype.set=function(t){this.value;if((t=this.prepareNewValue(t))!==rb.UNCHANGED){false,this.setNewValue(t)}},e.prototype.prepareNewValue=function(t){if(Lm(this),Wb(this)){var e=Ub(this,{object:this,type:"update",newValue:t});if(!e)return rb.UNCHANGED;t=e.newValue}return t=this.enhancer(t,this.value,this.name),this.equals(this.value,t)?rb.UNCHANGED:t},e.prototype.setNewValue=function(t){var e=this.value;this.value=t,this.reportChanged(),Xb(this)&&Yb(this,{type:"update",object:this,newValue:t,oldValue:e})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(t){return Gb(this,t)},e.prototype.observe=function(t,e){return e&&t({object:this,type:"update",newValue:this.value,oldValue:void 0}),Vb(this,t)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return Zy(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(Qy),$m=Xy("ObservableValue",Zm),Jm=function(){function t(t){this.dependenciesState=Tm.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=Tm.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+jy(),this.value=new km(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Am.NONE,Hy(t.get,"missing option for computed: get"),this.derivation=t.get,this.name=t.name||"ComputedValue@"+jy(),t.set&&(this.setter=Ym(this.name,t.set)),this.equals=t.equals||(t.compareStructural||t.struct?nm.structural:nm.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState!==Tm.UP_TO_DATE)return;t.lowestObserverState=Tm.POSSIBLY_STALE,t.observers.forEach((function(e){e.dependenciesState===Tm.UP_TO_DATE&&(e.dependenciesState=Tm.POSSIBLY_STALE,e.isTracing!==Am.NONE&&hb(e,t),e.onBecomeStale())}))}(this)},t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(t){return t()}))},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(t){return t()}))},t.prototype.get=function(){this.isComputing&&By("Cycle detected in computation "+this.name+": "+this.derivation),0!==rb.inBatch||0!==this.observers.size||this.keepAlive?(db(this),Dm(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState===Tm.STALE)return;t.lowestObserverState=Tm.STALE,t.observers.forEach((function(e){e.dependenciesState===Tm.POSSIBLY_STALE?e.dependenciesState=Tm.STALE:e.dependenciesState===Tm.UP_TO_DATE&&(t.lowestObserverState=Tm.UP_TO_DATE)}))}(this)):Dm(this)&&(this.warnAboutUntrackedRead(),ub(),this.value=this.computeValue(!1),cb());var t=this.value;if(Rm(t))throw t.cause;return t},t.prototype.peek=function(){var t=this.computeValue(!1);if(Rm(t))throw t.cause;return t},t.prototype.set=function(t){if(this.setter){Hy(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,t)}finally{this.isRunningSetter=!1}}else Hy(!1,!1)},t.prototype.trackAndCompute=function(){var t=this.value,e=this.dependenciesState===Tm.NOT_TRACKING,n=this.computeValue(!0),o=e||Rm(t)||Rm(n)||!this.equals(t,n);return o&&(this.value=n),o},t.prototype.computeValue=function(t){var e;if(this.isComputing=!0,rb.computationDepth++,t)e=Im(this,this.derivation,this.scope);else if(!0===rb.disableErrorBoundaries)e=this.derivation.call(this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new km(t)}return rb.computationDepth--,this.isComputing=!1,e},t.prototype.suspend=function(){this.keepAlive||(jm(this),this.value=void 0)},t.prototype.observe=function(t,e){var n=this,o=!0,i=void 0;return function(t,e){void 0===e&&(e=Iy);var n,o=e&&e.name||t.name||"Autorun@"+jy();if(e.scheduler||e.delay){var i=function(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:Cb}(e),r=!1;n=new fb(o,(function(){r||(r=!0,i((function(){r=!1,n.isDisposed||n.track(a)})))}),e.onError,e.requiresObservable)}else n=new fb(o,(function(){this.track(a)}),e.onError,e.requiresObservable);function a(){t(n)}return n.schedule(),n.getDisposer()}((function(){var r=n.get();if(!o||e){var a=Hm();t({type:"update",object:n,newValue:r,oldValue:i}),Fm(a)}o=!1,i=r}))},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return Zy(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(),Qm=Xy("ComputedValue",Jm),tb=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},eb={};function nb(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:eb}var ob=!0,ib=!1,rb=function(){var t=nb();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(ob=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==(new tb).version&&(ob=!1),ob?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new tb):(setTimeout((function(){ib||By("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new tb)}();function ab(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function sb(t,e){t.observers.delete(e),0===t.observers.size&&lb(t)}function lb(t){!1===t.isPendingUnobservation&&(t.isPendingUnobservation=!0,rb.pendingUnobservations.push(t))}function ub(){rb.inBatch++}function cb(){if(0==--rb.inBatch){yb();for(var t=rb.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,0===n.observers.size&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof Jm&&n.suspend())}rb.pendingUnobservations=[]}}function db(t){var e=rb.trackingDerivation;return null!==e?(e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t,t.isBeingObserved||(t.isBeingObserved=!0,t.onBecomeObserved())),!0):(0===t.observers.size&&rb.inBatch>0&&lb(t),!1)}function hb(t,e){if(t.isTracing===Am.BREAK){var n=[];pb(function(t,e){return Pb(fx(t,e))}(t),n,1),new Function("debugger;\n/*\nTracing '"+t.name+"'\n\nYou are entering this break point because derivation '"+t.name+"' is being traced and '"+e.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(t instanceof Jm?t.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function pb(t,e,n){e.length>=1e3?e.push("(and many more)"):(e.push(""+new Array(n).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return pb(t,e,n+1)})))}var fb=function(){function t(t,e,n,o){void 0===t&&(t="Reaction@"+jy()),void 0===o&&(o=!1),this.name=t,this.onInvalidate=e,this.errorHandler=n,this.requiresObservable=o,this.observing=[],this.newObserving=[],this.dependenciesState=Tm.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+jy(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=Am.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,rb.pendingReactions.push(this),yb())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(ub(),this._isScheduled=!1,Dm(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(t){this.reportExceptionInDerivation(t)}}cb()}},t.prototype.track=function(t){if(!this.isDisposed){ub(),this._isRunning=!0;var e=Im(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&jm(this),Rm(e)&&this.reportExceptionInDerivation(e.cause),cb()}},t.prototype.reportExceptionInDerivation=function(t){var e=this;if(this.errorHandler)this.errorHandler(t,this);else{if(rb.disableErrorBoundaries)throw t;rb.suppressReactionErrors,rb.globalReactionErrorHandlers.forEach((function(n){return n(t,e)}))}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(ub(),jm(this),cb()))},t.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t[Jy]=this,t},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(t){void 0===t&&(t=!1),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;"boolean"==typeof t[t.length-1]&&(n=t.pop());var o=function(t){switch(t.length){case 0:return rb.trackingDerivation;case 1:return fx(t[0]);case 2:return fx(t[0],t[1])}}(t);if(!o)return By(!1);o.isTracing,Am.NONE;o.isTracing=n?Am.BREAK:Am.LOG}(this,t)},t}(),gb=100,vb=function(t){return t()};function yb(){rb.inBatch>0||rb.isRunningReactions||vb(mb)}function mb(){rb.isRunningReactions=!0;for(var t=rb.pendingReactions,e=0;t.length>0;){++e===gb&&t.splice(0);for(var n=t.splice(0),o=0,i=n.length;o<i;o++)n[o].runReaction()}rb.isRunningReactions=!1}var bb=Xy("Reaction",fb);function xb(t){var e=vb;vb=function(n){return t((function(){return e(n)}))}}function _b(){By(!1)}function Eb(t){return function(e,n,o){if(o){if(o.value)return{value:Ym(0,o.value),enumerable:!1,configurable:!0,writable:!0};var i=o.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return Ym(0,i.call(this))}}}return function(t){return function(e,n,o){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:function(){},set:function(e){Uy(this,n,wb(t,e))}})}}(t).apply(this,arguments)}}var wb=function(t,e,n,o){return 1===arguments.length&&"function"==typeof t?Ym(t.name,t):2===arguments.length&&"function"==typeof e?Ym(0,e):1===arguments.length&&"string"==typeof t?Eb(t):!0!==o?Eb(e).apply(null,arguments):void Uy(t,e,Ym(t.name,n.value,this))};function Sb(t,e,n){Uy(t,e,Ym(0,n.bind(t)))}wb.bound=function(t,e,n,o){return!0===o?(Sb(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return Sb(this,e,n.value||n.initializer.call(this)),this[e]},set:_b}:{enumerable:!1,configurable:!0,set:function(t){Sb(this,e,t)},get:function(){}}};var Cb=function(t){return t()};function Nb(t,e,n){return Tb("onBecomeUnobserved",t,e)}function Tb(t,e,n,o){var i=fx(e),r=n,a=t+"Listeners";return i[a]?i[a].add(r):i[a]=new Set([r]),"function"!=typeof i[t]?By(!1):function(){var t=i[a];t&&(t.delete(r),0===t.size&&delete i[a])}}function Ab(t,e,n,o){var i=Mb(o=mm(o));return hm(t),lx(t,o.name,i.enhancer),e&&Ob(t,e,n,i),t}function Mb(t){return t.defaultDecorator||(!1===t.deep?_m:bm)}function Ob(t,e,n,o){var i,r;ub();try{var a=$y(e);try{for(var s=rm(a),l=s.next();!l.done;l=s.next()){var u=l.value,c=Object.getOwnPropertyDescriptor(e,u);0;var d=n&&u in n?n[u]:c.get?Mm:o;0;var h=d(t,u,c,!0);h&&Object.defineProperty(t,u,h)}}catch(t){i={error:t}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}}finally{cb()}}function Pb(t){var e,n,o={name:t.name};return t.observing&&t.observing.length>0&&(o.dependencies=(e=t.observing,n=[],e.forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n).map(Pb)),o}function kb(t){return 1!==arguments.length&&By(!1),function(t){return null!=t&&(px(t)||!!t[Jy]||tm(t)||bb(t)||Qm(t))}(t)}function Rb(t,e,n){if(2!==arguments.length||ax(t))if(px(t)){var o=t[Jy];o.values.get(e)?o.write(e,n):o.addObservableProp(e,n,o.defaultEnhancer)}else if(ox(t))t.set(e,n);else if(ax(t))t.add(e);else{if(!Qb(t))return By(!1);"number"!=typeof e&&(e=parseInt(e,10)),Hy(e>=0,"Not a valid index: '"+e+"'"),ub(),e>=t.length&&(t.length=e+1),t[e]=n,cb()}else{ub();var i=e;try{for(var r in i)Rb(t,r,i[r])}finally{cb()}}}var Db={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Lb(t,e,n,o){return o.detectCycles&&t.set(e,n),n}function Ib(t,e,n){if(!e.recurseEverything&&!kb(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if($m(t))return Ib(t.get(),e,n);var o;if(kb(t)&&(px(o=t)?o[Jy].getKeys():ox(o)||ax(o)?Array.from(o.keys()):Qb(o)?o.map((function(t,e){return e})):By(!1)),!0===e.detectCycles&&null!==t&&n.has(t))return n.get(t);if(Qb(t)||Array.isArray(t)){var i=Lb(n,t,[],e),r=t.map((function(t){return Ib(t,e,n)}));i.length=r.length;for(var a=0,s=r.length;a<s;a++)i[a]=r[a];return i}if(ax(t)||Object.getPrototypeOf(t)===Set.prototype){if(!1===e.exportMapsAsObjects){var l=Lb(n,t,new Set,e);return t.forEach((function(t){l.add(Ib(t,e,n))})),l}var u=Lb(n,t,[],e);return t.forEach((function(t){u.push(Ib(t,e,n))})),u}if(ox(t)||Object.getPrototypeOf(t)===Map.prototype){if(!1===e.exportMapsAsObjects){var c=Lb(n,t,new Map,e);return t.forEach((function(t,o){c.set(o,Ib(t,e,n))})),c}var d=Lb(n,t,{},e);return t.forEach((function(t,o){d[o]=Ib(t,e,n)})),d}var h=Lb(n,t,{},e);return qy(t).forEach((function(o){h[o]=Ib(t[o],e,n)})),h}function jb(t,e){var n;return"boolean"==typeof e&&(e={detectCycles:e}),e||(e=Db),e.detectCycles=void 0===e.detectCycles?!0===e.recurseEverything:!0===e.detectCycles,e.detectCycles&&(n=new Map),Ib(t,e,n)}function Bb(t,e){void 0===e&&(e=void 0),ub();try{return t.apply(e)}finally{cb()}}function Hb(t){return t[Jy]}function Fb(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t}var zb={has:function(t,e){if(e===Jy||"constructor"===e||e===lm)return!0;var n=Hb(t);return Fb(e)?n.has(e):e in t},get:function(t,e){if(e===Jy||"constructor"===e||e===lm)return t[e];var n=Hb(t),o=n.values.get(e);if(o instanceof Qy){var i=o.get();return void 0===i&&n.has(e),i}return Fb(e)&&n.has(e),t[e]},set:function(t,e,n){return!!Fb(e)&&(Rb(t,e,n),!0)},deleteProperty:function(t,e){return!!Fb(e)&&(Hb(t).remove(e),!0)},ownKeys:function(t){return Hb(t).keysAtom.reportObserved(),Reflect.ownKeys(t)},preventExtensions:function(t){return By("Dynamic observable objects cannot be frozen"),!1}};function Wb(t){return void 0!==t.interceptors&&t.interceptors.length>0}function Gb(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),Fy((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function Ub(t,e){var n=Hm();try{for(var o=sm(t.interceptors||[]),i=0,r=o.length;i<r&&(Hy(!(e=o[i](e))||e.type,"Intercept handlers should return nothing or a change object"),e);i++);return e}finally{Fm(n)}}function Xb(t){return void 0!==t.changeListeners&&t.changeListeners.length>0}function Vb(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),Fy((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function Yb(t,e){var n=Hm(),o=t.changeListeners;if(o){for(var i=0,r=(o=o.slice()).length;i<r;i++)o[i](e);Fm(n)}}var qb={get:function(t,e){return e===Jy?t[Jy]:"length"===e?t[Jy].getArrayLength():"number"==typeof e?Zb.get.call(t,e):"string"!=typeof e||isNaN(e)?Zb.hasOwnProperty(e)?Zb[e]:t[e]:Zb.get.call(t,parseInt(e))},set:function(t,e,n){return"length"===e&&t[Jy].setArrayLength(n),"number"==typeof e&&Zb.set.call(t,e,n),"symbol"==typeof e||isNaN(e)?t[e]=n:Zb.set.call(t,parseInt(e),n),!0},preventExtensions:function(t){return By("Observable arrays cannot be frozen"),!1}};var Kb=function(){function t(t,e,n){this.owned=n,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new Qy(t||"ObservableArray@"+jy()),this.enhancer=function(n,o){return e(n,o,t+"[..]")}}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.dehanceValues=function(t){return void 0!==this.dehancer&&t.length>0?t.map(this.dehancer):t},t.prototype.intercept=function(t){return Gb(this,t)},t.prototype.observe=function(t,e){return void 0===e&&(e=!1),e&&t({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Vb(this,t)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(t){if("number"!=typeof t||t<0)throw new Error("[mobx.array] Out of range: "+t);var e=this.values.length;if(t!==e)if(t>e){for(var n=new Array(t-e),o=0;o<t-e;o++)n[o]=void 0;this.spliceWithArray(e,0,n)}else this.spliceWithArray(t,e-t)},t.prototype.updateArrayLength=function(t,e){if(t!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=e},t.prototype.spliceWithArray=function(t,e,n){var o=this;Lm(this.atom);var i=this.values.length;if(void 0===t?t=0:t>i?t=i:t<0&&(t=Math.max(0,i+t)),e=1===arguments.length?i-t:null==e?0:Math.max(0,Math.min(e,i-t)),void 0===n&&(n=Ly),Wb(this)){var r=Ub(this,{object:this.proxy,type:"splice",index:t,removedCount:e,added:n});if(!r)return Ly;e=r.removedCount,n=r.added}n=0===n.length?n:n.map((function(t){return o.enhancer(t,void 0)}));var a=this.spliceItemsIntoValues(t,e,n);return 0===e&&0===n.length||this.notifyArraySplice(t,n,a),this.dehanceValues(a)},t.prototype.spliceItemsIntoValues=function(t,e,n){var o;if(n.length<1e4)return(o=this.values).splice.apply(o,sm([t,e],n));var i=this.values.slice(t,t+e);return this.values=this.values.slice(0,t).concat(n,this.values.slice(t+e)),i},t.prototype.notifyArrayChildUpdate=function(t,e,n){var o=!this.owned&&!1,i=Xb(this),r=i||o?{object:this.proxy,type:"update",index:t,newValue:e,oldValue:n}:null;this.atom.reportChanged(),i&&Yb(this,r)},t.prototype.notifyArraySplice=function(t,e,n){var o=!this.owned&&!1,i=Xb(this),r=i||o?{object:this.proxy,type:"splice",index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;this.atom.reportChanged(),i&&Yb(this,r)},t}(),Zb={intercept:function(t){return this[Jy].intercept(t)},observe:function(t,e){return void 0===e&&(e=!1),this[Jy].observe(t,e)},clear:function(){return this.splice(0)},replace:function(t){var e=this[Jy];return e.spliceWithArray(0,e.values.length,t)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var i=this[Jy];switch(arguments.length){case 0:return[];case 1:return i.spliceWithArray(t);case 2:return i.spliceWithArray(t,e)}return i.spliceWithArray(t,e,n)},spliceWithArray:function(t,e,n){return this[Jy].spliceWithArray(t,e,n)},push:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[Jy];return n.spliceWithArray(n.values.length,0,t),n.values.length},pop:function(){return this.splice(Math.max(this[Jy].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[Jy];return n.spliceWithArray(0,0,t),n.values.length},reverse:function(){var t=this.slice();return t.reverse.apply(t,arguments)},sort:function(t){var e=this.slice();return e.sort.apply(e,arguments)},remove:function(t){var e=this[Jy],n=e.dehanceValues(e.values).indexOf(t);return n>-1&&(this.splice(n,1),!0)},get:function(t){var e=this[Jy];if(e&&t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t])},set:function(t,e){var n=this[Jy],o=n.values;if(t<o.length){Lm(n.atom);var i=o[t];if(Wb(n)){var r=Ub(n,{type:"update",object:n.proxy,index:t,newValue:e});if(!r)return;e=r.newValue}(e=n.enhancer(e,i))!==i&&(o[t]=e,n.notifyArrayChildUpdate(t,e,i))}else{if(t!==o.length)throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+o.length);n.spliceWithArray(t,0,[e])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(t){"function"==typeof Array.prototype[t]&&(Zb[t]=function(){var e=this[Jy];e.atom.reportObserved();var n=e.dehanceValues(e.values);return n[t].apply(n,arguments)})})),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach((function(t){"function"==typeof Array.prototype[t]&&(Zb[t]=function(e,n){var o=this,i=this[Jy];return i.atom.reportObserved(),i.dehanceValues(i.values)[t]((function(t,i){return e.call(n,t,i,o)}),n)})})),["reduce","reduceRight"].forEach((function(t){Zb[t]=function(){var e=this,n=this[Jy];n.atom.reportObserved();var o=arguments[0];return arguments[0]=function(t,i,r){return i=n.dehanceValue(i),o(t,i,r,e)},n.values[t].apply(n.values,arguments)}}));var $b,Jb=Xy("ObservableArrayAdministration",Kb);function Qb(t){return Wy(t)&&Jb(t[Jy])}var tx,ex={},nx=function(){function t(t,e,n){if(void 0===e&&(e=fm),void 0===n&&(n="ObservableMap@"+jy()),this.enhancer=e,this.name=n,this[$b]=ex,this._keysAtom=em(this.name+".keys()"),this[Symbol.toStringTag]="Map","function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(t)}return t.prototype._has=function(t){return this._data.has(t)},t.prototype.has=function(t){var e=this;if(!rb.trackingDerivation)return this._has(t);var n=this._hasMap.get(t);if(!n){var o=n=new Zm(this._has(t),gm,this.name+"."+Ky(t)+"?",!1);this._hasMap.set(t,o),Nb(o,(function(){return e._hasMap.delete(t)}))}return n.get()},t.prototype.set=function(t,e){var n=this._has(t);if(Wb(this)){var o=Ub(this,{type:n?"update":"add",object:this,newValue:e,name:t});if(!o)return this;e=o.newValue}return n?this._updateValue(t,e):this._addValue(t,e),this},t.prototype.delete=function(t){var e=this;if((Lm(this._keysAtom),Wb(this))&&!(o=Ub(this,{type:"delete",object:this,name:t})))return!1;if(this._has(t)){var n=Xb(this),o=n?{type:"delete",object:this,oldValue:this._data.get(t).value,name:t}:null;return Bb((function(){e._keysAtom.reportChanged(),e._updateHasMapEntry(t,!1),e._data.get(t).setNewValue(void 0),e._data.delete(t)})),n&&Yb(this,o),!0}return!1},t.prototype._updateHasMapEntry=function(t,e){var n=this._hasMap.get(t);n&&n.setNewValue(e)},t.prototype._updateValue=function(t,e){var n=this._data.get(t);if((e=n.prepareNewValue(e))!==rb.UNCHANGED){var o=!1,i=Xb(this),r=i?{type:"update",object:this,oldValue:n.value,name:t,newValue:e}:null;o,n.setNewValue(e),i&&Yb(this,r)}},t.prototype._addValue=function(t,e){var n=this;Lm(this._keysAtom),Bb((function(){var o=new Zm(e,n.enhancer,n.name+"."+Ky(t),!1);n._data.set(t,o),e=o.value,n._updateHasMapEntry(t,!0),n._keysAtom.reportChanged()}));var o=Xb(this);o&&Yb(this,o?{type:"add",object:this,name:t,newValue:e}:null)},t.prototype.get=function(t){return this.has(t)?this.dehanceValue(this._data.get(t).get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},t.prototype.values=function(){var t=this,e=this.keys();return xx({next:function(){var n=e.next(),o=n.done,i=n.value;return{done:o,value:o?void 0:t.get(i)}}})},t.prototype.entries=function(){var t=this,e=this.keys();return xx({next:function(){var n=e.next(),o=n.done,i=n.value;return{done:o,value:o?void 0:[i,t.get(i)]}}})},t.prototype[($b=Jy,Symbol.iterator)]=function(){return this.entries()},t.prototype.forEach=function(t,e){var n,o;try{for(var i=rm(this),r=i.next();!r.done;r=i.next()){var a=am(r.value,2),s=a[0],l=a[1];t.call(e,l,s,this)}}catch(t){n={error:t}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}},t.prototype.merge=function(t){var e=this;return ox(t)&&(t=t.toJS()),Bb((function(){var n=qm(!0);try{Gy(t)?qy(t).forEach((function(n){return e.set(n,t[n])})):Array.isArray(t)?t.forEach((function(t){var n=am(t,2),o=n[0],i=n[1];return e.set(o,i)})):Vy(t)?(t.constructor!==Map&&By("Cannot initialize from classes that inherit from Map: "+t.constructor.name),t.forEach((function(t,n){return e.set(n,t)}))):null!=t&&By("Cannot initialize map from "+t)}finally{Km(n)}})),this},t.prototype.clear=function(){var t=this;Bb((function(){Bm((function(){var e,n;try{for(var o=rm(t.keys()),i=o.next();!i.done;i=o.next()){var r=i.value;t.delete(r)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}))}))},t.prototype.replace=function(t){var e=this;return Bb((function(){var n,o,i,r,a=function(t){if(Vy(t)||ox(t))return t;if(Array.isArray(t))return new Map(t);if(Gy(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}return By("Cannot convert to map from '"+t+"'")}(t),s=new Map,l=!1;try{for(var u=rm(e._data.keys()),c=u.next();!c.done;c=u.next()){var d=c.value;if(!a.has(d))if(e.delete(d))l=!0;else{var h=e._data.get(d);s.set(d,h)}}}catch(t){n={error:t}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}try{for(var p=rm(a.entries()),f=p.next();!f.done;f=p.next()){var g=am(f.value,2),v=(d=g[0],h=g[1],e._data.has(d));if(e.set(d,h),e._data.has(d)){var y=e._data.get(d);s.set(d,y),v||(l=!0)}}}catch(t){i={error:t}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}if(!l)if(e._data.size!==s.size)e._keysAtom.reportChanged();else for(var m=e._data.keys(),b=s.keys(),x=m.next(),_=b.next();!x.done;){if(x.value!==_.value){e._keysAtom.reportChanged();break}x=m.next(),_=b.next()}e._data=s})),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.toPOJO=function(){var t,e,n={};try{for(var o=rm(this),i=o.next();!i.done;i=o.next()){var r=am(i.value,2),a=r[0],s=r[1];n["symbol"==typeof a?a:Ky(a)]=s}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n},t.prototype.toJS=function(){return new Map(this)},t.prototype.toJSON=function(){return this.toPOJO()},t.prototype.toString=function(){var t=this;return this.name+"[{ "+Array.from(this.keys()).map((function(e){return Ky(e)+": "+t.get(e)})).join(", ")+" }]"},t.prototype.observe=function(t,e){return Vb(this,t)},t.prototype.intercept=function(t){return Gb(this,t)},t}(),ox=Xy("ObservableMap",nx),ix={},rx=function(){function t(t,e,n){if(void 0===e&&(e=fm),void 0===n&&(n="ObservableSet@"+jy()),this.name=n,this[tx]=ix,this._data=new Set,this._atom=em(this.name),this[Symbol.toStringTag]="Set","function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(t,o){return e(t,o,n)},t&&this.replace(t)}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.clear=function(){var t=this;Bb((function(){Bm((function(){var e,n;try{for(var o=rm(t._data.values()),i=o.next();!i.done;i=o.next()){var r=i.value;t.delete(r)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}))}))},t.prototype.forEach=function(t,e){var n,o;try{for(var i=rm(this),r=i.next();!r.done;r=i.next()){var a=r.value;t.call(e,a,a,this)}}catch(t){n={error:t}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e=this;if((Lm(this._atom),Wb(this))&&!(o=Ub(this,{type:"add",object:this,newValue:t})))return this;if(!this.has(t)){Bb((function(){e._data.add(e.enhancer(t,void 0)),e._atom.reportChanged()}));var n=Xb(this),o=n?{type:"add",object:this,newValue:t}:null;n&&Yb(this,o)}return this},t.prototype.delete=function(t){var e=this;if(Wb(this)&&!(o=Ub(this,{type:"delete",object:this,oldValue:t})))return!1;if(this.has(t)){var n=Xb(this),o=n?{type:"delete",object:this,oldValue:t}:null;return Bb((function(){e._atom.reportChanged(),e._data.delete(t)})),n&&Yb(this,o),!0}return!1},t.prototype.has=function(t){return this._atom.reportObserved(),this._data.has(this.dehanceValue(t))},t.prototype.entries=function(){var t=0,e=Array.from(this.keys()),n=Array.from(this.values());return xx({next:function(){var o=t;return t+=1,o<n.length?{value:[e[o],n[o]],done:!1}:{done:!0}}})},t.prototype.keys=function(){return this.values()},t.prototype.values=function(){this._atom.reportObserved();var t=this,e=0,n=Array.from(this._data.values());return xx({next:function(){return e<n.length?{value:t.dehanceValue(n[e++]),done:!1}:{done:!0}}})},t.prototype.replace=function(t){var e=this;return ax(t)&&(t=t.toJS()),Bb((function(){var n=qm(!0);try{Array.isArray(t)||Yy(t)?(e.clear(),t.forEach((function(t){return e.add(t)}))):null!=t&&By("Cannot initialize set from "+t)}finally{Km(n)}})),this},t.prototype.observe=function(t,e){return Vb(this,t)},t.prototype.intercept=function(t){return Gb(this,t)},t.prototype.toJS=function(){return new Set(this)},t.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},t.prototype[(tx=Jy,Symbol.iterator)]=function(){return this.values()},t}(),ax=Xy("ObservableSet",rx),sx=function(){function t(t,e,n,o){void 0===e&&(e=new Map),this.target=t,this.values=e,this.name=n,this.defaultEnhancer=o,this.keysAtom=new Qy(n+".keys")}return t.prototype.read=function(t){return this.values.get(t).get()},t.prototype.write=function(t,e){var n=this.target,o=this.values.get(t);if(o instanceof Jm)o.set(e);else{if(Wb(this)){if(!(a=Ub(this,{type:"update",object:this.proxy||n,name:t,newValue:e})))return;e=a.newValue}if((e=o.prepareNewValue(e))!==rb.UNCHANGED){var i=Xb(this),r=!1,a=i?{type:"update",object:this.proxy||n,oldValue:o.value,name:t,newValue:e}:null;r,o.setNewValue(e),i&&Yb(this,a)}}},t.prototype.has=function(t){var e=this.pendingKeys||(this.pendingKeys=new Map),n=e.get(t);if(n)return n.get();var o=!!this.values.get(t);return n=new Zm(o,gm,this.name+"."+Ky(t)+"?",!1),e.set(t,n),n.get()},t.prototype.addObservableProp=function(t,e,n){void 0===n&&(n=this.defaultEnhancer);var o=this.target;if(Wb(this)){var i=Ub(this,{object:this.proxy||o,name:t,type:"add",newValue:e});if(!i)return;e=i.newValue}var r=new Zm(e,n,this.name+"."+Ky(t),!1);this.values.set(t,r),e=r.value,Object.defineProperty(o,t,function(t){return ux[t]||(ux[t]={configurable:!0,enumerable:!0,get:function(){return this[Jy].read(t)},set:function(e){this[Jy].write(t,e)}})}(t)),this.notifyPropertyAddition(t,e)},t.prototype.addComputedProp=function(t,e,n){var o=this.target;n.name=n.name||this.name+"."+Ky(e),this.values.set(e,new Jm(n)),(t===o||function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||!1!==n.configurable&&!1!==n.writable}(t,e))&&Object.defineProperty(t,e,function(t){return cx[t]||(cx[t]={configurable:rb.computedConfigurable,enumerable:!1,get:function(){return dx(this).read(t)},set:function(e){dx(this).write(t,e)}})}(e))},t.prototype.remove=function(t){if(this.values.has(t)){var e=this.target;if(Wb(this))if(!(s=Ub(this,{object:this.proxy||e,name:t,type:"remove"})))return;try{ub();var n=Xb(this),o=!1,i=this.values.get(t),r=i&&i.get();if(i&&i.set(void 0),this.keysAtom.reportChanged(),this.values.delete(t),this.pendingKeys){var a=this.pendingKeys.get(t);a&&a.set(!1)}delete this.target[t];var s=n?{type:"remove",object:this.proxy||e,oldValue:r,name:t}:null;o,n&&Yb(this,s)}finally{cb()}}},t.prototype.illegalAccess=function(t,e){},t.prototype.observe=function(t,e){return Vb(this,t)},t.prototype.intercept=function(t){return Gb(this,t)},t.prototype.notifyPropertyAddition=function(t,e){var n=Xb(this),o=n?{type:"add",object:this.proxy||this.target,name:t,newValue:e}:null;if(n&&Yb(this,o),this.pendingKeys){var i=this.pendingKeys.get(t);i&&i.set(!0)}this.keysAtom.reportChanged()},t.prototype.getKeys=function(){var t,e;this.keysAtom.reportObserved();var n=[];try{for(var o=rm(this.values),i=o.next();!i.done;i=o.next()){var r=am(i.value,2),a=r[0];r[1]instanceof Zm&&n.push(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n},t}();function lx(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n=fm),Object.prototype.hasOwnProperty.call(t,Jy))return t[Jy];Gy(t)||(e=(t.constructor.name||"ObservableObject")+"@"+jy()),e||(e="ObservableObject@"+jy());var o=new sx(t,new Map,Ky(e),n);return Uy(t,Jy,o),o}var ux=Object.create(null),cx=Object.create(null);function dx(t){var e=t[Jy];return e||(hm(t),t[Jy])}var hx=Xy("ObservableObjectAdministration",sx);function px(t){return!!Wy(t)&&(hm(t),hx(t[Jy]))}function fx(t,e){if("object"==typeof t&&null!==t){if(Qb(t))return void 0!==e&&By(!1),t[Jy].atom;if(ax(t))return t[Jy];if(ox(t)){var n=t;return void 0===e?n._keysAtom:((o=n._data.get(e)||n._hasMap.get(e))||By(!1),o)}var o;if(hm(t),e&&!t[Jy]&&t[e],px(t))return e?((o=t[Jy].values.get(e))||By(!1),o):By(!1);if(tm(t)||Qm(t)||bb(t))return t}else if("function"==typeof t&&bb(t[Jy]))return t[Jy];return By(!1)}var gx=Object.prototype.toString;function vx(t,e,n){return void 0===n&&(n=-1),yx(t,e,n)}function yx(t,e,n,o,i){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var r=typeof t;if("function"!==r&&"object"!==r&&"object"!=typeof e)return!1;var a=gx.call(t);if(a!==gx.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++}t=mx(t),e=mx(e);var s="[object Array]"===a;if(!s){if("object"!=typeof t||"object"!=typeof e)return!1;var l=t.constructor,u=e.constructor;if(l!==u&&!("function"==typeof l&&l instanceof l&&"function"==typeof u&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1}if(0===n)return!1;n<0&&(n=-1),i=i||[];for(var c=(o=o||[]).length;c--;)if(o[c]===t)return i[c]===e;if(o.push(t),i.push(e),s){if((c=t.length)!==e.length)return!1;for(;c--;)if(!yx(t[c],e[c],n-1,o,i))return!1}else{var d=Object.keys(t),h=void 0;if(c=d.length,Object.keys(e).length!==c)return!1;for(;c--;)if(!bx(e,h=d[c])||!yx(t[h],e[h],n-1,o,i))return!1}return o.pop(),i.pop(),!0}function mx(t){return Qb(t)?t.slice():Vy(t)||ox(t)||Yy(t)||ax(t)?Array.from(t.entries()):t}function bx(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function xx(t){return t[Symbol.iterator]=_x,t}function _x(){return this}if("undefined"==typeof Proxy||"undefined"==typeof Symbol)throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:function(t){return function(){}},extras:{getDebugName:function(t,e){return(void 0!==e?fx(t,e):px(t)||ox(t)||ax(t)?function(t){return t||By("Expecting some object"),tm(t)||Qm(t)||bb(t)||ox(t)||ax(t)?t:(hm(t),t[Jy]?t[Jy]:void By(!1))}(t):fx(t)).name}},$mobx:Jy});var Ex=function(){return Ex=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Ex.apply(this,arguments)},wx=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},Sx=function(){function t(t,e){var n;this.BaseType=Ey.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=Ty.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.points="",this.pointsList=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.isAnimation=!1,this.isShowAdjustPoint=!1,this.zIndex=0,this.state=_y.DEFAULT,this.modelType=wy.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=e,this.properties=null!==(n=t.properties)&&void 0!==n?n:{},this.initEdgeData(t),this.setAttributes()}return t.prototype.initEdgeData=function(t){if(t.properties||(t.properties={}),!t.id){var e=this.graphModel.idGenerator,n=e&&e(t.type),o=this.createId();t.id=o||n||JE()}this.arrowConfig.markerEnd="url(#marker-end-".concat(t.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(t.id,")");var i=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=i,li(this,tE(t)),this.graphModel.overlapMode===Cy.INCREASE&&(this.zIndex=t.zIndex||iw()),this.setAnchors(),this.initPoints(),this.formatText(t)},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.getEdgeStyle=function(){return Ex(Ex({},this.graphModel.theme.baseEdge),this.style)},t.prototype.getAdjustPointStyle=function(){return Ex({},this.graphModel.theme.edgeAdjust)},t.prototype.getTextStyle=function(){return Is(this.graphModel.theme.edgeText)},t.prototype.getEdgeAnimationStyle=function(){return Is(this.graphModel.theme.edgeAnimation)},t.prototype.getArrowStyle=function(){var t=this.getEdgeStyle(),e=this.getEdgeAnimationStyle(),n=this.graphModel.theme.arrow,o=this.isAnimation?e.stroke:t.stroke;return Ex(Ex(Ex({},t),{fill:o,stroke:o}),n)},t.prototype.getOutlineStyle=function(){return Is(this.graphModel.theme.outline)},t.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(t.prototype,"sourceNode",{get:function(){var t,e;return null===(e=null===(t=this.graphModel)||void 0===t?void 0:t.nodesMap[this.sourceNodeId])||void 0===e?void 0:e.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"targetNode",{get:function(){var t,e;return null===(e=null===(t=this.graphModel)||void 0===t?void 0:t.nodesMap[this.targetNodeId])||void 0===e?void 0:e.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),t.prototype.getBeginAnchor=function(t,e,n){var o,i,r=xE(t);return n&&(o=Uu(r,(function(t){return t.id===n})))||r.forEach((function(t){var n=eE(t,e);(void 0===i||n<i)&&(i=n,o=t)})),o},t.prototype.getEndAnchor=function(t,e){var n,o,i=this,r=xE(t);return e&&(n=Uu(r,(function(t){return t.id===e})))||r.forEach((function(t){if(i.startPoint){var e=eE(t,i.startPoint);(void 0===o||e<o)&&(o=e,n=t)}})),n},t.prototype.getProperties=function(){return jb(this.properties)},t.prototype.getData=function(){var t=this.properties;kb(t)&&(t=jb(t));var e={id:this.id,type:this.type,properties:t,sourceNodeId:this.sourceNodeId,targetNodeId:this.targetNodeId,startPoint:li({},this.startPoint),endPoint:li({},this.endPoint)};this.graphModel.overlapMode===Cy.INCREASE&&(e.zIndex=this.zIndex);var n=this.text,o=n.x,i=n.y,r=n.value;return r&&(e.text={x:o,y:i,value:r}),e},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.setProperty=function(t,e){var n=Is(jb(this.properties));Rb(n,t,Py(e)),this.properties=n,this.setAttributes()},t.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},t.prototype.setProperties=function(t){this.properties=Ex(Ex({},jb(this.properties)),Py(t)),this.setAttributes()},t.prototype.changeEdgeId=function(t){var e=this.arrowConfig,n=e.markerEnd,o=e.markerStart;o&&o==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(t,")")),n&&n==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(t,")")),this.id=t},t.prototype.setStyle=function(t,e){var n;this.style=Ex(Ex({},this.style),((n={})[t]=Py(e),n))},t.prototype.setStyles=function(t){this.style=Ex(Ex({},this.style),Py(t))},t.prototype.updateStyles=function(t){this.style=Ex({},Py(t))},t.prototype.setTextMode=function(t){this.textMode=t},t.prototype.formatText=function(t){var e,n,o,i=this.textPosition,r=i.x,a=i.y,s=t.text,l={value:"",x:r,y:a,draggable:!1,editable:!0};s&&("string"==typeof s?l=Ex(Ex({},l),{value:s}):(l=Ex(Ex({},l),{x:null!==(e=s.x)&&void 0!==e?e:r,y:null!==(n=s.y)&&void 0!==n?n:a,value:null!==(o=s.value)&&void 0!==o?o:""}),nd(s.draggable)||(l.draggable=s.draggable),nd(s.editable)||(l.editable=s.editable))),this.text=l},t.prototype.resetTextPosition=function(){var t=this.textPosition,e=t.x,n=t.y;this.text.x=e,this.text.y=n},t.prototype.moveText=function(t,e){var n=this.text,o=n.x,i=n.y,r=n.value,a=n.draggable,s=n.editable;this.text={value:r,editable:s,draggable:a,x:o+t,y:i+e}},t.prototype.setText=function(t){t&&li(this.text,t)},t.prototype.updateText=function(t){this.text=Ex(Ex({},jb(this.text)),{value:t})},t.prototype.setAnchors=function(){if(!this.sourceAnchorId||!this.startPoint){if(!(t=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId)))throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:t.x,y:t.y}),this.sourceAnchorId||(this.sourceAnchorId=t.id)}if(!this.targetAnchorId||!this.endPoint){var t;if(!(t=this.getEndAnchor(this.targetNode,this.targetAnchorId)))throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:t.x,y:t.y}),this.targetAnchorId||(this.targetAnchorId=t.id)}},t.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},t.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t},t.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},t.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},t.prototype.openEdgeAnimation=function(){this.isAnimation=!0},t.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},t.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},t.prototype.updateStartPoint=function(t){this.startPoint=t},t.prototype.moveStartPoint=function(t,e){this.startPoint&&(this.startPoint.x+=t,this.startPoint.y+=e)},t.prototype.updateEndPoint=function(t){this.endPoint=t},t.prototype.moveEndPoint=function(t,e){this.endPoint&&(this.endPoint.x+=t,this.endPoint.y+=e)},t.prototype.setZIndex=function(t){void 0===t&&(t=0),this.zIndex=t},t.prototype.initPoints=function(){},t.prototype.updateAttributes=function(t){li(this,t)},t.prototype.getAdjustStart=function(){return this.startPoint},t.prototype.getAdjustEnd=function(){return this.endPoint},t.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint;this.updateStartPoint({x:e.x,y:e.y}),this.updateEndPoint({x:n.x,y:n.y})},t.BaseType=Ey.EDGE,wx([Cm],t.prototype,"type",void 0),wx([Cm],t.prototype,"sourceNodeId",void 0),wx([Cm],t.prototype,"targetNodeId",void 0),wx([Cm],t.prototype,"startPoint",void 0),wx([Cm],t.prototype,"endPoint",void 0),wx([Cm],t.prototype,"textMode",void 0),wx([Cm],t.prototype,"text",void 0),wx([Cm],t.prototype,"properties",void 0),wx([Cm],t.prototype,"points",void 0),wx([Cm],t.prototype,"pointsList",void 0),wx([Cm],t.prototype,"isSelected",void 0),wx([Cm],t.prototype,"isHovered",void 0),wx([Cm],t.prototype,"isHitable",void 0),wx([Cm],t.prototype,"isHittable",void 0),wx([Cm],t.prototype,"draggable",void 0),wx([Cm],t.prototype,"visible",void 0),wx([Cm],t.prototype,"isAnimation",void 0),wx([Cm],t.prototype,"isShowAdjustPoint",void 0),wx([Cm],t.prototype,"zIndex",void 0),wx([Cm],t.prototype,"state",void 0),wx([Cm],t.prototype,"style",void 0),wx([Cm],t.prototype,"arrowConfig",void 0),wx([Pm],t.prototype,"sourceNode",null),wx([Pm],t.prototype,"targetNode",null),wx([Pm],t.prototype,"textPosition",null),wx([wb],t.prototype,"setProperty",null),wx([wb],t.prototype,"deleteProperty",null),wx([wb],t.prototype,"setProperties",null),wx([wb],t.prototype,"changeEdgeId",null),wx([wb],t.prototype,"setStyle",null),wx([wb],t.prototype,"setStyles",null),wx([wb],t.prototype,"updateStyles",null),wx([wb],t.prototype,"setTextMode",null),wx([wb],t.prototype,"formatText",null),wx([wb],t.prototype,"resetTextPosition",null),wx([wb],t.prototype,"moveText",null),wx([wb],t.prototype,"setText",null),wx([wb],t.prototype,"updateText",null),wx([wb],t.prototype,"setAnchors",null),wx([wb],t.prototype,"setSelected",null),wx([wb],t.prototype,"setHovered",null),wx([wb],t.prototype,"setHitable",null),wx([wb],t.prototype,"setHittable",null),wx([wb],t.prototype,"openEdgeAnimation",null),wx([wb],t.prototype,"closeEdgeAnimation",null),wx([wb],t.prototype,"setElementState",null),wx([wb],t.prototype,"updateStartPoint",null),wx([wb],t.prototype,"moveStartPoint",null),wx([wb],t.prototype,"updateEndPoint",null),wx([wb],t.prototype,"moveEndPoint",null),wx([wb],t.prototype,"setZIndex",null),wx([wb],t.prototype,"initPoints",null),wx([wb],t.prototype,"updateAttributes",null),wx([wb],t.prototype,"getAdjustStart",null),wx([wb],t.prototype,"getAdjustEnd",null),wx([wb],t.prototype,"updateAfterAdjustStartAndEnd",null),t}(),Cx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Nx=function(){return Nx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Nx.apply(this,arguments)},Tx=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},Ax=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a};!function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=wy.BEZIER_EDGE,o.path="",o.initEdgeData(e),o.setAttributes(),o}Cx(e,t),e.prototype.initEdgeData=function(e){this.offset=100,t.prototype.initEdgeData.call(this,e)},e.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.bezier,n=t.prototype.getEdgeStyle.call(this),o=this.properties.style,i=void 0===o?{}:o;return Nx(Nx(Nx({},n),Is(e)),Is(i))},e.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var t=0,e=0;return this.pointsList.forEach((function(n){var o=n.x,i=n.y;t+=o,e+=i})),{x:t/this.pointsList.length,y:e/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e.prototype.getData=function(){var e=t.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return Nx(Nx({},e),{pointsList:n})},e.prototype.getControls=function(){var t=this.startPoint,e=this.endPoint;return J_({start:t,end:e,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset})},e.prototype.getPath=function(t){var e=Ax(t,4),n=e[0],o=e[1],i=e[2],r=e[3];return"M ".concat(n.x," ").concat(n.y,"\n C ").concat(o.x," ").concat(o.y,",\n ").concat(i.x," ").concat(i.y,",\n ").concat(r.x," ").concat(r.y)},e.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var t=this.getControls(),e=t.sNext,n=t.ePre;this.updatePath(e,n)},e.prototype.updatePath=function(t,e){t=Is(t),e=Is(e);var n={x:this.startPoint.x,y:this.startPoint.y},o={x:this.endPoint.x,y:this.endPoint.y};if(!t||!e){var i=this.getControls();t=i.sNext,e=i.ePre}this.pointsList=[n,t,e,o],this.path=this.getPath(this.pointsList)},e.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},e.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e;var n=Ax(this.pointsList,3),o=n[1],i=n[2];o.x+=t,o.y+=e,this.updatePath(o,i)},e.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e;var n=Ax(this.pointsList,3),o=n[1],i=n[2];i.x+=t,i.y+=e,this.updatePath(o,i)},e.prototype.updateAdjustAnchor=function(t,e){var n;"sNext"===e?this.pointsList[1]=t:"ePre"===e&&(this.pointsList[2]=t),this.path=this.getPath(this.pointsList),(null===(n=this.text)||void 0===n?void 0:n.value)&&this.setText(li({},this.text,this.textPosition))},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,o=t.sourceNode,i=t.targetNode,r=J_({start:e,end:n,sourceNode:o,targetNode:i,offset:this.offset}),a=r.sNext,s=r.ePre;this.pointsList=[e,a,s,n],this.initPoints()},Tx([Cm],e.prototype,"path",void 0),Tx([wb],e.prototype,"initPoints",null),Tx([wb],e.prototype,"updatePoints",null),Tx([wb],e.prototype,"updateStartPoint",null),Tx([wb],e.prototype,"updateEndPoint",null),Tx([wb],e.prototype,"moveStartPoint",null),Tx([wb],e.prototype,"moveEndPoint",null),Tx([wb],e.prototype,"updateAdjustAnchor",null),Tx([wb],e.prototype,"getAdjustStart",null),Tx([wb],e.prototype,"getAdjustEnd",null),Tx([wb],e.prototype,"updateAfterAdjustStartAndEnd",null)}(Sx);var Mx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ox=function(){return Ox=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Ox.apply(this,arguments)},Px=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},kx=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))};!function(t){function e(){var e=t.apply(this,kx([],Px(arguments),!1))||this;return e.modelType=wy.LINE_EDGE,e}Mx(e,t),e.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.line,n=t.prototype.getEdgeStyle.call(this),o=this.properties.style,i=void 0===o?{}:o;return Ox(Ox(Ox({},n),Is(e)),Is(i))},e.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}}}(Sx);var Rx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Dx=function(){return Dx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Dx.apply(this,arguments)},Lx=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},Ix=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},jx=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))};!function(t){function e(){var e=t.apply(this,jx([],Ix(arguments),!1))||this;return e.modelType=wy.POLYLINE_EDGE,e.draggingPointList=[],e}Rx(e,t),e.prototype.initEdgeData=function(e){this.offset=30,t.prototype.initEdgeData.call(this,e)},e.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.polyline,n=t.prototype.getEdgeStyle.call(this),o=this.properties.style,i=void 0===o?{}:o;return Dx(Dx(Dx({},n),Is(e)),Is(i))},e.prototype.getTextPosition=function(){var t,e=null===(t=this.text)||void 0===t?void 0:t.value;if(this.dbClickPosition&&!e){var n=this.dbClickPosition;return{x:n.x,y:n.y}}var o=K_(this.points),i=Ix(U_(o),2),r=i[0],a=i[1];return{x:(r.x+a.x)/2,y:(r.y+a.y)/2}},e.prototype.getAfterAnchor=function(t,e,n){var o,i;return n.forEach((function(n){var r;t===Ny.HORIZONTAL?r=Math.abs(e.y-n.y):t===Ny.VERTICAL&&(r=Math.abs(e.x-n.x)),(!i||i>r)&&(i=r,o=n)})),o},e.prototype.getCrossPoint=function(t,e,n){var o;return t===Ny.HORIZONTAL?o={x:n.x,y:e.y}:t===Ny.VERTICAL&&(o={x:e.x,y:n.y}),o},e.prototype.removeCrossPoints=function(t,e,n){var o=n.map((function(t){return t}));if(1===t){var i=o[t],r=o[e],a=o[t-1];if(X_(a,i,this.sourceNode)){if(V_(i,r,this.sourceNode))(s=Y_(i,r,this.sourceNode))&&(o[t]=s,o.splice(t-1,1),t--,e--)}else this.sourceNode.anchors.forEach((function(e){(e.x===a.x&&e.x===i.x||e.y===a.y&&e.y===i.y)&&(EE(e.x,e.y,i.x,i.y)<EE(a.x,a.y,i.x,i.y)&&(o[t-1]=e))}))}if(e===n.length-2){var s,l=o[t],u=o[e],c=o[e+1];if(X_(u,c,this.targetNode)){if(V_(l,u,this.targetNode))(s=Y_(l,u,this.targetNode))&&(o[e]=s,o.splice(e+1,1))}else this.targetNode.anchors.forEach((function(t){(t.x===c.x&&t.x===u.x||t.y===c.y&&t.y===u.y)&&(EE(t.x,t.y,u.x,u.y)<EE(c.x,c.y,u.x,u.y)&&(o[e+1]=t))}))}return o},e.prototype.getDraggingPoints=function(t,e,n,o,i){var r=i.map((function(t){return t})),a=this.getAfterAnchor(t,n,o),s=this.getCrossPoint(t,n,a);return"start"===e?(r.unshift(s),r.unshift(a)):(r.push(s),r.push(a)),r},e.prototype.updateCrossPoints=function(t){var e=t.map((function(t){return t})),n=t[0],o=t[1],i=t[e.length-2],r=t[e.length-1],a=this.sourceNode,s=this.targetNode,l=a.modelType,u=s.modelType,c=q_(n,o),d=e[0];switch(l){case wy.RECT_NODE:if(0!==a.radius)TE(n,a)||(d=CE(n,c,a));break;case wy.CIRCLE_NODE:d=NE(n,c,a);break;case wy.ELLIPSE_NODE:d=AE(n,c,a);break;case wy.DIAMOND_NODE:case wy.POLYGON_NODE:d=ME(n,c,a)}d&&(e[0]=d);var h=q_(i,r),p=e[e.length-1];switch(u){case wy.RECT_NODE:if(0!==s.radius)TE(r,s)||(p=CE(r,h,s));break;case wy.CIRCLE_NODE:p=NE(r,h,s);break;case wy.ELLIPSE_NODE:p=AE(r,h,s);break;case wy.DIAMOND_NODE:case wy.POLYGON_NODE:p=ME(r,h,s)}return p&&(e[e.length-1]=p),e},e.prototype.getData=function(){var e=t.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return Object.assign({},e,{pointsList:n})},e.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.pointsList.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" "):this.updatePoints()},e.prototype.updatePoints=function(){var t=G_({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=t,this.points=t.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ")},e.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e,this.updatePoints()},e.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e,this.updatePoints()},e.prototype.updatePointsList=function(t,e){this.pointsList.forEach((function(n){n.x+=t,n.y+=e}));var n=this.pointsList[0];this.startPoint=Object.assign({},n);var o=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},o),this.initPoints()},e.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map((function(t){return t}))},e.prototype.dragAppendSimple=function(t,e){var n;this.isDragging=!0;var o=t.start,i=t.end,r=t.startIndex,a=t.endIndex,s=t.direction,l=this.pointsList,u=l;return s===Ny.HORIZONTAL?(l[r]={x:o.x,y:o.y+e.y},l[a]={x:i.x,y:i.y+e.y},u=this.pointsList.map((function(t){return t}))):s===Ny.VERTICAL&&(l[r]={x:o.x+e.x,y:o.y},l[a]={x:i.x+e.x,y:i.y},u=this.pointsList.map((function(t){return t}))),this.updatePointsAfterDrag(u),this.draggingPointList=u,(null===(n=this.text)||void 0===n?void 0:n.value)&&this.setText(li({},this.text,this.textPosition)),{start:li({},l[r]),end:li({},l[a]),startIndex:r,endIndex:a,direction:s}},e.prototype.dragAppend=function(t,e){var n;this.isDragging=!0;var o=t.start,i=t.end,r=t.startIndex,a=t.endIndex,s=t.direction,l=this.pointsList;if(s===Ny.HORIZONTAL){l[r]={x:o.x,y:o.y+e.y},l[a]={x:i.x,y:i.y+e.y};var u=this.pointsList.map((function(t){return t}));if(0!==r&&a!==this.pointsList.length-1&&(u=this.removeCrossPoints(r,a,u)),0===r){var c={x:o.x,y:o.y+e.y};if(!wE(c,this.sourceNode)){var d=this.sourceNode.anchors;u=this.getDraggingPoints(s,"start",c,d,u)}}if(a===this.pointsList.length-1){var h={x:i.x,y:i.y+e.y};if(!wE(h,this.targetNode)){d=this.targetNode.anchors;u=this.getDraggingPoints(s,"end",h,d,u)}}this.updatePointsAfterDrag(u),this.draggingPointList=u}else if(s===Ny.VERTICAL){l[r]={x:o.x+e.x,y:o.y},l[a]={x:i.x+e.x,y:i.y};u=this.pointsList.map((function(t){return t}));if(0!==r&&a!==this.pointsList.length-1&&(u=this.removeCrossPoints(r,a,u)),0===r){c={x:o.x+e.x,y:o.y};if(!wE(c,this.sourceNode)){d=this.sourceNode.anchors;u=this.getDraggingPoints(s,"start",c,d,u)}}if(a===this.pointsList.length-1){h={x:i.x+e.x,y:i.y};if(!wE(h,this.targetNode)){d=this.targetNode.anchors;u=this.getDraggingPoints(s,"end",h,d,u)}}this.updatePointsAfterDrag(u),this.draggingPointList=u}return(null===(n=this.text)||void 0===n?void 0:n.value)&&this.setText(li({},this.text,this.textPosition)),{start:li({},l[r]),end:li({},l[a]),startIndex:r,endIndex:a,direction:s}},e.prototype.dragAppendEnd=function(){if(this.draggingPointList){var t=W_(K_(this.points));this.pointsList=t.map((function(t){return t})),this.draggingPointList=[];var e=t[0];this.startPoint=li({},e);var n=t[t.length-1];this.endPoint=li({},n)}this.isDragging=!1},e.prototype.updatePointsAfterDrag=function(t){var e=this.updateCrossPoints(t);this.points=e.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ")},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,o=t.sourceNode,i=t.targetNode;this.pointsList=G_({x:e.x,y:e.y},{x:n.x,y:n.y},o,i,this.offset||0),this.initPoints()},Lx([Cm],e.prototype,"dbClickPosition",void 0),Lx([wb],e.prototype,"initPoints",null),Lx([wb],e.prototype,"updatePoints",null),Lx([wb],e.prototype,"updateStartPoint",null),Lx([wb],e.prototype,"moveStartPoint",null),Lx([wb],e.prototype,"updateEndPoint",null),Lx([wb],e.prototype,"moveEndPoint",null),Lx([wb],e.prototype,"updatePointsList",null),Lx([wb],e.prototype,"dragAppendStart",null),Lx([wb],e.prototype,"dragAppendSimple",null),Lx([wb],e.prototype,"dragAppend",null),Lx([wb],e.prototype,"dragAppendEnd",null),Lx([wb],e.prototype,"updatePointsAfterDrag",null),Lx([wb],e.prototype,"getAdjustStart",null),Lx([wb],e.prototype,"getAdjustEnd",null),Lx([wb],e.prototype,"updateAfterAdjustStartAndEnd",null)}(Sx);var Bx=function(){return Bx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Bx.apply(this,arguments)},Hx=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},Fx=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},zx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},Wx=function(){function t(t,e){var n;this.BaseType=Ey.NODE,this.id="",this.type="",this.x=0,this.y=0,this.textMode=Ty.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this._width=100,this._height=80,this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.anchorsOffset=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isShowAnchor=!1,this.isDragging=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.rotatable=!0,this.resizable=!0,this.zIndex=1,this.state=_y.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=wy.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=e,this.properties=null!==(n=t.properties)&&void 0!==n?n:{},this.initNodeData(t),this.setAttributes()}return Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t;var e=this.x,n=void 0===e?0:e,o=this.y,i=void 0===o?0:o;this.transform=new mE(-n,-i).rotate(t).translate(n,i).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),t.prototype.initNodeData=function(t){if(t.properties||(t.properties={}),!t.id){var e=this.graphModel.idGenerator,n=e&&e(t.type),o=this.createId();t.id=o||n||JE()}this.formatText(t),li(this,OE(t)),this.graphModel.overlapMode===Cy.INCREASE&&(this.zIndex=t.zIndex||iw())},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.setTextMode=function(t){this.textMode=t},t.prototype.formatText=function(t){var e,n,o,i=t.x,r=t.y,a=t.text,s={value:"",x:i,y:r,draggable:!1,editable:!0};a&&("string"==typeof a?s.value=a:(s=Bx(Bx({},s),{x:null!==(e=a.x)&&void 0!==e?e:i,y:null!==(n=a.y)&&void 0!==n?n:r,value:null!==(o=a.value)&&void 0!==o?o:""}),nd(a.draggable)||(s.draggable=a.draggable),nd(a.editable)||(s.draggable=a.draggable))),t.text=s},t.prototype.resize=function(t){var e=t.width,n=t.height,o=t.deltaX,i=t.deltaY;return this.move(o/2,i/2),this.width=e,this.height=n,this.setProperties({width:e,height:n}),this.getData()},t.prototype.proportionalResize=function(){},t.prototype.getData=function(){var t=this.text,e=t.x,n=t.y,o=t.value,i=this.properties;kb(i)&&(i=jb(i));var r={id:this.id,type:this.type,x:this.x,y:this.y,properties:i};return this.rotate&&(r.rotate=this.rotate),this.graphModel.overlapMode===Cy.INCREASE&&(r.zIndex=this.zIndex),o&&(r.text={x:e,y:n,value:o}),r},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.getProperties=function(){return jb(this.properties)},t.prototype.getOuterGAttributes=function(){return{className:""}},t.prototype.getNodeStyle=function(){return Bx(Bx({},this.graphModel.theme.baseNode),this.style)},t.prototype.getTextStyle=function(){var t=this.graphModel.theme.nodeText,e=this.properties.textStyle,n=void 0===e?{}:e;return Bx(Bx({},Is(t)),Is(n))},t.prototype.getRotateControlStyle=function(){return Is(this.graphModel.theme.rotateControl)},t.prototype.getResizeControlStyle=function(){return Is(this.graphModel.theme.resizeControl)},t.prototype.getResizeOutlineStyle=function(){return Is(this.graphModel.theme.resizeOutline)},t.prototype.getAnchorStyle=function(t){return Is(this.graphModel.theme.anchor)},t.prototype.getAnchorLineStyle=function(t){return Is(this.graphModel.theme.anchorLine)},t.prototype.getOutlineStyle=function(){return Is(this.graphModel.theme.outline)},t.prototype.isAllowConnectedAsSource=function(t,e,n,o){var i=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var r=!0,a="",s=0;s<i.length;s++){var l=i[s];if(!l.validate.call(this,this,t,e,n,o)){r=!1,a=l.message;break}}return{isAllPass:r,msg:a}},t.prototype.getConnectedSourceRules=function(){return this.sourceRules},t.prototype.isAllowConnectedAsTarget=function(t,e,n,o){var i=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var r=!0,a="",s=0;s<i.length;s++){var l=i[s];if(!l.validate.call(this,t,this,e,n,o)){r=!1,a=l.message;break}}return{isAllPass:r,msg:a}},t.prototype.isAllowMoveNode=function(t,e){var n,o,i=!0,r=!0,a=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var s=Fx(a),l=s.next();!l.done;l=s.next()){var u=(0,l.value)(this,t,e);if(!u)return!1;if("object"==typeof u){var c=u;if(!c.x&&!c.y)return!1;i=i&&c.x,r=r&&c.y}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return{x:i,y:r}},t.prototype.getConnectedTargetRules=function(){return this.targetRules},t.prototype.getAnchorsByOffset=function(){var t=this,e=t.anchorsOffset,n=t.id,o=t.x,i=t.y;return e&&e.length>0?e.map((function(t,e){return t.length?{id:"".concat(n,"_").concat(e),x:o+t[0],y:i+t[1]}:Bx(Bx({},t),{x:o+t.x,y:i+t.y,id:t.id||"".concat(n,"_").concat(e)})})):this.getDefaultAnchor()},t.prototype.getDefaultAnchor=function(){return[]},t.prototype.getTargetAnchor=function(t){return _E(t,this)},t.prototype.getBounds=function(){return{minX:this.x-this.width/2,minY:this.y-this.height/2,maxX:this.x+this.width/2,maxY:this.y+this.height/2}},Object.defineProperty(t.prototype,"anchors",{get:function(){var t=this.getAnchorsByOffset(),e=this,n=e.x,o=e.y,i=e.rotate;return t.forEach((function(t){var e=t.x,r=t.y,a=zx(new gE([e,r,1]).translate(-n,-o).rotate(i).translate(n,o)[0],2),s=a[0],l=a[1];t.x=s,t.y=l})),t},enumerable:!1,configurable:!0}),t.prototype.getAnchorInfo=function(t){if(!Jc(t))for(var e=0;e<this.anchors.length;e++){var n=this.anchors[e];if(n.id===t)return n}},t.prototype.addNodeMoveRules=function(t){this.moveRules.includes(t)||this.moveRules.push(t)},t.prototype.isAllowMoveByXORY=function(t,e,n){var o,i;if(n)o=!0,i=!0;else{var r=this.isAllowMoveNode(t,e);"boolean"==typeof r?(o=r,i=r):(o=r.x,i=r.y)}return{isAllowMoveX:o,isAllowMoveY:i}},t.prototype.move=function(t,e,n){void 0===n&&(n=!1);var o=this.isAllowMoveByXORY(t,e,n),i=o.isAllowMoveX,r=o.isAllowMoveY;return i&&(this.x=this.x+t,this.text&&this.moveText(t,0)),r&&(this.y=this.y+e,this.text&&this.moveText(0,e)),i||r},t.prototype.getMoveDistance=function(t,e,n){void 0===n&&(n=!1);var o=this.isAllowMoveByXORY(t,e,n),i=o.isAllowMoveX,r=o.isAllowMoveY,a=0,s=0;return i&&t&&(this.x=this.x+t,this.text&&this.moveText(t,0),a=t),r&&e&&(this.y=this.y+e,this.text&&this.moveText(0,e),s=e),[a,s]},t.prototype.moveTo=function(t,e,n){void 0===n&&(n=!1);var o=t-this.x,i=e-this.y;return!(!n&&!this.isAllowMoveNode(o,i))&&(this.text&&this.moveText(o,i),this.x=t,this.y=e,!0)},t.prototype.moveText=function(t,e){var n=this.text,o=n.x,i=n.y,r=n.value,a=n.draggable,s=n.editable;this.text={value:r,editable:s,draggable:a,x:o+t,y:i+e}},t.prototype.updateText=function(t){this.text=Bx(Bx({},jb(this.text)),{value:t})},t.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},t.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t,this.setIsShowAnchor(t)},t.prototype.setIsShowAnchor=function(t){void 0===t&&(t=!0),this.isShowAnchor=t},t.prototype.setRotatable=function(t){void 0===t&&(t=!0),this.rotatable=t},t.prototype.setResizable=function(t){void 0===t&&(t=!0),this.resizable=t},t.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},t.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},t.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},t.prototype.updateProperties=function(t,e){var n=jb(this.properties);this.properties=t,this.setAttributes(),this.graphModel.eventCenter.emit(Sy.NODE_PROPERTIES_CHANGE,{id:this.id,keys:e,preProperties:n,properties:t})},t.prototype.setProperty=function(t,e){var n=Is(jb(this.properties));qh(n,t,Py(e)),this.updateProperties(n,[t])},t.prototype.setProperties=function(t){var e=jb(this.properties),n=Bx(Bx({},e),Py(t)),o=[];pd(t,(function(t,n){(fc(e,n)&&e[n]!==t||!fc(e,n))&&o.push(n)})),this.updateProperties(n,o)},t.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},t.prototype.setStyle=function(t,e){var n;this.style=Bx(Bx({},this.style),((n={})[t]=Py(e),n))},t.prototype.setStyles=function(t){this.style=Bx(Bx({},this.style),Py(t))},t.prototype.updateStyles=function(t){this.style=Bx({},Py(t))},t.prototype.setZIndex=function(t){void 0===t&&(t=1),this.zIndex=t},t.prototype.updateAttributes=function(t){li(this,t)},t.BaseType=Ey.NODE,Hx([Cm],t.prototype,"type",void 0),Hx([Cm],t.prototype,"x",void 0),Hx([Cm],t.prototype,"y",void 0),Hx([Cm],t.prototype,"textMode",void 0),Hx([Cm],t.prototype,"text",void 0),Hx([Cm],t.prototype,"properties",void 0),Hx([Cm],t.prototype,"_width",void 0),Hx([Cm],t.prototype,"_height",void 0),Hx([Cm],t.prototype,"anchorsOffset",void 0),Hx([Cm],t.prototype,"isSelected",void 0),Hx([Cm],t.prototype,"isHovered",void 0),Hx([Cm],t.prototype,"isShowAnchor",void 0),Hx([Cm],t.prototype,"isDragging",void 0),Hx([Cm],t.prototype,"isHitable",void 0),Hx([Cm],t.prototype,"isHittable",void 0),Hx([Cm],t.prototype,"draggable",void 0),Hx([Cm],t.prototype,"visible",void 0),Hx([Cm],t.prototype,"rotatable",void 0),Hx([Cm],t.prototype,"resizable",void 0),Hx([Cm],t.prototype,"zIndex",void 0),Hx([Cm],t.prototype,"state",void 0),Hx([Cm],t.prototype,"autoToFront",void 0),Hx([Cm],t.prototype,"style",void 0),Hx([Cm],t.prototype,"transform",void 0),Hx([Cm],t.prototype,"_rotate",void 0),Hx([Pm],t.prototype,"incoming",null),Hx([Pm],t.prototype,"outgoing",null),Hx([wb],t.prototype,"setTextMode",null),Hx([wb],t.prototype,"addNodeMoveRules",null),Hx([wb],t.prototype,"move",null),Hx([wb],t.prototype,"getMoveDistance",null),Hx([wb],t.prototype,"moveTo",null),Hx([wb],t.prototype,"moveText",null),Hx([wb],t.prototype,"updateText",null),Hx([wb],t.prototype,"setSelected",null),Hx([wb],t.prototype,"setHovered",null),Hx([wb],t.prototype,"setIsShowAnchor",null),Hx([wb],t.prototype,"setRotatable",null),Hx([wb],t.prototype,"setResizable",null),Hx([wb],t.prototype,"setHitable",null),Hx([wb],t.prototype,"setHittable",null),Hx([wb],t.prototype,"setElementState",null),Hx([wb],t.prototype,"setProperty",null),Hx([wb],t.prototype,"setProperties",null),Hx([wb],t.prototype,"deleteProperty",null),Hx([wb],t.prototype,"setStyle",null),Hx([wb],t.prototype,"setStyles",null),Hx([wb],t.prototype,"updateStyles",null),Hx([wb],t.prototype,"setZIndex",null),Hx([wb],t.prototype,"updateAttributes",null),t}(),Gx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ux=function(){return Ux=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Ux.apply(this,arguments)},Xx=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a};!function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=wy.CIRCLE_NODE,o.r=50,o.initNodeData(e),o.setAttributes(),o}Gx(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties.r;e&&(this.r=e)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.circle,o=this.properties.style,i=void 0===o?{}:o;return Ux(Ux(Ux({},e),Is(n)),Is(i))},e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,o=t.r;return[{x:e,y:n-o,id:"".concat(this.id,"_0")},{x:e+o,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o,id:"".concat(this.id,"_2")},{x:e-o,y:n,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(t){var e=t.width,n=t.deltaX,o=t.deltaY;return this.move(n/2,o/2),this.r=e,this.setProperties({r:e}),this.getData()},Xx([Cm],e.prototype,"r",void 0),Xx([Pm],e.prototype,"width",null),Xx([Pm],e.prototype,"height",null)}(Wx);var Vx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Yx=function(){return Yx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Yx.apply(this,arguments)},qx=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},Kx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a};!function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=wy.DIAMOND_NODE,o.rx=30,o.ry=50,o.initNodeData(e),o.setAttributes(),o}Vx(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.rx,o=e.ry;n&&(this.rx=n),o&&(this.ry=o)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.diamond,o=this.properties.style,i=void 0===o?{}:o;return Yx(Yx(Yx({},e),Is(n)),Is(i))},Object.defineProperty(e.prototype,"points",{get:function(){var t=this,e=t.x,n=t.y,o=t.rx,i=t.ry;return[[e,n-i],[e+o,n],[e,n+i],[e-o,n]]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointsPosition",{get:function(){return Ju(this.points,(function(t){var e=Kx(t,2);return{x:e[0],y:e[1]}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return xu(this.points,(function(n){var o=Kx(n,1)[0];o<t&&(t=o),o>e&&(e=o)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return xu(this.points,(function(n){var o=Kx(n,2)[1];o<t&&(t=o),o>e&&(e=o)})),e-t},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this;return Ju(this.points,(function(e,n){var o=Kx(e,2);return{x:o[0],y:o[1],id:"".concat(t.id,"_").concat(n)}}))},e.prototype.resize=function(t){var e=t.width,n=t.height,o=t.deltaX,i=t.deltaY;return this.move(o/2,i/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},qx([Cm],e.prototype,"rx",void 0),qx([Cm],e.prototype,"ry",void 0),qx([Pm],e.prototype,"points",null),qx([Pm],e.prototype,"pointsPosition",null),qx([Pm],e.prototype,"width",null),qx([Pm],e.prototype,"height",null)}(Wx);var Zx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),$x=function(){return $x=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},$x.apply(this,arguments)},Jx=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a};!function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=wy.ELLIPSE_NODE,o.rx=30,o.ry=45,o.initNodeData(e),o.setAttributes(),o}Zx(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.rx,o=e.ry;n&&(this.rx=n),o&&(this.ry=o)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.ellipse,o=this.properties.style,i=void 0===o?{}:o;return $x($x($x({},e),Is(n)),Is(i))},Object.defineProperty(e.prototype,"width",{get:function(){return 2*this.rx},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 2*this.ry},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,o=t.rx,i=t.ry;return[{x:e,y:n-i,id:"".concat(this.id,"_0")},{x:e+o,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+i,id:"".concat(this.id,"_2")},{x:e-o,y:n,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(t){var e=t.width,n=t.height,o=t.deltaX,i=t.deltaY;return this.move(o/2,i/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},Jx([Cm],e.prototype,"rx",void 0),Jx([Cm],e.prototype,"ry",void 0),Jx([Pm],e.prototype,"width",null),Jx([Pm],e.prototype,"height",null)}(Wx);var Qx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),t_=function(){return t_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},t_.apply(this,arguments)},e_=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},n_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a};!function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=wy.POLYGON_NODE,o.points=[[50,0],[100,50],[50,100],[0,50]],o.initNodeData(e),o.setAttributes(),o}Qx(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.points,o=e.width,i=e.height,r=n||this.points;this.points=function(t,e,n){if(!t)return[];var o=Math.min.apply(Math,oE([],nE(t.map((function(t){return t[0]}))),!1)),i=Math.max.apply(Math,oE([],nE(t.map((function(t){return t[0]}))),!1)),r=Math.min.apply(Math,oE([],nE(t.map((function(t){return t[1]}))),!1)),a=Math.max.apply(Math,oE([],nE(t.map((function(t){return t[1]}))),!1)),s=-o,l=-r,u=t.map((function(t){var e=nE(t,2),n=e[0],o=e[1];return[n+s,o+l]})),c=i-o,d=a-r,h=e?e/c:1,p=n?n/d:1,f=Math.min(h,p);return u.map((function(t){var e=nE(t,2),n=e[0],o=e[1];return[n*f,o*f]}))}(r,o,i)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.polygon,o=this.properties.style,i=void 0===o?{}:o;return t_(t_(t_({},e),Is(n)),Is(i))},Object.defineProperty(e.prototype,"pointsPosition",{get:function(){var t=this,e=t.x,n=t.y,o=t.width,i=t.height;return this.points.map((function(t){return{x:t[0]+e-o/2,y:t[1]+n-i/2}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var o=n_(n,1)[0];o<t&&(t=o),o>e&&(e=o)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var o=n_(n,2)[1];o<t&&(t=o),o>e&&(e=o)})),e-t},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this,e=this,n=e.x,o=e.y,i=e.width,r=e.height;return e.points.map((function(e,a){var s=n_(e,2),l=s[0],u=s[1];return{x:n+l-i/2,y:o+u-r/2,id:"".concat(t.id,"_").concat(a)}}))},e.prototype.resize=function(t){var e=this,n=t.width,o=t.height,i=t.deltaX,r=t.deltaY;this.move(i/2,r/2);var a=Ju(this.points,(function(t){var i=n_(t,2),r=i[0],a=i[1];return[r*n/e.width,a*o/e.height]}));return this.points=a,this.properties.points=a,this.getData()},e_([Cm],e.prototype,"points",void 0),e_([Pm],e.prototype,"pointsPosition",null),e_([Pm],e.prototype,"width",null),e_([Pm],e.prototype,"height",null)}(Wx);var o_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),i_=function(){return i_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},i_.apply(this,arguments)},r_=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a};!function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=wy.RECT_NODE,o.radius=0,o.initNodeData(e),o.setAttributes(),o}o_(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.width,o=e.height,i=e.radius;Jc(n)||(this.width=n),Jc(o)||(this.height=o),Jc(i)||(this.radius=i)},e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,o=t.width,i=t.height;return[{x:e,y:n-i/2,id:"".concat(this.id,"_0")},{x:e+o/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+i/2,id:"".concat(this.id,"_2")},{x:e-o/2,y:n,id:"".concat(this.id,"_3")}]},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.rect,o=this.properties.style,i=void 0===o?{}:o;return i_(i_(i_({},e),Is(n)),Is(i))},r_([Cm],e.prototype,"radius",void 0)}(Wx);var a_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),s_=function(){return s_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s_.apply(this,arguments)},l_=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},u_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},c_=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))};!function(t){function e(){var e=t.apply(this,c_([],u_(arguments),!1))||this;return e.modelType=wy.TEXT_NODE,e}a_(e,t),e.prototype.getTextStyle=function(){var e=t.prototype.getTextStyle.call(this),n=this.graphModel.theme.text,o=this.properties.textStyle;return s_(s_(s_({},e),Is(n)),Is(o))},Object.defineProperty(e.prototype,"width",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return kE({rows:t,fontSize:e,rowsLength:t.length}).width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return kE({rows:t,fontSize:e,rowsLength:t.length}).height},enumerable:!1,configurable:!0}),l_([Pm],e.prototype,"width",null),l_([Pm],e.prototype,"height",null)}(Wx);var d_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();!function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=wy.HTML_NODE,o.setAttributes(),o}d_(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.width,o=e.height;n&&(this.width=n),o&&(this.height=o)},e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,o=t.width,i=t.height;return[{x:e,y:n-i/2,id:"".concat(this.id,"_0")},{x:e+o/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+i/2,id:"".concat(this.id,"_2")},{x:e-o/2,y:n,id:"".concat(this.id,"_3")}]}}(Wx);var h_=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},p_={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,textEdit:!1,nodeTextEdit:!1,edgeTextEdit:!1,textDraggable:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},f_=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustEdgeStart","adjustEdgeEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","autoExpand","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","textEdit","nodeTextEdit","edgeTextEdit","textDraggable","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","textMode","nodeTextMode","edgeTextMode","nodeTextMultiple","edgeTextMultiple","nodeTextVertical","edgeTextVertical"],g_=function(){function t(t){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopMoveGraph=!1,this.stopScrollGraph=!1,this.textMode=Ty.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!1,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=Ty.TEXT,this.edgeTextMode=Ty.TEXT,this.edgeTextEdit=!0,this.edgeTextDraggable=!1,this.edgeTextMultiple=!1,this.edgeTextVertical=!1,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.adjustNodePosition=!0,this.autoExpand=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustEdgeStart=!1,this.adjustEdgeEnd=!1,this.edgeSelectedOutline=!0,this.multipleSelectKey="",li(this,this.computeConfig(t))}return t.prototype.updateEditConfig=function(t){var e=this.computeConfig(t);li(this,e)},t.prototype.computeConfig=function(t){var e=t.isSilentMode,n=t.textDraggable,o=t.textMode,i=t.textEdit,r=t.adjustEdgeStartAndEnd,a={};if(!1===e&&li(a,this.stagedConfig),!0===e&&e!==this.isSilentMode){var s=yh(p_,f_);this.stagedConfig=yh(this,f_),li(a,s)}nd(i)||li(a,{nodeTextEdit:i,edgeTextEdit:i}),nd(n)||li(a,{nodeTextDraggable:n,edgeTextDraggable:n}),o&&li(a,{nodeTextMode:o,edgeTextMode:o}),Wc(r)&&li(a,{adjustEdgeStart:r,adjustEdgeEnd:r});var l=yh(t,f_);return li(a,l)},t.prototype.updateTextMode=function(t){this.textMode=t,this.edgeTextMode=t,this.nodeTextMode=t},t.prototype.getConfig=function(){return yh(this,f_)},h_([Cm],t.prototype,"isSilentMode",void 0),h_([Cm],t.prototype,"stopZoomGraph",void 0),h_([Cm],t.prototype,"stopMoveGraph",void 0),h_([Cm],t.prototype,"stopScrollGraph",void 0),h_([Cm],t.prototype,"textMode",void 0),h_([Cm],t.prototype,"textEdit",void 0),h_([Cm],t.prototype,"textDraggable",void 0),h_([Cm],t.prototype,"nodeTextEdit",void 0),h_([Cm],t.prototype,"nodeTextDraggable",void 0),h_([Cm],t.prototype,"nodeTextMultiple",void 0),h_([Cm],t.prototype,"nodeTextVertical",void 0),h_([Cm],t.prototype,"nodeTextMode",void 0),h_([Cm],t.prototype,"edgeTextMode",void 0),h_([Cm],t.prototype,"edgeTextEdit",void 0),h_([Cm],t.prototype,"edgeTextDraggable",void 0),h_([Cm],t.prototype,"edgeTextMultiple",void 0),h_([Cm],t.prototype,"edgeTextVertical",void 0),h_([Cm],t.prototype,"hideAnchors",void 0),h_([Cm],t.prototype,"allowRotate",void 0),h_([Cm],t.prototype,"allowResize",void 0),h_([Cm],t.prototype,"hoverOutline",void 0),h_([Cm],t.prototype,"nodeSelectedOutline",void 0),h_([Cm],t.prototype,"adjustNodePosition",void 0),h_([Cm],t.prototype,"autoExpand",void 0),h_([Cm],t.prototype,"adjustEdge",void 0),h_([Cm],t.prototype,"adjustEdgeMiddle",void 0),h_([Cm],t.prototype,"adjustEdgeStartAndEnd",void 0),h_([Cm],t.prototype,"adjustEdgeStart",void 0),h_([Cm],t.prototype,"adjustEdgeEnd",void 0),h_([Cm],t.prototype,"edgeSelectedOutline",void 0),h_([wb],t.prototype,"updateEditConfig",null),h_([wb],t.prototype,"updateTextMode",null),t}(),v_=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){var o=this;null==t||t.split(",").forEach((function(t){t=t.trim(),o._events[t]||(o._events[t]=[]),o._events[t].push({callback:e,once:!!n})}))},t.prototype.once=function(t,e){var n=this;null==t||t.split(",").forEach((function(t){t=t.trim(),n.on(t,e,!0)}))},t.prototype.emit=function(t,e){var n=this;null==t||t.split(",").forEach((function(t){var o=n._events[t]||[],i=n._events["*"]||[],r=function(o){for(var i=o.length,r=0;r<i;r++)if(o[r]){var a=o[r],s=a.callback;a.once&&(o.splice(r,1),0===o.length&&delete n._events[t],i--,r--),s.apply(n,[e])}};r(o),r(i)}))},t.prototype.off=function(t,e){var n=this;t||(this._events={}),t.split(",").forEach((function(t){if(e){for(var o=n._events[t]||[],i=o.length,r=0;r<i;r++)o[r].callback===e&&(o.splice(r,1),i--,r--);0===o.length&&delete n._events[t]}else delete n._events[t]}))},t.prototype.getEvents=function(){return this._events},t}(),y_=function(){return y_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},y_.apply(this,arguments)},m_=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},b_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},x_=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))};!function(){function t(t){this.modelMap=new Map,this.nodeModelMap=new Map,this.edgeModelMap=new Map,this.elementsModelMap=new Map,this.nodeMoveRules=[],this.nodes=[],this.edges=[],this.overlapMode=Cy.DEFAULT,this.gridSize=1,this.partial=!1;var e,n=t.container,o=t.partial,i=t.background,r=void 0===i?{}:i,a=t.grid,s=t.idGenerator,l=t.edgeGenerator,u=t.animation,c=t.customTrajectory;this.rootEl=n,this.partial=!!o,this.background=r,"object"==typeof a&&(this.gridSize=a.size||1),this.theme=tw(t.style),this.edgeType=t.edgeType||"polyline",this.animation=(e=u)&&"boolean"!=typeof e?md(Is(My),e):Is(!0===e?Oy:My),this.overlapMode=t.overlapMode||Cy.DEFAULT,this.width=t.width||this.rootEl.getBoundingClientRect().width,this.height=t.height||this.rootEl.getBoundingClientRect().height,this.eventCenter=new v_,this.editConfigModel=new g_(t),this.transformModel=new N_(this.eventCenter,t),this.flowId=JE(),this.idGenerator=s,this.edgeGenerator=function(t,e){if("function"!=typeof e)return function(e,n,o){return Object.assign({type:t.edgeType},o)};return function(n,o,i){var r=e(n,o,i);return r?"string"==typeof r?Object.assign({},i,{type:r}):Object.assign({type:r},i):{type:t.edgeType}}}(this,l),this.customTrajectory=c}Object.defineProperty(t.prototype,"nodesMap",{get:function(){return this.nodes.reduce((function(t,e,n){return t[e.id]={index:n,model:e},t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgesMap",{get:function(){return this.edges.reduce((function(t,e,n){return t[e.id]={index:n,model:e},t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"modelsMap",{get:function(){return x_(x_([],b_(this.nodes),!1),b_(this.edges),!1).reduce((function(t,e){return t[e.id]=e,t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sortElements",{get:function(){for(var t=x_(x_([],b_(this.nodes),!1),b_(this.edges),!1).sort((function(t,e){return t.zIndex-e.zIndex})),e=[],n=[-200,-200],o=[this.width+Ay,this.height+Ay],i=0;i<t.length;i++){var r=t[i];r.visible&&(!this.partial||r.isSelected||this.isElementInArea(r,n,o,!1,!1))&&e.push(r)}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textEditElement",{get:function(){var t=this.nodes.find((function(t){return t.state===_y.TEXT_EDIT})),e=this.edges.find((function(t){return t.state===_y.TEXT_EDIT}));return t||e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectElements",{get:function(){var t=new Map;return this.nodes.forEach((function(e){e.isSelected&&t.set(e.id,e)})),this.edges.forEach((function(e){e.isSelected&&t.set(e.id,e)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectNodes",{get:function(){var t=[];return this.nodes.forEach((function(e){e.isSelected&&t.push(e)})),t},enumerable:!1,configurable:!0}),t.prototype.getAreaElement=function(t,e,n,o,i){var r=this;void 0===n&&(n=!0),void 0===o&&(o=!0),void 0===i&&(i=!1);var a=[];return xu(x_(x_([],b_(this.nodes),!1),b_(this.edges),!1),(function(s){var l=r.isElementInArea(s,t,e,n,o);i&&!s.visible||!l||a.push(s)})),a},t.prototype.getModel=function(t){return this.modelMap.get(t)},t.prototype.getNodeModelById=function(t){var e;return this.fakeNode&&t===this.fakeNode.id?this.fakeNode:null===(e=this.nodesMap[t])||void 0===e?void 0:e.model},t.prototype.getPointByClient=function(t){var e=t.x,n=t.y,o=this.rootEl.getBoundingClientRect(),i={x:e-o.left,y:n-o.top},r=b_(this.transformModel.HtmlPointToCanvasPoint([i.x,i.y]),2);return{domOverlayPosition:i,canvasOverlayPosition:{x:r[0],y:r[1]}}},t.prototype.isElementInArea=function(t,e,n,o,i){var r;if(void 0===o&&(o=!0),void 0===i&&(i=!0),t.BaseType===Ey.NODE){for(var a=SE(t),s=a.minX,l=a.minY,u=a.maxX,c=a.maxY,d=[{x:s,y:l},{x:u,y:l},{x:u,y:c},{x:s,y:c}],h=i,p=0;p<d.length;p++){var f=d[p],g=f.x,v=f.y;if(g=(r=b_(this.transformModel.CanvasPointToHtmlPoint([g,v]),2))[0],v=r[1],aE([g,v],e,n)!==i){h=!i;break}}return h}if(t.BaseType===Ey.EDGE){var y=t.startPoint,m=t.endPoint,b=this.transformModel.CanvasPointToHtmlPoint([y.x,y.y]),x=this.transformModel.CanvasPointToHtmlPoint([m.x,m.y]),_=aE(b,e,n),E=aE(x,e,n);return o?_&&E:_||E}return!1},t.prototype.graphDataToModel=function(t){var e=this;if(this.width&&this.height||this.resize(),!t)return this.nodes=[],void(this.edges=[]);if(t.nodes?this.nodes=Ju(t.nodes,(function(t){return e.getModelAfterSnapToGrid(t)})):this.nodes=[],t.edges){var n=this.edgeType;this.edges=Ju(t.edges,(function(t){var o,i=e.getModel(null!==(o=t.type)&&void 0!==o?o:n);if(!i)throw new Error("找不到".concat(t.type,"对应的边。"));var r=new i(t,e);return e.edgeModelMap.set(r.id,r),e.elementsModelMap.set(r.id,r),r}))}else this.edges=[]},t.prototype.modelToGraphData=function(){var t=[];this.edges.forEach((function(e){var n=e.getData();n&&!e.virtual&&t.push(n)}));var e=[];return this.nodes.forEach((function(t){var n=t.getData();n&&!t.virtual&&e.push(n)})),{nodes:e,edges:t}},t.prototype.modelToHistoryData=function(){for(var t=!1,e=[],n=0;n<this.nodes.length;n++){var o=this.nodes[n];if(o.isDragging){t=!0;break}e.push(o.getHistoryData())}if(t)return!1;for(var i=!1,r=[],a=0;a<this.edges.length;a++){var s=this.edges[a];if(s.isDragging){i=!0;break}r.push(s.getHistoryData())}return!i&&{nodes:e,edges:r}},t.prototype.getEdgeModelById=function(t){var e;return null===(e=this.edgesMap[t])||void 0===e?void 0:e.model},t.prototype.getElement=function(t){return this.modelsMap[t]},t.prototype.getNodeEdges=function(t){for(var e=[],n=0;n<this.edges.length;n++){var o=this.edges[n],i=o.sourceNodeId===t,r=o.targetNodeId===t;(i||r)&&e.push(o)}return e},t.prototype.getSelectElements=function(t){void 0===t&&(t=!0);var e=this.selectElements,n={nodes:[],edges:[]};return e.forEach((function(o){if(o.BaseType===Ey.NODE&&n.nodes.push(o.getData()),o.BaseType===Ey.EDGE){var i=o.getData(),r=e.get(i.sourceNodeId)&&e.get(i.targetNodeId);(t||r)&&n.edges.push(i)}})),n},t.prototype.updateAttributes=function(t,e){var n=this.getElement(t);null==n||n.updateAttributes(e)},t.prototype.changeNodeId=function(t,e){return e||(e=JE()),this.nodesMap[e]?"":this.nodesMap[t]?(this.edges.forEach((function(n){n.sourceNodeId===t&&(n.sourceNodeId=e),n.targetNodeId===t&&(n.targetNodeId=e)})),this.nodesMap[t].model.id=e,this.nodesMap[e]=this.nodesMap[t],e):""},t.prototype.changeEdgeId=function(t,e){return e||(e=JE()),this.edgesMap[e]?"":this.edgesMap[t]?(this.edges.forEach((function(n){n.id===t&&n.changeEdgeId(e)})),e):""},t.prototype.getTextModel=function(t){var e=this.editConfigModel,n=e.textMode,o=e.nodeTextMode,i=e.edgeTextMode;return t.BaseType===Ey.NODE?t.textMode||o||n||Ty.TEXT:t.BaseType===Ey.EDGE?t.textMode||i||n||Ty.TEXT:void 0},t.prototype.setTextMode=function(t,e){this.editConfigModel.updateEditConfig({textMode:t})},t.prototype.setFakeNode=function(t){this.fakeNode=t},t.prototype.removeFakeNode=function(){this.fakeNode=null},t.prototype.setModel=function(t,e){return this.modelMap.set(t,e)},t.prototype.toFront=function(t){var e,n,o,i=(null===(e=this.nodesMap[t])||void 0===e?void 0:e.model)||(null===(n=this.edgesMap[t])||void 0===n?void 0:n.model);i&&(this.overlapMode===Cy.DEFAULT&&(null===(o=this.topElement)||void 0===o||o.setZIndex(),i.setZIndex(9999),this.topElement=i),this.overlapMode===Cy.INCREASE&&this.setElementZIndex(t,"top"))},t.prototype.setElementZIndex=function(t,e){var n,o,i=(null===(n=this.nodesMap[t])||void 0===n?void 0:n.model)||(null===(o=this.edgesMap[t])||void 0===o?void 0:o.model);if(i){var r=void 0;"number"==typeof e?r=e:("top"===e&&(r=iw()),"bottom"===e&&(r=rw())),i.setZIndex(r)}},t.prototype.deleteNode=function(t){var e=this.nodesMap[t].model.getData();this.deleteEdgeBySource(t),this.deleteEdgeByTarget(t),this.nodes.splice(this.nodesMap[t].index,1),this.eventCenter.emit(Sy.NODE_DELETE,{data:e})},t.prototype.addNode=function(t,e,n){void 0===e&&(e=Sy.NODE_ADD);var o=Py(t),i=o.id;i&&this.nodesMap[i]&&delete o.id;var r=this.getModelAfterSnapToGrid(o);this.nodes.push(r);var a={data:r.getData()};return n&&(a.e=n),this.eventCenter.emit(e,a),r},t.prototype.getModelAfterSnapToGrid=function(t){var e=this.getModel(t.type);if(!e)throw new Error("找不到".concat(t.type,"对应的节点,请确认是否已注册此类型节点。"));var n=t.x,o=t.y;n&&o&&(t.x=iE(n,this.gridSize),t.y=iE(o,this.gridSize),"object"==typeof t.text&&null!==t.text&&(t.text.x+=t.x-n,t.text.y+=t.y-o));var i=new e(t,this);return this.nodeModelMap.set(i.id,i),this.elementsModelMap.set(i.id,i),i},t.prototype.cloneNode=function(t){var e=this.getNodeModelById(t),n=null==e?void 0:e.getData();if(n){n.x+=30,n.y+=30,n.id="","object"==typeof n.text&&null!==n.text&&(n.text.x+=30,n.text.y+=30);var o=this.addNode(n);return o.setSelected(!0),null==e||e.setSelected(!1),o.getData()}},t.prototype.moveNode=function(t,e,n,o){var i;void 0===o&&(o=!1);var r=this.nodesMap[t];if(r){var a=r.model;e=(i=b_(a.getMoveDistance(e,n,o),2))[0],n=i[1],this.moveEdge(t,e,n)}},t.prototype.moveNode2Coordinate=function(t,e,n,o){void 0===o&&(o=!1);var i=this.nodesMap[t];if(i){var r=i.model,a=e-r.x,s=n-r.y;this.moveNode(t,a,s,o)}},t.prototype.editText=function(t){this.setElementStateById(t,_y.TEXT_EDIT)},t.prototype.addEdge=function(t){var e=Py(t),n=e.type;n||(n=this.edgeType),e.id&&this.edgesMap[e.id]&&delete e.id;var o=this.getModel(n);if(!o)throw new Error("找不到".concat(n,"对应的边,请确认是否已注册此类型边。"));var i=new o(y_(y_({},e),{type:n}),this);this.edgeModelMap.set(i.id,i),this.elementsModelMap.set(i.id,i);var r=i.getData();return this.edges.push(i),this.eventCenter.emit(Sy.EDGE_ADD,{data:r}),i},t.prototype.moveEdge=function(t,e,n){for(var o=0;o<this.edges.length;o++){var i=this.edges[o],r=i.textPosition,a=r.x,s=r.y,l=this.edges[o].sourceNodeId===t,u=this.edges[o].targetNodeId===t;l&&i.moveStartPoint(e,n),u&&i.moveEndPoint(e,n),(l||u)&&this.handleEdgeTextMove(i,a,s)}},t.prototype.handleEdgeTextMove=function(t,e,n){var o;if(t.customTextPosition)t.resetTextPosition();else{if(t.modelType===wy.POLYLINE_EDGE&&(null===(o=t.text)||void 0===o?void 0:o.value)){var i=t.text,r=Q_(i,t.points);t.moveText(r.x-i.x,r.y-i.y)}var a=t.textPosition,s=a.x,l=a.y;t.moveText(s-e,l-n)}},t.prototype.deleteEdgeBySourceAndTarget=function(t,e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].sourceNodeId===t&&this.edges[n].targetNodeId===e){var o=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(Sy.EDGE_DELETE,{data:o})}},t.prototype.deleteEdgeById=function(t){if(this.edgesMap[t]){var e=this.edgesMap[t].index,n=this.edgesMap[t].model.getData();this.edges.splice(e,1),this.eventCenter.emit(Sy.EDGE_DELETE,{data:n})}},t.prototype.deleteEdgeBySource=function(t){for(var e=0;e<this.edges.length;e++)if(this.edges[e].sourceNodeId===t){var n=this.edges[e].getData();this.edges.splice(e,1),e--,this.eventCenter.emit(Sy.EDGE_DELETE,{data:n})}},t.prototype.deleteEdgeByTarget=function(t){for(var e=0;e<this.edges.length;e++)if(this.edges[e].targetNodeId===t){var n=this.edges[e].getData();this.edges.splice(e,1),e--,this.eventCenter.emit(Sy.EDGE_DELETE,{data:n})}},t.prototype.setElementStateById=function(t,e,n){this.nodes.forEach((function(o){o.id===t?o.setElementState(e,n):o.setElementState(_y.DEFAULT)})),this.edges.forEach((function(o){o.id===t?o.setElementState(e,n):o.setElementState(_y.DEFAULT)}))},t.prototype.updateText=function(t,e){var n=Uu(x_(x_([],b_(this.nodes),!1),b_(this.edges),!1),(function(e){return e.id===t}));null==n||n.updateText(e)},t.prototype.selectNodeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var o=null===(n=this.nodesMap[t])||void 0===n?void 0:n.model;null==o||o.setSelected(!0)},t.prototype.selectEdgeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var o=null===(n=this.edgesMap[t])||void 0===n?void 0:n.model;null==o||o.setSelected(!0)},t.prototype.selectElementById=function(t,e){void 0===e&&(e=!1),e||this.clearSelectElements();var n=this.getElement(t);null==n||n.setSelected(!0)},t.prototype.clearSelectElements=function(){var t;this.selectElements.forEach((function(t){null==t||t.setSelected(!1)})),this.selectElements.clear(),this.overlapMode===Cy.DEFAULT&&(null===(t=this.topElement)||void 0===t||t.setZIndex())},t.prototype.moveNodes=function(t,e,n,o){var i,r,a,s=this;void 0===o&&(o=!1);for(var l=t.reduce((function(t,i){var r,a=null===(r=s.nodesMap[i])||void 0===r?void 0:r.model;return a&&(t[i]=a.getMoveDistance(e,n,o)),t}),{}),u=0;u<this.edges.length;u++){var c=this.edges[u],d=c.textPosition,h=d.x,p=d.y,f=l[c.sourceNodeId],g=l[c.targetNodeId],v=void 0,y=void 0;f&&g&&c.modelType===wy.POLYLINE_EDGE?(v=(i=b_(f,2))[0],y=i[1],c.updatePointsList(v,y)):(f&&(v=(r=b_(f,2))[0],y=r[1],c.moveStartPoint(v,y)),g&&(v=(a=b_(g,2))[0],y=a[1],c.moveEndPoint(v,y))),(f||g)&&this.handleEdgeTextMove(c,h,p)}},t.prototype.addNodeMoveRules=function(t){this.nodeMoveRules.includes(t)||this.nodeMoveRules.push(t)},t.prototype.setDefaultEdgeType=function(t){this.edgeType=t},t.prototype.changeNodeType=function(t,e){var n=this.getNodeModelById(t);if(n){var o=n.getData();o.type=e;var i=this.getModel(e);if(!i)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));var r=new i(o,this);this.nodes.splice(this.nodesMap[t].index,1,r),this.getNodeEdges(t).forEach((function(e){if(e.sourceNodeId===t){var n=PE(r,e.startPoint,r.width,r.height);e.updateStartPoint(n)}if(e.targetNodeId===t){n=PE(r,e.endPoint,r.width,r.height);e.updateEndPoint(n)}}))}},t.prototype.changeEdgeType=function(t,e){var n=this.getEdgeModelById(t);if(n&&n.type!==e){var o=n.getData();o.type=e;var i=this.getModel(e);if(!i)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));delete o.pointsList;var r=new i(o,this);this.edges.splice(this.edgesMap[t].index,1,r)}},t.prototype.getNodeIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetNodeId===t&&e.push(n)})),e},t.prototype.getNodeOutgoingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceNodeId===t&&e.push(n)})),e},t.prototype.getAnchorIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetAnchorId===t&&e.push(n)})),e},t.prototype.getAnchorOutgoingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceAnchorId===t&&e.push(n)})),e},t.prototype.getNodeIncomingNode=function(t){var e=this,n=[];return this.edges.forEach((function(o){var i;o.targetNodeId===t&&n.push(null===(i=e.nodesMap[o.sourceNodeId])||void 0===i?void 0:i.model)})),n},t.prototype.getNodeOutgoingNode=function(t){var e=this,n=[];return this.edges.forEach((function(o){o.sourceNodeId===t&&n.push(e.nodesMap[o.targetNodeId].model)})),n},t.prototype.setTheme=function(t){this.theme=ew(y_(y_({},this.theme),t))},t.prototype.resize=function(t,e){this.width=t||this.rootEl.getBoundingClientRect().width,this.height=e||this.rootEl.getBoundingClientRect().height,!this.width||this.height},t.prototype.clearData=function(){this.nodes=[],this.edges=[]},t.prototype.getVirtualRectSize=function(){var t=this.nodes,e=[],n=[];t.forEach((function(t){var o=t.x,i=t.y,r=t.width,a=t.height,s=t.getNodeStyle().strokeWidth,l=void 0===s?0:s,u=o+r/2+l,c=o-r/2-l,d=i+a/2+l,h=i-a/2-l;e=e.concat([u,c].filter((function(t){return!Number.isNaN(t)}))),n=n.concat([d,h].filter((function(t){return!Number.isNaN(t)})))}));var o=Math.min.apply(Math,x_([],b_(e),!1)),i=Math.max.apply(Math,x_([],b_(e),!1)),r=Math.min.apply(Math,x_([],b_(n),!1)),a=i-o||0,s=Math.max.apply(Math,x_([],b_(n),!1))-r||0;return{width:a,height:s,x:o+a/2,y:r+s/2}},t.prototype.translateCenter=function(){var t=this,e=t.nodes,n=t.width,o=t.height,i=t.rootEl,r=t.transformModel;if(e.length){var a=n||i.clientWidth,s=o||i.clientHeight,l=this.getVirtualRectSize(),u=l.x,c=l.y;r.focusOn(u,c,a,s)}},t.prototype.fitView=function(t,e){void 0===t&&(t=20),void 0===e&&(e=20);var n=this,o=n.nodes,i=n.width,r=n.height,a=n.rootEl,s=n.transformModel;if(o.length){var l=i||a.clientWidth,u=r||a.clientHeight,c=this.getVirtualRectSize(),d=c.width,h=c.height,p=c.x,f=c.y,g=(d+e)/l,v=(h+t)/u,y=1/Math.max(g,v),m=[l/2,u/2];s.zoom(y,m),s.focusOn(p,f,l,u)}},t.prototype.openEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.openEdgeAnimation()},t.prototype.closeEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.closeEdgeAnimation()},t.prototype.getPartial=function(){return this.partial},t.prototype.setPartial=function(t){this.partial=t},m_([Cm],t.prototype,"width",void 0),m_([Cm],t.prototype,"height",void 0),m_([Cm],t.prototype,"edgeType",void 0),m_([Cm],t.prototype,"nodes",void 0),m_([Cm],t.prototype,"edges",void 0),m_([Cm],t.prototype,"fakeNode",void 0),m_([Cm],t.prototype,"overlapMode",void 0),m_([Cm],t.prototype,"background",void 0),m_([Cm],t.prototype,"gridSize",void 0),m_([Cm],t.prototype,"transformModel",void 0),m_([Cm],t.prototype,"editConfigModel",void 0),m_([Cm],t.prototype,"partial",void 0),m_([Pm],t.prototype,"nodesMap",null),m_([Pm],t.prototype,"edgesMap",null),m_([Pm],t.prototype,"modelsMap",null),m_([Pm],t.prototype,"sortElements",null),m_([Pm],t.prototype,"textEditElement",null),m_([Pm],t.prototype,"selectElements",null),m_([Pm],t.prototype,"selectNodes",null),m_([wb],t.prototype,"setTextMode",null),m_([wb],t.prototype,"setFakeNode",null),m_([wb],t.prototype,"removeFakeNode",null),m_([wb],t.prototype,"setModel",null),m_([wb],t.prototype,"toFront",null),m_([wb],t.prototype,"setElementZIndex",null),m_([wb],t.prototype,"deleteNode",null),m_([wb],t.prototype,"addNode",null),m_([wb],t.prototype,"cloneNode",null),m_([wb],t.prototype,"moveNode",null),m_([wb],t.prototype,"moveNode2Coordinate",null),m_([wb],t.prototype,"editText",null),m_([wb],t.prototype,"addEdge",null),m_([wb],t.prototype,"moveEdge",null),m_([wb],t.prototype,"deleteEdgeBySourceAndTarget",null),m_([wb],t.prototype,"deleteEdgeById",null),m_([wb],t.prototype,"deleteEdgeBySource",null),m_([wb],t.prototype,"deleteEdgeByTarget",null),m_([wb],t.prototype,"setElementStateById",null),m_([wb],t.prototype,"updateText",null),m_([wb],t.prototype,"selectNodeById",null),m_([wb],t.prototype,"selectEdgeById",null),m_([wb],t.prototype,"selectElementById",null),m_([wb],t.prototype,"clearSelectElements",null),m_([wb],t.prototype,"moveNodes",null),m_([wb],t.prototype,"setDefaultEdgeType",null),m_([wb],t.prototype,"changeNodeType",null),m_([wb],t.prototype,"changeEdgeType",null),m_([wb],t.prototype,"getNodeIncomingEdge",null),m_([wb],t.prototype,"getNodeOutgoingEdge",null),m_([wb],t.prototype,"getAnchorIncomingEdge",null),m_([wb],t.prototype,"getAnchorOutgoingEdge",null),m_([wb],t.prototype,"getNodeIncomingNode",null),m_([wb],t.prototype,"getNodeOutgoingNode",null),m_([wb],t.prototype,"setTheme",null),m_([wb],t.prototype,"resize",null),m_([wb],t.prototype,"clearData",null),m_([wb],t.prototype,"translateCenter",null),m_([wb],t.prototype,"fitView",null),m_([wb],t.prototype,"openEdgeAnimation",null),m_([wb],t.prototype,"closeEdgeAnimation",null),m_([wb],t.prototype,"setPartial",null)}();var __=function(){return __=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},__.apply(this,arguments)},E_=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a};!function(){function t(t){this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=t}t.prototype.getStyle=function(){return __({},this.graphModel.theme.snapline)},t.prototype.getCenterSnapLine=function(t,e){for(var n=t.x,o=t.y,i=!1,r=!1,a=0;a<e.length;a++){var s=e[a];if(s.id!==t.id&&(n===s.x&&(i=!0),o===s.y&&(r=!0),i&&r))break}return{isShowVertical:i,isShowHorizontal:r,position:{x:n,y:o}}},t.prototype.getHorizontalSnapline=function(t,e){var n,o=!1,i=0,r=t.id;if(r){var a=this.graphModel.fakeNode;if(a&&a.id===r)n=SE(a);else{var s=this.graphModel.getNodeModelById(r);s&&(n=SE(s))}}for(var l=0;l<e.length;l++){var u=e[l];if(u.id!==t.id){var c=SE(u);if(c.minY===(null==n?void 0:n.minY)||c.maxY===(null==n?void 0:n.minY)){o=!0,i=n.minY;break}if(c.minY===(null==n?void 0:n.maxY)||c.maxY===(null==n?void 0:n.maxY)){o=!0,i=n.maxY;break}}}return{isShowHorizontal:o,isShowVertical:this.isShowVertical,position:__(__({},this.position),{y:i})}},t.prototype.getVerticalSnapline=function(t,e){var n,o=!1,i=0,r=t.id;if(r){var a=this.graphModel.fakeNode;if(a&&a.id===r)n=SE(a);else{var s=this.graphModel.getNodeModelById(r);s&&(n=SE(s))}}for(var l=0;l<e.length;l++){var u=e[l];if(u.id!==t.id){var c=SE(u);if(c.minX===(null==n?void 0:n.minX)||c.maxX===(null==n?void 0:n.minX)){o=!0,i=n.minX;break}if(c.minX===(null==n?void 0:n.maxX)||c.maxX===(null==n?void 0:n.maxX)){o=!0,i=n.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:o,position:__(__({},this.position),{x:i})}},t.prototype.getSnapLinePosition=function(t,e){var n=this.getCenterSnapLine(t,e),o=n.isShowHorizontal,i=n.isShowVertical;if(!o){var r=this.getHorizontalSnapline(t,e);r.isShowHorizontal&&(n.isShowHorizontal=r.isShowHorizontal,n.position.y=r.position.y)}if(!i){var a=this.getVerticalSnapline(t,e);a.isShowVertical&&(n.isShowVertical=a.isShowVertical,n.position.x=a.position.x)}return n},t.prototype.setSnaplineInfo=function(t){var e=t.isShowHorizontal,n=t.isShowVertical,o=t.position;this.position=o,this.isShowHorizontal=e,this.isShowVertical=n},t.prototype.clearSnapline=function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1},t.prototype.setNodeSnapLine=function(t){var e=this.graphModel.nodes,n=this.getSnapLinePosition(t,e);this.setSnaplineInfo(n)},E_([Cm],t.prototype,"isShowHorizontal",void 0),E_([Cm],t.prototype,"isShowVertical",void 0),E_([Cm],t.prototype,"position",void 0),E_([wb],t.prototype,"clearSnapline",null),E_([wb],t.prototype,"setNodeSnapLine",null)}();var w_=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},S_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},C_={false:[-1/0,-1/0,1/0,1/0],true:[-1/0,-1/0,1/0,1/0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},N_=function(){function t(t,e){this.MINI_SCALE_SIZE=.2,this.MAX_SCALE_SIZE=16,this.SCALE_X=1,this.SKEW_Y=0,this.SKEW_X=0,this.SCALE_Y=1,this.TRANSLATE_X=0,this.TRANSLATE_Y=0,this.ZOOM_SIZE=.04,this.translateLimitMinX=-1/0,this.translateLimitMinY=-1/0,this.translateLimitMaxX=1/0,this.translateLimitMaxY=1/0,this.eventCenter=t;var n=e.stopMoveGraph,o=void 0!==n&&n;this.updateTranslateLimits(o)}return t.prototype.setZoomMiniSize=function(t){this.MINI_SCALE_SIZE=t},t.prototype.setZoomMaxSize=function(t){this.MAX_SCALE_SIZE=t},t.prototype.HtmlPointToCanvasPoint=function(t){var e=S_(t,2),n=e[0],o=e[1];return[(n-this.TRANSLATE_X)/this.SCALE_X,(o-this.TRANSLATE_Y)/this.SCALE_Y]},t.prototype.CanvasPointToHtmlPoint=function(t){var e=S_(t,2),n=e[0],o=e[1];return[n*this.SCALE_X+this.TRANSLATE_X,o*this.SCALE_Y+this.TRANSLATE_Y]},t.prototype.moveCanvasPointByHtml=function(t,e,n){var o=S_(t,2),i=o[0],r=o[1];return[i+e/this.SCALE_X,r+n/this.SCALE_Y]},t.prototype.fixDeltaXY=function(t,e){return[t/this.SCALE_X,e/this.SCALE_Y]},t.prototype.getTransformStyle=function(){var t=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(t,")")}},t.prototype.zoom=function(t,e){void 0===t&&(t=!1);var n=this.SCALE_X,o=this.SCALE_Y;return"number"==typeof t?(n=t,o=t):t?(n+=this.ZOOM_SIZE,o+=this.ZOOM_SIZE):(n-=this.ZOOM_SIZE,o-=this.ZOOM_SIZE),n<this.MINI_SCALE_SIZE||n>this.MAX_SCALE_SIZE||(e&&(this.TRANSLATE_X-=(n-this.SCALE_X)*e[0],this.TRANSLATE_Y-=(o-this.SCALE_Y)*e[1]),this.SCALE_X=n,this.SCALE_Y=o,this.emitGraphTransform("zoom")),"".concat(100*this.SCALE_X,"%")},t.prototype.emitGraphTransform=function(t){this.eventCenter.emit(Sy.GRAPH_TRANSFORM,{type:t,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},t.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},t.prototype.translate=function(t,e){this.TRANSLATE_X+t<=this.translateLimitMaxX&&this.TRANSLATE_X+t>=this.translateLimitMinX&&(this.TRANSLATE_X+=t),this.TRANSLATE_Y+e<=this.translateLimitMaxY&&this.TRANSLATE_Y+e>=this.translateLimitMinY&&(this.TRANSLATE_Y+=e),this.emitGraphTransform("translate")},t.prototype.focusOn=function(t,e,n,o){var i=S_(this.CanvasPointToHtmlPoint([t,e]),2),r=i[0],a=i[1],s=S_([n/2-r,o/2-a],2),l=s[0],u=s[1];this.TRANSLATE_X+=l,this.TRANSLATE_Y+=u,this.emitGraphTransform("focusOn")},t.prototype.updateTranslateLimits=function(t){var e;e=S_(Array.isArray(t)&&4===t.length?t:C_[t.toString()],4),this.translateLimitMinX=e[0],this.translateLimitMinY=e[1],this.translateLimitMaxX=e[2],this.translateLimitMaxY=e[3]},w_([Cm],t.prototype,"SCALE_X",void 0),w_([Cm],t.prototype,"SKEW_Y",void 0),w_([Cm],t.prototype,"SKEW_X",void 0),w_([Cm],t.prototype,"SCALE_Y",void 0),w_([Cm],t.prototype,"TRANSLATE_X",void 0),w_([Cm],t.prototype,"TRANSLATE_Y",void 0),w_([Cm],t.prototype,"ZOOM_SIZE",void 0),w_([wb],t.prototype,"zoom",null),w_([wb],t.prototype,"resetZoom",null),w_([wb],t.prototype,"translate",null),w_([wb],t.prototype,"focusOn",null),t}(),T_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},A_=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))},M_=function(t){var e=[],n={};return t.forEach((function(t){var e="".concat(t.x,"-").concat(t.y);t.id=e,n[e]=t})),Object.keys(n).forEach((function(t){e.push(n[t])})),e},O_=function(t,e){return 0===t.width&&0===t.height?t:{x:t.x,y:t.y,centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}},P_=function(t,e,n){var o=function(t,e){var n=Math.abs(t.x-e.centerX),o=Math.abs(t.y-e.centerY);return n/e.width>o/e.height?Ny.HORIZONTAL:Ny.VERTICAL}(n,e);return o===Ny.HORIZONTAL?{x:n.x>t.centerX?t.maxX:t.minX,y:n.y}:{x:n.x,y:n.y>t.centerY?t.maxY:t.minY}},k_=function(t,e){var n=Math.min(t.minX,e.minX),o=Math.min(t.minY,e.minY),i=Math.max(t.maxX,e.maxX),r=Math.max(t.maxY,e.maxY);return{x:(n+i)/2,y:(o+r)/2,centerX:(n+i)/2,centerY:(o+r)/2,minX:n,minY:o,maxX:i,maxY:r,height:r-o,width:i-n}},R_=function(t){var e=t.minX,n=t.minY,o=t.maxX,i=t.maxY;return[{x:e,y:n},{x:o,y:n},{x:o,y:i},{x:e,y:i}]},D_=function(t,e){var n=t.x,o=t.y;return n<e.minX||n>e.maxX||o<e.minY||o>e.maxY},L_=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},I_=function(t,e,n,o,i){return L_(t,e)+L_(t,n)+function(t,e){var n=0;return e.forEach((function(e){e&&(t.x===e.x&&(n+=-2),t.y===e.y&&(n+=-2))})),n}(t,[e,n,o,i])},j_=function(t,e,n,o,i){i||(i=0),t.unshift(e[o]),n[o]&&n[o]!==o&&i<=100&&j_(t,e,n,n[o],i+1)},B_=function(t,e,n,o){var i=e.x-t.x,r=e.y-t.y,a=o.x-n.x,s=o.y-n.y,l=(-r*(t.x-n.x)+i*(t.y-n.y))/(-a*r+i*s),u=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*r+i*s);return l>=0&&l<=1&&u>=0&&u<=1},H_=function(t,e,n){if(0===n.width&&0===n.height)return!1;var o=T_(R_(n),4),i=o[0],r=o[1],a=o[2],s=o[3];return B_(t,e,i,r)||B_(t,e,i,s)||B_(t,e,r,a)||B_(t,e,a,s)},F_=function(t,e,n,o,i,r,a){var s=[],l=[e],u={},c={},d={};e.id&&(c[e.id]=0,d[e.id]=I_(e,n,e));var h={};t.forEach((function(t){t.id&&(h[t.id]=t)}));for(var p=function(){var p,f,g,v,y=1/0;if(l.forEach((function(t){t.id&&d[t.id]<y&&(y=d[t.id],p=t)})),p===n&&n.id){var m=[];return j_(m,h,u,n.id),{value:m}}if(!p)return{value:[e,n]};g=p,(v=(f=l).indexOf(g))>-1&&f.splice(v,1),s.push(p),function(t,e,n,o){var i=[];return t.forEach((function(t){t!==e&&(t.x!==e.x&&t.y!==e.y||H_(t,e,n)||H_(t,e,o)||i.push(t))})),M_(i)}(t,p,o,i).forEach((function(t){if(-1===s.indexOf(t)&&(-1===l.indexOf(t)&&l.push(t),(null==p?void 0:p.id)&&(null==t?void 0:t.id))){var o=d[p.id]+L_(p,t);if(c[t.id]&&o>=c[t.id])return;u[t.id]=p.id,c[t.id]=o,d[t.id]=c[t.id]+I_(t,n,e,r,a)}}))};l.length;){var f=p();if("object"==typeof f)return f.value}return[e,n]},z_=function(t){return SE(t)},W_=function(t){for(var e=1;e<t.length-1;){var n=t[e-1],o=t[e],i=t[e+1];n.x===o.x&&o.x===i.x||n.y===o.y&&o.y===i.y?t.splice(e,1):e++}return t},G_=function(t,e,n,o,i){var r,a,s=z_(n),l=z_(o),u=O_(s,i),c=O_(l,i),d=P_(u,s,t),h=P_(c,l,e);if(r=u,a=c,2*Math.abs(r.centerX-a.centerX)<r.width+a.width&&2*Math.abs(r.centerY-a.centerY)<r.height+a.height){var p=Z_(t,e,d,h);return A_(A_([t,d],T_(p),!1),[h,e],!1)}var f=function(t){void 0===t&&(t=[]);var e=[],n=[];t.forEach((function(t){e.push(t.x),n.push(t.y)}));var o=Math.min.apply(Math,A_([],T_(e),!1)),i=Math.max.apply(Math,A_([],T_(e),!1)),r=Math.min.apply(Math,A_([],T_(n),!1)),a=Math.max.apply(Math,A_([],T_(n),!1));return{centerX:(o+i)/2,centerY:(r+a)/2,maxX:i,maxY:a,minX:o,minY:r,x:(o+i)/2,y:(r+a)/2,height:a-r,width:i-o}}([d,h]),g=k_(u,f),v=k_(c,f),y=[];y=(y=y.concat(R_(g))).concat(R_(v));var m={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[f,g,v].forEach((function(t){y=y.concat(function(t,e){return A_(A_([],T_(function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]}(t,e.x)),!1),T_(function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]}(t,e.y)),!1)}(t,m).filter((function(t){return D_(t,u)&&D_(t,c)})))})),[{x:d.x,y:h.y},{x:h.x,y:d.y}].forEach((function(t){D_(t,u)&&D_(t,c)&&y.push(t)})),y.unshift(d),y.push(h),y=M_(y);var b=F_(y,d,h,s,l,t,e);return b.unshift(t),b.push(e),b.length>2&&(b=W_(b)),M_(b)},U_=function(t){if(1===t.length){var e=T_(t,1)[0];return[e,e]}for(var n=t[0],o=t[1],i=EE(n.x,n.y,o.x,o.y),r=1;r<t.length-1;r++){var a=t[r],s=t[r+1],l=EE(a.x,a.y,s.x,s.y);l>i&&(i=l,n=a,o=s)}return[n,o]},X_=function(t,e,n){var o=wE(t,n),i=wE(e,n);return o&&i},V_=function(t,e,n){var o=wE(t,n),i=wE(e,n);return!(o&&i)&&(o||i)},Y_=function(t,e,n){for(var o=void 0,i=SE(n),r=R_(i),a=0;a<r.length;a++){B_(t,e,r[a],r[(a+1)%r.length])&&(o=[r[a],r[(a+1)%r.length]])}if(o)return function(t,e,n,o){var i=(e.y-t.y)*(o.x-n.x)-(t.x-e.x)*(n.y-o.y);if(0===i)return!1;var r=((e.x-t.x)*(o.x-n.x)*(n.y-t.y)+(e.y-t.y)*(o.x-n.x)*t.x-(o.y-n.y)*(e.x-t.x)*n.x)/i,a=-((e.y-t.y)*(o.y-n.y)*(n.x-t.x)+(e.x-t.x)*(o.y-n.y)*t.y-(o.x-n.x)*(e.y-t.y)*n.y)/i;return(r-t.x)*(r-e.x)<=0&&(a-t.y)*(a-e.y)<=0&&(r-n.x)*(r-o.x)<=0&&(a-n.y)*(a-o.y)<=0&&{x:r,y:a}}(t,e,o[0],o[1])},q_=function(t,e){var n=void 0;return t.x===e.x?n=Ny.VERTICAL:t.y===e.y&&(n=Ny.HORIZONTAL),n},K_=function(t){var e=t.split(" "),n=[];return e&&e.forEach((function(t){var e=T_(t.split(","),2),o=e[0],i=e[1];n.push({x:Number(o),y:Number(i)})})),n},Z_=function(t,e,n,o){var i=[];if(q_(t,n)===q_(e,o))t.y===n.y?(i.push({x:n.x,y:(n.y+o.y)/2}),i.push({x:o.x,y:(n.y+o.y)/2})):(i.push({x:(n.x+o.x)/2,y:n.y}),i.push({x:(n.x+o.x)/2,y:o.y}));else{var r={x:n.x,y:o.y},a=Ry(r,t,n),s=Ry(r,e,o);if(a||s)r={x:o.x,y:n.y};else{var l=$_(r,t,n),u=$_(r,e,o);l&&u&&(r={x:o.x,y:n.y})}i.push(r)}return i},$_=function(t,e,n){return t.x===e.x&&t.x===n.x||t.y===e.y&&t.y===n.y},J_=function(t){var e=t.start,n=t.end,o=t.sourceNode,i=t.targetNode,r=t.offset,a=SE(o),s=SE(i),l=O_(a,r),u=O_(s,r);return{sNext:P_(l,a,e),ePre:P_(u,s,n)}},Q_=function(t,e){for(var n,o=t.x,i=t.y,r=K_(e),a=Number.MAX_SAFE_INTEGER,s=[],l=0;l<r.length;l++)s.push({start:r[l],end:r[(l+1)%r.length]});if(s.forEach((function(t){var e=t.start,r=t.end;if(e.x===r.x){var s={x:e.x,y:i};if(Ry(s,e,r))(l=Math.abs(e.x-o))<a&&(a=l,n=s)}else if(e.y===r.y){var l;s={x:o,y:e.y};if(Ry(s,e,r))(l=Math.abs(e.y-i))<a&&(a=l,n=s)}})),!n){var u=s[0],c=u.start,d=u.end;n={x:c.x+(d.x-c.x)/2,y:c.y+(d.y-c.y)/2}}return n},tE=function(t){return yh(t,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},eE=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};var nE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},oE=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))};function iE(t,e){return e*Math.round(t/e)||t}var rE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},aE=function(t,e,n){var o=rE(t,2),i=o[0],r=o[1],a=rE(e,2),s=a[0],l=a[1],u=rE(n,2),c=u[0],d=u[1];return i>s&&i<c&&r>l&&r<d},sE=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();function lE(t,e){return!!(t instanceof cE&&e instanceof cE)}var uE=function(t){function e(n,o,i){var r=t.call(this,3)||this;return r[0]=n,r[1]=o,r[2]=i,r.x=n,r.y=o,r.z=i,Object.setPrototypeOf(r,e.prototype),r}return sE(e,t),e.prototype.add=function(t){if(lE(this,t))return new cE(this.x+t.x,this.y+t.y);var e=this.z+t.z;return new dE((this.x+t.x)/e,(this.y+t.y)/e)},e.prototype.subtract=function(t){if(lE(this,t))return new cE(this.x-t.x,this.y-t.y);var e=this.z-t.z;return 0===e?new cE(this.x-t.x,this.y-t.y):new dE((this.x-t.x)/e,(this.y-t.y)/e)},e}(Array),cE=function(t){function e(n,o,i){var r=t.call(this,n,o,null!=i?i:0)||this;return Object.setPrototypeOf(r,e.prototype),r}return sE(e,t),e.prototype.toString=function(){return"Vector"},e.prototype.dot=function(t){var e=this;return t.reduce((function(t,n,o){return t+n*e[o]}))},e.prototype.cross=function(t){return new e(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)},e.prototype.getLength=function(){return Math.hypot(this.x,this.y)},e.prototype.normalize=function(){var t=this.getLength();return new e(this.x/t,this.y/t)},e.prototype.crossZ=function(t){return this.x*t.y-this.y*t.x},e.prototype.angle=function(t){var e=this.crossZ(t),n=Math.acos(this.normalize().dot(t.normalize()));return e>=0?n:-n},e}(uE),dE=function(t){function e(n,o){var i=t.call(this,n,o,1)||this;return Object.setPrototypeOf(i,e.prototype),i}return sE(e,t),e.prototype.toString=function(){return"Point"},e}(uE),hE=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),pE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a},fE=function(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))},gE=function(t){function e(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var i=t.call(this,n.length)||this;return i.fill(new Array(3)),n.forEach((function(t,e){i[e]=t})),i.columns=n[0].length,i.rows=n.length,Object.setPrototypeOf(i,e.prototype),i}return hE(e,t),e.prototype.getRow=function(t){return this[t]},e.prototype.getColumn=function(t){return fE([],pE(this.map((function(e){return e[t]}))),!1)},e.prototype.transpose=function(){for(var t=[],n=0;n<this.columns;n++)t.push(this.getColumn(n));return new(e.bind.apply(e,fE([void 0],pE(t),!1)))},e.prototype.cross=function(t){var n=new Array(this.rows).fill("").map((function(){return[]}));if(this.columns===t.rows)for(var o=0;o<this.rows;o++)for(var i=this.getRow(o),r=function(e){var r=t.getColumn(e);n[o][e]=i.reduce((function(t,e,n){return t+e*r[n]}),0)},a=0;a<t.columns;a++)r(a);return new(e.bind.apply(e,fE([void 0],pE(n),!1)))},e.prototype.to2D=function(){return this.map((function(t){return[t[0],t[1]]}))},e.prototype.toPoints=function(){return this.map((function(t){return new dE(t[0],t[1])}))},e.prototype.toString=function(){var t=pE(this[0],2),e=t[0],n=t[1],o=pE(this[1],2),i=o[0],r=o[1],a=pE(this[2],2),s=a[0],l=a[1];return"matrix(".concat(e," ").concat(n," ").concat(i," ").concat(r," ").concat(s," ").concat(l,")")},e.prototype.translate=function(t,e){return this.cross(new mE(t,e))},e.prototype.rotate=function(t){return this.cross(new vE(t))},e.prototype.scale=function(t,e){return this.cross(new yE(t,e))},e}(Array),vE=function(t){function e(n){var o=t.call(this,new cE(+Math.cos(n).toFixed(2),+Math.sin(n).toFixed(2),0),new cE(-Math.sin(n).toFixed(2),+Math.cos(n).toFixed(2),0),new cE(0,0,1))||this;return Object.setPrototypeOf(o,e.prototype),o}return hE(e,t),e.prototype.inverse=function(){return this.transpose()},e}(gE),yE=function(t){function e(n,o){var i=t.call(this,new cE(n,0,0),new cE(0,o,0),new cE(0,0,1))||this;return i.sx=n,i.sy=o,Object.setPrototypeOf(i,e.prototype),i}return hE(e,t),e.prototype.inverse=function(){return new e(1/this.sx,1/this.sy)},e}(gE),mE=function(t){function e(n,o){var i=t.call(this,new cE(1,0,0),new cE(0,1,0),new cE(n,o,1))||this;return i.tx=n,i.ty=o,Object.setPrototypeOf(i,e.prototype),i}return hE(e,t),e.prototype.inverse=function(){return new e(-this.tx,-this.ty)},e}(gE);!function(t){var e=t.enforceActions,n=t.computedRequiresReaction,o=t.computedConfigurable,i=t.disableErrorBoundaries,r=t.reactionScheduler,a=t.reactionRequiresObservable,s=t.observableRequiresReaction;if(!0===t.isolateGlobalState&&((rb.pendingReactions.length||rb.inBatch||rb.isRunningReactions)&&By("isolateGlobalState should be called before MobX is running any reactions"),ib=!0,ob&&(0==--nb().__mobxInstanceCount&&(nb().__mobxGlobals=void 0),rb=new tb)),void 0!==e){var l=void 0;switch(e){case!0:case"observed":l=!0;break;case!1:case"never":l=!1;break;case"strict":case"always":l="strict";break;default:By("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}rb.enforceActions=l,rb.allowStateChanges=!0!==l&&"strict"!==l}void 0!==n&&(rb.computedRequiresReaction=!!n),void 0!==a&&(rb.reactionRequiresObservable=!!a),void 0!==s&&(rb.observableRequiresReaction=!!s,rb.allowStateReads=!rb.observableRequiresReaction),void 0!==o&&(rb.computedConfigurable=!!o),void 0!==i&&(rb.disableErrorBoundaries=!!i),r&&xb(r)}({isolateGlobalState:!0});var bE=function(){return bE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},bE.apply(this,arguments)},xE=function(t){return t.anchors},_E=function(t,e){for(var n,o=xE(e),i=Number.MAX_SAFE_INTEGER,r=0;r<o.length;r++){var a=EE(t.x,t.y,o[r].x,o[r].y);a<i&&(i=a,n={index:r,anchor:bE(bE({},o[r]),{x:o[r].x,y:o[r].y,id:o[r].id})})}return n},EE=function(t,e,n,o){return Math.hypot(t-n,e-o)},wE=function(t,e){var n=!1,o=SE(e);return t.x>=o.minX-0&&t.x<=o.maxX+0&&t.y>=o.minY-0&&t.y<=o.maxY+0&&(n=!0),n},SE=function(t){var e=t.x,n=t.y,o=t.width,i=t.height;return{minX:e-o/2,minY:n-i/2,maxX:e+o/2,maxY:n+i/2,x:e,y:n,width:o,height:i,centerX:e,centerY:n}},CE=function(t,e,n){var o,i=function(t){var e=t,n=e.x,o=e.y,i=e.width,r=e.height,a=e.radius;return[{x:n-i/2+a,y:o-r/2+a,r:a},{x:n+i/2-a,y:o-r/2+a,r:a},{x:n-i/2+a,y:o+r/2-a,r:a},{x:n+i/2-a,y:o+r/2-a,r:a}]}(n),r=Number.MAX_SAFE_INTEGER;return i.forEach((function(e){var n=EE(t.x,t.y,e.x,e.y);n<r&&(r=n,o=e)})),NE(t,e,o)},NE=function(t,e,n){var o,i=n.x,r=n.y,a=n.r;if(e===Ny.HORIZONTAL){var s=i-Math.sqrt(a*a-(t.y-r)*(t.y-r)),l=i+Math.sqrt(a*a-(t.y-r)*(t.y-r));o={x:Math.abs(s-t.x)<Math.abs(l-t.x)?s:l,y:t.y}}else if(e===Ny.VERTICAL){var u=r-Math.sqrt(a*a-(t.x-i)*(t.x-i)),c=r+Math.sqrt(a*a-(t.x-i)*(t.x-i)),d=Math.abs(u-t.y)<Math.abs(c-t.y)?u:c;o={x:t.x,y:d}}return o},TE=function(t,e){var n=e,o=!1,i=n.x,r=n.y,a=n.width,s=n.height,l=n.radius,u=i-a/2+l,c=i+a/2-l,d=r-s/2+l,h=r+s/2-l;return t.y===r+s/2||t.y===r-s/2?o=t.x>u&&t.x<c:t.x!==i+a/2&&t.x!==i-a/2||(o=t.y>d&&t.y<h),o},AE=function(t,e,n){var o,i=n,r=i.x,a=i.y,s=i.rx,l=i.ry;if(e===Ny.HORIZONTAL){var u=r-Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l)),c=r+Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l));o={x:Math.abs(u-t.x)<Math.abs(c-t.x)?u:c,y:t.y}}else if(e===Ny.VERTICAL){var d=a-Math.sqrt(l*l-(t.x-r)*(t.x-r)*l*l/(s*s)),h=a+Math.sqrt(l*l-(t.x-r)*(t.x-r)*l*l/(s*s)),p=Math.abs(d-t.y)<Math.abs(h-t.y)?d:h;o={x:t.x,y:p}}return o},ME=function(t,e,n){for(var o,i=n.pointsPosition,r=Number.MAX_SAFE_INTEGER,a=[],s=0;s<i.length;s++)a.push({start:i[s],end:i[(s+1)%i.length]});return a.forEach((function(n){var i=n.start,a=n.end,s=i,l=a;i.x>a.x&&(s=a,l=i);var u={x:t.x,y:t.y};if(s.x===l.x&&e===Ny.HORIZONTAL&&(u={x:s.x,y:t.y}),s.y===l.y&&e===Ny.VERTICAL&&(u={x:t.x,y:s.y}),s.x!==l.x&&s.y!==l.y){var c=(l.y-s.y)/(l.x-s.x),d=(s.x*l.y-l.x*s.y)/(s.x-l.x);e===Ny.HORIZONTAL?u={x:(t.y-d)/c,y:t.y}:e===Ny.VERTICAL&&(u={x:t.x,y:c*t.x+d})}if(Ry(u,i,a)){var h=EE(u.x,u.y,t.x,t.y);h<r&&(r=h,o=u)}})),o},OE=function(t){return yh(t,["id","type","x","y","text","label","properties","virtual","rotate","resizable","rotatable"])},PE=function(t,e,n,o){var i=t.x,r=t.y;return e.x>t.x?i=t.x+n/2:e.x<t.x&&(i=t.x-n/2),e.y>t.y?r=t.y+o/2:e.y<t.y&&(r=t.y-o/2),{x:i,y:r}},kE=function(t){var e=t.rows,n=t.rowsLength,o=t.fontSize,i=0;return e&&e.forEach((function(t){var e=function(t){if(!t)return 0;for(var e=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);t.match(/[A-Z]/)?e+=1.5:e+=o>=1&&o<=126||o>=65376&&o<=65439?1:2}return e}(t);i=e>i?e:i})),{width:Math.ceil(i/2)*o+o/4,height:n*(o+2)+o/4}};let RE;const DE=new Uint8Array(16);function LE(){if(!RE&&(RE="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!RE))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return RE(DE)}var IE=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const jE=[];for(let t=0;t<256;++t)jE.push((t+256).toString(16).slice(1));function BE(t,e=0){return jE[t[e+0]]+jE[t[e+1]]+jE[t[e+2]]+jE[t[e+3]]+"-"+jE[t[e+4]]+jE[t[e+5]]+"-"+jE[t[e+6]]+jE[t[e+7]]+"-"+jE[t[e+8]]+jE[t[e+9]]+"-"+jE[t[e+10]]+jE[t[e+11]]+jE[t[e+12]]+jE[t[e+13]]+jE[t[e+14]]+jE[t[e+15]]}function HE(t){if(!function(t){return"string"==typeof t&&IE.test(t)}(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}function FE(t,e,n){function o(t,o,i,r){var a;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}(t)),"string"==typeof o&&(o=HE(o)),16!==(null===(a=o)||void 0===a?void 0:a.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let s=new Uint8Array(16+t.length);if(s.set(o),s.set(t,o.length),s=n(s),s[6]=15&s[6]|e,s[8]=63&s[8]|128,i){r=r||0;for(let t=0;t<16;++t)i[r+t]=s[t];return i}return BE(s)}try{o.name=t}catch(t){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}function zE(t){return 14+(t+64>>>9<<4)+1}function WE(t,e){const n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function GE(t,e,n,o,i,r){return WE((a=WE(WE(e,t),WE(o,r)))<<(s=i)|a>>>32-s,n);var a,s}function UE(t,e,n,o,i,r,a){return GE(e&n|~e&o,t,e,i,r,a)}function XE(t,e,n,o,i,r,a){return GE(e&o|n&~o,t,e,i,r,a)}function VE(t,e,n,o,i,r,a){return GE(e^n^o,t,e,i,r,a)}function YE(t,e,n,o,i,r,a){return GE(n^(e|~o),t,e,i,r,a)}FE("v3",48,(function(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return function(t){const e=[],n=32*t.length,o="0123456789abcdef";for(let i=0;i<n;i+=8){const n=t[i>>5]>>>i%32&255,r=parseInt(o.charAt(n>>>4&15)+o.charAt(15&n),16);e.push(r)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[zE(e)-1]=e;let n=1732584193,o=-271733879,i=-1732584194,r=271733878;for(let e=0;e<t.length;e+=16){const a=n,s=o,l=i,u=r;n=UE(n,o,i,r,t[e],7,-680876936),r=UE(r,n,o,i,t[e+1],12,-389564586),i=UE(i,r,n,o,t[e+2],17,606105819),o=UE(o,i,r,n,t[e+3],22,-1044525330),n=UE(n,o,i,r,t[e+4],7,-176418897),r=UE(r,n,o,i,t[e+5],12,1200080426),i=UE(i,r,n,o,t[e+6],17,-1473231341),o=UE(o,i,r,n,t[e+7],22,-45705983),n=UE(n,o,i,r,t[e+8],7,1770035416),r=UE(r,n,o,i,t[e+9],12,-1958414417),i=UE(i,r,n,o,t[e+10],17,-42063),o=UE(o,i,r,n,t[e+11],22,-1990404162),n=UE(n,o,i,r,t[e+12],7,1804603682),r=UE(r,n,o,i,t[e+13],12,-40341101),i=UE(i,r,n,o,t[e+14],17,-1502002290),o=UE(o,i,r,n,t[e+15],22,1236535329),n=XE(n,o,i,r,t[e+1],5,-165796510),r=XE(r,n,o,i,t[e+6],9,-1069501632),i=XE(i,r,n,o,t[e+11],14,643717713),o=XE(o,i,r,n,t[e],20,-373897302),n=XE(n,o,i,r,t[e+5],5,-701558691),r=XE(r,n,o,i,t[e+10],9,38016083),i=XE(i,r,n,o,t[e+15],14,-660478335),o=XE(o,i,r,n,t[e+4],20,-405537848),n=XE(n,o,i,r,t[e+9],5,568446438),r=XE(r,n,o,i,t[e+14],9,-1019803690),i=XE(i,r,n,o,t[e+3],14,-187363961),o=XE(o,i,r,n,t[e+8],20,1163531501),n=XE(n,o,i,r,t[e+13],5,-1444681467),r=XE(r,n,o,i,t[e+2],9,-51403784),i=XE(i,r,n,o,t[e+7],14,1735328473),o=XE(o,i,r,n,t[e+12],20,-1926607734),n=VE(n,o,i,r,t[e+5],4,-378558),r=VE(r,n,o,i,t[e+8],11,-2022574463),i=VE(i,r,n,o,t[e+11],16,1839030562),o=VE(o,i,r,n,t[e+14],23,-35309556),n=VE(n,o,i,r,t[e+1],4,-1530992060),r=VE(r,n,o,i,t[e+4],11,1272893353),i=VE(i,r,n,o,t[e+7],16,-155497632),o=VE(o,i,r,n,t[e+10],23,-1094730640),n=VE(n,o,i,r,t[e+13],4,681279174),r=VE(r,n,o,i,t[e],11,-358537222),i=VE(i,r,n,o,t[e+3],16,-722521979),o=VE(o,i,r,n,t[e+6],23,76029189),n=VE(n,o,i,r,t[e+9],4,-640364487),r=VE(r,n,o,i,t[e+12],11,-421815835),i=VE(i,r,n,o,t[e+15],16,530742520),o=VE(o,i,r,n,t[e+2],23,-995338651),n=YE(n,o,i,r,t[e],6,-198630844),r=YE(r,n,o,i,t[e+7],10,1126891415),i=YE(i,r,n,o,t[e+14],15,-1416354905),o=YE(o,i,r,n,t[e+5],21,-57434055),n=YE(n,o,i,r,t[e+12],6,1700485571),r=YE(r,n,o,i,t[e+3],10,-1894986606),i=YE(i,r,n,o,t[e+10],15,-1051523),o=YE(o,i,r,n,t[e+1],21,-2054922799),n=YE(n,o,i,r,t[e+8],6,1873313359),r=YE(r,n,o,i,t[e+15],10,-30611744),i=YE(i,r,n,o,t[e+6],15,-1560198380),o=YE(o,i,r,n,t[e+13],21,1309151649),n=YE(n,o,i,r,t[e+4],6,-145523070),r=YE(r,n,o,i,t[e+11],10,-1120210379),i=YE(i,r,n,o,t[e+2],15,718787259),o=YE(o,i,r,n,t[e+9],21,-343485551),n=WE(n,a),o=WE(o,s),i=WE(i,l),r=WE(r,u)}return[n,o,i,r]}(function(t){if(0===t.length)return[];const e=8*t.length,n=new Uint32Array(zE(e));for(let o=0;o<e;o+=8)n[o>>5]|=(255&t[o/8])<<o%32;return n}(t),8*t.length))}));var qE={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function KE(t,e,n){if(qE.randomUUID&&!e&&!t)return qE.randomUUID();const o=(t=t||{}).random||(t.rng||LE)();return o[6]=15&o[6]|64,o[8]=63&o[8]|128,BE(o)}function ZE(t,e,n,o){switch(t){case 0:return e&n^~e&o;case 1:case 3:return e^n^o;case 2:return e&n^e&o^n&o}}function $E(t,e){return t<<e|t>>>32-e}FE("v5",80,(function(t){const e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const o=t.length/4+2,i=Math.ceil(o/16),r=new Array(i);for(let e=0;e<i;++e){const n=new Uint32Array(16);for(let o=0;o<16;++o)n[o]=t[64*e+4*o]<<24|t[64*e+4*o+1]<<16|t[64*e+4*o+2]<<8|t[64*e+4*o+3];r[e]=n}r[i-1][14]=8*(t.length-1)/Math.pow(2,32),r[i-1][14]=Math.floor(r[i-1][14]),r[i-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<i;++t){const o=new Uint32Array(80);for(let e=0;e<16;++e)o[e]=r[t][e];for(let t=16;t<80;++t)o[t]=$E(o[t-3]^o[t-8]^o[t-14]^o[t-16],1);let i=n[0],a=n[1],s=n[2],l=n[3],u=n[4];for(let t=0;t<80;++t){const n=Math.floor(t/20),r=$E(i,5)+ZE(n,a,s,l)+u+e[n]+o[t]>>>0;u=l,l=s,s=$E(a,30)>>>0,a=i,i=r}n[0]=n[0]+i>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+l>>>0,n[4]=n[4]+u>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));var JE=function(){return KE()},QE={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#000",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},tw=function(t){var e=Is(QE);return t&&(e=md(e,t)),e},ew=tw,nw=1e3,ow=999,iw=function(){return++nw},rw=function(){return--ow},aw=function(){return aw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},aw.apply(this,arguments)},sw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a};function lw(t){var e=t.x,n=t.y,o=t.width,i=t.height,r=t.className,a=t.strokeWidth,s=t.radius,l=void 0===s?0:s,u=e-o/2,c=n-i/2,d={};return d["stroke-width"]=a,xu(Tu(t),(function(t){var e=sw(t,2),n=e[0],o=e[1];"object"!=typeof o&&(d[n]=o)})),d.className=r?"lf-basic-shape ".concat(r):"lf-basic-shape",l&&(d.rx=l,d.ry=l),d.x=u,d.y=c,gg("rect",aw({},d))}var uw,cw=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),dw=function(){return dw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},dw.apply(this,arguments)},hw=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n},pw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a};!function(t){t[t.LEFT_TOP=0]="LEFT_TOP",t[t.RIGHT_TOP=1]="RIGHT_TOP",t[t.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",t[t.LEFT_BOTTOM=3]="LEFT_BOTTOM"}(uw||(uw={}));var fw=function(t){function e(e){var n=t.call(this)||this;n.updateEdgePointByAnchors=function(){var t=n.nodeModel,e=t.id,o=t.anchors;xu(n.graphModel.getNodeEdges(e),(function(t){if(t.sourceNodeId===e)(n=Uu(o,(function(e){return e.id===t.sourceAnchorId})))&&t.updateStartPoint({x:n.x,y:n.y});else if(t.targetNodeId===e){var n;(n=Uu(o,(function(e){return e.id===t.targetAnchorId})))&&t.updateEndPoint({x:n.x,y:n.y})}}))},n.triggerResizeEvent=function(t,e,o,i,r,a){n.graphModel.eventCenter.emit(Sy.NODE_RESIZE,{preData:t,data:e,deltaX:o,deltaY:i,index:r,model:a})},n.recalcResizeInfo=function(t,e,n,o,i){void 0===n&&(n=1),void 0===o&&(o=!1),void 0===i&&(i=!1);var r=Is(e),a=r.deltaX,s=r.deltaY,l=r.width,u=r.height,c=r.PCTResizeInfo;if(c){var d=0,h=0;switch(t){case uw.LEFT_TOP:h=(-1*a-s)/4;break;case uw.RIGHT_TOP:h=(a-s)/4;break;case uw.RIGHT_BOTTOM:h=(a+s)/4;break;case uw.LEFT_BOTTOM:h=(-1*a+s)/4}0!==h&&(d=Math.round(h/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var p=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),f=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(t){case uw.LEFT_TOP:a=l-p,s=u-f;break;case uw.RIGHT_TOP:a=p-l,s=u-f;break;case uw.RIGHT_BOTTOM:a=p-l,s=f-u;break;case uw.LEFT_BOTTOM:a=l-p,s=f-u}return r}switch(t){case uw.LEFT_TOP:r.width=o?l:l-a*n,r.height=i?u:u-s*n;break;case uw.RIGHT_TOP:r.width=o?l:l+a*n,r.height=i?u:u-s*n;break;case uw.RIGHT_BOTTOM:r.width=o?l:l+a*n,r.height=i?u:u+s*n;break;case uw.LEFT_BOTTOM:r.width=o?l:l-a*n,r.height=i?u:u+s*n}return r},n.resizeNode=function(t){var e=t.deltaX,o=t.deltaY,i=n.index,r=n.props,a=r.model,s=r.graphModel;gw({deltaX:e,deltaY:o,index:i,nodeModel:a,graphModel:s,cancelCallback:function(){n.dragHandler.cancelDrag()}})},n.onDragging=function(t){var e=t.deltaX,o=t.deltaY,i=n.graphModel.transformModel,r=pw(i.fixDeltaXY(e,o),2),a=r[0],s=r[1];n.resizeNode({deltaX:a,deltaY:s})},n.onDragEnd=function(){var t=n.nodeModel.x,e=n.nodeModel.y;n.nodeModel.moveTo(t,e),n.updateEdgePointByAnchors()};var o=e.index,i=e.model,r=e.graphModel;return n.index=o,n.nodeModel=i,n.graphModel=r,n.dragHandler=new ky({onDragging:n.onDragging,onDragEnd:n.onDragEnd,step:r.gridSize}),n}return cw(e,t),e.prototype.render=function(){var t=this.props,e=t.x,n=t.y,o=t.direction,i=t.model.getResizeControlStyle(),r=i.width,a=i.height,s=hw(i,["width","height"]);return gg("g",{className:"lf-resize-control lf-resize-control-".concat(o),children:[gg(lw,dw({className:"lf-resize-control-content",x:e,y:n,width:null!=r?r:7,height:null!=a?a:7},s)),gg(lw,{className:"lf-resize-control-content",x:e,y:n,width:25,height:25,fill:"transparent",stroke:"transparent",onMouseDown:this.dragHandler.handleMouseDown})]})},e}(Kf);!function(t){function e(){return t.call(this)||this}cw(e,t),e.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,o=SE(e),i=o.minX,r=o.minY,a=o.maxX,s=o.maxY;return Ju([{index:uw.LEFT_TOP,direction:"nw",x:i,y:r},{index:uw.RIGHT_TOP,direction:"ne",x:a,y:r},{index:uw.RIGHT_BOTTOM,direction:"se",x:a,y:s},{index:uw.LEFT_BOTTOM,direction:"sw",x:i,y:s}],(function(t){return gg(fw,dw({},t,{model:e,graphModel:n}))}))},e.prototype.getResizeOutline=function(){var t=this.props.model,e=t.x,n=t.y,o=t.width,i=t.height,r=t.getResizeOutlineStyle();return gg(lw,dw({},r,{x:e,y:n,width:o,height:i}))},e.prototype.render=function(){return gg("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})}}(Kf);var gw=function(t){var e=t.deltaX,n=t.deltaY,o=t.index,i=t.nodeModel,r=t.graphModel,a=t.cancelCallback,s=i.r,l=i.rx,u=i.ry,c=i.width,d=i.height,h=i.PCTResizeInfo,p=i.minWidth,f=i.minHeight,g=i.maxWidth,v=i.maxHeight,y=p===g,m=function(t,e,n,o,i){void 0===n&&(n=1),void 0===o&&(o=!1),void 0===i&&(i=!1);var r=Is(e),a=r.deltaX,s=r.deltaY,l=r.width,u=r.height,c=r.PCTResizeInfo;if(c){var d=0,h=0;switch(t){case uw.LEFT_TOP:h=(-1*a-s)/4;break;case uw.RIGHT_TOP:h=(a-s)/4;break;case uw.RIGHT_BOTTOM:h=(a+s)/4;break;case uw.LEFT_BOTTOM:h=(-1*a+s)/4}0!==h&&(d=Math.round(h/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var p=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),f=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(t){case uw.LEFT_TOP:a=l-p,s=u-f;break;case uw.RIGHT_TOP:a=p-l,s=u-f;break;case uw.RIGHT_BOTTOM:a=p-l,s=f-u;break;case uw.LEFT_BOTTOM:a=l-p,s=f-u}return r}switch(t){case uw.LEFT_TOP:r.width=o?l:l-a*n,r.height=i?u:u-s*n;break;case uw.RIGHT_TOP:r.width=o?l:l+a*n,r.height=i?u:u-s*n;break;case uw.RIGHT_BOTTOM:r.width=o?l:l+a*n,r.height=i?u:u+s*n;break;case uw.LEFT_BOTTOM:r.width=o?l:l-a*n,r.height=i?u:u+s*n}return r}(o,{width:s||l||c,height:s||u||d,deltaX:e,deltaY:n,PCTResizeInfo:h},s||l&&u?.5:1,y,f===v);if(m.width<p||m.width>g||m.height<f||m.height>v)null==a||a();else{m.deltaX=y?0:m.deltaX,m.deltaY=y?0:m.deltaY;var b=i.getData(),x=i.resize(m);!function(t,e){var n=t.id,o=t.anchors;xu(e.getNodeEdges(n),(function(t){if(t.sourceNodeId===n)(e=Uu(o,(function(e){return e.id===t.sourceAnchorId})))&&t.updateStartPoint({x:e.x,y:e.y});else if(t.targetNodeId===n){var e;(e=Uu(o,(function(e){return e.id===t.targetAnchorId})))&&t.updateEndPoint({x:e.x,y:e.y})}}))}(i,r),function(t,e,n,o,i,r,a){a.eventCenter.emit(Sy.NODE_RESIZE,{preData:t,data:e,deltaX:n,deltaY:o,index:i,model:r})}(b,x,e,n,o,i,r)}};function vw(t,e,n){var o=e.x,i=e.y,r=t.x-o,a=t.y-i;return{x:r*Math.cos(n)-a*Math.sin(n)+o,y:r*Math.sin(n)+a*Math.cos(n)+i}}var yw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.componentDidMount=function(){t.prototype.componentDidMount.call(this);var e=this.props,n=e.model,o=e.graphModel,i=o.eventCenter,r=new Map;i.on("node:rotate",(function(t){var e=t.model;if(e.id===n.id){var i={x:n.x,y:n.y};xu(Array.from(n.children),(function(t){var n=o.getNodeModelById(t);if(n){var a={x:n.x,y:n.y};r.has(n.id)?a=r.get(n.id):r.set(n.id,a);var s=e.rotate*(180/Math.PI);s<0&&(s+=360);var l=s*(Math.PI/180),u=vw(a,i,l);n.moveTo(u.x,u.y),n.rotate=e.rotate}}))}})),i.on("node:resize",(function(t){var e=t.deltaX,i=t.deltaY,r=t.index;t.model.id===n.id&&xu(Array.from(n.children),(function(t){var n=o.getNodeModelById(t);n&&gw({deltaX:e,deltaY:i,index:r,nodeModel:n,graphModel:o,cancelCallback:function(){}})}))}))},n.prototype.getResizeControl=function(){var e=this.props.model,n=e.resizable,o=e.isCollapsed;return n&&!o?t.prototype.getResizeControl.call(this):null},n.prototype.getAppendAreaShape=function(){var t=this.props.model,n=t.width,o=t.height,i=t.x,r=t.y,a=t.radius;if(!t.groupAddable)return null;var s=t.getNodeStyle().strokeWidth,l=void 0===s?0:s,u=t.getAddableOutlineStyle(),c=n+l+8,d=o+l+8;return e.h("rect",g(g({},u),{width:c,height:d,x:i-c/2,y:r-d/2,rx:a,ry:a}))},n.prototype.getCollapseIcon=function(t,e){return"M ".concat(t+3,",").concat(e+6," ").concat(t+11,",").concat(e+6," M").concat(t+7,",").concat(e+2," ").concat(t+7,",").concat(e+10)},n.prototype.getExpandIcon=function(t,e){return"M ".concat(t+3,",").concat(e+6," ").concat(t+11,",").concat(e+6," ")},n.prototype.getOperateIcon=function(){var t=this.props.model,n=t.x,o=t.y,i=n-t.width/2+10,r=o-t.height/2+10;if(!t.collapsible)return null;var a=(null==t?void 0:t.isCollapsed)?this.getCollapseIcon(i,r):this.getExpandIcon(i,r),s=e.h("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:a});return e.h("g",{},[e.h("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#f4f5f6",stroke:"#cecece",cursor:"pointer",x:i,y:r,onClick:function(){t.toggleCollapse(!t.isCollapsed)}}),s])},n.prototype.getShape=function(){return e.h("g",{},[this.getAppendAreaShape(),t.prototype.getShape.call(this),this.getOperateIcon()])},n}(e.RectNode),mw=function(t){function n(e,n){var o=t.call(this,e,n)||this;return o.isGroup=!0,o.isRestrict=!1,o.collapsible=!0,o.isCollapsed=!1,o.groupAddable=!1,o.transformWidthContainer=!0,o.childrenLastCollapseStateDict=new Map,o.childrenLastCollapseStateDict=new Map,o.initNodeData(e),o.setAttributes(),o}return f(n,t),n.prototype.initNodeData=function(e){var n;t.prototype.initNodeData.call(this,e);var o=null!==(n=e.properties)&&void 0!==n?n:{},i=o.children,r=o.width,a=o.height,s=o.collapsedWidth,l=o.collapsedHeight,u=o.collapsible,c=o.isCollapsed,d=o.zIndex,h=o.isRestrict,p=o.autoResize,f=o.autoToFront;this.children=i?new Set(i):new Set,this.zIndex=null!=d?d:-1e4,this.isCollapsed=null!=c&&c;var g=null!=r?r:400,v=null!=a?a:230;this.width=g,this.height=v,this.expandWidth=g,this.expandHeight=v,this.collapsedWidth=null!=s?s:80,this.collapsedHeight=null!=l?l:60,this.isRestrict=null!=h&&h,this.autoResize=null!=p&&p,this.collapsible=null==u||u,this.autoToFront=null!=f&&f,this.text.editable=!1,this.text.draggable=!1},n.prototype.setAttributes=function(){t.prototype.setAttributes.call(this),this.isCollapsed&&this.toggleCollapse(!0)},n.prototype.getData=function(){var e=this,n=t.prototype.getData.call(this),o=[];return xu(Array.from(this.children),(function(t){var n=e.graphModel.getNodeModelById(t);n&&!n.virtual&&o.push(t)})),n.children=o,n.properties&&(n.properties.children=o,n.properties.isCollapsed=this.isCollapsed),n},n.prototype.getHistoryData=function(){var e=t.prototype.getHistoryData.call(this);e.children=Array.from(this.children),e.isGroup=!0;var n=this,o=n.x,i=n.y,r=n.collapsedWidth,a=n.collapsedHeight,s=n.expandWidth,l=n.expandHeight;return n.isCollapsed&&(e.x=o+s/2-r/2,e.y=i+l/2-a/2),e},n.prototype.toggleCollapse=function(t){var n=this,o=!!t;this.isCollapsed=o,o?this.collapse():this.expand();var i=E(E([],_(this.incoming.edges),!1),_(this.outgoing.edges),!1);xu(Array.from(this.children),(function(o){var r,a,s=n.graphModel.elementsModelMap.get(o);if(s){var l=s.isCollapsed;if(s.isGroup){var u=s;if(u.isCollapsed||u.toggleCollapse(t),!t){var c=null===(r=n.childrenLastCollapseStateDict)||void 0===r?void 0:r.get(o);void 0!==c&&c!==s.isCollapsed&&u.toggleCollapse(c)}}if(null===(a=n.childrenLastCollapseStateDict)||void 0===a||a.set(o,!!l),s.visible=!t,s.BaseType===e.ElementType.NODE){var d=s.incoming.edges,h=s.outgoing.edges;i=E(E(E([],_(i),!1),_(d),!1),_(h),!1)}}})),this.collapseEdge(o,i)},n.prototype.collapse=function(){var t=this,e=t.x,n=t.y,o=t.text,i=t.width,r=t.height,a=t.collapsedWidth,s=t.collapsedHeight;this.x=e-i/2+a/2,this.y=n-r/2+s/2,this.text.x=o.x-i/2+a/2,this.text.y=o.y-r/2+s/2,this.expandWidth=i,this.expandHeight=r,this.width=a,this.height=s},n.prototype.expand=function(){var t=this,e=t.x,n=t.y,o=t.text,i=t.expandWidth,r=t.expandHeight,a=t.collapsedWidth,s=t.collapsedHeight;this.width=i,this.height=r,this.x=e+this.width/2-a/2,this.y=n+this.height/2-s/2,this.text.x=o.x+this.width/2-a/2,this.text.y=o.y+this.height/2-s/2},n.prototype.createVirtualEdge=function(t){t.pointsList=void 0;var e=this.graphModel.addEdge(t);e.virtual=!0,e.text.editable=!1,e.isCollapsedEdge=!0},n.prototype.collapseEdge=function(t,e){var n=this,o=this.graphModel;xu(e,(function(e,i){var r,a=e.getData(),s=a.targetNodeId,l=a.sourceNodeId,u=g(g({},a),{id:"".concat(a.id,"__").concat(i),text:null===(r=a.text)||void 0===r?void 0:r.value});e.virtual&&o.deleteEdgeById(e.id);var c=o.dynamicGroup.getGroupByNodeId(s);c||(c=o.getNodeModelById(s));var d=o.dynamicGroup.getGroupByNodeId(l);d||(d=o.getNodeModelById(l)),t&&e.visible&&(n.children.has(l)||n.id===l?(u.startPoint=void 0,u.sourceNodeId=n.id):(u.endPoint=void 0,u.targetNodeId=n.id),c.id===n.id&&d.id===n.id||n.createVirtualEdge(u),e.visible=!1),t||e.visible||(c&&c.isGroup&&c.isCollapsed?(u.targetNodeId=c.id,u.endPoint=void 0,n.createVirtualEdge(u)):d&&d.isGroup&&d.isCollapsed?(u.sourceNodeId=d.id,u.startPoint=void 0,n.createVirtualEdge(u)):e.visible=!0)}))},n.prototype.isAllowAppendIn=function(t){return!0},n.prototype.setAllowAppendChild=function(t){this.groupAddable=t},n.prototype.addChild=function(t){this.children.add(t);var e=this.getData();this.graphModel.eventCenter.emit("group:add-node",{data:e})},n.prototype.removeChild=function(t){this.children.delete(t);var e=this.getData();this.graphModel.eventCenter.emit("group:remove-node",{data:e})},n.prototype.toBack=function(){this.zIndex--},n.prototype.getResizeOutlineStyle=function(){var e=t.prototype.getResizeOutlineStyle.call(this);return e.stroke="none",e},n.prototype.getAnchorStyle=function(){var e=t.prototype.getAnchorStyle.call(this);return e.stroke="transparent",e.fill="transparent",e.hover&&(e.hover.fill="transparent",e.hover.stroke="transparent"),e},n.prototype.getAddableOutlineStyle=function(){return{stroke:"#feb663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},y([e.observable],n.prototype,"isCollapsed",void 0),y([e.observable],n.prototype,"groupAddable",void 0),y([e.observable],n.prototype,"transformWidthContainer",void 0),n}(e.RectNodeModel);var bw,xw={type:"dynamic-group",view:yw,model:mw},_w=-1e4,Ew=function(){function t(t){var e=t.lf,n=t.options,o=this;this.topGroupZIndex=_w,this.nodeGroupMap=new Map,this.addNodeToGroup=function(t){var e=t.data,n=o.nodeGroupMap.get(e.id);n&&((s=o.lf.getNodeModelById(n)).removeChild(e.id),o.nodeGroupMap.delete(e.id),s.setAllowAppendChild(!1));var i=o.lf.getNodeModelById(e.id),r=null==i?void 0:i.getBounds();if(i&&r){if(i.isGroup){var a=i;xu(Array.from(a.children),(function(t){o.nodeGroupMap.set(t,e.id)})),o.calibrateTopGroupZIndex([e]),o.onNodeSelect({data:e,isSelected:!1,isMultiple:!1})}var s;if(s=o.getGroupByBounds(r,e))s.isAllowAppendIn(e)?(s.addChild(e.id),o.nodeGroupMap.set(e.id,s.id),s.setAllowAppendChild(!0)):o.lf.emit("group:not-allowed",{group:s.getData(),node:e})}},this.removeNodeFromGroup=function(t){var e=t.data;e.isGroup&&e.children&&xu(Array.from(e.children),(function(t){o.nodeGroupMap.delete(t),o.lf.deleteNode(t)}));var n=o.nodeGroupMap.get(e.id);if(n){var i=o.lf.getNodeModelById(n);i&&i.removeChild(e.id),o.nodeGroupMap.delete(e.id)}},this.setActiveGroup=function(t){var e=t.data,n=o.lf.getNodeModelById(e.id),i=null==n?void 0:n.getBounds();if(n&&i){var r=o.getGroupByBounds(i,e);if(o.activeGroup&&o.activeGroup.setAllowAppendChild(!1),!r||n.isGroup&&r.id===e.id)return;if(!r.isAllowAppendIn(e))return;o.activeGroup=r,o.activeGroup.setAllowAppendChild(!0)}},this.onNodeSelect=function(t){var e=t.data,n=t.isMultiple,i=t.isSelected,r=o.lf.getNodeModelById(e.id);if(o.sendNodeToFront(r),o.topGroupZIndex>-1e3){var a=o.lf.graphModel.nodes;o.topGroupZIndex=_w;var s=Qh(Fu(a,(function(t){return!!t.isGroup})),"zIndex"),l=0;xu(s,(function(t){t.zIndex!==l&&(o.topGroupZIndex++,l=t.zIndex),t.setZIndex(o.topGroupZIndex)}))}if(n&&i)if(null==r?void 0:r.isGroup){var u=r.children;xu(Array.from(u),(function(t){var e=o.lf.getNodeModelById(t);null==e||e.setSelected(!1)}))}else{var c=o.nodeGroupMap.get(e.id);if(c){var d=o.lf.getNodeModelById(c);(null==d?void 0:d.isSelected)&&(null==r||r.setSelected(!1))}}},this.onGraphRendered=function(t){var e=t.data;xu(e.nodes,(function(t){t.children&&xu(t.children,(function(e){o.nodeGroupMap.set(e,t.id)}))})),o.calibrateTopGroupZIndex(e.nodes)},e.register(xw),this.lf=e,li(this,n),this.init()}return t.prototype.getNodesInGroup=function(t){var e=this,n=[];return t.isGroup&&xu(Array.from(t.children),(function(t){n.push(t);var o=e.lf.getNodeModelById(t);(null==o?void 0:o.isGroup)&&(n=n.concat(e.getNodesInGroup(o)))})),n},t.prototype.getGroupByNodeId=function(t){var e=this.nodeGroupMap.get(t);if(e)return this.lf.getNodeModelById(e)},t.prototype.getGroupByBounds=function(t,e){var n=Fu(this.lf.graphModel.nodes,(function(n){return!!n.isGroup&&function(t,e){var n=t.minX,o=t.minY,i=t.maxX,r=t.maxY,a=e.x,s=e.y,l=e.width,u=e.height;return n>=a-l/2&&i<=a+l/2&&o>=s-u/2&&r<=s+u/2}(t,n)&&n.id!==e.id})),o=n.length;if(o<=1)return n[0];for(var i=n[o-1],r=o-2;r>=0;r--)i=n[r];return i},t.prototype.sendNodeToFront=function(t){var e=this;if(t&&t.isGroup&&(this.topGroupZIndex++,t.setZIndex(this.topGroupZIndex),t.children)){var n=t.children;xu(Array.from(n),(function(t){var n=e.lf.getNodeModelById(t);e.sendNodeToFront(n)}))}},t.prototype.getMaxZIndex=function(t){var e=this,n=_w;if(t.isGroup&&(n=Math.max(n,t.zIndex)),t.children){var o=t.children;xu(Array.from(o),(function(t){var o=e.lf.getNodeModelById(t);if(null==o?void 0:o.isGroup){var i=e.getMaxZIndex(o);n=Math.max(n,i)}}))}return n},t.prototype.calibrateTopGroupZIndex=function(t){var e=this,n=_w;if(xu(t,(function(t){var o=e.lf.getNodeModelById(t.id);if(o){var i=e.getMaxZIndex(o);i>n&&(n=i)}})),!(this.topGroupZIndex>=n)){var o=Fu(this.lf.graphModel.nodes,(function(t){return!!t.isGroup})),i=this.topGroupZIndex;xu(o,(function(t){t.zIndex>i&&(i=t.zIndex)})),this.topGroupZIndex=i}},t.prototype.initGroupChildNodes=function(t,n,o,i){var r=this,a=[],s=[],l=[];xu(Array.from(n),(function(u){var c=r.lf.getNodeModelById(u);if(c){var d=c.getData(),h=e.EventType.NODE_GROUP_COPY||"node:group-copy-add",p=e.transformNodeData(d,i),f=r.lf.addNode(p,h);if(o.addChild(f.id),t[u]=f.id,a.push(f),l.push.apply(l,E([],_(E(E([],_(f.incoming.edges),!1),_(f.outgoing.edges),!1)),!1)),n instanceof Set){var g=r.initGroupChildNodes(t,n,f,i),v=g.childNodes,y=g.edgesData;a.push.apply(a,E([],_(v),!1)),s.push.apply(s,E([],_(y),!1))}}}));var u=Ju(Fu(l,(function(e){return fc(t,e.sourceNodeId)&&fc(t,e.targetNodeId)})),(function(t){return t.getData()}));return{childNodes:a,edgesData:s.concat(u)}},t.prototype.createEdge=function(t,n,o){var i,r,a=t.sourceNodeId,s=t.targetNodeId,l=null!==(i=n[a])&&void 0!==i?i:a,u=null!==(r=n[s])&&void 0!==r?r:s,c=Is(t);return t.id&&"object"==typeof t.text&&null!==t.text&&(c=e.transformEdgeData(t,o)),this.lf.graphModel.addEdge(g(g({},c),{sourceNodeId:l,targetNodeId:u}))},t.prototype.init=function(){var t=this,e=this.lf,n=e.graphModel;n.addNodeMoveRules((function(e,o,i){if(e.isGroup){var r=t.getNodesInGroup(e);return n.moveNodes(r,o,i,!0),!0}var a=t.nodeGroupMap.get(e.id),s=t.lf.getNodeModelById(a);return!s||!s.isRestrict||function(t,e,n,o){var i=t.minX,r=t.minY,a=t.maxX,s=t.maxY,l=e.x,u=e.y,c=e.width,d=e.height;return{x:l+n>=i+c/2&&l+n<=a-c/2,y:u+o>=r+d/2&&u+o<=s-d/2}}(s.getBounds(),e,o,i)})),n.dynamicGroup=this,e.on("node:add,node:drop,node:dnd-add",this.addNodeToGroup),e.on("node:delete",this.removeNodeFromGroup),e.on("node:drag,node:dnd-drag",this.setActiveGroup),e.on("node:click",this.onNodeSelect),e.on("graph:rendered",this.onGraphRendered),e.on("graph:updated",(function(t){t.data})),e.on("group:add-node",(function(t){t.data})),e.addElements=function(n,o){var i=n.nodes,r=n.edges;void 0===o&&(o=40);var a={},s={nodes:[],edges:[]},l=[];return xu(i,(function(n){var i=n.id,r=n.children,u=v(n,["children"]),c=e.addNode(u);if(i&&(a[i]=c.id),s.nodes.push(c),c.isGroup){var d=t.initGroupChildNodes(a,r,c,o).edgesData;l.push.apply(l,E([],_(d),!1))}})),xu(l,(function(e){t.createEdge(e,a,o)})),xu(r,(function(e){s.edges.push(t.createEdge(e,a,o))})),s},this.render()},t.prototype.render=function(){},t.prototype.destroy=function(){this.lf.off("node:add,node:drop,node:dnd-add",this.addNodeToGroup),this.lf.off("node:delete",this.removeNodeFromGroup),this.lf.off("node:drag,node:dnd-drag",this.setActiveGroup),this.lf.off("node:click",this.onNodeSelect),this.lf.off("graph:rendered",this.onGraphRendered)},t.pluginName="dynamicGroup",t}();!function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(bw||(bw={}));var ww=function(t,e,n,o){return void 0===o&&(o=0),Nw(t,e,n)<=o};function Sw(t){return t*t}function Cw(t,e){return Sw(t.x-e.x)+Sw(t.y-e.y)}var Nw=function(t,e,n){return Math.sqrt(function(t,e,n){var o=Cw(e,n);if(0===o)return Cw(t,e);var i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/o;return i=Math.max(0,Math.min(1,i)),Cw(t,{x:e.x+i*(n.x-e.x),y:e.y+i*(n.y-e.y)})}(t,e,n))},Tw=function(t,e,n){var o=function(t){var e=t.x,n=t.y,o=t.width,i=t.height;return{minX:e-o/2,minY:n-i/2,maxX:e+o/2,maxY:n+i/2,x:e,y:n,width:o,height:i,centerX:e,centerY:n}}(t),i=function(t,e){var n;return t.x===e.x?n=bw.VERTICAL:t.y===e.y&&(n=bw.HORIZONTAL),n}(e,n),r=Math.max(e.x,n.x),a=Math.min(e.x,n.x),s=Math.max(e.y,n.y),l=Math.min(e.y,n.y),u=t.x,c=t.y,d=t.width,h=t.height;if(i===bw.HORIZONTAL){if(r>=o.maxX&&a<=o.minX)return{startCrossPoint:{x:e.x>n.x?u+d/2:u-d/2,y:e.y},endCrossPoint:{x:e.x>n.x?u-d/2:u+d/2,y:e.y}}}else if(i===bw.VERTICAL&&s>=o.maxY&&l<=o.minY)return{startCrossPoint:{x:e.x,y:e.y>n.y?c+h/2:c-h/2},endCrossPoint:{x:e.x,y:e.y>n.y?c-h/2:c+h/2}}},Aw=function(t,e,n){void 0===n&&(n=0);for(var o=t.x,i=t.y,r=e.pointsList,a=0;a<r.length-1;a++)if(ww({x:o,y:i},r[a],r[a+1],n)){var s=Tw(t,r[a],r[a+1]);if(s)return{crossIndex:a+1,crossPoints:s}}return{crossIndex:-1,crossPoints:{startCrossPoint:{x:0,y:0},endCrossPoint:{x:0,y:0}}}},Mw=function(){function t(t){var e=t.lf;this._lf=e,this.deviation=20,this.dndAdd=!0,this.dropAdd=!0,this.eventHandler()}return t.prototype.eventHandler=function(){var t=this;this.dndAdd&&this._lf.on("node:dnd-add",(function(e){var n=e.data;t.insetNode(n)})),this.dropAdd&&this._lf.on("node:drop",(function(e){for(var n=e.data,o=t._lf.graphModel.edges,i=n.id,r=!0,a=0;a<o.length;a++)if(o[a].sourceNodeId===i||o[a].targetNodeId===i){r=!1;break}r&&t.insetNode(n)}))},t.prototype.checkRuleBeforeInsetNode=function(t,n,o,i,r){var a=this._lf.getNodeModelById(t),s=this._lf.getNodeModelById(n),l=a.getAnchorInfo(o),u=s.getAnchorInfo(i),c=a.isAllowConnectedAsSource(r,l,u),d=s.isAllowConnectedAsTarget(r,l,u),h=e.formatAnchorConnectValidateData(c),p=h.isAllPass,f=h.msg,g=e.formatAnchorConnectValidateData(d),v=g.isAllPass;return{isPass:p&&v,sourceMsg:f,targetMsg:g.msg}},t.prototype.insetNode=function(t){var n=this,o=this._lf.graphModel.edges,i=this._lf.getNodeModelById(t.id),r=null==i?void 0:i.getDefaultAnchor();if(!r||0===r.length)this._lf.graphModel.eventCenter.emit(e.EventType.CONNECTION_NOT_ALLOWED,{data:t,msg:"自定义类型节点不显示锚点,也不允许其他节点连接到此节点"});else if(i)for(var a=0;a<o.length;a++){var s=Aw(i,o[a],this.deviation),l=s.crossIndex,u=s.crossPoints;if(l>=0){var c=o[a],d=c.sourceNodeId,h=c.targetNodeId,p=c.id,f=c.type,g=c.pointsList,v=c.sourceAnchorId,y=c.targetAnchorId,m=Is(g[0]),b=Is(u.startCrossPoint);this._lf.deleteEdge(p);var x=this.checkRuleBeforeInsetNode(d,h,v,y,t);if(this._lf.addEdge({type:f,sourceNodeId:d,targetNodeId:t.id,startPoint:m,endPoint:b,pointsList:E(E([],_(g.slice(0,l)),!1),[u.startCrossPoint],!1)}),this._lf.addEdge({type:f,sourceNodeId:t.id,targetNodeId:h,startPoint:Is(u.endCrossPoint),endPoint:Is(g[g.length-1]),pointsList:E([u.endCrossPoint],_(g.slice(l)),!1)}),x.isPass)break;this._lf.graphModel.eventCenter.emit(e.EventType.CONNECTION_NOT_ALLOWED,{data:t,msg:x.targetMsg||x.sourceMsg}),setTimeout((function(){n._lf.undo()}),200);break}}},t.pluginName="insertNodeInPolyline",t}(),Ow="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Pw={},kw={get exports(){return Pw},set exports(t){Pw=t}};!function(t){!function(){var e={}.hasOwnProperty;function n(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=i(t,o(n)))}return t}function o(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var o="";for(var r in t)e.call(t,r)&&t[r]&&(o=i(o,r));return o}function i(t,e){return e?t?t+" "+e:t+e:t}t.exports?(n.default=n,t.exports=n):window.classNames=n}()}(kw);var Rw=Pw,Dw=function(t){function n(n){var o=t.call(this,n)||this;o.textRef=e.createRef(),o.setHoverOn=function(){var t=o.props.element;t.isDragging||o.state.isHovered||(o.setState({isHovered:!0}),t.setHovered(!0))},o.setHoverOff=function(){var t=o.props.element;o.state.isHovered&&(o.setState({isHovered:!1}),t.setHovered(!1))},o.handleMouseDown=function(t){var e,n=o.props,i=n.label,r=n.graphModel.editConfigModel.nodeTextDraggable;(null!==(e=i.draggable)&&void 0!==e?e:r)&&!o.state.isDragging&&(o.setState({isDragging:!0}),o.stepDrag.handleMouseDown(t))},o.handleDragging=function(t){var e=t.deltaX,n=t.deltaY,i=o.props,r=i.label,a=i.element,s=i.graphModel,l=_(s.transformModel.fixDeltaXY(e,n),2),u=l[0],c=l[1],d=a.properties._label,h=Gu(d,(function(t){return t.id===r.id})),p=d[h];d[h]=g(g({},p),{x:p.x+u,y:p.y+c});var f=s.getElement(a.id);null==f||f.setProperty("_label",d),s.eventCenter.emit("label:drag",{data:r.getData(),model:r})},o.handleDragEnd=function(){o.setState({isDragging:!1})},o.handleDbClick=function(t){var n=o.props,i=n.label,r=n.element;if(n.graphModel.eventCenter.emit("label:dblclick",{data:i.getData(),e:t,model:r}),i.editable){if(r.setSelected(),r.setElementState(e.ElementState.TEXT_EDIT),o.setState({isEditing:!0}),o.textRef.current){o.textRef.current.contentEditable="true",o.textRef.current.focus();var a=document.createRange(),s=window.getSelection();a.selectNodeContents(o.textRef.current),a.collapse(!1),null==s||s.removeAllRanges(),null==s||s.addRange(a)}}else r.setSelected(!0)},o.handleBlur=function(t){var e=o.props,n=e.label,i=e.element;e.graphModel.eventCenter.emit("label:blur",{e:t,model:i,data:n.getData(),element:o.textRef.current}),o.setState({isDragging:!1,isHovered:!1})},o.reCalcLabelSize=function(){};var i=n.label,r=n.graphModel,a=r.gridSize,s=r.eventCenter;return o.stepDrag=new e.StepDrag({onDragging:o.handleDragging,onDragEnd:o.handleDragEnd,step:a,eventType:"LABEL",model:i,eventCenter:s}),o.state={isEditing:!1,isHovered:!1,isDragging:!1},o}return f(n,t),n.prototype.componentDidMount=function(){var t=this,n=this.props,o=n.label,i=n.element,r=n.graphModel;r.eventCenter.on("blank:click,node:click,edge:click",(function(){var n,a,s,l;if(t.state.isEditing){t.setState({isEditing:!1});var u=null!==(a=null===(n=t.textRef.current)||void 0===n?void 0:n.innerText)&&void 0!==a?a:"",c=null!==(l=null===(s=t.textRef.current)||void 0===s?void 0:s.innerHTML)&&void 0!==l?l:"",d=i.properties._label,h=Gu(d,(function(t){return t.id===o.id})),p=d[h];d[h]=g(g({},p),{value:u,content:c});var f=r.getElement(i.id);null==f||f.setProperty("_label",d),i.setElementState(e.ElementState.DEFAULT)}t.textRef.current&&(t.textRef.current.contentEditable="false")}))},n.prototype.componentDidUpdate=function(){},n.prototype.componentWillUnmount=function(){this.props.graphModel.eventCenter.off("blank:click,node:click,edge:click")},n.prototype.render=function(){var t,e=this.props,n=e.label,o=e.element,i=e.graphModel,r=this.state,a=r.isDragging,s=r.isHovered,l=r.isEditing,u=i.transformModel.getTransformStyle().transform,c=n.id,d=n.x,h=n.y,p=n.zIndex,f=n.vertical,v=n.style,y=n.rotate,m=n.content,b=n.labelWidth,x=n.textOverflowMode,_=null!=b?b:"node"===o.BaseType?o.width-20:80,E={left:"".concat(d-_/2,"px"),top:"".concat(h-10,"px"),width:"".concat(_,"px"),height:"20px",zIndex:null!=p?p:1,transform:y?"".concat(u," rotate(").concat(y,"deg)"):"".concat(u," rotate(").concat(f?-.25:0,"turn)")};return gg("div",{id:"element-container-".concat(c),className:Rw("lf-label-editor-container"),style:E,onMouseDown:this.handleMouseDown,onDblClick:this.handleDbClick,onBlur:this.handleBlur,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,children:gg("div",{ref:this.textRef,id:"editor-container-".concat(c),className:Rw("lf-label-editor",(t={"lf-label-editor-dragging":a,"lf-label-editor-editing":l,"lf-label-editor-hover":!l&&s},t["lf-label-editor-".concat(x)]=!l,t)),style:g({maxWidth:"".concat(_,"px"),width:"".concat(_,"px")},v),dangerouslySetInnerHTML:{__html:m}})})},n=y([e.observer],n)}(e.Component),Lw=e.LogicFlowUtil.createUuid,Iw=function(){function t(t,e,n){var o;this.type="label",this.content="",this.value="",this.style={},this.vertical=!1,this.editable=!0,this.draggable=!0,this.textOverflowMode="default",this.element=e,this.graphModel=n,this.id=null!==(o=t.id)&&void 0!==o?o:Lw(),this.initLabelData(t)}return t.prototype.initLabelData=function(t){li(this,t)},t.prototype.getData=function(){return{id:this.id,x:this.x,y:this.y,content:this.content,value:this.value,rotate:this.rotate,style:e.toJS(this.style),draggable:this.draggable,editable:this.editable,labelWidth:this.labelWidth,textOverflowMode:this.textOverflowMode,vertical:this.vertical}},y([e.observable],t.prototype,"x",void 0),y([e.observable],t.prototype,"y",void 0),y([e.observable],t.prototype,"content",void 0),y([e.observable],t.prototype,"value",void 0),y([e.observable],t.prototype,"rotate",void 0),y([e.observable],t.prototype,"style",void 0),y([e.observable],t.prototype,"zIndex",void 0),y([e.observable],t.prototype,"vertical",void 0),y([e.observable],t.prototype,"editable",void 0),y([e.observable],t.prototype,"draggable",void 0),y([e.observable],t.prototype,"labelWidth",void 0),y([e.observable],t.prototype,"textOverflowMode",void 0),t}(),jw={},Bw={get exports(){return jw},set exports(t){jw=t}};!function(t){"classList"in document.createElement("_")||function(t){if("Element"in t){var e="classList",n="prototype",o=t.Element[n],i=Object,r=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},a=Array[n].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1},s=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},l=function(t,e){if(""===e)throw new s("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new s("INVALID_CHARACTER_ERR","String contains an invalid character");return a.call(t,e)},u=function(t){for(var e=r.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],o=0,i=n.length;o<i;o++)this.push(n[o]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},c=u[n]=[],d=function(){return new u(this)};if(s[n]=Error[n],c.item=function(t){return this[t]||null},c.contains=function(t){return-1!==l(this,t+="")},c.add=function(){var t,e=arguments,n=0,o=e.length,i=!1;do{-1===l(this,t=e[n]+"")&&(this.push(t),i=!0)}while(++n<o);i&&this._updateClassName()},c.remove=function(){var t,e,n=arguments,o=0,i=n.length,r=!1;do{for(e=l(this,t=n[o]+"");-1!==e;)this.splice(e,1),r=!0,e=l(this,t)}while(++o<i);r&&this._updateClassName()},c.toggle=function(t,e){t+="";var n=this.contains(t),o=n?!0!==e&&"remove":!1!==e&&"add";return o&&this[o](t),!0===e||!1===e?e:!n},c.toString=function(){return this.join(" ")},i.defineProperty){var h={get:d,enumerable:!0,configurable:!0};try{i.defineProperty(o,e,h)}catch(t){-2146823252===t.number&&(h.enumerable=!1,i.defineProperty(o,e,h))}}else i[n].__defineGetter__&&o.__defineGetter__(e,d)}}(self),function(t){if(t.URL=t.URL||t.webkitURL,t.Blob&&t.URL)try{return void new Blob}catch(t){}var e=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||function(t){var e=function(t){return Object.prototype.toString.call(t).match(/^\[object\s(.*)\]$/)[1]},n=function(){this.data=[]},o=function(t,e,n){this.data=t,this.size=t.length,this.type=e,this.encoding=n},i=n.prototype,r=o.prototype,a=t.FileReaderSync,s=function(t){this.code=this[this.name=t]},l="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),u=l.length,c=t.URL||t.webkitURL||t,d=c.createObjectURL,h=c.revokeObjectURL,p=c,f=t.btoa,g=t.atob,v=t.ArrayBuffer,y=t.Uint8Array,m=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(o.fake=r.fake=!0;u--;)s.prototype[l[u]]=u+1;return c.createObjectURL||(p=t.URL=function(t){var e,n=document.createElementNS("http://www.w3.org/1999/xhtml","a");return n.href=t,"origin"in n||("data:"===n.protocol.toLowerCase()?n.origin=null:(e=t.match(m),n.origin=e&&e[1])),n}),p.createObjectURL=function(t){var e,n=t.type;return null===n&&(n="application/octet-stream"),t instanceof o?(e="data:"+n,"base64"===t.encoding?e+";base64,"+t.data:"URI"===t.encoding?e+","+decodeURIComponent(t.data):f?e+";base64,"+f(t.data):e+","+encodeURIComponent(t.data)):d?d.call(c,t):void 0},p.revokeObjectURL=function(t){"data:"!==t.substring(0,5)&&h&&h.call(c,t)},i.append=function(t){var n=this.data;if(y&&(t instanceof v||t instanceof y)){for(var i="",r=new y(t),l=0,u=r.length;l<u;l++)i+=String.fromCharCode(r[l]);n.push(i)}else if("Blob"===e(t)||"File"===e(t)){if(!a)throw new s("NOT_READABLE_ERR");var c=new a;n.push(c.readAsBinaryString(t))}else t instanceof o?"base64"===t.encoding&&g?n.push(g(t.data)):"URI"===t.encoding?n.push(decodeURIComponent(t.data)):"raw"===t.encoding&&n.push(t.data):("string"!=typeof t&&(t+=""),n.push(unescape(encodeURIComponent(t))))},i.getBlob=function(t){return arguments.length||(t=null),new o(this.data.join(""),t,"raw")},i.toString=function(){return"[object BlobBuilder]"},r.slice=function(t,e,n){var i=arguments.length;return i<3&&(n=null),new o(this.data.slice(t,i>1?e:this.data.length),n,this.encoding)},r.toString=function(){return"[object Blob]"},r.close=function(){this.size=0,delete this.data},n}(t);t.Blob=function(t,n){var o=n&&n.type||"",i=new e;if(t)for(var r=0,a=t.length;r<a;r++)Uint8Array&&t[r]instanceof Uint8Array?i.append(t[r].buffer):i.append(t[r]);var s=i.getBlob(o);return!s.slice&&s.webkitSlice&&(s.slice=s.webkitSlice),s};var n=Object.getPrototypeOf||function(t){return t.__proto__};t.Blob.prototype=n(new t.Blob)}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||Ow.content||Ow),function(e,n){"undefined"!=typeof process&&process&&process.versions&&process.versions.electron?e.MediumEditor=n:t.exports=n}(Ow,function(){function t(t,e){return this.init(t,e)}var e,n,o,i,r,a,s,l,u,c,d;return t.extensions={},function(e){function n(t,e){var n,o=Array.prototype.slice.call(arguments,2);e=e||{};for(var i=0;i<o.length;i++){var r=o[i];if(r)for(n in r)r.hasOwnProperty(n)&&void 0!==r[n]&&(t||!1===e.hasOwnProperty(n))&&(e[n]=r[n])}return e}var o=!1;try{var i=document.createElement("div"),r=document.createTextNode(" ");i.appendChild(r),o=i.contains(r)}catch(t){}var a={isIE:"Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&null!==new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent),isEdge:null!==/Edge\/\d+/.exec(navigator.userAgent),isFF:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isMac:e.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77,V:86},isMetaCtrlKey:function(t){return!!(a.isMac&&t.metaKey||!a.isMac&&t.ctrlKey)},isKey:function(t,e){var n=a.getKeyCode(t);return!1===Array.isArray(e)?n===e:-1!==e.indexOf(n)},getKeyCode:function(t){var e=t.which;return null===e&&(e=null!==t.charCode?t.charCode:t.keyCode),e},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var t=[!0].concat(Array.prototype.slice.call(arguments));return n.apply(this,t)},defaults:function(){var t=[!1].concat(Array.prototype.slice.call(arguments));return n.apply(this,t)},createLink:function(t,e,n,o){var i=t.createElement("a");return a.moveTextRangeIntoElement(e[0],e[e.length-1],i),i.setAttribute("href",n),o&&("_blank"===o&&i.setAttribute("rel","noopener noreferrer"),i.setAttribute("target",o)),i},findOrCreateMatchingTextNodes:function(t,e,n){for(var o=t.createTreeWalker(e,NodeFilter.SHOW_ALL,null,!1),i=[],r=0,s=!1,l=null,u=null;null!==(l=o.nextNode());)if(!(l.nodeType>3))if(3===l.nodeType){if(!s&&n.start<r+l.nodeValue.length&&(s=!0,u=a.splitStartNodeIfNeeded(l,n.start,r)),s&&a.splitEndNodeIfNeeded(l,u,n.end,r),s&&r===n.end)break;if(s&&r>n.end+1)throw new Error("PerformLinking overshot the target!");s&&i.push(u||l),r+=l.nodeValue.length,null!==u&&(r+=u.nodeValue.length,o.nextNode()),u=null}else"img"===l.tagName.toLowerCase()&&(!s&&n.start<=r&&(s=!0),s&&i.push(l));return i},splitStartNodeIfNeeded:function(t,e,n){return e!==n?t.splitText(e-n):null},splitEndNodeIfNeeded:function(t,e,n,o){var i,r;i=o+t.nodeValue.length+(e?e.nodeValue.length:0)-1,r=n-o-(e?t.nodeValue.length:0),i>=n&&o!==i&&0!==r&&(e||t).splitText(r)},splitByBlockElements:function(e){if(3!==e.nodeType&&1!==e.nodeType)return[];var n=[],o=t.util.blockContainerElementNames.join(",");if(3===e.nodeType||0===e.querySelectorAll(o).length)return[e];for(var i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(3===r.nodeType)n.push(r);else if(1===r.nodeType){0===r.querySelectorAll(o).length?n.push(r):n=n.concat(t.util.splitByBlockElements(r))}}return n},findAdjacentTextNodeWithContent:function(t,e,n){var o,i=!1,r=n.createNodeIterator(t,NodeFilter.SHOW_TEXT,null,!1);for(o=r.nextNode();o;){if(o===e)i=!0;else if(i&&3===o.nodeType&&o.nodeValue&&o.nodeValue.trim().length>0)break;o=r.nextNode()}return o},findPreviousSibling:function(t){if(!t||a.isMediumEditorElement(t))return!1;for(var e=t.previousSibling;!e&&!a.isMediumEditorElement(t.parentNode);)e=(t=t.parentNode).previousSibling;return e},isDescendant:function(t,e,n){if(!t||!e)return!1;if(t===e)return!!n;if(1!==t.nodeType)return!1;if(o||3!==e.nodeType)return t.contains(e);for(var i=e.parentNode;null!==i;){if(i===t)return!0;i=i.parentNode}return!1},isElement:function(t){return!(!t||1!==t.nodeType)},throttle:function(t,e){var n,o,i,r=null,a=0,s=function(){a=Date.now(),r=null,i=t.apply(n,o),r||(n=o=null)};return e||0===e||(e=50),function(){var l=Date.now(),u=e-(l-a);return n=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),a=l,i=t.apply(n,o),r||(n=o=null)):r||(r=setTimeout(s,u)),i}},traverseUp:function(t,e){if(!t)return!1;do{if(1===t.nodeType){if(e(t))return t;if(a.isMediumEditorElement(t))return!1}t=t.parentNode}while(t);return!1},htmlEntities:function(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},insertHTMLCommand:function(e,n){var o,i,r,s,l,u,c,d=!1,h=["insertHTML",!1,n];if(!t.util.isEdge&&e.queryCommandSupported("insertHTML"))try{return e.execCommand.apply(e,h)}catch(t){}if((o=e.getSelection()).rangeCount){if(c=(i=o.getRangeAt(0)).commonAncestorContainer,a.isMediumEditorElement(c)&&!c.firstChild)i.selectNode(c.appendChild(e.createTextNode("")));else if(3===c.nodeType&&0===i.startOffset&&i.endOffset===c.nodeValue.length||3!==c.nodeType&&c.innerHTML===i.toString()){for(;!a.isMediumEditorElement(c)&&c.parentNode&&1===c.parentNode.childNodes.length&&!a.isMediumEditorElement(c.parentNode);)c=c.parentNode;i.selectNode(c)}for(i.deleteContents(),(r=e.createElement("div")).innerHTML=n,s=e.createDocumentFragment();r.firstChild;)l=r.firstChild,u=s.appendChild(l);i.insertNode(s),u&&((i=i.cloneRange()).setStartAfter(u),i.collapse(!0),t.selection.selectRange(e,i)),d=!0}return e.execCommand.callListeners&&e.execCommand.callListeners(h,d),d},execFormatBlock:function(e,n){var o=a.getTopBlockContainer(t.selection.getSelectionStart(e));if("blockquote"===n){if(o&&Array.prototype.slice.call(o.childNodes).some((function(t){return a.isBlockContainer(t)})))return e.execCommand("outdent",!1,null);if(a.isIE)return e.execCommand("indent",!1,n)}if(o&&n===o.nodeName.toLowerCase()&&(n="p"),a.isIE&&(n="<"+n+">"),o&&"blockquote"===o.nodeName.toLowerCase()){if(a.isIE&&"<p>"===n)return e.execCommand("outdent",!1,n);if((a.isFF||a.isEdge)&&"p"===n)return Array.prototype.slice.call(o.childNodes).some((function(t){return!a.isBlockContainer(t)}))&&e.execCommand("formatBlock",!1,n),e.execCommand("outdent",!1,n)}return e.execCommand("formatBlock",!1,n)},setTargetBlank:function(t,e){var n,o=e||!1;if("a"===t.nodeName.toLowerCase())t.target="_blank",t.rel="noopener noreferrer";else for(t=t.getElementsByTagName("a"),n=0;n<t.length;n+=1)!1!==o&&o!==t[n].attributes.href.value||(t[n].target="_blank",t[n].rel="noopener noreferrer")},removeTargetBlank:function(t,e){var n;if("a"===t.nodeName.toLowerCase())t.removeAttribute("target"),t.removeAttribute("rel");else for(t=t.getElementsByTagName("a"),n=0;n<t.length;n+=1)e===t[n].attributes.href.value&&(t[n].removeAttribute("target"),t[n].removeAttribute("rel"))},addClassToAnchors:function(t,e){var n,o,i=e.split(" ");if("a"===t.nodeName.toLowerCase())for(o=0;o<i.length;o+=1)t.classList.add(i[o]);else{var r=t.getElementsByTagName("a");if(0===r.length){var s=a.getClosestTag(t,"a");t=s?[s]:[]}else t=r;for(n=0;n<t.length;n+=1)for(o=0;o<i.length;o+=1)t[n].classList.add(i[o])}},isListItem:function(t){if(!t)return!1;if("li"===t.nodeName.toLowerCase())return!0;for(var e=t.parentNode,n=e.nodeName.toLowerCase();"li"===n||!a.isBlockContainer(e)&&"div"!==n;){if("li"===n)return!0;if(!(e=e.parentNode))return!1;n=e.nodeName.toLowerCase()}return!1},cleanListDOM:function(e,n){if("li"===n.nodeName.toLowerCase()){var o=n.parentElement;"p"===o.parentElement.nodeName.toLowerCase()&&(a.unwrap(o.parentElement,e),t.selection.moveCursor(e,n.firstChild,n.firstChild.textContent.length))}},splitOffDOMTree:function(t,e,n){for(var o=e,i=null,r=!n;o!==t;){var a,s=o.parentNode,l=s.cloneNode(!1),u=r?o:s.firstChild;for(i&&(r?l.appendChild(i):a=i),i=l;u;){var c=u.nextSibling;u===o?(u.hasChildNodes()?u=u.cloneNode(!1):u.parentNode.removeChild(u),u.textContent&&i.appendChild(u),u=r?c:null):(u.parentNode.removeChild(u),(u.hasChildNodes()||u.textContent)&&i.appendChild(u),u=c)}a&&i.appendChild(a),o=s}return i},moveTextRangeIntoElement:function(t,e,n){if(!t||!e)return!1;var o=a.findCommonRoot(t,e);if(!o)return!1;if(e===t){var i=t.parentNode,r=t.nextSibling;return i.removeChild(t),n.appendChild(t),r?i.insertBefore(n,r):i.appendChild(n),n.hasChildNodes()}for(var s,l,u,c=[],d=0;d<o.childNodes.length;d++)if(u=o.childNodes[d],s){if(a.isDescendant(u,e,!0)){l=u;break}c.push(u)}else a.isDescendant(u,t,!0)&&(s=u);var h=l.nextSibling,p=o.ownerDocument.createDocumentFragment();return s===t?(s.parentNode.removeChild(s),p.appendChild(s)):p.appendChild(a.splitOffDOMTree(s,t)),c.forEach((function(t){t.parentNode.removeChild(t),p.appendChild(t)})),l===e?(l.parentNode.removeChild(l),p.appendChild(l)):p.appendChild(a.splitOffDOMTree(l,e,!0)),n.appendChild(p),l.parentNode===o?o.insertBefore(n,l):h?o.insertBefore(n,h):o.appendChild(n),n.hasChildNodes()},depthOfNode:function(t){for(var e=0,n=t;null!==n.parentNode;)n=n.parentNode,e++;return e},findCommonRoot:function(t,e){for(var n=a.depthOfNode(t),o=a.depthOfNode(e),i=t,r=e;n!==o;)n>o?(i=i.parentNode,n-=1):(r=r.parentNode,o-=1);for(;i!==r;)i=i.parentNode,r=r.parentNode;return i},isElementAtBeginningOfBlock:function(t){for(var e;!a.isBlockContainer(t)&&!a.isMediumEditorElement(t);){for(e=t;e=e.previousSibling;)if((3===e.nodeType?e.nodeValue:e.textContent).length>0)return!1;t=t.parentNode}return!0},isMediumEditorElement:function(t){return t&&t.getAttribute&&!!t.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(t){return a.traverseUp(t,(function(t){return a.isMediumEditorElement(t)}))},isBlockContainer:function(t){return t&&3!==t.nodeType&&-1!==a.blockContainerElementNames.indexOf(t.nodeName.toLowerCase())},getClosestBlockContainer:function(t){return a.traverseUp(t,(function(t){return a.isBlockContainer(t)||a.isMediumEditorElement(t)}))},getTopBlockContainer:function(t){var e=!!a.isBlockContainer(t)&&t;return a.traverseUp(t,(function(t){return a.isBlockContainer(t)&&(e=t),!(e||!a.isMediumEditorElement(t))&&(e=t,!0)})),e},getFirstSelectableLeafNode:function(t){for(;t&&t.firstChild;)t=t.firstChild;if("table"===(t=a.traverseUp(t,(function(t){return-1===a.emptyElementNames.indexOf(t.nodeName.toLowerCase())}))).nodeName.toLowerCase()){var e=t.querySelector("th, td");e&&(t=e)}return t},getFirstTextNode:function(t){return a.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),a._getFirstTextNode(t)},_getFirstTextNode:function(t){if(3===t.nodeType)return t;for(var e=0;e<t.childNodes.length;e++){var n=a._getFirstTextNode(t.childNodes[e]);if(null!==n)return n}return null},ensureUrlHasProtocol:function(t){return-1===t.indexOf("://")?"http://"+t:t},warn:function(){void 0!==e.console&&"function"==typeof e.console.warn&&e.console.warn.apply(e.console,arguments)},deprecated:function(t,e,n){var o=t+" is deprecated, please use "+e+" instead.";n&&(o+=" Will be removed in "+n),a.warn(o)},deprecatedMethod:function(t,e,n,o){a.deprecated(t,e,o),"function"==typeof this[e]&&this[e].apply(this,n)},cleanupAttrs:function(t,e){e.forEach((function(e){t.removeAttribute(e)}))},cleanupTags:function(t,e){-1!==e.indexOf(t.nodeName.toLowerCase())&&t.parentNode.removeChild(t)},unwrapTags:function(e,n){-1!==n.indexOf(e.nodeName.toLowerCase())&&t.util.unwrap(e,document)},getClosestTag:function(t,e){return a.traverseUp(t,(function(t){return t.nodeName.toLowerCase()===e.toLowerCase()}))},unwrap:function(t,e){for(var n=e.createDocumentFragment(),o=Array.prototype.slice.call(t.childNodes),i=0;i<o.length;i++)n.appendChild(o[i]);n.childNodes.length?t.parentNode.replaceChild(n,t):t.parentNode.removeChild(t)},guid:function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}};t.util=a}(window),(e=function(e){t.util.extend(this,e)}).extend=function(e){var n,o=this;n=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return o.apply(this,arguments)},t.util.extend(n,o);var i=function(){this.constructor=n};return i.prototype=o.prototype,n.prototype=new i,e&&t.util.extend(n.prototype,e),n},e.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,getInteractionElements:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(t){return this.base.options[t]}},["execAction","on","off","subscribe","trigger"].forEach((function(t){e.prototype[t]=function(){return this.base[t].apply(this.base,arguments)}})),t.Extension=e,function(){function e(e){return t.util.isBlockContainer(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}var n={findMatchingSelectionParent:function(e,n){var o,i=n.getSelection();return 0!==i.rangeCount&&(o=i.getRangeAt(0).commonAncestorContainer,t.util.traverseUp(o,e))},getSelectionElement:function(e){return this.findMatchingSelectionParent((function(e){return t.util.isMediumEditorElement(e)}),e)},exportSelection:function(t,e){if(!t)return null;var n=null,o=e.getSelection();if(o.rangeCount>0){var i,r=o.getRangeAt(0),a=r.cloneRange();a.selectNodeContents(t),a.setEnd(r.startContainer,r.startOffset),n={start:i=a.toString().length,end:i+r.toString().length},this.doesRangeStartWithImages(r,e)&&(n.startsWithImage=!0);var s=this.getTrailingImageCount(t,n,r.endContainer,r.endOffset);if(s&&(n.trailingImageCount=s),0!==i){var l=this.getIndexRelativeToAdjacentEmptyBlocks(e,t,r.startContainer,r.startOffset);-1!==l&&(n.emptyBlocksIndex=l)}}return n},importSelection:function(t,e,n,o){if(t&&e){var i=n.createRange();i.setStart(e,0),i.collapse(!0);var r,a=e,s=[],l=0,u=!1,c=!1,d=0,h=!1,p=!1,f=null;for((o||t.startsWithImage||void 0!==t.emptyBlocksIndex)&&(p=!0);!h&&a;)if(a.nodeType>3)a=s.pop();else{if(3!==a.nodeType||c){if(t.trailingImageCount&&c&&("img"===a.nodeName.toLowerCase()&&d++,d===t.trailingImageCount)){for(var g=0;a.parentNode.childNodes[g]!==a;)g++;i.setEnd(a.parentNode,g+1),h=!0}if(!h&&1===a.nodeType)for(var v=a.childNodes.length-1;v>=0;)s.push(a.childNodes[v]),v-=1}else r=l+a.length,!u&&t.start>=l&&t.start<=r&&(p||t.start<r?(i.setStart(a,t.start-l),u=!0):f=a),u&&t.end>=l&&t.end<=r&&(t.trailingImageCount?c=!0:(i.setEnd(a,t.end-l),h=!0)),l=r;h||(a=s.pop())}!u&&f&&(i.setStart(f,f.length),i.setEnd(f,f.length)),void 0!==t.emptyBlocksIndex&&(i=this.importSelectionMoveCursorPastBlocks(n,e,t.emptyBlocksIndex,i)),o&&(i=this.importSelectionMoveCursorPastAnchor(t,i)),this.selectRange(n,i)}},importSelectionMoveCursorPastAnchor:function(e,n){if(e.start===e.end&&3===n.startContainer.nodeType&&n.startOffset===n.startContainer.nodeValue.length&&t.util.traverseUp(n.startContainer,(function(t){return"a"===t.nodeName.toLowerCase()}))){for(var o=n.startContainer,i=n.startContainer.parentNode;null!==i&&"a"!==i.nodeName.toLowerCase();)i.childNodes[i.childNodes.length-1]!==o?i=null:(o=i,i=i.parentNode);if(null!==i&&"a"===i.nodeName.toLowerCase()){for(var r=null,a=0;null===r&&a<i.parentNode.childNodes.length;a++)i.parentNode.childNodes[a]===i&&(r=a);n.setStart(i.parentNode,r+1),n.collapse(!0)}}return n},importSelectionMoveCursorPastBlocks:function(n,o,i,r){var a,s,l=n.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,e,!1),u=r.startContainer,c=0;for(i=i||1,a=3===u.nodeType&&t.util.isBlockContainer(u.previousSibling)?u.previousSibling:t.util.getClosestBlockContainer(u);l.nextNode();)if(s){if(s=l.currentNode,++c===i)break;if(s.textContent.length>0)break}else a===l.currentNode&&(s=l.currentNode);return s||(s=a),r.setStart(t.util.getFirstSelectableLeafNode(s),0),r},getIndexRelativeToAdjacentEmptyBlocks:function(n,o,i,r){if(i.textContent.length>0&&r>0)return-1;var a=i;if(3!==a.nodeType&&(a=i.childNodes[r]),a){if(!t.util.isElementAtBeginningOfBlock(a))return-1;var s=t.util.findPreviousSibling(a);if(!s)return-1;if(s.nodeValue)return-1}for(var l=t.util.getClosestBlockContainer(i),u=n.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,e,!1),c=0;u.nextNode();){var d=""===u.currentNode.textContent;if((d||c>0)&&(c+=1),u.currentNode===l)return c;d||(c=0)}return c},doesRangeStartWithImages:function(t,e){if(0!==t.startOffset||1!==t.startContainer.nodeType)return!1;if("img"===t.startContainer.nodeName.toLowerCase())return!0;var n=t.startContainer.querySelector("img");if(!n)return!1;for(var o=e.createTreeWalker(t.startContainer,NodeFilter.SHOW_ALL,null,!1);o.nextNode();){var i=o.currentNode;if(i===n)break;if(i.nodeValue)return!1}return!0},getTrailingImageCount:function(t,e,n,o){if(0===o||1!==n.nodeType)return 0;if("img"!==n.nodeName.toLowerCase()&&!n.querySelector("img"))return 0;for(var i=n.childNodes[o-1];i.hasChildNodes();)i=i.lastChild;for(var r,a=t,s=[],l=0,u=!1,c=!1,d=!1,h=0;!d&&a;)if(a.nodeType>3)a=s.pop();else{if(3!==a.nodeType||c){if("img"===a.nodeName.toLowerCase()&&h++,a===i)d=!0;else if(1===a.nodeType)for(var p=a.childNodes.length-1;p>=0;)s.push(a.childNodes[p]),p-=1}else h=0,r=l+a.length,!u&&e.start>=l&&e.start<=r&&(u=!0),u&&e.end>=l&&e.end<=r&&(c=!0),l=r;d||(a=s.pop())}return h},selectionContainsContent:function(t){var e=t.getSelection();if(!e||e.isCollapsed||!e.rangeCount)return!1;if(""!==e.toString().trim())return!0;var n=this.getSelectedParentElement(e.getRangeAt(0));return!(!n||!("img"===n.nodeName.toLowerCase()||1===n.nodeType&&n.querySelector("img")))},selectionInContentEditableFalse:function(t){var e,n=this.findMatchingSelectionParent((function(t){var n=t&&t.getAttribute("contenteditable");return"true"===n&&(e=!0),"#text"!==t.nodeName&&"false"===n}),t);return!e&&n},getSelectionHtml:function(t){var e,n,o,i="",r=t.getSelection();if(r.rangeCount){for(o=t.createElement("div"),e=0,n=r.rangeCount;e<n;e+=1)o.appendChild(r.getRangeAt(e).cloneContents());i=o.innerHTML}return i},getCaretOffsets:function(t,e){var n,o;return e||(e=window.getSelection().getRangeAt(0)),n=e.cloneRange(),o=e.cloneRange(),n.selectNodeContents(t),n.setEnd(e.endContainer,e.endOffset),o.selectNodeContents(t),o.setStart(e.endContainer,e.endOffset),{left:n.toString().length,right:o.toString().length}},rangeSelectsSingleNode:function(t){var e=t.startContainer;return e===t.endContainer&&e.hasChildNodes()&&t.endOffset===t.startOffset+1},getSelectedParentElement:function(t){return t?this.rangeSelectsSingleNode(t)&&3!==t.startContainer.childNodes[t.startOffset].nodeType?t.startContainer.childNodes[t.startOffset]:3===t.startContainer.nodeType?t.startContainer.parentNode:t.startContainer:null},getSelectedElements:function(t){var e,n,o,i=t.getSelection();if(!i.rangeCount||i.isCollapsed||!i.getRangeAt(0).commonAncestorContainer)return[];if(3===(e=i.getRangeAt(0)).commonAncestorContainer.nodeType){for(n=[],o=e.commonAncestorContainer;o.parentNode&&1===o.parentNode.childNodes.length;)n.push(o.parentNode),o=o.parentNode;return n}return[].filter.call(e.commonAncestorContainer.getElementsByTagName("*"),(function(t){return"function"!=typeof i.containsNode||i.containsNode(t,!0)}))},selectNode:function(t,e){var n=e.createRange();n.selectNodeContents(t),this.selectRange(e,n)},select:function(t,e,n,o,i){var r=t.createRange();return r.setStart(e,n),o?r.setEnd(o,i):r.collapse(!0),this.selectRange(t,r),r},clearSelection:function(t,e){e?t.getSelection().collapseToStart():t.getSelection().collapseToEnd()},moveCursor:function(t,e,n){this.select(t,e,n)},getSelectionRange:function(t){var e=t.getSelection();return 0===e.rangeCount?null:e.getRangeAt(0)},selectRange:function(t,e){var n=t.getSelection();n.removeAllRanges(),n.addRange(e)},getSelectionStart:function(t){var e=t.getSelection().anchorNode;return e&&3===e.nodeType?e.parentNode:e}};t.selection=n}(),function(){function e(e,n){return!!e&&e.some((function(e){if("function"!=typeof e.getInteractionElements)return!1;var o=e.getInteractionElements();return!!o&&(Array.isArray(o)||(o=[o]),o.some((function(e){return t.util.isDescendant(e,n,!0)})))}))}var n=function(t){this.base=t,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};n.prototype={InputEventOnContenteditableSupported:!t.util.isIE&&!t.util.isEdge,attachDOMEvent:function(e,n,o,i){var r=this.base.options.contentWindow,a=this.base.options.ownerDocument;e=t.util.isElement(e)||[r,a].indexOf(e)>-1?[e]:e,Array.prototype.forEach.call(e,function(t){t.addEventListener(n,o,i),this.events.push([t,n,o,i])}.bind(this))},detachDOMEvent:function(e,n,o,i){var r,a,s=this.base.options.contentWindow,l=this.base.options.ownerDocument;e&&(e=t.util.isElement(e)||[s,l].indexOf(e)>-1?[e]:e,Array.prototype.forEach.call(e,function(t){-1!==(r=this.indexOfListener(t,n,o,i))&&(a=this.events.splice(r,1)[0])[0].removeEventListener(a[1],a[2],a[3])}.bind(this)))},indexOfListener:function(t,e,n,o){var i,r,a;for(i=0,r=this.events.length;i<r;i+=1)if((a=this.events[i])[0]===t&&a[1]===e&&a[2]===n&&a[3]===o)return i;return-1},detachAllDOMEvents:function(){for(var t=this.events.pop();t;)t[0].removeEventListener(t[1],t[2],t[3]),t=this.events.pop()},detachAllEventsFromElement:function(t){for(var e=this.events.filter((function(e){return e&&e[0].getAttribute&&e[0].getAttribute("medium-editor-index")===t.getAttribute("medium-editor-index")})),n=0,o=e.length;n<o;n++){var i=e[n];this.detachDOMEvent(i[0],i[1],i[2],i[3])}},attachAllEventsToElement:function(t){this.listeners.editableInput&&(this.contentCache[t.getAttribute("medium-editor-index")]=t.innerHTML),this.eventsCache&&this.eventsCache.forEach((function(e){this.attachDOMEvent(t,e.name,e.handler.bind(this))}),this)},enableCustomEvent:function(t){void 0!==this.disabledEvents[t]&&delete this.disabledEvents[t]},disableCustomEvent:function(t){this.disabledEvents[t]=!0},attachCustomEvent:function(t,e){this.setupListener(t),this.customEvents[t]||(this.customEvents[t]=[]),this.customEvents[t].push(e)},detachCustomEvent:function(t,e){var n=this.indexOfCustomListener(t,e);-1!==n&&this.customEvents[t].splice(n,1)},indexOfCustomListener:function(t,e){return this.customEvents[t]&&this.customEvents[t].length?this.customEvents[t].indexOf(e):-1},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(t,e,n){this.customEvents[t]&&!this.disabledEvents[t]&&this.customEvents[t].forEach((function(t){t(e,n)}))},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach((function(t){t.removeAttribute("data-medium-focused")}))},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=function(t){this.handleDocumentExecCommand(t)}.bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var t=this.options.ownerDocument;if(this.execCommandListener&&t.execCommand.listeners){var e=t.execCommand.listeners.indexOf(this.execCommandListener);-1!==e&&t.execCommand.listeners.splice(e,1),t.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var t=this.options.ownerDocument;if(!t.execCommand.listeners){var e=function(e,n){t.execCommand.listeners&&t.execCommand.listeners.forEach((function(t){t({command:e[0],value:e[2],args:e,result:n})}))},n=function(){var n=t.execCommand.orig.apply(this,arguments);if(!t.execCommand.listeners)return n;var o=Array.prototype.slice.call(arguments);return e(o,n),n};n.orig=t.execCommand,n.listeners=[],n.callListeners=e,t.execCommand=n}},unwrapExecCommand:function(){var t=this.options.ownerDocument;t.execCommand.orig&&(t.execCommand=t.execCommand.orig)},setupListener:function(t){if(!this.listeners[t]){switch(t){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache={},this.base.elements.forEach((function(t){this.contentCache[t.getAttribute("medium-editor-index")]=t.innerHTML}),this),this.InputEventOnContenteditableSupported&&this.attachToEachElement("input",this.handleInput),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":case"editableKeydownEnter":case"editableKeydownTab":case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste)}this.listeners[t]=!0}},attachToEachElement:function(t,e){this.eventsCache||(this.eventsCache=[]),this.base.elements.forEach((function(n){this.attachDOMEvent(n,t,e.bind(this))}),this),this.eventsCache.push({name:t,handler:e})},cleanupElement:function(t){var e=t.getAttribute("medium-editor-index");e&&(this.detachAllEventsFromElement(t),this.contentCache&&delete this.contentCache[e])},focusElement:function(t){t.focus(),this.updateFocus(t,{target:t,type:"focus"})},updateFocus:function(n,o){var i,r=this.base.getFocusedElement();r&&"click"===o.type&&this.lastMousedownTarget&&(t.util.isDescendant(r,this.lastMousedownTarget,!0)||e(this.base.extensions,this.lastMousedownTarget))&&(i=r),i||this.base.elements.some((function(e){return!i&&t.util.isDescendant(e,n,!0)&&(i=e),!!i}),this);var a=!t.util.isDescendant(r,n,!0)&&!e(this.base.extensions,n);i!==r&&(r&&a&&(r.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",o,r)),i&&(i.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",o,i))),a&&this.triggerCustomEvent("externalInteraction",o)},updateInput:function(t,e){if(this.contentCache){var n=t.getAttribute("medium-editor-index"),o=t.innerHTML;o!==this.contentCache[n]&&this.triggerCustomEvent("editableInput",e,t),this.contentCache[n]=o}},handleDocumentSelectionChange:function(e){if(e.currentTarget&&e.currentTarget.activeElement){var n,o=e.currentTarget.activeElement;this.base.elements.some((function(e){return!!t.util.isDescendant(e,o,!0)&&(n=e,!0)}),this),n&&this.updateInput(n,{target:o,currentTarget:n})}},handleDocumentExecCommand:function(){var t=this.base.getFocusedElement();t&&this.updateInput(t,{target:t,currentTarget:t})},handleBodyClick:function(t){this.updateFocus(t.target,t)},handleBodyFocus:function(t){this.updateFocus(t.target,t)},handleBodyMousedown:function(t){this.lastMousedownTarget=t.target},handleInput:function(t){this.updateInput(t.currentTarget,t)},handleClick:function(t){this.triggerCustomEvent("editableClick",t,t.currentTarget)},handleBlur:function(t){this.triggerCustomEvent("editableBlur",t,t.currentTarget)},handleKeypress:function(t){if(this.triggerCustomEvent("editableKeypress",t,t.currentTarget),this.keypressUpdateInput){var e={target:t.target,currentTarget:t.currentTarget};setTimeout(function(){this.updateInput(e.currentTarget,e)}.bind(this),0)}},handleKeyup:function(t){this.triggerCustomEvent("editableKeyup",t,t.currentTarget)},handleMouseover:function(t){this.triggerCustomEvent("editableMouseover",t,t.currentTarget)},handleDragging:function(t){this.triggerCustomEvent("editableDrag",t,t.currentTarget)},handleDrop:function(t){this.triggerCustomEvent("editableDrop",t,t.currentTarget)},handlePaste:function(t){this.triggerCustomEvent("editablePaste",t,t.currentTarget)},handleKeydown:function(e){return this.triggerCustomEvent("editableKeydown",e,e.currentTarget),t.util.isKey(e,t.util.keyCode.SPACE)?this.triggerCustomEvent("editableKeydownSpace",e,e.currentTarget):t.util.isKey(e,t.util.keyCode.ENTER)||e.ctrlKey&&t.util.isKey(e,t.util.keyCode.M)?this.triggerCustomEvent("editableKeydownEnter",e,e.currentTarget):t.util.isKey(e,t.util.keyCode.TAB)?this.triggerCustomEvent("editableKeydownTab",e,e.currentTarget):t.util.isKey(e,[t.util.keyCode.DELETE,t.util.keyCode.BACKSPACE])?this.triggerCustomEvent("editableKeydownDelete",e,e.currentTarget):void 0}},t.Events=n}(),n=t.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(e){n.isBuiltInButton(e)?t.Extension.call(this,this.defaults[e]):t.Extension.call(this,e)},init:function(){t.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return"function"==typeof this.action?this.action(this.base.options):this.action},getAria:function(){return"function"==typeof this.aria?this.aria(this.base.options):this.aria},getTagNames:function(){return"function"==typeof this.tagNames?this.tagNames(this.base.options):this.tagNames},createButton:function(){var t=this.document.createElement("button"),e=this.contentDefault,n=this.getAria(),o=this.getEditorOption("buttonLabels");return t.classList.add("medium-editor-action"),t.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach((function(e){t.classList.add(e)})),t.setAttribute("data-action",this.getAction()),n&&(t.setAttribute("title",n),t.setAttribute("aria-label",n)),this.attrs&&Object.keys(this.attrs).forEach((function(e){t.setAttribute(e,this.attrs[e])}),this),"fontawesome"===o&&this.contentFA&&(e=this.contentFA),t.innerHTML=e,t},handleClick:function(t){t.preventDefault(),t.stopPropagation();var e=this.getAction();e&&this.execAction(e)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")),delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var t=null;return this.useQueryState&&(t=this.base.queryCommandState(this.getAction())),t},isAlreadyApplied:function(t){var e,n,o=!1,i=this.getTagNames();return!1===this.knownState||!0===this.knownState?this.knownState:(i&&i.length>0&&(o=-1!==i.indexOf(t.nodeName.toLowerCase())),!o&&this.style&&(e=this.style.value.split("|"),n=this.window.getComputedStyle(t,null).getPropertyValue(this.style.prop),e.forEach((function(t){this.knownState||((o=-1!==n.indexOf(t))||"text-decoration"!==this.style.prop)&&(this.knownState=o)}),this)),o)}}),n.isBuiltInButton=function(e){return"string"==typeof e&&t.extensions.button.prototype.defaults.hasOwnProperty(e)},t.extensions.button=n,t.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"<b>B</b>",contentFA:'<i class="fa fa-bold"></i>'},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"<b><i>I</i></b>",contentFA:'<i class="fa fa-italic"></i>'},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"<b><u>U</u></b>",contentFA:'<i class="fa fa-underline"></i>'},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"<s>A</s>",contentFA:'<i class="fa fa-strikethrough"></i>'},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"<b>x<sup>1</sup></b>",contentFA:'<i class="fa fa-superscript"></i>'},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"<b>x<sub>1</sub></b>",contentFA:'<i class="fa fa-subscript"></i>'},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"<b>image</b>",contentFA:'<i class="fa fa-picture-o"></i>'},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"<b>html</b>",contentFA:'<i class="fa fa-code"></i>'},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"<b>1.</b>",contentFA:'<i class="fa fa-list-ol"></i>'},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"<b>•</b>",contentFA:'<i class="fa fa-list-ul"></i>'},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"<b>→</b>",contentFA:'<i class="fa fa-indent"></i>'},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"<b>←</b>",contentFA:'<i class="fa fa-outdent"></i>'},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"<b>C</b>",contentFA:'<i class="fa fa-align-center"></i>'},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"<b>J</b>",contentFA:'<i class="fa fa-align-justify"></i>'},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"<b>L</b>",contentFA:'<i class="fa fa-align-left"></i>'},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"<b>R</b>",contentFA:'<i class="fa fa-align-right"></i>'},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"<b>X</b>",contentFA:'<i class="fa fa-eraser"></i>'},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"<b>“</b>",contentFA:'<i class="fa fa-quote-right"></i>'},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"<b>0101</b>",contentFA:'<i class="fa fa-code fa-lg"></i>'},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"<b>H1</b>",contentFA:'<i class="fa fa-header"><sup>1</sup>'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"<b>H2</b>",contentFA:'<i class="fa fa-header"><sup>2</sup>'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"<b>H3</b>",contentFA:'<i class="fa fa-header"><sup>3</sup>'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"<b>H4</b>",contentFA:'<i class="fa fa-header"><sup>4</sup>'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"<b>H5</b>",contentFA:'<i class="fa fa-header"><sup>5</sup>'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"<b>H6</b>",contentFA:'<i class="fa fa-header"><sup>6</sup>'}},o=t.extensions.button.extend({init:function(){t.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"✓",formCloseLabel:"×",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return!!this.hasForm&&this.getForm().classList.contains(this.activeClass)},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var t=this.base.getExtensionByName("toolbar");t&&t.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var t=this.base.getExtensionByName("toolbar");t&&t.hideToolbarDefaultActions()},setToolbarPosition:function(){var t=this.base.getExtensionByName("toolbar");t&&t.setToolbarPosition()}}),t.extensions.form=o,i=t.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"<b>#</b>",contentFA:'<i class="fa fa-link"></i>',init:function(){t.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(e){e.preventDefault(),e.stopPropagation();var n=t.selection.getSelectionRange(this.document);return"a"===n.startContainer.nodeName.toLowerCase()||"a"===n.endContainer.nodeName.toLowerCase()||t.util.getClosestTag(t.selection.getSelectedParentElement(n),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(e){t.util.isKey(e,t.util.keyCode.K)&&t.util.isMetaCtrlKey(e)&&!e.shiftKey&&this.handleClick(e)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var t=['<input type="text" class="medium-editor-toolbar-input" placeholder="',this.placeholderText,'">'];return t.push('<a href="#" class="medium-editor-toolbar-save">',"fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':this.formSaveLabel,"</a>"),t.push('<a href="#" class="medium-editor-toolbar-close">',"fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':this.formCloseLabel,"</a>"),this.targetCheckbox&&t.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-target" id="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">','<label for="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">',this.targetCheckboxText,"</label>","</div>"),this.customClassOption&&t.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-button">',"<label>",this.customClassOptionText,"</label>","</div>"),t.join("")},isDisplayed:function(){return t.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){t.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(e){var n=this.getInput(),o=this.getAnchorTargetCheckbox(),i=this.getAnchorButtonCheckbox();if("string"==typeof(e=e||{value:""})&&(e={value:e}),this.base.saveSelection(),this.hideToolbarDefaultActions(),t.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),n.value=e.value,n.focus(),o&&(o.checked="_blank"===e.target),i){var r=e.buttonClass?e.buttonClass.split(" "):[];i.checked=-1!==r.indexOf(this.customClassOption)}},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},getFormOpts:function(){var t=this.getAnchorTargetCheckbox(),e=this.getAnchorButtonCheckbox(),n={value:this.getInput().value.trim()};return this.linkValidation&&(n.value=this.checkLinkFormat(n.value)),n.target="_self",t&&t.checked&&(n.target="_blank"),e&&e.checked&&(n.buttonClass=this.customClassOption),n},doFormSave:function(){var t=this.getFormOpts();this.completeFormSave(t)},completeFormSave:function(t){this.base.restoreSelection(),this.execAction(this.action,t),this.base.checkSelection()},ensureEncodedUri:function(t){return t===decodeURI(t)?encodeURI(t):t},ensureEncodedUriComponent:function(t){return t===decodeURIComponent(t)?encodeURIComponent(t):t},ensureEncodedParam:function(t){var e=t.split("="),n=e[0],o=e[1];return n+(void 0===o?"":"="+this.ensureEncodedUriComponent(o))},ensureEncodedQuery:function(t){return t.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(t){var e=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i.test(t),n="",o=t.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),i=o[1],r=o[2],a=o[3];if(/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/.test(t))return"tel:"+t;if(!e){var s=i.split("/")[0];(s.match(/.+(\.|:).+/)||"localhost"===s)&&(n="http://")}return n+this.ensureEncodedUri(i)+(void 0===r?"":"?"+this.ensureEncodedQuery(r))+(void 0===a?"":"#"+a)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(t){var e=t.querySelector(".medium-editor-toolbar-close"),n=t.querySelector(".medium-editor-toolbar-save"),o=t.querySelector(".medium-editor-toolbar-input");this.on(t,"click",this.handleFormClick.bind(this)),this.on(o,"keyup",this.handleTextboxKeyup.bind(this)),this.on(e,"click",this.handleCloseClick.bind(this)),this.on(n,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var t=this.document.createElement("div");return t.className="medium-editor-toolbar-form",t.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),t.innerHTML=this.getTemplate(),this.attachFormEvents(t),t},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(e){if(e.keyCode===t.util.keyCode.ENTER)return e.preventDefault(),void this.doFormSave();e.keyCode===t.util.keyCode.ESCAPE&&(e.preventDefault(),this.doFormCancel())},handleFormClick:function(t){t.stopPropagation()},handleSaveClick:function(t){t.preventDefault(),this.doFormSave()},handleCloseClick:function(t){t.preventDefault(),this.doFormCancel()}}),t.extensions.anchor=i,r=t.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,showOnEmptyLinks:!0,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getInteractionElements:function(){return this.getPreviewElement()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var t=this.document.createElement("div");return t.id="medium-editor-anchor-preview-"+this.getEditorId(),t.className="medium-editor-anchor-preview",t.innerHTML=this.getTemplate(),this.on(t,"click",this.handleClick.bind(this)),t},getTemplate:function(){return'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <a class="medium-editor-toolbar-anchor-preview-inner"></a></div>'},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview&&this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(t){return!(!this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")&&!t.getAttribute("data-disable-preview"))||(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=t.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=t.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=t,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(t){t=t||this.activeAnchor;var e,n,o,i,r,a=this.window.innerWidth,s=this.anchorPreview.offsetHeight,l=t.getBoundingClientRect(),u=this.diffLeft,c=this.diffTop,d=this.getEditorOption("elementsContainer"),h=["absolute","fixed"].indexOf(window.getComputedStyle(d).getPropertyValue("position"))>-1,p={};e=this.anchorPreview.offsetWidth/2;var f=this.base.getExtensionByName("toolbar");f&&(u=f.diffLeft,c=f.diffTop),n=u-e,h?(i=d.getBoundingClientRect(),["top","left"].forEach((function(t){p[t]=l[t]-i[t]})),p.width=l.width,p.height=l.height,l=p,a=i.width,r=d.scrollTop):r=this.window.pageYOffset,o=l.left+l.width/2,r+=s+l.top+l.height-c-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(r)+"px",this.anchorPreview.style.right="initial",o<e?(this.anchorPreview.style.left=n+e+"px",this.anchorPreview.style.right="initial"):a-o<e?(this.anchorPreview.style.left="auto",this.anchorPreview.style.right=0):(this.anchorPreview.style.left=n+o+"px",this.anchorPreview.style.right="initial")},attachToEditables:function(){this.subscribe("editableMouseover",this.handleEditableMouseover.bind(this)),this.subscribe("positionedToolbar",this.handlePositionedToolbar.bind(this))},handlePositionedToolbar:function(){this.showWhenToolbarIsVisible||this.hidePreview()},handleClick:function(t){var e=this.base.getExtensionByName("anchor"),n=this.activeAnchor;e&&n&&(t.preventDefault(),this.base.selectElement(this.activeAnchor),this.base.delay(function(){if(n){var t={value:n.attributes.href.value,target:n.getAttribute("target"),buttonClass:n.getAttribute("class")};e.showForm(t),n=null}}.bind(this))),this.hidePreview()},handleAnchorMouseout:function(){this.anchorToPreview=null,this.off(this.activeAnchor,"mouseout",this.instanceHandleAnchorMouseout),this.instanceHandleAnchorMouseout=null},handleEditableMouseover:function(e){var n=t.util.getClosestTag(e.target,"a");if(!1!==n){if(!this.showOnEmptyLinks&&(!/href=["']\S+["']/.test(n.outerHTML)||/href=["']#\S+["']/.test(n.outerHTML)))return!0;var o=this.base.getExtensionByName("toolbar");if(!this.showWhenToolbarIsVisible&&o&&o.isDisplayed&&o.isDisplayed())return!0;this.activeAnchor&&this.activeAnchor!==n&&this.detachPreviewHandlers(),this.anchorToPreview=n,this.instanceHandleAnchorMouseout=this.handleAnchorMouseout.bind(this),this.on(this.anchorToPreview,"mouseout",this.instanceHandleAnchorMouseout),this.base.delay(function(){this.anchorToPreview&&this.showPreview(this.anchorToPreview)}.bind(this))}},handlePreviewMouseover:function(){this.lastOver=(new Date).getTime(),this.hovering=!0},handlePreviewMouseout:function(t){t.relatedTarget&&/anchor-preview/.test(t.relatedTarget.className)||(this.hovering=!1)},updatePreview:function(){if(this.hovering)return!0;(new Date).getTime()-this.lastOver>this.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=(new Date).getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}}),t.extensions.anchorPreview=r,function(){var e,n,o,i,r;function a(e){return!t.util.getClosestTag(e,"a")}e=[" ","\t","\n","\r"," "," "," "," "," ","\u2028","\u2029"],o="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+(n="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw")+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+n+"))",i=new RegExp("^("+n+")$","i"),r=new RegExp(o,"gi");var s=t.Extension.extend({init:function(){t.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var t=0,e=0;e<this.window._mediumEditors.length;e++){var n=this.window._mediumEditors[e];null!==n&&void 0!==n.getExtensionByName("autoLink")&&t++}return 1===t},destroy:function(){this.document.queryCommandSupported("AutoUrlDetect")&&this.isLastInstance()&&this.document.execCommand("AutoUrlDetect",!1,!0)},onBlur:function(t,e){this.performLinking(e)},onKeypress:function(e){this.disableEventHandling||t.util.isKey(e,[t.util.keyCode.SPACE,t.util.keyCode.ENTER])&&(clearTimeout(this.performLinkingTimeout),this.performLinkingTimeout=setTimeout(function(){try{var t=this.base.exportSelection();this.performLinking(e.target)&&this.base.importSelection(t,!0)}catch(t){window.console&&window.console.error("Failed to perform linking",t),this.disableEventHandling=!0}}.bind(this),0))},performLinking:function(e){var n=t.util.splitByBlockElements(e),o=!1;0===n.length&&(n=[e]);for(var i=0;i<n.length;i++)o=this.removeObsoleteAutoLinkSpans(n[i])||o,o=this.performLinkingWithinElement(n[i])||o;return this.base.events.updateInput(e,{target:e,currentTarget:e}),o},removeObsoleteAutoLinkSpans:function(e){if(!e||3===e.nodeType)return!1;for(var n=e.querySelectorAll('span[data-auto-link="true"]'),o=!1,i=0;i<n.length;i++){var r=n[i].textContent;if(-1===r.indexOf("://")&&(r=t.util.ensureUrlHasProtocol(r)),n[i].getAttribute("data-href")!==r&&a(n[i])){o=!0;var s=r.replace(/\s+$/,"");if(n[i].getAttribute("data-href")===s){var l=r.length-s.length,u=t.util.splitOffDOMTree(n[i],this.splitTextBeforeEnd(n[i],l));n[i].parentNode.insertBefore(u,n[i].nextSibling)}else t.util.unwrap(n[i],this.document)}}return o},splitTextBeforeEnd:function(t,e){for(var n,o,i,r=this.document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null,!1),a=!0;a;)a=null!==r.lastChild();for(;e>0&&null!==i;)(o=(n=r.currentNode).nodeValue).length>e?(i=n.splitText(o.length-e),e=0):(i=r.previousNode(),e-=o.length);return i},performLinkingWithinElement:function(e){for(var n=this.findLinkableText(e),o=0;o<n.length;o++){var i=t.util.findOrCreateMatchingTextNodes(this.document,e,n[o]);this.shouldNotLink(i)||this.createAutoLink(i,n[o].href)}return!1},shouldNotLink:function(e){for(var n=!1,o=0;o<e.length&&!1===n;o++)n=!!t.util.traverseUp(e[o],(function(t){return"a"===t.nodeName.toLowerCase()||t.getAttribute&&"true"===t.getAttribute("data-auto-link")}));return n},findLinkableText:function(t){for(var n=t.textContent,o=null,a=[];null!==(o=r.exec(n));){var s=o.index+o[0].length;!(0!==o.index&&-1===e.indexOf(n[o.index-1])||s!==n.length&&-1===e.indexOf(n[s]))&&(-1!==o[0].indexOf("/")||i.test(o[0].split(".").pop().split("?").shift()))&&a.push({href:o[0],start:o.index,end:s})}return a},createAutoLink:function(e,n){n=t.util.ensureUrlHasProtocol(n);var o=t.util.createLink(this.document,e,n,this.getEditorOption("targetBlank")?"_blank":null),i=this.document.createElement("span");for(i.setAttribute("data-auto-link","true"),i.setAttribute("data-href",n),o.insertBefore(i,o.firstChild);o.childNodes.length>1;)i.appendChild(o.childNodes[1])}});t.extensions.autoLink=s}(),function(){var e="medium-editor-dragover";function n(n){var o=t.util.getContainerEditorElement(n);Array.prototype.slice.call(o.parentElement.querySelectorAll("."+e)).forEach((function(t){t.classList.remove(e)}))}var o=t.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){t.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(t){t.preventDefault(),t.dataTransfer.dropEffect="copy";var o=t.target.classList?t.target:t.target.parentElement;n(o),"dragover"===t.type&&o.classList.add(e)},handleDrop:function(t){t.preventDefault(),t.stopPropagation(),this.base.selectElement(t.target);var e=this.base.exportSelection();e.start=e.end,this.base.importSelection(e),t.dataTransfer.files&&Array.prototype.slice.call(t.dataTransfer.files).forEach((function(t){this.isAllowedFile(t)&&t.type.match("image")&&this.insertImageFile(t)}),this),n(t.target)},isAllowedFile:function(t){return this.allowedTypes.some((function(e){return!!t.type.match(e)}))},insertImageFile:function(e){if("function"==typeof FileReader){var n=new FileReader;n.readAsDataURL(e),n.addEventListener("load",function(e){var n=this.document.createElement("img");n.src=e.target.result,t.util.insertHTMLCommand(this.document,n.outerHTML)}.bind(this))}}});t.extensions.fileDragging=o}(),a=t.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){t.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach((function(t){var e=t.key.charCodeAt(0);this.keys[e]||(this.keys[e]=[]),this.keys[e].push(t)}),this)},handleKeydown:function(e){var n=t.util.getKeyCode(e);if(this.keys[n]){var o=t.util.isMetaCtrlKey(e),i=!!e.shiftKey,r=!!e.altKey;this.keys[n].forEach((function(t){t.meta!==o||t.shift!==i||t.alt!==r&&void 0!==t.alt||(e.preventDefault(),e.stopPropagation(),"function"==typeof t.command?t.command.apply(this):!1!==t.command&&this.execAction(t.command))}),this)}}}),t.extensions.keyboardCommands=a,s=t.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'<i class="fa fa-font"></i>',fonts:["","Arial","Verdana","Times New Roman"],init:function(){t.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(t){if(t.preventDefault(),t.stopPropagation(),!this.isDisplayed()){var e=this.document.queryCommandValue("fontName")+"";this.showForm(e)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(t){var e=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),e.value=t||"",e.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var t,e=this.document,n=e.createElement("div"),o=e.createElement("select"),i=e.createElement("a"),r=e.createElement("a");n.className="medium-editor-toolbar-form",n.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(n,"click",this.handleFormClick.bind(this));for(var a=0;a<this.fonts.length;a++)(t=e.createElement("option")).innerHTML=this.fonts[a],t.value=this.fonts[a],o.appendChild(t);return o.className="medium-editor-toolbar-select",n.appendChild(o),this.on(o,"change",this.handleFontChange.bind(this)),r.setAttribute("href","#"),r.className="medium-editor-toobar-save",r.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':"✓",n.appendChild(r),this.on(r,"click",this.handleSaveClick.bind(this),!0),i.setAttribute("href","#"),i.className="medium-editor-toobar-close",i.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':"×",n.appendChild(i),this.on(i,"click",this.handleCloseClick.bind(this)),n},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){t.selection.getSelectedElements(this.document).forEach((function(t){"font"===t.nodeName.toLowerCase()&&t.hasAttribute("face")&&t.removeAttribute("face")}))},handleFontChange:function(){var t=this.getSelect().value;""===t?this.clearFontName():this.execAction("fontName",{value:t})},handleFormClick:function(t){t.stopPropagation()},handleSaveClick:function(t){t.preventDefault(),this.doFormSave()},handleCloseClick:function(t){t.preventDefault(),this.doFormCancel()}}),t.extensions.fontName=s,l=t.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'<i class="fa fa-text-height"></i>',init:function(){t.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(t){if(t.preventDefault(),t.stopPropagation(),!this.isDisplayed()){var e=this.document.queryCommandValue("fontSize")+"";this.showForm(e)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(t){var e=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),e.value=t||"",e.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var t=this.document,e=t.createElement("div"),n=t.createElement("input"),o=t.createElement("a"),i=t.createElement("a");return e.className="medium-editor-toolbar-form",e.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(e,"click",this.handleFormClick.bind(this)),n.setAttribute("type","range"),n.setAttribute("min","1"),n.setAttribute("max","7"),n.className="medium-editor-toolbar-input",e.appendChild(n),this.on(n,"change",this.handleSliderChange.bind(this)),i.setAttribute("href","#"),i.className="medium-editor-toobar-save",i.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':"✓",e.appendChild(i),this.on(i,"click",this.handleSaveClick.bind(this),!0),o.setAttribute("href","#"),o.className="medium-editor-toobar-close",o.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':"×",e.appendChild(o),this.on(o,"click",this.handleCloseClick.bind(this)),e},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){t.selection.getSelectedElements(this.document).forEach((function(t){"font"===t.nodeName.toLowerCase()&&t.hasAttribute("size")&&t.removeAttribute("size")}))},handleSliderChange:function(){var t=this.getInput().value;"4"===t?this.clearFontSize():this.execAction("fontSize",{value:t})},handleFormClick:function(t){t.stopPropagation()},handleSaveClick:function(t){t.preventDefault(),this.doFormSave()},handleCloseClick:function(t){t.preventDefault(),this.doFormCancel()}}),t.extensions.fontSize=l,function(){var e="%ME_PASTEBIN%",n=null,o=null,i=function(t){t.stopPropagation()};function r(t,e,n){var o=t.clipboardData||e.clipboardData||n.dataTransfer,i={};if(!o)return i;if(o.getData){var r=o.getData("Text");r&&r.length>0&&(i["text/plain"]=r)}if(o.types)for(var a=0;a<o.types.length;a++){var s=o.types[a];i[s]=o.getData(s)}return i}var a=t.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],unwrapTags:[],init:function(){t.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&(this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.getEditorElements().forEach((function(t){this.on(t,"paste",this.handlePaste.bind(this))}),this),this.subscribe("addElement",this.handleAddElement.bind(this)))},handleAddElement:function(t,e){this.on(e,"paste",this.handlePaste.bind(this))},destroy:function(){(this.forcePlainText||this.cleanPastedHTML)&&this.removePasteBin()},handlePaste:function(t,e){if(!t.defaultPrevented){var n=r(t,this.window,this.document),o=n["text/html"],i=n["text/plain"];this.window.clipboardData&&void 0===t.clipboardData&&!o&&(o=i),(o||i)&&(t.preventDefault(),this.doPaste(o,i,e))}},doPaste:function(e,n,o){var i,r,a="";if(this.cleanPastedHTML&&e)return this.cleanPaste(e);if(n){if(this.getEditorOption("disableReturn")||o&&o.getAttribute("data-disable-return"))a=t.util.htmlEntities(n);else if((i=n.split(/[\r\n]+/g)).length>1)for(r=0;r<i.length;r+=1)""!==i[r]&&(a+="<p>"+t.util.htmlEntities(i[r])+"</p>");else a=t.util.htmlEntities(i[0]);t.util.insertHTMLCommand(this.document,a)}},handlePasteBinPaste:function(t){if(t.defaultPrevented)this.removePasteBin();else{var e=r(t,this.window,this.document),n=e["text/html"],i=e["text/plain"],a=o;if(!this.cleanPastedHTML||n)return t.preventDefault(),this.removePasteBin(),this.doPaste(n,i,a),void this.trigger("editablePaste",{currentTarget:a,target:a},a);setTimeout(function(){this.cleanPastedHTML&&(n=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(n,i,a),this.trigger("editablePaste",{currentTarget:a,target:a},a)}.bind(this),0)}},handleKeydown:function(e,n){t.util.isKey(e,t.util.keyCode.V)&&t.util.isMetaCtrlKey(e)&&(e.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(n))},createPasteBin:function(r){var a,s=t.selection.getSelectionRange(this.document),l=this.window.pageYOffset;o=r,s&&((a=s.getClientRects()).length?l+=a[0].top:void 0!==s.startContainer.getBoundingClientRect?l+=s.startContainer.getBoundingClientRect().top:l+=s.getBoundingClientRect().top),n=s;var u=this.document.createElement("div");u.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),u.setAttribute("style","border: 1px red solid; position: absolute; top: "+l+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),u.setAttribute("contentEditable",!0),u.innerHTML=e,this.document.body.appendChild(u),this.on(u,"focus",i),this.on(u,"focusin",i),this.on(u,"focusout",i),u.focus(),t.selection.selectNode(u,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(u,"paste",this.boundHandlePaste)},removePasteBin:function(){null!==n&&(t.selection.selectRange(this.document,n),n=null),null!==o&&(o=null);var e=this.getPasteBin();e&&e&&(this.off(e,"focus",i),this.off(e,"focusin",i),this.off(e,"focusout",i),this.off(e,"paste",this.boundHandlePaste),e.parentElement.removeChild(e))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var t=this.getPasteBin();if(!t)return!1;if(t.firstChild&&"mcepastebin"===t.firstChild.id)return!1;var n=t.innerHTML;return!(!n||n===e)&&n},cleanPaste:function(t){var e,n,o,i,r=/<p|<br|<div/.test(t),a=[].concat(this.preCleanReplacements||[],[[new RegExp(/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g),""],[new RegExp(/<br>$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),'<a href="$1">'],[new RegExp(/<\/p>\n+/gi),"</p>"],[new RegExp(/\n+<p/gi),"<p"],[new RegExp(/<\/?o:[a-z]*>/gi),""],[new RegExp(/<!\[if !supportLists\]>(((?!<!).)*)<!\[endif]\>/gi),"$1"]],this.cleanReplacements||[]);for(e=0;e<a.length;e+=1)t=t.replace(a[e][0],a[e][1]);if(!r)return this.pasteHTML(t);for((o=this.document.createElement("div")).innerHTML="<p>"+t.split("<br><br>").join("</p><p>")+"</p>",n=o.querySelectorAll("a,p,div,br"),e=0;e<n.length;e+=1)switch((i=n[e]).innerHTML=i.innerHTML.replace(/\n/gi," "),i.nodeName.toLowerCase()){case"p":case"div":this.filterCommonBlocks(i);break;case"br":this.filterLineBreak(i)}this.pasteHTML(o.innerHTML)},pasteHTML:function(e,n){n=t.util.defaults({},n,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags,unwrapTags:this.unwrapTags});var o,i,r,a,s=this.document.createDocumentFragment();for(s.appendChild(this.document.createElement("body")),(a=s.querySelector("body")).innerHTML=e,this.cleanupSpans(a),o=a.querySelectorAll("*"),r=0;r<o.length;r+=1)"a"===(i=o[r]).nodeName.toLowerCase()&&this.getEditorOption("targetBlank")&&t.util.setTargetBlank(i),t.util.cleanupAttrs(i,n.cleanAttrs),t.util.cleanupTags(i,n.cleanTags),t.util.unwrapTags(i,n.unwrapTags);t.util.insertHTMLCommand(this.document,a.innerHTML.replace(/ /g," "))},isCommonBlock:function(t){return t&&("p"===t.nodeName.toLowerCase()||"div"===t.nodeName.toLowerCase())},filterCommonBlocks:function(t){/^\s*$/.test(t.textContent)&&t.parentNode&&t.parentNode.removeChild(t)},filterLineBreak:function(t){this.isCommonBlock(t.previousElementSibling)?this.removeWithParent(t):!this.isCommonBlock(t.parentNode)||t.parentNode.firstChild!==t&&t.parentNode.lastChild!==t?t.parentNode&&1===t.parentNode.childElementCount&&""===t.parentNode.textContent&&this.removeWithParent(t):this.removeWithParent(t)},removeWithParent:function(t){t&&t.parentNode&&(t.parentNode.parentNode&&1===t.parentNode.childElementCount?t.parentNode.parentNode.removeChild(t.parentNode):t.parentNode.removeChild(t))},cleanupSpans:function(e){var n,o,i,r=e.querySelectorAll(".replace-with"),a=function(t){return t&&"#text"!==t.nodeName&&"false"===t.getAttribute("contenteditable")};for(n=0;n<r.length;n+=1)o=r[n],i=this.document.createElement(o.classList.contains("bold")?"b":"i"),o.classList.contains("bold")&&o.classList.contains("italic")?i.innerHTML="<i>"+o.innerHTML+"</i>":i.innerHTML=o.innerHTML,o.parentNode.replaceChild(i,o);for(r=e.querySelectorAll("span"),n=0;n<r.length;n+=1){if(o=r[n],t.util.traverseUp(o,a))return!1;t.util.unwrap(o,this.document)}}});t.extensions.paste=a}(),u=t.Extension.extend({name:"placeholder",text:"Type your text",hideOnClick:!0,init:function(){t.Extension.prototype.init.apply(this,arguments),this.initPlaceholders(),this.attachEventHandlers()},initPlaceholders:function(){this.getEditorElements().forEach(this.initElement,this)},handleAddElement:function(t,e){this.initElement(e)},initElement:function(t){t.getAttribute("data-placeholder")||t.setAttribute("data-placeholder",this.text),this.updatePlaceholder(t)},destroy:function(){this.getEditorElements().forEach(this.cleanupElement,this)},handleRemoveElement:function(t,e){this.cleanupElement(e)},cleanupElement:function(t){t.getAttribute("data-placeholder")===this.text&&t.removeAttribute("data-placeholder")},showPlaceholder:function(e){e&&(t.util.isFF&&0===e.childNodes.length?(e.classList.add("medium-editor-placeholder-relative"),e.classList.remove("medium-editor-placeholder")):(e.classList.add("medium-editor-placeholder"),e.classList.remove("medium-editor-placeholder-relative")))},hidePlaceholder:function(t){t&&(t.classList.remove("medium-editor-placeholder"),t.classList.remove("medium-editor-placeholder-relative"))},updatePlaceholder:function(t,e){if(t.querySelector("img, blockquote, ul, ol, table")||""!==t.textContent.replace(/^\s+|\s+$/g,""))return this.hidePlaceholder(t);e||this.showPlaceholder(t)},attachEventHandlers:function(){this.hideOnClick&&this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableInput",this.handleInput.bind(this)),this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("addElement",this.handleAddElement.bind(this)),this.subscribe("removeElement",this.handleRemoveElement.bind(this))},handleInput:function(t,e){var n=this.hideOnClick&&e===this.base.getFocusedElement();this.updatePlaceholder(e,n)},handleFocus:function(t,e){this.hidePlaceholder(e)},handleBlur:function(t,e){this.updatePlaceholder(e)}}),t.extensions.placeholder=u,c=t.Extension.extend({name:"toolbar",align:"center",allowMultiParagraphSelection:!0,buttons:["bold","italic","underline","anchor","h2","h3","quote"],diffLeft:0,diffTop:-10,firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last",standardizeSelectionStart:!1,static:!1,sticky:!1,stickyTopOffset:0,updateOnEmptySelection:!1,relativeContainer:null,init:function(){t.Extension.prototype.init.apply(this,arguments),this.initThrottledMethods(),this.relativeContainer?this.relativeContainer.appendChild(this.getToolbarElement()):this.getEditorOption("elementsContainer").appendChild(this.getToolbarElement())},forEachExtension:function(t,e){return this.base.extensions.forEach((function(n){if(n!==this)return t.apply(e||this,arguments)}),this)},createToolbar:function(){var t=this.document.createElement("div");return t.id="medium-editor-toolbar-"+this.getEditorId(),t.className="medium-editor-toolbar",this.static?t.className+=" static-toolbar":this.relativeContainer?t.className+=" medium-editor-relative-toolbar":t.className+=" medium-editor-stalker-toolbar",t.appendChild(this.createToolbarButtons()),this.forEachExtension((function(e){e.hasForm&&t.appendChild(e.getForm())})),this.attachEventHandlers(),t},createToolbarButtons:function(){var e,n,o,i,r,a,s=this.document.createElement("ul");return s.id="medium-editor-toolbar-actions"+this.getEditorId(),s.className="medium-editor-toolbar-actions",s.style.display="block",this.buttons.forEach((function(o){"string"==typeof o?(r=o,a=null):(r=o.name,a=o),(i=this.base.addBuiltInExtension(r,a))&&"function"==typeof i.getButton&&(n=i.getButton(this.base),e=this.document.createElement("li"),t.util.isElement(n)?e.appendChild(n):e.innerHTML=n,s.appendChild(e))}),this),(o=s.querySelectorAll("button")).length>0&&(o[0].classList.add(this.firstButtonClass),o[o.length-1].classList.add(this.lastButtonClass)),s},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getInteractionElements:function(){return this.getToolbarElement()},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=t.util.throttle(function(){this.base.isActive&&this.positionToolbarIfShown()}.bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this.static&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(e){if(e&&e.target&&t.util.isDescendant(this.getToolbarElement(),e.target))return!1;this.checkState()},handleEditableClick:function(){setTimeout(function(){this.checkState()}.bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout(function(){this.hideToolbar()}.bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return"block"===this.getToolbarActionsElement().style.display},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay(function(){this.showToolbar()}.bind(this))},hideExtensionForms:function(){this.forEachExtension((function(t){t.hasForm&&t.isDisplayed()&&t.hideForm()}))},multipleBlockElementsSelected:function(){var e=new RegExp("<("+t.util.blockContainerElementNames.join("|")+")[^>]*>","g"),n=t.selection.getSelectionHtml(this.document).replace(/<[^\/>][^>]*><\/[^>]+>/gim,"").match(e);return!!n&&n.length>1},modifySelection:function(){var e=this.window.getSelection().getRangeAt(0);if(this.standardizeSelectionStart&&e.startContainer.nodeValue&&e.startOffset===e.startContainer.nodeValue.length){var n=t.util.findAdjacentTextNodeWithContent(t.selection.getSelectionElement(this.window),e.startContainer,this.document);if(n){for(var o=0;0===n.nodeValue.substr(o,1).trim().length;)o+=1;e=t.selection.select(this.document,n,o,e.endContainer,e.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||t.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var e=t.selection.getSelectionElement(this.window);return!e||-1===this.getEditorElements().indexOf(e)||e.getAttribute("data-disable-toolbar")?this.hideToolbar():this.updateOnEmptySelection&&this.static?this.showAndUpdateToolbar():!t.selection.selectionContainsContent(this.document)||!1===this.allowMultiParagraphSelection&&this.multipleBlockElementsSelected()?this.hideToolbar():void this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension((function(t){"function"==typeof t.isActive&&"function"==typeof t.setInactive&&t.setInactive()})),this.checkActiveButtons()},checkActiveButtons:function(){var e,n=[],o=null,i=t.selection.getSelectionRange(this.document),r=function(t){"function"==typeof t.checkState?t.checkState(e):"function"==typeof t.isActive&&"function"==typeof t.isAlreadyApplied&&"function"==typeof t.setActive&&!t.isActive()&&t.isAlreadyApplied(e)&&t.setActive()};if(i&&(this.forEachExtension((function(t){"function"!=typeof t.queryCommandState||null===(o=t.queryCommandState())?n.push(t):o&&"function"==typeof t.setActive&&t.setActive()})),e=t.selection.getSelectedParentElement(i),this.getEditorElements().some((function(n){return t.util.isDescendant(n,e,!0)}))))for(;e&&(n.forEach(r),!t.util.isMediumEditorElement(e));)e=e.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var t=this.base.getFocusedElement(),e=this.window.getSelection();if(!t)return this;!this.static&&e.isCollapsed||(this.showToolbar(),this.relativeContainer||(this.static?this.positionStaticToolbar(t):this.positionToolbar(e)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))},positionStaticToolbar:function(t){this.getToolbarElement().style.left="0";var e,n=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,o=this.window.innerWidth,i=this.getToolbarElement(),r=t.getBoundingClientRect(),a=r.top+n,s=r.left+r.width/2,l=i.offsetHeight,u=i.offsetWidth,c=u/2;switch(this.sticky?n>a+t.offsetHeight-l-this.stickyTopOffset?(i.style.top=a+t.offsetHeight-l+"px",i.classList.remove("medium-editor-sticky-toolbar")):n>a-l-this.stickyTopOffset?(i.classList.add("medium-editor-sticky-toolbar"),i.style.top=this.stickyTopOffset+"px"):(i.classList.remove("medium-editor-sticky-toolbar"),i.style.top=a-l+"px"):i.style.top=a-l+"px",this.align){case"left":e=r.left;break;case"right":e=r.right-u;break;case"center":e=s-c}e<0?e=0:e+u>o&&(e=o-Math.ceil(u)-1),i.style.left=e+"px"},positionToolbar:function(t){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var e=t.getRangeAt(0),n=e.getBoundingClientRect();(!n||0===n.height&&0===n.width&&e.startContainer===e.endContainer)&&(n=1===e.startContainer.nodeType&&e.startContainer.querySelector("img")?e.startContainer.querySelector("img").getBoundingClientRect():e.startContainer.getBoundingClientRect());var o,i,r=this.window.innerWidth,a=this.getToolbarElement(),s=a.offsetHeight,l=a.offsetWidth/2,u=this.diffLeft-l,c=this.getEditorOption("elementsContainer"),d=["absolute","fixed"].indexOf(window.getComputedStyle(c).getPropertyValue("position"))>-1,h={},p={};d?(i=c.getBoundingClientRect(),["top","left"].forEach((function(t){p[t]=n[t]-i[t]})),p.width=n.width,p.height=n.height,n=p,r=i.width,h.top=c.scrollTop):h.top=this.window.pageYOffset,o=n.left+n.width/2,h.top+=n.top-s,n.top<50?(a.classList.add("medium-toolbar-arrow-over"),a.classList.remove("medium-toolbar-arrow-under"),h.top+=50+n.height-this.diffTop):(a.classList.add("medium-toolbar-arrow-under"),a.classList.remove("medium-toolbar-arrow-over"),h.top+=this.diffTop),o<l?(h.left=u+l,h.right="initial"):r-o<l?(h.left="auto",h.right=0):(h.left=u+o,h.right="initial"),["top","left","right"].forEach((function(t){a.style[t]=h[t]+(isNaN(h[t])?"":"px")}))}}),t.extensions.toolbar=c,d=t.Extension.extend({init:function(){t.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(t){var e="medium-editor-dragover";t.preventDefault(),t.dataTransfer.dropEffect="copy","dragover"===t.type?t.target.classList.add(e):"dragleave"===t.type&&t.target.classList.remove(e)},handleDrop:function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.files&&Array.prototype.slice.call(e.dataTransfer.files,0).some(function(e){var n,o;e.type.match("image")&&((n=new FileReader).readAsDataURL(e),o="medium-img-"+ +new Date,t.util.insertHTMLCommand(this.document,'<img class="medium-editor-image-loading" id="'+o+'" />'),n.onload=function(){var t=this.document.getElementById(o);t&&(t.removeAttribute("id"),t.removeAttribute("class"),t.src=n.result)}.bind(this))}.bind(this)),e.target.classList.remove("medium-editor-dragover")}}),t.extensions.imageDragging=d,function(){function e(e){var n=t.selection.getSelectionStart(this.options.ownerDocument),o=n.textContent,i=t.selection.getCaretOffsets(n);(void 0===o[i.left-1]||""===o[i.left-1].trim()||void 0!==o[i.left]&&""===o[i.left].trim())&&e.preventDefault()}function n(e,n){if(this.options.disableReturn||n.getAttribute("data-disable-return"))e.preventDefault();else if(this.options.disableDoubleReturn||n.getAttribute("data-disable-double-return")){var o=t.selection.getSelectionStart(this.options.ownerDocument);(o&&""===o.textContent.trim()&&"li"!==o.nodeName.toLowerCase()||o.previousElementSibling&&"br"!==o.previousElementSibling.nodeName.toLowerCase()&&""===o.previousElementSibling.textContent.trim())&&e.preventDefault()}}function o(e){var n=t.selection.getSelectionStart(this.options.ownerDocument);"pre"===(n&&n.nodeName.toLowerCase())&&(e.preventDefault(),t.util.insertHTMLCommand(this.options.ownerDocument," ")),t.util.isListItem(n)&&(e.preventDefault(),e.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function i(e){var n,o=t.selection.getSelectionStart(this.options.ownerDocument),i=o.nodeName.toLowerCase(),r=/^(\s+|<br\/?>)?$/i,a=/h\d/i;t.util.isKey(e,[t.util.keyCode.BACKSPACE,t.util.keyCode.ENTER])&&o.previousElementSibling&&a.test(i)&&0===t.selection.getCaretOffsets(o).left?t.util.isKey(e,t.util.keyCode.BACKSPACE)&&r.test(o.previousElementSibling.innerHTML)?(o.previousElementSibling.parentNode.removeChild(o.previousElementSibling),e.preventDefault()):!this.options.disableDoubleReturn&&t.util.isKey(e,t.util.keyCode.ENTER)&&((n=this.options.ownerDocument.createElement("p")).innerHTML="<br>",o.previousElementSibling.parentNode.insertBefore(n,o),e.preventDefault()):t.util.isKey(e,t.util.keyCode.DELETE)&&o.nextElementSibling&&o.previousElementSibling&&!a.test(i)&&r.test(o.innerHTML)&&a.test(o.nextElementSibling.nodeName.toLowerCase())?(t.selection.moveCursor(this.options.ownerDocument,o.nextElementSibling),o.previousElementSibling.parentNode.removeChild(o),e.preventDefault()):t.util.isKey(e,t.util.keyCode.BACKSPACE)&&"li"===i&&r.test(o.innerHTML)&&!o.previousElementSibling&&!o.parentElement.previousElementSibling&&o.nextElementSibling&&"li"===o.nextElementSibling.nodeName.toLowerCase()?((n=this.options.ownerDocument.createElement("p")).innerHTML="<br>",o.parentElement.parentElement.insertBefore(n,o.parentElement),t.selection.moveCursor(this.options.ownerDocument,n),o.parentElement.removeChild(o),e.preventDefault()):t.util.isKey(e,t.util.keyCode.BACKSPACE)&&!1!==t.util.getClosestTag(o,"blockquote")&&0===t.selection.getCaretOffsets(o).left?(e.preventDefault(),t.util.execFormatBlock(this.options.ownerDocument,"p")):t.util.isKey(e,t.util.keyCode.ENTER)&&!1!==t.util.getClosestTag(o,"blockquote")&&0===t.selection.getCaretOffsets(o).right?((n=this.options.ownerDocument.createElement("p")).innerHTML="<br>",o.parentElement.insertBefore(n,o.nextSibling),t.selection.moveCursor(this.options.ownerDocument,n),e.preventDefault()):t.util.isKey(e,t.util.keyCode.BACKSPACE)&&t.util.isMediumEditorElement(o.parentElement)&&!o.previousElementSibling&&o.nextElementSibling&&r.test(o.innerHTML)&&(e.preventDefault(),t.selection.moveCursor(this.options.ownerDocument,o.nextSibling),o.parentElement.removeChild(o))}function r(e){var n=t.selection.getSelectionStart(this.options.ownerDocument);n&&(t.util.isMediumEditorElement(n)&&0===n.children.length&&!t.util.isBlockContainer(n)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),!t.util.isKey(e,t.util.keyCode.ENTER)||t.util.isListItem(n)||t.util.isBlockContainer(n)||("a"===n.nodeName.toLowerCase()?this.options.ownerDocument.execCommand("unlink",!1,null):e.shiftKey||e.ctrlKey||this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function a(t,e){var n=e.parentNode.querySelector('textarea[medium-editor-textarea-id="'+e.getAttribute("medium-editor-textarea-id")+'"]');n&&(n.value=e.innerHTML.trim())}function s(t){t._mediumEditors||(t._mediumEditors=[null]),this.id||(this.id=t._mediumEditors.length),t._mediumEditors[this.id]=this}function l(t){t._mediumEditors&&t._mediumEditors[this.id]&&(t._mediumEditors[this.id]=null)}function u(e,n,o){var i=[];if(e||(e=[]),"string"==typeof e&&(e=n.querySelectorAll(e)),t.util.isElement(e)&&(e=[e]),o)for(var r=0;r<e.length;r++){var a=e[r];!t.util.isElement(a)||a.getAttribute("data-medium-editor-element")||a.getAttribute("medium-editor-textarea-id")||i.push(a)}else i=Array.prototype.slice.apply(e);return i}function c(t){var e=t.parentNode.querySelector('textarea[medium-editor-textarea-id="'+t.getAttribute("medium-editor-textarea-id")+'"]');e&&(e.classList.remove("medium-editor-hidden"),e.removeAttribute("medium-editor-textarea-id")),t.parentNode&&t.parentNode.removeChild(t)}function d(t,e,n){return t=function(t,e){return Object.keys(e).forEach((function(n){void 0===t[n]&&(t[n]=e[n])})),t}(t,{window:n.options.contentWindow,document:n.options.ownerDocument,base:n}),"function"==typeof t.init&&t.init(),t.name||(t.name=e),t}function h(){return!this.elements.every((function(t){return!!t.getAttribute("data-disable-toolbar")}))&&!1!==this.options.toolbar}function p(){return!!h.call(this)&&!1!==this.options.anchorPreview}function f(){return!1!==this.options.placeholder}function g(){return!1!==this.options.autoLink}function v(){return!1!==this.options.imageDragging}function y(){return!1!==this.options.keyboardCommands}function m(){return!this.options.extensions.imageDragging}function b(t){for(var e=this.options.ownerDocument.createElement("div"),n=Date.now(),o="medium-editor-"+n,i=t.attributes;this.options.ownerDocument.getElementById(o);)n++,o="medium-editor-"+n;e.className=t.className,e.id=o,e.innerHTML=t.value,t.setAttribute("medium-editor-textarea-id",o);for(var r=0,a=i.length;r<a;r++)e.hasAttribute(i[r].nodeName)||e.setAttribute(i[r].nodeName,i[r].value);return t.form&&this.on(t.form,"reset",function(t){t.defaultPrevented||this.resetContent(this.options.ownerDocument.getElementById(o))}.bind(this)),t.classList.add("medium-editor-hidden"),t.parentNode.insertBefore(e,t),e}function x(e,o){if(!e.getAttribute("data-medium-editor-element")){"textarea"===e.nodeName.toLowerCase()&&(e=b.call(this,e),this.instanceHandleEditableInput||(this.instanceHandleEditableInput=a.bind(this),this.subscribe("editableInput",this.instanceHandleEditableInput))),this.options.disableEditing||e.getAttribute("data-disable-editing")||(e.setAttribute("contentEditable",!0),e.setAttribute("spellcheck",this.options.spellcheck)),this.instanceHandleEditableKeydownEnter||(e.getAttribute("data-disable-return")||e.getAttribute("data-disable-double-return"))&&(this.instanceHandleEditableKeydownEnter=n.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter)),this.options.disableReturn||e.getAttribute("data-disable-return")||this.on(e,"keyup",r.bind(this));var i=t.util.guid();e.setAttribute("data-medium-editor-element",!0),e.classList.add("medium-editor-element"),e.setAttribute("role","textbox"),e.setAttribute("aria-multiline",!0),e.setAttribute("data-medium-editor-editor-index",o),e.setAttribute("medium-editor-index",i),N[i]=e.innerHTML,this.events.attachAllEventsToElement(e)}return e}function _(){this.subscribe("editableKeydownTab",o.bind(this)),this.subscribe("editableKeydownDelete",i.bind(this)),this.subscribe("editableKeydownEnter",i.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",e.bind(this)),this.instanceHandleEditableKeydownEnter||(this.options.disableReturn||this.options.disableDoubleReturn)&&(this.instanceHandleEditableKeydownEnter=n.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter))}function E(){if(this.extensions=[],Object.keys(this.options.extensions).forEach((function(t){"toolbar"!==t&&this.options.extensions[t]&&this.extensions.push(d(this.options.extensions[t],t,this))}),this),m.call(this)){var e=this.options.fileDragging;e||(e={},v.call(this)||(e.allowedTypes=[])),this.addBuiltInExtension("fileDragging",e)}var n={paste:!0,"anchor-preview":p.call(this),autoLink:g.call(this),keyboardCommands:y.call(this),placeholder:f.call(this)};Object.keys(n).forEach((function(t){n[t]&&this.addBuiltInExtension(t)}),this);var o=this.options.extensions.toolbar;if(!o&&h.call(this)){var i=t.util.extend({},this.options.toolbar,{allowMultiParagraphSelection:this.options.allowMultiParagraphSelection});o=new t.extensions.toolbar(i)}o&&this.extensions.push(d(o,"toolbar",this))}function w(e,n){return n&&[["allowMultiParagraphSelection","toolbar.allowMultiParagraphSelection"]].forEach((function(e){n.hasOwnProperty(e[0])&&void 0!==n[e[0]]&&t.util.deprecated(e[0],e[1],"v6.0.0")})),t.util.defaults({},n,e)}function S(e,n){var o,i;if(o=/^append-(.+)$/gi.exec(e))return t.util.execFormatBlock(this.options.ownerDocument,o[1]);if("fontSize"===e)return n.size&&t.util.deprecated(".size option for fontSize command",".value","6.0.0"),i=n.value||n.size,this.options.ownerDocument.execCommand("fontSize",!1,i);if("fontName"===e)return n.name&&t.util.deprecated(".name option for fontName command",".value","6.0.0"),i=n.value||n.name,this.options.ownerDocument.execCommand("fontName",!1,i);if("createLink"===e)return this.createLink(n);if("image"===e){var r=this.options.contentWindow.getSelection().toString().trim();return this.options.ownerDocument.execCommand("insertImage",!1,r)}if("html"===e){var a=this.options.contentWindow.getSelection().toString().trim();return t.util.insertHTMLCommand(this.options.ownerDocument,a)}if(/justify([A-Za-z]*)$/g.exec(e)){var s=this.options.ownerDocument.execCommand(e,!1,null),l=t.selection.getSelectedParentElement(t.selection.getSelectionRange(this.options.ownerDocument));return l&&C.call(this,t.util.getTopBlockContainer(l)),s}return i=n&&n.value,this.options.ownerDocument.execCommand(e,!1,i)}function C(e){if(e){var n,o=Array.prototype.slice.call(e.childNodes).filter((function(t){var e="div"===t.nodeName.toLowerCase();return e&&!n&&(n=t.style.textAlign),e}));o.length&&(this.saveSelection(),o.forEach((function(e){if(e.style.textAlign===n){var o=e.lastChild;if(o){t.util.unwrap(e,this.options.ownerDocument);var i=this.options.ownerDocument.createElement("BR");o.parentNode.insertBefore(i,o.nextSibling)}}}),this),e.style.textAlign=n,this.restoreSelection())}}var N={};t.prototype={init:function(t,e){return this.options=w.call(this,this.defaults,e),this.origElements=t,this.options.elementsContainer||(this.options.elementsContainer=this.options.ownerDocument.body),this.setup()},setup:function(){this.isActive||(s.call(this,this.options.contentWindow),this.events=new t.Events(this),this.elements=[],this.addElements(this.origElements),0!==this.elements.length&&(this.isActive=!0,E.call(this),_.call(this)))},destroy:function(){this.isActive&&(this.isActive=!1,this.extensions.forEach((function(t){"function"==typeof t.destroy&&t.destroy()}),this),this.events.destroy(),this.elements.forEach((function(t){this.options.spellcheck&&(t.innerHTML=t.innerHTML),t.removeAttribute("contentEditable"),t.removeAttribute("spellcheck"),t.removeAttribute("data-medium-editor-element"),t.classList.remove("medium-editor-element"),t.removeAttribute("role"),t.removeAttribute("aria-multiline"),t.removeAttribute("medium-editor-index"),t.removeAttribute("data-medium-editor-editor-index"),t.getAttribute("medium-editor-textarea-id")&&c(t)}),this),this.elements=[],this.instanceHandleEditableKeydownEnter=null,this.instanceHandleEditableInput=null,l.call(this,this.options.contentWindow))},on:function(t,e,n,o){return this.events.attachDOMEvent(t,e,n,o),this},off:function(t,e,n,o){return this.events.detachDOMEvent(t,e,n,o),this},subscribe:function(t,e){return this.events.attachCustomEvent(t,e),this},unsubscribe:function(t,e){return this.events.detachCustomEvent(t,e),this},trigger:function(t,e,n){return this.events.triggerCustomEvent(t,e,n),this},delay:function(t){var e=this;return setTimeout((function(){e.isActive&&t()}),this.options.delay)},serialize:function(){var t,e={},n=this.elements.length;for(t=0;t<n;t+=1)e[""!==this.elements[t].id?this.elements[t].id:"element-"+t]={value:this.elements[t].innerHTML.trim()};return e},getExtensionByName:function(t){var e;return this.extensions&&this.extensions.length&&this.extensions.some((function(n){return n.name===t&&(e=n,!0)})),e},addBuiltInExtension:function(e,n){var o,i=this.getExtensionByName(e);if(i)return i;switch(e){case"anchor":o=t.util.extend({},this.options.anchor,n),i=new t.extensions.anchor(o);break;case"anchor-preview":i=new t.extensions.anchorPreview(this.options.anchorPreview);break;case"autoLink":i=new t.extensions.autoLink;break;case"fileDragging":i=new t.extensions.fileDragging(n);break;case"fontname":i=new t.extensions.fontName(this.options.fontName);break;case"fontsize":i=new t.extensions.fontSize(n);break;case"keyboardCommands":i=new t.extensions.keyboardCommands(this.options.keyboardCommands);break;case"paste":i=new t.extensions.paste(this.options.paste);break;case"placeholder":i=new t.extensions.placeholder(this.options.placeholder);break;default:t.extensions.button.isBuiltInButton(e)&&(n?(o=t.util.defaults({},n,t.extensions.button.prototype.defaults[e]),i=new t.extensions.button(o)):i=new t.extensions.button(e))}return i&&this.extensions.push(d(i,e,this)),i},stopSelectionUpdates:function(){this.preventSelectionUpdates=!0},startSelectionUpdates:function(){this.preventSelectionUpdates=!1},checkSelection:function(){var t=this.getExtensionByName("toolbar");return t&&t.checkState(),this},queryCommandState:function(t){var e,n=null;(e=/^full-(.+)$/gi.exec(t))&&(t=e[1]);try{n=this.options.ownerDocument.queryCommandState(t)}catch(t){n=null}return n},execAction:function(e,n){var o,i;return(o=/^full-(.+)$/gi.exec(e))?(this.saveSelection(),this.selectAllContents(),i=S.call(this,o[1],n),this.restoreSelection()):i=S.call(this,e,n),"insertunorderedlist"!==e&&"insertorderedlist"!==e||t.util.cleanListDOM(this.options.ownerDocument,this.getSelectedParentElement()),this.checkSelection(),i},getSelectedParentElement:function(e){return void 0===e&&(e=this.options.contentWindow.getSelection().getRangeAt(0)),t.selection.getSelectedParentElement(e)},selectAllContents:function(){var e=t.selection.getSelectionElement(this.options.contentWindow);if(e){for(;1===e.children.length;)e=e.children[0];this.selectElement(e)}},selectElement:function(e){t.selection.selectNode(e,this.options.ownerDocument);var n=t.selection.getSelectionElement(this.options.contentWindow);n&&this.events.focusElement(n)},getFocusedElement:function(){var t;return this.elements.some((function(e){return!t&&e.getAttribute("data-medium-focused")&&(t=e),!!t}),this),t},exportSelection:function(){var e=t.selection.getSelectionElement(this.options.contentWindow),n=this.elements.indexOf(e),o=null;return n>=0&&(o=t.selection.exportSelection(e,this.options.ownerDocument)),null!==o&&0!==n&&(o.editableElementIndex=n),o},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(e,n){if(e){var o=this.elements[e.editableElementIndex||0];t.selection.importSelection(e,o,this.options.ownerDocument,n)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(e){var n,o=t.selection.getSelectionElement(this.options.contentWindow),i={};if(-1!==this.elements.indexOf(o)){try{if(this.events.disableCustomEvent("editableInput"),e.url&&t.util.deprecated(".url option for createLink",".value","6.0.0"),(n=e.url||e.value)&&n.trim().length>0){var r=this.options.contentWindow.getSelection();if(r){var a,s,l,u,c=r.getRangeAt(0),d=c.commonAncestorContainer;if(3===c.endContainer.nodeType&&3!==c.startContainer.nodeType&&0===c.startOffset&&c.startContainer.firstChild===c.endContainer&&(d=c.endContainer),s=t.util.getClosestBlockContainer(c.startContainer),l=t.util.getClosestBlockContainer(c.endContainer),3!==d.nodeType&&0!==d.textContent.length&&s===l){var h=s||o,p=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),a=this.exportSelection(),p.appendChild(h.cloneNode(!0)),o===h?t.selection.select(this.options.ownerDocument,h.firstChild,0,h.lastChild,3===h.lastChild.nodeType?h.lastChild.nodeValue.length:h.lastChild.childNodes.length):t.selection.select(this.options.ownerDocument,h,0,h,h.childNodes.length);var f=this.exportSelection();0===(u=t.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,p,{start:a.start-f.start,end:a.end-f.start,editableElementIndex:a.editableElementIndex})).length&&((p=this.options.ownerDocument.createDocumentFragment()).appendChild(d.cloneNode(!0)),u=[p.firstChild.firstChild,p.firstChild.lastChild]),t.util.createLink(this.options.ownerDocument,u,n.trim());var g=(p.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;t.util.insertHTMLCommand(this.options.ownerDocument,p.firstChild.innerHTML.replace(/^\s+/,"")),a.start-=g,a.end-=g,this.importSelection(a)}else this.options.ownerDocument.execCommand("createLink",!1,n);this.options.targetBlank||"_blank"===e.target?t.util.setTargetBlank(t.selection.getSelectionStart(this.options.ownerDocument),n):t.util.removeTargetBlank(t.selection.getSelectionStart(this.options.ownerDocument),n),e.buttonClass&&t.util.addClassToAnchors(t.selection.getSelectionStart(this.options.ownerDocument),e.buttonClass)}}if(this.options.targetBlank||"_blank"===e.target||e.buttonClass){(i=this.options.ownerDocument.createEvent("HTMLEvents")).initEvent("input",!0,!0,this.options.contentWindow);for(var v=0,y=this.elements.length;v<y;v+=1)this.elements[v].dispatchEvent(i)}}finally{this.events.enableCustomEvent("editableInput")}this.events.triggerCustomEvent("editableInput",i,o)}},cleanPaste:function(t){this.getExtensionByName("paste").cleanPaste(t)},pasteHTML:function(t,e){this.getExtensionByName("paste").pasteHTML(t,e)},setContent:function(t,e){if(e=e||0,this.elements[e]){var n=this.elements[e];n.innerHTML=t,this.checkContentChanged(n)}},getContent:function(t){return t=t||0,this.elements[t]?this.elements[t].innerHTML.trim():null},checkContentChanged:function(e){e=e||t.selection.getSelectionElement(this.options.contentWindow),this.events.updateInput(e,{target:e,currentTarget:e})},resetContent:function(t){if(t){var e=this.elements.indexOf(t);-1!==e&&this.setContent(N[t.getAttribute("medium-editor-index")],e)}else this.elements.forEach((function(t,e){this.setContent(N[t.getAttribute("medium-editor-index")],e)}),this)},addElements:function(t){var e=u(t,this.options.ownerDocument,!0);if(0===e.length)return!1;e.forEach((function(t){t=x.call(this,t,this.id),this.elements.push(t),this.trigger("addElement",{target:t,currentTarget:t},t)}),this)},removeElements:function(t){var e=u(t,this.options.ownerDocument).map((function(t){return t.getAttribute("medium-editor-textarea-id")&&t.parentNode?t.parentNode.querySelector('div[medium-editor-textarea-id="'+t.getAttribute("medium-editor-textarea-id")+'"]'):t}));this.elements=this.elements.filter((function(t){return-1===e.indexOf(t)||(this.events.cleanupElement(t),t.getAttribute("medium-editor-textarea-id")&&c(t),this.trigger("removeElement",{target:t,currentTarget:t},t),!1)}),this)}},t.getEditorFromElement=function(t){var e=t.getAttribute("data-medium-editor-editor-index"),n=t&&t.ownerDocument&&(t.ownerDocument.defaultView||t.ownerDocument.parentWindow);return n&&n._mediumEditors&&n._mediumEditors[e]?n._mediumEditors[e]:null}}(),t.prototype.defaults={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableExtraSpaces:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0},t.parseVersionString=function(t){var e=t.split("-"),n=e[0].split("."),o=e.length>1?e[1]:"";return{major:parseInt(n[0],10),minor:parseInt(n[1],10),revision:parseInt(n[2],10),preRelease:o,toString:function(){return[n[0],n[1],n[2]].join(".")+(o?"-"+o:"")}}},t.version=t.parseVersionString.call(this,"5.23.3"),t}())}(Bw);var Hw=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Fw=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),zw=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],o=!0,i=!1,r=void 0;try{for(var a,s=t[Symbol.iterator]();!(o=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);o=!0);}catch(t){i=!0,r=t}finally{try{!o&&s.return&&s.return()}finally{if(i)throw r}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")};String.prototype.startsWith=String.prototype.startsWith||function(t){return 0===this.indexOf(t)},String.prototype.padStart=String.prototype.padStart||function(t,e){for(var n=this;n.length<t;)n=e+n;return n};var Ww={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function Gw(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString())||"0"}var Uw=function(){function t(e,n,o,i){Hw(this,t);var r=this;if(void 0===e);else if(Array.isArray(e))this.rgba=e;else if(void 0===o){var a=e&&""+e;a&&function(e){if(e.startsWith("hsl")){var n=e.match(/([\-\d\.e]+)/g).map(Number),o=zw(n,4),i=o[0],a=o[1],s=o[2],l=o[3];void 0===l&&(l=1),i/=360,a/=100,s/=100,r.hsla=[i,a,s,l]}else if(e.startsWith("rgb")){var u=e.match(/([\-\d\.e]+)/g).map(Number),c=zw(u,4),d=c[0],h=c[1],p=c[2],f=c[3];void 0===f&&(f=1),r.rgba=[d,h,p,f]}else e.startsWith("#")?r.rgba=t.hexToRgb(e):r.rgba=t.nameToRgb(e)||t.hexToRgb(e)}(a.toLowerCase())}else this.rgba=[e,n,o,void 0===i?1:i]}return Fw(t,[{key:"printRGB",value:function(t){var e=(t?this.rgba:this.rgba.slice(0,3)).map((function(t,e){return Gw(t,3===e?3:0)}));return t?"rgba("+e+")":"rgb("+e+")"}},{key:"printHSL",value:function(t){var e=[360,100,100,1],n=["","%","%",""],o=(t?this.hsla:this.hsla.slice(0,3)).map((function(t,o){return Gw(t*e[o],3===o?3:1)+n[o]}));return t?"hsla("+o+")":"hsl("+o+")"}},{key:"printHex",value:function(t){var e=this.hex;return t?e:e.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(t){3===t.length&&(t[3]=1),this._rgba=t,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(t){3===t.length&&(t[3]=1),this._hsla=t,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var t=this.rgba.map((function(t,e){return e<3?t.toString(16):Math.round(255*t).toString(16)}));return"#"+t.map((function(t){return t.padStart(2,"0")})).join("")},set:function(e){this.rgba=t.hexToRgb(e)}}],[{key:"hexToRgb",value:function(t){var e=(t.startsWith("#")?t.slice(1):t).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!e.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+t);var n=e.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(t){return parseInt(t,16)}));return n[3]=n[3]/255,n}},{key:"nameToRgb",value:function(e){var n=e.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),o=Ww[n];return void 0===o?o:t.hexToRgb(o.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(t){var e=zw(t,4),n=e[0],o=e[1],i=e[2],r=e[3];n/=255,o/=255,i/=255;var a=Math.max(n,o,i),s=Math.min(n,o,i),l=void 0,u=void 0,c=(a+s)/2;if(a===s)l=u=0;else{var d=a-s;switch(u=c>.5?d/(2-a-s):d/(a+s),a){case n:l=(o-i)/d+(o<i?6:0);break;case o:l=(i-n)/d+2;break;case i:l=(n-o)/d+4}l/=6}return[l,u,c,r]}},{key:"hslToRgb",value:function(t){var e=zw(t,4),n=e[0],o=e[1],i=e[2],r=e[3],a=void 0,s=void 0,l=void 0;if(0===o)a=s=l=i;else{var u=function(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t},c=i<.5?i*(1+o):i+o-i*o,d=2*i-c;a=u(d,c,n+1/3),s=u(d,c,n),l=u(d,c,n-1/3)}var h=[255*a,255*s,255*l].map(Math.round);return h[3]=r,h}}]),t}(),Xw=function(){function t(){Hw(this,t),this._events=[]}return Fw(t,[{key:"add",value:function(t,e,n){t.addEventListener(e,n,!1),this._events.push({target:t,type:e,handler:n})}},{key:"remove",value:function(e,n,o){this._events=this._events.filter((function(i){var r=!0;return e&&e!==i.target&&(r=!1),n&&n!==i.type&&(r=!1),o&&o!==i.handler&&(r=!1),r&&t._doRemove(i.target,i.type,i.handler),!r}))}},{key:"destroy",value:function(){this._events.forEach((function(e){return t._doRemove(e.target,e.type,e.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(t,e,n){t.removeEventListener(e,n,!1)}}]),t}();function Vw(t,e,n){var o=!1;function i(t,e,n){return Math.max(e,Math.min(t,n))}function r(t,r,a){if(a&&(o=!0),o){t.preventDefault();var s=e.getBoundingClientRect(),l=s.width,u=s.height,c=r.clientX,d=r.clientY,h=i(c-s.left,0,l),p=i(d-s.top,0,u);n(h/l,p/u)}}function a(t,e){1===(void 0===t.buttons?t.which:t.buttons)?r(t,t,e):o=!1}function s(t,e){1===t.touches.length?r(t,t.touches[0],e):o=!1}t.add(e,"mousedown",(function(t){a(t,!0)})),t.add(e,"touchstart",(function(t){s(t,!0)})),t.add(window,"mousemove",a),t.add(e,"touchmove",s),t.add(window,"mouseup",(function(t){o=!1})),t.add(e,"touchend",(function(t){o=!1})),t.add(e,"touchcancel",(function(t){o=!1}))}var Yw="keydown",qw="mousedown",Kw="focusin";function Zw(t,e){return(e||document).querySelector(t)}function $w(t,e,n,o,i){t.add(e,Yw,(function(t){n.indexOf(t.key)>=0&&o(t)}))}var Jw=function(){function t(e){Hw(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new Xw,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return Fw(t,[{key:"setOptions",value:function(t){var e=this;if(t){var n=this.settings;if(t instanceof HTMLElement)n.parent=t;else{n.parent&&t.parent&&n.parent!==t.parent&&(this._events.remove(n.parent),this._popupInited=!1),function(t,e){for(var n in t)e[n]=t[n]}(t,n),t.onChange&&(this.onChange=t.onChange),t.onDone&&(this.onDone=t.onDone),t.onOpen&&(this.onOpen=t.onOpen),t.onClose&&(this.onClose=t.onClose);var o=t.color||t.colour;o&&this._setColor(o)}var i=n.parent;if(i&&n.popup&&!this._popupInited){var r=function(t){return e.openHandler(t)};this._events.add(i,"click",r),$w(this._events,i,[" ","Spacebar","Enter"],r),this._popupInited=!0}else t.parent&&!n.popup&&this.show()}}},{key:"openHandler",value:function(t){if(this.show()){t&&t.preventDefault(),this.settings.parent.style.pointerEvents="none";var e=t&&t.type===Yw?this._domEdit:this.domElement;setTimeout((function(){return e.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(t){var e=t&&t.type,n=!1;if(t)if(e===qw||e===Kw){var o=(this.__containedEvent||0)+100;t.timeStamp>o&&(n=!0)}else!function(t){t.preventDefault(),t.stopPropagation()}(t),n=!0;else n=!0;n&&this.hide()&&(this.settings.parent.style.pointerEvents="",e!==qw&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(t,e){this.closeHandler(),this.setOptions(t),e&&this.openHandler()}},{key:"setColor",value:function(t,e){this._setColor(t,{silent:e})}},{key:"_setColor",value:function(t,e){if("string"==typeof t&&(t=t.trim()),t){e=e||{};var n=void 0;try{n=new Uw(t)}catch(t){if(e.failSilently)return;throw t}if(!this.settings.alpha){var o=n.hsla;o[3]=1,n.hsla=o}this.colour=this.color=n,this._setHSLA(null,null,null,null,e)}}},{key:"setColour",value:function(t,e){this.setColor(t,e)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var t=this._toggleDOM(!0);return this._setPosition(),t}var e,n,o=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',i=(e=o,(n=document.createElement("div")).innerHTML=e,n.firstElementChild);return this.domElement=i,this._domH=Zw(".picker_hue",i),this._domSL=Zw(".picker_sl",i),this._domA=Zw(".picker_alpha",i),this._domEdit=Zw(".picker_editor input",i),this._domSample=Zw(".picker_sample",i),this._domOkay=Zw(".picker_done button",i),this._domCancel=Zw(".picker_cancel button",i),i.classList.add("layout_"+this.settings.layout),this.settings.alpha||i.classList.add("no_alpha"),this.settings.editor||i.classList.add("no_editor"),this.settings.cancelButton||i.classList.add("no_cancel"),this._ifPopup((function(){return i.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var t=this,e=this,n=this.domElement,o=this._events;function i(t,e,n){o.add(t,e,n)}i(n,"click",(function(t){return t.preventDefault()})),Vw(o,this._domH,(function(t,n){return e._setHSLA(t)})),Vw(o,this._domSL,(function(t,n){return e._setHSLA(null,t,1-n)})),this.settings.alpha&&Vw(o,this._domA,(function(t,n){return e._setHSLA(null,null,null,1-n)}));var r=this._domEdit;i(r,"input",(function(t){e._setColor(this.value,{fromEditor:!0,failSilently:!0})})),i(r,"focus",(function(t){var e=this;e.selectionStart===e.selectionEnd&&e.select()})),this._ifPopup((function(){var e=function(e){return t.closeHandler(e)};i(window,qw,e),i(window,Kw,e),$w(o,n,["Esc","Escape"],e);var r=function(e){t.__containedEvent=e.timeStamp};i(n,qw,r),i(n,Kw,r),i(t._domCancel,"click",e)}));var a=function(e){t._ifPopup((function(){return t.closeHandler(e)})),t.onDone&&t.onDone(t.colour)};i(this._domOkay,"click",a),$w(o,n,["Enter"],a)}},{key:"_setPosition",value:function(){var t=this.settings.parent,e=this.domElement;t!==e.parentNode&&t.appendChild(e),this._ifPopup((function(n){"static"===getComputedStyle(t).position&&(t.style.position="relative");var o=!0===n?"popup_right":"popup_"+n;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(t){t===o?e.classList.add(t):e.classList.remove(t)})),e.classList.add(o)}))}},{key:"_setHSLA",value:function(t,e,n,o,i){i=i||{};var r=this.colour,a=r.hsla;[t,e,n,o].forEach((function(t,e){(t||0===t)&&(a[e]=t)})),r.hsla=a,this._updateUI(i),this.onChange&&!i.silent&&this.onChange(r)}},{key:"_updateUI",value:function(t){if(this.domElement){t=t||{};var e=this.colour,n=e.hsla,o="hsl("+360*n[0]+", 100%, 50%)",i=e.hslString,r=e.hslaString,a=this._domH,s=this._domSL,l=this._domA,u=Zw(".picker_selector",a),c=Zw(".picker_selector",s),d=Zw(".picker_selector",l);m(0,u,n[0]),this._domSL.style.backgroundColor=this._domH.style.color=o,m(0,c,n[1]),b(0,c,1-n[2]),s.style.color=i,b(0,d,1-n[3]);var h=i,p=h.replace("hsl","hsla").replace(")",", 0)"),f="linear-gradient("+[h,p]+")";if(this._domA.style.background=f+", linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",!t.fromEditor){var g=this.settings.editorFormat,v=this.settings.alpha,y=void 0;switch(g){case"rgb":y=e.printRGB(v);break;case"hsl":y=e.printHSL(v);break;default:y=e.printHex(v)}this._domEdit.value=y}this._domSample.style.color=r}function m(t,e,n){e.style.left=100*n+"%"}function b(t,e,n){e.style.top=100*n+"%"}}},{key:"_ifPopup",value:function(t,e){this.settings.parent&&this.settings.popup?t&&t(this.settings.popup):e&&e()}},{key:"_toggleDOM",value:function(t){var e=this.domElement;if(!e)return!1;var n=t?"":"none",o=e.style.display!==n;return o&&(e.style.display=n),o}}]),t}(),Qw=document.createElement("style");Qw.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(Qw),Jw.StyleElement=Qw;var tS={},eS={get exports(){return tS},set exports(t){tS=t}};!function(t){t.exports=function(){var t="object",e="function",n="undefined",o=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],i=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],r=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],a=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function s(n,o){var i=typeof n[o];return i==e||!(i!=t||!n[o])||"unknown"==i}function l(e,n){return!(typeof e[n]!=t||!e[n])}function u(t,e){return typeof t[e]!=n}function c(t){return function(e,n){for(var o=n.length;o--;)if(!t(e,n[o]))return!1;return!0}}var d=c(s),h=c(l),p=c(u);function f(t){return t&&d(t,a)&&p(t,r)}function g(t){return l(t,"body")?t.body:t.getElementsByTagName("body")[0]}var v,y,m=[].forEach?function(t,e){t.forEach(e)}:function(t,e){for(var n=0,o=t.length;n<o;++n)e(t[n],n)},b={},x=typeof window!=n&&typeof document!=n,_={isHostMethod:s,isHostObject:l,isHostProperty:u,areHostMethods:d,areHostObjects:h,areHostProperties:p,isTextRange:f,getBody:g,forEach:m},E={version:"1.3.1",initialized:!1,isBrowser:x,supported:!0,util:_,features:{},modules:b,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==n||rangyAutoInitialize}};function w(t){typeof console!=n&&s(console,"log")}function S(t,e){x&&e?alert(t):w(t)}function C(t){E.initialized=!0,E.supported=!1,S("Rangy is not supported in this environment. Reason: "+t,E.config.alertOnFail)}function N(t){S("Rangy warning: "+t,E.config.alertOnWarn)}E.fail=C,E.warn=N,{}.hasOwnProperty?(_.extend=v=function(t,e,n){var o,i;for(var r in e)e.hasOwnProperty(r)&&(o=t[r],i=e[r],n&&null!==o&&"object"==typeof o&&null!==i&&"object"==typeof i&&v(o,i,!0),t[r]=i);return e.hasOwnProperty("toString")&&(t.toString=e.toString),t},_.createOptions=function(t,e){var n={};return v(n,e),t&&v(n,t),n}):C("hasOwnProperty not supported"),x||C("Rangy can only run in a browser"),function(){var t;if(x){var e=document.createElement("div");e.appendChild(document.createElement("span"));var n=[].slice;try{1==n.call(e.childNodes,0)[0].nodeType&&(t=function(t){return n.call(t,0)})}catch(t){}}t||(t=function(t){for(var e=[],n=0,o=t.length;n<o;++n)e[n]=t[n];return e}),_.toArray=t}(),x&&(s(document,"addEventListener")?y=function(t,e,n){t.addEventListener(e,n,!1)}:s(document,"attachEvent")?y=function(t,e,n){t.attachEvent("on"+e,n)}:C("Document does not have required addEventListener or attachEvent method"),_.addListener=y);var T=[];function A(t){return t.message||t.description||String(t)}function M(){if(x&&!E.initialized){var t,e=!1,n=!1;s(document,"createRange")&&(t=document.createRange(),d(t,i)&&p(t,o)&&(e=!0));var r=g(document);if(r&&"body"==r.nodeName.toLowerCase())if(r&&s(r,"createTextRange")&&f(t=r.createTextRange())&&(n=!0),e||n){var a;for(var l in E.initialized=!0,E.features={implementsDomRange:e,implementsTextRange:n},b)(a=b[l])instanceof D&&a.init(a,E);for(var u=0,c=T.length;u<c;++u)try{T[u](E)}catch(t){w("Rangy init listener threw an exception. Continuing. Detail: "+A(t))}}else C("Neither Range nor TextRange are available");else C("No body element found")}}function O(t,e,n){n&&(t+=" in module "+n.name),E.warn("DEPRECATED: "+t+" is deprecated. Please use "+e+" instead.")}function P(t,e,n,o){t[e]=function(){return O(e,n,o),t[n].apply(t,_.toArray(arguments))}}_.deprecationNotice=O,_.createAliasForDeprecatedMethod=P,E.init=M,E.addInitListener=function(t){E.initialized?t(E):T.push(t)};var k=[];function R(t){t=t||window,M();for(var e=0,n=k.length;e<n;++e)k[e](t)}function D(t,e,n){this.name=t,this.dependencies=e,this.initialized=!1,this.supported=!1,this.initializer=n}function L(t,e,n){var o=new D(t,e,(function(e){if(!e.initialized){e.initialized=!0;try{n(E,e),e.supported=!0}catch(e){w("Module '"+t+"' failed to load: "+A(e)),e.stack&&w(e.stack)}}}));return b[t]=o,o}function I(){}function j(){}E.addShimListener=function(t){k.push(t)},x&&(E.shim=E.createMissingNativeApi=R,P(E,"createMissingNativeApi","shim")),D.prototype={init:function(){for(var t,e,n=this.dependencies||[],o=0,i=n.length;o<i;++o){if(e=n[o],!((t=b[e])&&t instanceof D))throw new Error("required module '"+e+"' not found");if(t.init(),!t.supported)throw new Error("required module '"+e+"' not supported")}this.initializer(this)},fail:function(t){throw this.initialized=!0,this.supported=!1,new Error(t)},warn:function(t){E.warn("Module "+this.name+": "+t)},deprecationNotice:function(t,e){E.warn("DEPRECATED: "+t+" in module "+this.name+" is deprecated. Please use "+e+" instead")},createError:function(t){return new Error("Error in Rangy "+this.name+" module: "+t)}},E.createModule=function(t){var e,n;2==arguments.length?(e=arguments[1],n=[]):(e=arguments[2],n=arguments[1]);var o=L(t,n,e);E.initialized&&E.supported&&o.init()},E.createCoreModule=function(t,e,n){L(t,e,n)},E.RangePrototype=I,E.rangePrototype=new I,E.selectionPrototype=new j,E.createCoreModule("DomUtil",[],(function(t,e){var n="undefined",o=t.util,i=o.getBody;o.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||e.fail("document missing a Node creation method"),o.isHostMethod(document,"getElementsByTagName")||e.fail("document missing getElementsByTagName method");var r=document.createElement("div");o.areHostMethods(r,["insertBefore","appendChild","cloneNode"]||!o.areHostObjects(r,["previousSibling","nextSibling","childNodes","parentNode"]))||e.fail("Incomplete Element implementation"),o.isHostProperty(r,"innerHTML")||e.fail("Element is missing innerHTML property");var a=document.createTextNode("test");o.areHostMethods(a,["splitText","deleteData","insertData","appendData","cloneNode"]||!o.areHostObjects(r,["previousSibling","nextSibling","childNodes","parentNode"])||!o.areHostProperties(a,["data"]))||e.fail("Incomplete Text Node implementation");var s=function(t,e){for(var n=t.length;n--;)if(t[n]===e)return!0;return!1};function l(t){var e;return typeof t.namespaceURI==n||null===(e=t.namespaceURI)||"http://www.w3.org/1999/xhtml"==e}function u(t){var e=t.parentNode;return 1==e.nodeType?e:null}function c(t){for(var e=0;t=t.previousSibling;)++e;return e}function d(t){switch(t.nodeType){case 7:case 10:return 0;case 3:case 8:return t.length;default:return t.childNodes.length}}function h(t,e){var n,o=[];for(n=t;n;n=n.parentNode)o.push(n);for(n=e;n;n=n.parentNode)if(s(o,n))return n;return null}function p(t,e,n){for(var o=n?e:e.parentNode;o;){if(o===t)return!0;o=o.parentNode}return!1}function f(t,e){return p(t,e,!0)}function g(t,e,n){for(var o,i=n?t:t.parentNode;i;){if((o=i.parentNode)===e)return i;i=o}return null}function v(t){var e=t.nodeType;return 3==e||4==e||8==e}function y(t){if(!t)return!1;var e=t.nodeType;return 3==e||8==e}function m(t,e){var n=e.nextSibling,o=e.parentNode;return n?o.insertBefore(t,n):o.appendChild(t),t}function b(t,e,n){var o=t.cloneNode(!1);if(o.deleteData(0,e),t.deleteData(e,t.length-e),m(o,t),n)for(var i,r=0;i=n[r++];)i.node==t&&i.offset>e?(i.node=o,i.offset-=e):i.node==t.parentNode&&i.offset>c(t)&&++i.offset;return o}function x(t){if(9==t.nodeType)return t;if(typeof t.ownerDocument!=n)return t.ownerDocument;if(typeof t.document!=n)return t.document;if(t.parentNode)return x(t.parentNode);throw e.createError("getDocument: no document found for node")}function _(t){var o=x(t);if(typeof o.defaultView!=n)return o.defaultView;if(typeof o.parentWindow!=n)return o.parentWindow;throw e.createError("Cannot get a window object for node")}function E(t){if(typeof t.contentDocument!=n)return t.contentDocument;if(typeof t.contentWindow!=n)return t.contentWindow.document;throw e.createError("getIframeDocument: No Document object found for iframe element")}function w(t){if(typeof t.contentWindow!=n)return t.contentWindow;if(typeof t.contentDocument!=n)return t.contentDocument.defaultView;throw e.createError("getIframeWindow: No Window object found for iframe element")}function S(t){return t&&o.isHostMethod(t,"setTimeout")&&o.isHostObject(t,"document")}function C(t,e,n){var i;if(t?o.isHostProperty(t,"nodeType")?i=1==t.nodeType&&"iframe"==t.tagName.toLowerCase()?E(t):x(t):S(t)&&(i=t.document):i=document,!i)throw e.createError(n+"(): Parameter must be a Window object or DOM node");return i}function N(t){for(var e;e=t.parentNode;)t=e;return t}function T(t,n,o,i){var r,a,s,l,u;if(t==o)return n===i?0:n<i?-1:1;if(r=g(o,t,!0))return n<=c(r)?-1:1;if(r=g(t,o,!0))return c(r)<i?-1:1;if(!(a=h(t,o)))throw new Error("comparePoints error: nodes have no common ancestor");if((s=t===a?a:g(t,a,!0))===(l=o===a?a:g(o,a,!0)))throw e.createError("comparePoints got to case 4 and childA and childB are the same!");for(u=a.firstChild;u;){if(u===s)return-1;if(u===l)return 1;u=u.nextSibling}}var A,M=!1;function O(t){try{return t.parentNode,!1}catch(t){return!0}}function P(t){if(!t)return"[No node]";if(M&&O(t))return"[Broken node]";if(v(t))return'"'+t.data+'"';if(1==t.nodeType){var e=t.id?' id="'+t.id+'"':"";return"<"+t.nodeName+e+">[index:"+c(t)+",length:"+t.childNodes.length+"]["+(t.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return t.nodeName}function k(t){for(var e,n=x(t).createDocumentFragment();e=t.firstChild;)n.appendChild(e);return n}function R(t,e,n){var o=i(t),r=t.createElement("div");r.contentEditable=""+!!n,e&&(r.innerHTML=e);var a=o.firstChild;return a?o.insertBefore(r,a):o.appendChild(r),r}function D(t){return t.parentNode.removeChild(t)}function L(t){this.root=t,this._next=t}function I(t){return new L(t)}function j(t,e){this.node=t,this.offset=e}function B(t){this.code=this[t],this.codeName=t,this.message="DOMException: "+this.codeName}!function(){var e=document.createElement("b");e.innerHTML="1";var n=e.firstChild;e.innerHTML="<br />",M=O(n),t.features.crashyTextNodes=M}(),typeof window.getComputedStyle!=n?A=function(t,e){return _(t).getComputedStyle(t,null)[e]}:typeof document.documentElement.currentStyle!=n?A=function(t,e){return t.currentStyle?t.currentStyle[e]:""}:e.fail("No means of obtaining computed style properties found"),L.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var t,e,n=this._current=this._next;if(this._current)if(t=n.firstChild)this._next=t;else{for(e=null;n!==this.root&&!(e=n.nextSibling);)n=n.parentNode;this._next=e}return this._current},detach:function(){this._current=this._next=this.root=null}},j.prototype={equals:function(t){return!!t&&this.node===t.node&&this.offset==t.offset},inspect:function(){return"[DomPosition("+P(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}},B.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},B.prototype.toString=function(){return this.message},t.dom={arrayContains:s,isHtmlNamespace:l,parentElement:u,getNodeIndex:c,getNodeLength:d,getCommonAncestor:h,isAncestorOf:p,isOrIsAncestorOf:f,getClosestAncestorIn:g,isCharacterDataNode:v,isTextOrCommentNode:y,insertAfter:m,splitDataNode:b,getDocument:x,getWindow:_,getIframeWindow:w,getIframeDocument:E,getBody:i,isWindow:S,getContentDocument:C,getRootContainer:N,comparePoints:T,isBrokenNode:O,inspectNode:P,getComputedStyleProperty:A,createTestElement:R,removeNode:D,fragmentFromNodeChildren:k,createIterator:I,DomPosition:j},t.DOMException=B})),E.createCoreModule("DomRange",["DomUtil"],(function(t,e){var n=t.dom,o=t.util,i=n.DomPosition,r=t.DOMException,a=n.isCharacterDataNode,s=n.getNodeIndex,l=n.isOrIsAncestorOf,u=n.getDocument,c=n.comparePoints,d=n.splitDataNode,h=n.getClosestAncestorIn,p=n.getNodeLength,f=n.arrayContains,g=n.getRootContainer,v=t.features.crashyTextNodes,y=n.removeNode;function m(t,e){return 3!=t.nodeType&&(l(t,e.startContainer)||l(t,e.endContainer))}function b(t){return t.document||u(t.startContainer)}function x(t){return g(t.startContainer)}function _(t){return new i(t.parentNode,s(t))}function E(t){return new i(t.parentNode,s(t)+1)}function w(t,e,o){var i=11==t.nodeType?t.firstChild:t;return a(e)?o==e.length?n.insertAfter(t,e):e.parentNode.insertBefore(t,0==o?e:d(e,o)):o>=e.childNodes.length?e.appendChild(t):e.insertBefore(t,e.childNodes[o]),i}function S(t,e,n){if(Z(t),Z(e),b(e)!=b(t))throw new r("WRONG_DOCUMENT_ERR");var o=c(t.startContainer,t.startOffset,e.endContainer,e.endOffset),i=c(t.endContainer,t.endOffset,e.startContainer,e.startOffset);return n?o<=0&&i>=0:o<0&&i>0}function C(t){for(var e,n,o,i=b(t.range).createDocumentFragment();n=t.next();){if(e=t.isPartiallySelectedSubtree(),n=n.cloneNode(!e),e&&(o=t.getSubtreeIterator(),n.appendChild(C(o)),o.detach()),10==n.nodeType)throw new r("HIERARCHY_REQUEST_ERR");i.appendChild(n)}return i}function N(t,e,o){var i,r,a,s;for(o=o||{stop:!1};a=t.next();)if(t.isPartiallySelectedSubtree()){if(!1===e(a))return void(o.stop=!0);if(N(s=t.getSubtreeIterator(),e,o),s.detach(),o.stop)return}else for(i=n.createIterator(a);r=i.next();)if(!1===e(r))return void(o.stop=!0)}function T(t){for(var e;t.next();)t.isPartiallySelectedSubtree()?(T(e=t.getSubtreeIterator()),e.detach()):t.remove()}function A(t){for(var e,n,o=b(t.range).createDocumentFragment();e=t.next();){if(t.isPartiallySelectedSubtree()?(e=e.cloneNode(!1),n=t.getSubtreeIterator(),e.appendChild(A(n)),n.detach()):t.remove(),10==e.nodeType)throw new r("HIERARCHY_REQUEST_ERR");o.appendChild(e)}return o}function M(t,e,n){var o,i=!(!e||!e.length),r=!!n;i&&(o=new RegExp("^("+e.join("|")+")$"));var s=[];return N(new P(t,!1),(function(e){if((!i||o.test(e.nodeType))&&(!r||n(e))){var l=t.startContainer;if(e!=l||!a(l)||t.startOffset!=l.length){var u=t.endContainer;e==u&&a(u)&&0==t.endOffset||s.push(e)}}})),s}function O(t){return"["+(void 0===t.getName?"Range":t.getName())+"("+n.inspectNode(t.startContainer)+":"+t.startOffset+", "+n.inspectNode(t.endContainer)+":"+t.endOffset+")]"}function P(t,e){if(this.range=t,this.clonePartiallySelectedTextNodes=e,!t.collapsed){this.sc=t.startContainer,this.so=t.startOffset,this.ec=t.endContainer,this.eo=t.endOffset;var n=t.commonAncestorContainer;this.sc===this.ec&&a(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==n||a(this.sc)?h(this.sc,n,!0):this.sc.childNodes[this.so],this._last=this.ec!==n||a(this.ec)?h(this.ec,n,!0):this.ec.childNodes[this.eo-1])}}P.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var t=this._current=this._next;return t&&(this._next=t!==this._last?t.nextSibling:null,a(t)&&this.clonePartiallySelectedTextNodes&&(t===this.ec&&(t=t.cloneNode(!0)).deleteData(this.eo,t.length-this.eo),this._current===this.sc&&(t=t.cloneNode(!0)).deleteData(0,this.so))),t},remove:function(){var t,e,n=this._current;!a(n)||n!==this.sc&&n!==this.ec?n.parentNode&&y(n):(t=n===this.sc?this.so:0)!=(e=n===this.ec?this.eo:n.length)&&n.deleteData(t,e-t)},isPartiallySelectedSubtree:function(){return m(this._current,this.range)},getSubtreeIterator:function(){var t;if(this.isSingleCharacterDataNode)(t=this.range.cloneRange()).collapse(!1);else{t=new yt(b(this.range));var e=this._current,n=e,o=0,i=e,r=p(e);l(e,this.sc)&&(n=this.sc,o=this.so),l(e,this.ec)&&(i=this.ec,r=this.eo),vt(t,n,o,i,r)}return new P(t,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var k=[1,3,4,5,7,8,10],R=[2,9,11],D=[5,6,10,12],L=[1,3,4,5,7,8,10,11],I=[1,3,4,5,7,8];function j(t){return function(e,n){for(var o,i=n?e:e.parentNode;i;){if(o=i.nodeType,f(t,o))return i;i=i.parentNode}return null}}var B=j([9,11]),H=j(D),F=j([6,10,12]),z=j([1]);function W(t,e){if(F(t,e))throw new r("INVALID_NODE_TYPE_ERR")}function G(t,e){if(!f(e,t.nodeType))throw new r("INVALID_NODE_TYPE_ERR")}function U(t,e){if(e<0||e>(a(t)?t.length:t.childNodes.length))throw new r("INDEX_SIZE_ERR")}function X(t,e){if(B(t,!0)!==B(e,!0))throw new r("WRONG_DOCUMENT_ERR")}function V(t){if(H(t,!0))throw new r("NO_MODIFICATION_ALLOWED_ERR")}function Y(t,e){if(!t)throw new r(e)}function q(t,e){return e<=(a(t)?t.length:t.childNodes.length)}function K(t){return!!t.startContainer&&!!t.endContainer&&!(v&&(n.isBrokenNode(t.startContainer)||n.isBrokenNode(t.endContainer)))&&g(t.startContainer)==g(t.endContainer)&&q(t.startContainer,t.startOffset)&&q(t.endContainer,t.endOffset)}function Z(t){if(!K(t))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+t.inspect()+")")}var $=document.createElement("style"),J=!1;try{$.innerHTML="<b>x</b>",J=3==$.firstChild.nodeType}catch(t){}t.features.htmlParsingConforms=J;var Q=J?function(t){var e=this.startContainer,o=u(e);if(!e)throw new r("INVALID_STATE_ERR");var i=null;return 1==e.nodeType?i=e:a(e)&&(i=n.parentElement(e)),(i=null===i||"HTML"==i.nodeName&&n.isHtmlNamespace(u(i).documentElement)&&n.isHtmlNamespace(i)?o.createElement("body"):i.cloneNode(!1)).innerHTML=t,n.fragmentFromNodeChildren(i)}:function(t){var e=b(this).createElement("body");return e.innerHTML=t,n.fragmentFromNodeChildren(e)};function tt(t,e){Z(t);var n=t.startContainer,o=t.startOffset,i=t.endContainer,r=t.endOffset,l=n===i;a(i)&&r>0&&r<i.length&&d(i,r,e),a(n)&&o>0&&o<n.length&&(n=d(n,o,e),l?(r-=o,i=n):i==n.parentNode&&r>=s(n)&&r++,o=0),t.setStartAndEnd(n,o,i,r)}function et(t){Z(t);var e=t.commonAncestorContainer.parentNode.cloneNode(!1);return e.appendChild(t.cloneContents()),e.innerHTML}var nt=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],ot=0,it=1,rt=2,at=3,st=0,lt=1,ut=2,ct=3;function dt(t){t.START_TO_START=ot,t.START_TO_END=it,t.END_TO_END=rt,t.END_TO_START=at,t.NODE_BEFORE=st,t.NODE_AFTER=lt,t.NODE_BEFORE_AND_AFTER=ut,t.NODE_INSIDE=ct}function ht(t){dt(t),dt(t.prototype)}function pt(t,e){return function(){Z(this);var n,o=this.startContainer,i=this.startOffset,r=this.commonAncestorContainer,a=new P(this,!0);o!==r&&(o=(n=E(h(o,r,!0))).node,i=n.offset),N(a,V),a.reset();var s=t(a);return a.detach(),e(this,o,i,o,i),s}}function ft(e,n){function i(t,e){return function(n){G(n,k),G(g(n),R);var o=(t?_:E)(n);(e?r:l)(this,o.node,o.offset)}}function r(t,e,o){var i=t.endContainer,r=t.endOffset;e===t.startContainer&&o===t.startOffset||(g(e)==g(i)&&1!=c(e,o,i,r)||(i=e,r=o),n(t,e,o,i,r))}function l(t,e,o){var i=t.startContainer,r=t.startOffset;e===t.endContainer&&o===t.endOffset||(g(e)==g(i)&&-1!=c(e,o,i,r)||(i=e,r=o),n(t,i,r,e,o))}var u=function(){};u.prototype=t.rangePrototype,e.prototype=new u,o.extend(e.prototype,{setStart:function(t,e){W(t,!0),U(t,e),r(this,t,e)},setEnd:function(t,e){W(t,!0),U(t,e),l(this,t,e)},setStartAndEnd:function(){var t=arguments,e=t[0],o=t[1],i=e,r=o;switch(t.length){case 3:r=t[2];break;case 4:i=t[2],r=t[3]}W(e,!0),U(e,o),W(i,!0),U(i,r),n(this,e,o,i,r)},setBoundary:function(t,e,n){this["set"+(n?"Start":"End")](t,e)},setStartBefore:i(!0,!0),setStartAfter:i(!1,!0),setEndBefore:i(!0,!1),setEndAfter:i(!1,!1),collapse:function(t){Z(this),t?n(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):n(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(t){W(t,!0),n(this,t,0,t,p(t))},selectNode:function(t){W(t,!1),G(t,k);var e=_(t),o=E(t);n(this,e.node,e.offset,o.node,o.offset)},extractContents:pt(A,n),deleteContents:pt(T,n),canSurroundContents:function(){Z(this),V(this.startContainer),V(this.endContainer);var t=new P(this,!0),e=t._first&&m(t._first,this)||t._last&&m(t._last,this);return t.detach(),!e},splitBoundaries:function(){tt(this)},splitBoundariesPreservingPositions:function(t){tt(this,t)},normalizeBoundaries:function(){Z(this);var t,e=this.startContainer,o=this.startOffset,i=this.endContainer,r=this.endOffset,l=function(t){var e=t.nextSibling;e&&e.nodeType==t.nodeType&&(i=t,r=t.length,t.appendData(e.data),y(e))},u=function(t){var n=t.previousSibling;if(n&&n.nodeType==t.nodeType){e=t;var a=t.length;if(o=n.length,t.insertData(0,n.data),y(n),e==i)r+=o,i=e;else if(i==t.parentNode){var l=s(t);r==l?(i=t,r=a):r>l&&r--}}},c=!0;if(a(i))r==i.length?l(i):0==r&&(t=i.previousSibling)&&t.nodeType==i.nodeType&&(r=t.length,e==i&&(c=!1),t.appendData(i.data),y(i),i=t);else{if(r>0){var d=i.childNodes[r-1];d&&a(d)&&l(d)}c=!this.collapsed}if(c){if(a(e))0==o?u(e):o==e.length&&(t=e.nextSibling)&&t.nodeType==e.nodeType&&(i==t&&(i=e,r+=e.length),e.appendData(t.data),y(t));else if(o<e.childNodes.length){var h=e.childNodes[o];h&&a(h)&&u(h)}}else e=i,o=r;n(this,e,o,i,r)},collapseToPoint:function(t,e){W(t,!0),U(t,e),this.setStartAndEnd(t,e)},parentElement:function(){return Z(this),this.commonAncestorContainer?z(this.commonAncestorContainer,!0):null}}),ht(e)}function gt(t){t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset,t.commonAncestorContainer=t.collapsed?t.startContainer:n.getCommonAncestor(t.startContainer,t.endContainer)}function vt(t,e,o,i,r){t.startContainer=e,t.startOffset=o,t.endContainer=i,t.endOffset=r,t.document=n.getDocument(e),gt(t)}function yt(t){vt(this,t,0,t,0)}o.extend(t.rangePrototype,{compareBoundaryPoints:function(t,e){var n,o,i,r;Z(this),X(this.startContainer,e.startContainer);var a=t==at||t==ot?"start":"end",s=t==it||t==ot?"start":"end";return n=this[a+"Container"],o=this[a+"Offset"],i=e[s+"Container"],r=e[s+"Offset"],c(n,o,i,r)},insertNode:function(t){if(Z(this),G(t,L),V(this.startContainer),l(t,this.startContainer))throw new r("HIERARCHY_REQUEST_ERR");var e=w(t,this.startContainer,this.startOffset);this.setStartBefore(e)},cloneContents:function(){var t,e;if(Z(this),this.collapsed)return b(this).createDocumentFragment();if(this.startContainer===this.endContainer&&a(this.startContainer))return(t=this.startContainer.cloneNode(!0)).data=t.data.slice(this.startOffset,this.endOffset),(e=b(this).createDocumentFragment()).appendChild(t),e;var n=new P(this,!0);return t=C(n),n.detach(),t},canSurroundContents:function(){Z(this),V(this.startContainer),V(this.endContainer);var t=new P(this,!0),e=t._first&&m(t._first,this)||t._last&&m(t._last,this);return t.detach(),!e},surroundContents:function(t){if(G(t,I),!this.canSurroundContents())throw new r("INVALID_STATE_ERR");var e=this.extractContents();if(t.hasChildNodes())for(;t.lastChild;)t.removeChild(t.lastChild);w(t,this.startContainer,this.startOffset),t.appendChild(e),this.selectNode(t)},cloneRange:function(){Z(this);for(var t,e=new yt(b(this)),n=nt.length;n--;)e[t=nt[n]]=this[t];return e},toString:function(){Z(this);var t=this.startContainer;if(t===this.endContainer&&a(t))return 3==t.nodeType||4==t.nodeType?t.data.slice(this.startOffset,this.endOffset):"";var e=[],n=new P(this,!0);return N(n,(function(t){3!=t.nodeType&&4!=t.nodeType||e.push(t.data)})),n.detach(),e.join("")},compareNode:function(t){Z(this);var e=t.parentNode,n=s(t);if(!e)throw new r("NOT_FOUND_ERR");var o=this.comparePoint(e,n),i=this.comparePoint(e,n+1);return o<0?i>0?ut:st:i>0?lt:ct},comparePoint:function(t,e){return Z(this),Y(t,"HIERARCHY_REQUEST_ERR"),X(t,this.startContainer),c(t,e,this.startContainer,this.startOffset)<0?-1:c(t,e,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:Q,toHtml:function(){return et(this)},intersectsNode:function(t,e){if(Z(this),g(t)!=x(this))return!1;var n=t.parentNode,o=s(t);if(!n)return!0;var i=c(n,o,this.endContainer,this.endOffset),r=c(n,o+1,this.startContainer,this.startOffset);return e?i<=0&&r>=0:i<0&&r>0},isPointInRange:function(t,e){return Z(this),Y(t,"HIERARCHY_REQUEST_ERR"),X(t,this.startContainer),c(t,e,this.startContainer,this.startOffset)>=0&&c(t,e,this.endContainer,this.endOffset)<=0},intersectsRange:function(t){return S(this,t,!1)},intersectsOrTouchesRange:function(t){return S(this,t,!0)},intersection:function(t){if(this.intersectsRange(t)){var e=c(this.startContainer,this.startOffset,t.startContainer,t.startOffset),n=c(this.endContainer,this.endOffset,t.endContainer,t.endOffset),o=this.cloneRange();return-1==e&&o.setStart(t.startContainer,t.startOffset),1==n&&o.setEnd(t.endContainer,t.endOffset),o}return null},union:function(t){if(this.intersectsOrTouchesRange(t)){var e=this.cloneRange();return-1==c(t.startContainer,t.startOffset,this.startContainer,this.startOffset)&&e.setStart(t.startContainer,t.startOffset),1==c(t.endContainer,t.endOffset,this.endContainer,this.endOffset)&&e.setEnd(t.endContainer,t.endOffset),e}throw new r("Ranges do not intersect")},containsNode:function(t,e){return e?this.intersectsNode(t,!1):this.compareNode(t)==ct},containsNodeContents:function(t){return this.comparePoint(t,0)>=0&&this.comparePoint(t,p(t))<=0},containsRange:function(t){var e=this.intersection(t);return null!==e&&t.equals(e)},containsNodeText:function(t){var e=this.cloneRange();e.selectNode(t);var n=e.getNodes([3]);if(n.length>0){e.setStart(n[0],0);var o=n.pop();return e.setEnd(o,o.length),this.containsRange(e)}return this.containsNodeContents(t)},getNodes:function(t,e){return Z(this),M(this,t,e)},getDocument:function(){return b(this)},collapseBefore:function(t){this.setEndBefore(t),this.collapse(!1)},collapseAfter:function(t){this.setStartAfter(t),this.collapse(!0)},getBookmark:function(e){var o=b(this),i=t.createRange(o);e=e||n.getBody(o),i.selectNodeContents(e);var r=this.intersection(i),a=0,s=0;return r&&(i.setEnd(r.startContainer,r.startOffset),s=(a=i.toString().length)+r.toString().length),{start:a,end:s,containerNode:e}},moveToBookmark:function(t){var e=t.containerNode,n=0;this.setStart(e,0),this.collapse(!0);for(var o,i,r,a,s=[e],l=!1,u=!1;!u&&(o=s.pop());)if(3==o.nodeType)i=n+o.length,!l&&t.start>=n&&t.start<=i&&(this.setStart(o,t.start-n),l=!0),l&&t.end>=n&&t.end<=i&&(this.setEnd(o,t.end-n),u=!0),n=i;else for(r=(a=o.childNodes).length;r--;)s.push(a[r])},getName:function(){return"DomRange"},equals:function(t){return yt.rangesEqual(this,t)},isValid:function(){return K(this)},inspect:function(){return O(this)},detach:function(){}}),ft(yt,vt),o.extend(yt,{rangeProperties:nt,RangeIterator:P,copyComparisonConstants:ht,createPrototypeRange:ft,inspect:O,toHtml:et,getRangeDocument:b,rangesEqual:function(t,e){return t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset}}),t.DomRange=yt})),E.createCoreModule("WrappedRange",["DomRange"],(function(t,e){var n,o,i=t.dom,r=t.util,a=i.DomPosition,s=t.DomRange,l=i.getBody,u=i.getContentDocument,c=i.isCharacterDataNode;if(t.features.implementsDomRange&&function(){var o,a,c=s.rangeProperties;function d(t){for(var e,n=c.length;n--;)t[e=c[n]]=t.nativeRange[e];t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset}function h(t,e,n,o,i){var r=t.startContainer!==e||t.startOffset!=n,a=t.endContainer!==o||t.endOffset!=i,s=!t.equals(t.nativeRange);(r||a||s)&&(t.setEnd(o,i),t.setStart(e,n))}n=function(t){if(!t)throw e.createError("WrappedRange: Range must be specified");this.nativeRange=t,d(this)},s.createPrototypeRange(n,h),(o=n.prototype).selectNode=function(t){this.nativeRange.selectNode(t),d(this)},o.cloneContents=function(){return this.nativeRange.cloneContents()},o.surroundContents=function(t){this.nativeRange.surroundContents(t),d(this)},o.collapse=function(t){this.nativeRange.collapse(t),d(this)},o.cloneRange=function(){return new n(this.nativeRange.cloneRange())},o.refresh=function(){d(this)},o.toString=function(){return this.nativeRange.toString()};var p=document.createTextNode("test");l(document).appendChild(p);var f=document.createRange();f.setStart(p,0),f.setEnd(p,0);try{f.setStart(p,1),o.setStart=function(t,e){this.nativeRange.setStart(t,e),d(this)},o.setEnd=function(t,e){this.nativeRange.setEnd(t,e),d(this)},a=function(t){return function(e){this.nativeRange[t](e),d(this)}}}catch(t){o.setStart=function(t,e){try{this.nativeRange.setStart(t,e)}catch(n){this.nativeRange.setEnd(t,e),this.nativeRange.setStart(t,e)}d(this)},o.setEnd=function(t,e){try{this.nativeRange.setEnd(t,e)}catch(n){this.nativeRange.setStart(t,e),this.nativeRange.setEnd(t,e)}d(this)},a=function(t,e){return function(n){try{this.nativeRange[t](n)}catch(o){this.nativeRange[e](n),this.nativeRange[t](n)}d(this)}}}o.setStartBefore=a("setStartBefore","setEndBefore"),o.setStartAfter=a("setStartAfter","setEndAfter"),o.setEndBefore=a("setEndBefore","setStartBefore"),o.setEndAfter=a("setEndAfter","setStartAfter"),o.selectNodeContents=function(t){this.setStartAndEnd(t,0,i.getNodeLength(t))},f.selectNodeContents(p),f.setEnd(p,3);var g=document.createRange();g.selectNodeContents(p),g.setEnd(p,4),g.setStart(p,2),-1==f.compareBoundaryPoints(f.START_TO_END,g)&&1==f.compareBoundaryPoints(f.END_TO_START,g)?o.compareBoundaryPoints=function(t,e){return t==(e=e.nativeRange||e).START_TO_END?t=e.END_TO_START:t==e.END_TO_START&&(t=e.START_TO_END),this.nativeRange.compareBoundaryPoints(t,e)}:o.compareBoundaryPoints=function(t,e){return this.nativeRange.compareBoundaryPoints(t,e.nativeRange||e)};var v=document.createElement("div");v.innerHTML="123";var y=v.firstChild,m=l(document);m.appendChild(v),f.setStart(y,1),f.setEnd(y,2),f.deleteContents(),"13"==y.data&&(o.deleteContents=function(){this.nativeRange.deleteContents(),d(this)},o.extractContents=function(){var t=this.nativeRange.extractContents();return d(this),t}),m.removeChild(v),m=null,r.isHostMethod(f,"createContextualFragment")&&(o.createContextualFragment=function(t){return this.nativeRange.createContextualFragment(t)}),l(document).removeChild(p),o.getName=function(){return"WrappedRange"},t.WrappedRange=n,t.createNativeRange=function(t){return(t=u(t,e,"createNativeRange")).createRange()}}(),t.features.implementsTextRange){var d=function(t){var e=t.parentElement(),n=t.duplicate();n.collapse(!0);var o=n.parentElement();(n=t.duplicate()).collapse(!1);var r=n.parentElement(),a=o==r?o:i.getCommonAncestor(o,r);return a==e?a:i.getCommonAncestor(e,a)},h=function(t){return 0==t.compareEndPoints("StartToEnd",t)},p=function(t,e,n,o,r){var s=t.duplicate();s.collapse(n);var l=s.parentElement();if(i.isOrIsAncestorOf(e,l)||(l=e),!l.canHaveHTML){var u=new a(l.parentNode,i.getNodeIndex(l));return{boundaryPosition:u,nodeInfo:{nodeIndex:u.offset,containerElement:u.node}}}var d=i.getDocument(l).createElement("span");d.parentNode&&i.removeNode(d);for(var h,p,f,g,v,y=n?"StartToStart":"StartToEnd",m=r&&r.containerElement==l?r.nodeIndex:0,b=l.childNodes.length,x=b,_=x;_==b?l.appendChild(d):l.insertBefore(d,l.childNodes[_]),s.moveToElementText(d),0!=(h=s.compareEndPoints(y,t))&&m!=x;){if(-1==h){if(x==m+1)break;m=_}else x=x==m+1?m:_;_=Math.floor((m+x)/2),l.removeChild(d)}if(v=d.nextSibling,-1==h&&v&&c(v)){var E;if(s.setEndPoint(n?"EndToStart":"EndToEnd",t),/[\r\n]/.test(v.data)){var w=s.duplicate(),S=w.text.replace(/\r\n/g,"\r").length;for(E=w.moveStart("character",S);-1==(h=w.compareEndPoints("StartToEnd",w));)E++,w.moveStart("character",1)}else E=s.text.length;g=new a(v,E)}else p=(o||!n)&&d.previousSibling,g=(f=(o||n)&&d.nextSibling)&&c(f)?new a(f,0):p&&c(p)?new a(p,p.data.length):new a(l,i.getNodeIndex(d));return i.removeNode(d),{boundaryPosition:g,nodeInfo:{nodeIndex:_,containerElement:l}}},f=function(t,e){var n,o,r,a,s=t.offset,u=i.getDocument(t.node),d=l(u).createTextRange(),h=c(t.node);return h?o=(n=t.node).parentNode:(n=s<(a=t.node.childNodes).length?a[s]:null,o=t.node),(r=u.createElement("span")).innerHTML="&#feff;",n?o.insertBefore(r,n):o.appendChild(r),d.moveToElementText(r),d.collapse(!e),o.removeChild(r),h&&d[e?"moveStart":"moveEnd"]("character",s),d};(o=function(t){this.textRange=t,this.refresh()}).prototype=new s(document),o.prototype.refresh=function(){var t,e,n,o=d(this.textRange);h(this.textRange)?e=t=p(this.textRange,o,!0,!0).boundaryPosition:(t=(n=p(this.textRange,o,!0,!1)).boundaryPosition,e=p(this.textRange,o,!1,!1,n.nodeInfo).boundaryPosition),this.setStart(t.node,t.offset),this.setEnd(e.node,e.offset)},o.prototype.getName=function(){return"WrappedTextRange"},s.copyComparisonConstants(o);var g=function(t){if(t.collapsed)return f(new a(t.startContainer,t.startOffset),!0);var e=f(new a(t.startContainer,t.startOffset),!0),n=f(new a(t.endContainer,t.endOffset),!1),o=l(s.getRangeDocument(t)).createTextRange();return o.setEndPoint("StartToStart",e),o.setEndPoint("EndToEnd",n),o};if(o.rangeToTextRange=g,o.prototype.toTextRange=function(){return g(this)},t.WrappedTextRange=o,!t.features.implementsDomRange||t.config.preferTextRange){var v=Function("return this;")();void 0===v.Range&&(v.Range=o),t.createNativeRange=function(t){return t=u(t,e,"createNativeRange"),l(t).createTextRange()},t.WrappedRange=o}}t.createRange=function(n){return n=u(n,e,"createRange"),new t.WrappedRange(t.createNativeRange(n))},t.createRangyRange=function(t){return t=u(t,e,"createRangyRange"),new s(t)},r.createAliasForDeprecatedMethod(t,"createIframeRange","createRange"),r.createAliasForDeprecatedMethod(t,"createIframeRangyRange","createRangyRange"),t.addShimListener((function(e){var n=e.document;void 0===n.createRange&&(n.createRange=function(){return t.createRange(n)}),n=e=null}))})),E.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],(function(t,e){t.config.checkSelectionRanges=!0;var n,o,i="boolean",r="number",a=t.dom,s=t.util,l=s.isHostMethod,u=t.DomRange,c=t.WrappedRange,d=t.DOMException,h=a.DomPosition,p=t.features,f="Control",g=a.getDocument,v=a.getBody,y=u.rangesEqual;function m(t){return"string"==typeof t?/^backward(s)?$/i.test(t):!!t}function b(t,n){if(t){if(a.isWindow(t))return t;if(t instanceof Z)return t.win;var o=a.getContentDocument(t,e,n);return a.getWindow(o)}return window}function x(t){return b(t,"getWinSelection").getSelection()}function _(t){return b(t,"getDocSelection").document.selection}function E(t){var e=!1;return t.anchorNode&&(e=1==a.comparePoints(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)),e}var w=l(window,"getSelection"),S=s.isHostObject(document,"selection");p.implementsWinGetSelection=w,p.implementsDocSelection=S;var C=S&&(!w||t.config.preferTextRange);if(C)n=_,t.isSelectionValid=function(t){var e=b(t,"isSelectionValid").document,n=e.selection;return"None"!=n.type||g(n.createRange().parentElement())==e};else{if(!w)return e.fail("Neither document.selection or window.getSelection() detected."),!1;n=x,t.isSelectionValid=function(){return!0}}t.getNativeSelection=n;var N=n();if(!N)return e.fail("Native selection was null (possibly issue 138?)"),!1;var T=t.createNativeRange(document),A=v(document),M=s.areHostProperties(N,["anchorNode","focusNode","anchorOffset","focusOffset"]);p.selectionHasAnchorAndFocus=M;var O=l(N,"extend");p.selectionHasExtend=O;var P=l(N,"setBaseAndExtent");p.selectionHasSetBaseAndExtent=P;var k=typeof N.rangeCount==r;p.selectionHasRangeCount=k;var R=!1,D=!0,L=O?function(e,n){var o=u.getRangeDocument(n),i=t.createRange(o);i.collapseToPoint(n.endContainer,n.endOffset),e.addRange(G(i)),e.extend(n.startContainer,n.startOffset)}:null;s.areHostMethods(N,["addRange","getRangeAt","removeAllRanges"])&&typeof N.rangeCount==r&&p.implementsDomRange&&function(){var e=window.getSelection();if(e){for(var n=e.rangeCount,o=n>1,i=[],r=E(e),s=0;s<n;++s)i[s]=e.getRangeAt(s);var l=a.createTestElement(document,"",!1),u=l.appendChild(document.createTextNode(" ")),c=document.createRange();if(c.setStart(u,1),c.collapse(!0),e.removeAllRanges(),e.addRange(c),D=1==e.rangeCount,e.removeAllRanges(),!o){var d=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(d&&parseInt(d[1])>=36)R=!1;else{var h=c.cloneRange();c.setStart(u,0),h.setEnd(u,3),h.setStart(u,2),e.addRange(c),e.addRange(h),R=2==e.rangeCount}}for(a.removeNode(l),e.removeAllRanges(),s=0;s<n;++s)0==s&&r?L?L(e,i[s]):(t.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),e.addRange(i[s])):e.addRange(i[s])}}(),p.selectionSupportsMultipleRanges=R,p.collapsedNonEditableSelectionsSupported=D;var I,j,B=!1;function H(t,e,n){var o=n?"end":"start",i=n?"start":"end";t.anchorNode=e[o+"Container"],t.anchorOffset=e[o+"Offset"],t.focusNode=e[i+"Container"],t.focusOffset=e[i+"Offset"]}function F(t){var e=t.nativeSelection;t.anchorNode=e.anchorNode,t.anchorOffset=e.anchorOffset,t.focusNode=e.focusNode,t.focusOffset=e.focusOffset}function z(t){t.anchorNode=t.focusNode=null,t.anchorOffset=t.focusOffset=0,t.rangeCount=0,t.isCollapsed=!0,t._ranges.length=0,W(t)}function W(t){t.type=0==t.rangeCount?"None":o(t)?"Caret":"Range"}function G(e){var n;return e instanceof u?((n=t.createNativeRange(e.getDocument())).setEnd(e.endContainer,e.endOffset),n.setStart(e.startContainer,e.startOffset)):e instanceof c?n=e.nativeRange:p.implementsDomRange&&e instanceof a.getWindow(e.startContainer).Range&&(n=e),n}function U(t){if(!t.length||1!=t[0].nodeType)return!1;for(var e=1,n=t.length;e<n;++e)if(!a.isAncestorOf(t[0],t[e]))return!1;return!0}function X(t){var n=t.getNodes();if(!U(n))throw e.createError("getSingleElementFromRange: range "+t.inspect()+" did not consist of a single element");return n[0]}function V(t){return!!t&&void 0!==t.text}function Y(t,e){var n=new c(e);t._ranges=[n],H(t,n,!1),t.rangeCount=1,t.isCollapsed=n.collapsed,W(t)}function q(e){if(e._ranges.length=0,"None"==e.docSelection.type)z(e);else{var n=e.docSelection.createRange();if(V(n))Y(e,n);else{e.rangeCount=n.length;for(var o,i=g(n.item(0)),r=0;r<e.rangeCount;++r)(o=t.createRange(i)).selectNode(n.item(r)),e._ranges.push(o);e.isCollapsed=1==e.rangeCount&&e._ranges[0].collapsed,H(e,e._ranges[e.rangeCount-1],!1),W(e)}}}function K(t,n){for(var o=t.docSelection.createRange(),i=X(n),r=g(o.item(0)),a=v(r).createControlRange(),s=0,l=o.length;s<l;++s)a.add(o.item(s));try{a.add(i)}catch(t){throw e.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),q(t)}function Z(t,e,n){this.nativeSelection=t,this.docSelection=e,this._ranges=[],this.win=n,this.refresh()}function $(t){t.win=t.anchorNode=t.focusNode=t._ranges=null,t.rangeCount=t.anchorOffset=t.focusOffset=0,t.detached=!0,W(t)}A&&l(A,"createControlRange")&&(I=A.createControlRange(),s.areHostProperties(I,["item","add"])&&(B=!0)),p.implementsControlRange=B,o=M?function(t){return t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset}:function(t){return!!t.rangeCount&&t.getRangeAt(t.rangeCount-1).collapsed},l(N,"getRangeAt")?j=function(t,e){try{return t.getRangeAt(e)}catch(t){return null}}:M&&(j=function(e){var n=g(e.anchorNode),o=t.createRange(n);return o.setStartAndEnd(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset),o.collapsed!==this.isCollapsed&&o.setStartAndEnd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset),o}),Z.prototype=t.selectionPrototype;var J=[];function Q(t,e){for(var n,o,i=J.length;i--;)if(o=(n=J[i]).selection,"deleteAll"==e)$(o);else if(n.win==t)return"delete"==e?(J.splice(i,1),!0):o;return"deleteAll"==e&&(J.length=0),null}var tt=function(t){if(t&&t instanceof Z)return t.refresh(),t;var e=Q(t=b(t,"getNativeSelection")),o=n(t),i=S?_(t):null;return e?(e.nativeSelection=o,e.docSelection=i,e.refresh()):(e=new Z(o,i,t),J.push({win:t,selection:e})),e};t.getSelection=tt,s.createAliasForDeprecatedMethod(t,"getIframeSelection","getSelection");var et,nt=Z.prototype;function ot(t,n){for(var o,i=g(n[0].startContainer),r=v(i).createControlRange(),a=0,s=n.length;a<s;++a){o=X(n[a]);try{r.add(o)}catch(t){throw e.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}r.select(),q(t)}if(!C&&M&&s.areHostMethods(N,["removeAllRanges","addRange"])){nt.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),z(this)};var it=function(t,e){L(t.nativeSelection,e),t.refresh()};nt.addRange=k?function(e,n){if(B&&S&&this.docSelection.type==f)K(this,e);else if(m(n)&&O)it(this,e);else{var i;R?i=this.rangeCount:(this.removeAllRanges(),i=0);var r=G(e).cloneRange();try{this.nativeSelection.addRange(r)}catch(t){}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==i+1){if(t.config.checkSelectionRanges){var a=j(this.nativeSelection,this.rangeCount-1);a&&!y(a,e)&&(e=new c(a))}this._ranges[this.rangeCount-1]=e,H(this,e,rt(this.nativeSelection)),this.isCollapsed=o(this),W(this)}else this.refresh()}}:function(t,e){m(e)&&O?it(this,t):(this.nativeSelection.addRange(G(t)),this.refresh())},nt.setRanges=function(t){if(B&&S&&t.length>1)ot(this,t);else{this.removeAllRanges();for(var e=0,n=t.length;e<n;++e)this.addRange(t[e])}}}else{if(!(l(N,"empty")&&l(T,"select")&&B&&C))return e.fail("No means of selecting a Range or TextRange was found"),!1;nt.removeAllRanges=function(){try{if(this.docSelection.empty(),"None"!=this.docSelection.type){var t;if(this.anchorNode)t=g(this.anchorNode);else if(this.docSelection.type==f){var e=this.docSelection.createRange();e.length&&(t=g(e.item(0)))}t&&(v(t).createTextRange().select(),this.docSelection.empty())}}catch(t){}z(this)},nt.addRange=function(e){this.docSelection.type==f?K(this,e):(t.WrappedTextRange.rangeToTextRange(e).select(),this._ranges[0]=e,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,H(this,e,!1),W(this))},nt.setRanges=function(t){this.removeAllRanges();var e=t.length;e>1?ot(this,t):e&&this.addRange(t[0])}}if(nt.getRangeAt=function(t){if(t<0||t>=this.rangeCount)throw new d("INDEX_SIZE_ERR");return this._ranges[t].cloneRange()},C)et=function(e){var n;t.isSelectionValid(e.win)?n=e.docSelection.createRange():(n=v(e.win.document).createTextRange()).collapse(!0),e.docSelection.type==f?q(e):V(n)?Y(e,n):z(e)};else if(l(N,"getRangeAt")&&typeof N.rangeCount==r)et=function(e){if(B&&S&&e.docSelection.type==f)q(e);else if(e._ranges.length=e.rangeCount=e.nativeSelection.rangeCount,e.rangeCount){for(var n=0,i=e.rangeCount;n<i;++n)e._ranges[n]=new t.WrappedRange(e.nativeSelection.getRangeAt(n));H(e,e._ranges[e.rangeCount-1],rt(e.nativeSelection)),e.isCollapsed=o(e),W(e)}else z(e)};else{if(!M||typeof N.isCollapsed!=i||typeof T.collapsed!=i||!p.implementsDomRange)return e.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;et=function(t){var e,n=t.nativeSelection;n.anchorNode?(e=j(n,0),t._ranges=[e],t.rangeCount=1,F(t),t.isCollapsed=o(t),W(t)):z(t)}}nt.refresh=function(t){var e=t?this._ranges.slice(0):null,n=this.anchorNode,o=this.anchorOffset;if(et(this),t){var i=e.length;if(i!=this._ranges.length)return!0;if(this.anchorNode!=n||this.anchorOffset!=o)return!0;for(;i--;)if(!y(e[i],this._ranges[i]))return!0;return!1}};var rt,at=function(t,e){var n=t.getAllRanges();t.removeAllRanges();for(var o=0,i=n.length;o<i;++o)y(e,n[o])||t.addRange(n[o]);t.rangeCount||z(t)};function st(t,e){if(t.win.document!=g(e))throw new d("WRONG_DOCUMENT_ERR")}function lt(t,e){if(e<0||e>(a.isCharacterDataNode(t)?t.length:t.childNodes.length))throw new d("INDEX_SIZE_ERR")}function ut(e){return function(n,o){var i;this.rangeCount?(i=this.getRangeAt(0))["set"+(e?"Start":"End")](n,o):(i=t.createRange(this.win.document)).setStartAndEnd(n,o),this.setSingleRange(i,this.isBackward())}}function ct(t){var e=[],n=new h(t.anchorNode,t.anchorOffset),o=new h(t.focusNode,t.focusOffset),i="function"==typeof t.getName?t.getName():"Selection";if(void 0!==t.rangeCount)for(var r=0,a=t.rangeCount;r<a;++r)e[r]=u.inspect(t.getRangeAt(r));return"["+i+"(Ranges: "+e.join(", ")+")(anchor: "+n.inspect()+", focus: "+o.inspect()+"]"}nt.removeRange=B&&S?function(t){if(this.docSelection.type==f){for(var e=this.docSelection.createRange(),n=X(t),o=g(e.item(0)),i=v(o).createControlRange(),r=!1,a=0,s=e.length;a<s;++a)e.item(a)!==n||r?i.add(e.item(a)):r=!0;i.select(),q(this)}else at(this,t)}:function(t){at(this,t)},!C&&M&&p.implementsDomRange?(rt=E,nt.isBackward=function(){return rt(this)}):rt=nt.isBackward=function(){return!1},nt.isBackwards=nt.isBackward,nt.toString=function(){for(var t=[],e=0,n=this.rangeCount;e<n;++e)t[e]=""+this._ranges[e];return t.join("")},nt.collapse=function(e,n){st(this,e);var o=t.createRange(e);o.collapseToPoint(e,n),this.setSingleRange(o),this.isCollapsed=!0},nt.collapseToStart=function(){if(!this.rangeCount)throw new d("INVALID_STATE_ERR");var t=this._ranges[0];this.collapse(t.startContainer,t.startOffset)},nt.collapseToEnd=function(){if(!this.rangeCount)throw new d("INVALID_STATE_ERR");var t=this._ranges[this.rangeCount-1];this.collapse(t.endContainer,t.endOffset)},nt.selectAllChildren=function(e){st(this,e);var n=t.createRange(e);n.selectNodeContents(e),this.setSingleRange(n)},P?nt.setBaseAndExtent=function(t,e,n,o){this.nativeSelection.setBaseAndExtent(t,e,n,o),this.refresh()}:O&&(nt.setBaseAndExtent=function(e,n,o,i){lt(e,n),lt(o,i),st(this,e),st(this,o);var r=t.createRange(node),s=-1==a.comparePoints(e,n,o,i);s?r.setStartAndEnd(o,i,e,n):r.setStartAndEnd(e,n,o,i),this.setSingleRange(r,s)}),nt.deleteFromDocument=function(){if(B&&S&&this.docSelection.type==f){for(var t,e=this.docSelection.createRange();e.length;)t=e.item(0),e.remove(t),a.removeNode(t);this.refresh()}else if(this.rangeCount){var n=this.getAllRanges();if(n.length){this.removeAllRanges();for(var o=0,i=n.length;o<i;++o)n[o].deleteContents();this.addRange(n[i-1])}}},nt.eachRange=function(t,e){for(var n=0,o=this._ranges.length;n<o;++n)if(t(this.getRangeAt(n)))return e},nt.getAllRanges=function(){var t=[];return this.eachRange((function(e){t.push(e)})),t},nt.setSingleRange=function(t,e){this.removeAllRanges(),this.addRange(t,e)},nt.callMethodOnEachRange=function(t,e){var n=[];return this.eachRange((function(o){n.push(o[t].apply(o,e||[]))})),n},nt.setStart=ut(!0),nt.setEnd=ut(!1),t.rangePrototype.select=function(t){tt(this.getDocument()).setSingleRange(this,t)},nt.changeEachRange=function(t){var e=[],n=this.isBackward();this.eachRange((function(n){t(n),e.push(n)})),this.removeAllRanges(),n&&1==e.length?this.addRange(e[0],"backward"):this.setRanges(e)},nt.containsNode=function(t,e){return this.eachRange((function(n){return n.containsNode(t,e)}),!0)||!1},nt.getBookmark=function(t){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[t])}},nt.moveToBookmark=function(e){for(var n,o,i=[],r=0;n=e.rangeBookmarks[r++];)(o=t.createRange(this.win)).moveToBookmark(n),i.push(o);e.backward?this.setSingleRange(i[0],"backward"):this.setRanges(i)},nt.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},nt.restoreRanges=function(t){this.removeAllRanges();for(var e,n=0;e=t.ranges[n];++n)this.addRange(e,t.backward&&0==n)},nt.toHtml=function(){var t=[];return this.eachRange((function(e){t.push(u.toHtml(e))})),t.join("")},p.implementsTextRange&&(nt.getNativeTextRange=function(){var n;if(n=this.docSelection){var o=n.createRange();if(V(o))return o;throw e.createError("getNativeTextRange: selection is a control selection")}if(this.rangeCount>0)return t.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw e.createError("getNativeTextRange: selection contains no range")}),nt.getName=function(){return"WrappedSelection"},nt.inspect=function(){return ct(this)},nt.detach=function(){Q(this.win,"delete"),$(this)},Z.detachAll=function(){Q(null,"deleteAll")},Z.inspect=ct,Z.isDirectionBackward=m,t.Selection=Z,t.selectionPrototype=nt,t.addShimListener((function(t){void 0===t.getSelection&&(t.getSelection=function(){return tt(t)}),t=null}))}));var B=!1,H=function(t){B||(B=!0,!E.initialized&&E.config.autoInitialize&&M())};return x&&("complete"==document.readyState?H():(s(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",H,!1),y(window,"load",H))),E}()}(eS);var nS={},oS={get exports(){return nS},set exports(t){nS=t}};!function(t){var e;t.exports=((e=tS).createModule("ClassApplier",["WrappedSelection"],(function(t,e){var n=t.dom,o=n.DomPosition,i=n.arrayContains,r=t.util,a=r.forEach,s="span",l=r.isHostMethod(document,"createElementNS");function u(t,e){for(var n in t)if(t.hasOwnProperty(n)&&!1===e(n,t[n]))return!1;return!0}function c(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function d(t,e){return!!t&&new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(t)}function h(t,e){return"object"==typeof t.classList?t.classList.contains(e):d("string"==typeof t.className?t.className:t.getAttribute("class"),e)}function p(t,e){if("object"==typeof t.classList)t.classList.add(e);else{var n="string"==typeof t.className,o=n?t.className:t.getAttribute("class");o?d(o,e)||(o+=" "+e):o=e,n?t.className=o:t.setAttribute("class",o)}}var f=function(){function t(t,e,n){return e&&n?" ":""}return function(e,n){if("object"==typeof e.classList)e.classList.remove(n);else{var o="string"==typeof e.className,i=o?e.className:e.getAttribute("class");i=i.replace(new RegExp("(^|\\s)"+n+"(\\s|$)"),t),o?e.className=i:e.setAttribute("class",i)}}}();function g(t){return"string"==typeof t.className?t.className:t.getAttribute("class")}function v(t){return t&&t.split(/\s+/).sort().join(" ")}function y(t){return v(g(t))}function m(t,e){return y(t)==y(e)}function b(t,e){for(var n=e.split(/\s+/),o=0,i=n.length;o<i;++o)if(!h(t,c(n[o])))return!1;return!0}function x(t){var e=t.parentNode;return e&&1==e.nodeType&&!/^(textarea|style|script|select|iframe)$/i.test(e.nodeName)}function _(t,e,n,o,i){var r=t.node,a=t.offset,s=r,l=a;r==o&&a>i&&++l,r!=e||a!=n&&a!=n+1||(s=o,l+=i-n),r==e&&a>n+1&&--l,t.node=s,t.offset=l}function E(t,e,n){t.node==e&&t.offset>n&&--t.offset}function w(t,e,o,i){-1==o&&(o=e.childNodes.length);var r=t.parentNode,s=n.getNodeIndex(t);a(i,(function(t){_(t,r,s,e,o)})),e.childNodes.length==o?e.appendChild(t):e.insertBefore(t,e.childNodes[o])}function S(t,e){var o=t.parentNode,i=n.getNodeIndex(t);a(e,(function(t){E(t,o,i)})),n.removeNode(t)}function C(t,e,n,o,i){for(var r,a=[];r=t.firstChild;)w(r,e,n++,i),a.push(r);return S(t,i),a}function N(t,e){return C(t,t.parentNode,n.getNodeIndex(t),!0,e)}function T(t,e){var n=t.cloneRange();n.selectNodeContents(e);var o=n.intersection(t);return""!=(o?o.toString():"")}function A(t){for(var e,n=t.getNodes([3]),o=0;(e=n[o])&&!T(t,e);)++o;for(var i=n.length-1;(e=n[i])&&!T(t,e);)--i;return n.slice(o,i+1)}function M(t,e){if(t.attributes.length!=e.attributes.length)return!1;for(var n,o,i,r=0,a=t.attributes.length;r<a;++r)if("class"!=(i=(n=t.attributes[r]).name)){if(null===n!=(null===(o=e.attributes.getNamedItem(i))))return!1;if(n.specified!=o.specified)return!1;if(n.specified&&n.nodeValue!==o.nodeValue)return!1}return!0}function O(t,e){for(var n,o=0,r=t.attributes.length;o<r;++o)if(n=t.attributes[o].name,(!e||!i(e,n))&&t.attributes[o].specified&&"class"!=n)return!0;return!1}var P=n.getComputedStyleProperty,k="boolean"==typeof document.createElement("div").isContentEditable?function(t){return t&&1==t.nodeType&&t.isContentEditable}:function(t){return!(!t||1!=t.nodeType||"false"==t.contentEditable)&&("true"==t.contentEditable||k(t.parentNode))};function R(t){var e;return t&&1==t.nodeType&&((e=t.parentNode)&&9==e.nodeType&&"on"==e.designMode||k(t)&&!k(t.parentNode))}function D(t){return(k(t)||1!=t.nodeType&&k(t.parentNode))&&!R(t)}var L=/^inline(-block|-table)?$/i;function I(t){return t&&1==t.nodeType&&!L.test(P(t,"display"))}var j=/[^\r\n\t\f \u200B]/;function B(t){if(0==t.data.length)return!0;if(j.test(t.data))return!1;switch(P(t.parentNode,"whiteSpace")){case"pre":case"pre-wrap":case"-moz-pre-wrap":return!1;case"pre-line":if(/[\r\n]/.test(t.data))return!1}return I(t.previousSibling)||I(t.nextSibling)}function H(t){var e,n,i=[];for(e=0;n=t[e++];)i.push(new o(n.startContainer,n.startOffset),new o(n.endContainer,n.endOffset));return i}function F(t,e){for(var n,o,i,r=0,a=t.length;r<a;++r)n=t[r],o=e[2*r],i=e[2*r+1],n.setStartAndEnd(o.node,o.offset,i.node,i.offset)}function z(t,e){return n.isCharacterDataNode(t)?0==e?!!t.previousSibling:e!=t.length||!!t.nextSibling:e>0&&e<t.childNodes.length}function W(t,o,i,r){var a,s,l=0==i;if(n.isAncestorOf(o,t))return t;if(n.isCharacterDataNode(o)){var u=n.getNodeIndex(o);if(0==i)i=u;else{if(i!=o.length)throw e.createError("splitNodeAt() should not be called with offset in the middle of a data node ("+i+" in "+o.data);i=u+1}o=o.parentNode}if(z(o,i)){a=o.cloneNode(!1),s=o.parentNode,a.id&&a.removeAttribute("id");for(var c,d=0;c=o.childNodes[i];)w(c,a,d++,r);return w(a,s,n.getNodeIndex(o)+1,r),o==t?a:W(t,s,n.getNodeIndex(a),r)}if(t!=o){a=o.parentNode;var h=n.getNodeIndex(o);return l||h++,W(t,a,h,r)}return t}function G(t,e){return t.namespaceURI==e.namespaceURI&&t.tagName.toLowerCase()==e.tagName.toLowerCase()&&m(t,e)&&M(t,e)&&"inline"==P(t,"display")&&"inline"==P(e,"display")}function U(t){var e=t?"nextSibling":"previousSibling";return function(n,o){var i=n.parentNode,r=n[e];if(r){if(r&&3==r.nodeType)return r}else if(o&&(r=i[e])&&1==r.nodeType&&G(i,r)){var a=r[t?"firstChild":"lastChild"];if(a&&3==a.nodeType)return a}return null}}var X=U(!1),V=U(!0);function Y(t){this.isElementMerge=1==t.nodeType,this.textNodes=[];var e=this.isElementMerge?t.lastChild:t;e&&(this.textNodes[0]=e)}Y.prototype={doMerge:function(t){var e=this.textNodes,o=e[0];if(e.length>1){var i,r=n.getNodeIndex(o),s=[],l=0;a(e,(function(u,c){i=u.parentNode,c>0&&(i.removeChild(u),i.hasChildNodes()||n.removeNode(i),t&&a(t,(function(t){t.node==u&&(t.node=o,t.offset+=l),t.node==i&&t.offset>r&&(--t.offset,t.offset==r+1&&c<e.length-1&&(t.node=o,t.offset=l))}))),s[c]=u.data,l+=u.data.length})),o.data=s.join("")}return o.data},getLength:function(){for(var t=this.textNodes.length,e=0;t--;)e+=this.textNodes[t].length;return e},toString:function(){var t=[];return a(this.textNodes,(function(e,n){t[n]="'"+e.data+"'"})),"[Merge("+t.join(",")+")]"}};var q=["elementTagName","ignoreWhiteSpace","applyToEditableOnly","useExistingElements","removeEmptyElements","onElementCreate"],K={};function Z(t,e,n){var o,i,r,a,s=this;s.cssClass=s.className=t;var l=null,d={};if("object"==typeof e&&null!==e){for(void 0!==e.elementTagName&&(e.elementTagName=e.elementTagName.toLowerCase()),n=e.tagNames,l=e.elementProperties,d=e.elementAttributes,i=0;a=q[i++];)e.hasOwnProperty(a)&&(s[a]=e[a]);o=e.normalize}else o=e;s.normalize=void 0===o||o,s.attrExceptions=[];var h=document.createElement(s.elementTagName);s.elementProperties=s.copyPropertiesToElement(l,h,!0),u(d,(function(t,e){s.attrExceptions.push(t),d[t]=""+e})),s.elementAttributes=d,s.elementSortedClassName=s.elementProperties.hasOwnProperty("className")?v(s.elementProperties.className+" "+t):t,s.applyToAnyTagName=!1;var p=typeof n;if("string"==p)"*"==n?s.applyToAnyTagName=!0:s.tagNames=c(n.toLowerCase()).split(/\s*,\s*/);else if("object"==p&&"number"==typeof n.length)for(s.tagNames=[],i=0,r=n.length;i<r;++i)"*"==n[i]?s.applyToAnyTagName=!0:s.tagNames.push(n[i].toLowerCase());else s.tagNames=[s.elementTagName]}function $(t,e,n){return new Z(t,e,n)}Z.prototype={elementTagName:s,elementProperties:{},elementAttributes:{},ignoreWhiteSpace:!0,applyToEditableOnly:!1,useExistingElements:!0,removeEmptyElements:!0,onElementCreate:null,copyPropertiesToElement:function(t,e,n){var o,i,r,a,s,l,u={};for(var c in t)if(t.hasOwnProperty(c))if(a=t[c],s=e[c],"className"==c)p(e,a),p(e,this.className),e[c]=v(e[c]),n&&(u[c]=a);else if("style"==c){for(o in i=s,n&&(u[c]=r={}),t[c])t[c].hasOwnProperty(o)&&(i[o]=a[o],n&&(r[o]=i[o]));this.attrExceptions.push(c)}else e[c]=a,n&&(u[c]=e[c],l=K.hasOwnProperty(c)?K[c]:c,this.attrExceptions.push(l));return n?u:""},copyAttributesToElement:function(t,e){for(var n in t)t.hasOwnProperty(n)&&!/^class(?:Name)?$/i.test(n)&&e.setAttribute(n,t[n])},appliesToElement:function(t){return i(this.tagNames,t.tagName.toLowerCase())},getEmptyElements:function(t){var e=this;return t.getNodes([1],(function(t){return e.appliesToElement(t)&&!t.hasChildNodes()}))},hasClass:function(t){return 1==t.nodeType&&(this.applyToAnyTagName||this.appliesToElement(t))&&h(t,this.className)},getSelfOrAncestorWithClass:function(t){for(;t;){if(this.hasClass(t))return t;t=t.parentNode}return null},isModifiable:function(t){return!this.applyToEditableOnly||D(t)},isIgnorableWhiteSpaceNode:function(t){return this.ignoreWhiteSpace&&t&&3==t.nodeType&&B(t)},postApply:function(t,e,n,o){var i,r,s=t[0],l=t[t.length-1],u=[],c=s,d=l,h=0,p=l.length;a(t,(function(t){(r=X(t,!o))?(i||(i=new Y(r),u.push(i)),i.textNodes.push(t),t===s&&(c=i.textNodes[0],h=c.length),t===l&&(d=i.textNodes[0],p=i.getLength())):i=null}));var f=V(l,!o);if(f&&(i||(i=new Y(l),u.push(i)),i.textNodes.push(f)),u.length){for(var g=0,v=u.length;g<v;++g)u[g].doMerge(n);e.setStartAndEnd(c,h,d,p)}},createContainer:function(t){var e=n.getDocument(t),o=l&&!n.isHtmlNamespace(t)&&t.namespaceURI?e.createElementNS(t.namespaceURI,this.elementTagName):e.createElement(this.elementTagName);return this.copyPropertiesToElement(this.elementProperties,o,!1),this.copyAttributesToElement(this.elementAttributes,o),p(o,this.className),this.onElementCreate&&this.onElementCreate(o,this),o},elementHasProperties:function(t,e){var n=this;return u(e,(function(e,o){if("className"==e)return b(t,o);if("object"==typeof o){if(!n.elementHasProperties(t[e],o))return!1}else if(t[e]!==o)return!1}))},elementHasAttributes:function(t,e){return u(e,(function(e,n){if(t.getAttribute(e)!==n)return!1}))},applyToTextNode:function(t,e){if(x(t)){var n=t.parentNode;if(1==n.childNodes.length&&this.useExistingElements&&this.appliesToElement(n)&&this.elementHasProperties(n,this.elementProperties)&&this.elementHasAttributes(n,this.elementAttributes))p(n,this.className);else{var o=t.parentNode,i=this.createContainer(o);o.insertBefore(i,t),i.appendChild(t)}}},isRemovable:function(t){return t.tagName.toLowerCase()==this.elementTagName&&y(t)==this.elementSortedClassName&&this.elementHasProperties(t,this.elementProperties)&&!O(t,this.attrExceptions)&&this.elementHasAttributes(t,this.elementAttributes)&&this.isModifiable(t)},isEmptyContainer:function(t){var e=t.childNodes.length;return 1==t.nodeType&&this.isRemovable(t)&&(0==e||1==e&&this.isEmptyContainer(t.firstChild))},removeEmptyContainers:function(t){var e=this,n=t.getNodes([1],(function(t){return e.isEmptyContainer(t)})),o=[t],i=H(o);a(n,(function(t){S(t,i)})),F(o,i)},undoToTextNode:function(t,e,n,o){if(!e.containsNode(n)){var i=e.cloneRange();i.selectNode(n),i.isPointInRange(e.endContainer,e.endOffset)&&(W(n,e.endContainer,e.endOffset,o),e.setEndAfter(n)),i.isPointInRange(e.startContainer,e.startOffset)&&(n=W(n,e.startContainer,e.startOffset,o))}this.isRemovable(n)?N(n,o):f(n,this.className)},splitAncestorWithClass:function(t,e,n){var o=this.getSelfOrAncestorWithClass(t);o&&W(o,t,e,n)},undoToAncestor:function(t,e){this.isRemovable(t)?N(t,e):f(t,this.className)},applyToRange:function(t,e){var n=this,o=H((e=e||[])||[]);t.splitBoundariesPreservingPositions(o),n.removeEmptyElements&&n.removeEmptyContainers(t);var i=A(t);if(i.length){a(i,(function(t){n.isIgnorableWhiteSpaceNode(t)||n.getSelfOrAncestorWithClass(t)||!n.isModifiable(t)||n.applyToTextNode(t,o)}));var r=i[i.length-1];t.setStartAndEnd(i[0],0,r,r.length),n.normalize&&n.postApply(i,t,o,!1),F(e,o)}var s=n.getEmptyElements(t);a(s,(function(t){p(t,n.className)}))},applyToRanges:function(t){for(var e=t.length;e--;)this.applyToRange(t[e],t);return t},applyToSelection:function(e){var n=t.getSelection(e);n.setRanges(this.applyToRanges(n.getAllRanges()))},undoToRange:function(t,e){var n=this,o=H(e=e||[]);t.splitBoundariesPreservingPositions(o),n.removeEmptyElements&&n.removeEmptyContainers(t,o);var i,r,s=A(t),l=s[s.length-1];if(s.length){n.splitAncestorWithClass(t.endContainer,t.endOffset,o),n.splitAncestorWithClass(t.startContainer,t.startOffset,o);for(var u=0,c=s.length;u<c;++u)i=s[u],(r=n.getSelfOrAncestorWithClass(i))&&n.isModifiable(i)&&n.undoToAncestor(r,o);t.setStartAndEnd(s[0],0,l,l.length),n.normalize&&n.postApply(s,t,o,!0),F(e,o)}var d=n.getEmptyElements(t);a(d,(function(t){f(t,n.className)}))},undoToRanges:function(t){for(var e=t.length;e--;)this.undoToRange(t[e],t);return t},undoToSelection:function(e){var n=t.getSelection(e),o=t.getSelection(e).getAllRanges();this.undoToRanges(o),n.setRanges(o)},isAppliedToRange:function(t){if(t.collapsed||""==t.toString())return!!this.getSelfOrAncestorWithClass(t.commonAncestorContainer);var e=t.getNodes([3]);if(e.length)for(var n,o=0;n=e[o++];)if(!this.isIgnorableWhiteSpaceNode(n)&&T(t,n)&&this.isModifiable(n)&&!this.getSelfOrAncestorWithClass(n))return!1;return!0},isAppliedToRanges:function(t){var e=t.length;if(0==e)return!1;for(;e--;)if(!this.isAppliedToRange(t[e]))return!1;return!0},isAppliedToSelection:function(e){var n=t.getSelection(e);return this.isAppliedToRanges(n.getAllRanges())},toggleRange:function(t){this.isAppliedToRange(t)?this.undoToRange(t):this.applyToRange(t)},toggleSelection:function(t){this.isAppliedToSelection(t)?this.undoToSelection(t):this.applyToSelection(t)},getElementsWithClassIntersectingRange:function(t){var e=[],n=this;return t.getNodes([3],(function(t){var o=n.getSelfOrAncestorWithClass(t);o&&!i(e,o)&&e.push(o)})),e},detach:function(){}},Z.util={hasClass:h,addClass:p,removeClass:f,getClass:g,hasSameClasses:m,hasAllClasses:b,replaceWithOwnChildren:N,elementsHaveSameNonClassAttributes:M,elementHasNonClassAttributes:O,splitNodeAt:W,isEditableElement:k,isEditingHost:R,isEditable:D},t.CssClassApplier=t.ClassApplier=Z,t.createClassApplier=$,r.createAliasForDeprecatedMethod(t,"createCssClassApplier","createClassApplier",e)})),e)}(oS);var iS={toolbar:{allowMultiParagraphSelection:!0,buttons:["bold","colorpicker","italic","underline","strikethrough","quote","justifyLeft","justifyCenter","justifyRight","justifyFull","superscript","subscript","orderedlist","unorderedlist","pre","removeFormat","outdent","indent","h2","h3"],standardizeSelectionStart:!1,updateOnEmptySelection:!1},placeholder:{text:"请输入内容",hideOnClick:!0},disableEditing:!0},rS=jw.extensions.button.extend({name:"colorpicker",tagNames:["mark"],contentDefault:"<b>Color</b>",aria:"Color Picker",action:"colorPicker",init:function(){var t=this;tS.init(),jw.extensions.button.prototype.init.call(this),this.colorPicker=new Jw({parent:this.button,color:"#000",onDone:function(e){t.coloredText&&t.coloredText.isAppliedToSelection()&&t.coloredText.undoToSelection(),t.coloredText=tS.createClassApplier("colored",{elementTagName:"span",elementProperties:{style:{color:e.hex}},normalize:!0}),t.coloredText.toggleSelection(),t.base.checkContentChanged(),t.setInactive()}})},getButton:function(){return this.button},handleClick:function(){this.setActive(),this.colorPicker.show()},isAlreadyApplied:function(t){return"mark"===t.nodeName.toLowerCase()},isActive:function(){return this.button.classList.contains("medium-editor-button-active")},setInactive:function(){this.button.classList.remove("medium-editor-button-active")},setActive:function(){this.button.classList.add("medium-editor-button-active")}}),aS=function(t){function n(e){var n=t.call(this,e)||this;n.labelMap=new Map;var o=e.lf,i=e.graphModel;return n.lf=o,n.graphModel=i,n.state={tick:0},n}return f(n,t),n.prototype.componentDidMount=function(){var t=this,e=this.props.graphModel;this.editor=new jw(".lf-label-editor",md(iS,{autoLink:!0,extensions:{colorPicker:new rS}})),e.eventCenter.on("text:update,node:mousemove,node:resize,node:rotate,node:drag,label:drop,node:drop",(function(){})),e.eventCenter.on("node:properties-change,node:properties-delete",(function(){t.setState({tick:t.state.tick+1})}))},n.prototype.componentDidUpdate=function(){var t;this.editor&&this.editor.elements.length>0?this.editor.addElements(".lf-label-editor"):(null===(t=this.editor)||void 0===t||t.destroy(),this.editor=new jw(".lf-label-editor",md(iS,{autoLink:!0,extensions:{colorPicker:new rS}})))},n.prototype.componentWillUnmount=function(){var t;null===(t=this.editor)||void 0===t||t.destroy()},n.prototype.getLabels=function(){var t=this,e=this.props,n=e.lf.extension,o=e.graphModel,i=E(E([],_(o.nodes),!1),_(o.edges),!1);if(n.label){var r=[];return xu(i,(function(e){var n,i;xu(null!==(i=null===(n=e.getData().properties)||void 0===n?void 0:n._label)&&void 0!==i?i:[],(function(n){var i=t.labelMap,a=new Iw(n,e,o);i.set(a.id,a),r.push(gg(Dw,{label:a,element:e,graphModel:o},a.id))}))})),r}return null},n.prototype.render=function(){return gg("foreignObject",{id:"lf-label-overlay",class:"lf-label-overlay",children:this.getLabels()})},n.toolName="label-edit-tool",n=y([e.observer],n)}(e.Component),sS=function(){function t(t){var n,o,i,r=t.lf,a=t.options;this.labelInitPositionMap=new Map,this.lf=r,this.options=null!=a?a:{},this.textOverflowMode=null!==(n=a.textOverflowMode)&&void 0!==n?n:"default",this.isMultiple=null===(o=a.isMultiple)||void 0===o||o,this.labelWidth=a.labelWidth,this.maxCount=null!==(i=a.maxCount)&&void 0!==i?i:1/0,r.graphModel.editConfigModel.updateTextMode(e.TextMode.LABEL),this.addEventListeners(),r.tool.registerTool(aS.toolName,aS),r.tool.disableTool("text-edit-tool")}return t.prototype.formatConfig=function(t,n){var o=t.editConfigModel,i=o.nodeTextEdit,r=o.edgeTextEdit,a=o.nodeTextDraggable,s=o.edgeTextDraggable,l=this,u=l.textOverflowMode,c=l.isMultiple,d=l.maxCount,h=l.labelWidth,p=n.text,f=n.zIndex,v=n.properties,y=v._label,m=v._labelOption,b=y,x=void 0===m?{}:m,_=x.isMultiple,E=x.maxCount,w=[];if(ee(b)){var S=null!=E?E:d;w=c&&_?b.length>S?b.slice(0,S):b:[b[0]]}else if(he(b))w=[b];else if("string"==typeof b||!b){var C=g(g({},p),{content:b||p.value,draggable:"edge"===n.BaseType?s:a});w=C.value?[C]:[]}return"edge"===n.BaseType&&(w=Ju(w,(function(t){return t}))),Ju(w,(function(t){t.id||(t.id=e.createUuid());var o=t.value,l=t.content,c=t.vertical,d=t.editable,p=t.draggable,v=t.textOverflowMode,y="node"===n.BaseType?i:r,m="node"===n.BaseType?a:s;return g(g({},t),{zIndex:f,labelWidth:h,content:null!=l?l:o,vertical:null!=c&&c,editable:y&&d,draggable:m&&p,textOverflowMode:null!=v?v:u})}))},t.prototype.setupLabels=function(t){var e=this;xu(t.sortElements,(function(n){e.rewriteInnerMethods(n);var o=e.formatConfig(t,n);n.setProperty("_label",o)}))},t.prototype.addLabel=function(t,n){var o,i,r,a=this.isMultiple,s=this.maxCount,l=t.properties,u=null!==(o=l._label)&&void 0!==o?o:[],c=null!==(i=l._labelOption)&&void 0!==i?i:{},d=u.length,h={id:e.createUuid(),x:n.x,y:n.y,content:"Label".concat(d+1),value:"Label".concat(d+1),style:{},draggable:!0,editable:!0,vertical:!1};!a||d>=(null!==(r=null==c?void 0:c.maxCount)&&void 0!==r?r:s)||(u.push(h),t.setProperty("_label",u))},t.prototype.addEventListeners=function(){var t=this,n=this.lf.graphModel,o=n.eventCenter,i=n.editConfigModel;o.on("graph:rendered",(function(e){var n=e.graphModel;t.setupLabels(n)})),o.on("node:dbclick,edge:dbclick",(function(o){var r=o.e,a=o.data,s=n.getElement(a.id),l=n.getPointByClient({x:r.clientX,y:r.clientY}).canvasOverlayPosition,u={x:l.x,y:l.y};s&&i.textMode===e.TextMode.LABEL&&t.addLabel(s,u)})),o.on("node:resize",(function(t){var e,n,o=t.preData,i=t.data,r=t.model,a=null!==(e=o.properties)&&void 0!==e?e:{},s=a.width,l=a.height,u=a._label,c=void 0===u?[]:u,d=null!==(n=i.properties)&&void 0!==n?n:{},h=d.width,p=d.height;if(s&&l&&h&&p){var f={x:o.x,y:o.y,width:s,height:l},v={x:i.x,y:i.y,width:h,height:p},y=Ju(c,(function(t){var e,n,o,i,r,a,s,l,u,c,d,h=t.x,p=t.y,y=(n=v,o={x:h,y:p},i=(e=f).x,r=e.y,a=e.width,s=e.height,l=n.x,u=n.y,c=n.width,d=n.height,{x:l+(o.x-i)/a*c,y:u+(o.y-r)/s*d});return g(g({},t),y)}));r.setProperty("_label",y)}})),o.on("node:rotate",(function(e){var n=e.model,o=n.x,i=n.y,r=n.rotate,a=n.properties._label,s={x:o,y:i},l=Ju(void 0===a?[]:a,(function(e){if(!e.id)return e;var n={x:e.x,y:e.y};t.labelInitPositionMap.has(e.id)?n=t.labelInitPositionMap.get(e.id):t.labelInitPositionMap.set(e.id,n);var o=r*(180/Math.PI);o<0&&(o+=360);var i=o*(Math.PI/180),a=vw(n,s,i);return g(g(g({},e),a),{rotate:o})}));n.setProperty("_label",l)})),o.on("node:add,edge:add",(function(e){var o=e.data,i=n.getElement(o.id);if(i){var r=t.formatConfig(n,o);i.setProperty("_label",r)}}))},t.prototype.rewriteInnerMethods=function(t){t.moveText=function(e,n){if(t.text){var o=t.text,i=o.x,r=o.y,a=o.value,s=o.draggable,l=o.editable;t.text={value:a,editable:l,draggable:s,x:i+e,y:r+n};var u=Is(t.getProperties());if(ee(u._label)){var c=Ju(u._label,(function(t){return g(g({},t),{x:t.x+e,y:t.y+n})}));null==t||t.setProperty("_label",c)}}}},t.prototype.updateTextMode=function(t){var n=this.lf.graphModel.editConfigModel;t!==n.textMode&&(n.updateTextMode(t),t===e.TextMode.LABEL?(this.lf.tool.enableTool(aS.toolName),this.lf.tool.disableTool("text-edit-tool")):t===e.TextMode.TEXT&&(this.lf.tool.enableTool("text-edit-tool"),this.lf.tool.disableTool(aS.toolName)))},t.prototype.render=function(){},t.prototype.destroy=function(){},t.pluginName="label",t}(),lS={};function uS(t){return t.startsWith("data:text/plain")}function cS(t){return m(this,void 0,void 0,(function(){return b(this,(function(e){return lS[t]?[2,lS[t]]:[2,new Promise((function(e,n){try{fetch(t).then((function(t){return t.blob()})).then((function(o){var i=new FileReader;i.onloadend=function(){e(lS[t]=i.result)},i.onerror=n,i.readAsDataURL(o)})).catch((function(){e(lS[t]=t)}))}catch(e){return lS[t]=t}}))]}))}))}function dS(t,e){return m(this,void 0,void 0,(function(){var n,o;return b(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),(n=t.getAttribute(e)||"").startsWith("data:")?[2]:[4,cS(n)];case 1:return uS(o=i.sent())?[2]:(t.setAttribute(e,o),[3,3]);case 2:return i.sent(),[3,3];case 3:return[2]}}))}))}function hS(t,e){return m(this,void 0,void 0,(function(){var n;return b(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),e.startsWith("data:")?[2]:[4,cS(e)];case 1:return uS(n=o.sent())?[2]:(t.style.backgroundImage="url(".concat(n,")"),[3,3]);case 2:return o.sent(),[3,3];case 3:return[2]}}))}))}function pS(t){return m(this,void 0,void 0,(function(){var e,n,o,i,r,a,s,l,u;return b(this,(function(c){switch(c.label){case 0:for(e=[t],o=[];e.length;)(n=e.shift()).children.length&&e.push.apply(e,E([],_(n.children),!1)),n instanceof HTMLElement&&(i=n.style,r=i.background,a=i.backgroundImage,(s=r.match(/url\(["']?(.*?)["']?\)/))&&s[1]&&(u=s[1],o.push(hS(n,u))),(l=a.match(/url\(["']?(.*?)["']?\)/))&&l[1]&&(u=l[1],o.push(hS(n,u)))),n instanceof HTMLImageElement?o.push(dS(n,"src")):n instanceof SVGImageElement&&o.push(dS(n,"href"));return[4,Promise.all(o)];case 1:return c.sent(),[2]}}))}))}function fS(t,e,n){var o=document.createElement("canvas");o.width=e,o.height=n;var i=o.getContext("2d");return i&&i.drawImage(t,0,0,t.width,t.height,0,0,e,n),o}var gS=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.customCssRules="",this.useGlobalRules=!0,e.getSnapshot=function(t,e){return m(n,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return[4,this.getSnapshot(t,e)];case 1:return[2,n.sent()]}}))}))},e.getSnapshotBlob=function(t,e){return m(n,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return[4,this.getSnapshotBlob(t,e)];case 1:return[2,n.sent()]}}))}))},e.getSnapshotBase64=function(t,e){return m(n,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return[4,this.getSnapshotBase64(t,e)];case 1:return[2,n.sent()]}}))}))}}return t.prototype.getSvgRootElement=function(t){return t.container.querySelector(".lf-canvas-overlay")},t.prototype.triggerDownload=function(t){var e=new MouseEvent("click",{view:document.defaultView,bubbles:!1,cancelable:!0}),n=document.createElement("a");n.setAttribute("download",this.fileName),n.setAttribute("href",t),n.setAttribute("target","_blank"),n.dispatchEvent(e)},t.prototype.removeAnchor=function(t){for(var e=t.childNodes,n=t.childNodes&&t.childNodes.length,o=0;o<n;o++){var i=e[o];(i.classList&&Array.from(i.classList)||[]).indexOf("lf-anchor")>-1&&(t.removeChild(t.childNodes[o]),n--,o--)}},t.prototype.removeRotateControl=function(t){for(var e=t.childNodes,n=t.childNodes&&t.childNodes.length,o=0;o<n;o++){var i=e[o];(i.classList&&Array.from(i.classList)||[]).indexOf("lf-rotate-control")>-1&&(t.removeChild(t.childNodes[o]),n--,o--)}},t.prototype.getSnapshot=function(t,e){return m(this,void 0,void 0,(function(){var n,o,i,r,a=this;return b(this,(function(s){switch(s.label){case 0:return n=this.lf.graphModel.getPartial(),o=(null!=e?e:{}).partial,i=void 0===o?n:o,r=this.lf.getEditConfig(),this.lf.updateEditConfig({isSilentMode:!0,stopScrollGraph:!0,stopMoveGraph:!0}),n===i?[3,1]:(this.lf.graphModel.setPartial(i),this.lf.graphModel.eventCenter.once("graph:updated",(function(){return m(a,void 0,void 0,(function(){return b(this,(function(o){switch(o.label){case 0:return[4,this.snapshot(t,e)];case 1:return o.sent(),this.lf.graphModel.setPartial(n),[2]}}))}))})),[3,3]);case 1:return[4,this.snapshot(t,e)];case 2:s.sent(),s.label=3;case 3:return this.lf.updateEditConfig(r),[2]}}))}))},t.prototype.snapshot=function(t,e){return m(this,void 0,void 0,(function(){var n,o,i,r,a,s,l,u,c,d=this;return b(this,(function(h){switch(h.label){case 0:return o=(n=null!=e?e:{}).fileType,i=void 0===o?"png":o,r=n.quality,this.fileName="".concat(null!=t?t:"logic-flow.".concat(Date.now()),".").concat(i),[4,pS(a=this.getSvgRootElement(this.lf))];case 1:return h.sent(),"svg"===i?(s=this.cloneSvg(a),l=(new XMLSerializer).serializeToString(s),u=new Blob([l],{type:"image/svg+xml;charset=utf-8"}),c=URL.createObjectURL(u),this.triggerDownload(c)):this.getCanvasData(a,null!=e?e:{}).then((function(t){var e=t.toDataURL("image/".concat(i),r).replace("image/".concat(i),"image/octet-stream");d.triggerDownload(e)})),[2]}}))}))},t.prototype.getSnapshotBase64=function(t,e){return m(this,void 0,void 0,(function(){var n,o=this;return b(this,(function(i){switch(i.label){case 0:return[4,pS(n=this.getSvgRootElement(this.lf))];case 1:return i.sent(),[2,new Promise((function(i){o.getCanvasData(n,{backgroundColor:t}).then((function(t){var n=t.toDataURL("image/".concat(null!=e?e:"png"));i({data:n,width:t.width,height:t.height})}))}))]}}))}))},t.prototype.getSnapshotBlob=function(t,e){return m(this,void 0,void 0,(function(){var n,o=this;return b(this,(function(i){switch(i.label){case 0:return[4,pS(n=this.getSvgRootElement(this.lf))];case 1:return i.sent(),[2,new Promise((function(i){o.getCanvasData(n,{backgroundColor:t}).then((function(t){t.toBlob((function(e){i({data:e,width:t.width,height:t.height})}),"image/".concat(null!=e?e:"png"))}))}))]}}))}))},t.prototype.getClassRules=function(){var t="";if(this.useGlobalRules)for(var e=document.styleSheets,n=0;n<e.length;n++){var o=e[n];try{for(var i=0;i<o.cssRules.length;i++)t+=o.cssRules[i].cssText}catch(t){}}return this.customCssRules&&(t+=this.customCssRules),t},t.prototype.getCanvasData=function(t,e){return m(this,void 0,void 0,(function(){var n,o,i,r,a,s,l,u,c,d,h,p,f,g,v,y,m,x,_,E,w,S,C,N,T,A;return b(this,(function(b){return n=e.width,o=e.height,i=e.backgroundColor,r=e.padding,a=void 0===r?40:r,s=this.cloneSvg(t,!1),(l=window.devicePixelRatio||1)<1&&(l=1),u=this.lf.graphModel.rootEl.querySelector(".lf-base"),c=u.getBoundingClientRect(),d=this.lf.container.querySelector(".lf-canvas-overlay"),h=d.getBoundingClientRect(),p=c.x-h.x,f=c.y-h.y,g=this.lf.graphModel,v=g.transformModel,y=v.SCALE_X,m=v.SCALE_Y,x=v.TRANSLATE_X,_=v.TRANSLATE_Y,s.lastChild.style.transform="matrix(1, 0, 0, 1, ".concat((-p+x)*(1/y),", ").concat((-f+_)*(1/m),")"),E=Math.ceil(c.width/y),w=Math.ceil(c.height/m),(S=document.createElement("canvas")).style.width="".concat(E,"px"),S.style.height="".concat(w,"px"),S.width=E*l+2*a,S.height=w*l+2*a,(C=S.getContext("2d"))&&(C.clearRect(0,0,S.width,S.height),C.scale(l,l),i?(C.fillStyle=i,C.fillRect(0,0,S.width,S.height)):C.clearRect(0,0,S.width,S.height)),N=new Image,(T=document.createElement("style")).innerHTML=this.getClassRules(),(A=document.createElement("foreignObject")).appendChild(T),s.appendChild(A),[2,new Promise((function(t){N.onload=function(){var e=navigator.userAgent.indexOf("Firefox")>-1;try{e?createImageBitmap(N,{resizeWidth:n&&o?fS(S,n,o).width:S.width,resizeHeight:n&&o?fS(S,n,o).height:S.height}).then((function(e){null==C||C.drawImage(e,a/l,a/l),t(n&&o?fS(S,n,o):S)})):(null==C||C.drawImage(N,a/l,a/l),t(n&&o?fS(S,n,o):S))}catch(e){null==C||C.drawImage(N,a/l,a/l),t(n&&o?fS(S,n,o):S)}};var e="data:image/svg+xml;charset=utf-8,".concat((new XMLSerializer).serializeToString(s)).replace(/\n/g,"").replace(/\t/g,"").replace(/#/g,"%23");N.src=e}))]}))}))},t.prototype.cloneSvg=function(t,e){var n,o=this;void 0===e&&(e=!0);var i=t.cloneNode(!0),r=i.lastChild,a=null===(n=null==r?void 0:r.childNodes)||void 0===n?void 0:n.length;if(a)for(var s=0;s<a;s++){var l=null==r?void 0:r.childNodes[s],u=l.classList&&Array.from(l.classList);if(u&&u.indexOf("lf-base")<0)null==r||r.removeChild(r.childNodes[s]),a--,s--;else{var c=null==r?void 0:r.childNodes[s];c&&c.childNodes.forEach((function(t){var e=t;o.removeAnchor(e.firstChild),o.removeRotateControl(e.firstChild)}))}}if(e){var d=document.createElement("style");d.innerHTML=this.getClassRules();var h=document.createElement("foreignObject");h.appendChild(d),i.appendChild(h)}return i},t.pluginName="snapshot",t}(),vS=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.paths=[],e.getPathes=function(){if(!n.startNodeType)throw new Error("需要预先指定开始节点类型");return n.getPathes()},e.setRawPaths=function(t){n.setPathes(t)},e.getRawPathes=function(){return n.paths},e.setStartNodeType=function(t){n.startNodeType=t}}return t.prototype.setPathes=function(t){this.paths=t.map((function(t){return{routeId:t.routeId,name:t.name,elements:t.elements,type:t.type,similarElement:null,weight:0}}))},t.prototype.getPathes=function(){var t=this,e=this.lf.getGraphRawData(),n=new Map,o=[];e.nodes.forEach((function(e){n.set(e.id,{id:e.id,data:e,nextNodes:[]}),e.type===t.startNodeType&&o.push(e.id)})),e.edges.forEach((function(t){var e=n.get(t.sourceNodeId);null==e||e.nextNodes.push(t.targetNodeId)}));var i=[];return o.forEach((function(e){var o=n.get(e);o&&(i=i.concat(t.findPathElements(o,n,[])))})),this.getNewPathes(i)},t.prototype.findPathElements=function(t,e,n){void 0===n&&(n=[]);var o=E([],_(n),!1);if(o.push(t.id),0===t.nextNodes.length)return[o];for(var i=[],r=0;r<t.nextNodes.length;r++){var a=e.get(t.nextNodes[r]),s=void 0;if(a){var l=o.indexOf(a.id);s=-1!==l?[E(E([],_(o.slice(l)),!1),[a.id],!1)]:this.findPathElements(a,e,E([],_(o),!1)),i=i.concat(s)}}return i},t.prototype.getNewPathes=function(t){var e=this,n=[],o=new Set;t.forEach((function(t){var i=e.getNewId("path"),r=e.getNewId("路径"),a=e.isLoopPath(t),s=t.join(",");o.has(s)||(o.add(s),n.push({routeId:i,name:r,elements:t,type:a,weight:0,similarElement:""}))}));var i=JSON.parse(JSON.stringify(this.paths));return n.forEach((function(t){for(var n=0;n<i.length;n++){var o=i[n],r=e.similar2Path(E([],_(t.elements),!1),E([],_(o.elements),!1));r>t.weight&&o.weight<=r&&(t.weight=r,t.similarElement=o,r===o.weight&&o.similarElement?(o.similarElement.similarElement=null,o.similarElement.weight=0,o.similarElement=null,o.weight=0):(o.similarElement=t,o.weight=r))}})),n.forEach((function(t){t.similarElement&&t.similarElement.similarElement===t&&(t.routeId=t.similarElement.routeId,t.name=t.similarElement.name),delete t.similarElement,delete t.weight})),this.setPathes(n),n},t.prototype.similar2Path=function(t,e){var n=0,o=t.length+e.length;t.sort(),e.sort();for(var i=t.shift(),r=e.shift();void 0!==i&&void 0!==r;)i===r?(n++,i=t.shift(),r=e.shift()):i<r?i=t.shift():i>r&&(r=e.shift());return n/o*200},t.prototype.getNewId=function(t){return"".concat(t,"_").concat(C())},t.prototype.isLoopPath=function(t){var e=t.length;return t.indexOf(t[e-1])!==e-1?1:0},t.pluginName="flowPath",t}(),yS=-1,mS=0,bS=1,xS=function(){function t(t){var e=t.lf,n=this;this.levelHeight=[],this.newNodeMap=new Map,this.lf=e,this.trunk=[],e.layout=function(t){var e=n.lf.getGraphRawData();n.lf.setStartNodeType(t);var o=n.lf.getPathes();return n.levelHeight=[],n.newNodeMap=new Map,n.layout(e,o)}}return t.prototype.layout=function(t,e){var n=this,o=[];e.forEach((function(t){var e=t.elements;e.length>o.length?o=e:e.length===o.length&&JSON.stringify(e)===JSON.stringify(n.trunk)&&(o=n.trunk)})),this.trunk=o;for(var i=this.formatData(t),r={nodes:[],edges:[]},a=o.length-1;a>=0;a--)this.setNodePosition(o[a],i,r,a,1);this.lf.graphModel.graphDataToModel(r)},t.prototype.setNodePosition=function(t,e,n,o,i){var r=this,a=e[t],s=a.text,l=a.type,u=a.next,c=a.properties,d=160*o+40,h=120*i,p={id:t,x:d,text:s,y:h,type:l,properties:c};return s&&"object"==typeof s&&(p.text=g(g({},s),{x:d+s.x,y:h+s.y})),this.newNodeMap.set(p.id,{x:p.x,y:p.y,type:l}),n.nodes.push(p),a.isFixed=!0,this.addLevelHeight(o,1),u&&u.length>0&&u.forEach((function(i){if(!e[i.nodeId].isFixed){var a=r.getLevelHeight(o+1);r.addLevelHeight(o,1),r.setNodePosition(i.nodeId,e,n,o+1,a+1)}n.edges.push(g({id:i.edgeId,type:i.edgeType,sourceNodeId:t,targetNodeId:i.nodeId,properties:i.properties,text:i.text},r.getEdgeDataPoints(t,i.nodeId)))})),p},t.prototype.getEdgeDataPoints=function(t,e){var n=this.newNodeMap.get(t),o=this.newNodeMap.get(e),i=this.getShape(t),r=i.width,a=i.height,s=this.getShape(e),l=s.width,u=s.height,c=this.getRelativePosition(n,o),d={x:n.x,y:n.y},h={x:o.x,y:o.y};switch(c){case mS:d.x=n.x+r/2,h.x=o.x-l/2;break;case yS:d.y=n.y+a/2,h.x=o.x-l/2;break;case bS:d.x=n.x+r/2,h.y=o.y+u/2}return{startPoint:d,endPoint:h}},t.prototype.getRelativePosition=function(t,e){var n=t.y,o=e.y;return n<o?-1:n===o?0:1},t.prototype.getShape=function(t){var e,n,o=this.lf.getNodeModelById(t);return{height:null!==(e=null==o?void 0:o.height)&&void 0!==e?e:0,width:null!==(n=null==o?void 0:o.width)&&void 0!==n?n:0}},t.prototype.formatData=function(t){var e=t.nodes.reduce((function(t,e){var n=e.type,o=e.properties,i=e.text,r=e.x,a=e.y;return i&&"object"==typeof i&&(i.x=i.x-r,i.y=i.y-a),t[e.id]={type:n,properties:o,text:i,prev:[],next:[]},t}),{});return t.edges.forEach((function(t){var n=t.sourceNodeId,o=t.targetNodeId,i=t.id,r=t.properties,a=t.text,s=a;"object"==typeof a&&(s=a.value),e[n].next.push({edgeId:i,nodeId:o,edgeType:t.type,properties:r,text:s}),e[o].prev.push({edgeId:i,nodeId:n,properties:r,text:s})})),e},t.prototype.addLevelHeight=function(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);var o=this.levelHeight[t];o||(o={positiveHeight:0,negativeHeight:0},this.levelHeight[t]=o),n?o.negativeHeight-=e:o.positiveHeight+=e},t.prototype.getLevelHeight=function(t,e){void 0===e&&(e=!1);var n=this.levelHeight[t];return n?e?n.negativeHeight:n.positiveHeight:0},t.pluginName="AutoLayout",t}(),_S=function(){function t(t){var e=t.lf,n=this;this.controlItems=[{key:"zoom-out",iconClass:"lf-control-zoomOut",title:"缩小流程图",text:"缩小",onClick:function(){n.lf.zoom(!1)}},{key:"zoom-in",iconClass:"lf-control-zoomIn",title:"放大流程图",text:"放大",onClick:function(){n.lf.zoom(!0)}},{key:"reset",iconClass:"lf-control-fit",title:"恢复流程原有尺寸",text:"适应",onClick:function(){n.lf.resetZoom()}},{key:"undo",iconClass:"lf-control-undo",title:"回到上一步",text:"上一步",onClick:function(){n.lf.undo()}},{key:"redo",iconClass:"lf-control-redo",title:"移到下一步",text:"下一步",onClick:function(){n.lf.redo()}}],this.lf=e}return t.prototype.render=function(t,e){this.destroy();var n=this.getControlTool();this.toolEl=n,e.appendChild(n),this.domContainer=e},t.prototype.destroy=function(){this.domContainer&&this.toolEl&&this.domContainer.contains(this.toolEl)&&this.domContainer.removeChild(this.toolEl)},t.prototype.addItem=function(t){this.controlItems.push(t)},t.prototype.removeItem=function(t){var e=this.controlItems.findIndex((function(e){return e.key===t}));return-1==e?null:this.controlItems.splice(e,1)[0]},t.prototype.getControlTool=function(){var t=this,e="lf-control-item",n="lf-control-item disabled",o=document.createElement("div"),i=[];return o.className="lf-control",this.controlItems.forEach((function(o){var r=document.createElement("div"),a=document.createElement("i"),s=document.createElement("span");switch(r.className=n,o.onClick&&(r.onclick=o.onClick.bind(null,t.lf)),o.onMouseEnter&&(r.onmouseenter=o.onMouseEnter.bind(null,t.lf)),o.onMouseLeave&&(r.onmouseleave=o.onMouseLeave.bind(null,t.lf)),a.className=o.iconClass,s.className="lf-control-text",s.title=o.title,s.innerText=o.text,r.append(a,s),o.text){case"上一步":t.lf.on("history:change",(function(t){var o=t.data.undoAble;r.className=o?e:n}));break;case"下一步":t.lf.on("history:change",(function(t){var o=t.data.redoAble;r.className=o?e:n}));break;default:r.className=e}i.push(r)})),o.append.apply(o,E([],_(i),!1)),o},t.pluginName="control",t}(),ES="lf:defaultNodeMenu",wS="lf:defaultEdgeMenu",SS="lf:defaultGraphMenu",CS="lf:defaultSelectionMenu",NS=function(){function t(t){var e=t.lf,n=this;this.__currentData=null,this.lf=e,e.options.isSilentMode||(this.__menuDOM=document.createElement("ul"),this.menuTypeMap=new Map,this.init(),this.lf.setMenuConfig=function(t){n.setMenuConfig(t)},this.lf.addMenuConfig=function(t){n.addMenuConfig(t)},this.lf.setMenuByType=function(t){n.setMenuByType(t)})}return t.prototype.init=function(){var t,e,n,o,i=this,r=[{text:"删除",callback:function(t){i.lf.deleteNode(t.id)}},{text:"编辑文本",callback:function(t){i.lf.graphModel.editText(t.id)}},{text:"复制",callback:function(t){i.lf.cloneNode(t.id)}}];null===(t=this.menuTypeMap)||void 0===t||t.set(ES,r);var a=[{text:"删除",callback:function(t){i.lf.deleteEdge(t.id)}},{text:"编辑文本",callback:function(t){i.lf.graphModel.editText(t.id)}}];null===(e=this.menuTypeMap)||void 0===e||e.set(wS,a),null===(n=this.menuTypeMap)||void 0===n||n.set(SS,[]);var s=[{text:"删除",callback:function(t){i.lf.clearSelectElements(),t.edges.forEach((function(t){return i.lf.deleteEdge(t.id)})),t.nodes.forEach((function(t){return i.lf.deleteNode(t.id)}))}}];null===(o=this.menuTypeMap)||void 0===o||o.set(CS,s)},t.prototype.render=function(t,e){var n=this;t.options.isSilentMode||(this.__container=e,this.__currentData=null,this.__menuDOM&&(this.__menuDOM.className="lf-menu",e.appendChild(this.__menuDOM),this.__menuDOM.addEventListener("click",(function(t){t.stopPropagation();for(var e=t.target;-1===Array.from(e.classList).indexOf("lf-menu-item")&&-1===Array.from(e.classList).indexOf("lf-menu");)e=null==e?void 0:e.parentElement;Array.from(e.classList).indexOf("lf-menu-item")>-1&&(e.onclickCallback(n.__currentData),n.__menuDOM&&(n.__menuDOM.style.display="none"),n.__currentData=null)}),!0)),this.lf.on("node:contextmenu",(function(t){var e,o,i=t.data,r=t.position,a=t.e,s=r.domOverlayPosition,l=s.x,u=s.y,c=i.id,d=n.lf.graphModel.getNodeModelById(c);if(d){var h=[],p=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(d.type);h=d&&d.menu&&Array.isArray(d.menu)?d.menu:p||(null===(o=n.menuTypeMap)||void 0===o?void 0:o.get(ES)),n.__currentData=i,n.showMenu(l,u,h,{width:d.width,height:d.height,clientX:a.clientX,clientY:a.clientY})}})),this.lf.on("edge:contextmenu",(function(t){var e,o,i,r=t.data,a=t.position,s=t.e,l=a.domOverlayPosition,u=l.x,c=l.y,d=r.id,h=n.lf.graphModel.getEdgeModelById(d);if(h){var p=[],f=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(h.type);p=h&&h.menu&&Array.isArray(h.menu)?h.menu:f||(null!==(i=null===(o=n.menuTypeMap)||void 0===o?void 0:o.get(wS))&&void 0!==i?i:[]),n.__currentData=r,n.showMenu(u,c,p,{width:h.width,height:h.height,clientX:s.clientX,clientY:s.clientY})}})),this.lf.on("blank:contextmenu",(function(t){var e,o,i=t.position,r=null!==(o=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(SS))&&void 0!==o?o:[],a=i.domOverlayPosition,s=a.x,l=a.y;n.showMenu(s,l,r)})),this.lf.on("selection:contextmenu",(function(t){var e,o=t.data,i=t.position,r=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(CS),a=i.domOverlayPosition,s=a.x,l=a.y;n.__currentData=o,n.showMenu(s,l,r)})),this.lf.on("node:mousedown",(function(){n.__menuDOM.style.display="none"})),this.lf.on("edge:click",(function(){n.__menuDOM.style.display="none"})),this.lf.on("blank:click",(function(){n.__menuDOM.style.display="none"})))},t.prototype.destroy=function(){var t;this.__menuDOM&&(null===(t=null==this?void 0:this.__container)||void 0===t||t.removeChild(this.__menuDOM),this.__menuDOM=void 0)},t.prototype.showMenu=function(t,e,n,o){if(n&&n.length){var i=this.__menuDOM;if(i){if(i.innerHTML="",i.append.apply(i,E([],_(this.__getMenuDom(n)),!1)),!i.children.length)return;if(i.style.display="block",!o)return i.style.top="".concat(e,"px"),void(i.style.left="".concat(t,"px"));var r=o.width,a=o.height,s=o.clientX,l=o.clientY,u=this.lf.graphModel,c=i.offsetWidth,d=!0,h=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,p=h-s,f=u.rootEl.getBoundingClientRect(),g=f.left+f.width;g<h&&(p=g-s),p<c&&(d=!1),i.style.left="".concat(d?t:t-r,"px");var v=i.offsetHeight,y=!0,m=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,b=m-l,x=f.top+f.height;x<m&&(b=x-l),b<v&&(y=!1),i.style.top="".concat(y?e:e-a,"px")}}},t.prototype.setMenuByType=function(t){var e,n=t.type,o=t.menu;n&&o&&(null===(e=this.menuTypeMap)||void 0===e||e.set(n,o))},t.prototype.__getMenuDom=function(t){var e=[];return t&&t.length>0&&t.forEach((function(t){var n=document.createElement("li");if(t.className?n.className="lf-menu-item ".concat(t.className):n.className="lf-menu-item",!0===t.icon){var o=document.createElement("span");o.className="lf-menu-item-icon",n.appendChild(o)}var i=document.createElement("span");i.className="lf-menu-item-text",t.text&&(i.innerText=t.text),n.appendChild(i),n.onclickCallback=t.callback,e.push(n)})),e},t.prototype.setMenuConfig=function(t){var e,n,o;t&&(void 0!==t.nodeMenu&&(null===(e=this.menuTypeMap)||void 0===e||e.set(ES,t.nodeMenu?t.nodeMenu:[])),void 0!==t.edgeMenu&&(null===(n=this.menuTypeMap)||void 0===n||n.set(wS,t.edgeMenu?t.edgeMenu:[])),void 0!==t.graphMenu&&(null===(o=this.menuTypeMap)||void 0===o||o.set(SS,t.graphMenu?t.graphMenu:[])))},t.prototype.addMenuConfig=function(t){var e,n,o,i,r,a,s,l,u;if(t){if(Array.isArray(t.nodeMenu)){var c=null!==(n=null===(e=this.menuTypeMap)||void 0===e?void 0:e.get(ES))&&void 0!==n?n:[];null===(o=this.menuTypeMap)||void 0===o||o.set(ES,c.concat(t.nodeMenu))}if(Array.isArray(t.edgeMenu)){c=null!==(r=null===(i=this.menuTypeMap)||void 0===i?void 0:i.get(wS))&&void 0!==r?r:[];null===(a=this.menuTypeMap)||void 0===a||a.set(wS,c.concat(t.edgeMenu))}if(Array.isArray(t.graphMenu)){c=null!==(l=null===(s=this.menuTypeMap)||void 0===s?void 0:s.get(SS))&&void 0!==l?l:[];null===(u=this.menuTypeMap)||void 0===u||u.set(SS,c.concat(t.graphMenu))}}},t.prototype.changeMenuItem=function(t,e){if("add"===t)this.addMenuConfig(e);else{if("reset"!==t)throw new Error("The first parameter of changeMenuConfig should be 'add' or 'reset'");this.setMenuConfig(e)}},t.pluginName="menu",t}(),TS="menu-common",AS=function(){function t(t){var e=t.lf,n=this;this.menuTypeMap=new Map,this.listenDelete=function(){n.hideContextMenu()},this.lf=e,this.__menuDOM=document.createElement("div"),this.__menuDOM.className="lf-inner-context",this.menuTypeMap.set(TS,[]),this.lf.setContextMenuByType=function(t,e){n.setContextMenuByType(t,e)},this.lf.setContextMenuItems=function(t){n.setContextMenuItems(t)},this.lf.showContextMenu=function(t){n.showContextMenu(t)},this.lf.hideContextMenu=function(){n.hideContextMenu()}}return t.prototype.render=function(t,e){var n=this;this.container=e,t.on("node:click",(function(t){var e=t.data;n._activeData=e,n.createContextMenu()})),t.on("edge:click",(function(t){var e=t.data;n._activeData=e,n.createContextMenu()})),t.on("blank:click",(function(){n.hideContextMenu()}))},t.prototype.setContextMenuByType=function(t,e){this.menuTypeMap.set(t,e)},t.prototype.hideContextMenu=function(){this.__menuDOM.innerHTML="",this.__menuDOM.style.display="none",this.isShow&&this.container.removeChild(this.__menuDOM),this.lf.off("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!1},t.prototype.showContextMenu=function(t){t&&t.id&&(this._activeData=t,this.createContextMenu())},t.prototype.setContextMenuItems=function(t){this.menuTypeMap.set(TS,t)},t.prototype.getContextMenuPosition=function(){var t=this._activeData,e=this.lf.graphModel.getElement(t.id);if(e){var n,o;if("edge"===e.BaseType){n=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER;var i=e.getData();n=Math.max(i.startPoint.x,n),o=Math.min(i.startPoint.y,o),n=Math.max(i.endPoint.x,n),o=Math.min(i.endPoint.y,o),i.pointsList&&i.pointsList.forEach((function(t){n=Math.max(t.x,n),o=Math.min(t.y,o)}))}return"node"===e.BaseType&&(n=t.x+e.width/2,o=t.y-e.height/2),this.lf.graphModel.transformModel.CanvasPointToHtmlPoint([n,o])}},t.prototype.createContextMenu=function(){var t=this;if(!this.lf.options.isSilentMode){var e=E(E([],_(this.menuTypeMap.get(this._activeData.type)||[]),!1),_(this.menuTypeMap.get(TS)||[]),!1),n=document.createDocumentFragment();e.forEach((function(e){var o=document.createElement("div");o.className="lf-context-item";var i=document.createElement("img");i.src=e.icon,i.className="lf-context-img",e.className&&(o.className="".concat(o.className," ").concat(e.className)),i.addEventListener("click",(function(){t.hideContextMenu(),e.callback?e.callback(t._activeData):t.addNode({sourceId:t._activeData.id,x:t._activeData.x,y:t._activeData.y,properties:e.properties,type:e.type})})),o.appendChild(i),n.appendChild(o)})),this.__menuDOM.innerHTML="",this.__menuDOM.appendChild(n),this.showMenu()}},t.prototype.addNode=function(t,e){var n=void 0!==e;void 0===e&&(e=t.y);var o=this.lf.getNodeModelById(t.sourceId);if(o){var i=t.x-o.width+200,r=e-t.y/2-20,a=t.x+o.width+200,s=e+t.y/2+20;if(this.lf.getAreaElement([i,r],[a,s]).length)return e+=100,void this.addNode(t,e);if(t.type){var l=this.lf.addNode({type:t.type,x:t.x+200,y:e,properties:t.properties}),u=void 0,c=void 0;n&&(u={x:t.x,y:t.y+o.height/2},c={x:l.x-l.width/2,y:l.y}),this.lf.addEdge({sourceNodeId:t.sourceId,targetNodeId:l.id,startPoint:u,endPoint:c})}}},t.prototype.showMenu=function(){var t=this.getContextMenuPosition();if(t){var e=_(t,2),n=e[0],o=e[1];this.__menuDOM.style.display="flex",this.__menuDOM.style.top="".concat(o,"px"),this.__menuDOM.style.left="".concat(n+10,"px"),this.container.appendChild(this.__menuDOM),!this.isShow&&this.lf.on("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!0}},t.pluginName="contextMenu",t}(),MS=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.lf.setPatternItems=function(t){n.setPatternItems(t)}}return t.prototype.render=function(t,e){var n=this;this.destroy(),this.shapeList&&0!==this.shapeList.length?(this.panelEl=document.createElement("div"),this.panelEl.className="lf-dndpanel",this.shapeList.forEach((function(t){var e;null===(e=n.panelEl)||void 0===e||e.appendChild(n.createDndItem(t))})),e.appendChild(this.panelEl),this.domContainer=e):this.domContainer=e},t.prototype.destroy=function(){this.domContainer&&this.panelEl&&this.domContainer.contains(this.panelEl)&&this.domContainer.removeChild(this.panelEl)},t.prototype.setPatternItems=function(t){this.shapeList=t,this.domContainer&&this.render(this.lf,this.domContainer)},t.prototype.createDndItem=function(t){var e=this,n=document.createElement("div");n.className=t.className?"lf-dnd-item ".concat(t.className):"lf-dnd-item";var o=document.createElement("div");if(o.className="lf-dnd-shape",t.icon&&(o.style.backgroundImage="url(".concat(t.icon,")")),n.appendChild(o),t.label){var i=document.createElement("div");i.innerText=t.label,i.className="lf-dnd-text",n.appendChild(i)}return t.disabled?(n.classList.add("disabled"),n.onmousedown=function(){t.callback&&t.callback(e.lf,e.domContainer)},n):(n.onmousedown=function(){t.type&&e.lf.dnd.startDrag({type:t.type,properties:t.properties,text:t.text}),t.callback&&t.callback(e.lf,e.domContainer)},n.ondblclick=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-dbclick",{e:n,data:t})},n.onclick=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-click",{e:n,data:t})},n.oncontextmenu=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-contextmenu",{e:n,data:t})},n)},t.pluginName="dndPanel",t}(),OS=function(){function t(t){var e=t.lf,n=t.LogicFlow,o=t.options,i=this;this.width=200,this.height=150,this.scale=1,this.translateX=0,this.translateY=0,this.showEdge=!1,this.viewPortTop=0,this.viewPortLeft=0,this.viewPortWidth=150,this.viewPortHeight=75,this.isShow=!1,this.isShowHeader=!1,this.isShowCloseIcon=!1,this.headerTitle="导航",this.disabledPlugins=["miniMap","control","selectionSelect"],this.render=function(t,e){i.container=e,i.lf.on("history:change",(function(){i.isShow&&i.setView()})),i.lf.on("graph:transform",(function(){i.isShow&&i.setView(!1)}))},this.show=function(t,e){i.isShow||(i.createMiniMap(t,e),i.setView()),i.isShow=!0},this.hide=function(){i.isShow&&(i.removeMiniMap(),i.lf.emit("miniMap:close",{})),i.isShow=!1},this.updatePosition=function(t){if("object"==typeof t)void 0===t.left&&void 0===t.right||(i.leftPosition=t.left,i.rightPosition=t.right),void 0===t.top&&void 0===t.bottom||(i.topPosition=t.top,i.bottomPosition=t.bottom);else switch(t){case"left-top":i.leftPosition=0,i.rightPosition=void 0,i.topPosition=0,i.bottomPosition=void 0;break;case"right-top":i.leftPosition=void 0,i.rightPosition=0,i.topPosition=0,i.bottomPosition=void 0;break;case"left-bottom":i.leftPosition=0,i.rightPosition=void 0,i.topPosition=void 0,i.bottomPosition=0;break;case"right-bottom":i.leftPosition=void 0,i.rightPosition=0,i.topPosition=void 0,i.bottomPosition=0}i.updateMiniMapPosition()},this.reset=function(){i.lf.resetTranslate(),i.lf.resetZoom()},this.setShowEdge=function(t){i.showEdge!==t&&(i.showEdge=t,i.setView())},this.startDrag=function(t){document.addEventListener("mousemove",i.drag),document.addEventListener("mouseup",i.drop);var e=t.x,n=t.y;i.startPosition={x:e,y:n}},this.drag=function(t){var e=t.x,n=t.y,o=(e-i.startPosition.x)/i.scale,r=(n-i.startPosition.y)/i.scale,a=i.viewPortLeft+o+i.viewPortWidth/i.scale/2,s=i.viewPortTop+r+i.viewPortHeight/i.scale/2;i.startPosition={x:e,y:n},i.lf.focusOn({coordinate:{x:a,y:s}})},this.drop=function(){document.removeEventListener("mousemove",i.drag),document.removeEventListener("mouseup",i.drop)},this.mapClick=function(t){var e=t.offsetX,n=t.offsetY,o=i.translateX+e/i.scale,r=i.translateY+n/i.scale;i.lf.focusOn({coordinate:{x:o,y:r}})},this.lf=e,this.LFCtor=n,o&&this.setOption(o),this.viewPortWidth=e.graphModel.width,this.viewPortHeight=e.graphModel.height;var r={left:0,right:this.viewPortWidth,top:0,bottom:this.viewPortHeight};this.bounds=r,this.elementAreaBounds=r,this.viewPortBounds=r,this.initMiniMap()}return t.prototype.setOption=function(t){var e=t.width,n=void 0===e?150:e,o=t.height,i=void 0===o?220:o,r=t.showEdge,a=void 0!==r&&r,s=t.isShowHeader,l=void 0!==s&&s,u=t.isShowCloseIcon,c=void 0!==u&&u,d=t.leftPosition,h=t.topPosition,p=t.rightPosition,f=void 0===p?0:p,g=t.bottomPosition,v=void 0===g?0:g,y=t.headerTitle,m=void 0===y?"导航":y;this.width=n,this.height=i,this.showEdge=a,this.isShowHeader=l,this.isShowCloseIcon=c,this.leftPosition=d,this.rightPosition=void 0!==d?void 0:f,this.topPosition=h,this.bottomPosition=void 0!==h?void 0:v,this.headerTitle=m},t.prototype.initMiniMap=function(){var t=document.createElement("div");t.className="lf-mini-map-graph",t.style.width="".concat(this.width,"px"),t.style.height="".concat(this.height,"px"),this.lfMap=new this.LFCtor({container:t,grid:!1,isSilentMode:!0,stopZoomGraph:!0,stopScrollGraph:!0,stopMoveGraph:!1,history:!1,snapline:!1,disabledPlugins:this.disabledPlugins}),this.miniMapWrap=t,this.createViewPort(),t.addEventListener("click",this.mapClick)},t.prototype.createMiniMap=function(t,e){var n,o=document.createElement("div");this.miniMapContainer=o,o.appendChild(this.miniMapWrap),o.style.position="absolute",void 0===t&&void 0===e||(this.leftPosition=t||0,this.topPosition=e||0,this.rightPosition=void 0,this.bottomPosition=void 0),this.updateMiniMapPosition(),o.className="lf-mini-map",this.isShowCloseIcon||o.classList.add("lf-mini-map-no-close-icon"),this.isShowHeader||o.classList.add("lf-mini-map-no-header"),null===(n=this.container)||void 0===n||n.appendChild(o),this.miniMapWrap.appendChild(this.viewport);var i=document.createElement("div");i.className="lf-mini-map-header",i.innerText=this.headerTitle,o.appendChild(i);var r=document.createElement("span");r.className="lf-mini-map-close",r.addEventListener("click",this.hide),o.appendChild(r)},t.prototype.updateMiniMapPosition=function(){if(this.miniMapContainer){var t=this.miniMapContainer.style;void 0!==this.rightPosition?(t.right="".concat(this.rightPosition,"px"),t.left=""):(t.left="".concat(this.leftPosition,"px"),t.right=""),void 0!==this.bottomPosition?(t.bottom="".concat(this.bottomPosition,"px"),t.top=""):(t.top="".concat(this.topPosition,"px"),t.bottom="")}},t.prototype.removeMiniMap=function(){var t;this.miniMapContainer&&(null===(t=this.container)||void 0===t||t.removeChild(this.miniMapContainer))},t.prototype.updateBounds=function(t){t&&this.updateElementAreaBounds(t),this.updateViewPortBounds(),this.bounds={left:Math.min(this.elementAreaBounds.left,this.viewPortBounds.left),right:Math.max(this.elementAreaBounds.right,this.viewPortBounds.right),top:Math.min(this.elementAreaBounds.top,this.viewPortBounds.top),bottom:Math.max(this.elementAreaBounds.bottom,this.viewPortBounds.bottom)}},t.prototype.updateElementAreaBounds=function(t){var e={left:0,right:0,top:0,bottom:0},n=t.nodes;n&&n.length>0&&n.forEach((function(t){var n,o,i=t.x,r=t.y,a=null!==(n=t.width)&&void 0!==n?n:200,s=null!==(o=t.height)&&void 0!==o?o:200,l=i-a/2,u=i+a/2,c=r-s/2,d=r+s/2;e.left=Math.min(l,e.left),e.right=Math.max(u,e.right),e.top=Math.min(c,e.top),e.bottom=Math.max(d,e.bottom)})),this.elementAreaBounds=e},t.prototype.updateViewPortBounds=function(){var t=this.lf.getTransform(),e=t.TRANSLATE_X,n=t.TRANSLATE_Y,o=t.SCALE_X,i=t.SCALE_Y,r=this.lf.graphModel,a=r.width,s=r.height;this.viewPortBounds={left:-e/o,right:(-e+a)/o,top:-n/i,bottom:(-n+s)/i}},t.prototype.resetData=function(t){var e=t.nodes,n=t.edges;return e.forEach((function(t){t.text=void 0})),this.showEdge&&n.forEach((function(t){t.text=void 0})),{nodes:e,edges:this.showEdge?n:[]}},t.prototype.setView=function(t){var e,n;if(void 0===t&&(t=!0),t){var o=this.lf.getGraphRawData(),i=this.resetData(o),r=this.lf.viewMap,a=this.lf.graphModel.modelMap,s=this.lfMap.viewMap;try{for(var l=x(r.keys()),u=l.next();!u.done;u=l.next()){var c=u.value;s.has(c)||this.lfMap.register({type:c,view:r.get(c),model:a.get(c)})}}catch(t){e={error:t}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}this.lfMap.render(i),this.updateBounds(i)}else this.updateBounds();var d=this.bounds,h=d.left,p=d.top,f=d.right-h,g=d.bottom-p,v=this.width/f,y=this.height/g,m=Math.min(v,y);this.scale=m;var b=h-(this.width/m-f)/2,_=p-(this.height/m-g)/2;if(this.lfMap.graphModel.transformModel.translate(-b+this.translateX,-_+this.translateY),this.translateX=b,this.translateY=_,this.miniMapWrap.firstChild){var E=this.miniMapWrap.firstChild.style;E.pointerEvents="none",E.transform="matrix(".concat(m,", 0, 0, ").concat(m,", 0, 0)"),E.transformOrigin="left top",E.height="".concat(this.height/m,"px"),E.width="".concat(this.width/m,"px"),this.updateViewPort()}},t.prototype.updateViewPort=function(){var t=this.viewport.style,e=this.lf.getTransform(),n=e.TRANSLATE_X,o=e.TRANSLATE_Y,i=e.SCALE_X,r=e.SCALE_Y,a=this.lf.graphModel,s=a.width,l=a.height;this.viewPortLeft=-n/i,this.viewPortTop=-o/r,this.viewPortWidth=s/i*this.scale,this.viewPortHeight=l/r*this.scale,t.width="".concat(this.viewPortWidth,"px"),t.height="".concat(this.viewPortHeight,"px"),t.left="".concat((this.viewPortLeft-this.translateX)*this.scale,"px"),t.top="".concat((this.viewPortTop-this.translateY)*this.scale,"px")},t.prototype.createViewPort=function(){var t=document.createElement("div");t.className="lf-minimap-viewport",t.addEventListener("mousedown",this.startDrag),t.addEventListener("click",(function(t){t.stopPropagation()})),this.viewport=t},t.pluginName="miniMap",t}(),PS=function(){function t(t){var e=t.lf,n=this;this.disabled=!0,this.isDefaultStopMoveGraph=!1,this.isWholeNode=!0,this.isWholeEdge=!0,this.draw=function(t){var e=n.lf.getPointByClient(t.clientX,t.clientY).domOverlayPosition,o=e.x,i=e.y;if(n.endPoint={x:o,y:i},n.startPoint){var r=n.startPoint,a=r.x,s=r.y,l=a,u=s,c=o-a,d=i-s;o<a&&(l=o,c=a-o),i<s&&(u=i,d=s-i),n.wrapper&&(n.wrapper.style.left="".concat(l,"px"),n.wrapper.style.top="".concat(u,"px"),n.wrapper.style.width="".concat(c,"px"),n.wrapper.style.height="".concat(d,"px"))}},this.drawOff=function(){var t;if(document.removeEventListener("mousemove",n.draw),document.removeEventListener("mouseup",n.drawOff),n.wrapper&&(n.wrapper.oncontextmenu=null,null===(t=n.container)||void 0===t||t.removeChild(n.wrapper)),n.startPoint&&n.endPoint){var e=n.startPoint,o=e.x,i=e.y,r=n.endPoint,a=r.x,s=r.y,l=[Math.min(o,a),Math.min(i,s)],u=[Math.max(o,a),Math.max(i,s)];if(n.lf.emit("selection:selected-area",{topLeft:l,bottomRight:u}),Math.abs(a-o)<10&&Math.abs(s-i)<10)return;var c=n.lf.graphModel.getAreaElement(l,u,n.isWholeEdge,n.isWholeNode,!0),d=n.lf.graphModel,h=d.dynamicGroup,p=d.group;c.forEach((function(t){p&&p.getNodeGroup(t.id)||n.lf.selectElementById(t.id,!0),h&&h.getGroupByNodeId(t.id)||n.lf.selectElementById(t.id,!0)})),n.lf.emit("selection:selected",{elements:c,leftTopPoint:l,rightBottomPoint:u})}},this.lf=e;var o=e.getEditConfig().stopMoveGraph;this.isDefaultStopMoveGraph=o,e.openSelectionSelect=function(){n.openSelectionSelect()},e.closeSelectionSelect=function(){n.closeSelectionSelect()}}return t.prototype.render=function(t,e){var n=this;this.container=e,t.on("blank:mousedown",(function(o){var i=o.e;if(t.getEditConfig().stopMoveGraph&&!n.disabled&&!(2===i.button)){var r=t.getPointByClient(i.clientX,i.clientY).domOverlayPosition,a=r.x,s=r.y;n.startPoint={x:a,y:s},n.endPoint={x:a,y:s};var l=document.createElement("div");l.className="lf-selection-select",l.oncontextmenu=function(t){t.preventDefault()},l.style.top="".concat(n.startPoint.y,"px"),l.style.left="".concat(n.startPoint.x,"px"),e.appendChild(l),n.wrapper=l,document.addEventListener("mousemove",n.draw),document.addEventListener("mouseup",n.drawOff)}}))},t.prototype.setSelectionSense=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0),this.isWholeEdge=t,this.isWholeNode=e},t.prototype.openSelectionSelect=function(){this.lf.getEditConfig().stopMoveGraph||(this.isDefaultStopMoveGraph=!1,this.lf.updateEditConfig({stopMoveGraph:!0})),this.open()},t.prototype.closeSelectionSelect=function(){this.isDefaultStopMoveGraph||this.lf.updateEditConfig({stopMoveGraph:!1}),this.close()},t.prototype.open=function(){this.disabled=!1},t.prototype.close=function(){this.disabled=!0},t.pluginName="selectionSelect",t}(),kS=function(t,e){var n=[],o=[],i=function(t,o,r){t&&(r&&o.unshift.apply(o,E([],_(e.getEdgeModels({sourceNodeId:t.id,targetNodeId:null==r?void 0:r.id}).map((function(t){return t.id}))),!1)),o.includes(t.id)?n.push(o):(o.unshift(t.id),t.incoming.nodes.length?t.incoming.nodes.forEach((function(e){i(e,o.slice(),t)})):n.push(o)))},r=function(t,n,i){t&&(i&&n.push.apply(n,E([],_(e.getEdgeModels({sourceNodeId:null==i?void 0:i.id,targetNodeId:t.id}).map((function(t){return t.id}))),!1)),n.includes(t.id)?o.push(n):(n.push(t.id),t.outgoing.nodes.length?t.outgoing.nodes.forEach((function(e){r(e,n.slice(),t)})):o.push(n)))};return i(t,[]),r(t,[]),E([],_(new Set(E(E([],_(n.flat()),!1),_(o.flat()),!1))),!1)},RS=function(){function t(t){var e=t.lf,n=t.options;this.mode="path",this.enable=!0,this.tempStyles={};var o=n.mode,i=void 0===o?"path":o,r=n.enable,a=void 0===r||r;this.lf=e,this.mode=i,this.enable=a}return t.prototype.setMode=function(t){this.mode=t},t.prototype.setEnable=function(t){this.enable=t},t.prototype.highlightSingle=function(t){var e=this.lf.getModelById(t);"node"===(null==e?void 0:e.BaseType)?e.updateStyles(this.tempStyles[t]):"edge"===(null==e?void 0:e.BaseType)&&(e.updateStyles(this.tempStyles[t]),e.sourceNode.updateStyles(this.tempStyles[e.sourceNode.id]),e.targetNode.updateStyles(this.tempStyles[e.targetNode.id]))},t.prototype.highlightNeighbours=function(t){var e=this,n=this.lf.getModelById(t);if("node"===(null==n?void 0:n.BaseType)){n.updateStyles(this.tempStyles[t]);var o=n.incoming,i=o.nodes,r=o.edges,a=n.outgoing,s=a.nodes,l=a.edges;js(i,s).forEach((function(t){t.updateStyles(e.tempStyles[t.id])})),js(r,l).forEach((function(t){t.updateStyles(e.tempStyles[t.id])}))}else"edge"===(null==n?void 0:n.BaseType)&&(n.updateStyles(this.tempStyles[t]),n.sourceNode.updateStyles(this.tempStyles[n.sourceNode.id]),n.targetNode.updateStyles(this.tempStyles[n.targetNode.id]))},t.prototype.highlightPath=function(t){var e=this,n=function(t,e){var n=e.getModelById(t);return kS("node"===(null==n?void 0:n.BaseType)?n:null==n?void 0:n.targetNode,e)}(t,this.lf);n.forEach((function(t){var n;null===(n=e.lf.getModelById(t))||void 0===n||n.updateStyles(e.tempStyles[t])}))},t.prototype.highlight=function(t,e){var n=this;(void 0===e&&(e=this.mode),this.enable)&&(Object.keys(this.tempStyles).length&&this.restoreHighlight(),Object.values(this.lf.graphModel.modelsMap).forEach((function(t){var e="node"===t.BaseType?t.getNodeStyle():t.getEdgeStyle();n.tempStyles[t.id]=g({},e),t.setStyles({opacity:.1})})),{single:this.highlightSingle.bind(this),neighbour:this.highlightNeighbours.bind(this),path:this.highlightPath.bind(this)}[e](t))},t.prototype.restoreHighlight=function(){var t=this;Object.keys(this.tempStyles).length&&(Object.values(this.lf.graphModel.modelsMap).forEach((function(e){var n,o=null!==(n=t.tempStyles[e.id])&&void 0!==n?n:{};e.updateStyles(g({},o))})),this.tempStyles={})},t.prototype.render=function(){var t=this;this.lf.on("node:mouseenter",(function(e){var n=e.data;return t.highlight(n.id)})),this.lf.on("edge:mouseenter",(function(e){var n=e.data;return t.highlight(n.id)})),this.lf.on("node:mouseleave",this.restoreHighlight.bind(this)),this.lf.on("edge:mouseleave",this.restoreHighlight.bind(this)),this.lf.on("history:change",this.restoreHighlight.bind(this))},t.prototype.destroy=function(){},t.pluginName="highlight",t}(),DS={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function LS(t,e,n,o){var i,r="",a="";t[0]===e[0]?r=t[1]>e[1]?"t":"b":t[1]===e[1]&&(r=t[0]>e[0]?"l":"r"),e[0]===n[0]?a=e[1]>n[1]?"t":"b":e[1]===n[1]&&(a=e[0]>n[0]?"l":"r");var s=Math.min(Math.hypot(e[0]-t[0],e[1]-t[1])/2,Math.hypot(n[0]-e[0],n[1]-e[1])/2,o)||.2*o,l="".concat(r).concat(a),u=DS[l]||"-",c="L ".concat(t[0]," ").concat(t[1]);if("-"===u)c+="L ".concat(e[0]," ").concat(e[1]," L ").concat(n[0]," ").concat(n[1]);else{var d=_(function(t,e,n,o){var i=[t[0],t[1]],r=[t[0],t[1]];switch(n){case"tl":return"tr"===e?(i[1]+=o,r[0]+=o):"lb"===e&&(i[0]+=o,r[1]+=o),[i,r];case"tr":return"tl"===e?(i[1]+=o,r[0]-=o):"rb"===e&&(i[0]-=o,r[1]+=o),[i,r];case"bl":return"br"===e?(i[1]-=o,r[0]+=o):"lt"===e&&(i[0]+=o,r[1]-=o),[i,r];case"br":return"bl"===e?(i[1]-=o,r[0]-=o):"rt"===e&&(i[0]-=o,r[1]-=o),[i,r];default:return[]}}(e,l,u,s),2),h=d[0],p=d[1];h&&p&&(c+="L ".concat(h[0]," ").concat(h[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(p[0]," ").concat(p[1]),i=_(p,2),e[0]=i[0],e[1]=i[1])}return c}function IS(t,e){var n=0,o="";if(2===t.length)o+="M".concat(t[n][0]," ").concat(t[n++][1]," L ").concat(t[n][0]," ").concat(t[n][1]);else{for(o+="M".concat(t[n][0]," ").concat(t[n++][1]);n+1<t.length;){o+=LS(t[n-1],t[n],t[1+n++],e)}o+="L ".concat(t[n][0]," ").concat(t[n][1])}return o}var jS=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getEdge=function(){var t=this.props.model,n=t.points,o=t.isAnimation,i=t.arrowConfig,r=t.radius,a=void 0===r?5:r,s=t.getEdgeStyle(),l=t.getEdgeAnimationStyle(),u=function(t){for(var e=t,n=1;n<e.length-1;){var o=_(e[n-1],2),i=o[0],r=o[1],a=_(e[n],2),s=a[0],l=a[1],u=_(e[n+1],2),c=u[0],d=u[1];i===s&&s===c||r===l&&l===d?e.splice(n,1):n++}return e}(n.split(" ").map((function(t){return t.split(",").map((function(t){return+t}))}))),c=IS(u,a),d=g(g(g({style:o?l:{}},s),i),{fill:"none"});return e.h("path",g({d:c},d))},n}(e.PolylineEdge),BS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e}(e.PolylineEdgeModel),HS=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getLabelShape=function(){var t=this.props.model,n=t.id,o=t.x,i=t.y,r=t.width,a=t.height,s=t.properties,l=this.props.model.getNodeStyle();return e.h("svg",{x:o-r/2,y:i-a/2,width:50,height:24,style:"z-index: 0; background: none; overflow: auto;"},[s.labelText?e.h("text",{x:0,y:-5,fontSize:"16px",fill:l.stroke},s.labelText):"",s.disabledDelete?"":e.h("text",{x:s.labelText?50:0,y:-5,fontSize:"24px",cursor:"pointer",fill:l.stroke,onclick:this.handleCustomDeleteIconClick.bind(this,n)},"x")])},n.prototype.getShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.id,s=this.props.model.getNodeStyle();return e.h("g",{},[e.h("rect",g(g({},s),{x:n-i/2,y:o-r/2,width:i,height:r,id:a})),this.getLabelShape()])},n.prototype.toFront=function(){},n.prototype.handleCustomDeleteIconClick=function(t){this.props.graphModel.deleteNode(t)},n}(e.PolygonNode),FS=function(t){function e(){var e=t.apply(this,E([],_(arguments),!1))||this;return e.d=10,e}return f(e,t),e.prototype.initNodeData=function(e){e.text={value:"",x:e.x,y:e.y,draggable:!1,editable:!1},t.prototype.initNodeData.call(this,e),this.zIndex=0,this.draggable=!0},e.prototype.setAttributes=function(){var t,e=this;this.points=[],(null===(t=this.properties)||void 0===t?void 0:t.node_selection_ids).length>1&&setTimeout((function(){var t;e.updatePointsByNodes((null===(t=e.properties)||void 0===t?void 0:t.node_selection_ids)||[])}))},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return e.stroke=this.properties.strokeColor||"#008000",e.strokeDasharray="10 5",e},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.updatePoints=function(t){this.points=t},e.prototype.updateCoordinate=function(t){var e=t.x,n=t.y;this.x=e,this.y=n},e.prototype.updatePointsByNodes=function(t){var e=this,n=[],o=1/0,i=1/0,r=-1/0,a=-1/0;t.forEach((function(t){var n=e.graphModel.getNodeModelById(t);if(n){var s=n.width,l=n.height,u=n.x,c=n.y;o=Math.min(o,u-s/2-e.d),i=Math.min(i,c-l/2-e.d),r=Math.max(r,u+s/2+e.d),a=Math.max(a,c+l/2+e.d)}})),n.push([o,i],[r,i],[r,a],[o,a]),[o,i,r,a].some((function(t){return Math.abs(t)===1/0}))||(this.updatePoints(n),this.updateCoordinate({x:(r+o)/2,y:(a+i)/2}))},e}(e.PolygonNodeModel),zS=function(){function t(t){var e=t.lf;this.selectNodes=[],this.d=10,e.register({type:"node-selection",view:HS,model:FS})}return Object.defineProperty(t.prototype,"selectNodesIds",{get:function(){return this.selectNodes.map((function(t){return t.id}))},enumerable:!1,configurable:!0}),t.prototype.addNodeSelection=function(){this.lf.addNode({type:"node-selection",text:"",properties:{node_selection_ids:this.selectNodesIds}}).updatePointsByNodes(this.selectNodesIds)},t.prototype.updateNodeSelection=function(){var t=this.getNodeSelection();t&&(this.lf.setProperties(t.id,{node_selection_ids:this.selectNodesIds}),this.lf.getNodeModelById(t.id).updatePointsByNodes(this.selectNodesIds))},t.prototype.getNodeSelection=function(){var t=this,e=this.selectNodesIds,n=this.lf.getGraphRawData(),o=e.filter((function(e){return e!==t.currentClickNode.id}));return n.nodes.find((function(t){if("node-selection"===t.type){var e=Bi(t,"properties.node_selection_ids",[]);return o.every((function(t){return e.includes(t)}))}return!1}))},t.prototype.render=function(t){var e=this;this.lf=t,t.on("node:click",(function(n){if(n.e.shiftKey&&"node-selection"!==n.data.type){e.currentClickNode=n.data;var o=!1;e.selectNodesIds.includes(n.data.id)&&(e.lf.getNodeModelById(n.data.id).setSelected(!1),o=!0);var i=t.getSelectElements(!0).nodes;e.selectNodes=i,1===e.selectNodes.length?o?e.updateNodeSelection():e.addNodeSelection():e.selectNodes.length>1&&e.updateNodeSelection()}})),t.graphModel.addNodeMoveRules((function(e,n,o){if("node-selection"===e.type){var i=e.properties.node_selection_ids;return t.graphModel.moveNodes(i,n,o,!0),!0}return!0}))},t.pluginName="node-selection",t}(),WS=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getLabelShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=t.properties;return e.h("text",{x:n-i/2+5,y:o-r/2+16,fontSize:12,fill:"blue"},a.moreText)},n.prototype.getShape=function(){var t=this.props.model,n=t.x,o=t.y,i=t.width,r=t.height,a=this.props.model.getNodeStyle();return e.h("g",{},[e.h("rect",g(g({},a),{fill:"#FFFFFF",x:n-i/2,y:o-r/2})),this.getLabelShape()])},n}(e.RectNode),GS={pluginName:"rectLabelNode",install:function(t){t.register({type:"rect-label",model:e.RectNodeModel,view:WS})}};t.AutoLayout=xS,t.BPMNAdapter=Ov,t.BPMNBaseAdapter=Mv,t.BPMNElements=Gg,t.BoundaryEventFactory=xt,t.BpmnAdapter=ct,t.BpmnElement=U,t.BpmnXmlAdapter=dt,t.ContextMenu=AS,t.Control=_S,t.CurvedEdge=jS,t.CurvedEdgeModel=BS,t.DiamondResize=Sg,t.DiamondResizeModel=Eg,t.DiamondResizeView=wg,t.DndPanel=MS,t.DynamicGroup=Ew,t.DynamicGroupNode=yw,t.DynamicGroupNodeModel=mw,t.EllipseResize=_g,t.EllipseResizeModel=bg,t.EllipseResizeView=xg,t.EndEventFactory=yt,t.EndEventModel=M,t.EndEventView=O,t.ExclusiveGatewayModel=L,t.ExclusiveGatewayView=I,t.FlowPath=vS,t.GatewayNodeFactory=Rt,t.Group=Ig,t.GroupNode=Rg,t.GroupNodeModel=kg,t.Highlight=RS,t.HtmlResize=Tg,t.HtmlResizeModel=Cg,t.HtmlResizeView=Ng,t.InsertNodeInPolyline=Mw,t.IntermediateCatchEventFactory=mt,t.IntermediateThrowEventFactory=_t,t.Label=sS,t.Menu=NS,t.MiniMap=OS,t.NodeResize=Pg,t.NodeSelection=zS,t.RectLabelNode=GS,t.RectResize=Og,t.RectResizeModel=Ag,t.RectResizeView=Mg,t.SelectionSelect=PS,t.SequenceFlowModel=k,t.SequenceFlowView=R,t.ServiceTaskModel=B,t.ServiceTaskView=H,t.Snapshot=gS,t.StartEventFactory=bt,t.StartEventModel=N,t.StartEventView=T,t.SubProcessFactory=jg,t.TaskNodeFactory=Lt,t.UserTaskModel=z,t.UserTaskView=W,t.bpmnUtils=vt,t.convertNormalToXml=Ev,t.convertXmlToNormal=wv,t.dynamicGroup=xw,t.gateway={exclusive:0,inclusive:1,parallel:2},t.gatewayComposable=[[1,1,0],[0,0,1],[0,1,1]],t.getCurvedEdgePath=IS,t.handleAttributes=K,t.icons=kt,t.lfJson2Xml=J,t.lfXml2Json=et,t.multiInstanceIcon=Dt,t.sequenceFlowFactory=Hg,t.toLogicflowData=function(t){var e={nodes:[],edges:[]},n=t.flowElementList;return n&&n.length>0&&n.forEach((function(t){if(t.type===Pv.SEQUENCE_FLOW){var n=function(t){var e=t.incoming,n=t.outgoing,o=t.properties,i=t.key,r=t.type,a=o.text,s=o.name,l=o.startPoint,u=o.endPoint,c=o.pointsList,d={id:i,type:kv[r],sourceNodeId:e[0],targetNodeId:n[0],text:a||s,properties:{}};l&&(d.startPoint=JSON.parse(l)),u&&(d.endPoint=JSON.parse(u)),c&&(d.pointsList=JSON.parse(c));var h=["startPoint","endPoint","pointsList","text"];return Object.keys(t.properties).forEach((function(e){-1===h.indexOf(e)&&(d.properties[e]=t.properties[e])})),d}(t);e.edges.push(n)}else{var o=function(t){var e=t.properties,n=t.key,o=t.type,i=t.bounds,r=e.x,a=e.y,s=e.text;if(void 0===r){var l=_(i,2),u=l[0],c=u.x,d=u.y,h=l[1];r=(c+h.x)/2,a=(d+h.y)/2}var p={id:n,type:kv[o],x:r,y:a,text:s,properties:{}},f=["x","y","text"];return Object.keys(t.properties).forEach((function(e){-1===f.indexOf(e)&&(p.properties[e]=t.properties[e])})),p}(t);e.nodes.push(o)}})),e},t.toNormalJson=rt,t.toTurboData=function(t){var e=new Map,n={flowElementList:[]};return t.nodes.forEach((function(t){var o=function(t){var e=t.id,n=t.type,o=t.x,i=t.y,r=t.text,a=void 0===r?"":r,s=t.properties;return{incoming:[],outgoing:[],dockers:[],type:Rv(n),properties:g(g({},s),{name:a&&a.value||"",x:o,y:i,text:a}),key:e}}(t);n.flowElementList.push(o),e.set(t.id,o)})),t.edges.forEach((function(t){var o=function(t){var e=t.id,n=t.type,o=t.sourceNodeId,i=t.targetNodeId,r=t.startPoint,a=t.endPoint,s=t.pointsList,l=t.text,u=void 0===l?"":l,c=t.properties;return{incoming:[o],outgoing:[i],type:Rv(n),dockers:[],properties:g(g({},c),{name:u&&u.value||"",text:u,startPoint:JSON.stringify(r),endPoint:JSON.stringify(a),pointsList:JSON.stringify(s)}),key:e}}(t);e.get(t.sourceNodeId).outgoing.push(o.key),e.get(t.targetNodeId).incoming.push(o.key),n.flowElementList.push(o)})),n},t.toXmlJson=it,t.useDefinition=Wg}));
|
|
42
2
|
//# sourceMappingURL=index.min.js.map
|