import { h } from "@stencil/core";
import { SignatureXIcon } from "../../../utils/Icons";
/**
 * Display a dialog that allows the user to specify a signature image, either by using a signature-font-generated image
 * based on their full name, or by hand-drawing their signature with a mouse or tablet.
 */
export class VerdocsAdoptSignatureDialog {
    constructor() {
        /**
         * Initial signature text
         */
        this.name = '';
        /**
         * If true, the name fields will be read-only. Used when the sender has locked the recipient's name.
         */
        this.nameLocked = false;
        this.fontLoaded = false;
        this.enteredName = '';
        this.enteredInitials = '';
        this.mode = 'type';
        this.isDrawing = false;
        this.hasDrawnSignature = false;
        this.hasDrawnInitials = false;
        this.currentSigStroke = [];
        this.allSigStrokes = [];
        this.lastSigPoint = null;
        this.currentInitialsStroke = [];
        this.allInitialsStrokes = [];
        this.lastInitialsPoint = null;
        this.handleSigPointerDown = (e) => {
            e.preventDefault();
            if (!this.signatureElement || !this.sigDrawingContext) {
                return;
            }
            this.isDrawing = true;
            this.hasDrawnSignature = true;
            const point = this.getSigCanvasCoordinates(e);
            this.currentSigStroke = [point];
            this.lastSigPoint = point;
            // Start a new path
            this.sigDrawingContext.beginPath();
            this.sigDrawingContext.moveTo(point.x, point.y);
            // Capture pointer to ensure we get all events even if pointer leaves canvas
            this.signatureElement.setPointerCapture(e.pointerId);
        };
        this.handleSigPointerMove = (e) => {
            e.preventDefault();
            if (!this.isDrawing || !this.sigDrawingContext || !this.lastSigPoint) {
                return;
            }
            const point = this.getSigCanvasCoordinates(e);
            this.currentSigStroke.push(point);
            // Use quadratic curves for smooth drawing
            // The control point is the last point, and we draw to the midpoint
            const midPoint = {
                x: (this.lastSigPoint.x + point.x) / 2,
                y: (this.lastSigPoint.y + point.y) / 2,
            };
            this.sigDrawingContext.quadraticCurveTo(this.lastSigPoint.x, this.lastSigPoint.y, midPoint.x, midPoint.y);
            this.sigDrawingContext.stroke();
            this.lastSigPoint = point;
        };
        this.handleSigPointerUp = (e) => {
            e.preventDefault();
            if (!this.isDrawing || !this.sigDrawingContext) {
                return;
            }
            // Complete the stroke
            if (this.lastSigPoint && this.currentSigStroke.length > 0) {
                this.sigDrawingContext.lineTo(this.lastSigPoint.x, this.lastSigPoint.y);
                this.sigDrawingContext.stroke();
            }
            // Save the completed stroke
            if (this.currentSigStroke.length > 0) {
                this.allSigStrokes.push([...this.currentSigStroke]);
            }
            this.isDrawing = false;
            this.currentSigStroke = [];
            this.lastSigPoint = null;
            // Release pointer capture
            if (this.signatureElement) {
                this.signatureElement.releasePointerCapture(e.pointerId);
            }
        };
        this.handleSigPointerCancel = (e) => {
            // Handle cases where drawing is interrupted (e.g., phone call, notification)
            this.isDrawing = false;
            this.currentSigStroke = [];
            this.lastSigPoint = null;
            if (this.signatureElement) {
                this.signatureElement.releasePointerCapture(e.pointerId);
            }
        };
        this.handleInitialsPointerDown = (e) => {
            e.preventDefault();
            if (!this.initialsElement || !this.initialsDrawingContext) {
                return;
            }
            this.isDrawing = true;
            this.hasDrawnInitials = true;
            const point = this.getInitialsCanvasCoordinates(e);
            this.currentInitialsStroke = [point];
            this.lastInitialsPoint = point;
            // Start a new path
            this.initialsDrawingContext.beginPath();
            this.initialsDrawingContext.moveTo(point.x, point.y);
            // Capture pointer to ensure we get all events even if pointer leaves canvas
            this.initialsElement.setPointerCapture(e.pointerId);
        };
        this.handleInitialsPointerMove = (e) => {
            e.preventDefault();
            if (!this.isDrawing || !this.initialsDrawingContext || !this.lastInitialsPoint) {
                return;
            }
            const point = this.getInitialsCanvasCoordinates(e);
            this.currentInitialsStroke.push(point);
            // Use quadratic curves for smooth drawing
            // The control point is the last point, and we draw to the midpoint
            const midPoint = {
                x: (this.lastInitialsPoint.x + point.x) / 2,
                y: (this.lastInitialsPoint.y + point.y) / 2,
            };
            this.initialsDrawingContext.quadraticCurveTo(this.lastInitialsPoint.x, this.lastInitialsPoint.y, midPoint.x, midPoint.y);
            this.initialsDrawingContext.stroke();
            this.lastInitialsPoint = point;
        };
        this.handleInitialsPointerUp = (e) => {
            e.preventDefault();
            if (!this.isDrawing || !this.initialsDrawingContext) {
                return;
            }
            // Complete the stroke
            if (this.lastInitialsPoint && this.currentInitialsStroke.length > 0) {
                this.initialsDrawingContext.lineTo(this.lastInitialsPoint.x, this.lastInitialsPoint.y);
                this.initialsDrawingContext.stroke();
            }
            // Save the completed stroke
            if (this.currentInitialsStroke.length > 0) {
                this.allInitialsStrokes.push([...this.currentInitialsStroke]);
            }
            this.isDrawing = false;
            this.currentInitialsStroke = [];
            this.lastInitialsPoint = null;
            // Release pointer capture
            if (this.initialsElement) {
                this.initialsElement.releasePointerCapture(e.pointerId);
            }
        };
        this.handleInitialsPointerCancel = (e) => {
            // Handle cases where drawing is interrupted (e.g., phone call, notification)
            this.isDrawing = false;
            this.currentInitialsStroke = [];
            this.lastInitialsPoint = null;
            if (this.initialsElement) {
                this.initialsElement.releasePointerCapture(e.pointerId);
            }
        };
    }
    componentWillLoad() {
        this.enteredName = this.name;
        this.computeEnteredInitials(this.name);
        const ds = new FontFace('Dancing Script', 'url(https://fonts.gstatic.com/s/dancingscript/v19/If2cXTr6YS-zF4S-kcSWSVi_sxjsohD9F50Ruu7BMSo3Sup6hNX6plRP.woff)');
        ds.load().then(font => {
            document.fonts.add(font);
            this.fontLoaded = true;
        });
    }
    componentDidLoad() {
        this.drawSignatureText();
        this.drawInitialsText();
        this.setupSignatureCanvas();
        this.setupInitialsCanvas();
    }
    componentDidUpdate() {
        this.drawSignatureText();
        this.drawInitialsText();
        this.setupSignatureCanvas();
        this.setupInitialsCanvas();
        // Redraw drawn signature when in draw mode
        if (this.mode === 'draw' && this.allSigStrokes.length > 0) {
            this.redrawDrawnSignature();
        }
        if (this.mode === 'draw' && this.allInitialsStrokes.length > 0) {
            this.redrawDrawnInitials();
        }
    }
    drawSignatureText() {
        if (!this.signatureElement || this.mode !== 'type') {
            return;
        }
        const sigCanvasWidth = this.signatureElement.width;
        const sigCanvasHeight = this.signatureElement.height;
        const sigContext = this.signatureElement.getContext('2d');
        sigContext.clearRect(0, 0, this.signatureElement.width, this.signatureElement.height);
        let fontSize = 100;
        let metrics = sigContext.measureText(this.enteredName);
        do {
            fontSize -= 2;
            sigContext.font = `${fontSize}px Dancing Script`;
            metrics = sigContext.measureText(this.enteredName);
        } while (metrics.width > sigCanvasWidth - 24 || metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent + 24 > sigCanvasHeight);
        sigContext.textAlign = 'center';
        sigContext.textBaseline = 'middle';
        sigContext.font = `${fontSize}px Dancing Script`;
        sigContext.fillText(this.enteredName, this.signatureElement.width / 2, this.signatureElement.height / 2);
    }
    drawInitialsText() {
        if (!this.initialsElement || this.mode !== 'type') {
            return;
        }
        const initialsCanvasWidth = this.initialsElement.width;
        const initialsCanvasHeight = this.initialsElement.height;
        const context = this.initialsElement.getContext('2d');
        context.clearRect(0, 0, this.initialsElement.width, this.initialsElement.height);
        let fontSize = 100;
        let metrics = context.measureText(this.enteredInitials);
        do {
            fontSize -= 2;
            context.font = `${fontSize}px Dancing Script`;
            metrics = context.measureText(this.enteredInitials);
        } while (metrics.width > initialsCanvasWidth - 24 || metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent + 24 > initialsCanvasHeight);
        context.textAlign = 'center';
        context.textBaseline = 'middle';
        context.font = `${fontSize}px Dancing Script`;
        context.fillText(this.enteredInitials, this.initialsElement.width / 2, this.initialsElement.height / 2);
    }
    redrawDrawnSignature() {
        if (!this.signatureElement || !this.sigDrawingContext || this.allSigStrokes.length === 0) {
            return;
        }
        // Clear the canvas first
        this.sigDrawingContext.clearRect(0, 0, this.signatureElement.width, this.signatureElement.height);
        // Redraw all strokes
        for (const stroke of this.allSigStrokes) {
            if (stroke.length === 0) {
                continue;
            }
            // Start the path at the first point
            this.sigDrawingContext.beginPath();
            this.sigDrawingContext.moveTo(stroke[0].x, stroke[0].y);
            // Draw smooth curves through all points in the stroke
            for (let i = 1; i < stroke.length; i++) {
                const currentPoint = stroke[i];
                const previousPoint = stroke[i - 1];
                // Use quadratic curves for smooth lines
                const midPoint = {
                    x: (previousPoint.x + currentPoint.x) / 2,
                    y: (previousPoint.y + currentPoint.y) / 2,
                };
                this.sigDrawingContext.quadraticCurveTo(previousPoint.x, previousPoint.y, midPoint.x, midPoint.y);
            }
            // Draw to the last point
            if (stroke.length > 1) {
                const lastPoint = stroke[stroke.length - 1];
                this.sigDrawingContext.lineTo(lastPoint.x, lastPoint.y);
            }
            this.sigDrawingContext.stroke();
        }
    }
    redrawDrawnInitials() {
        if (!this.initialsElement || !this.initialsDrawingContext || this.allInitialsStrokes.length === 0) {
            return;
        }
        // Clear the canvas first
        this.initialsDrawingContext.clearRect(0, 0, this.initialsElement.width, this.initialsElement.height);
        // Redraw all strokes
        for (const stroke of this.allInitialsStrokes) {
            if (stroke.length === 0) {
                continue;
            }
            // Start the path at the first point
            this.initialsDrawingContext.beginPath();
            this.initialsDrawingContext.moveTo(stroke[0].x, stroke[0].y);
            // Draw smooth curves through all points in the stroke
            for (let i = 1; i < stroke.length; i++) {
                const currentPoint = stroke[i];
                const previousPoint = stroke[i - 1];
                // Use quadratic curves for smooth lines
                const midPoint = {
                    x: (previousPoint.x + currentPoint.x) / 2,
                    y: (previousPoint.y + currentPoint.y) / 2,
                };
                this.initialsDrawingContext.quadraticCurveTo(previousPoint.x, previousPoint.y, midPoint.x, midPoint.y);
            }
            // Draw to the last point
            if (stroke.length > 1) {
                const lastPoint = stroke[stroke.length - 1];
                this.initialsDrawingContext.lineTo(lastPoint.x, lastPoint.y);
            }
            this.initialsDrawingContext.stroke();
        }
    }
    handleNameChange(e) {
        this.enteredName = e.target.value;
        this.computeEnteredInitials(e.target.value);
    }
    computeEnteredInitials(name) {
        const nameComponents = name
            .trim()
            .split(' ')
            .filter(part => part.length > 0);
        this.enteredInitials = nameComponents.length > 1 ? nameComponents.map(word => word.charAt(0).toUpperCase()).join('') : nameComponents[0].toUpperCase();
    }
    handleCancel(e) {
        e.stopPropagation();
        e.preventDefault();
        this.exit.emit();
    }
    handleAdopt(e) {
        e.stopPropagation();
        e.preventDefault();
        const signature = this.signatureElement.toDataURL('image/png');
        const initials = this.initialsElement.toDataURL('image/png');
        this.next.emit({ signature, initials });
    }
    isAdoptButtonDisabled() {
        switch (this.mode) {
            case 'type':
                // Disable if no name has been entered
                return !this.enteredName || this.enteredName.trim().length === 0;
            case 'draw':
                // Disable if nothing has been drawn
                return (!this.hasDrawnSignature && !this.hasDrawnInitials) || this.allSigStrokes.length === 0 || this.allInitialsStrokes.length === 0;
            default:
                return true;
        }
    }
    setupSignatureCanvas() {
        if (!this.signatureElement) {
            return;
        }
        // Set up drawing context when in draw mode
        if (this.mode === 'draw') {
            // Always get fresh context from the current canvas element
            const sigContext = this.signatureElement.getContext('2d');
            // Only initialize if we don't have a context or it's different
            if (sigContext && sigContext !== this.sigDrawingContext) {
                this.sigDrawingContext = sigContext;
                // Configure drawing style for smooth signatures
                this.sigDrawingContext.strokeStyle = '#000000';
                this.sigDrawingContext.lineWidth = 2;
                this.sigDrawingContext.lineCap = 'round';
                this.sigDrawingContext.lineJoin = 'round';
                // Clear canvas only if there are no existing strokes
                if (this.allSigStrokes.length === 0) {
                    this.sigDrawingContext.clearRect(0, 0, this.signatureElement.width, this.signatureElement.height);
                }
            }
        }
        // Reset drawing context when switching away from draw mode
        // NOTE: We don't clear allStrokes here so drawing persists when returning to draw mode
        if (this.mode !== 'draw' && this.sigDrawingContext) {
            this.sigDrawingContext = null;
            this.currentSigStroke = [];
            this.lastSigPoint = null;
        }
    }
    setupInitialsCanvas() {
        if (!this.initialsElement) {
            return;
        }
        // Set up drawing context when in draw mode
        if (this.mode === 'draw') {
            // Always get fresh context from the current canvas element
            const initialsContext = this.initialsElement.getContext('2d');
            // Only initialize if we don't have a context or it's different
            if (initialsContext && initialsContext !== this.initialsDrawingContext) {
                this.initialsDrawingContext = initialsContext;
                // Configure drawing style for smooth signatures
                this.initialsDrawingContext.strokeStyle = '#000000';
                this.initialsDrawingContext.lineWidth = 2;
                this.initialsDrawingContext.lineCap = 'round';
                this.initialsDrawingContext.lineJoin = 'round';
                // Clear canvas only if there are no existing strokes
                if (this.allInitialsStrokes.length === 0) {
                    this.initialsDrawingContext.clearRect(0, 0, this.initialsElement.width, this.initialsElement.height);
                }
            }
        }
        // Reset drawing context when switching away from draw mode
        // NOTE: We don't clear allStrokes here so drawing persists when returning to draw mode
        if (this.mode !== 'draw' && this.initialsDrawingContext) {
            this.initialsDrawingContext = null;
            this.currentInitialsStroke = [];
            this.lastInitialsPoint = null;
        }
    }
    clearSignatureCanvas() {
        if (!this.signatureElement || !this.sigDrawingContext) {
            return;
        }
        this.sigDrawingContext.clearRect(0, 0, this.signatureElement.width, this.signatureElement.height);
        this.currentSigStroke = [];
        this.allSigStrokes = [];
        this.lastSigPoint = null;
        this.hasDrawnSignature = false;
    }
    clearInitialsCanvas() {
        if (!this.initialsElement || !this.initialsDrawingContext) {
            return;
        }
        this.initialsDrawingContext.clearRect(0, 0, this.initialsElement.width, this.initialsElement.height);
        this.currentInitialsStroke = [];
        this.allInitialsStrokes = [];
        this.lastInitialsPoint = null;
        this.hasDrawnInitials = false;
    }
    handleClearDrawing(e, type = 'all') {
        e.stopPropagation();
        e.preventDefault();
        if (type === 'all' || type === 'signature')
            this.clearSignatureCanvas();
        if (type === 'all' || type === 'initials')
            this.clearInitialsCanvas();
    }
    getSigCanvasCoordinates(e) {
        if (!this.signatureElement) {
            return { x: 0, y: 0 };
        }
        const rect = this.signatureElement.getBoundingClientRect();
        // Calculate the scale factor between canvas size and display size
        const scaleX = this.signatureElement.width / rect.width;
        const scaleY = this.signatureElement.height / rect.height;
        return {
            x: (e.clientX - rect.left) * scaleX,
            y: (e.clientY - rect.top) * scaleY,
        };
    }
    getInitialsCanvasCoordinates(e) {
        if (!this.initialsElement) {
            return { x: 0, y: 0 };
        }
        const rect = this.initialsElement.getBoundingClientRect();
        // Calculate the scale factor between canvas size and display size
        const scaleX = this.initialsElement.width / rect.width;
        const scaleY = this.initialsElement.height / rect.height;
        return {
            x: (e.clientX - rect.left) * scaleX,
            y: (e.clientY - rect.top) * scaleY,
        };
    }
    render() {
        return (h("verdocs-dialog", { key: '462948fa67d1a3e32c0fdd03d0183f8b822eb312' }, h("div", { key: 'f05a30ae50b16934a983f29b2d27ddfc4b3fb3b4', slot: "heading", class: "heading" }, "Adopt Your Signature"), h("div", { key: '1a2aa7ace11493961d251ad6bc6ce3406a625532', slot: "content", class: "content" }, h("div", { key: 'd4f11c53451ce55c875320829016bf3a7009b8dc', style: { fontWeight: '300', color: '#242424', fontSize: '13px' } }, "Confirm your name, initials, and signature."), h("div", { key: '5bd2c07de6a5f3f4e31d308c62d4f8805822fcf9', class: { type: true, active: this.mode === 'type' } }, h("verdocs-text-input", { key: '1d6a6a26e1cd66442d7a4d44040a41d66251de55', label: "Full Name", value: this.enteredName, disabled: this.nameLocked, onInput: e => this.handleNameChange(e), onClick: e => e.stopPropagation() }), this.nameLocked && h("div", { key: '2a839a7f0791dc5af3154471f7730f0f23e1cf36', class: "name-locked-hint" }, "Your name has been set by the sender and cannot be changed.")), h("div", { key: '6090f63b7bb0be98a9cc02705dd2cc2d4e573d3c', style: { fontWeight: '400', color: '#242424', fontSize: '13px' } }, "Select a signature style"), h("div", { key: '4ff274227aad18cb5ba62ee876bbb848cca8c111', style: { display: 'flex', flexDirection: 'row', gap: '10px', marginBottom: '6px', alignItems: 'center', fontSize: '13px' } }, h("verdocs-radio-button", { key: '6d8c8784e20426fc4cab54aaf1f4d976872b49b1', checked: this.mode === 'type', value: "type", name: "mode", onClick: () => (this.mode = 'type') }), h("label", { key: 'c787fadf3e94998050c4d43d30d5a7f84baaaea1' }, "Typed with a keyboard")), h("div", { key: 'c7b02e786ef4538621f4adae37ed2087ab176b5b', style: { display: 'flex', flexDirection: 'row', gap: '10px', marginBottom: '6px', alignItems: 'center', fontSize: '13px' } }, h("verdocs-radio-button", { key: 'fcf483b47ee7b4031ab0e5d46ae38e3761193441', checked: this.mode === 'draw', value: "draw", name: "mode", onClick: () => (this.mode = 'draw') }), h("label", { key: '16c6f4fabb564512fc757685d31aadbdd7723ace' }, "Drawn with touch, mouse, or stylus")), h("div", { key: 'c9e059fff254d2654f6fac9afae61c2849a72926', class: "preview-header" }, h("div", { key: '396b8d70757e4c976ed946c0c4dee93c1adf41db', style: { fontSize: '13px', fontWeight: '400' } }, "Signature Preview"), this.mode === 'draw' && (h("button", { key: '4eabebe8916e28e42011a5d5c5a70fe114179df7', class: "clear-button-text", onClick: e => this.handleClearDrawing(e, 'signature'), disabled: !this.hasDrawnSignature }, "Clear"))), h("div", { key: 'c6749bfdef5f26df049c6e54384b528a38f4a8b7', class: "canvas-container signature-container" }, h("div", { key: 'eb76bcb4ab6a18c9ba361f466a21a26552687983', class: "signing-indicator" }, h("div", { key: 'db9ad8803a7d74319a84d16ae5ac5b82316d9d85', class: "x-icon", innerHTML: SignatureXIcon }), h("div", { key: '72c51304ffe3ebd8d7cce0cc3baa8bca002961d2', class: "signing-line" })), h("canvas", { key: 'e795c8fc32ad3dd0dcdffb67915db3c26e7eeeb4', ref: el => (this.signatureElement = el),
            // width="300"
            height: "79", class: "signature-canvas", onPointerDown: this.handleSigPointerDown, onPointerMove: this.handleSigPointerMove, onPointerUp: this.handleSigPointerUp, onPointerCancel: this.handleSigPointerCancel, style: { touchAction: 'none', cursor: 'crosshair' } })), h("div", { key: 'a9987ec211baaaa01288dde3ffc061d0372cd7f3', class: "preview-header" }, h("div", { key: '97d1a8462f2d9c272580cf6049ae72017f20b158', style: { fontSize: '13px', fontWeight: '400' } }, "Initials Preview"), this.mode === 'draw' && (h("button", { key: '61f91899f09cbc2dac6d89daa3e9ec1617df7b9c', class: "clear-button-text", onClick: e => this.handleClearDrawing(e, 'initials'), disabled: !this.hasDrawnInitials }, "Clear"))), h("div", { key: 'b09b7f23218b4747dedcfe9d40b912263bea907a', class: "canvas-container initials-container" }, h("div", { key: '35c2b9b40ab5077895f567a922a1b48e86dde3cf', class: "signing-indicator" }, h("div", { key: 'dca3b7841d1b0c6c5ffa1d127ffe9acd048b7715', class: "x-icon", innerHTML: SignatureXIcon }), h("div", { key: '54d0f42b043bdebca98fbde793d91deaa39068ec', class: "signing-line" })), h("canvas", { key: '2449706db1331aa7835ddcf2cf0f910ac0f5f4a6', ref: el => (this.initialsElement = el),
            // width="300"
            height: "79", class: "initials-canvas", onPointerDown: this.handleInitialsPointerDown, onPointerMove: this.handleInitialsPointerMove, onPointerUp: this.handleInitialsPointerUp, onPointerCancel: this.handleInitialsPointerCancel, style: { touchAction: 'none', cursor: 'crosshair' } })), h("div", { key: '4cc74908b230f05762bbbc92f082b68f1d0298d3', class: "disclaimer" }, "By clicking \u00ABAdopt Signature\u00BB, I agree that the signature and initials above will be the electronic representation of my signature and initials for all purposes when I use them to sign documents. Applying them to a document is legally equivalent to signing with a pen on paper.")), h("div", { key: 'dbbee3f80aa7a0f6862ef4920b3edcc493313c80', class: "footer", slot: "footer" }, h("div", { key: '44f060db31afd99c8b5b1b4d4ac2734dea70cb04', class: "buttons" }, h("button", { key: 'af6c0a693f3576184e7c1fb4235403da1b3db9cf', class: "cancel", onClick: e => this.handleCancel(e) }, "Cancel"), h("button", { key: '9283607fa5c94acd924dbfd363073664a5b9d037', class: "proceed", onClick: e => this.handleAdopt(e), disabled: this.isAdoptButtonDisabled() }, "Adopt & Sign")))));
    }
    static get is() { return "verdocs-adopt-signature-dialog"; }
    static get originalStyleUrls() {
        return {
            "$": ["verdocs-adopt-signature-dialog.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["verdocs-adopt-signature-dialog.css"]
        };
    }
    static get properties() {
        return {
            "name": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Initial signature text"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "name",
                "defaultValue": "''"
            },
            "nameLocked": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If true, the name fields will be read-only. Used when the sender has locked the recipient's name."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "name-locked",
                "defaultValue": "false"
            }
        };
    }
    static get states() {
        return {
            "fontLoaded": {},
            "enteredName": {},
            "enteredInitials": {},
            "mode": {},
            "isDrawing": {},
            "hasDrawnSignature": {},
            "hasDrawnInitials": {}
        };
    }
    static get events() {
        return [{
                "method": "next",
                "name": "next",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Fired when the user completes the dialog and clicks Adopt. The event detail will contain a base64-encoded string\nrepresentation of the signature adopted."
                },
                "complexType": {
                    "original": "{signature: string; initials: string}",
                    "resolved": "{ signature: string; initials: string; }",
                    "references": {}
                }
            }, {
                "method": "exit",
                "name": "exit",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name."
                },
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                }
            }];
    }
}
//# sourceMappingURL=verdocs-adopt-signature-dialog.js.map
