PageSourceSearch

https://www.qyvo.io/build/assets/ConfigurationTab-CJH55FQ_.js

js qyvo.io collected 2026-10-02 06:28:46 UTC 23,105 bytes, 1 lines download raw bytes

vendor: 3,962 bytes, line 1
1import{j as e}from"./app-ByQch4I5.js";import{b as u}from"./vendor-charts-BKAt7cDO.js";import{C as T,a as V,b as B,c as K,d as ge}from"./card-BuV06XZb.js";import{I as q}from"./input-oWbSJjZA.js";import{T as pe}from"./textarea-C2DzXLcv.js";import{L as S}from"./label-8L8euwlc.js";import{u as he,f as xe,S as U,a as F,b as H,c as $,d as A}from"./select-CpwNcpia.js";import{S as Z}from"./switch-BesEoEx2.js";import{u as ve,P as E,c as P,d as ie}from"./index-B55C8FZP.js";import{u as D}from"./index-CqaWym_s.js";import{R as Qe,I as Ze,c as be}from"./index-BYnlm6xS.js";import{u as je,c as et}from"./index-C6kCe8uY.js";import{u as we}from"./index-wp-dmnFN.js";import{P as tt}from"./index-sZSOPfrQ.js";import{c as oe,u as nt}from"./utils-CUI6UMdp.js";import{C as st}from"./circle-D0o7WlQ4.js";import{A as rt,b as at}from"./alert-Ec8gnC9J.js";import{B as ee}from"./button-CO2CfBCy.js";import it from"./LivePreview-CW8qXrRH.js";import{T as ot}from"./triangle-alert-DqaUqV91.js";import{U as me}from"./upload-tmNHmeDq.js";import{X as dt}from"./x-B4BqlaU8.js";import"./Combination-DeVoTXCW.js";import"./createLucideIcon-DK2HYjz_.js";import"./check-Drz9NtyC.js";var de="Radio",[ct,_e]=ie(de),[lt,ut]=ct(de),Se=u.forwardRef((t,s)=>{const{__scopeRadio:r,name:o,checked:d=!1,required:n,disabled:c,value:l="on",onCheck:g,form:h,...f}=t,[i,p]=u.useState(null),m=D(s,b=>p(b)),x=u.useRef(!1),j=i?h||!!i.closest("form"):!0;return e.jsxs(lt,{scope:r,checked:d,disabled:c,children:[e.jsx(E.button,{type:"button",role:"radio","aria-checked":d,"data-state":Ne(d),"data-disabled":c?"":void 0,disabled:c,value:l,...f,ref:m,onClick:P(t.onClick,b=>{d||g?.(),j&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})}),j&&e.jsx(Ce,{control:i,bubbles:!x.current,name:o,value:l,checked:d,required:n,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});Se.displayName=de;var Re="RadioIndicator",ye=u.forwardRef((t,s)=>{const{__scopeRadio:r,forceMount:o,...d}=t,n=ut(Re,r);return e.jsx(tt,{present:o||n.checked,children:e.jsx(E.span,{"data-state":Ne(n.checked),"data-disabled":n.disabled?"":void 0,...d,ref:s})})});ye.displayName=Re;var gt="RadioBubbleInput",Ce=u.forwardRef(({__scopeRadio:t,control:s,checked:r,bubbles:o=!0,...d},n)=>{const c=u.useRef(null),l=D(c,n),g=he(r),h=we(s);return u.useEffect(()=>{const f=c.current;if(!f)return;const i=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(i,"checked").set;if(g!==r&&m){const x=new Event("click",{bubbles:o});m.call(f,r),f.dispatchEvent(x)}},[g,r,o]),e.jsx(E.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...d,tabIndex:-1,ref:l,style:{...d.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ce.displayName=gt;function Ne(t){return t?"checked":"unchecked"}var pt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Y="RadioGroup",[mt]=ie(Y,[be,_e]),Pe=be(),Ee=_e(),[ft,ht]=mt(Y),De=u.forwardRef((t,s)=>{const{__scopeRadioGroup:r,name:o,defaultValue:d,value:n,required:c=!1,disabled:l=!1,orientation:g,dir:h,loop:f=!0,onValueChange:i,...p}=t,m=Pe(r),x=je(h),[j,b]=ve({prop:n,defaultProp:d??null,onChange:i,caller:Y});return e.jsx(ft,{scope:r,name:o,required:c,disabled:l,value:j,onValueChange:b,children:e.jsx(Qe,{asChild:!0,...m,orientation:g,dir:x,loop:f,children:e.jsx(E.div,{role:"radiogroup","aria-required":c,"aria-orientation":g,"data-disabled":l?"":void 0,dir:x,...p,ref:s})})})});De.displayName=Y;var ke="RadioGroupItem",Ie=u.forwardRef((t,s)=>{const{__scopeRadioGroup:r,disabled:o,...d}=t,n=ht(ke,r),c=n.disabled||o,l=Pe(r),g=Ee(r),h=u.useRef(null),f=D(s,h),i=n.value===d.value,p=u.useRef(!1);return u.useEffect(()=>{const m=j=>{pt.includes(j.key)&&(p.current=!0)},x=()=>p.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",x)}},[]),e.jsx(Ze,{asChild:!0,...l,focusable:!c,active:i,children:e.jsx(Se,{disabled:c,required:n.required,
1checked:i,...g,...d,name:n.name,ref:f,onCheck:()=>n.onValueChange(d.value),onKeyDown:P(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:P(d.onFocus,()=>{p.current&&h.current?.click()})})})});Ie.displayName=ke;var xt="RadioGroupIndicator",Ae=u.forwardRef((t,s)=>{const{__scopeRadioGroup:r,...o}=t,d=Ee(r);return e.jsx(ye,{...d,...o,ref:s})});Ae.displayName=xt;var Me=De,Te=Ie,vt=Ae;const te=u.forwardRef(({className:t,...s},r)=>e.jsx(Me,{className:oe("grid gap-2",t),...s,ref:r}));te.displayName=Me.displayName;const z=u.forwardRef(({className:t,...s},r)=>e.jsx(Te,{ref:r,className:oe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...s,children:e.jsx(vt,{className:"flex items-center justify-center",children:e.jsx(st,{className:"h-2.5 w-2.5 fill-current text-current"})})}));z.displayName=Te.displayName;var Ve=["PageUp","PageDown"],Be=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ke={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},L="Slider",[ne,bt,jt]=et(L),[Le]=ie(L,[jt]),[wt,X]=Le(L),Ge=u.forwardRef((t,s)=>{const{name:r,min:o=0,max:d=100,step:n=1,orientation:c="horizontal",disabled:l=!1,minStepsBetweenThumbs:g=0,defaultValue:h=[o],value:f,onValueChange:i=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:x,...j}=t,b=u.useRef(new Set),_=u.useRef(0),w=c==="horizontal"?_t:St,[v=[],y]=ve({prop:f,defaultProp:h,onChange:R=>{[...b.current][_.current]?.focus(),i(R)}}),C=u.useRef(v);function N(R){const k=Pt(v,R);G(R,k)}function W(R){G(R,_.current)}function Je(){const R=C.current[_.current];v[_.current]!==R&&p(v)}function G(R,k,{commit:J}={commit:!1}){const le=It(n),Q=At(Math.round((R-o)/n)*n+o,le),O=xe(Q,[o,d]);y((M=[])=>{const I=Ct(M,O,k);if(kt(I,g*n)){_.current=I.indexOf(O);const ue=String(I)!==String(M);return ue&&J&&p(I),ue?I:M}else return M})}return e.jsx(wt,{scope:t.__scopeSlider,name:r,disabled:l,min:o,max:d,valueIndexToChangeRef:_,thumbs:b.current,values:v,orientation:c,form:x,children:e.jsx(ne.Provider,{scope:t.__scopeSlider,children:e.jsx(ne.Slot,{scope:t.__scopeSlider,children:e.jsx(w,{"aria-disabled":l,"data-disabled":l?"":void 0,...j,ref:s,onPointerDown:P(j.onPointerDown,()=>{l||(C.current=v)}),min:o,max:d,inverted:m,onSlideStart:l?void 0:N,onSlideMove:l?void 0:W,onSlideEnd:l?void 0:Je,onHomeKeyDown:()=>!l&&G(o,0,{commit:!0}),onEndKeyDown:()=>!l&&G(d,v.length-1,{commit:!0}),onStepKeyDown:({event:R,direction:k})=>{if(!l){const Q=Ve.includes(R.key)||R.shiftKey&&Be.includes(R.key)?10:1,O=_.current,M=v[O],I=n*Q*k;G(M+I,O,{commit:!0})}}})})})})});Ge.displayName=L;var[Oe,qe]=Le(L,{startEdge:"left",endEdge:"right",size:"width",direction:1}),_t=u.forwardRef((t,s)=>{const{min:r,max:o,dir:d,inverted:n,onSlideStart:c,onSlideMove:l,onSlideEnd:g,onStepKeyDown:h,...f}=t,[i,p]=u.useState(null),m=D(s,w=>p(w)),x=u.useRef(void 0),j=je(d),b=j==="ltr",_=b&&!n||!b&&n;function a(w){const v=x.current||i.getBoundingClientRect(),y=[0,v.width],N=ce(y,_?[r,o]:[o,r]);return x.current=v,N(w-v.left)}return e.jsx(Oe,{scope:t.__scopeSlider,startEdge:_?"left":"right",endEdge:_?"right":"left",direction:_?1:-1,size:"width",children:e.jsx(ze,{dir:j,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const v=a(w.clientX);c?.(v)},onSlideMove:w=>{const v=a(w.clientX);l?.(v)},onSlideEnd:()=>{x.current=void 0,g?.()},onStepKeyDown:w=>{const y=Ke[_?"from-left":"from-right"].includes(w.key);h?.({event:w,direction:y?-1:1})}})})}),St=u.forwardRef((t,s)=>{const{min:r,max:o,inverted:d,onSlideStart:n,onSlideMove:c,onSlideEnd:l,onStepKeyDown:g,...h}=t,f=u.useRef(null),i=D(s,f),p=u.useRef(void 0),m=!d;function x(j){const b=p.current||f.current.getBoundingClientRect(),_=[0,b.height],w=ce(_,m?[o,r]:[r,o]);return p.current=b,w(j-b.top)}return e.jsx(Oe,{scope:t.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:e.jsx(ze,{"data-orientation":"vertical",...h,ref:i,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:j=>{const b=x(j.clientY);n?.(b)},onSlideMove:j=>{const b=x(j.clientY);c?.(b)},onSlideEnd:()=>{p.current=void 0,l?.()},onStepKeyDown:j=>{const _=Ke[m?"from-bottom":"from-top"].includes(j.key);g?.({event:j,direction:_?-1:1})}})})}),ze=u.forwardRef((t,s)=>{const{__scopeSlider:r,onSlideStart:o,onSlideMove:d,onSlideEnd:n,onHomeKeyDown:c,onEndKeyDown:l,onStepKeyDown:g,...h}=t,f=X(L,r);return e.jsx(E.span,{...h,ref:s,onKeyDown:P(t.onKeyDown,i=>{i.key==="Home"?(c(i),i.preventDefault()):i.key==="End"?(l(i),i.preventDefault()):Ve.concat(Be).includes(i.key)&&(g(i),i.preventDefault())}),onPointerDown:P(t.onPointerDown,i=>{const p=i.target;p.setPointerCapture(i.pointerId),i.preventDefault(),f.thumbs.has(p)?p.focus():o(i)}),onPointerMove:P(t.onPointerMove,i=>{i.target.hasPointerCapture(i.pointerId)&&d(i)}),onPointerUp:P(t.onPointerUp,i=>{const p=i.target;p.hasPointerCapture(i.pointerId)&&(p.releasePointerCapture(i.pointerId),n(i))})})}),Ue="SliderTrack",Fe=u.forwardRef((t,s)=>{const{__scopeSlider:r,...o}=t,d=X(Ue,r);return e.jsx(E.span,{"data-disabled":d.disabled?"":void 0,"data-orientation":d.orientation,...o,ref:s})});Fe.displayName=Ue;var se="SliderRange",He=u.forwardRef((t,s)=>{const{__scopeSlider:r,...o}=t,d=X(se,r),n=qe(se,r),c=u.useRef(null),l=D(s,c),g=d.values.length,h=d.values.map(p=>
1Xe(p,d.min,d.max)),f=g>1?Math.min(...h):0,i=100-Math.max(...h);return e.jsx(E.span,{"data-orientation":d.orientation,"data-disabled":d.disabled?"":void 0,...o,ref:l,style:{...t.style,[n.startEdge]:f+"%",[n.endEdge]:i+"%"}})});He.displayName=se;var re="SliderThumb",$e=u.forwardRef((t,s)=>{const r=bt(t.__scopeSlider),[o,d]=u.useState(null),n=D(s,l=>d(l)),c=u.useMemo(()=>o?r().findIndex(l=>l.ref.current===o):-1,[r,o]);return e.jsx(Rt,{...t,ref:n,index:c})}),Rt=u.forwardRef((t,s)=>{const{__scopeSlider:r,index:o,name:d,...n}=t,c=X(re,r),l=qe(re,r),[g,h]=u.useState(null),f=D(s,a=>h(a)),i=g?c.form||!!g.closest("form"):!0,p=we(g),m=c.values[o],x=m===void 0?0:Xe(m,c.min,c.max),j=Nt(o,c.values.length),b=p?.[l.size],_=b?Et(b,x,l.direction):0;return u.useEffect(()=>{if(g)return c.thumbs.add(g),()=>{c.thumbs.delete(g)}},[g,c.thumbs]),e.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${x}% + ${_}px)`},children:[e.jsx(ne.ItemSlot,{scope:t.__scopeSlider,children:e.jsx(E.span,{role:"slider","aria-label":t["aria-label"]||j,"aria-valuemin":c.min,"aria-valuenow":m,"aria-valuemax":c.max,"aria-orientation":c.orientation,"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,tabIndex:c.disabled?void 0:0,...n,ref:f,style:m===void 0?{display:"none"}:t.style,onFocus:P(t.onFocus,()=>{c.valueIndexToChangeRef.current=o})})}),i&&e.jsx(Ye,{name:d??(c.name?c.name+(c.values.length>1?"[]":""):void 0),form:c.form,value:m},o)]})});$e.displayName=re;var yt="RadioBubbleInput",Ye=u.forwardRef(({__scopeSlider:t,value:s,...r},o)=>{const d=u.useRef(null),n=D(d,o),c=he(s);return u.useEffect(()=>{const l=d.current;if(!l)return;const g=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(g,"value").set;if(c!==s&&f){const i=new Event("input",{bubbles:!0});f.call(l,s),l.dispatchEvent(i)}},[c,s]),e.jsx(E.input,{style:{display:"none"},...r,ref:n,defaultValue:s})});Ye.displayName=yt;function Ct(t=[],s,r){const o=[...t];return o[r]=s,o.sort((d,n)=>d-n)}function Xe(t,s,r){const n=100/(r-s)*(t-s);return xe(n,[0,100])}function Nt(t,s){return s>2?`Value ${t+1} of ${s}`:s===2?["Minimum","Maximum"][t]:void 0}function Pt(t,s){if(t.length===1)return 0;const r=t.map(d=>Math.abs(d-s)),o=Math.min(...r);return r.indexOf(o)}function Et(t,s,r){const o=t/2,n=ce([0,50],[0,o]);return(o-n(s)*r)*r}function Dt(t){return t.slice(0,-1).map((s,r)=>t[r+1]-s)}function kt(t,s){if(s>0){const r=Dt(t);return Math.min(...r)>=s}return!0}function ce(t,s){return r=>{if(t[0]===t[1]||s[0]===s[1])return s[0];const o=(s[1]-s[0])/(t[1]-t[0]);return s[0]+o*(r-t[0])}}function It(t){return(String(t).split(".")[1]||"").length}function At(t,s){const r=Math.pow(10,s);return Math.round(t*r)/r}var We=Ge,Mt=Fe,Tt=He,Vt=$e;const ae=u.forwardRef(({className:t,...s},r)=>e.jsxs(We,{ref:r,className:oe("relative flex w-full touch-none select-none items-center",t),...s,children:[e.jsx(Mt,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-muted",children:e.jsx(Tt,{className:"absolute h-full bg-primary"})}),e.jsx(Vt,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));ae.displayName=We.displayName;function fe({value:t,onChange:s,className:r}){return e.jsxs("div",{className:`flex items-center gap-2 ${r||""}`,children:[e.jsx("input",{type:"color",value:t||"#000000",onChange:o=>s(o.target.value),className:"h-10 w-12 cursor-pointer rounded border p-1","aria-label":"Pick a color"}),e.jsx(q,{type:"text",value:t||"",onChange:o=>s(o.target.value),placeholder:"#RRGGBB",className:"font-mono"})]})}function cn({form:t,wabaAccounts:s,sequences:r,aiEnabled:o,widgetDomain:d}){const{t:n}=nt(),c=u.useRef(null),[l,g]=u.useState(!1),[h,f]=u.useState(null),i=(a,w)=>{const v=JSON.parse(JSON.stringify(t.data.config)),y=a.split(".");let C=v;for(let N=0;N<y.length-1;N++)C=C[y[N]];C[y[y.length-1]]=w,t.setData("config",v)},p=async a=>{const w=a.target.files?.[0];if(w){f(null),g(!0);try{const v=new FormData;v.append("image",w);const y=document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")||"",C=await fetch(route("widgets.upload.brand-image"),{method:"POST",headers:{"X-CSRF-TOKEN":y,Accept:"application/json"},body:v,credentials:"same-origin"});if(!C.ok){const W=await C.json().catch(()=>({}));throw new Error(W.message||n("widgets.brand_img_upload_failed"))}const{url:N}=await C.json();i("widget.brand_img_url",N)}catch(v){f(v.message)}finally{g(!1),c.current&&(c.current.value="")}}},m=a=>{t.setData("linked_sequence_id",a);const w=r.find(v=>v.id===a);w?.trigger_text&&t.setData("prefilled_msg",w.trigger_text)},x=t.data.mode==="sequence"&&t.data.linked_sequence_id?r.find(a=>a.id===t.data.linked_sequence_id):null,b=(s.find(a=>a.id===t.data.waba_account_id)?.phone_number||"").replace(/\D/g,""),_=t.data.mode==="sequence"?x?.trigger_text||"":t.data.prefilled_msg||"";return e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_380px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs(T,{children:[e.jsx(V,{children:e.jsx(B,{children:n("widgets.infos_title")})}),e.jsxs(K,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(S,{children:n("widgets.waba")}),e.jsxs(U,{value:t.data.waba_account_id,onValueChange:a=>t.setData("waba_account_id",a),children:[e.jsx(F,{children:e.jsx(H,{})}),e.jsx($,{children:s.map(a=>e.jsx(A,{value:a.id,children:a.phone_number},a.id))})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Z,{checked:t.data.enabled,onCheckedChange:a=>t.setData("enabled",a)}),e.jsx(S,{children:n("widgets.enabled")})]})]})]}),e.jsxs(T,{children:[e.jsxs(V,{children:[e.jsx(B,{children:n("widgets.dest_title")}),e.jsx(ge,{children:n("widgets.dest_desc")})]}),e.jsxs(K,{className:"space-y-4",children:[e.jsxs(te,{value:t.data.mode,onValueChange:a=>t.setData("mode",a),className:"grid grid-cols-2 gap-3",children:[e.jsxs("label",{className:"flex items-start gap-3 rounded border p-3 cursor-pointer",children:[e.jsx(z,{value:"sequence"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:n("widgets.mode_sequence")}),e.jsx("div",{className:"text-xs text-muted-foreground",children:n("widgets.mode_sequence_desc")})]})]}),e.jsxs("label",{className:"flex items-start gap-3 rounded border p-3 cursor-pointer",children:[e.jsx(z,{value:"ai"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:n("widgets.mode_ai")}),e.jsx("div",{className:"text-xs text-muted-foreground",children:n("widgets.mode_ai_desc")})]})]})]}),t.data.mode==="sequence"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:n("widgets.linked_sequence")}),e.jsxs(U,{value:t.data.linked_sequence_id||"",onValueChange:m,children:[e.jsx(F,{children:e.jsx(H,{placeholder:n("widgets.pick_sequence")})}),e.jsx($,{children:r.map(a=>e.jsxs(A,{value:a.id,children:[a.name,' — "',a.trigger_text,'"']},a.id))})]}),x&&e.jsxs("div",{className:"rounded-md border bg-muted/50 px-3 py-2 text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[n("widgets.visitor_will_send")," "]}),e.jsxs("span",{className:"font-medium",children:["« ",x.trigger_text," »"]})]})]}),t.data.mode==="ai"&&!o&&e.jsxs(rt,{children:[e.jsx(ot,{className:"h-4 w-4"}),e.jsx(at,{children:n("widgets.ai_not_enabled_warning")})]})]})]}),t.data.mode==="ai"&&e.jsxs(T,{children:[e.jsxs(V,{children:[e.jsx(B,{children:n("widgets.prefilled_t
1itle")}),e.jsx(ge,{children:n("widgets.prefilled_desc")})]}),e.jsxs(K,{children:[e.jsx(pe,{value:t.data.prefilled_msg,onChange:a=>t.setData("prefilled_msg",a.target.value),maxLength:1024,rows:3}),e.jsxs("div",{className:"text-xs text-muted-foreground text-right mt-1",children:[t.data.prefilled_msg.length,"/1024"]})]})]}),e.jsxs(T,{children:[e.jsx(V,{children:e.jsx(B,{children:n("widgets.appearance_title")})}),e.jsxs(K,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-medium text-sm",children:n("widgets.appearance_button")}),e.jsxs("div",{children:[e.jsx(S,{children:n("widgets.variant")}),e.jsxs(U,{value:t.data.config.variant,onValueChange:a=>i("variant",a),children:[e.jsx(F,{children:e.jsx(H,{})}),e.jsxs($,{children:[e.jsx(A,{value:"button",children:n("widgets.variant_button")}),e.jsx(A,{value:"button_and_widget",children:n("widgets.variant_button_and_widget")})]})]})]}),e.jsxs("div",{children:[e.jsx(S,{children:n("widgets.btn_background")}),e.jsx(fe,{value:t.data.config.button.background,onChange:a=>i("button.background",a)})]}),e.jsxs("div",{children:[e.jsx(S,{children:n("widgets.btn_cta")}),e.jsx(q,{value:t.data.config.button.cta,onChange:a=>i("button.cta",a.target.value),maxLength:40})]}),e.jsxs("div",{children:[e.jsx(S,{children:n("widgets.btn_position")}),e.jsxs(te,{value:t.data.config.button.position,onValueChange:a=>i("button.position",a),className:"flex gap-4",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx(z,{value:"bottom-right"}),n("widgets.pos_right")]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx(z,{value:"bottom-left"}),n("widgets.pos_left")]})]})]}),e.jsx("div",{className:"grid grid-cols-3 gap-4",children:["bottom","left","right"].map(a=>e.jsxs("div",{children:[e.jsxs(S,{children:[n(`widgets.margin_${a}`)," (",t.data.config.button.margin[a],"px)"]}),e.jsx(ae,{min:0,max:200,step:1,value:[t.data.config.button.margin[a]],onValueChange:([w])=>i(`button.margin.${a}`,w)})]},a))}),e.jsxs("div",{children:[e.jsxs(S,{children:[n("widgets.border_radius")," (",t.data.config.button.border_radius,"px)"]}),e.jsx(ae,{min:0,max:40,step:1,value:[t.data.config.button.border_radius],onValueChange:([a])=>i("button.border_radius",a)})]})]}),t.data.config.variant==="button_and_widget"&&e.jsxs("div",{className:"space-y-4 border-t pt-4",children:[e.jsx("h3",{className:"font-medium text-sm",children:n("widgets.appearance_bubble")}),e.jsxs("div",{children:[e.jsx(S,{children:n("widgets.brand_name")}),e.jsx(q,{value:t.data.config.widget.brand_name,onChange:a=>i("widget.brand_name",a.target.value),maxLength:40})]}),e.jsxs("div",{children:[e.jsx(S,{children:n("widgets.brand_subtitle")}),e.jsx(q,{value:t.data.config.widget.brand_subtitle,onChange:a=>i("widget.brand_subtitle",a.target.value),maxLength:40})]}),e.jsxs("div",{children:[e.jsx(S,{children:n("widgets.brand_color")}),e.jsx(fe,{value:t.data.config.widget.brand_color,onChange:a=>i("widget.brand_color",a)})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(S,{children:n("widgets.brand_image")}),e.jsx("input",{ref:c,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif,image/svg+xml",onChange:p,className:"hidden"}),t.data.config.widget.brand_img_url?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:t.data.config.widget.brand_img_url,alt:"",className:"h-12 w-12 rounded-full border object-cover"}),e.jsxs(ee,{type:"button",variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:l,children:[e.jsx(me,{className:"h-4 w-4 mr-1"}),n(l?"widgets.uploading":"widgets.brand_image_replace")]}),e.jsx(ee,{type:"button",variant:"ghost",size:"icon",onClick:()=>i("widget.brand_img_url",""),title:n("widgets.brand_image_remove"),children:e.jsx(dt,{className:"h-4 w-4"})})]}):e.jsx("div",{children:e.jsxs(ee,{type:"button",variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:l,children:[e.jsx(me,{className:"h-4 w-4 mr-1"}),n(l?"widgets.uploading":"widgets.brand_image_upload")]})}),h&&e.jsx("p",{className:"text-xs text-red-600",children:h}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n("widgets.brand_image_hint")})]}),e.jsxs("div",{children:[e.jsx(S,{children:n("widgets.onscreen_msg")}),e.jsx(pe,{value:t.data.config.widget.onscreen_msg,onChange:a=>i("widget.onscreen_msg",a.target.value),maxLength:500,rows:3})]}),e.jsxs("div",{children:[e.jsx(S,{children:n("widgets.bubble_cta")}),e.jsx(q,{value:t.data.config.widget.cta,onChange:a=>i("widget.cta",a.target.value),maxLength:40})]})]})]})]}),e.jsxs(T,{children:[e.jsx(V,{children:e.jsx(B,{children:n("widgets.behavior_title")})}),e.jsxs(K,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Z,{checked:t.data.config.widget.mobile,onCheckedChange:a=>i("widget.mobile",a)}),e.jsx(S,{children:n("widgets.show_on_mobile")})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Z,{checked:t.data.config.widget.open_by_default,disabled:t.data.config.variant==="button",onCheckedChange:a=>i("widget.open_by_default",a)}),e.jsx(S,{children:n("widgets.open_by_default")})]}),e.jsxs("div",{children:[e.jsx(S,{children:n("widgets.reopen_session")}),e.jsxs(U,{value:t.data.config.widget.reopen_session,onValueChange:a=>i("widget.reopen_session",a),children:[e.jsx(F,{children:e.jsx(H,{})}),e.jsxs($,{children:[e.jsx(A,{value:"always",children:n("widgets.reopen_always")}),e.jsx(A,{value:"24h",children:n("widgets.reopen_24h")}),e.jsx(A,{value:"7d",children:n("widgets.reopen_7d")})]})]})]})]})]})]}),e.jsx("div",{className:"hidden lg:block",children:e.jsxs(T,{className:"sticky top-6",children:[e.jsx(V,{children:e.jsx(B,{children:n("widgets.preview_title")})}),e.jsx(K,{className:"p-0",children:e.jsx(it,{config:t.data.config,prefilledMsg:_,phone:b,publicId:null,widgetDomain:d})})]})})]})}export{cn as default};

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.