1"use strict";(globalThis.webpackChunktailored_industry||=[]).push([[6302],{16302(I,g,n){n.r(g),n.d(g,{default:()=>w});var o=n(74848),s=n(96540),A=n(11201),D=n(24401),R=n(26336),m=n(87164),b=n(11848),l=n(78663),B=n(89610),y=n(44675);function v({onChange:r,strokeColor:i,strokeWidth:u=3}={}){const[a,c]=(0,s.useState)(),[f,h]=(0,s.useState)(),d=(0,s.useRef)(null),x=(0,y.A)(),F=()=>{c(t=>{if(t)return t;const e=new l.Hl(d?.current??void 0);return E(e),e})},S=t=>{h(t),(0,B.A)(r)&&r(t)},C=t=>()=>{try{if(!t)return;const e=new l.Hl(void 0);e.loadFromJSON(t.toJSON()).then(()=>{e.backgroundColor="#fff",e?.forEachObject(H=>{H.set("stroke","#000")}),S(e.toDataURL())})}catch(e){console.warn(e)}},N=()=>i||x.palette.text.primary,E=t=>{t&&(t.on("object:modified",C(t)),t.on("object:added",C(t)),t.on("object:removed",C(t)),t.hoverCursor="move",t.setDimensions({width:260}),t.setDimensions({height:130}),t.selection=!1,t.backgroundColor=x.palette.background.paper,t.isDrawingMode=!0,t.freeDrawingBrush=new l.mW(t),t.freeDrawingBrush.width=u,t.freeDrawingBrush.color=N())};return{canvas:a,initCanvas:F,canvasRef:d,clearCanvas:()=>{a?.clear(),S(void 0)},canClear:!!f}}const O=(0,b.A)(m.A)(({theme:r})=>({border:r.border.solid(1),borderRadius:r.shape.borderRadius,background:r.palette.background.paper}));j.useSignature=v;function j({onChange:r,strokeColor:i,strokeWidth:u,...a}){const{canvasRef:c,initCanvas:f,clearCanvas:h,canClear:d}=v({onChange:r,strokeColor:i,strokeWidth:u});return(0,s.useEffect)(()=>{f()},[]),(0,o.jsx)(m.A,{maxWidth:"100%",width:"fit-content",children:(0,o.jsxs)(D.A,{...a,contentDirection:"row",contentAlignItems:"center",children:[(0,o.jsx)(O,{className:"Signature",children:(0,o.jsx)("canvas",{ref:c})}),(0,o.jsx)(A.A,{color:"error",hidden:!d,startIcon:(0,o.jsx)(R.A,{}),onClick:h,invisible:!0})]})})}const w=j}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.