var m=Object.defineProperty;var w=(e,n,t)=>n in e?m(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var l=(e,n,t)=>(w(e,typeof n!="symbol"?n+"":n,t),t);import{ch as h,av as o,ci as g,p as c,C as i,s as f,cj as s,f as v,aE as y,bL as b,ck as d,e as C,E as A}from"./index-03b6134d.js";import"./index-0a53aaef.js";import"./postmen-9e6354af.js";import{c as u}from"./createReactComponent-fcd6848b.js";/**
 * @license @tabler/icons-react v3.24.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var j=u("outline","bold","IconBold",[["path",{d:"M7 5h6a3.5 3.5 0 0 1 0 7h-6z",key:"svg-0"}],["path",{d:"M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7",key:"svg-1"}]]);/**
 * @license @tabler/icons-react v3.24.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var B=u("outline","italic","IconItalic",[["path",{d:"M11 5l6 0",key:"svg-0"}],["path",{d:"M7 19l6 0",key:"svg-1"}],["path",{d:"M14 5l-4 14",key:"svg-2"}]]);const z=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:o.jsx("path",{fill:"currentColor",d:"M11 21v-4H7.5q-.625 0-1.062-.437T6 15.5q0-.625.438-1.062T7.5 14H11v-4H4.5q-.625 0-1.062-.437T3 8.5q0-.625.438-1.062T4.5 7H11V3q0-.425.288-.712T12 2q.425 0 .713.288T13 3v4h6.5q.625 0 1.063.438T21 8.5q0 .625-.437 1.063T19.5 10H13v4h3.5q.625 0 1.063.438T18 15.5q0 .625-.437 1.063T16.5 17H13v4q0 .425-.288.713T12 22q-.425 0-.712-.288T11 21"})}),S=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:o.jsx("path",{fill:"currentColor",d:"M3 22q-.425 0-.712-.288T2 21V3q0-.425.288-.712T3 2q.425 0 .713.288T4 3v18q0 .425-.288.713T3 22m4.5-5q-.625 0-1.062-.437T6 15.5q0-.625.438-1.062T7.5 14h7q.625 0 1.063.438T16 15.5q0 .625-.437 1.063T14.5 17zm0-7q-.625 0-1.062-.437T6 8.5q0-.625.438-1.062T7.5 7h13q.625 0 1.063.438T22 8.5q0 .625-.437 1.063T20.5 10z"})}),I=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:o.jsx("path",{fill:"currentColor",d:"M21 22q-.425 0-.712-.288T20 21V3q0-.425.288-.712T21 2q.425 0 .713.288T22 3v18q0 .425-.288.713T21 22M9.5 17q-.625 0-1.062-.437T8 15.5q0-.625.438-1.062T9.5 14h7q.625 0 1.063.438T18 15.5q0 .625-.437 1.063T16.5 17zm-6-7q-.625 0-1.062-.437T2 8.5q0-.625.438-1.062T3.5 7h13q.625 0 1.063.438T18 8.5q0 .625-.437 1.063T16.5 10z"})}),P=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:o.jsx("path",{fill:"currentColor",d:"M3 22q-.425 0-.712-.288T2 21q0-.425.288-.712T3 20h18q.425 0 .713.288T22 21q0 .425-.288.713T21 22zm5.5-4q-.625 0-1.062-.437T7 16.5v-13q0-.625.438-1.062T8.5 2q.625 0 1.063.438T10 3.5v13q0 .625-.437 1.063T8.5 18m7 0q-.625 0-1.062-.437T14 16.5v-7q0-.625.438-1.062T15.5 8q.625 0 1.063.438T17 9.5v7q0 .625-.437 1.063T15.5 18"})}),M=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:o.jsx("path",{fill:"currentColor",d:"M8.5 21q-.625 0-1.062-.437T7 19.5V13H3q-.425 0-.712-.288T2 12q0-.425.288-.712T3 11h4V4.5q0-.625.438-1.062T8.5 3q.625 0 1.063.438T10 4.5V11h4V7.5q0-.625.438-1.062T15.5 6q.625 0 1.063.438T17 7.5V11h4q.425 0 .713.288T22 12q0 .425-.288.713T21 13h-4v3.5q0 .625-.437 1.063T15.5 18q-.625 0-1.062-.437T14 16.5V13h-4v6.5q0 .625-.437 1.063T8.5 21"})}),F=e=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:o.jsx("path",{fill:"currentColor",d:"M8.5 22q-.625 0-1.062-.437T7 20.5v-13q0-.625.438-1.062T8.5 6q.625 0 1.063.438T10 7.5v13q0 .625-.437 1.063T8.5 22m7-6q-.625 0-1.062-.437T14 14.5v-7q0-.625.438-1.062T15.5 6q.625 0 1.063.438T17 7.5v7q0 .625-.437 1.063T15.5 16M3 4q-.425 0-.712-.288T2 3q0-.425.288-.712T3 2h18q.425 0 .713.288T22 3q0 .425-.288.713T21 4z"})}),O={[h.Top]:o.jsx(F,{}),[h.Center]:o.jsx(M,{}),[h.Bottom]:o.jsx(P,{})},_={[g.Left]:o.jsx(S,{}),[h.Center]:o.jsx(z,{}),[h.Bottom]:o.jsx(I,{})},V=o.jsx(j,{}),H=o.jsx(B,{});var N=Object.defineProperty,D=Object.getOwnPropertyDescriptor,T=(e,n,t,r)=>{for(var a=r>1?void 0:r?D(n,t):n,x=e.length-1,q;x>=0;x--)(q=e[x])&&(a=(r?q(n,t,a):q(a))||a);return r&&a&&N(n,t,a),a};class p extends A{constructor(){super(...arguments);l(this,"_curFontAsset",null);l(this,"_curDeleteFontCB",null);l(this,"text","");l(this,"color",{r:1,g:1,b:1,a:1});l(this,"fontSize",24);l(this,"font",null);l(this,"lineSpacing",0);l(this,"fontStyleArr",[]);l(this,"horizontalAlignment",g.Center);l(this,"verticalAlignment",h.Center);l(this,"enableWrapping",!1);l(this,"overflowMode",d.Overflow)}deserialize(t){super.deserialize(t)}toJSON(){const t=super.toJSON(),r=this.fontStyleArr;if(r){let a=s.None;r.indexOf("bold")!==-1&&(a|=s.Bold),r.indexOf("italic")!==-1&&(a|=s.Italic),t.props.fontStyle=a}return t}}l(p,"_defaultFontRefId","0000900");T([c({label:"text-renderer.text.label",info:"text-renderer.text.info",type:i.Textarea,bindPath:"text"}),f()],p.prototype,"text",2);T([c({label:"text-renderer.color.label",info:"text-renderer.color.info",type:i.Color,bindPath:"color"}),f()],p.prototype,"color",2);T([c({label:"text-renderer.font-size.label",info:"text-renderer.font-size.info",type:i.Number,bindPath:"fontSize"}),f()],p.prototype,"fontSize",2);T([c({label:"text-renderer.font.label",info:"text-renderer.font.info",type:i.AssetPicker,assetType:"Font",onChange:async(e,n,t)=>{if(t&&t!==e._curFontAsset){await e.applyBoundPathChange("font",i.AssetPicker,t.getCurrentRef()),e._curDeleteFontCB&&e._curDeleteFontCB();const r=()=>{e.font=void 0,e.applyBoundPathChange("font",i.AssetPicker,void 0)};t.on("delete",r),e._curDeleteFontCB=()=>{t.off("delete",r)},e._curFontAsset=t}else e.font=void 0,await e.applyBoundPathChange("font",i.AssetPicker,void 0),e._curFontAsset=null,e._curDeleteFontCB&&e._curDeleteFontCB(),e._curDeleteFontCB=null}}),f()],p.prototype,"font",2);T([c({label:"text-renderer.line-spacing.label",info:"text-renderer.line-spacing.info",type:i.Number,bindPath:"lineSpacing"}),f()],p.prototype,"lineSpacing",2);T([c({label:"text-renderer.font-style.label",info:"text-renderer.font-style.info",type:i.ToggleGroup,multiple:!0,options:[{label:V,value:"bold"},{label:H,value:"italic"}],onChange(e,n,t){let r=s.None;t.indexOf("bold")!==-1&&(r|=s.Bold),t.indexOf("italic")!==-1&&(r|=s.Italic),e.applyBoundPathChange("fontStyle",i.Number,r)}}),v({valueType:y.Float,interpolationType:b.Step,getActualEditorValue:e=>{let n=s.None;return e.indexOf("bold")!==-1&&(n|=s.Bold),e.indexOf("italic")!==-1&&(n|=s.Italic),n},getEditorValue:e=>{const n=[];return e&s.Bold&&n.push("bold"),e&s.Italic&&n.push("italic"),n}}),f()],p.prototype,"fontStyleArr",2);T([v({valueType:y.Float,interpolationType:b.Step}),c({label:"text-renderer.horizontal-alignment.label",info:"text-renderer.horizontal-alignment.info",type:i.SegmentControl,bindPath:"horizontalAlignment",value:g.Center,options:Object.values(g).filter(e=>typeof e=="number").map(e=>({label:_[e],value:e}))}),f()],p.prototype,"horizontalAlignment",2);T([c({label:"text-renderer.vertical-alignment.label",info:"text-renderer.vertical-alignment.info",type:i.SegmentControl,bindPath:"verticalAlignment",value:h.Center,options:Object.values(h).filter(e=>typeof e=="number").map(e=>({label:O[e],value:e}))}),f()],p.prototype,"verticalAlignment",2);T([c({label:"text-renderer.enable-wrapping.label",info:"text-renderer.enable-wrapping.info",type:i.Toggle,bindPath:"enableWrapping"}),f()],p.prototype,"enableWrapping",2);T([c({label:"text-renderer.overflow-mode.label",info:"text-renderer.overflow-mode.info",type:i.Select,bindPath:"overflowMode",value:d.Overflow,options:Object.keys(d).filter(e=>isNaN(Number(e))).map(e=>({label:C(`text-renderer.overflow-mode.${e.toLocaleLowerCase()}`),value:d[e]}))}),f()],p.prototype,"overflowMode",2);export{p as T};
