"use strict";(self["webpackChunkaida"]=self["webpackChunkaida"]||[]).push([[7530],{27530:function(e,a,n){n.r(a),n.d(a,{default:function(){return q}});var l=n(66252),t=n(49963),o=n(3577),i=n(2262),c=n(46413),s=(n(74160),n(61399));const r=e=>((0,l.dD)("data-v-6171bcc6"),e=e(),(0,l.Cn)(),e),u={key:0,class:"selection-toolbar"},d={class:"toolbar-section"},v=r((()=>(0,l._)("div",{class:"toolbar-header"},[(0,l._)("div",{class:"header-title"},"选区工具")],-1))),g={class:"tool-types"},p=r((()=>(0,l._)("div",{class:"toolbar-divider"},null,-1))),_={class:"tool-actions"},m={class:"btn-text"},S={key:0,class:"dialog-overlay"},b={class:"dialog-container"},y={class:"dialog-header"},M={class:"dialog-content"},C={class:"feather-control"},O={class:"feather-value"},w={class:"dialog-buttons"},f={key:1,class:"dialog-overlay"},k={class:"dialog-container"},L={class:"dialog-header"},T={class:"dialog-content"},h={class:"dialog-buttons"};var E={__name:"SelectionPanel",props:{canvas:{type:Object,required:!0},commandManager:{type:Object,required:!0},selectionManager:{type:Object,required:!0},layerManager:{type:Object,required:!0},toolManager:{type:Object,required:!0},activeTool:{type:String,required:!1,default:null}},setup(e){const a=e,n=(0,i.iH)(!1),r=(0,i.iH)("rectangle"),E=(0,i.iH)(0),z=(0,i.iH)("#000000"),A=(0,i.iH)(!1),q=(0,i.iH)(!1),U=(0,i.iH)(!1),j=e=>e;function H(){n.value=!0,W()}function x(){n.value=!1}function P(e){r.value=e,a.toolManager?a.toolManager.setToolWithCommand(e):a.selectionManager&&(a.selectionManager.setSelectionType(e),a.selectionManager.setupSelectionEvents())}function W(){A.value=a.selectionManager&&null!==a.selectionManager.getSelectionObject(),A.value&&(E.value=a.selectionManager.getFeatherAmount())}function D(){A.value&&a.commandManager.execute(new c.FeatherSelectionCommand({selectionManager:a.selectionManager,featherAmount:E.value}))}function F(){A.value&&(a.commandManager.execute(new c.LassoCutoutCommand({canvas:a.canvas,layerManager:a.layerManager,selectionManager:a.selectionManager,toolManager:a.toolManager})),W())}function I(){q.value=!1}function R(){U.value=!1}function G(){A.value&&(a.commandManager.execute(new c.FillSelectionCommand({canvas:a.canvas,layerManager:a.layerManager,selectionManager:a.selectionManager,color:z.value})),W(),U.value=!1)}return(0,l.bv)((()=>{a.selectionManager&&(W(),a.selectionManager.onSelectionChanged=()=>{W()})})),(0,l.YP)((()=>a.activeTool),(e=>{const n=[s.OperationType.LASSO,s.OperationType.LASSO_RECTANGLE,s.OperationType.LASSO_ELLIPSE];n.includes(e)?(H(),r.value=e,a.selectionManager&&(a.selectionManager.setSelectionType(r.value),a.selectionManager.setupSelectionEvents())):x()}),{immediate:!0}),(e,a)=>{const c=(0,l.up)("svg-icon");return(0,l.wg)(),(0,l.j4)(t.uT,{name:"fade"},{default:(0,l.w5)((()=>[n.value?((0,l.wg)(),(0,l.iD)("div",u,[(0,l._)("div",d,[v,(0,l._)("div",g,[(0,l._)("div",{class:(0,o.C_)(["tool-btn",{active:r.value===(0,i.SU)(s.OperationType).LASSO}]),onClick:a[0]||(a[0]=e=>P((0,i.SU)(s.OperationType).LASSO))},[(0,l.Wm)(c,{name:"CFree",size:"26"}),(0,l._)("span",null,(0,o.zw)(j("手绘")),1)],2),(0,l._)("div",{class:(0,o.C_)(["tool-btn",{active:r.value===(0,i.SU)(s.OperationType).LASSO_RECTANGLE}]),onClick:a[1]||(a[1]=e=>P((0,i.SU)(s.OperationType).LASSO_RECTANGLE))},[(0,l.Wm)(c,{name:"CRectangle",size:"32"}),(0,l._)("span",null,(0,o.zw)(j("矩形")),1)],2),(0,l._)("div",{class:(0,o.C_)(["tool-btn",{active:r.value===(0,i.SU)(s.OperationType).LASSO_ELLIPSE}]),onClick:a[2]||(a[2]=e=>P((0,i.SU)(s.OperationType).LASSO_ELLIPSE))},[(0,l.Wm)(c,{name:"CEllipse",size:"30"}),(0,l._)("span",null,(0,o.zw)(j("椭圆")),1)],2)]),p,(0,l._)("div",_,[(0,l._)("div",{class:"action-btn",onClick:F},[(0,l.Wm)(c,{name:"CPaste"}),(0,l._)("span",m,(0,o.zw)(j("拷贝并粘贴")),1)])])]),q.value?((0,l.wg)(),(0,l.iD)("div",S,[(0,l._)("div",b,[(0,l._)("div",y,[(0,l._)("h3",null,(0,o.zw)(j("羽化")),1),(0,l._)("button",{class:"close-dialog-btn",onClick:I},"×")]),(0,l._)("div",M,[(0,l._)("div",C,[(0,l.wy)((0,l._)("input",{type:"range",min:"0",max:"50","onUpdate:modelValue":a[3]||(a[3]=e=>E.value=e),class:"slider-control"},null,512),[[t.nr,E.value,void 0,{number:!0}]]),(0,l._)("div",O,(0,o.zw)(E.value)+"px",1)]),(0,l._)("div",w,[(0,l._)("button",{class:"cancel-btn",onClick:I},(0,o.zw)(j("取消")),1),(0,l._)("button",{class:"confirm-btn",onClick:D},(0,o.zw)(j("确认")),1)])])])])):(0,l.kq)("",!0),U.value?((0,l.wg)(),(0,l.iD)("div",f,[(0,l._)("div",k,[(0,l._)("div",L,[(0,l._)("h3",null,(0,o.zw)(j("选择填充颜色")),1),(0,l._)("button",{class:"close-dialog-btn",onClick:R}," × ")]),(0,l._)("div",T,[(0,l.wy)((0,l._)("input",{type:"color","onUpdate:modelValue":a[4]||(a[4]=e=>z.value=e),class:"color-picker"},null,512),[[t.nr,z.value]]),(0,l._)("div",h,[(0,l._)("button",{class:"cancel-btn",onClick:R},(0,o.zw)(j("取消")),1),(0,l._)("button",{class:"confirm-btn",onClick:G},(0,o.zw)(j("确认")),1)])])])])):(0,l.kq)("",!0)])):(0,l.kq)("",!0)])),_:1})}}},z=n(83744);const A=(0,z.Z)(E,[["__scopeId","data-v-6171bcc6"]]);var q=A}}]);