PageSourceSearch

https://dealerhub.360rain.com/assets/quote-portal-sandbox-content-BAB63SBC.js

js 360rain.com collected 2026-10-02 15:00:01 UTC 12,122 bytes, 1 lines download raw bytes

1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`64d60fa4-f350-48db-8e7e-7b818fb230fd`,e._sentryDebugIdIdentifier=`sentry-dbid-64d60fa4-f350-48db-8e7e-7b818fb230fd`)}catch{}})();import{a as e}from"./rolldown-runtime-eil0g4P7.js";import{Hn as t,Or as n,Sp as r,Yp as i,qu as a,yd as o}from"./icons-DpkGVEtF.js";import{$ as s,Pt as c,X as l,Y as u,a as d,et as f,lt as p,o as m,s as h}from"./login-shell-shared-B1ZmoKZI.js";import{t as g}from"./button-BoQCzBK8.js";import{t as _}from"./scrolling-page-UUxlnl8F.js";import{ai as v,ci as y,ki as b,li as x,oi as S,ui as C}from"./full-app-shell-X40U7syq.js";import{f as w}from"./signature-capture-DfM81HCT.js";import{n as T,t as E}from"./quote-portal-sections-DWm3lO6u.js";var D=e(i(),1),O=c();function k(e,t){if(e===`buyer`)return`Buyer signer`;if(e===`seller`)return`Seller signer`;if(e===`readonly`)return`Read-only viewer`;let n=e.slice(10);return t?.recipient_roles.find(e=>e.role_key===n)?.label||`Recipient`}function A(){document.querySelector(`[data-testid="contract-field-progress-guide"]`)?.scrollIntoView({behavior:`smooth`,block:`start`})}function j(e){return(0,O.jsxs)(`div`,{className:`sticky top-0 z-40 border-b bg-white/95 px-4 py-3 shadow-xs backdrop-blur`,children:[(0,O.jsxs)(`div`,{className:`mx-auto flex max-w-6xl flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`,children:[(0,O.jsxs)(`div`,{className:`space-y-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(t,{className:`h-5 w-5 text-brand-primary`}),(0,O.jsx)(`h1`,{className:`text-sm font-semibold text-slate-950`,children:`Quote Portal Sandbox`})]}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Browser-only sandbox. No quote data is saved, logged, emailed, or signed.`})]}),(0,O.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,O.jsxs)(`div`,{className:`w-48 space-y-1`,children:[(0,O.jsx)(b,{className:`text-xs`,children:`Testing as`}),(0,O.jsx)(P,{onRoleChange:e.onRoleChange,packet:e.packet,role:e.role})]}),(0,O.jsx)(g,{onClick:A,type:`button`,variant:`outline`,children:`Jump to contract`}),(0,O.jsxs)(g,{onClick:e.onReset,type:`button`,variant:`outline`,children:[(0,O.jsx)(n,{className:`h-4 w-4`}),`Reset`]}),(0,O.jsxs)(g,{onClick:e.onCompleteStage,disabled:e.stage===`completed`||e.role!==e.stage,type:`button`,className:`bg-brand-primary hover:bg-brand-primary-hover`,children:[`Complete`,` `,e.stage===`buyer`?`buyer`:e.stage===`seller`?`seller`:`preview`]}),e.returnHref?(0,O.jsx)(g,{asChild:!0,type:`button`,variant:`ghost`,children:(0,O.jsxs)(p,{href:e.returnHref,children:[(0,O.jsx)(r,{className:`h-4 w-4`}),`Return to editor`]})}):null]})]}),(0,O.jsxs)(`div`,{className:`mx-auto mt-2 max-w-6xl text-xs text-muted-foreground`,children:[`Stage: `,(0,O.jsx)(`span`,{className:`font-medium text-slate-800`,children:e.stage}),` · Role:`,` `,k(e.role,e.packet)]})]})}function M(e){return(0,O.jsx)(`div`,{className:`sticky top-0 z-40 border-b bg-white/95 px-3 py-2 shadow-xs backdrop-blur`,"data-testid":`sandbox-preview-controls`,children:(0,O.jsxs)(`div`,{className:`mx-auto flex max-w-5xl flex-wrap items-end gap-2`,children:[(0,O.jsxs)(`div`,{className:`w-44 space-y-1`,children:[(0,O.jsx)(b,{className:`text-xs`,children:`Preview as`}),(0,O.jsx)(P,{onRoleChange:e.onRoleChange,packet:e.packet,role:e.role})]}),(0,O.jsxs)(g,{onClick:e.onReset,size:`sm`,type:`button`,variant:`outline`,children:[(0,O.jsx)(n,{className:`h-4 w-4`}),`Reset`]}),(0,O.jsxs)(g,{className:`bg-brand-primary hover:bg-brand-primary-hover`,onClick:e.onCompleteStage,disabled:e.stage===`completed`||e.role!==e.stage,size:`sm`,type:`button`,children:[`Complete`,` `,e.stage===`buyer`?`buyer`:e.stage===`seller`?`seller`:`preview`]}),(0,O.jsx)(`span`,{className:`pb-1 text-xs text-muted-foreground`,children:`Nothing in this preview is saved.`})]})})}function N(e){return e.compact?(0,O.jsx)(M,{...e}):(0,O.jsx)(j,{...e})}function P(e){return(0,O.jsxs)(v,{onValueChange:t=>e.onRoleChange(t),value:e.role,children:[(0,O.jsx)(x,{"data-testid":`sandbox-role-select`,children:(0,O.jsx)(C,{})}),(0,O.jsxs)(S,{children:[(0,O.jsx)(y,{value:`buyer`,children:`Buyer signer`}),(0,O.jsx)(y,{value:`seller`,children:`Seller signer`}),e.packet?.recipient_roles?.map(e=>(0,O.jsx)(y,{value:`recipient:${e.role_key}`,children:e.label},e.role_key)),(0,O.jsx)(y,{value:`readonly`,children:`Read-only viewer`})]})]})}function F({stage:e}){if(e===`buyer`)return null;let t=e===`completed`;return(0,O.jsxs)(`section`,{className:`mx-auto max-w-5xl space-y-4 px-4 pb-8 sm:px-6 lg:px-8`,children:[(0,O.jsx)(`div`,{className:`grid gap-3 rounded-md border bg-white p-4 sm:grid-cols-3`,children:[{done:!0,label:`Buyer signed`},{done:t,label:`Final counter-signature`},{done:t,label:`Final document ready`}].map(e=>(0,O.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,O.jsx)(`div`,{className:[`flex h-8 w-8 shrink-0 items-center justify-center rounded-full border`,e.done?`border-green-200 bg-green-50 text-green-700`:`border-blue-200 bg-blue-50 text-blue-700`].join(` `),children:e.done?(0,O.jsx)(o,{className:`h-4 w-4`}):(0,O.jsx)(a,{className:`h-4 w-4`})}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-sm font-medium text-gray-950`,children:e.label}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.done?`Complete`:`In progress`})]})]},e.label))}),(0,O.jsxs)(u,{children:[(0,O.jsx)(s,{children:(0,O.jsx)(f,{className:`text-lg`,children:t?`Sandbox executed state`:`Sandbox buyer complete state`})}),(0,O.jsx)(l,{className:`text-sm text-muted-foreground`,children:t?`This mimics the completed portal state. No final PDF was generated and no next-step activity was logged.`:`This mimics the buyer-complete state while the packet waits for seller counter-signature.`})]})]})}var I={conflictsByField:new Map,editorsByField:new Map,lastSavedByField:new Map,resolveConflictWithCurrent:()=>void 0,sendBlur:()=>void 0,sendFocus:()=>void 0,sendValueChange:()=>void 0,viewers:[]};function L(e){return`quote-portal-sandbox-progress:${e}`}function R(e){return e===`seller`?`seller`:`buyer`}
1function z(e){return e.startsWith(`recipient:`)?[e.slice(10)]:[]}function B(e){if(!e)return null;let t=sessionStorage.getItem(L(e));if(!t)return null;try{return JSON.parse(t)}catch{return null}}function V(e){return e.response||{acknowledged:!1,values:{}}}function H(e,t){return{assigned_email:t?.assigned_email||null,assigned_phone:t?.assigned_phone||null,display_name:t?.display_name||`Sandbox ${e===`buyer`?`Buyer`:`Seller`}`,id:e===`buyer`?-1001:-1002,signer_kind:t?.signer_kind||(e===`buyer`?`external_contact`:`internal_user`),stage:e}}function U(e,t){let n=e===`buyer`&&t===`buyer`||e===`seller`&&t===`seller`;return{access_mode:e===`buyer`||e===`readonly`?`buyer_magic_link`:`recipient_magic_link`,audience:`full_portal`,read_only:e===`readonly`,blocking_reason:null,blocking_reason_code:null,can_download_final_document:!1,can_reveal_contract:!0,can_sign_current_stage:n,editable_recipient_role_keys:z(e),is_assigned_signer:n,viewer_display_name:`Sandbox ${e===`readonly`?`viewer`:`tester`}`}}function W(e){return{...e.baseContext,buyer_assignment:H(`buyer`,e.baseContext.buyer_assignment),buyer_intent_shown_at:e.baseContext.buyer_intent_shown_at||new Date().toISOString(),contract_is_revealed:!0,contract_packet:e.packet,current_stage:e.stage,final_document:e.stage===`completed`?{id:-1,download_filename:`sandbox-final-contract.pdf`,file_size:0,generated_at:new Date().toISOString(),page_count:e.packet.page_count}:null,quote:{...e.baseContext.quote,approved_at:e.baseContext.quote.approved_at||(e.stage===`seller`?new Date().toISOString():null),status:e.stage===`completed`?`executed`:e.stage===`seller`?`awaiting_counter_signature`:`pending`},seller_assignment:H(`seller`,e.baseContext.seller_assignment),signatures:[],viewer:U(e.role,e.stage)}}function G(e){let n=(0,D.useRef)(null),r=(0,D.useMemo)(()=>B(e.sessionId),[e.sessionId]),[i,a]=(0,D.useState)(r?.role||`buyer`),[o,s]=(0,D.useState)(r?.stage||R(i)),[c,l]=(0,D.useState)(r?.contractResponse||V(e.packet)),[u,f]=(0,D.useState)(r?.signatures||{}),[p,g]=(0,D.useState)(!1),[v,y]=(0,D.useState)(null),[b,x]=(0,D.useState)(r?.signatureReceipt||null),[S,C]=(0,D.useState)(`contract`);(0,D.useEffect)(()=>{if(!e.sessionId)return;let t={contractResponse:c,role:i,signatureReceipt:b,signatures:u,stage:o};sessionStorage.setItem(L(e.sessionId),JSON.stringify(t))},[c,u,e.sessionId,i,b,o]);let k=W({baseContext:e.portalContext,packet:e.packet,role:i,stage:o});function A(e){return n.current?.querySelector(e)}function j(e){a(e),e!==`readonly`&&(s(R(e)),x(null)),y(null),g(!1)}function M(){e.sessionId&&sessionStorage.removeItem(L(e.sessionId)),a(`buyer`),s(`buyer`),l(V(e.packet)),f({}),x(null),y(null),g(!1)}function P(){if(o===`completed`||i!==o)return;let t=w({packet:e.packet,response:c,stage:o});if(t){y(t.message),A(`[data-testid="${t.targetTestId}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`});return}let n=o;if(!u[n]){y(`Apply a sandbox ${n} signature before completing this stage.`);return}let r=new Date().toISOString(),l=o===`buyer`?`seller`:`completed`;x({certificate_id:`sandbox-${o}-${Date.now()}`,next_stage:l,signed_at:r,signed_stage:n}),s(l),a(l===`seller`?`seller`:`readonly`),y(null)}function z(){let t=w({packet:e.packet,response:c,stage:o});if(t){y(t.message),A(`[data-testid="${t.targetTestId}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`});return}y(null),g(!0)}return(0,O.jsxs)(_,{className:e.compact?`h-full`:void 0,contentRef:n,"data-testid":e.testId,padding:`none`,shellClassName:`bg-gray-50`,width:`full`,children:[(0,O.jsx)(N,{compact:e.compact,onCompleteStage:P,onReset:M,onRoleChange:j,packet:e.packet,returnHref:e.returnHref||null,role:i,stage:o}),e.compact?null:(0,O.jsxs)(d,{className:`mx-auto mt-4 max-w-5xl border-blue-200 bg-blue-50`,children:[(0,O.jsx)(t,{className:`h-5 w-5 text-brand-primary`}),(0,O.jsx)(h,{className:`text-blue-900`,children:`Sandbox session`}),(0,O.jsx)(m,{className:`text-blue-800`,children:`Fill fields, switch roles, and apply signatures here. Progress is stored only in this browser tab session.`})]}),(0,O.jsx)(E,{activePortalTab:S,approvalError:null,buyerSignatureResetError:null,collaboration:I,comments:[],contractResponse:c,isApprovalPending:!1,isBuyerSignatureResetPending:!1,isCommentPending:!1,isCommentPlacementMode:!1,isCommentsPanelOpen:!1,isMobileCommentsOpen:!1,isRevealPending:!1,isSavingPortalAddress:!1,isSignaturePending:!1,isDiscountProgramSelectionPending:!1,mentionableRecipients:[],onApproveQuote:()=>void 0,onBeginAnchorComment:()=>void 0,onCancelAnchorComment:()=>void 0,onCloseCommentsPanel:()=>void 0,onCloseMobileComments:()=>void 0,onCloseSignatureCapture:()=>g(!1),onCommentAnchorClick:()=>void 0,onContractFieldChange:(e,t)=>
1{y(null),l(n=>({...n,values:{...n.values,[e]:t}}))},onCreateComment:()=>void 0,onDeleteComment:()=>void 0,onDocumentView:()=>void 0,onDownloadFinalDocument:()=>y(`Sandbox final documents are not generated or downloaded.`),onJumpToCommentAnchor:e=>{C(T(e)),A(`[data-comment-anchor="${e.anchor_type}:${e.anchor_id}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`})},onMarkCommentsRead:()=>void 0,onPortalTabChange:C,onPrintExhibitA:()=>y(`Sandbox Exhibit A PDFs are not generated or downloaded.`),onReplyComment:()=>void 0,onResetBuyerSignature:()=>void 0,onRevealContract:()=>void 0,onSavePortalAddress:async e=>({sandbox:!0}),onSignatureFieldClick:z,onDiscountProgramSelectionChange:()=>void 0,onSubmitSignature:e=>{(o===`buyer`||o===`seller`)&&f(t=>({...t,[o]:e})),g(!1),y(null)},onToggleComments:()=>void 0,onUpdateCommentStatus:()=>void 0,optimisticSignatures:u,portalAddressBooks:e.portalAddressBooks,portalContext:k,readCommentIds:new Set,revealError:null,selectedCommentAnchor:null,showSignatureCapture:p,signatureBlockMessage:v,signatureError:null,signatureReceipt:b,discountProgramSelectionError:null}),(0,O.jsx)(F,{stage:o})]})}export{G as t};

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.