import{p as y,R as j,P as m,ci as C,a as l,u as a,j as t,I as f,O as h,T as d,Q as b,M as $,C as k,he as N,hj as w,a4 as S}from"./bundle.CHKSNOJF.js";import{M as _,K as O}from"./builder.es-BkI8MZOV.js";import{C as P}from"./chevron-right-CHJ6fP-X.js";function x(){return x=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(r[n]=o[n])}return r},x.apply(this,arguments)}function z(r,e){if(r==null)return{};var o=B(r,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(o[n]=r[n])}return o}function B(r,e){if(r==null)return{};var o={},n=Object.keys(r),s,i;for(i=0;i<n.length;i++)s=n[i],!(e.indexOf(s)>=0)&&(o[s]=r[s]);return o}var g=y.forwardRef(function(r,e){var o=r.color,n=o===void 0?"currentColor":o,s=r.size,i=s===void 0?24:s,c=z(r,["color","size"]);return j.createElement("svg",x({ref:e,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},c),j.createElement("polyline",{points:"15 18 9 12 15 6"}))});g.propTypes={color:m.string,size:m.oneOfType([m.string,m.number])};g.displayName="ChevronLeft";const v=S.div`
  background-color: ${({theme:r})=>r.backgroundColor};

  &:hover {
    background-color: ${({theme:r})=>r.hoverBackgroundColor};
  }
`;function G(){const r=C(),e=l(),[o]=a();return t.jsx("div",{className:"max-w-[90rem] mx-auto",children:t.jsx(_.Provider,{value:{endpoint:void 0,document:r.document,invitation:r.invitation,components:{start:I,minimize:M,submit:T,dateInput:E,success:L,card:{card:V},signatureSelector:{dialog:R,input:D,button:W,clear:F,useSignature:K},previous:Y,next:q},styles:{border:e.$24,frame:{background:e.$1,color:e.$3},general:{backgroundColor:e.$1,textColor:e.$3,foregroundColor:e.$4}},translations:{sign_the_document:String(o("sign_the_document"))}},children:t.jsx(O,{})})})}function I({onClick:r}){const[e]=a();return t.jsx(d,{type:"primary",behavior:"button",onClick:r,children:e("start_signing")})}function M({onClick:r}){const e=l();return t.jsx(v,{className:"p-2 rounded-md border cursor-pointer",onClick:o=>{o.stopPropagation(),r()},theme:{backgroundColor:e.$1,hoverBackgroundColor:e.$4},style:{borderColor:e.$24},children:t.jsx(f,{element:w})})}function T({isSubmitting:r,disabled:e,onClick:o}){const[n]=a();return t.jsx(d,{disabled:e||r,onClick:o,type:"primary",behavior:"button",className:"w-full",disableWithoutIcon:!0,children:n("continue")})}function E({value:r,onChange:e}){return t.jsx(b,{type:"date",value:r,onValueChange:o=>e(o)})}function L(){const[r]=a(),e=l();return t.jsx(k,{title:t.jsxs("div",{className:"flex items-center gap-x-3",children:[t.jsx(N,{size:20,className:"text-green-600 mt-0.5"}),t.jsx("span",{style:{color:e.$3},children:r("successfully_signed_document")})]}),style:{borderColor:e.$24},headerStyle:{borderColor:e.$20},children:t.jsx("div",{className:"flex flex-col gap-6 px-4 sm:px-6",children:t.jsxs("div",{className:"text-sm",style:{color:e.$3},children:["Done! You’ve successfully signed the document!",t.jsx("br",{})," ",t.jsx("br",{}),"You’ll receive an email once the document is finalized—immediately for self-signed, or after all parties have signed.",t.jsx("br",{})," ",t.jsx("br",{}),"This page is now safe to close."]})})})}function R({isOpen:r,onOpenChange:e,trigger:o,input:n,content:s,useSignatureButton:i,type:c}){const[u]=a(),p={signature:u("create_signature"),initials:u("enter_initials")};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"mr-2",children:o}),t.jsx($,{title:c?p[c]:u("create_signature"),visible:r,onClose:e,size:"regular",children:t.jsxs("div",{className:"grid gap-6 pb-4",children:[n,s,i]})})]})}function D({value:r,onChange:e}){const[o]=a();return t.jsx(b,{type:"text",value:r,onValueChange:n=>e(n),placeholder:o("signature_name"),changeOverride:!0})}function W({onClick:r}){const[e]=a();return t.jsx(d,{behavior:"button",onClick:r,children:e("customize")})}function F({onClick:r}){const[e]=a();return t.jsx(d,{type:"secondary",behavior:"button",onClick:r,children:e("clear")})}function K({onClick:r}){const[e]=a();return t.jsx(d,{type:"primary",behavior:"button",onClick:r,children:e("use_signature")})}function V({content:r,headerRef:e,contentRef:o,footerRef:n,header:s,toggled:i,hasSignature:c,footer:u}){const p=l();return t.jsxs("div",{className:"border flex py-4 flex-col space-y-6 rounded-md",style:{backgroundColor:p.$1,borderColor:p.$24},children:[t.jsx("div",{ref:e,className:h("flex flex-col space-y-4 rounded-md",{"py-2 px-4":!(i&&c),"px-6":i&&c}),children:s}),i&&c?t.jsx("div",{className:"flex justify-center",ref:o,children:r}):null,t.jsx("div",{ref:n,className:"flex flex-col px-6",children:u})]})}function Y({onClick:r,disabled:e}){const o=l();return t.jsx(v,{className:h("py-1 px-2 rounded-md border",{"opacity-75 cursor-not-allowed":e,"opacity-100 cursor-pointer":!e}),onClick:n=>{n.stopPropagation(),!e&&r()},theme:{backgroundColor:o.$1,hoverBackgroundColor:o.$4},children:t.jsx(f,{element:g,className:"w-7 h-7"})})}function q({onClick:r,disabled:e}){const o=l();return t.jsx(v,{className:h("py-1 px-2 rounded-md border",{"opacity-75 cursor-not-allowed":e,"opacity-100 cursor-pointer":!e}),onClick:n=>{n.stopPropagation(),!e&&r()},theme:{backgroundColor:o.$1,hoverBackgroundColor:o.$4},children:t.jsx(f,{element:P,className:"w-7 h-7"})})}export{G as default};
