Changeset 3428303
- Timestamp:
- 12/27/2025 02:56:45 PM (3 months ago)
- Location:
- formative
- Files:
-
- 23 added
- 4 deleted
- 8 edited
-
tags/1.0.1 (added)
-
tags/1.0.1/README.md (added)
-
tags/1.0.1/build (added)
-
tags/1.0.1/build/admin-rtl.css (added)
-
tags/1.0.1/build/admin.asset.php (added)
-
tags/1.0.1/build/admin.css (added)
-
tags/1.0.1/build/admin.js (added)
-
tags/1.0.1/build/frontend-rtl.css (added)
-
tags/1.0.1/build/frontend.asset.php (added)
-
tags/1.0.1/build/frontend.css (added)
-
tags/1.0.1/build/frontend.js (added)
-
tags/1.0.1/formative.php (added)
-
tags/1.0.1/includes (added)
-
tags/1.0.1/includes/API (added)
-
tags/1.0.1/includes/API/Base_Controller.php (added)
-
tags/1.0.1/includes/API/Entries_Controller.php (added)
-
tags/1.0.1/includes/API/Forms_Controller.php (added)
-
tags/1.0.1/includes/API/Settings_Controller.php (added)
-
tags/1.0.1/includes/Installer.php (added)
-
tags/1.0.1/includes/Plugin.php (added)
-
tags/1.0.1/package.json (added)
-
tags/1.0.1/readme.txt (added)
-
trunk/README.md (added)
-
trunk/build/admin-rtl.css (modified) (1 diff)
-
trunk/build/admin.asset.php (modified) (1 diff)
-
trunk/build/admin.css (modified) (1 diff)
-
trunk/build/admin.js (modified) (1 diff)
-
trunk/build/blocks (deleted)
-
trunk/formative.php (modified) (2 diffs)
-
trunk/includes/Plugin.php (modified) (4 diffs)
-
trunk/languages (deleted)
-
trunk/package-lock.json (deleted)
-
trunk/package.json (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/src (deleted)
Legend:
- Unmodified
- Added
- Removed
-
formative/trunk/build/admin-rtl.css
r3426920 r3428303 1 .formative-admin-wrapper{background:#f0f0f1;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;margin:0 -22px 0 -20px;min-height:100vh}.formative-admin-header{align-items:center;background:#fff;border-bottom:1px solid #ddd;box-shadow:0 1px 3px rgba(0,0,0,.05);display:flex;justify-content:space-between;padding:16px 32px}.formative-logo{align-items:center;display:flex;font-size:24px;font-weight:600;gap:12px;margin:0}.formative-logo-icon{font-size:28px}.formative-version{color:#999;font-size:12px}.formative-admin-container{display:flex;min-height:calc(100vh - 65px)}.formative-admin-sidebar{background:#fff;border-left:1px solid #ddd;padding:20px 0;width:240px}.formative-admin-nav{display:flex;flex-direction:column}.formative-nav-item{align-items:center;border-right:3px solid transparent;color:#333;display:flex;gap:12px;padding:12px 24px;text-decoration:none;transition:all .2s}.formative-nav-item:hover{background:#f5f5f5;color:#0073aa}.formative-nav-item.active{background:#f0f6fc;border-right-color:#0073aa;color:#0073aa;font-weight:500}.formative-nav-icon{font-size:18px}.formative-admin-content{flex:1;max-width:1400px;padding:32px}.formative-page-header{align-items:center;display:flex;justify-content:space-between;margin-bottom:24px}.formative-page-header h1{font-size:28px;font-weight:600;margin:0}.formative-stats-grid{display:grid;gap:20px;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));margin-bottom:32px}.formative-stat-card{align-items:center;background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);display:flex;gap:16px;padding:24px}.formative-stat-icon{font-size:36px}.formative-stat-value{color:#0073aa;font-size:32px;font-weight:700}.formative-stat-label{color:#666;font-size:14px}.formative-dashboard-sections{display:grid;gap:24px;grid-template-columns:repeat(auto-fit,minmax(400px,1fr))}.formative-dashboard-section{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);padding:24px}.formative-dashboard-section h2{font-size:18px;font-weight:600;margin:0 0 16px}.formative-recent-list{display:flex;flex-direction:column;gap:12px}.formative-recent-item{background:#f9f9f9;border-radius:4px;padding:12px}.formative-recent-title{font-weight:500;margin-bottom:4px}.formative-recent-meta{color:#666;font-size:12px}.formative-table-wrapper{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);overflow:hidden}.formative-table{border-collapse:collapse;width:100%}.formative-table th{background:#f5f5f5;border-bottom:2px solid #ddd;font-weight:600;padding:16px;text-align:right}.formative-table td{border-bottom:1px solid #eee;padding:16px}.formative-table-actions{display:flex;gap:12px}.formative-shortcode-cell{align-items:center;display:flex;gap:8px}.formative-shortcode-cell code{background:#f5f5f5;border-radius:4px;color:#d63638;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:12px;padding:4px 8px}.formative-shortcode-cell button{flex-shrink:0}.formative-preview-modal .components-modal__content{padding:0}.formative-preview-modal .components-modal__header{border-bottom:1px solid #ddd}.formative-form-preview{max-height:70vh;overflow-y:auto;padding:20px}.formative-form-preview .formative-form{margin:0 auto;max-width:600px}.formative-form-preview .formative-field-wrapper{margin-bottom:20px}.formative-form-preview .formative-field-label{color:#1e1e1e;display:block;font-size:14px;font-weight:600;margin-bottom:8px}.formative-form-preview .formative-required{color:#d63638;margin-right:3px}.formative-form-preview .formative-input,.formative-form-preview .formative-select,.formative-form-preview .formative-textarea{background:#f9f9f9;border:1px solid #ddd;border-radius:4px;font-size:14px;padding:10px 12px;width:100%}.formative-form-preview .formative-textarea{min-height:100px;resize:vertical}.formative-form-preview .formative-field-help{color:#757575;font-size:12px;margin-top:5px}.formative-form-preview .formative-checkbox-group,.formative-form-preview .formative-radio-group{display:flex;flex-direction:column;gap:8px}.formative-form-preview .formative-checkbox-label,.formative-form-preview .formative-radio-label{align-items:center;display:flex;gap:8px}.formative-form-preview .formative-submit-button{background:#007cba;border:none;border-radius:4px;color:#fff;cursor:not-allowed;font-size:16px;font-weight:500;opacity:.7;padding:12px 24px}.formative-modal-footer{padding:16px 20px}.formative-pagination{align-items:center;display:flex;gap:16px;justify-content:center;margin-top:24px}.formative-empty-state{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);padding:48px;text-align:center}.formative-loading{align-items:center;display:flex;justify-content:center;min-height:400px}.formative-builder-layout{display:flex;gap:0;height:calc(100vh - 180px);overflow:hidden;position:relative}.formative-builder-sidebar{background:#fff;border-left:1px solid #ddd;flex-shrink:0;height:100%;overflow-x:hidden;overflow-y:auto;padding:0;width:360px}.formative-builder-sidebar .components-panel{border:none}.formative-builder-sidebar .components-panel__body{border-bottom:none;border-top:1px solid #e0e0e0}.formative-builder-sidebar .components-panel__body:first-child{border-top:none}.formative-builder-canvas{background:#f5f5f5;flex:1;height:100%;min-width:400px;overflow-x:hidden;overflow-y:auto;padding:0;position:relative}.formative-canvas-inner{box-shadow:-1px 2px 8px -3px rgba(0,0,0,.88);margin:0 auto;max-width:900px;padding:40px 20px}.formative-canvas-header{margin-bottom:32px;text-align:center}.formative-canvas-header h2{color:#1e1e1e;font-size:24px;font-weight:600;margin:0}.formative-empty-canvas{align-items:center;border:2px dashed transparent;border-radius:8px;color:#666;display:flex;flex-direction:column;justify-content:center;min-height:400px;padding:40px;text-align:center;transition:all .2s}.formative-empty-canvas.drag-active{background:#f0f6fc;border-color:#00a32a}.formative-empty-canvas.drag-active h3{color:#00a32a}.formative-empty-canvas h3{color:#333;font-size:20px;margin:0 0 8px}.formative-empty-canvas p{margin:0;max-width:400px}.formative-canvas-fields{display:flex;flex-direction:column;gap:16px;min-height:100px;position:relative}.formative-canvas-fields.drag-active .formative-canvas-field{position:relative}.formative-canvas-fields.drag-active .formative-canvas-field:after{background:transparent;border-radius:2px;bottom:-10px;content:"";height:4px;right:0;position:absolute;left:0;transition:background .2s}.formative-canvas-fields.drag-active .formative-canvas-field.drop-target:after{background:#00a32a}.formative-canvas-fields.drag-active:before{background:transparent;border-radius:2px;content:"";height:4px;right:0;position:absolute;left:0;top:-10px;transition:background .2s}.formative-canvas-fields.drag-active.drop-target-start:before{background:#00a32a}.formative-canvas-field{align-items:flex-start;background:#fff;border:2px solid transparent;border-radius:4px;cursor:pointer;display:flex;gap:12px;padding:20px 16px 20px 20px;position:relative;transition:border-color .2s,box-shadow .2s,transform .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.formative-canvas-field:hover{border-color:#0073aa;box-shadow:0 2px 8px rgba(0,115,170,.1)}.formative-canvas-field:hover .canvas-field-drag-handle{opacity:1}.formative-canvas-field.is-selected{border-color:#0073aa;box-shadow:0 2px 12px rgba(0,115,170,.15)}.formative-canvas-field.is-selected .canvas-field-drag-handle{opacity:1}.formative-canvas-field.is-dragging{cursor:grabbing;opacity:.5;transform:scale(.98)}.formative-canvas-field.drop-target{background:#f0f6fc;border-color:#00a32a;border-style:dashed}.formative-canvas-field.drop-target:after{background:#00a32a;border-radius:2px;bottom:-10px;content:"";height:3px;right:0;position:absolute;left:0}.formative-canvas-field.drag-over{background:#f0f6fc;border-color:#00a32a;border-style:dashed}.formative-canvas-field.drag-over:before{background:#00a32a;border-radius:2px;content:"";height:3px;right:0;position:absolute;left:0;top:-2px}.formative-canvas-field .canvas-field-drag-handle{border-radius:3px;color:#999;cursor:grab;flex-shrink:0;margin:4px -4px -2px;opacity:.4;padding:2px 4px;transition:all .2s}.formative-canvas-field .canvas-field-drag-handle:hover{background:#f0f0f0;color:#0073aa;opacity:1}.formative-canvas-field .canvas-field-drag-handle:active{cursor:grabbing}.formative-canvas-field .canvas-field-drag-handle svg{display:block}.formative-canvas-field .canvas-field-preview{flex:1;min-width:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.formative-canvas-field .canvas-field-preview .field-label{color:#1e1e1e;display:block;font-weight:500;margin-bottom:8px;pointer-events:none}.formative-canvas-field .canvas-field-preview .field-label .required{color:#d63638;margin-right:4px}.formative-canvas-field .canvas-field-preview .formative-input,.formative-canvas-field .canvas-field-preview .formative-select,.formative-canvas-field .canvas-field-preview .formative-textarea{background:#fafafa;border:1px solid #ddd;border-radius:4px;font-size:14px;padding:8px 12px;pointer-events:none;width:100%}.formative-canvas-field .canvas-field-preview .formative-textarea{min-height:100px;pointer-events:none;resize:vertical}.formative-canvas-field .canvas-field-preview .field-help-text{color:#666;font-size:12px;margin-top:6px;pointer-events:none}.formative-canvas-field .canvas-field-preview .formative-checkbox-group,.formative-canvas-field .canvas-field-preview .formative-radio-group{display:flex;flex-direction:column;gap:8px;pointer-events:none}.formative-canvas-field .canvas-field-preview .formative-checkbox-label,.formative-canvas-field .canvas-field-preview .formative-radio-label{align-items:center;display:flex;gap:8px;pointer-events:none}.formative-canvas-field .canvas-field-overlay{align-items:center;display:flex;gap:8px;position:absolute;left:8px;top:8px}.formative-canvas-field .canvas-field-overlay .field-type-badge{background:#0073aa;border-radius:12px;color:#fff;font-size:11px;font-weight:500;letter-spacing:.5px;padding:4px 12px;text-transform:uppercase}.formative-canvas-submit{margin-top:32px;text-align:center}.formative-canvas-submit .preview-submit-button{background:#0073aa;border:none;border-radius:4px;color:#fff;cursor:not-allowed;font-size:16px;font-weight:500;opacity:.8;padding:12px 32px}.formative-field-settings-panel{background:#fff;border-right:1px solid #ddd;display:flex;flex-direction:column;flex-shrink:0;height:100%;overflow:hidden;position:relative;width:360px}.settings-panel-header{background:#f9f9f9;border-bottom:1px solid #ddd;flex-shrink:0;padding:16px 20px}.settings-panel-header .settings-panel-title{align-items:center;display:flex;justify-content:space-between;margin-bottom:12px}.settings-panel-header .settings-panel-title h3{font-size:16px;font-weight:600;margin:0}.settings-panel-header .settings-panel-title .field-type-badge{background:#0073aa;border-radius:12px;color:#fff;font-size:11px;font-weight:500;padding:4px 12px;text-transform:uppercase}.settings-panel-header .settings-panel-actions{display:flex;flex-wrap:wrap;gap:4px}.settings-panel-header .settings-panel-actions .components-button{min-width:auto;padding:6px}.settings-panel-header .settings-panel-actions .components-button svg{display:block}.settings-panel-content{flex:1;overflow-x:hidden;overflow-y:auto;padding:0;position:relative}.settings-panel-content .components-panel{border:none}.settings-panel-content .components-tab-panel__tabs{background:#f9f9f9;border-bottom:1px solid #ddd;display:flex;flex-shrink:0;position:sticky;top:0;z-index:10}.settings-panel-content .components-tab-panel__tabs button{background:transparent;border:none;border-bottom:2px solid transparent;color:#666;cursor:pointer;flex:1;font-weight:500;padding:12px 16px;transition:all .2s}.settings-panel-content .components-tab-panel__tabs button.is-active{background:#fff;border-bottom-color:#0073aa;color:#0073aa}.settings-panel-content .components-tab-panel__tabs button:hover{background:#f5f5f5;color:#0073aa}.settings-panel-content .tab-panel-content{padding:0}.settings-panel-content .tab-panel-content .components-panel__body{border-bottom:none;border-top:1px solid #e0e0e0}.settings-panel-content .tab-panel-content .components-panel__body:first-child{border-top:none}.settings-panel-content .formative-options-list{display:flex;flex-direction:column;gap:16px;margin-bottom:16px}.settings-panel-content .formative-option-item{background:#f9f9f9;border:1px solid #e0e0e0;border-radius:4px;padding:12px}.settings-panel-content .formative-option-item .components-base-control{margin-bottom:8px}.settings-panel-content .formative-option-item .components-base-control:last-of-type{margin-bottom:12px}.settings-panel-content .formative-option-item .components-button{width:100%}.formative-builder-preview{background:#f5f5f5;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);max-height:calc(100vh - 120px);overflow-y:auto;padding:24px;position:sticky;top:40px;width:420px}.formative-builder-preview .preview-header{align-items:center;border-bottom:2px solid #ddd;display:flex;justify-content:space-between;margin-bottom:20px;padding-bottom:12px}.formative-builder-preview .preview-header h3{color:#1e1e1e;font-size:16px;font-weight:600;margin:0}.formative-builder-preview .preview-header .preview-device-selector{display:flex;gap:4px}.formative-builder-preview .preview-header .preview-device-selector button{align-items:center;background:#fff;border:1px solid #ddd;border-radius:4px;cursor:pointer;display:flex;justify-content:center;padding:6px 10px;transition:all .2s}.formative-builder-preview .preview-header .preview-device-selector button svg{display:block}.formative-builder-preview .preview-header .preview-device-selector button.active{background:#0073aa;border-color:#0073aa;color:#fff}.formative-builder-preview .preview-header .preview-device-selector button.active svg{stroke:#fff}.formative-builder-preview .preview-header .preview-device-selector button:hover{background:#f0f0f0;border-color:#ccc}.formative-builder-preview .preview-header .preview-device-selector button:hover.active{background:#005a87;border-color:#005a87}.formative-builder-preview .preview-content{background:#fff;border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.08);padding:24px;transition:all .3s ease}.formative-builder-preview .preview-content.device-mobile{margin:0 auto;max-width:375px}.formative-builder-preview .preview-content.device-tablet{margin:0 auto;max-width:768px}.formative-builder-preview .preview-field{margin-bottom:20px}.formative-builder-preview .preview-field label{color:#1e1e1e;display:block;font-weight:500;margin-bottom:8px}.formative-builder-preview .preview-field label .required{color:#d63638;margin-right:4px}.formative-builder-preview .preview-field .description{color:#666;font-size:13px;font-style:italic;margin-top:6px}.formative-builder-preview .preview-field input[type=email],.formative-builder-preview .preview-field input[type=number],.formative-builder-preview .preview-field input[type=tel],.formative-builder-preview .preview-field input[type=text],.formative-builder-preview .preview-field input[type=url],.formative-builder-preview .preview-field select,.formative-builder-preview .preview-field textarea{border:1px solid #ddd;border-radius:4px;font-size:14px;padding:10px 12px;transition:border-color .2s;width:100%}.formative-builder-preview .preview-field input[type=email]:focus,.formative-builder-preview .preview-field input[type=number]:focus,.formative-builder-preview .preview-field input[type=tel]:focus,.formative-builder-preview .preview-field input[type=text]:focus,.formative-builder-preview .preview-field input[type=url]:focus,.formative-builder-preview .preview-field select:focus,.formative-builder-preview .preview-field textarea:focus{border-color:#0073aa;box-shadow:0 0 0 1px #0073aa;outline:none}.formative-builder-preview .preview-field input[type=email]::-moz-placeholder,.formative-builder-preview .preview-field input[type=number]::-moz-placeholder,.formative-builder-preview .preview-field input[type=tel]::-moz-placeholder,.formative-builder-preview .preview-field input[type=text]::-moz-placeholder,.formative-builder-preview .preview-field input[type=url]::-moz-placeholder,.formative-builder-preview .preview-field select::-moz-placeholder,.formative-builder-preview .preview-field textarea::-moz-placeholder{color:#999}.formative-builder-preview .preview-field input[type=email]::placeholder,.formative-builder-preview .preview-field input[type=number]::placeholder,.formative-builder-preview .preview-field input[type=tel]::placeholder,.formative-builder-preview .preview-field input[type=text]::placeholder,.formative-builder-preview .preview-field input[type=url]::placeholder,.formative-builder-preview .preview-field select::placeholder,.formative-builder-preview .preview-field textarea::placeholder{color:#999}.formative-builder-preview .preview-field textarea{min-height:100px;resize:vertical}.formative-builder-preview .preview-field .checkbox-group,.formative-builder-preview .preview-field .radio-group{display:flex;flex-direction:column;gap:8px}.formative-builder-preview .preview-field .checkbox-group label,.formative-builder-preview .preview-field .radio-group label{align-items:center;display:flex;font-weight:400;margin:0}.formative-builder-preview .preview-field .checkbox-group label input,.formative-builder-preview .preview-field .radio-group label input{margin-left:8px}.formative-builder-preview .preview-submit{margin-top:24px}.formative-builder-preview .preview-submit button{background:#0073aa;border:none;border-radius:4px;color:#fff;cursor:pointer;font-size:14px;font-weight:500;padding:12px 24px;transition:background .2s}.formative-builder-preview .preview-submit button:hover{background:#005a87}.formative-builder-preview .preview-empty-state{color:#666;padding:60px 20px;text-align:center}.formative-builder-preview .preview-empty-state svg{display:inline-block;margin-bottom:16px}.formative-builder-preview .preview-empty-state h4{color:#1e1e1e;font-size:16px;margin:0 0 8px}.formative-builder-preview .preview-empty-state p{font-size:14px;margin:0}@media(max-width:1400px){.formative-builder-preview{width:360px}}@media(max-width:1200px){.formative-builder-layout{flex-wrap:wrap}.formative-builder-sidebar{width:100%}.formative-builder-canvas,.formative-builder-preview{width:calc(50% - 12px)}}@media(max-width:768px){.formative-builder-canvas,.formative-builder-preview{width:100%}.formative-builder-preview{max-height:none;position:static}}.formative-field-types{display:grid;gap:8px;grid-template-columns:1fr 1fr}.formative-field-types>div[draggable]{cursor:grab;transition:opacity .2s,transform .1s}.formative-field-types>div[draggable]:active{cursor:grabbing}.formative-field-types>div[draggable].is-dragging{opacity:.5;transform:scale(.95)}.formative-field-types>div[draggable]:hover{transform:translateY(-1px)}.formative-field-types button{align-items:center;display:flex;gap:6px;justify-content:center;width:100%}.formative-field-types button svg{flex-shrink:0;opacity:.7}.formative-field-types button:hover svg{opacity:1}.formative-field-item{background:#f9f9f9;border:1px solid #ddd;border-radius:4px;margin-bottom:12px;overflow:hidden}.formative-field-header{align-items:center;cursor:pointer;display:flex;justify-content:space-between;padding:12px 16px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.formative-field-title{align-items:center;display:flex;font-weight:500;gap:8px}.formative-field-type{color:#666;font-size:12px}.formative-field-actions{display:flex;gap:4px}.formative-field-content{background:#fff;border-top:1px solid #ddd;padding:16px}.formative-responsive-controls{margin-top:16px}.formative-device-switcher{margin-bottom:16px}.formative-settings-sections{display:flex;flex-direction:column;gap:24px}.formative-settings-section{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);padding:24px}.formative-settings-section h2{font-size:18px;margin:0 0 8px}.formative-settings-section .description{color:#666;margin-bottom:20px}.formative-modal-overlay{align-items:center;background:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;right:0;position:fixed;left:0;top:0;z-index:999999}.formative-modal{background:#fff;border-radius:8px;box-shadow:0 10px 40px rgba(0,0,0,.3);max-height:80vh;max-width:600px;overflow:auto;width:90%}.formative-modal-header{align-items:center;border-bottom:1px solid #ddd;display:flex;justify-content:space-between;padding:20px}.formative-modal-content{padding:20px}.formative-entry-field{background:#f9f9f9;border-radius:4px;display:flex;flex-direction:column;gap:4px;margin-bottom:12px;padding:12px}.formative-settings-modal .components-modal__content{display:flex;flex-direction:column;margin-top:0;padding:0}.formative-settings-modal .components-modal__header{border-bottom:1px solid #ddd;flex-shrink:0;padding:20px 24px;position:relative;z-index:1}.formative-settings-modal .components-tab-panel__tabs{background:#f9f9f9;border-bottom:1px solid #ddd;display:flex;flex-shrink:0;flex-wrap:wrap;gap:4px;padding:16px 24px;position:relative;z-index:2}.formative-settings-modal .components-tab-panel__tabs-item{background:#fff;border:1px solid #ddd;border-radius:4px;cursor:pointer;font-size:13px;padding:8px 16px;position:relative;transition:all .2s;z-index:3}.formative-settings-modal .components-tab-panel__tabs-item:hover{background:#f0f0f0}.formative-settings-modal .components-tab-panel__tabs-item.is-active{background:#2271b1;border-color:#2271b1;color:#fff}.formative-settings-modal .components-tab-panel__tab-content{flex:1;max-height:60vh;overflow-y:auto;padding:24px}.formative-settings-tab{display:flex;flex-direction:column;gap:20px}.formative-settings-tab .components-notice{margin:0 0 20px;padding:12px 16px}.formative-settings-tab .components-notice p{margin:0}.formative-settings-tab .components-base-control{margin-bottom:20px}.formative-settings-tab .components-base-control:last-child{margin-bottom:0}.formative-settings-tab .components-toggle-control{background:#f9f9f9;border:1px solid #ddd;border-radius:4px;padding:16px}.formative-settings-tab .components-toggle-control .components-base-control__field{margin-bottom:0}.formative-settings-tab .components-toggle-control:has(.components-form-toggle:disabled){cursor:not-allowed;opacity:.5}.formative-integration-option{margin-bottom:12px}.formative-modal-footer{background:#f9f9f9;border-top:1px solid #ddd;display:flex;gap:12px;justify-content:flex-end;padding:16px 24px}.formative-form-preview-container{background:#f9f9f9;border-radius:4px;min-height:400px;padding:20px}.formative-form-preview-container .formative-form{background:#fff;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);margin:0 auto;max-width:600px;padding:30px}.formative-form-preview-container .formative-field-wrapper{margin-bottom:20px}.formative-form-preview-container .formative-field-label{color:#333;display:block;font-weight:600;margin-bottom:8px}.formative-form-preview-container .formative-required{color:#dc3232;margin-right:4px}.formative-form-preview-container .formative-field-help{color:#666;font-size:13px;margin:6px 0 0}.formative-form-preview-container .formative-input,.formative-form-preview-container .formative-select,.formative-form-preview-container .formative-textarea{border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;padding:10px 12px;width:100%}.formative-form-preview-container .formative-input:disabled,.formative-form-preview-container .formative-select:disabled,.formative-form-preview-container .formative-textarea:disabled{background:#f5f5f5;cursor:not-allowed}.formative-form-preview-container .formative-textarea{min-height:100px;resize:vertical}.formative-form-preview-container .formative-checkbox-group,.formative-form-preview-container .formative-radio-group{display:flex;flex-direction:column;gap:8px}.formative-form-preview-container .formative-checkbox-label,.formative-form-preview-container .formative-radio-label{align-items:center;cursor:pointer;display:flex;gap:8px}.formative-form-preview-container .formative-checkbox-label input,.formative-form-preview-container .formative-radio-label input{margin:0}.formative-form-preview-container .formative-submit-button{background:#2271b1;border:none;border-radius:4px;color:#fff;cursor:pointer;font-size:14px;font-weight:600;padding:12px 24px}.formative-form-preview-container .formative-submit-button:disabled{cursor:not-allowed;opacity:.6}@media(max-width:768px){.formative-admin-wrapper{margin:0}.formative-admin-container{flex-direction:column}.formative-admin-sidebar{border-bottom:1px solid #ddd;border-left:none;width:100%}.formative-builder-layout{flex-direction:column}.formative-builder-sidebar{width:100%}}.formative-template-selector{margin:0 auto;max-width:1200px}.formative-template-header{margin-bottom:48px;text-align:center}.formative-template-header h1{color:#1e1e1e;font-size:32px;font-weight:600;margin:0 0 12px}.formative-template-header p{color:#666;font-size:16px;margin:0}.formative-template-grid{display:grid;gap:24px;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));margin-bottom:40px}.formative-template-card{background:#fff;border:2px solid #e0e0e0;border-radius:12px;cursor:pointer;padding:32px 24px;position:relative;text-align:center;transition:all .2s ease}.formative-template-card:hover{border-color:#0073aa;box-shadow:0 4px 12px rgba(0,115,170,.15);transform:translateY(-2px)}.formative-template-card:focus{outline:2px solid #0073aa;outline-offset:2px}.formative-template-card h3{color:#1e1e1e;font-size:18px;font-weight:600;margin:16px 0 8px}.formative-template-card p{color:#666;font-size:14px;line-height:1.5;margin:0}.formative-template-icon{align-items:center;background:linear-gradient(-135deg,#0073aa,#005a87);border-radius:16px;color:#fff;display:inline-flex;height:80px;justify-content:center;margin:0 auto;width:80px}.formative-template-badge{background:#f0f0f1;border-radius:12px;color:#666;font-size:12px;font-weight:500;padding:4px 10px;position:absolute;left:16px;top:16px}.formative-builder-mode .formative-admin-content{max-width:none;padding:0}.formative-builder-wrapper{display:flex;flex-direction:column;height:calc(100vh - 65px)}@media(max-width:768px){.formative-template-grid{gap:16px;grid-template-columns:1fr}.formative-template-card{padding:24px 20px}.formative-template-icon{height:60px;width:60px}.formative-template-icon svg{height:32px;width:32px}}1 #formative-admin-root .is-secondary{box-shadow:inset 0 0 0 1px #000,0 0 0 currentColor!important;color:#000!important}#formative-admin-root .is-primary{background-color:#000!important;box-shadow:inset 0 0 0 1px #000,0 0 0 currentColor!important}.formative-admin-wrapper{background:#f0f0f1;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;margin:0 -22px 0 -20px;min-height:100vh}.formative-admin-header{align-items:center;background:#fff;border-bottom:1px solid #ddd;box-shadow:0 1px 3px rgba(0,0,0,.05);display:flex;justify-content:space-between;padding:16px 32px}.formative-logo{align-items:center;display:flex;font-size:24px;font-weight:600;gap:12px;margin:0}.formative-logo-icon{font-size:28px}.formative-version{color:#999;font-size:12px}.formative-admin-container{display:flex;min-height:calc(100vh - 65px);padding:20px 24px}.formative-admin-sidebar{background:#fff;border-left:1px solid #ddd;padding:20px 0;width:240px}.formative-admin-nav{display:flex;flex-direction:column}.formative-nav-item{align-items:center;border-right:3px solid transparent;color:#333;display:flex;gap:12px;padding:12px 24px;text-decoration:none;transition:all .2s}.formative-nav-item:hover{background:#f5f5f5;color:#000}.formative-nav-item.active{background:#f0f6fc;border-right-color:#000;color:#000;font-weight:500}.formative-nav-icon{font-size:18px}.formative-admin-content{flex:1;max-width:1400px;padding:32px}.formative-page-header{align-items:center;display:flex;justify-content:space-between;margin-bottom:24px}.formative-page-header .formative-df{display:flex}.formative-page-header .formative-form-name{gap:16px}.formative-page-header .formative-form-name h1{margin-top:4px}.formative-page-header h1{font-size:28px;font-weight:600;margin:0}.formative-stats-grid{display:grid;gap:20px;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));margin-bottom:32px}.formative-stat-card{align-items:center;background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);display:flex;gap:16px;padding:24px}.formative-stat-icon{font-size:36px}.formative-stat-value{color:#000;font-size:32px;font-weight:700}.formative-stat-label{color:#666;font-size:14px}.formative-dashboard-sections{display:grid;gap:24px;grid-template-columns:repeat(auto-fit,minmax(400px,1fr))}.formative-dashboard-section{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);padding:24px}.formative-dashboard-section h2{font-size:18px;font-weight:600;margin:0 0 16px}.formative-recent-list{display:flex;flex-direction:column;gap:12px}.formative-recent-item{background:#f9f9f9;border-radius:4px;padding:12px}.formative-recent-title{font-weight:500;margin-bottom:4px}.formative-recent-meta{color:#666;font-size:12px}.formative-table-wrapper{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);overflow:hidden}.formative-table{border-collapse:collapse;width:100%}.formative-table th{background:#f5f5f5;border-bottom:2px solid #ddd;font-weight:600;padding:16px;text-align:right}.formative-table td{border-bottom:1px solid #eee;padding:16px}.formative-table-actions{display:flex;gap:12px}.formative-shortcode-cell{align-items:center;display:flex;gap:8px}.formative-shortcode-cell code{background:#f5f5f5;border-radius:4px;color:#d63638;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:12px;padding:4px 8px}.formative-shortcode-cell button{flex-shrink:0}.formative-preview-modal .components-modal__content{padding:0}.formative-preview-modal .components-modal__header{border-bottom:1px solid #ddd}.formative-form-preview{max-height:70vh;overflow-y:auto;padding:20px}.formative-form-preview .formative-form{margin:0 auto;max-width:600px}.formative-form-preview .formative-field-wrapper{margin-bottom:20px}.formative-form-preview .formative-field-label{color:#1e1e1e;display:block;font-size:14px;font-weight:600;margin-bottom:8px}.formative-form-preview .formative-required{color:#d63638;margin-right:3px}.formative-form-preview .formative-input,.formative-form-preview .formative-select,.formative-form-preview .formative-textarea{background:#f9f9f9;border:1px solid #ddd;border-radius:4px;font-size:14px;padding:10px 12px;width:100%}.formative-form-preview .formative-textarea{min-height:100px;resize:vertical}.formative-form-preview .formative-field-help{color:#757575;font-size:12px;margin-top:5px}.formative-form-preview .formative-checkbox-group,.formative-form-preview .formative-radio-group{display:flex;flex-direction:column;gap:8px}.formative-form-preview .formative-checkbox-label,.formative-form-preview .formative-radio-label{align-items:center;display:flex;gap:8px}.formative-form-preview .formative-submit-button{background:#007cba;border:none;border-radius:4px;color:#fff;cursor:not-allowed;font-size:16px;font-weight:500;opacity:.7;padding:12px 24px}.formative-modal-footer{padding:16px 20px}.formative-pagination{align-items:center;display:flex;gap:16px;justify-content:center;margin-top:24px}.formative-empty-state{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);padding:48px;text-align:center}.formative-loading{align-items:center;display:flex;justify-content:center;min-height:400px}.formative-builder-layout{display:flex;gap:0;height:calc(100vh - 180px);overflow:hidden;position:relative}.formative-builder-sidebar{background:#fff;border-left:1px solid #ddd;flex-shrink:0;height:100%;overflow-x:hidden;overflow-y:auto;padding:0;width:360px}.formative-builder-sidebar .components-panel{border:none}.formative-builder-sidebar .components-panel__body{border-bottom:none;border-top:1px solid #e0e0e0}.formative-builder-sidebar .components-panel__body:first-child{border-top:none}.formative-builder-canvas{background:#f5f5f5;flex:1;height:100%;min-width:400px;overflow-x:hidden;overflow-y:auto;padding:0;position:relative}.formative-canvas-inner{box-shadow:-1px 2px 8px -3px rgba(0,0,0,.88);margin:0 auto;max-width:900px;padding:40px 20px}.formative-canvas-header{margin-bottom:32px;text-align:center}.formative-canvas-header h2{color:#1e1e1e;font-size:24px;font-weight:600;margin:0}.formative-empty-canvas{align-items:center;border:2px dashed transparent;border-radius:8px;color:#666;display:flex;flex-direction:column;justify-content:center;min-height:400px;padding:40px;text-align:center;transition:all .2s}.formative-empty-canvas.drag-active{background:#f0f6fc;border-color:#00a32a}.formative-empty-canvas.drag-active h3{color:#00a32a}.formative-empty-canvas h3{color:#333;font-size:20px;margin:0 0 8px}.formative-empty-canvas p{margin:0;max-width:400px}.formative-canvas-fields{display:flex;flex-direction:column;gap:16px;min-height:100px;position:relative}.formative-canvas-fields.drag-active .formative-canvas-field{position:relative}.formative-canvas-fields.drag-active .formative-canvas-field:after{background:transparent;border-radius:2px;bottom:-10px;content:"";height:4px;right:0;position:absolute;left:0;transition:background .2s}.formative-canvas-fields.drag-active .formative-canvas-field.drop-target:after{background:#00a32a}.formative-canvas-fields.drag-active:before{background:transparent;border-radius:2px;content:"";height:4px;right:0;position:absolute;left:0;top:-10px;transition:background .2s}.formative-canvas-fields.drag-active.drop-target-start:before{background:#00a32a}.formative-canvas-field{align-items:flex-start;background:#fff;border:2px solid transparent;border-radius:4px;cursor:pointer;display:flex;gap:12px;padding:20px 16px 20px 20px;position:relative;transition:border-color .2s,box-shadow .2s,transform .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.formative-canvas-field:hover{border-color:#000;box-shadow:0 2px 8px rgba(0,115,170,.1)}.formative-canvas-field:hover .canvas-field-drag-handle{opacity:1}.formative-canvas-field.is-selected{border-color:#000;box-shadow:0 2px 12px rgba(0,115,170,.15)}.formative-canvas-field.is-selected .canvas-field-drag-handle{opacity:1}.formative-canvas-field.is-dragging{cursor:grabbing;opacity:.5;transform:scale(.98)}.formative-canvas-field.drop-target{background:#f0f6fc;border-color:#00a32a;border-style:dashed}.formative-canvas-field.drop-target:after{background:#00a32a;border-radius:2px;bottom:-10px;content:"";height:3px;right:0;position:absolute;left:0}.formative-canvas-field.drag-over{background:#f0f6fc;border-color:#00a32a;border-style:dashed}.formative-canvas-field.drag-over:before{background:#00a32a;border-radius:2px;content:"";height:3px;right:0;position:absolute;left:0;top:-2px}.formative-canvas-field .canvas-field-drag-handle{border-radius:3px;color:#999;cursor:grab;flex-shrink:0;margin:4px -4px -2px;opacity:.4;padding:2px 4px;transition:all .2s}.formative-canvas-field .canvas-field-drag-handle:hover{background:#f0f0f0;color:#000;opacity:1}.formative-canvas-field .canvas-field-drag-handle:active{cursor:grabbing}.formative-canvas-field .canvas-field-drag-handle svg{display:block}.formative-canvas-field .canvas-field-preview{flex:1;min-width:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.formative-canvas-field .canvas-field-preview .field-label{color:#1e1e1e;display:block;font-weight:500;margin-bottom:8px;pointer-events:none}.formative-canvas-field .canvas-field-preview .field-label .required{color:#d63638;margin-right:4px}.formative-canvas-field .canvas-field-preview .formative-input,.formative-canvas-field .canvas-field-preview .formative-select,.formative-canvas-field .canvas-field-preview .formative-textarea{background:#fafafa;border:1px solid #ddd;border-radius:4px;font-size:14px;padding:8px 12px;pointer-events:none;width:100%}.formative-canvas-field .canvas-field-preview .formative-textarea{min-height:100px;pointer-events:none;resize:vertical}.formative-canvas-field .canvas-field-preview .field-help-text{color:#666;font-size:12px;margin-top:6px;pointer-events:none}.formative-canvas-field .canvas-field-preview .formative-checkbox-group,.formative-canvas-field .canvas-field-preview .formative-radio-group{display:flex;flex-direction:column;gap:8px;pointer-events:none}.formative-canvas-field .canvas-field-preview .formative-checkbox-label,.formative-canvas-field .canvas-field-preview .formative-radio-label{align-items:center;display:flex;gap:8px;pointer-events:none}.formative-canvas-field .canvas-field-overlay{align-items:center;display:flex;gap:8px;position:absolute;left:8px;top:8px}.formative-canvas-field .canvas-field-overlay .field-type-badge{background:#000;border-radius:12px;color:#fff;font-size:11px;font-weight:500;letter-spacing:.5px;padding:4px 12px;text-transform:uppercase}.formative-canvas-submit{margin-top:32px;text-align:center}.formative-canvas-submit .preview-submit-button{background:#000;border:none;border-radius:4px;color:#fff;cursor:not-allowed;font-size:16px;font-weight:500;opacity:.8;padding:12px 32px}.formative-field-settings-panel{background:#fff;border-right:1px solid #ddd;display:flex;flex-direction:column;flex-shrink:0;height:100%;overflow:hidden;position:relative;width:360px}.settings-panel-header{background:#f9f9f9;border-bottom:1px solid #ddd;flex-shrink:0;padding:16px 20px}.settings-panel-header .settings-panel-title{align-items:center;display:flex;justify-content:space-between;margin-bottom:12px}.settings-panel-header .settings-panel-title h3{font-size:16px;font-weight:600;margin:0}.settings-panel-header .settings-panel-title .field-type-badge{background:#000;border-radius:12px;color:#fff;font-size:11px;font-weight:500;padding:4px 12px;text-transform:uppercase}.settings-panel-header .settings-panel-actions{display:flex;flex-wrap:wrap;gap:4px}.settings-panel-header .settings-panel-actions .components-button{min-width:auto;padding:6px}.settings-panel-header .settings-panel-actions .components-button svg{display:block}.settings-panel-content{flex:1;overflow-x:hidden;overflow-y:auto;padding:0;position:relative}.settings-panel-content .components-panel{border:none}.settings-panel-content .components-tab-panel__tabs{background:#f9f9f9;border-bottom:1px solid #ddd;display:flex;flex-shrink:0;position:sticky;top:0;z-index:10}.settings-panel-content .components-tab-panel__tabs button{background:transparent;border:none;border-bottom:2px solid transparent;color:#666;cursor:pointer;flex:1;font-weight:500;padding:12px 16px;transition:all .2s}.settings-panel-content .components-tab-panel__tabs button.is-active{background:#fff;border-bottom-color:#000;color:#000}.settings-panel-content .components-tab-panel__tabs button:hover{background:#f5f5f5;color:#000}.settings-panel-content .tab-panel-content{padding:0}.settings-panel-content .tab-panel-content .components-panel__body{border-bottom:none;border-top:1px solid #e0e0e0}.settings-panel-content .tab-panel-content .components-panel__body:first-child{border-top:none}.settings-panel-content .formative-options-list{display:flex;flex-direction:column;gap:16px;margin-bottom:16px}.settings-panel-content .formative-option-item{background:#f9f9f9;border:1px solid #e0e0e0;border-radius:4px;padding:12px}.settings-panel-content .formative-option-item .components-base-control{margin-bottom:8px}.settings-panel-content .formative-option-item .components-base-control:last-of-type{margin-bottom:12px}.settings-panel-content .formative-option-item .components-button{width:100%}.formative-builder-preview{background:#f5f5f5;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);max-height:calc(100vh - 120px);overflow-y:auto;padding:24px;position:sticky;top:40px;width:420px}.formative-builder-preview .preview-header{align-items:center;border-bottom:2px solid #ddd;display:flex;justify-content:space-between;margin-bottom:20px;padding-bottom:12px}.formative-builder-preview .preview-header h3{color:#1e1e1e;font-size:16px;font-weight:600;margin:0}.formative-builder-preview .preview-header .preview-device-selector{display:flex;gap:4px}.formative-builder-preview .preview-header .preview-device-selector button{align-items:center;background:#fff;border:1px solid #ddd;border-radius:4px;cursor:pointer;display:flex;justify-content:center;padding:6px 10px;transition:all .2s}.formative-builder-preview .preview-header .preview-device-selector button svg{display:block}.formative-builder-preview .preview-header .preview-device-selector button.active{background:#000;border-color:#000;color:#fff}.formative-builder-preview .preview-header .preview-device-selector button.active svg{stroke:#fff}.formative-builder-preview .preview-header .preview-device-selector button:hover{background:#f0f0f0;border-color:#ccc}.formative-builder-preview .preview-header .preview-device-selector button:hover.active{background:#005a87;border-color:#005a87}.formative-builder-preview .preview-content{background:#fff;border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.08);padding:24px;transition:all .3s ease}.formative-builder-preview .preview-content.device-mobile{margin:0 auto;max-width:375px}.formative-builder-preview .preview-content.device-tablet{margin:0 auto;max-width:768px}.formative-builder-preview .preview-field{margin-bottom:20px}.formative-builder-preview .preview-field label{color:#1e1e1e;display:block;font-weight:500;margin-bottom:8px}.formative-builder-preview .preview-field label .required{color:#d63638;margin-right:4px}.formative-builder-preview .preview-field .description{color:#666;font-size:13px;font-style:italic;margin-top:6px}.formative-builder-preview .preview-field input[type=email],.formative-builder-preview .preview-field input[type=number],.formative-builder-preview .preview-field input[type=tel],.formative-builder-preview .preview-field input[type=text],.formative-builder-preview .preview-field input[type=url],.formative-builder-preview .preview-field select,.formative-builder-preview .preview-field textarea{border:1px solid #ddd;border-radius:4px;font-size:14px;padding:10px 12px;transition:border-color .2s;width:100%}.formative-builder-preview .preview-field input[type=email]:focus,.formative-builder-preview .preview-field input[type=number]:focus,.formative-builder-preview .preview-field input[type=tel]:focus,.formative-builder-preview .preview-field input[type=text]:focus,.formative-builder-preview .preview-field input[type=url]:focus,.formative-builder-preview .preview-field select:focus,.formative-builder-preview .preview-field textarea:focus{border-color:#000;box-shadow:0 0 0 1px #000;outline:none}.formative-builder-preview .preview-field input[type=email]::-moz-placeholder,.formative-builder-preview .preview-field input[type=number]::-moz-placeholder,.formative-builder-preview .preview-field input[type=tel]::-moz-placeholder,.formative-builder-preview .preview-field input[type=text]::-moz-placeholder,.formative-builder-preview .preview-field input[type=url]::-moz-placeholder,.formative-builder-preview .preview-field select::-moz-placeholder,.formative-builder-preview .preview-field textarea::-moz-placeholder{color:#999}.formative-builder-preview .preview-field input[type=email]::placeholder,.formative-builder-preview .preview-field input[type=number]::placeholder,.formative-builder-preview .preview-field input[type=tel]::placeholder,.formative-builder-preview .preview-field input[type=text]::placeholder,.formative-builder-preview .preview-field input[type=url]::placeholder,.formative-builder-preview .preview-field select::placeholder,.formative-builder-preview .preview-field textarea::placeholder{color:#999}.formative-builder-preview .preview-field textarea{min-height:100px;resize:vertical}.formative-builder-preview .preview-field .checkbox-group,.formative-builder-preview .preview-field .radio-group{display:flex;flex-direction:column;gap:8px}.formative-builder-preview .preview-field .checkbox-group label,.formative-builder-preview .preview-field .radio-group label{align-items:center;display:flex;font-weight:400;margin:0}.formative-builder-preview .preview-field .checkbox-group label input,.formative-builder-preview .preview-field .radio-group label input{margin-left:8px}.formative-builder-preview .preview-submit{margin-top:24px}.formative-builder-preview .preview-submit button{background:#000;border:none;border-radius:4px;color:#fff;cursor:pointer;font-size:14px;font-weight:500;padding:12px 24px;transition:background .2s}.formative-builder-preview .preview-submit button:hover{background:#005a87}.formative-builder-preview .preview-empty-state{color:#666;padding:60px 20px;text-align:center}.formative-builder-preview .preview-empty-state svg{display:inline-block;margin-bottom:16px}.formative-builder-preview .preview-empty-state h4{color:#1e1e1e;font-size:16px;margin:0 0 8px}.formative-builder-preview .preview-empty-state p{font-size:14px;margin:0}@media(max-width:1400px){.formative-builder-preview{width:360px}}@media(max-width:1200px){.formative-builder-layout{flex-wrap:wrap}.formative-builder-sidebar{width:100%}.formative-builder-canvas,.formative-builder-preview{width:calc(50% - 12px)}}@media(max-width:768px){.formative-builder-canvas,.formative-builder-preview{width:100%}.formative-builder-preview{max-height:none;position:static}}.formative-field-types{display:grid;gap:8px;grid-template-columns:1fr 1fr}.formative-field-types>div[draggable]{cursor:grab;transition:opacity .2s,transform .1s}.formative-field-types>div[draggable]:active{cursor:grabbing}.formative-field-types>div[draggable].is-dragging{opacity:.5;transform:scale(.95)}.formative-field-types>div[draggable]:hover{transform:translateY(-1px)}.formative-field-types button{align-items:center;display:flex;gap:6px;justify-content:center;width:100%}.formative-field-types button svg{flex-shrink:0;opacity:.7}.formative-field-types button:hover svg{opacity:1}.formative-field-item{background:#f9f9f9;border:1px solid #ddd;border-radius:4px;margin-bottom:12px;overflow:hidden}.formative-field-header{align-items:center;cursor:pointer;display:flex;justify-content:space-between;padding:12px 16px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.formative-field-title{align-items:center;display:flex;font-weight:500;gap:8px}.formative-field-type{color:#666;font-size:12px}.formative-field-actions{display:flex;gap:4px}.formative-field-content{background:#fff;border-top:1px solid #ddd;padding:16px}.formative-responsive-controls{margin-top:16px}.formative-device-switcher{margin-bottom:16px}.formative-settings-sections{display:flex;flex-direction:column;gap:24px}.formative-settings-section{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);padding:24px}.formative-settings-section h2{font-size:18px;margin:0 0 8px}.formative-settings-section .description{color:#666;margin-bottom:20px}.formative-modal-overlay{align-items:center;background:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;right:0;position:fixed;left:0;top:0;z-index:999999}.formative-modal{background:#fff;border-radius:8px;box-shadow:0 10px 40px rgba(0,0,0,.3);max-height:80vh;max-width:600px;overflow:auto;width:90%}.formative-modal-header{align-items:center;border-bottom:1px solid #ddd;display:flex;justify-content:space-between;padding:20px}.formative-modal-content{padding:20px}.formative-entry-field{background:#f9f9f9;border-radius:4px;display:flex;flex-direction:column;gap:4px;margin-bottom:12px;padding:12px}.formative-settings-modal .components-modal__content{display:flex;flex-direction:column;margin-top:0;padding:0}.formative-settings-modal .components-modal__header{border-bottom:1px solid #ddd;flex-shrink:0;padding:20px 24px;position:relative;z-index:1}.formative-settings-modal .components-tab-panel__tabs{background:#f9f9f9;border-bottom:1px solid #ddd;display:flex;flex-shrink:0;flex-wrap:wrap;gap:4px;padding:16px 24px;position:relative;z-index:2}.formative-settings-modal .components-tab-panel__tabs-item{background:#fff;border:1px solid #ddd;border-radius:4px;cursor:pointer;font-size:13px;padding:8px 16px;position:relative;transition:all .2s;z-index:3}.formative-settings-modal .components-tab-panel__tabs-item:hover{background:#f0f0f0}.formative-settings-modal .components-tab-panel__tabs-item.is-active{background:#2271b1;border-color:#2271b1;color:#fff}.formative-settings-modal .components-tab-panel__tab-content{flex:1;max-height:60vh;overflow-y:auto;padding:24px}.formative-settings-tab{display:flex;flex-direction:column;gap:20px}.formative-settings-tab .components-notice{margin:0 0 20px;padding:12px 16px}.formative-settings-tab .components-notice p{margin:0}.formative-settings-tab .components-base-control{margin-bottom:20px}.formative-settings-tab .components-base-control:last-child{margin-bottom:0}.formative-settings-tab .components-toggle-control{background:#f9f9f9;border:1px solid #ddd;border-radius:4px;padding:16px}.formative-settings-tab .components-toggle-control .components-base-control__field{margin-bottom:0}.formative-settings-tab .components-toggle-control:has(.components-form-toggle:disabled){cursor:not-allowed;opacity:.5}.formative-integration-option{margin-bottom:12px}.formative-modal-footer{background:#f9f9f9;border-top:1px solid #ddd;display:flex;gap:12px;justify-content:flex-end;padding:16px 24px}.formative-form-preview-container{background:#f9f9f9;border-radius:4px;min-height:400px;padding:20px}.formative-form-preview-container .formative-form{background:#fff;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);margin:0 auto;max-width:600px;padding:30px}.formative-form-preview-container .formative-field-wrapper{margin-bottom:20px}.formative-form-preview-container .formative-field-label{color:#333;display:block;font-weight:600;margin-bottom:8px}.formative-form-preview-container .formative-required{color:#dc3232;margin-right:4px}.formative-form-preview-container .formative-field-help{color:#666;font-size:13px;margin:6px 0 0}.formative-form-preview-container .formative-input,.formative-form-preview-container .formative-select,.formative-form-preview-container .formative-textarea{border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;padding:10px 12px;width:100%}.formative-form-preview-container .formative-input:disabled,.formative-form-preview-container .formative-select:disabled,.formative-form-preview-container .formative-textarea:disabled{background:#f5f5f5;cursor:not-allowed}.formative-form-preview-container .formative-textarea{min-height:100px;resize:vertical}.formative-form-preview-container .formative-checkbox-group,.formative-form-preview-container .formative-radio-group{display:flex;flex-direction:column;gap:8px}.formative-form-preview-container .formative-checkbox-label,.formative-form-preview-container .formative-radio-label{align-items:center;cursor:pointer;display:flex;gap:8px}.formative-form-preview-container .formative-checkbox-label input,.formative-form-preview-container .formative-radio-label input{margin:0}.formative-form-preview-container .formative-submit-button{background:#2271b1;border:none;border-radius:4px;color:#fff;cursor:pointer;font-size:14px;font-weight:600;padding:12px 24px}.formative-form-preview-container .formative-submit-button:disabled{cursor:not-allowed;opacity:.6}@media(max-width:768px){.formative-admin-wrapper{margin:0}.formative-admin-container{flex-direction:column}.formative-admin-sidebar{border-bottom:1px solid #ddd;border-left:none;width:100%}.formative-builder-layout{flex-direction:column}.formative-builder-sidebar{width:100%}}.formative-template-selector{margin:0 auto;max-width:1200px}.formative-template-header{margin-bottom:48px;text-align:center}.formative-template-header h1{color:#1e1e1e;font-size:32px;font-weight:600;margin:0 0 12px}.formative-template-header p{color:#666;font-size:16px;margin:0}.formative-template-grid{display:grid;gap:24px;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));margin-bottom:40px}.formative-template-card{background:#fff;border:2px solid #e0e0e0;border-radius:12px;cursor:pointer;padding:32px 24px;position:relative;text-align:center;transition:all .2s ease}.formative-template-card:hover{border-color:#000;box-shadow:0 4px 12px rgba(0,115,170,.15);transform:translateY(-2px)}.formative-template-card:focus{outline:2px solid #000;outline-offset:2px}.formative-template-card h3{color:#1e1e1e;font-size:18px;font-weight:600;margin:16px 0 8px}.formative-template-card p{color:#666;font-size:14px;line-height:1.5;margin:0}.formative-template-icon{align-items:center;background:#000;border-radius:16px;color:#fff;display:inline-flex;height:80px;justify-content:center;margin:0 auto;width:80px}.formative-template-badge{background:#f0f0f1;border-radius:12px;color:#666;font-size:12px;font-weight:500;padding:4px 10px;position:absolute;left:16px;top:16px}.formative-builder-mode .formative-admin-content{max-width:none;padding:0}.formative-builder-wrapper{display:flex;flex-direction:column;height:calc(100vh - 65px)}@media(max-width:768px){.formative-template-grid{gap:16px;grid-template-columns:1fr}.formative-template-card{padding:24px 20px}.formative-template-icon{height:60px;width:60px}.formative-template-icon svg{height:32px;width:32px}} -
formative/trunk/build/admin.asset.php
r3426920 r3428303 1 <?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => ' b017c114bba29d8150f0');1 <?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '33dbb1f35bffd3045d07'); -
formative/trunk/build/admin.css
r3426920 r3428303 1 .formative-admin-wrapper{background:#f0f0f1;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;margin:0 -20px 0 -22px;min-height:100vh}.formative-admin-header{align-items:center;background:#fff;border-bottom:1px solid #ddd;box-shadow:0 1px 3px rgba(0,0,0,.05);display:flex;justify-content:space-between;padding:16px 32px}.formative-logo{align-items:center;display:flex;font-size:24px;font-weight:600;gap:12px;margin:0}.formative-logo-icon{font-size:28px}.formative-version{color:#999;font-size:12px}.formative-admin-container{display:flex;min-height:calc(100vh - 65px)}.formative-admin-sidebar{background:#fff;border-right:1px solid #ddd;padding:20px 0;width:240px}.formative-admin-nav{display:flex;flex-direction:column}.formative-nav-item{align-items:center;border-left:3px solid transparent;color:#333;display:flex;gap:12px;padding:12px 24px;text-decoration:none;transition:all .2s}.formative-nav-item:hover{background:#f5f5f5;color:#0073aa}.formative-nav-item.active{background:#f0f6fc;border-left-color:#0073aa;color:#0073aa;font-weight:500}.formative-nav-icon{font-size:18px}.formative-admin-content{flex:1;max-width:1400px;padding:32px}.formative-page-header{align-items:center;display:flex;justify-content:space-between;margin-bottom:24px}.formative-page-header h1{font-size:28px;font-weight:600;margin:0}.formative-stats-grid{display:grid;gap:20px;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));margin-bottom:32px}.formative-stat-card{align-items:center;background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);display:flex;gap:16px;padding:24px}.formative-stat-icon{font-size:36px}.formative-stat-value{color:#0073aa;font-size:32px;font-weight:700}.formative-stat-label{color:#666;font-size:14px}.formative-dashboard-sections{display:grid;gap:24px;grid-template-columns:repeat(auto-fit,minmax(400px,1fr))}.formative-dashboard-section{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);padding:24px}.formative-dashboard-section h2{font-size:18px;font-weight:600;margin:0 0 16px}.formative-recent-list{display:flex;flex-direction:column;gap:12px}.formative-recent-item{background:#f9f9f9;border-radius:4px;padding:12px}.formative-recent-title{font-weight:500;margin-bottom:4px}.formative-recent-meta{color:#666;font-size:12px}.formative-table-wrapper{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);overflow:hidden}.formative-table{border-collapse:collapse;width:100%}.formative-table th{background:#f5f5f5;border-bottom:2px solid #ddd;font-weight:600;padding:16px;text-align:left}.formative-table td{border-bottom:1px solid #eee;padding:16px}.formative-table-actions{display:flex;gap:12px}.formative-shortcode-cell{align-items:center;display:flex;gap:8px}.formative-shortcode-cell code{background:#f5f5f5;border-radius:4px;color:#d63638;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:12px;padding:4px 8px}.formative-shortcode-cell button{flex-shrink:0}.formative-preview-modal .components-modal__content{padding:0}.formative-preview-modal .components-modal__header{border-bottom:1px solid #ddd}.formative-form-preview{max-height:70vh;overflow-y:auto;padding:20px}.formative-form-preview .formative-form{margin:0 auto;max-width:600px}.formative-form-preview .formative-field-wrapper{margin-bottom:20px}.formative-form-preview .formative-field-label{color:#1e1e1e;display:block;font-size:14px;font-weight:600;margin-bottom:8px}.formative-form-preview .formative-required{color:#d63638;margin-left:3px}.formative-form-preview .formative-input,.formative-form-preview .formative-select,.formative-form-preview .formative-textarea{background:#f9f9f9;border:1px solid #ddd;border-radius:4px;font-size:14px;padding:10px 12px;width:100%}.formative-form-preview .formative-textarea{min-height:100px;resize:vertical}.formative-form-preview .formative-field-help{color:#757575;font-size:12px;margin-top:5px}.formative-form-preview .formative-checkbox-group,.formative-form-preview .formative-radio-group{display:flex;flex-direction:column;gap:8px}.formative-form-preview .formative-checkbox-label,.formative-form-preview .formative-radio-label{align-items:center;display:flex;gap:8px}.formative-form-preview .formative-submit-button{background:#007cba;border:none;border-radius:4px;color:#fff;cursor:not-allowed;font-size:16px;font-weight:500;opacity:.7;padding:12px 24px}.formative-modal-footer{padding:16px 20px}.formative-pagination{align-items:center;display:flex;gap:16px;justify-content:center;margin-top:24px}.formative-empty-state{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);padding:48px;text-align:center}.formative-loading{align-items:center;display:flex;justify-content:center;min-height:400px}.formative-builder-layout{display:flex;gap:0;height:calc(100vh - 180px);overflow:hidden;position:relative}.formative-builder-sidebar{background:#fff;border-right:1px solid #ddd;flex-shrink:0;height:100%;overflow-x:hidden;overflow-y:auto;padding:0;width:360px}.formative-builder-sidebar .components-panel{border:none}.formative-builder-sidebar .components-panel__body{border-bottom:none;border-top:1px solid #e0e0e0}.formative-builder-sidebar .components-panel__body:first-child{border-top:none}.formative-builder-canvas{background:#f5f5f5;flex:1;height:100%;min-width:400px;overflow-x:hidden;overflow-y:auto;padding:0;position:relative}.formative-canvas-inner{box-shadow:1px 2px 8px -3px rgba(0,0,0,.88);margin:0 auto;max-width:900px;padding:40px 20px}.formative-canvas-header{margin-bottom:32px;text-align:center}.formative-canvas-header h2{color:#1e1e1e;font-size:24px;font-weight:600;margin:0}.formative-empty-canvas{align-items:center;border:2px dashed transparent;border-radius:8px;color:#666;display:flex;flex-direction:column;justify-content:center;min-height:400px;padding:40px;text-align:center;transition:all .2s}.formative-empty-canvas.drag-active{background:#f0f6fc;border-color:#00a32a}.formative-empty-canvas.drag-active h3{color:#00a32a}.formative-empty-canvas h3{color:#333;font-size:20px;margin:0 0 8px}.formative-empty-canvas p{margin:0;max-width:400px}.formative-canvas-fields{display:flex;flex-direction:column;gap:16px;min-height:100px;position:relative}.formative-canvas-fields.drag-active .formative-canvas-field{position:relative}.formative-canvas-fields.drag-active .formative-canvas-field:after{background:transparent;border-radius:2px;bottom:-10px;content:"";height:4px;left:0;position:absolute;right:0;transition:background .2s}.formative-canvas-fields.drag-active .formative-canvas-field.drop-target:after{background:#00a32a}.formative-canvas-fields.drag-active:before{background:transparent;border-radius:2px;content:"";height:4px;left:0;position:absolute;right:0;top:-10px;transition:background .2s}.formative-canvas-fields.drag-active.drop-target-start:before{background:#00a32a}.formative-canvas-field{align-items:flex-start;background:#fff;border:2px solid transparent;border-radius:4px;cursor:pointer;display:flex;gap:12px;padding:20px 20px 20px 16px;position:relative;transition:border-color .2s,box-shadow .2s,transform .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.formative-canvas-field:hover{border-color:#0073aa;box-shadow:0 2px 8px rgba(0,115,170,.1)}.formative-canvas-field:hover .canvas-field-drag-handle{opacity:1}.formative-canvas-field.is-selected{border-color:#0073aa;box-shadow:0 2px 12px rgba(0,115,170,.15)}.formative-canvas-field.is-selected .canvas-field-drag-handle{opacity:1}.formative-canvas-field.is-dragging{cursor:grabbing;opacity:.5;transform:scale(.98)}.formative-canvas-field.drop-target{background:#f0f6fc;border-color:#00a32a;border-style:dashed}.formative-canvas-field.drop-target:after{background:#00a32a;border-radius:2px;bottom:-10px;content:"";height:3px;left:0;position:absolute;right:0}.formative-canvas-field.drag-over{background:#f0f6fc;border-color:#00a32a;border-style:dashed}.formative-canvas-field.drag-over:before{background:#00a32a;border-radius:2px;content:"";height:3px;left:0;position:absolute;right:0;top:-2px}.formative-canvas-field .canvas-field-drag-handle{border-radius:3px;color:#999;cursor:grab;flex-shrink:0;margin:4px -4px -2px;opacity:.4;padding:2px 4px;transition:all .2s}.formative-canvas-field .canvas-field-drag-handle:hover{background:#f0f0f0;color:#0073aa;opacity:1}.formative-canvas-field .canvas-field-drag-handle:active{cursor:grabbing}.formative-canvas-field .canvas-field-drag-handle svg{display:block}.formative-canvas-field .canvas-field-preview{flex:1;min-width:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.formative-canvas-field .canvas-field-preview .field-label{color:#1e1e1e;display:block;font-weight:500;margin-bottom:8px;pointer-events:none}.formative-canvas-field .canvas-field-preview .field-label .required{color:#d63638;margin-left:4px}.formative-canvas-field .canvas-field-preview .formative-input,.formative-canvas-field .canvas-field-preview .formative-select,.formative-canvas-field .canvas-field-preview .formative-textarea{background:#fafafa;border:1px solid #ddd;border-radius:4px;font-size:14px;padding:8px 12px;pointer-events:none;width:100%}.formative-canvas-field .canvas-field-preview .formative-textarea{min-height:100px;pointer-events:none;resize:vertical}.formative-canvas-field .canvas-field-preview .field-help-text{color:#666;font-size:12px;margin-top:6px;pointer-events:none}.formative-canvas-field .canvas-field-preview .formative-checkbox-group,.formative-canvas-field .canvas-field-preview .formative-radio-group{display:flex;flex-direction:column;gap:8px;pointer-events:none}.formative-canvas-field .canvas-field-preview .formative-checkbox-label,.formative-canvas-field .canvas-field-preview .formative-radio-label{align-items:center;display:flex;gap:8px;pointer-events:none}.formative-canvas-field .canvas-field-overlay{align-items:center;display:flex;gap:8px;position:absolute;right:8px;top:8px}.formative-canvas-field .canvas-field-overlay .field-type-badge{background:#0073aa;border-radius:12px;color:#fff;font-size:11px;font-weight:500;letter-spacing:.5px;padding:4px 12px;text-transform:uppercase}.formative-canvas-submit{margin-top:32px;text-align:center}.formative-canvas-submit .preview-submit-button{background:#0073aa;border:none;border-radius:4px;color:#fff;cursor:not-allowed;font-size:16px;font-weight:500;opacity:.8;padding:12px 32px}.formative-field-settings-panel{background:#fff;border-left:1px solid #ddd;display:flex;flex-direction:column;flex-shrink:0;height:100%;overflow:hidden;position:relative;width:360px}.settings-panel-header{background:#f9f9f9;border-bottom:1px solid #ddd;flex-shrink:0;padding:16px 20px}.settings-panel-header .settings-panel-title{align-items:center;display:flex;justify-content:space-between;margin-bottom:12px}.settings-panel-header .settings-panel-title h3{font-size:16px;font-weight:600;margin:0}.settings-panel-header .settings-panel-title .field-type-badge{background:#0073aa;border-radius:12px;color:#fff;font-size:11px;font-weight:500;padding:4px 12px;text-transform:uppercase}.settings-panel-header .settings-panel-actions{display:flex;flex-wrap:wrap;gap:4px}.settings-panel-header .settings-panel-actions .components-button{min-width:auto;padding:6px}.settings-panel-header .settings-panel-actions .components-button svg{display:block}.settings-panel-content{flex:1;overflow-x:hidden;overflow-y:auto;padding:0;position:relative}.settings-panel-content .components-panel{border:none}.settings-panel-content .components-tab-panel__tabs{background:#f9f9f9;border-bottom:1px solid #ddd;display:flex;flex-shrink:0;position:sticky;top:0;z-index:10}.settings-panel-content .components-tab-panel__tabs button{background:transparent;border:none;border-bottom:2px solid transparent;color:#666;cursor:pointer;flex:1;font-weight:500;padding:12px 16px;transition:all .2s}.settings-panel-content .components-tab-panel__tabs button.is-active{background:#fff;border-bottom-color:#0073aa;color:#0073aa}.settings-panel-content .components-tab-panel__tabs button:hover{background:#f5f5f5;color:#0073aa}.settings-panel-content .tab-panel-content{padding:0}.settings-panel-content .tab-panel-content .components-panel__body{border-bottom:none;border-top:1px solid #e0e0e0}.settings-panel-content .tab-panel-content .components-panel__body:first-child{border-top:none}.settings-panel-content .formative-options-list{display:flex;flex-direction:column;gap:16px;margin-bottom:16px}.settings-panel-content .formative-option-item{background:#f9f9f9;border:1px solid #e0e0e0;border-radius:4px;padding:12px}.settings-panel-content .formative-option-item .components-base-control{margin-bottom:8px}.settings-panel-content .formative-option-item .components-base-control:last-of-type{margin-bottom:12px}.settings-panel-content .formative-option-item .components-button{width:100%}.formative-builder-preview{background:#f5f5f5;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);max-height:calc(100vh - 120px);overflow-y:auto;padding:24px;position:sticky;top:40px;width:420px}.formative-builder-preview .preview-header{align-items:center;border-bottom:2px solid #ddd;display:flex;justify-content:space-between;margin-bottom:20px;padding-bottom:12px}.formative-builder-preview .preview-header h3{color:#1e1e1e;font-size:16px;font-weight:600;margin:0}.formative-builder-preview .preview-header .preview-device-selector{display:flex;gap:4px}.formative-builder-preview .preview-header .preview-device-selector button{align-items:center;background:#fff;border:1px solid #ddd;border-radius:4px;cursor:pointer;display:flex;justify-content:center;padding:6px 10px;transition:all .2s}.formative-builder-preview .preview-header .preview-device-selector button svg{display:block}.formative-builder-preview .preview-header .preview-device-selector button.active{background:#0073aa;border-color:#0073aa;color:#fff}.formative-builder-preview .preview-header .preview-device-selector button.active svg{stroke:#fff}.formative-builder-preview .preview-header .preview-device-selector button:hover{background:#f0f0f0;border-color:#ccc}.formative-builder-preview .preview-header .preview-device-selector button:hover.active{background:#005a87;border-color:#005a87}.formative-builder-preview .preview-content{background:#fff;border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.08);padding:24px;transition:all .3s ease}.formative-builder-preview .preview-content.device-mobile{margin:0 auto;max-width:375px}.formative-builder-preview .preview-content.device-tablet{margin:0 auto;max-width:768px}.formative-builder-preview .preview-field{margin-bottom:20px}.formative-builder-preview .preview-field label{color:#1e1e1e;display:block;font-weight:500;margin-bottom:8px}.formative-builder-preview .preview-field label .required{color:#d63638;margin-left:4px}.formative-builder-preview .preview-field .description{color:#666;font-size:13px;font-style:italic;margin-top:6px}.formative-builder-preview .preview-field input[type=email],.formative-builder-preview .preview-field input[type=number],.formative-builder-preview .preview-field input[type=tel],.formative-builder-preview .preview-field input[type=text],.formative-builder-preview .preview-field input[type=url],.formative-builder-preview .preview-field select,.formative-builder-preview .preview-field textarea{border:1px solid #ddd;border-radius:4px;font-size:14px;padding:10px 12px;transition:border-color .2s;width:100%}.formative-builder-preview .preview-field input[type=email]:focus,.formative-builder-preview .preview-field input[type=number]:focus,.formative-builder-preview .preview-field input[type=tel]:focus,.formative-builder-preview .preview-field input[type=text]:focus,.formative-builder-preview .preview-field input[type=url]:focus,.formative-builder-preview .preview-field select:focus,.formative-builder-preview .preview-field textarea:focus{border-color:#0073aa;box-shadow:0 0 0 1px #0073aa;outline:none}.formative-builder-preview .preview-field input[type=email]::-moz-placeholder,.formative-builder-preview .preview-field input[type=number]::-moz-placeholder,.formative-builder-preview .preview-field input[type=tel]::-moz-placeholder,.formative-builder-preview .preview-field input[type=text]::-moz-placeholder,.formative-builder-preview .preview-field input[type=url]::-moz-placeholder,.formative-builder-preview .preview-field select::-moz-placeholder,.formative-builder-preview .preview-field textarea::-moz-placeholder{color:#999}.formative-builder-preview .preview-field input[type=email]::placeholder,.formative-builder-preview .preview-field input[type=number]::placeholder,.formative-builder-preview .preview-field input[type=tel]::placeholder,.formative-builder-preview .preview-field input[type=text]::placeholder,.formative-builder-preview .preview-field input[type=url]::placeholder,.formative-builder-preview .preview-field select::placeholder,.formative-builder-preview .preview-field textarea::placeholder{color:#999}.formative-builder-preview .preview-field textarea{min-height:100px;resize:vertical}.formative-builder-preview .preview-field .checkbox-group,.formative-builder-preview .preview-field .radio-group{display:flex;flex-direction:column;gap:8px}.formative-builder-preview .preview-field .checkbox-group label,.formative-builder-preview .preview-field .radio-group label{align-items:center;display:flex;font-weight:400;margin:0}.formative-builder-preview .preview-field .checkbox-group label input,.formative-builder-preview .preview-field .radio-group label input{margin-right:8px}.formative-builder-preview .preview-submit{margin-top:24px}.formative-builder-preview .preview-submit button{background:#0073aa;border:none;border-radius:4px;color:#fff;cursor:pointer;font-size:14px;font-weight:500;padding:12px 24px;transition:background .2s}.formative-builder-preview .preview-submit button:hover{background:#005a87}.formative-builder-preview .preview-empty-state{color:#666;padding:60px 20px;text-align:center}.formative-builder-preview .preview-empty-state svg{display:inline-block;margin-bottom:16px}.formative-builder-preview .preview-empty-state h4{color:#1e1e1e;font-size:16px;margin:0 0 8px}.formative-builder-preview .preview-empty-state p{font-size:14px;margin:0}@media(max-width:1400px){.formative-builder-preview{width:360px}}@media(max-width:1200px){.formative-builder-layout{flex-wrap:wrap}.formative-builder-sidebar{width:100%}.formative-builder-canvas,.formative-builder-preview{width:calc(50% - 12px)}}@media(max-width:768px){.formative-builder-canvas,.formative-builder-preview{width:100%}.formative-builder-preview{max-height:none;position:static}}.formative-field-types{display:grid;gap:8px;grid-template-columns:1fr 1fr}.formative-field-types>div[draggable]{cursor:grab;transition:opacity .2s,transform .1s}.formative-field-types>div[draggable]:active{cursor:grabbing}.formative-field-types>div[draggable].is-dragging{opacity:.5;transform:scale(.95)}.formative-field-types>div[draggable]:hover{transform:translateY(-1px)}.formative-field-types button{align-items:center;display:flex;gap:6px;justify-content:center;width:100%}.formative-field-types button svg{flex-shrink:0;opacity:.7}.formative-field-types button:hover svg{opacity:1}.formative-field-item{background:#f9f9f9;border:1px solid #ddd;border-radius:4px;margin-bottom:12px;overflow:hidden}.formative-field-header{align-items:center;cursor:pointer;display:flex;justify-content:space-between;padding:12px 16px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.formative-field-title{align-items:center;display:flex;font-weight:500;gap:8px}.formative-field-type{color:#666;font-size:12px}.formative-field-actions{display:flex;gap:4px}.formative-field-content{background:#fff;border-top:1px solid #ddd;padding:16px}.formative-responsive-controls{margin-top:16px}.formative-device-switcher{margin-bottom:16px}.formative-settings-sections{display:flex;flex-direction:column;gap:24px}.formative-settings-section{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);padding:24px}.formative-settings-section h2{font-size:18px;margin:0 0 8px}.formative-settings-section .description{color:#666;margin-bottom:20px}.formative-modal-overlay{align-items:center;background:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:999999}.formative-modal{background:#fff;border-radius:8px;box-shadow:0 10px 40px rgba(0,0,0,.3);max-height:80vh;max-width:600px;overflow:auto;width:90%}.formative-modal-header{align-items:center;border-bottom:1px solid #ddd;display:flex;justify-content:space-between;padding:20px}.formative-modal-content{padding:20px}.formative-entry-field{background:#f9f9f9;border-radius:4px;display:flex;flex-direction:column;gap:4px;margin-bottom:12px;padding:12px}.formative-settings-modal .components-modal__content{display:flex;flex-direction:column;margin-top:0;padding:0}.formative-settings-modal .components-modal__header{border-bottom:1px solid #ddd;flex-shrink:0;padding:20px 24px;position:relative;z-index:1}.formative-settings-modal .components-tab-panel__tabs{background:#f9f9f9;border-bottom:1px solid #ddd;display:flex;flex-shrink:0;flex-wrap:wrap;gap:4px;padding:16px 24px;position:relative;z-index:2}.formative-settings-modal .components-tab-panel__tabs-item{background:#fff;border:1px solid #ddd;border-radius:4px;cursor:pointer;font-size:13px;padding:8px 16px;position:relative;transition:all .2s;z-index:3}.formative-settings-modal .components-tab-panel__tabs-item:hover{background:#f0f0f0}.formative-settings-modal .components-tab-panel__tabs-item.is-active{background:#2271b1;border-color:#2271b1;color:#fff}.formative-settings-modal .components-tab-panel__tab-content{flex:1;max-height:60vh;overflow-y:auto;padding:24px}.formative-settings-tab{display:flex;flex-direction:column;gap:20px}.formative-settings-tab .components-notice{margin:0 0 20px;padding:12px 16px}.formative-settings-tab .components-notice p{margin:0}.formative-settings-tab .components-base-control{margin-bottom:20px}.formative-settings-tab .components-base-control:last-child{margin-bottom:0}.formative-settings-tab .components-toggle-control{background:#f9f9f9;border:1px solid #ddd;border-radius:4px;padding:16px}.formative-settings-tab .components-toggle-control .components-base-control__field{margin-bottom:0}.formative-settings-tab .components-toggle-control:has(.components-form-toggle:disabled){cursor:not-allowed;opacity:.5}.formative-integration-option{margin-bottom:12px}.formative-modal-footer{background:#f9f9f9;border-top:1px solid #ddd;display:flex;gap:12px;justify-content:flex-end;padding:16px 24px}.formative-form-preview-container{background:#f9f9f9;border-radius:4px;min-height:400px;padding:20px}.formative-form-preview-container .formative-form{background:#fff;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);margin:0 auto;max-width:600px;padding:30px}.formative-form-preview-container .formative-field-wrapper{margin-bottom:20px}.formative-form-preview-container .formative-field-label{color:#333;display:block;font-weight:600;margin-bottom:8px}.formative-form-preview-container .formative-required{color:#dc3232;margin-left:4px}.formative-form-preview-container .formative-field-help{color:#666;font-size:13px;margin:6px 0 0}.formative-form-preview-container .formative-input,.formative-form-preview-container .formative-select,.formative-form-preview-container .formative-textarea{border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;padding:10px 12px;width:100%}.formative-form-preview-container .formative-input:disabled,.formative-form-preview-container .formative-select:disabled,.formative-form-preview-container .formative-textarea:disabled{background:#f5f5f5;cursor:not-allowed}.formative-form-preview-container .formative-textarea{min-height:100px;resize:vertical}.formative-form-preview-container .formative-checkbox-group,.formative-form-preview-container .formative-radio-group{display:flex;flex-direction:column;gap:8px}.formative-form-preview-container .formative-checkbox-label,.formative-form-preview-container .formative-radio-label{align-items:center;cursor:pointer;display:flex;gap:8px}.formative-form-preview-container .formative-checkbox-label input,.formative-form-preview-container .formative-radio-label input{margin:0}.formative-form-preview-container .formative-submit-button{background:#2271b1;border:none;border-radius:4px;color:#fff;cursor:pointer;font-size:14px;font-weight:600;padding:12px 24px}.formative-form-preview-container .formative-submit-button:disabled{cursor:not-allowed;opacity:.6}@media(max-width:768px){.formative-admin-wrapper{margin:0}.formative-admin-container{flex-direction:column}.formative-admin-sidebar{border-bottom:1px solid #ddd;border-right:none;width:100%}.formative-builder-layout{flex-direction:column}.formative-builder-sidebar{width:100%}}.formative-template-selector{margin:0 auto;max-width:1200px}.formative-template-header{margin-bottom:48px;text-align:center}.formative-template-header h1{color:#1e1e1e;font-size:32px;font-weight:600;margin:0 0 12px}.formative-template-header p{color:#666;font-size:16px;margin:0}.formative-template-grid{display:grid;gap:24px;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));margin-bottom:40px}.formative-template-card{background:#fff;border:2px solid #e0e0e0;border-radius:12px;cursor:pointer;padding:32px 24px;position:relative;text-align:center;transition:all .2s ease}.formative-template-card:hover{border-color:#0073aa;box-shadow:0 4px 12px rgba(0,115,170,.15);transform:translateY(-2px)}.formative-template-card:focus{outline:2px solid #0073aa;outline-offset:2px}.formative-template-card h3{color:#1e1e1e;font-size:18px;font-weight:600;margin:16px 0 8px}.formative-template-card p{color:#666;font-size:14px;line-height:1.5;margin:0}.formative-template-icon{align-items:center;background:linear-gradient(135deg,#0073aa,#005a87);border-radius:16px;color:#fff;display:inline-flex;height:80px;justify-content:center;margin:0 auto;width:80px}.formative-template-badge{background:#f0f0f1;border-radius:12px;color:#666;font-size:12px;font-weight:500;padding:4px 10px;position:absolute;right:16px;top:16px}.formative-builder-mode .formative-admin-content{max-width:none;padding:0}.formative-builder-wrapper{display:flex;flex-direction:column;height:calc(100vh - 65px)}@media(max-width:768px){.formative-template-grid{gap:16px;grid-template-columns:1fr}.formative-template-card{padding:24px 20px}.formative-template-icon{height:60px;width:60px}.formative-template-icon svg{height:32px;width:32px}}1 #formative-admin-root .is-secondary{box-shadow:inset 0 0 0 1px #000,0 0 0 currentColor!important;color:#000!important}#formative-admin-root .is-primary{background-color:#000!important;box-shadow:inset 0 0 0 1px #000,0 0 0 currentColor!important}.formative-admin-wrapper{background:#f0f0f1;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;margin:0 -20px 0 -22px;min-height:100vh}.formative-admin-header{align-items:center;background:#fff;border-bottom:1px solid #ddd;box-shadow:0 1px 3px rgba(0,0,0,.05);display:flex;justify-content:space-between;padding:16px 32px}.formative-logo{align-items:center;display:flex;font-size:24px;font-weight:600;gap:12px;margin:0}.formative-logo-icon{font-size:28px}.formative-version{color:#999;font-size:12px}.formative-admin-container{display:flex;min-height:calc(100vh - 65px);padding:20px 24px}.formative-admin-sidebar{background:#fff;border-right:1px solid #ddd;padding:20px 0;width:240px}.formative-admin-nav{display:flex;flex-direction:column}.formative-nav-item{align-items:center;border-left:3px solid transparent;color:#333;display:flex;gap:12px;padding:12px 24px;text-decoration:none;transition:all .2s}.formative-nav-item:hover{background:#f5f5f5;color:#000}.formative-nav-item.active{background:#f0f6fc;border-left-color:#000;color:#000;font-weight:500}.formative-nav-icon{font-size:18px}.formative-admin-content{flex:1;max-width:1400px;padding:32px}.formative-page-header{align-items:center;display:flex;justify-content:space-between;margin-bottom:24px}.formative-page-header .formative-df{display:flex}.formative-page-header .formative-form-name{gap:16px}.formative-page-header .formative-form-name h1{margin-top:4px}.formative-page-header h1{font-size:28px;font-weight:600;margin:0}.formative-stats-grid{display:grid;gap:20px;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));margin-bottom:32px}.formative-stat-card{align-items:center;background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);display:flex;gap:16px;padding:24px}.formative-stat-icon{font-size:36px}.formative-stat-value{color:#000;font-size:32px;font-weight:700}.formative-stat-label{color:#666;font-size:14px}.formative-dashboard-sections{display:grid;gap:24px;grid-template-columns:repeat(auto-fit,minmax(400px,1fr))}.formative-dashboard-section{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);padding:24px}.formative-dashboard-section h2{font-size:18px;font-weight:600;margin:0 0 16px}.formative-recent-list{display:flex;flex-direction:column;gap:12px}.formative-recent-item{background:#f9f9f9;border-radius:4px;padding:12px}.formative-recent-title{font-weight:500;margin-bottom:4px}.formative-recent-meta{color:#666;font-size:12px}.formative-table-wrapper{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);overflow:hidden}.formative-table{border-collapse:collapse;width:100%}.formative-table th{background:#f5f5f5;border-bottom:2px solid #ddd;font-weight:600;padding:16px;text-align:left}.formative-table td{border-bottom:1px solid #eee;padding:16px}.formative-table-actions{display:flex;gap:12px}.formative-shortcode-cell{align-items:center;display:flex;gap:8px}.formative-shortcode-cell code{background:#f5f5f5;border-radius:4px;color:#d63638;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:12px;padding:4px 8px}.formative-shortcode-cell button{flex-shrink:0}.formative-preview-modal .components-modal__content{padding:0}.formative-preview-modal .components-modal__header{border-bottom:1px solid #ddd}.formative-form-preview{max-height:70vh;overflow-y:auto;padding:20px}.formative-form-preview .formative-form{margin:0 auto;max-width:600px}.formative-form-preview .formative-field-wrapper{margin-bottom:20px}.formative-form-preview .formative-field-label{color:#1e1e1e;display:block;font-size:14px;font-weight:600;margin-bottom:8px}.formative-form-preview .formative-required{color:#d63638;margin-left:3px}.formative-form-preview .formative-input,.formative-form-preview .formative-select,.formative-form-preview .formative-textarea{background:#f9f9f9;border:1px solid #ddd;border-radius:4px;font-size:14px;padding:10px 12px;width:100%}.formative-form-preview .formative-textarea{min-height:100px;resize:vertical}.formative-form-preview .formative-field-help{color:#757575;font-size:12px;margin-top:5px}.formative-form-preview .formative-checkbox-group,.formative-form-preview .formative-radio-group{display:flex;flex-direction:column;gap:8px}.formative-form-preview .formative-checkbox-label,.formative-form-preview .formative-radio-label{align-items:center;display:flex;gap:8px}.formative-form-preview .formative-submit-button{background:#007cba;border:none;border-radius:4px;color:#fff;cursor:not-allowed;font-size:16px;font-weight:500;opacity:.7;padding:12px 24px}.formative-modal-footer{padding:16px 20px}.formative-pagination{align-items:center;display:flex;gap:16px;justify-content:center;margin-top:24px}.formative-empty-state{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);padding:48px;text-align:center}.formative-loading{align-items:center;display:flex;justify-content:center;min-height:400px}.formative-builder-layout{display:flex;gap:0;height:calc(100vh - 180px);overflow:hidden;position:relative}.formative-builder-sidebar{background:#fff;border-right:1px solid #ddd;flex-shrink:0;height:100%;overflow-x:hidden;overflow-y:auto;padding:0;width:360px}.formative-builder-sidebar .components-panel{border:none}.formative-builder-sidebar .components-panel__body{border-bottom:none;border-top:1px solid #e0e0e0}.formative-builder-sidebar .components-panel__body:first-child{border-top:none}.formative-builder-canvas{background:#f5f5f5;flex:1;height:100%;min-width:400px;overflow-x:hidden;overflow-y:auto;padding:0;position:relative}.formative-canvas-inner{box-shadow:1px 2px 8px -3px rgba(0,0,0,.88);margin:0 auto;max-width:900px;padding:40px 20px}.formative-canvas-header{margin-bottom:32px;text-align:center}.formative-canvas-header h2{color:#1e1e1e;font-size:24px;font-weight:600;margin:0}.formative-empty-canvas{align-items:center;border:2px dashed transparent;border-radius:8px;color:#666;display:flex;flex-direction:column;justify-content:center;min-height:400px;padding:40px;text-align:center;transition:all .2s}.formative-empty-canvas.drag-active{background:#f0f6fc;border-color:#00a32a}.formative-empty-canvas.drag-active h3{color:#00a32a}.formative-empty-canvas h3{color:#333;font-size:20px;margin:0 0 8px}.formative-empty-canvas p{margin:0;max-width:400px}.formative-canvas-fields{display:flex;flex-direction:column;gap:16px;min-height:100px;position:relative}.formative-canvas-fields.drag-active .formative-canvas-field{position:relative}.formative-canvas-fields.drag-active .formative-canvas-field:after{background:transparent;border-radius:2px;bottom:-10px;content:"";height:4px;left:0;position:absolute;right:0;transition:background .2s}.formative-canvas-fields.drag-active .formative-canvas-field.drop-target:after{background:#00a32a}.formative-canvas-fields.drag-active:before{background:transparent;border-radius:2px;content:"";height:4px;left:0;position:absolute;right:0;top:-10px;transition:background .2s}.formative-canvas-fields.drag-active.drop-target-start:before{background:#00a32a}.formative-canvas-field{align-items:flex-start;background:#fff;border:2px solid transparent;border-radius:4px;cursor:pointer;display:flex;gap:12px;padding:20px 20px 20px 16px;position:relative;transition:border-color .2s,box-shadow .2s,transform .2s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.formative-canvas-field:hover{border-color:#000;box-shadow:0 2px 8px rgba(0,115,170,.1)}.formative-canvas-field:hover .canvas-field-drag-handle{opacity:1}.formative-canvas-field.is-selected{border-color:#000;box-shadow:0 2px 12px rgba(0,115,170,.15)}.formative-canvas-field.is-selected .canvas-field-drag-handle{opacity:1}.formative-canvas-field.is-dragging{cursor:grabbing;opacity:.5;transform:scale(.98)}.formative-canvas-field.drop-target{background:#f0f6fc;border-color:#00a32a;border-style:dashed}.formative-canvas-field.drop-target:after{background:#00a32a;border-radius:2px;bottom:-10px;content:"";height:3px;left:0;position:absolute;right:0}.formative-canvas-field.drag-over{background:#f0f6fc;border-color:#00a32a;border-style:dashed}.formative-canvas-field.drag-over:before{background:#00a32a;border-radius:2px;content:"";height:3px;left:0;position:absolute;right:0;top:-2px}.formative-canvas-field .canvas-field-drag-handle{border-radius:3px;color:#999;cursor:grab;flex-shrink:0;margin:4px -4px -2px;opacity:.4;padding:2px 4px;transition:all .2s}.formative-canvas-field .canvas-field-drag-handle:hover{background:#f0f0f0;color:#000;opacity:1}.formative-canvas-field .canvas-field-drag-handle:active{cursor:grabbing}.formative-canvas-field .canvas-field-drag-handle svg{display:block}.formative-canvas-field .canvas-field-preview{flex:1;min-width:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.formative-canvas-field .canvas-field-preview .field-label{color:#1e1e1e;display:block;font-weight:500;margin-bottom:8px;pointer-events:none}.formative-canvas-field .canvas-field-preview .field-label .required{color:#d63638;margin-left:4px}.formative-canvas-field .canvas-field-preview .formative-input,.formative-canvas-field .canvas-field-preview .formative-select,.formative-canvas-field .canvas-field-preview .formative-textarea{background:#fafafa;border:1px solid #ddd;border-radius:4px;font-size:14px;padding:8px 12px;pointer-events:none;width:100%}.formative-canvas-field .canvas-field-preview .formative-textarea{min-height:100px;pointer-events:none;resize:vertical}.formative-canvas-field .canvas-field-preview .field-help-text{color:#666;font-size:12px;margin-top:6px;pointer-events:none}.formative-canvas-field .canvas-field-preview .formative-checkbox-group,.formative-canvas-field .canvas-field-preview .formative-radio-group{display:flex;flex-direction:column;gap:8px;pointer-events:none}.formative-canvas-field .canvas-field-preview .formative-checkbox-label,.formative-canvas-field .canvas-field-preview .formative-radio-label{align-items:center;display:flex;gap:8px;pointer-events:none}.formative-canvas-field .canvas-field-overlay{align-items:center;display:flex;gap:8px;position:absolute;right:8px;top:8px}.formative-canvas-field .canvas-field-overlay .field-type-badge{background:#000;border-radius:12px;color:#fff;font-size:11px;font-weight:500;letter-spacing:.5px;padding:4px 12px;text-transform:uppercase}.formative-canvas-submit{margin-top:32px;text-align:center}.formative-canvas-submit .preview-submit-button{background:#000;border:none;border-radius:4px;color:#fff;cursor:not-allowed;font-size:16px;font-weight:500;opacity:.8;padding:12px 32px}.formative-field-settings-panel{background:#fff;border-left:1px solid #ddd;display:flex;flex-direction:column;flex-shrink:0;height:100%;overflow:hidden;position:relative;width:360px}.settings-panel-header{background:#f9f9f9;border-bottom:1px solid #ddd;flex-shrink:0;padding:16px 20px}.settings-panel-header .settings-panel-title{align-items:center;display:flex;justify-content:space-between;margin-bottom:12px}.settings-panel-header .settings-panel-title h3{font-size:16px;font-weight:600;margin:0}.settings-panel-header .settings-panel-title .field-type-badge{background:#000;border-radius:12px;color:#fff;font-size:11px;font-weight:500;padding:4px 12px;text-transform:uppercase}.settings-panel-header .settings-panel-actions{display:flex;flex-wrap:wrap;gap:4px}.settings-panel-header .settings-panel-actions .components-button{min-width:auto;padding:6px}.settings-panel-header .settings-panel-actions .components-button svg{display:block}.settings-panel-content{flex:1;overflow-x:hidden;overflow-y:auto;padding:0;position:relative}.settings-panel-content .components-panel{border:none}.settings-panel-content .components-tab-panel__tabs{background:#f9f9f9;border-bottom:1px solid #ddd;display:flex;flex-shrink:0;position:sticky;top:0;z-index:10}.settings-panel-content .components-tab-panel__tabs button{background:transparent;border:none;border-bottom:2px solid transparent;color:#666;cursor:pointer;flex:1;font-weight:500;padding:12px 16px;transition:all .2s}.settings-panel-content .components-tab-panel__tabs button.is-active{background:#fff;border-bottom-color:#000;color:#000}.settings-panel-content .components-tab-panel__tabs button:hover{background:#f5f5f5;color:#000}.settings-panel-content .tab-panel-content{padding:0}.settings-panel-content .tab-panel-content .components-panel__body{border-bottom:none;border-top:1px solid #e0e0e0}.settings-panel-content .tab-panel-content .components-panel__body:first-child{border-top:none}.settings-panel-content .formative-options-list{display:flex;flex-direction:column;gap:16px;margin-bottom:16px}.settings-panel-content .formative-option-item{background:#f9f9f9;border:1px solid #e0e0e0;border-radius:4px;padding:12px}.settings-panel-content .formative-option-item .components-base-control{margin-bottom:8px}.settings-panel-content .formative-option-item .components-base-control:last-of-type{margin-bottom:12px}.settings-panel-content .formative-option-item .components-button{width:100%}.formative-builder-preview{background:#f5f5f5;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);max-height:calc(100vh - 120px);overflow-y:auto;padding:24px;position:sticky;top:40px;width:420px}.formative-builder-preview .preview-header{align-items:center;border-bottom:2px solid #ddd;display:flex;justify-content:space-between;margin-bottom:20px;padding-bottom:12px}.formative-builder-preview .preview-header h3{color:#1e1e1e;font-size:16px;font-weight:600;margin:0}.formative-builder-preview .preview-header .preview-device-selector{display:flex;gap:4px}.formative-builder-preview .preview-header .preview-device-selector button{align-items:center;background:#fff;border:1px solid #ddd;border-radius:4px;cursor:pointer;display:flex;justify-content:center;padding:6px 10px;transition:all .2s}.formative-builder-preview .preview-header .preview-device-selector button svg{display:block}.formative-builder-preview .preview-header .preview-device-selector button.active{background:#000;border-color:#000;color:#fff}.formative-builder-preview .preview-header .preview-device-selector button.active svg{stroke:#fff}.formative-builder-preview .preview-header .preview-device-selector button:hover{background:#f0f0f0;border-color:#ccc}.formative-builder-preview .preview-header .preview-device-selector button:hover.active{background:#005a87;border-color:#005a87}.formative-builder-preview .preview-content{background:#fff;border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.08);padding:24px;transition:all .3s ease}.formative-builder-preview .preview-content.device-mobile{margin:0 auto;max-width:375px}.formative-builder-preview .preview-content.device-tablet{margin:0 auto;max-width:768px}.formative-builder-preview .preview-field{margin-bottom:20px}.formative-builder-preview .preview-field label{color:#1e1e1e;display:block;font-weight:500;margin-bottom:8px}.formative-builder-preview .preview-field label .required{color:#d63638;margin-left:4px}.formative-builder-preview .preview-field .description{color:#666;font-size:13px;font-style:italic;margin-top:6px}.formative-builder-preview .preview-field input[type=email],.formative-builder-preview .preview-field input[type=number],.formative-builder-preview .preview-field input[type=tel],.formative-builder-preview .preview-field input[type=text],.formative-builder-preview .preview-field input[type=url],.formative-builder-preview .preview-field select,.formative-builder-preview .preview-field textarea{border:1px solid #ddd;border-radius:4px;font-size:14px;padding:10px 12px;transition:border-color .2s;width:100%}.formative-builder-preview .preview-field input[type=email]:focus,.formative-builder-preview .preview-field input[type=number]:focus,.formative-builder-preview .preview-field input[type=tel]:focus,.formative-builder-preview .preview-field input[type=text]:focus,.formative-builder-preview .preview-field input[type=url]:focus,.formative-builder-preview .preview-field select:focus,.formative-builder-preview .preview-field textarea:focus{border-color:#000;box-shadow:0 0 0 1px #000;outline:none}.formative-builder-preview .preview-field input[type=email]::-moz-placeholder,.formative-builder-preview .preview-field input[type=number]::-moz-placeholder,.formative-builder-preview .preview-field input[type=tel]::-moz-placeholder,.formative-builder-preview .preview-field input[type=text]::-moz-placeholder,.formative-builder-preview .preview-field input[type=url]::-moz-placeholder,.formative-builder-preview .preview-field select::-moz-placeholder,.formative-builder-preview .preview-field textarea::-moz-placeholder{color:#999}.formative-builder-preview .preview-field input[type=email]::placeholder,.formative-builder-preview .preview-field input[type=number]::placeholder,.formative-builder-preview .preview-field input[type=tel]::placeholder,.formative-builder-preview .preview-field input[type=text]::placeholder,.formative-builder-preview .preview-field input[type=url]::placeholder,.formative-builder-preview .preview-field select::placeholder,.formative-builder-preview .preview-field textarea::placeholder{color:#999}.formative-builder-preview .preview-field textarea{min-height:100px;resize:vertical}.formative-builder-preview .preview-field .checkbox-group,.formative-builder-preview .preview-field .radio-group{display:flex;flex-direction:column;gap:8px}.formative-builder-preview .preview-field .checkbox-group label,.formative-builder-preview .preview-field .radio-group label{align-items:center;display:flex;font-weight:400;margin:0}.formative-builder-preview .preview-field .checkbox-group label input,.formative-builder-preview .preview-field .radio-group label input{margin-right:8px}.formative-builder-preview .preview-submit{margin-top:24px}.formative-builder-preview .preview-submit button{background:#000;border:none;border-radius:4px;color:#fff;cursor:pointer;font-size:14px;font-weight:500;padding:12px 24px;transition:background .2s}.formative-builder-preview .preview-submit button:hover{background:#005a87}.formative-builder-preview .preview-empty-state{color:#666;padding:60px 20px;text-align:center}.formative-builder-preview .preview-empty-state svg{display:inline-block;margin-bottom:16px}.formative-builder-preview .preview-empty-state h4{color:#1e1e1e;font-size:16px;margin:0 0 8px}.formative-builder-preview .preview-empty-state p{font-size:14px;margin:0}@media(max-width:1400px){.formative-builder-preview{width:360px}}@media(max-width:1200px){.formative-builder-layout{flex-wrap:wrap}.formative-builder-sidebar{width:100%}.formative-builder-canvas,.formative-builder-preview{width:calc(50% - 12px)}}@media(max-width:768px){.formative-builder-canvas,.formative-builder-preview{width:100%}.formative-builder-preview{max-height:none;position:static}}.formative-field-types{display:grid;gap:8px;grid-template-columns:1fr 1fr}.formative-field-types>div[draggable]{cursor:grab;transition:opacity .2s,transform .1s}.formative-field-types>div[draggable]:active{cursor:grabbing}.formative-field-types>div[draggable].is-dragging{opacity:.5;transform:scale(.95)}.formative-field-types>div[draggable]:hover{transform:translateY(-1px)}.formative-field-types button{align-items:center;display:flex;gap:6px;justify-content:center;width:100%}.formative-field-types button svg{flex-shrink:0;opacity:.7}.formative-field-types button:hover svg{opacity:1}.formative-field-item{background:#f9f9f9;border:1px solid #ddd;border-radius:4px;margin-bottom:12px;overflow:hidden}.formative-field-header{align-items:center;cursor:pointer;display:flex;justify-content:space-between;padding:12px 16px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.formative-field-title{align-items:center;display:flex;font-weight:500;gap:8px}.formative-field-type{color:#666;font-size:12px}.formative-field-actions{display:flex;gap:4px}.formative-field-content{background:#fff;border-top:1px solid #ddd;padding:16px}.formative-responsive-controls{margin-top:16px}.formative-device-switcher{margin-bottom:16px}.formative-settings-sections{display:flex;flex-direction:column;gap:24px}.formative-settings-section{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08);padding:24px}.formative-settings-section h2{font-size:18px;margin:0 0 8px}.formative-settings-section .description{color:#666;margin-bottom:20px}.formative-modal-overlay{align-items:center;background:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:999999}.formative-modal{background:#fff;border-radius:8px;box-shadow:0 10px 40px rgba(0,0,0,.3);max-height:80vh;max-width:600px;overflow:auto;width:90%}.formative-modal-header{align-items:center;border-bottom:1px solid #ddd;display:flex;justify-content:space-between;padding:20px}.formative-modal-content{padding:20px}.formative-entry-field{background:#f9f9f9;border-radius:4px;display:flex;flex-direction:column;gap:4px;margin-bottom:12px;padding:12px}.formative-settings-modal .components-modal__content{display:flex;flex-direction:column;margin-top:0;padding:0}.formative-settings-modal .components-modal__header{border-bottom:1px solid #ddd;flex-shrink:0;padding:20px 24px;position:relative;z-index:1}.formative-settings-modal .components-tab-panel__tabs{background:#f9f9f9;border-bottom:1px solid #ddd;display:flex;flex-shrink:0;flex-wrap:wrap;gap:4px;padding:16px 24px;position:relative;z-index:2}.formative-settings-modal .components-tab-panel__tabs-item{background:#fff;border:1px solid #ddd;border-radius:4px;cursor:pointer;font-size:13px;padding:8px 16px;position:relative;transition:all .2s;z-index:3}.formative-settings-modal .components-tab-panel__tabs-item:hover{background:#f0f0f0}.formative-settings-modal .components-tab-panel__tabs-item.is-active{background:#2271b1;border-color:#2271b1;color:#fff}.formative-settings-modal .components-tab-panel__tab-content{flex:1;max-height:60vh;overflow-y:auto;padding:24px}.formative-settings-tab{display:flex;flex-direction:column;gap:20px}.formative-settings-tab .components-notice{margin:0 0 20px;padding:12px 16px}.formative-settings-tab .components-notice p{margin:0}.formative-settings-tab .components-base-control{margin-bottom:20px}.formative-settings-tab .components-base-control:last-child{margin-bottom:0}.formative-settings-tab .components-toggle-control{background:#f9f9f9;border:1px solid #ddd;border-radius:4px;padding:16px}.formative-settings-tab .components-toggle-control .components-base-control__field{margin-bottom:0}.formative-settings-tab .components-toggle-control:has(.components-form-toggle:disabled){cursor:not-allowed;opacity:.5}.formative-integration-option{margin-bottom:12px}.formative-modal-footer{background:#f9f9f9;border-top:1px solid #ddd;display:flex;gap:12px;justify-content:flex-end;padding:16px 24px}.formative-form-preview-container{background:#f9f9f9;border-radius:4px;min-height:400px;padding:20px}.formative-form-preview-container .formative-form{background:#fff;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);margin:0 auto;max-width:600px;padding:30px}.formative-form-preview-container .formative-field-wrapper{margin-bottom:20px}.formative-form-preview-container .formative-field-label{color:#333;display:block;font-weight:600;margin-bottom:8px}.formative-form-preview-container .formative-required{color:#dc3232;margin-left:4px}.formative-form-preview-container .formative-field-help{color:#666;font-size:13px;margin:6px 0 0}.formative-form-preview-container .formative-input,.formative-form-preview-container .formative-select,.formative-form-preview-container .formative-textarea{border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;padding:10px 12px;width:100%}.formative-form-preview-container .formative-input:disabled,.formative-form-preview-container .formative-select:disabled,.formative-form-preview-container .formative-textarea:disabled{background:#f5f5f5;cursor:not-allowed}.formative-form-preview-container .formative-textarea{min-height:100px;resize:vertical}.formative-form-preview-container .formative-checkbox-group,.formative-form-preview-container .formative-radio-group{display:flex;flex-direction:column;gap:8px}.formative-form-preview-container .formative-checkbox-label,.formative-form-preview-container .formative-radio-label{align-items:center;cursor:pointer;display:flex;gap:8px}.formative-form-preview-container .formative-checkbox-label input,.formative-form-preview-container .formative-radio-label input{margin:0}.formative-form-preview-container .formative-submit-button{background:#2271b1;border:none;border-radius:4px;color:#fff;cursor:pointer;font-size:14px;font-weight:600;padding:12px 24px}.formative-form-preview-container .formative-submit-button:disabled{cursor:not-allowed;opacity:.6}@media(max-width:768px){.formative-admin-wrapper{margin:0}.formative-admin-container{flex-direction:column}.formative-admin-sidebar{border-bottom:1px solid #ddd;border-right:none;width:100%}.formative-builder-layout{flex-direction:column}.formative-builder-sidebar{width:100%}}.formative-template-selector{margin:0 auto;max-width:1200px}.formative-template-header{margin-bottom:48px;text-align:center}.formative-template-header h1{color:#1e1e1e;font-size:32px;font-weight:600;margin:0 0 12px}.formative-template-header p{color:#666;font-size:16px;margin:0}.formative-template-grid{display:grid;gap:24px;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));margin-bottom:40px}.formative-template-card{background:#fff;border:2px solid #e0e0e0;border-radius:12px;cursor:pointer;padding:32px 24px;position:relative;text-align:center;transition:all .2s ease}.formative-template-card:hover{border-color:#000;box-shadow:0 4px 12px rgba(0,115,170,.15);transform:translateY(-2px)}.formative-template-card:focus{outline:2px solid #000;outline-offset:2px}.formative-template-card h3{color:#1e1e1e;font-size:18px;font-weight:600;margin:16px 0 8px}.formative-template-card p{color:#666;font-size:14px;line-height:1.5;margin:0}.formative-template-icon{align-items:center;background:#000;border-radius:16px;color:#fff;display:inline-flex;height:80px;justify-content:center;margin:0 auto;width:80px}.formative-template-badge{background:#f0f0f1;border-radius:12px;color:#666;font-size:12px;font-weight:500;padding:4px 10px;position:absolute;right:16px;top:16px}.formative-builder-mode .formative-admin-content{max-width:none;padding:0}.formative-builder-wrapper{display:flex;flex-direction:column;height:calc(100vh - 65px)}@media(max-width:768px){.formative-template-grid{gap:16px;grid-template-columns:1fr}.formative-template-card{padding:24px 20px}.formative-template-icon{height:60px;width:60px}.formative-template-icon svg{height:32px;width:32px}} -
formative/trunk/build/admin.js
r3426920 r3428303 1 (()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.element,a=window.wp.i18n,r=window.React;function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},i.apply(this,arguments)}var n;!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(n||(n={}));const s="popstate";function o(e,t){if(!1===e||null==e)throw new Error(t)}function l(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function c(e,t){return{usr:e.state,key:e.key,idx:t}}function d(e,t,a,r){return void 0===a&&(a=null),i({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?h(t):t,{state:a,key:t&&t.key||r||Math.random().toString(36).substr(2,8)})}function m(e){let{pathname:t="/",search:a="",hash:r=""}=e;return a&&"?"!==a&&(t+="?"===a.charAt(0)?a:"?"+a),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function h(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substr(a),e=e.substr(0,a));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var u;function p(e,t,a){return void 0===a&&(a="/"),function(e,t,a,r){let i=E(("string"==typeof t?h(t):t).pathname||"/",a);if(null==i)return null;let n=v(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,a)=>e===t[a])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(n);let s=null;for(let e=0;null==s&&e<n.length;++e){let t=S(i);s=w(n[e],t,r)}return s}(e,t,a,!1)}function v(e,t,a,r){void 0===t&&(t=[]),void 0===a&&(a=[]),void 0===r&&(r="");let i=(e,i,n)=>{let s={relativePath:void 0===n?e.path||"":n,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};s.relativePath.startsWith("/")&&(o(s.relativePath.startsWith(r),'Absolute route path "'+s.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),s.relativePath=s.relativePath.slice(r.length));let l=B([r,s.relativePath]),c=a.concat(s);e.children&&e.children.length>0&&(o(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),v(e.children,t,c,l)),(null!=e.path||e.index)&&t.push({path:l,score:k(l,e.index),routesMeta:c})};return e.forEach((e,t)=>{var a;if(""!==e.path&&null!=(a=e.path)&&a.includes("?"))for(let a of f(e.path))i(e,t,a);else i(e,t)}),t}function f(e){let t=e.split("/");if(0===t.length)return[];let[a,...r]=t,i=a.endsWith("?"),n=a.replace(/\?$/,"");if(0===r.length)return i?[n,""]:[n];let s=f(r.join("/")),o=[];return o.push(...s.map(e=>""===e?n:[n,e].join("/"))),i&&o.push(...s),o.map(t=>e.startsWith("/")&&""===t?"/":t)}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(u||(u={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const g=/^:[\w-]+$/,x=3,_=2,b=1,y=10,j=-2,C=e=>"*"===e;function k(e,t){let a=e.split("/"),r=a.length;return a.some(C)&&(r+=j),t&&(r+=_),a.filter(e=>!C(e)).reduce((e,t)=>e+(g.test(t)?x:""===t?b:y),r)}function w(e,t,a){void 0===a&&(a=!1);let{routesMeta:r}=e,i={},n="/",s=[];for(let e=0;e<r.length;++e){let o=r[e],l=e===r.length-1,c="/"===n?t:t.slice(n.length)||"/",d=N({path:o.relativePath,caseSensitive:o.caseSensitive,end:l},c),m=o.route;if(!d&&l&&a&&!r[r.length-1].route.index&&(d=N({path:o.relativePath,caseSensitive:o.caseSensitive,end:!1},c)),!d)return null;Object.assign(i,d.params),s.push({params:i,pathname:B([n,d.pathname]),pathnameBase:F(B([n,d.pathnameBase])),route:m}),"/"!==d.pathnameBase&&(n=B([n,d.pathnameBase]))}return s}function N(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[a,r]=function(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!0),l("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,a)=>(r.push({paramName:t,isOptional:null!=a}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),i=t.match(a);if(!i)return null;let n=i[0],s=n.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((e,t,a)=>{let{paramName:r,isOptional:i}=t;if("*"===r){let e=o[a]||"";s=n.slice(0,n.length-e.length).replace(/(.)\/+$/,"$1")}const l=o[a];return e[r]=i&&!l?void 0:(l||"").replace(/%2F/g,"/"),e},{}),pathname:n,pathnameBase:s,pattern:e}}function S(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return l(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function E(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,r=e.charAt(a);return r&&"/"!==r?null:e.slice(a)||"/"}const T=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function D(e,t){let a=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?a.length>1&&a.pop():"."!==e&&a.push(e)}),a.length>1?a.join("/"):"/"}function P(e,t,a,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+a+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function M(e,t){let a=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t?a.map((e,t)=>t===a.length-1?e.pathname:e.pathnameBase):a.map(e=>e.pathnameBase)}function R(e,t,a,r){let n;void 0===r&&(r=!1),"string"==typeof e?n=h(e):(n=i({},e),o(!n.pathname||!n.pathname.includes("?"),P("?","pathname","search",n)),o(!n.pathname||!n.pathname.includes("#"),P("#","pathname","hash",n)),o(!n.search||!n.search.includes("#"),P("#","search","hash",n)));let s,c=""===e||""===n.pathname,d=c?"/":n.pathname;if(null==d)s=a;else{let e=t.length-1;if(!r&&d.startsWith("..")){let t=d.split("/");for(;".."===t[0];)t.shift(),e-=1;n.pathname=t.join("/")}s=e>=0?t[e]:"/"}let m=function(e,t){void 0===t&&(t="/");let a,{pathname:r,search:i="",hash:n=""}="string"==typeof e?h(e):e;if(r)if(s=r,T.test(s))a=r;else{if(r.includes("//")){let e=r;r=r.replace(/\/\/+/g,"/"),l(!1,"Pathnames cannot have embedded double slashes - normalizing "+e+" -> "+r)}a=r.startsWith("/")?D(r.substring(1),"/"):D(r,t)}else a=t;var s;return{pathname:a,search:A(i),hash:L(n)}}(n,s),u=d&&"/"!==d&&d.endsWith("/"),p=(c||"."===d)&&a.endsWith("/");return m.pathname.endsWith("/")||!u&&!p||(m.pathname+="/"),m}const B=e=>e.join("/").replace(/\/\/+/g,"/"),F=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),A=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",L=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const z=["post","put","patch","delete"],U=(new Set(z),["get",...z]);function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},q.apply(this,arguments)}new Set(U),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const O=r.createContext(null),W=r.createContext(null),$=r.createContext(null),I=r.createContext(null),H=r.createContext({outlet:null,matches:[],isDataRoute:!1}),V=r.createContext(null);function G(){return null!=r.useContext(I)}function Y(){return G()||o(!1),r.useContext(I).location}function J(e){r.useContext($).static||r.useLayoutEffect(e)}function K(){let{isDataRoute:e}=r.useContext(H);return e?function(){let{router:e}=function(){let e=r.useContext(O);return e||o(!1),e}(re.UseNavigateStable),t=ne(ie.UseNavigateStable),a=r.useRef(!1);return J(()=>{a.current=!0}),r.useCallback(function(r,i){void 0===i&&(i={}),a.current&&("number"==typeof r?e.navigate(r):e.navigate(r,q({fromRouteId:t},i)))},[e,t])}():function(){G()||o(!1);let e=r.useContext(O),{basename:t,future:a,navigator:i}=r.useContext($),{matches:n}=r.useContext(H),{pathname:s}=Y(),l=JSON.stringify(M(n,a.v7_relativeSplatPath)),c=r.useRef(!1);return J(()=>{c.current=!0}),r.useCallback(function(a,r){if(void 0===r&&(r={}),!c.current)return;if("number"==typeof a)return void i.go(a);let n=R(a,JSON.parse(l),s,"path"===r.relative);null==e&&"/"!==t&&(n.pathname="/"===n.pathname?t:B([t,n.pathname])),(r.replace?i.replace:i.push)(n,r.state,r)},[t,i,l,s,e])}()}function Q(e,t){let{relative:a}=void 0===t?{}:t,{future:i}=r.useContext($),{matches:n}=r.useContext(H),{pathname:s}=Y(),o=JSON.stringify(M(n,i.v7_relativeSplatPath));return r.useMemo(()=>R(e,JSON.parse(o),s,"path"===a),[e,o,s,a])}function Z(e,t,a,i){G()||o(!1);let{navigator:s}=r.useContext($),{matches:l}=r.useContext(H),c=l[l.length-1],d=c?c.params:{},m=(c&&c.pathname,c?c.pathnameBase:"/");c&&c.route;let u,v=Y();if(t){var f;let e="string"==typeof t?h(t):t;"/"===m||(null==(f=e.pathname)?void 0:f.startsWith(m))||o(!1),u=e}else u=v;let g=u.pathname||"/",x=g;if("/"!==m){let e=m.replace(/^\//,"").split("/");x="/"+g.replace(/^\//,"").split("/").slice(e.length).join("/")}let _=p(e,{pathname:x}),b=function(e,t,a,i){var n;if(void 0===t&&(t=[]),void 0===a&&(a=null),void 0===i&&(i=null),null==e){var s;if(!a)return null;if(a.errors)e=a.matches;else{if(!(null!=(s=i)&&s.v7_partialHydration&&0===t.length&&!a.initialized&&a.matches.length>0))return null;e=a.matches}}let l=e,c=null==(n=a)?void 0:n.errors;if(null!=c){let e=l.findIndex(e=>e.route.id&&void 0!==(null==c?void 0:c[e.route.id]));e>=0||o(!1),l=l.slice(0,Math.min(l.length,e+1))}let d=!1,m=-1;if(a&&i&&i.v7_partialHydration)for(let e=0;e<l.length;e++){let t=l[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(m=e),t.route.id){let{loaderData:e,errors:r}=a,i=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||i){d=!0,l=m>=0?l.slice(0,m+1):[l[0]];break}}}return l.reduceRight((e,i,n)=>{let s,o=!1,h=null,u=null;var p;a&&(s=c&&i.route.id?c[i.route.id]:void 0,h=i.route.errorElement||ee,d&&(m<0&&0===n?(se[p="route-fallback"]||(se[p]=!0),o=!0,u=null):m===n&&(o=!0,u=i.route.hydrateFallbackElement||null)));let v=t.concat(l.slice(0,n+1)),f=()=>{let t;return t=s?h:o?u:i.route.Component?r.createElement(i.route.Component,null):i.route.element?i.route.element:e,r.createElement(ae,{match:i,routeContext:{outlet:e,matches:v,isDataRoute:null!=a},children:t})};return a&&(i.route.ErrorBoundary||i.route.errorElement||0===n)?r.createElement(te,{location:a.location,revalidation:a.revalidation,component:h,error:s,children:f(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):f()},null)}(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},d,e.params),pathname:B([m,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?m:B([m,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),l,a,i);return t&&b?r.createElement(I.Provider,{value:{location:q({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:n.Pop}},b):b}function X(){let e=function(){var e;let t=r.useContext(V),a=function(){let e=r.useContext(W);return e||o(!1),e}(ie.UseRouteError),i=ne(ie.UseRouteError);return void 0!==t?t:null==(e=a.errors)?void 0:e[i]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return r.createElement(r.Fragment,null,r.createElement("h2",null,"Unexpected Application Error!"),r.createElement("h3",{style:{fontStyle:"italic"}},t),a?r.createElement("pre",{style:i},a):null,null)}const ee=r.createElement(X,null);class te extends r.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?r.createElement(H.Provider,{value:this.props.routeContext},r.createElement(V.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ae(e){let{routeContext:t,match:a,children:i}=e,n=r.useContext(O);return n&&n.static&&n.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=a.route.id),r.createElement(H.Provider,{value:t},i)}var re=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(re||{}),ie=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ie||{});function ne(e){let t=function(){let e=r.useContext(H);return e||o(!1),e}(),a=t.matches[t.matches.length-1];return a.route.id||o(!1),a.route.id}const se={};function oe(e){let{to:t,replace:a,state:i,relative:n}=e;G()||o(!1);let{future:s,static:l}=r.useContext($),{matches:c}=r.useContext(H),{pathname:d}=Y(),m=K(),h=R(t,M(c,s.v7_relativeSplatPath),d,"path"===n),u=JSON.stringify(h);return r.useEffect(()=>m(JSON.parse(u),{replace:a,state:i,relative:n}),[m,u,n,a,i]),null}function le(e){o(!1)}function ce(e){let{basename:t="/",children:a=null,location:i,navigationType:s=n.Pop,navigator:l,static:c=!1,future:d}=e;G()&&o(!1);let m=t.replace(/^\/*/,"/"),u=r.useMemo(()=>({basename:m,navigator:l,static:c,future:q({v7_relativeSplatPath:!1},d)}),[m,d,l,c]);"string"==typeof i&&(i=h(i));let{pathname:p="/",search:v="",hash:f="",state:g=null,key:x="default"}=i,_=r.useMemo(()=>{let e=E(p,m);return null==e?null:{location:{pathname:e,search:v,hash:f,state:g,key:x},navigationType:s}},[m,p,v,f,g,x,s]);return null==_?null:r.createElement($.Provider,{value:u},r.createElement(I.Provider,{children:a,value:_}))}function de(e){let{children:t,location:a}=e;return Z(me(t),a)}function me(e,t){void 0===t&&(t=[]);let a=[];return r.Children.forEach(e,(e,i)=>{if(!r.isValidElement(e))return;let n=[...t,i];if(e.type===r.Fragment)return void a.push.apply(a,me(e.props.children,n));e.type!==le&&o(!1),e.props.index&&e.props.children&&o(!1);let s={id:e.props.id||n.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(s.children=me(e.props.children,n)),a.push(s)}),a}r.startTransition,new Promise(()=>{}),r.Component;const he=window.ReactDOM;function ue(){return ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ue.apply(this,arguments)}function pe(e,t){if(null==e)return{};var a,r,i={},n=Object.keys(e);for(r=0;r<n.length;r++)a=n[r],t.indexOf(a)>=0||(i[a]=e[a]);return i}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const ve=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],fe=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"];try{window.__reactRouterVersion="6"}catch(e){}const ge=r.createContext({isTransitioning:!1});new Map;const xe=r.startTransition;function _e(e){let{basename:t,children:a,future:u,window:p}=e,v=r.useRef();var f;null==v.current&&(v.current=(void 0===(f={window:p,v5Compat:!0})&&(f={}),function(e,t,a,r){void 0===r&&(r={});let{window:l=document.defaultView,v5Compat:h=!1}=r,u=l.history,p=n.Pop,v=null,f=g();function g(){return(u.state||{idx:null}).idx}function x(){p=n.Pop;let e=g(),t=null==e?null:e-f;f=e,v&&v({action:p,location:b.location,delta:t})}function _(e){let t="null"!==l.location.origin?l.location.origin:l.location.href,a="string"==typeof e?e:m(e);return a=a.replace(/ $/,"%20"),o(t,"No window.location.(origin|href) available to create URL for href: "+a),new URL(a,t)}null==f&&(f=0,u.replaceState(i({},u.state,{idx:f}),""));let b={get action(){return p},get location(){return e(l,u)},listen(e){if(v)throw new Error("A history only accepts one active listener");return l.addEventListener(s,x),v=e,()=>{l.removeEventListener(s,x),v=null}},createHref:e=>t(l,e),createURL:_,encodeLocation(e){let t=_(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){p=n.Push;let r=d(b.location,e,t);a&&a(r,e),f=g()+1;let i=c(r,f),s=b.createHref(r);try{u.pushState(i,"",s)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;l.location.assign(s)}h&&v&&v({action:p,location:b.location,delta:1})},replace:function(e,t){p=n.Replace;let r=d(b.location,e,t);a&&a(r,e),f=g();let i=c(r,f),s=b.createHref(r);u.replaceState(i,"",s),h&&v&&v({action:p,location:b.location,delta:0})},go:e=>u.go(e)};return b}(function(e,t){let{pathname:a="/",search:r="",hash:i=""}=h(e.location.hash.substr(1));return a.startsWith("/")||a.startsWith(".")||(a="/"+a),d("",{pathname:a,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let a=e.document.querySelector("base"),r="";if(a&&a.getAttribute("href")){let t=e.location.href,a=t.indexOf("#");r=-1===a?t:t.slice(0,a)}return r+"#"+("string"==typeof t?t:m(t))},function(e,t){l("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")},f)));let g=v.current,[x,_]=r.useState({action:g.action,location:g.location}),{v7_startTransition:b}=u||{},y=r.useCallback(e=>{b&&xe?xe(()=>_(e)):_(e)},[_,b]);return r.useLayoutEffect(()=>g.listen(y),[g,y]),r.useEffect(()=>{return null==(e=u)||e.v7_startTransition,void 0===(null==e?void 0:e.v7_relativeSplatPath)&&(!t||t.v7_relativeSplatPath),void(t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation));var e,t},[u]),r.createElement(ce,{basename:t,children:a,location:x.location,navigationType:x.action,navigator:g,future:u})}he.flushSync,r.useId;const be="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,ye=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,je=r.forwardRef(function(e,t){let a,{onClick:i,relative:n,reloadDocument:s,replace:l,state:c,target:d,to:h,preventScrollReset:u,viewTransition:p}=e,v=pe(e,ve),{basename:f}=r.useContext($),g=!1;if("string"==typeof h&&ye.test(h)&&(a=h,be))try{let e=new URL(window.location.href),t=h.startsWith("//")?new URL(e.protocol+h):new URL(h),a=E(t.pathname,f);t.origin===e.origin&&null!=a?h=a+t.search+t.hash:g=!0}catch(e){}let x=function(e,t){let{relative:a}=void 0===t?{}:t;G()||o(!1);let{basename:i,navigator:n}=r.useContext($),{hash:s,pathname:l,search:c}=Q(e,{relative:a}),d=l;return"/"!==i&&(d="/"===l?i:B([i,l])),n.createHref({pathname:d,search:c,hash:s})}(h,{relative:n}),_=function(e,t){let{target:a,replace:i,state:n,preventScrollReset:s,relative:o,viewTransition:l}=void 0===t?{}:t,c=K(),d=Y(),h=Q(e,{relative:o});return r.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,a)){t.preventDefault();let a=void 0!==i?i:m(d)===m(h);c(e,{replace:a,state:n,preventScrollReset:s,relative:o,viewTransition:l})}},[d,c,h,i,n,a,e,s,o,l])}(h,{replace:l,state:c,target:d,preventScrollReset:u,relative:n,viewTransition:p});return r.createElement("a",ue({},v,{href:a||x,onClick:g||s?i:function(e){i&&i(e),e.defaultPrevented||_(e)},ref:t,target:d}))}),Ce=r.forwardRef(function(e,t){let{"aria-current":a="page",caseSensitive:i=!1,className:n="",end:s=!1,style:l,to:c,viewTransition:d,children:m}=e,h=pe(e,fe),u=Q(c,{relative:h.relative}),p=Y(),v=r.useContext(W),{navigator:f,basename:g}=r.useContext($),x=null!=v&&function(e,t){void 0===t&&(t={});let a=r.useContext(ge);null==a&&o(!1);let{basename:i}=function(){let e=r.useContext(O);return e||o(!1),e}(ke.useViewTransitionState),n=Q(e,{relative:t.relative});if(!a.isTransitioning)return!1;let s=E(a.currentLocation.pathname,i)||a.currentLocation.pathname,l=E(a.nextLocation.pathname,i)||a.nextLocation.pathname;return null!=N(n.pathname,l)||null!=N(n.pathname,s)}(u)&&!0===d,_=f.encodeLocation?f.encodeLocation(u).pathname:u.pathname,b=p.pathname,y=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;i||(b=b.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&g&&(y=E(y,g)||y);const j="/"!==_&&_.endsWith("/")?_.length-1:_.length;let C,k=b===_||!s&&b.startsWith(_)&&"/"===b.charAt(j),w=null!=y&&(y===_||!s&&y.startsWith(_)&&"/"===y.charAt(_.length)),S={isActive:k,isPending:w,isTransitioning:x},T=k?a:void 0;C="function"==typeof n?n(S):[n,k?"active":null,w?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let D="function"==typeof l?l(S):l;return r.createElement(je,ue({},h,{"aria-current":T,className:C,ref:t,style:D,to:c,viewTransition:d}),"function"==typeof m?m(S):m)});var ke,we;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ke||(ke={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(we||(we={}));const Ne=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,a)=>a?a.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Se=(...e)=>e.filter((e,t,a)=>Boolean(e)&&""!==e.trim()&&a.indexOf(e)===t).join(" ").trim(),Ee=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var Te={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const De=(0,r.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:n="",children:s,iconNode:o,...l},c)=>(0,r.createElement)("svg",{ref:c,...Te,width:t,height:t,stroke:e,strokeWidth:i?24*Number(a)/Number(t):a,className:Se("lucide",n),...!s&&!Ee(l)&&{"aria-hidden":"true"},...l},[...o.map(([e,t])=>(0,r.createElement)(e,t)),...Array.isArray(s)?s:[s]])),Pe=(e,t)=>{const a=(0,r.forwardRef)(({className:a,...i},n)=>{return(0,r.createElement)(De,{ref:n,iconNode:t,className:Se(`lucide-${s=Ne(e),s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,a),...i});var s});return a.displayName=Ne(e),a},Me=Pe("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]),Re=window.ReactJSXRuntime,Be=()=>(0,Re.jsxs)("div",{className:"formative-admin-header",children:[(0,Re.jsx)("div",{className:"formative-admin-header-left",children:(0,Re.jsxs)("h1",{className:"formative-logo",children:[(0,Re.jsx)("span",{className:"formative-logo-icon",children:(0,Re.jsx)(Me,{size:24})}),(0,a.__)("Formative","formative")]})}),(0,Re.jsx)("div",{className:"formative-admin-header-right",children:(0,Re.jsx)("span",{className:"formative-version",children:"v1.0.0"})})]}),Fe=Pe("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),Ae=Pe("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),Le=Pe("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),ze=Pe("inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]),Ue=Pe("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),qe=()=>{const e=[{path:"/",label:(0,a.__)("Dashboard","formative"),icon:Fe,exact:!0},{path:"/forms",label:(0,a.__)("All Forms","formative"),icon:Ae},{path:"/forms/templates",label:(0,a.__)("Add New","formative"),icon:Le},{path:"/entries",label:(0,a.__)("Entries","formative"),icon:ze},{path:"/settings",label:(0,a.__)("Settings","formative"),icon:Ue}];return(0,Re.jsx)("div",{className:"formative-admin-sidebar",children:(0,Re.jsx)("nav",{className:"formative-admin-nav",children:e.map(e=>{const t=e.icon;return(0,Re.jsxs)(Ce,{to:e.path,end:e.exact,className:({isActive:e})=>"formative-nav-item "+(e?"active":""),children:[(0,Re.jsx)("span",{className:"formative-nav-icon",children:(0,Re.jsx)(t,{size:20})}),(0,Re.jsx)("span",{className:"formative-nav-label",children:e.label})]},e.path)})})})},Oe=window.wp.apiFetch;var We=e.n(Oe);const $e=()=>{const[e,r]=(0,t.useState)({totalForms:0,totalEntries:0,recentForms:[],recentEntries:[]}),[i,n]=(0,t.useState)(!0);(0,t.useEffect)(()=>{s()},[]);const s=async()=>{try{const[e,t]=await Promise.all([We()({path:"/formative/v1/forms?per_page=5"}),We()({path:"/formative/v1/entries?per_page=5"})]);r({totalForms:e.data?.total||0,totalEntries:t.data?.total||0,recentForms:e.data?.forms||[],recentEntries:t.data?.entries||[]})}catch(e){console.error("Error fetching dashboard data:",e)}finally{n(!1)}};return i?(0,Re.jsx)("div",{className:"formative-loading",children:(0,a.__)("Loading...","formative")}):(0,Re.jsxs)("div",{className:"formative-dashboard",children:[(0,Re.jsx)("div",{className:"formative-page-header",children:(0,Re.jsx)("h1",{children:(0,a.__)("Dashboard","formative")})}),(0,Re.jsxs)("div",{className:"formative-stats-grid",children:[(0,Re.jsxs)("div",{className:"formative-stat-card",children:[(0,Re.jsx)("div",{className:"formative-stat-icon",children:(0,Re.jsx)(Ae,{size:32,strokeWidth:1.5})}),(0,Re.jsx s)("div",{className:"formative-stat-content",children:[(0,Re.jsx)("div",{className:"formative-stat-value",children:e.totalForms}),(0,Re.jsx)("div",{className:"formative-stat-label",children:(0,a.__)("Total Forms","formative")})]})]}),(0,Re.jsxs)("div",{className:"formative-stat-card",children:[(0,Re.jsx)("div",{className:"formative-stat-icon",children:(0,Re.jsx)(ze,{size:32,strokeWidth:1.5})}),(0,Re.jsxs)("div",{className:"formative-stat-content",children:[(0,Re.jsx)("div",{className:"formative-stat-value",children:e.totalEntries}),(0,Re.jsx)("div",{className:"formative-stat-label",children:(0,a.__)("Total Entries","formative")})]})]})]})," ",(0,Re.jsxs)("div",{className:"formative-dashboard-sections",children:[(0,Re.jsxs)("div",{className:"formative-dashboard-section",children:[(0,Re.jsx)("h2",{children:(0,a.__)("Recent Forms","formative")}),e.recentForms.length>0?(0,Re.jsx)("div",{className:"formative-recent-list",children:e.recentForms.map(e=>(0,Re.jsxs)("div",{className:"formative-recent-item",children:[(0,Re.jsx)("div",{className:"formative-recent-title",children:e.title}),(0,Re.jsxs)("div",{className:"formative-recent-meta",children:[e.entriesCount," ",(0,a.__)("entries","formative")]})]},e.id))}):(0,Re.jsx)("p",{children:(0,a.__)("No forms yet.","formative")})]}),(0,Re.jsxs)("div",{className:"formative-dashboard-section",children:[(0,Re.jsx)("h2",{children:(0,a.__)("Recent Entries","formative")}),e.recentEntries.length>0?(0,Re.jsx)("div",{className:"formative-recent-list",children:e.recentEntries.map(e=>(0,Re.jsxs)("div",{className:"formative-recent-item",children:[(0,Re.jsxs)("div",{className:"formative-recent-title",children:[(0,a.__)("Entry #","formative"),e.id]}),(0,Re.jsx)("div",{className:"formative-recent-meta",children:new Date(e.createdAt).toLocaleDateString()})]},e.id))}):(0,Re.jsx)("p",{children:(0,a.__)("No entries yet.","formative")})]})]})]})},Ie=window.wp.components,He=()=>{const[e,r]=(0,t.useState)([]),[i,n]=(0,t.useState)(!0),[s,o]=(0,t.useState)(1),[l,c]=(0,t.useState)(1),[d,m]=(0,t.useState)(null),h=K();(0,t.useEffect)(()=>{u()},[s]);const u=async()=>{n(!0);try{const e=await We()({path:`/formative/v1/forms?page=${s}&per_page=10`});e.success&&(r(e.data.forms),c(e.data.totalPages))}catch(e){console.error("Error fetching forms:",e)}finally{n(!1)}},p=e=>`${window.location.origin}/?formative_preview=${e}`,v=e=>{switch(e.type){case"textarea":return(0,Re.jsx)("textarea",{className:"formative-input formative-textarea",placeholder:e.placeholder,disabled:!0});case"select":return(0,Re.jsxs)("select",{className:"formative-input formative-select",disabled:!0,children:[(0,Re.jsx)("option",{children:e.placeholder||(0,a.__)("Select...","formative")}),e.options?.map((e,t)=>(0,Re.jsx)("option",{value:e.value,children:e.label},t))]});case"checkbox":return(0,Re.jsx)("div",{className:"formative-checkbox-group",children:e.options?.map((e,t)=>(0,Re.jsxs)("label",{className:"formative-checkbox-label",children:[(0,Re.jsx)("input",{type:"checkbox",disabled:!0}),(0,Re.jsx)("span",{children:e.label})]},t))});case"radio":return(0,Re.jsx)("div",{className:"formative-radio-group",children:e.options?.map((t,a)=>(0,Re.jsxs)("label",{className:"formative-radio-label",children:[(0,Re.jsx)("input",{type:"radio",name:e.name,disabled:!0}),(0,Re.jsx)("span",{children:t.label})]},a))});default:return(0,Re.jsx)("input",{type:e.type||"text",className:"formative-input",placeholder:e.placeholder,disabled:!0})}};return i?(0,Re.jsx)("div",{className:"formative-loading",children:(0,a.__)("Loading...","formative")}):(0,Re.jsxs)("div",{className:"formative-form-list",children:[(0,Re.jsxs)("div",{className:"formative-page-header",children:[(0,Re.jsx)("h1",{children:(0,a.__)("All Forms","formative")}),(0,Re.jsx)(Ie.Button,{isPrimary:!0,onClick:()=>h("/forms/templates"),children:(0,a.__)("Add New Form","formative")})]}),e.length>0?(0,Re.jsx)("div",{className:"formative-table-wrapper",children:(0,Re.jsxs)("table",{className:"formative-table",children:[(0,Re.jsx)("thead",{children:(0,Re.jsxs)("tr",{children:[(0,Re.jsx)("th",{children:(0,a.__)("Title","formative")}),(0,Re.jsx)("th",{children:(0,a.__)("Shortcode","formative")}),(0,Re.jsx)("th",{children:(0,a.__)("Entries","formative")}),(0,Re.jsx)("th",{children:(0,a.__)("Created","formative")}),(0,Re.jsx)("th",{children:(0,a.__)("Actions","formative")})]})}),(0,Re.jsx)("tbody",{children:e.map(e=>(0,Re.jsxs)("tr",{children:[(0,Re.jsx)("td",{children:(0,Re.jsx)("strong",{children:e.title})}),(0,Re.jsx)("td",{children:(0,Re.jsxs)("div",{className:"formative-shortcode-cell",children:[(0,Re.jsx)("code",{children:e.shortcode}),(0,Re.jsx)(Ie.Button,{isSmall:!0,onClick:()=>{return t=e.shortcode,navigator.clipboard.writeText(t),void alert((0,a.__)("Shortcode copied to clipboard!","formative"));var t},children:(0,a.__)("Copy","formative")})]})}),(0,Re.jsx)("td",{children:e.entriesCount}),(0,Re.jsx)("td",{children:new Date(e.createdAt).toLocaleDateString()}),(0,Re.jsx)("td",{children:(0,Re.jsxs)("div",{className:"formative-table-actions",children:[(0,Re.jsx)(Ie.Button,{isLink:!0,onClick:()=>h(`/forms/edit/${e.id}`),children:(0,a.__)("Edit","formative")}),(0,Re.jsx)(Ie.Button,{isLink:!0,onClick:()=>(e=>{m(e)})(e),children:(0,a.__)("Preview","formative")}),(0,Re.jsx)(Ie.Button,{isLink:!0,onClick:()=>window.open(p(e.id),"_blank"),children:(0,a.__)("View","formative")}),(0,Re.jsx)(Ie.Button,{isLink:!0,onClick:()=>(async e=>{try{await We()({path:`/formative/v1/forms/${e}/duplicate`,method:"POST"}),u()}catch(e){console.error("Error duplicating form:",e),alert((0,a.__)("Failed to duplicate form.","formative"))}})(e.id),children:(0,a.__)("Duplicate","formative")}),(0,Re.jsx)(Ie.Button,{isLink:!0,isDestructive:!0,onClick:()=>(async e=>{if(confirm((0,a.__)("Are you sure you want to delete this form?","formative")))try{await We()({path:`/formative/v1/forms/${e}`,method:"DELETE"}),u()}catch(e){console.error("Error deleting form:",e),alert((0,a.__)("Failed to delete form.","formative"))}})(e.id),children:(0,a.__)("Delete","formative")})]})})]},e.id))})]})}):(0,Re.jsxs)("div",{className:"formative-empty-state",children:[(0,Re.jsx)("p",{children:(0,a.__)("No forms found. Create your first form!","formative")}),(0,Re.jsx)(Ie.Button,{isPrimary:!0,onClick:()=>h("/forms/new"),children:(0,a.__)("Create Form","formative")})]}),l>1&&(0,Re.jsxs)("div",{className:"formative-pagination",children:[(0,Re.jsx)(Ie.Button,{disabled:1===s,onClick:()=>o(s-1),children:(0,a.__)("Previous","formative")}),(0,Re.jsxs)("span",{children:[(0,a.__)("Page","formative")," ",s," ",(0,a.__)("of","formative")," ",l]}),(0,Re.jsx)(Ie.Button,{disabled:s===l,onClick:()=>o(s+1),children:(0,a.__)("Next","formative")})]}),d&&(0,Re.jsxs)(Ie.Modal,{title:`${(0,a.__)("Preview:","formative")} ${d.title}`,onRequestClose:()=>m(null),className:"formative-preview-modal",style:{maxWidth:"800px"},children:[(f=d,f.fields&&0!==f.fields.length?(0,Re.jsx)("div",{className:"formative-form-preview",children:(0,Re.jsxs)("form",{className:"formative-form",children:[f.fields.map((e,t)=>(0,Re.jsxs)("div",{className:"formative-field-wrapper",children:[e.label&&(0,Re.jsxs)("label",{className:"formative-field-label",children:[e.label,e.required&&(0,Re.jsx)("span",{className:"formative-required",children:"*"})]}),(0,Re.jsx)("div",{className:"formative-field-input",children:v(e)}),e.helpText&&(0,Re.jsx)("p",{className:"formative-field-help",children:e.helpText})]},t)),(0,Re.jsx)("div",{className:"formative-field-wrapper",children:(0,Re.jsx)("button",{type:"button",className:"formative-submit-button",disabled:!0,children:f.settings?.submitButtonText||(0,a.__)("Submit","formative")})})]})}):(0,Re.jsx)("p",{children:(0,a.__)("This form has no fields to preview.","formative")})),(0,Re.jsxs)("div",{className:"formative-modal-footer",children:[(0,Re.jsx)(Ie.Button,{isPrimary:!0,onClick:()=>m(null),children:(0,a.__)("Close","formative")}),(0,Re.jsx)(Ie.Button,{isSecondary:!0,onClick:()=>window.open(p(d.id),"_blank"),children:(0,a.__)("View on Frontend","formative")})]})]})]});var f},Ve=Pe("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]),Ge=Pe("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),Ye=Pe("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),Je=Pe("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),Ke=Pe("shopping-cart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]),Qe=()=>{const e=K(),t=[{id:"blank",name:(0,a.__)("Start with Blank Template","formative"),description:(0,a.__)("Create a form from scratch with your own fields","formative"),icon:Me,fields:[]},{id:"contact",name:(0,a.__)("Contact Form","formative"),description:(0,a.__)("Simple contact form with name, email, and message","formative"),icon:Ve,fields:[{type:"text",label:"Name",name:"name",required:!0,placeholder:"Your name"},{type:"email",label:"Email",name:"email",required:!0,placeholder:"your@email.com"},{type:"tel",label:"Phone",name:"phone",placeholder:"Your phone number"},{type:"textarea",label:"Message",name:"message",required:!0,placeholder:"Your message",rows:5},{type:"submit",label:"Send Message",name:"submit"}]},{id:"registration",name:(0,a.__)("Registration Form","formative"),description:(0,a.__)("User registration with personal details","formative"),icon:Ge,fields:[{type:"firstname",label:"First Name",name:"first_name",required:!0,placeholder:"First name"},{type:"lastname",label:"Last Name",name:"last_name",required:!0,placeholder:"Last name"},{type:"email",label:"Email Address",name:"email",required:!0,placeholder:"your@email.com"},{type:"tel",label:"Phone Number",name:"phone",required:!0,placeholder:"Phone number"},{type:"password",label:"Password",name:"password",required:!0,placeholder:"Choose a password"},{type:"gdpr",label:"GDPR Consent",name:"gdpr_consent",required:!0},{type:"submit",label:"Register",name:"submit"}]},{id:"feedback",name:(0,a.__)("Feedback Form","formative"),description:(0,a.__)("Collect customer feedback with ratings","formative"),icon:Ye,fields:[{type:"text",label:"Name",name:"name",required:!0,placeholder:"Your name"},{type:"email",label:"Email",name:"email",required:!0,placeholder:"your@email.com"},{type:"rating",label:"Overall Satisfaction",name:"satisfaction",required:!0,maxRating:5},{type:"textarea",label:"Comments",name:"comments",placeholder:"Tell us more...",rows:5},{type:"submit",label:"Submit Feedback",name:"submit"}]},{id:"appointment",name:(0,a.__)("Appointment Booking","formative"),description:(0,a.__)("Schedule appointments with date and time selection","formative"),icon:Je,fields:[{type:"text",label:"Full Name",name:"name",required:!0,placeholder:"Your name"},{type:"email",label:"Email",name:"email",required:!0,placeholder:"your@email.com"},{type:"tel",label:"Phone",name:"phone",required:!0,placeholder:"Phone number"},{type:"date",label:"Preferred Date",name:"appointment_date",required:!0},{type:"time",label:"Preferred Time",name:"appointment_time",required:!0},{type:"textarea",label:"Additional Notes",name:"notes",placeholder:"Any special requirements",rows:3},{type:"submit",label:"Book Appointment",name:"submit"}]},{id:"order",name:(0,a.__)("Order Form","formative"),description:(0,a.__)("Product order form with quantity and options","formative"),icon:Ke,fields:[{type:"text",label:"Full Name",name:"name",required:!0,placeholder:"Your name"},{type:"email",label:"Email",name:"email",required:!0,placeholder:"your@email.com"},{type:"tel",label:"Phone",name:"phone",required:!0,placeholder:"Phone number"},{type:"select",label:"Product",name:"product",required:!0,options:["Select a product","Product A","Product B","Product C"]},{type:"number",label:"Quantity",name:"quantity",required:!0,min:1,max:100,defaultValue:1},{type:"textarea",label:"Delivery Address",name:"address",required:!0,placeholder:"Full delivery address",rows:3},{type:"submit",label:"Place Order",name:"submit"}]}],r=t=>{const a={id:t.id,name:t.name,description:t.description,fields:t.fields};e("/forms/new",{state:{template:a}})};return(0,Re.jsxs)("div",{className:"formative-template-selector",children:[(0,Re.jsxs)("div",{className:"formative-template-header",children:[(0,Re.jsx)("h1",{children:(0,a.__)("Choose a Template","formative")}),(0,Re.jsx)("p",{children:(0,a.__)("Select a template to get started quickly, or start from scratch","formative")})]}),(0,Re.jsx)("div",{className:"formative-template-grid",children:t.map(e=>{const t=e.icon;return(0,Re.jsxs)("div",{className:"formative-template-card",onClick:()=>r(e),role:"button",tabIndex:0,onKeyPress:t=>{"Enter"!==t.key&&" "!==t.key||r(e)},children:[(0,Re.jsx)("div",{className:"formative-template-icon",children:(0,Re.jsx)(t,{size:40,strokeWidth:1.5})}),(0,Re.jsx)("h3",{children:e.name}),(0,Re.jsx)("p",{children:e.description}),"blank"!==e.id&&(0,Re.jsxs)("div",{className:"formative-template-badge",children:[e.fields.length," ",(0,a.__)("fields","formative")]})]},e.id)})})]})},Ze=Pe("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),Xe=Pe("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),et=Pe("type",[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]),tt=Pe("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]),at=Pe("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]),rt=Pe("text-align-start",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]]),it=Pe("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),nt=Pe("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),st=Pe("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),ot=Pe("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),lt=Pe("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),ct=Pe("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),dt=Pe("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),mt=Pe("sliders-vertical",[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]]),ht=Pe("toggle-left",[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),ut=Pe("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),pt=Pe("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),vt=Pe("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),ft=Pe("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),gt=Pe("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),xt=Pe("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),_t=Pe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),bt=Pe("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),yt=Pe("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]),jt=Pe("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),Ct=({value:e={},onChange:r})=>{const[i,n]=(0,t.useState)("desktop"),s={desktop:{label:(0,a.__)("Desktop","formative"),icon:bt,minWidth:1024},tablet:{label:(0,a.__)("Tablet","formative"),icon:yt,minWidth:768},mobile:{label:(0,a.__)("Mobile","formative"),icon:jt,minWidth:320}},o=e[i]||{},l=(t,a)=>{const n={...e,[i]:{...o,[t]:a}};r(n)};return(0,Re.jsxs)("div",{className:"formative-responsive-controls",children:[(0,Re.jsx)("div",{className:"formative-device-switcher",children:(0,Re.jsx)(Ie.ButtonGroup,{children:Object.entries(s).map(([e,{label:t,icon:a}])=>(0,Re.jsxs)(Ie.Button,{isPressed:i===e,onClick:()=>n(e),children:[(0,Re.jsx)("span",{className:"formative-device-icon",children:(0,Re.jsx)(a,{size:16})}),(0,Re.jsx)("span",{className:"formative-device-label",children:t})]},e))})}),(0,Re.jsxs)("div",{className:"formative-responsive-settings",children:[(0,Re.jsx)("h4",{children:(0,a.__)("Spacing","formative")}),(0,Re.jsx)(Ie.__experimentalUnitControl,{label:(0,a.__)("Margin Top","formative"),value:o.marginTop||"0px",onChange:e=>l("marginTop",e),units:[{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"},{value:"%",label:"%"}]}),(0,Re.jsx)(Ie.__experimentalUnitControl,{label:(0,a.__)("Margin Bottom","formative"),value:o.marginBottom||"0px",onChange:e=>l("marginBottom",e),units:[{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"},{value:"%",label:"%"}]}),(0,Re.jsx)(Ie.__experimentalUnitControl,{label:(0,a.__)("Padding","formative"),value:o.padding||"0px",onChange:e=>l("padding",e),units:[{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"}]}),(0,Re.jsx)("h4",{children:(0,a.__)("Typography","formative")}),(0,Re.jsx)(Ie.__experimentalUnitControl,{label:(0,a.__)("Font Size","formative"),value:o.fontSize||"16px",onChange:e=>l("fontSize",e),units:[{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"}]}),(0,Re.jsx)("h4",{children:(0,a.__)("Layout","formative")}),(0,Re.jsx)(Ie.__experimentalUnitControl,{label:(0,a.__)("Width","formative"),value:o.width||"100%",onChange:e=>l("width",e),units:[{value:"%",label:"%"},{value:"px",label:"px"},{value:"vw",label:"vw"}]}),(0,Re.jsx)(Ie.SelectControl,{label:(0,a.__)("Display","formative"),value:o.display||"block",options:[{label:(0,a.__)("Block","formative"),value:"block"},{label:(0,a.__)("Inline Block","formative"),value:"inline-block"},{label:(0,a.__)("Flex","formative"),value:"flex"},{label:(0,a.__)("None","formative"),value:"none"}],onChange:e=>l("display",e)})]})]})},kt=({field:e,onUpdate:t,onClose:r,onMoveUp:i,onMoveDown:n,onDelete:s,canMoveUp:o,canMoveDown:l})=>{const c=["select","radio","checkbox"].includes(e.type),d=(a,r)=>{t({...e,[a]:r})},m=(t,a,r)=>{const i=[...e.options||[]];i[t]={...i[t],[a]:r},d("options",i)},h=()=>{const t=[...e.options||[],{label:`Option ${(e.options?.length||0)+1}`,value:`option${(e.options?.length||0)+1}`}];d("options",t)};return(0,Re.jsxs)("div",{className:"formative-field-settings-panel",children:[(0,Re.jsxs)("div",{className:"settings-panel-header",children:[(0,Re.jsxs)("div",{className:"settings-panel-title",children:[(0,Re.jsx)("h3",{children:(0,a.__)("Field Settings","formative")}),(0,Re.jsx)("span",{className:"field-type-badge",children:e.type})]}),(0,Re.jsxs)("div",{className:"settings-panel-actions",children:[o&&(0,Re.jsx)(Ie.Button,{onClick:i,label:(0,a.__)("Move up","formative"),icon:(0,Re.jsx)(gt,{size:16})}),l&&(0,Re.jsx)(Ie.Button,{onClick:n,label:(0,a.__)("Move down","formative"),icon:(0,Re.jsx)(it,{size:16})}),(0,Re.jsx)(Ie.Button,{onClick:()=>{confirm((0,a.__)("Delete this field?","formative"))&&(s(),r())},label:(0,a.__)("Delete","formative"),isDestructive:!0,icon:(0,Re.jsx)(xt,{size:16})}),(0,Re.jsx)(Ie.Button,{onClick:r,label:(0,a.__)("Close","formative"),icon:(0,Re.jsx)(_t,{size:20})})]})]}),(0,Re.jsx)("div",{className:"settings-panel-content",children:(0,Re.jsx)(Ie.TabPanel,{className:"formative-settings-tabs",activeClass:"is-active",tabs:[{name:"content",title:(0,a.__)("Content","formative"),className:"tab-content"},{name:"style",title:(0,a.__)("Style","formative"),className:"tab-style"},{name:"advanced",title:(0,a.__)("Advanced","formative"),className:"tab-advanced"}],children:t=>"content"===t.name?(0,Re.jsx)("div",{className:"tab-panel-content",children:(0,Re.jsxs)(Ie.Panel,{children:[(0,Re.jsxs)(Ie.PanelBody,{title:(0,a.__)("General","formative"),initialOpen:!0,children:[(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Label","formative"),value:e.label,onChange:e=>d("label",e)}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Field Name","formative"),value:e.name,onChange:e=>d("name",e),help:(0,a.__)("Unique identifier for this field","formative")}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Placeholder","formative"),value:e.placeholder,onChange:e=>d("placeholder",e)}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Help Text","formative"),value:e.helpText,onChange:e=>d("helpText",e)}),(0,Re.jsx)(Ie.CheckboxControl,{label:(0,a.__)("Required","formative"),checked:e.required,onChange:e=>d("required",e)})]}),c&&(0,Re.jsxs)(Ie.PanelBody,{title:(0,a.__)("Options","formative"),children:[(0,Re.jsx)("div",{className:"formative-options-list",children:(e.options||[]).map((t,r)=>(0,Re.jsxs)("div",{className:"formative-option-item",children:[(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Label","formative"),value:t.label,onChange:e=>m(r,"label",e)}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Value","formative"),value:t.value,onChange:e=>m(r,"value",e)}),(0,Re.jsx)(Ie.Button,{isDestructive:!0,isSmall:!0,onClick:()=>(t=>{const a=e.options.filter((e,a)=>a!==t);d("options",a)})(r),children:(0,a.__)("Remove","formative")})]},r))}),(0,Re.jsx)(Ie.Button,{isSecondary:!0,onClick:h,style:{marginTop:"10px"},children:(0,a.__)("Add Option","formative")})]})]})}):"style"===t.name?(0,Re.jsx)("div",{className:"tab-panel-content",children:(0,Re.jsx)(Ie.Panel,{children:(0,Re.jsx)(Ie.PanelBody,{title:(0,a.__)("Responsive Styling","formative"),initialOpen:!0,children:(0,Re.jsx)(Ct,{value:e.responsive||{},onChange:e=>d("responsive",e)})})})}):"advanced"===t.name?(0,Re.jsx)("div",{className:"tab-panel-content",children:(0,Re.jsx)(Ie.Panel,{children:(0,Re.jsxs)(Ie.PanelBody,{title:(0,a.__)("Advanced Options","formative"),initialOpen:!0,children:[(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("CSS Classes","formative"),value:e.cssClasses||"",onChange:e=>d("cssClasses",e),help:(0,a.__)("Add custom CSS classes","formative")}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Field ID","formative"),value:e.fieldId||"",onChange:e=>d("fieldId",e),help:(0,a.__)("Custom HTML ID attribute","formative")})]})})}):void 0})})]})},wt=({settings:e,updateSetting:t})=>(0,Re.jsxs)("div",{className:"formative-settings-tab",children:[(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Form Title","formative"),help:(0,a.__)("This is the form title","formative"),value:e.formTitle||"",onChange:e=>t("formTitle",e)}),(0,Re.jsx)(Ie.TextareaControl,{label:(0,a.__)("Success Message","formative"),help:(0,a.__)("This message will be shown after a successful submission.","formative"),value:e.successMessage||"",onChange:e=>t("successMessage",e)}),(0,Re.jsx)(Ie.TextareaControl,{label:(0,a.__)("Error Message","formative"),help:(0,a.__)("This message will be shown if there is an error.","formative"),value:e.errorMessage||"",onChange:e=>t("errorMessage",e)}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Required Login","formative"),help:(0,a.__)("Without login, users can't submit the form.","formative"),checked:e.requireLogin||!1,onChange:e=>t("requireLogin",e)}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Capture User Browser Data","formative"),help:(0,a.__)("Store user's browser (and maybe browser etc).","formative"),checked:e.captureBrowserData||!1,onChange:e=>t("captureBrowserData",e)}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Hide Form After Submission","formative"),help:(0,a.__)("After submission, hide the form for preventing multiple submission.","formative"),checked:e.hideFormAfterSubmission||!1,onChange:e=>t("hideFormAfterSubmission",e)}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Store Entries","formative"),help:(0,a.__)("Store submitted form data to database.","formative"),checked:!1!==e.storeEntries,onChange:e=>t("storeEntries",e)}),!1!==e.storeEntries&&(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Entry Title","formative"),help:(0,a.__)("Enter here title of this form entries.","formative"),value:e.entryTitle||"Entry # {id}",onChange:e=>t("entryTitle",e)}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Limit Total Entries","formative"),help:(0,a.__)("Limit the total number of submissions for this form.","formative"),checked:e.limitEntries||!1,onChange:e=>t("limitEntries",e)}),e.limitEntries&&(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Maximum Entries","formative"),type:"number",value:e.maxEntries||"",onChange:e=>t("maxEntries",e)}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Count Views","formative"),help:(0,a.__)("Track form views.","formative"),checked:e.countViews||!1,onChange:e=>t("countViews",e)}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Stop Vertical Scrolling","formative"),help:(0,a.__)("Stop scrolling effect when submitting the form.","formative"),checked:e.stopVerticalScrolling||!1,onChange:e=>t("stopVerticalScrolling",e)}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Redirect To","formative"),help:(0,a.__)("Users will be redirected to this link after submission.","formative"),value:e.redirectUrl||"",onChange:e=>t("redirectUrl",e),placeholder:"https://example.com/thank-you"}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Show Quiz Summary","formative"),help:(0,a.__)("Display quiz results after submission.","formative"),checked:e.showQuizSummary||!1,onChange:e=>t("showQuizSummary",e)}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Redirect Form Data","formative"),help:(0,a.__)("Include form data in redirect URL.","formative"),checked:e.redirectFormData||!1,onChange:e=>t("redirectFormData",e)})]}),Nt=({settings:e,updateSetting:t})=>(0,Re.jsxs)("div",{className:"formative-settings-tab",children:[(0,Re.jsx)(Ie.Notice,{status:"warning",isDismissible:!1,children:(0,Re.jsxs)("p",{children:[(0,a.__)("You are currently using Formative free version.","formative"),(0,Re.jsx)("br",{}),(0,a.__)("Get full access to premium features by upgrading today.","formative")]})}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Confirmation Mail to User","formative"),help:(0,a.__)("Want to send a submission copy to user by email? Active this one. The form must have at least one Email widget and it should be required.","formative"),checked:e.confirmationMailToUser||!1,onChange:e=>t("confirmationMailToUser",e),disabled:!0}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Want to send a copy of submitted form to user?","formative"),checked:e.sendCopyToUser||!1,onChange:e=>t("sendCopyToUser",e),disabled:!0}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Email Verification","formative"),help:(0,a.__)("Want to send an email verification mail to the user by email? Active this one. The form must have at least one Email widget and it should be required.","formative"),checked:e.emailVerification||!1,onChange:e=>t("emailVerification",e),disabled:!0})]}),St=({settings:e,updateSetting:t})=>(0,Re.jsxs)("div",{className:"formative-settings-tab",children:[(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Notification Mail to Admin","formative"),help:(0,a.__)("Want to send a submission copy to admin by email? Active this one.","formative"),checked:e.notificationMailToAdmin||!1,onChange:e=>t("notificationMailToAdmin",e)}),e.notificationMailToAdmin&&(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Admin Email","formative"),help:(0,a.__)("Enter admin email address to receive notifications.","formative"),value:e.adminEmail||"",onChange:e=>t("adminEmail",e),placeholder:(0,a.__)("admin@example.com","formative")}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Email Subject","formative"),value:e.adminEmailSubject||(0,a.__)("New Form Submission","formative"),onChange:e=>t("adminEmailSubject",e)}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("From Email","formative"),value:e.adminEmailFrom||"",onChange:e=>t("adminEmailFrom",e),placeholder:(0,a.__)("noreply@example.com","formative")}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("From Name","formative"),value:e.adminEmailFromName||"",onChange:e=>t("adminEmailFromName",e),placeholder:(0,a.__)("Formative","formative")})]})]}),Et=({settings:e,updateSetting:t})=>{const r=[{name:"hubspot",label:(0,a.__)("HubSpot Forms","formative"),help:(0,a.__)("Integrate hubspot with this form. Configure HubSpot.","formative"),premium:!0},{name:"hubspotContact",label:(0,a.__)("HubSpot Contact","formative"),premium:!0},{name:"mailchimp",label:(0,a.__)("Mail Chimp","formative"),help:(0,a.__)("Integrate mailchimp with this form. The form must have at least one Email widget and it should be required. Configure Mail Chimp.","formative"),premium:!0},{name:"slack",label:(0,a.__)("Slack","formative"),help:(0,a.__)("Integrate slack with this form. Slack info.","formative"),premium:!0},{name:"restApi",label:(0,a.__)("REST API","formative"),help:(0,a.__)("Send entry data to third party rest api/webhook.","formative"),premium:!0},{name:"googleSheet",label:(0,a.__)("Google Sheet","formative"),help:(0,a.__)("Integrate google sheet with this form.","formative"),premium:!0},{name:"mailpoet",label:(0,a.__)("MailPoet","formative"),help:(0,a.__)("Integrate MailPoet with this form. The form must have at least one Email widget and it should be required.","formative"),premium:!0},{name:"aweber",label:(0,a.__)("Aweber","formative"),help:(0,a.__)("Integrate aweber with this form. The form must have at least one Email widget and it should be required.","formative"),premium:!0},{name:"convertkit",label:(0,a.__)("ConvertKit","formative"),help:(0,a.__)("Integrate convertKit with this form. The form must have at least one Email widget and it should be required.","formative"),premium:!0},{name:"getresponse",label:(0,a.__)("GetResponse","formative"),help:(0,a.__)("Integrate GetResponse with this form. The form must have at least one Email widget and it should be required.","formative"),premium:!0},{name:"activecampaign",label:(0,a.__)("ActiveCampaign","formative"),help:(0,a.__)("Integrate ActiveCampaign with this form. The form must have at least one Email widget and it should be required.","formative"),premium:!0},{name:"zapier",label:(0,a.__)("Zapier","formative"),help:(0,a.__)("Integrate zapier with this form. The form must have at least one Email widget and it should be required.","formative"),premium:!0}];return(0,Re.jsxs)("div",{className:"formative-settings-tab",children:[(0,Re.jsx)(Ie.Notice,{status:"warning",isDismissible:!1,children:(0,Re.jsxs)("p",{children:[(0,a.__)("You are currently using Formative free version.","formative"),(0,Re.jsx)("br",{}),(0,a.__)("Get full access to premium features by upgrading today.","formative")]})}),r.map(a=>(0,Re.jsx)("div",{className:"formative-integration-option",children:(0,Re.jsx)(Ie.ToggleControl,{label:a.label,help:a.help,checked:e[a.name]||!1,onChange:e=>t(a.name,e),disabled:a.premium})},a.name))]})},Tt=({settings:e,updateSetting:t})=>(0,Re.jsxs)("div",{className:"formative-settings-tab",children:[(0,Re.jsx)(Ie.Notice,{status:"error",isDismissible:!1,children:(0,Re.jsxs)("p",{children:[(0,Re.jsx)("strong",{children:(0,a.__)("Payment is a premium feature—get Pro to use it!","formative")}),(0,Re.jsx)("br",{}),(0,a.__)("Get full access to premium features by upgrading today.","formative")]})}),(0,Re.jsx)(Ie.SelectControl,{label:(0,a.__)("Default Currency","formative"),value:e.defaultCurrency||"USD",options:[{label:(0,a.__)("Select default currency","formative"),value:""},{label:"USD - US Dollar",value:"USD"},{label:"EUR - Euro",value:"EUR"},{label:"GBP - British Pound",value:"GBP"},{label:"JPY - Japanese Yen",value:"JPY"},{label:"AUD - Australian Dollar",value:"AUD"},{label:"CAD - Canadian Dollar",value:"CAD"},{label:"INR - Indian Rupee",value:"INR"}],onChange:e=>t("defaultCurrency",e),disabled:!0}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("PayPal","formative"),help:(0,a.__)("Integrate paypal payment with this form.","formative"),checked:e.paypal||!1,onChange:e=>t("paypal",e),disabled:!0}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Stripe","formative"),help:(0,a.__)("Integrate stripe payment with this form.","formative"),checked:e.stripe||!1,onChange:e=>t("stripe",e),disabled:!0})]}),Dt=({settings:e,updateSetting:t})=>(0,Re.jsxs)("div",{className:"formative-settings-tab",children:[(0,Re.jsx)(Ie.Notice,{status:"error",isDismissible:!1,children:(0,Re.jsxs)("p",{children:[(0,Re.jsx)("strong",{children:(0,a.__)("CRM is a premium feature—get Pro to use it!","formative")}),(0,Re.jsx)("br",{}),(0,a.__)("Get full access to premium features by upgrading today.","formative")]})}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Zoho Contact","formative"),help:(0,a.__)("Integrate Zoho Contact with this form.","formative"),checked:e.zohoContact||!1,onChange:e=>t("zohoContact",e),disabled:!0}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Helpscout","formative"),help:(0,a.__)("Integrate Helpscout with this form.","formative"),checked:e.helpscout||!1,onChange:e=>t("helpscout",e),disabled:!0}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Fluent","formative"),help:(0,a.__)("Integrate fluent with this form. The form must have at least one Email widget and it should be required.","formative"),checked:e.fluent||!1,onChange:e=>t("fluent",e),disabled:!0})]}),Pt=({settings:e,updateSetting:t})=>(0,Re.jsxs)("div",{className:"formative-settings-tab",children:[(0,Re.jsx)(Ie.Notice,{status:"error",isDismissible:!1,children:(0,Re.jsxs)("p",{children:[(0,Re.jsx)("strong",{children:(0,a.__)("Auth is a premium feature—get Pro to use it!","formative")}),(0,Re.jsx)("br",{}),(0,a.__)("Get full access to premium features by upgrading today.","formative")]})}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Login","formative"),help:(0,a.__)("Enable or disable login system.","formative"),checked:e.enableLogin||!1,onChange:e=>t("enableLogin",e),disabled:!0}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Registration","formative"),help:(0,a.__)("Enable or disable user registration.","formative"),checked:e.enableRegistration||!1,onChange:e=>t("enableRegistration",e),disabled:!0})]}),Mt=({settings:e,updateSetting:t})=>(0,Re.jsxs)("div",{className:"formative-settings-tab",children:[(0,Re.jsx)(Ie.Notice,{status:"error",isDismissible:!1,children:(0,Re.jsxs)("p",{children:[(0,Re.jsx)("strong",{children:(0,a.__)("Form to Post is a premium feature—get Pro to use it!","formative")}),(0,Re.jsx)("br",{}),(0,a.__)("Get full access to premium features by upgrading today.","formative")]})}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Form to Post","formative"),help:(0,a.__)("Create a post from form entries.","formative"),checked:e.formToPost||!1,onChange:e=>t("formToPost",e),disabled:!0}),e.formToPost&&(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(Ie.SelectControl,{label:(0,a.__)("Post Type","formative"),value:e.postType||"post",options:[{label:(0,a.__)("Post","formative"),value:"post"},{label:(0,a.__)("Page","formative"),value:"page"},{label:(0,a.__)("Custom Post Type","formative"),value:"custom"}],onChange:e=>t("postType",e),disabled:!0}),(0,Re.jsx)(Ie.SelectControl,{label:(0,a.__)("Post Status","formative"),value:e.postStatus||"draft",options:[{label:(0,a.__)("Draft","formative"),value:"draft"},{label:(0,a.__)("Published","formative"),value:"publish"},{label:(0,a.__)("Pending Review","formative"),value:"pending"}],onChange:e=>t("postStatus",e),disabled:!0})]})]}),Rt=({isOpen:e,onClose:r,settings:i,onSave:n})=>{const[s,o]=(0,t.useState)(i),l=(e,t)=>{o({...s,[e]:t})},c=[{name:"general",title:(0,a.__)("General","formative"),component:wt},{name:"confirmation",title:(0,a.__)("Confirmation","formative"),component:Nt},{name:"notification",title:(0,a.__)("Notification","formative"),component:St},{name:"integration",title:(0,a.__)("Integration","formative"),component:Et},{name:"payment",title:(0,a.__)("Payment","formative"),component:Tt},{name:"crm",title:(0,a.__)("CRM","formative"),component:Dt},{name:"auth",title:(0,a.__)("Auth","formative"),component:Pt},{name:"post",title:(0,a.__)("Post","formative"),component:Mt}];return e?(0,Re.jsxs)(Ie.Modal,{title:(0,a.__)("Form Settings","formative"),onRequestClose:r,className:"formative-settings-modal",style:{maxWidth:"800px",minHeight:"600px"},shouldCloseOnClickOutside:!1,children:[(0,Re.jsx)(Ie.TabPanel,{className:"formative-settings-tabs",activeClass:"is-active",tabs:c,children:e=>{const t=e.component;return(0,Re.jsx)(t,{settings:s,updateSetting:l})}}),(0,Re.jsxs)("div",{className:"formative-modal-footer",children:[(0,Re.jsx)(Ie.Button,{onClick:r,children:(0,a.__)("Cancel","formative")}),(0,Re.jsx)(Ie.Button,{isPrimary:!0,onClick:()=>{n(s),r()},children:(0,a.__)("Save Changes","formative")})]})]}):null},Bt={formTitle:"",successMessage:"Thank you for your submission!",errorMessage:"Something went wrong. Please try again.",submitButtonText:"Submit",requireLogin:!1,captureBrowserData:!1,hideFormAfterSubmission:!1,storeEntries:!0,entryTitle:"Entry # {id}",limitEntries:!1,maxEntries:"",countViews:!1,stopVerticalScrolling:!1,redirectUrl:"",showQuizSummary:!1,redirectFormData:!1,confirmationMailToUser:!1,sendCopyToUser:!1,emailVerification:!1,notificationMailToAdmin:!1,adminEmail:"",adminEmailSubject:"New Form Submission",adminEmailFrom:"",adminEmailFromName:"",hubspot:!1,hubspotContact:!1,mailchimp:!1,slack:!1,restApi:!1,googleSheet:!1,mailpoet:!1,aweber:!1,convertkit:!1,getresponse:!1,activecampaign:!1,zapier:!1,defaultCurrency:"USD",paypal:!1,stripe:!1,zohoContact:!1,helpscout:!1,fluent:!1,enableLogin:!1,enableRegistration:!1,formToPost:!1,postType:"post",postStatus:"draft"},Ft=()=>{const{id:e}=function(){let{matches:e}=r.useContext(H),t=e[e.length-1];return t?t.params:{}}(),i=K(),n=Y(),[s,o]=(0,t.useState)(""),[l,c]=(0,t.useState)([]),[d,m]=(0,t.useState)(Bt),[h,u]=(0,t.useState)(!1),[p,v]=(0,t.useState)(!!e),[f,g]=(0,t.useState)(!1),[x,_]=(0,t.useState)(null),[b,y]=(0,t.useState)(null),[j,C]=(0,t.useState)(null),[k,w]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(e)N();else if(n.state?.template){const e=n.state.template;o(e.name||""),c(e.fields||[])}},[e,n.state]);const N=async()=>{try{const a=await We()({path:`/formative/v1/forms/${e}`});if(a.success){const e=a.data;o(e.title),c(e.fields||[]),m((t=e.settings||{},{...Bt,...t}))}}catch(e){console.error("Error fetching form:",e)}finally{v(!1)}var t},S=(e,t=null)=>{const a={id:`field-${Date.now()}`,type:e,name:`field_${l.length+1}`,label:{text:"Text",email:"Email",number:"Number",tel:"Phone",textarea:"Textarea",select:"Select",checkbox:"Checkbox",radio:"Radio",date:"Date",time:"Time",url:"URL",password:"Password",file:"File Upload",rating:"Rating",range:"Range Slider",switch:"Switch",recaptcha:"reCAPTCHA",firstname:"First Name",lastname:"Last Name",gdpr:"GDPR Consent",message:"Response Message",summary:"Summary",submit:"Submit Button"}[e]||`${e.charAt(0).toUpperCase()+e.slice(1)} Field`,placeholder:"",required:"submit"!==e&&"recaptcha"!==e&&"message"!==e&&"summary"!==e,helpText:"",options:["select","checkbox","radio"].includes(e)?[{label:"Option 1",value:"option1"}]:void 0,..."rating"===e&&{maxRating:5},..."range"===e&&{min:0,max:100,step:1,defaultValue:50},..."file"===e&&{accept:"",multiple:!1},..."switch"===e&&{defaultChecked:!1}};let r,i;null!==t?(r=[...l],r.splice(t,0,a),i=t):(r=[...l,a],i=r.length-1),c(r),_(i)},E=(e,t)=>{const a=[...l],r="up"===t?e-1:e+1;r>=0&&r<a.length&&([a[e],a[r]]=[a[r],a[e]],c(a),x===e?_(r):x===r&&_(e))},T=(e,t)=>{if("BUTTON"===e.target.tagName)return e.preventDefault(),!1;w(t),e.dataTransfer.effectAllowed="copy",e.dataTransfer.setData("text/plain",t)},D=()=>{w(null),C(null)},P=()=>{null===b||k||C(null)},M=()=>{y(null),C(null),w(null)},R=e=>{switch(e.type){case"textarea":return(0,Re.jsx)("textarea",{className:"formative-input formative-textarea",placeholder:e.placeholder,disabled:!0});case"select":return(0,Re.jsxs)("select",{className:"formative-input formative-select",disabled:!0,children:[(0,Re.jsx)("option",{children:e.placeholder||(0,a.__)("Select...","formative")}),e.options?.map((e,t)=>(0,Re.jsx)("option",{value:e.value,children:e.label},t))]});case"checkbox":return(0,Re.jsx)("div",{className:"formative-checkbox-group",children:e.options?.map((e,t)=>(0,Re.jsxs)("label",{className:"formative-checkbox-label",children:[(0,Re.jsx)("input",{type:"checkbox",disabled:!0}),(0,Re.jsx)("span",{children:e.label})]},t))});case"radio":return(0,Re.jsx)("div",{className:"formative-radio-group",children:e.options?.map((t,a)=>(0,Re.jsxs)("label",{className:"formative-radio-label",children:[(0,Re.jsx)("input",{type:"radio",name:e.name,disabled:!0}),(0,Re.jsx)("span",{children:t.label})]},a))});case"file":return(0,Re.jsxs)("div",{className:"formative-file-upload",children:[(0,Re.jsx)("input",{type:"file",className:"formative-input",disabled:!0}),(0,Re.jsx)("span",{className:"file-info",children:(0,a.__)("No file chosen","formative")})]});case"rating":return(0,Re.jsx)("div",{className:"formative-rating",children:[...Array(e.maxRating||5)].map((e,t)=>(0,Re.jsx)(Ze,{size:20,style:{marginRight:"4px",color:"#ddd"}},t))});case"range":return(0,Re.jsxs)("div",{className:"formative-range",children:[(0,Re.jsx)("input",{type:"range",min:e.min||0,max:e.max||100,step:e.step||1,defaultValue:e.defaultValue||50,className:"formative-input",disabled:!0}),(0,Re.jsx)("span",{className:"range-value",children:e.defaultValue||50})]});case"switch":return(0,Re.jsxs)("label",{className:"formative-switch",children:[(0,Re.jsx)("input",{type:"checkbox",defaultChecked:e.defaultChecked,disabled:!0}),(0,Re.jsx)("span",{className:"switch-slider"})]});case"recaptcha":return(0,Re.jsxs)("div",{className:"formative-recaptcha-placeholder",children:[(0,Re.jsx)(Xe,{size:48,style:{opacity:.3}}),(0,Re.jsx)("span",{children:(0,a.__)("reCAPTCHA will appear here","formative")})]});case"gdpr":return(0,Re.jsxs)("label",{className:"formative-gdpr",children:[(0,Re.jsx)("input",{type:"checkbox",disabled:!0}),(0,Re.jsx)("span",{children:(0,a.__)("I agree to the terms and conditions","formative")})]});case"message":return(0,Re.jsxs)("div",{className:"formative-message-preview",children:[(0,Re.jsx)(Ye,{size:24,style:{marginRight:"8px",opacity:.5}}),(0,Re.jsx)("span",{children:(0,a.__)("Response message will appear here","formative")})]});case"summary":return(0,Re.jsxs)("div",{className:"formative-summary-preview",children:[(0,Re.jsx)(Ae,{size:24,style:{marginRight:"8px",opacity:.5}}),(0,Re.jsx)("span",{children:(0,a.__)("Form summary will appear here","formative")})]});case"submit":return(0,Re.jsx)("button",{type:"button",className:"formative-submit-button",disabled:!0,children:e.label||(0,a.__)("Submit","formative")});case"firstname":case"lastname":return(0,Re.jsx)("input",{type:"text",className:"formative-input",placeholder:e.placeholder||e.label,disabled:!0});default:return(0,Re.jsx)("input",{type:e.type||"text",className:"formative-input",placeholder:e.placeholder,disabled:!0})}};return p?(0,Re.jsx)("div",{className:"formative-loading",children:(0,a.__)("Loading...","formative")}):(0,Re.jsx)("div",{className:"formative-builder-wrapper",children:(0,Re.jsxs)("div",{className:"formative-form-builder",children:[(0,Re.jsxs)("div",{className:"formative-page-header",children:[(0,Re.jsxs)("div",{children:[(0,Re.jsx)("h1",{children:e?(0,a.__)("Edit Form","formative"):(0,a.__)("Create New Form","formative")}),(0,Re.jsx)(Ie.TextControl,{value:s,onChange:o,placeholder:(0,a.__)("Enter form title...","formative"),className:"formative-form-title-input"})]}),(0,Re.jsxs)("div",{className:"formative-header-actions",children:[(0,Re.jsx)(Ie.Button,{onClick:()=>i("/forms"),children:(0,a.__)("Cancel","formative")}),(0,Re.jsx)(Ie.Button,{isSecondary:!0,onClick:()=>g(!0),children:(0,a.__)("Form Settings","formative")}),(0,Re.jsx)(Ie.Button,{isPrimary:!0,onClick:async()=>{if(s.trim()){u(!0);try{const t={title:s,fields:l,settings:d},a=await We()({path:e?`/formative/v1/forms/${e}`:"/formative/v1/forms",method:e?"PUT":"POST",data:t});a.success&&(alert(a.message),e||i(`/forms/edit/${a.data.id}`))}catch(e){console.error("Error saving form:",e),alert((0,a.__)("Failed to save form.","formative"))}finally{u(!1)}}else alert((0,a.__)("Please enter a form title.","formative"))},isBusy:h,children:(0,a.__)("Save Form","formative")})]})]}),(0,Re.jsx)(Rt,{isOpen:f,onClose:()=>g(!1),settings:d,onSave:e=>m(e)}),(0,Re.jsxs)("div",{className:"formative-builder-layout",children:[(0,Re.jsx)("div",{className:"formative-builder-sidebar",children:(0,Re.jsx)(Ie.Panel,{children:(0,Re.jsx)(Ie.PanelBody,{title:(0,a.__)("Add Fields","formative"),initialOpen:!0,children:(0,Re.jsxs)("div",{className:"formative-field-types",children:[(0,Re.jsx)("div",{draggable:!0,className:"text"===k?"is-dragging":"",onDragStart:e=>T(e,"text"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("text"),children:[(0,Re.jsx)(et,{size:16}),(0,a.__)("Text","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"email"===k?"is-dragging":"",onDragStart:e=>T(e,"email"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("email"),children:[(0,Re.jsx)(Ve,{size:16}),(0,a.__)("Email","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"number"===k?"is-dragging":"",onDragStart:e=>T(e,"number"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("number"),children:[(0,Re.jsx)(tt,{size:16}),(0,a.__)("Number","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"tel"===k?"is-dragging":"",onDragStart:e=>T(e,"tel"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("tel"),children:[(0,Re.jsx)(at,{size:16}),(0,a.__)("Phone","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"textarea"===k?"is-dragging":"",onDragStart:e=>T(e,"textarea"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("textarea"),children:[(0,Re.jsx)(rt,{size:16}),(0,a.__)("Textarea","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"select"===k?"is-dragging":"",onDragStart:e=>T(e,"select"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("select"),children:[(0,Re.jsx)(it,{size:16}),(0,a.__)("Select","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"checkbox"===k?"is-dragging":"",onDragStart:e=>T(e,"checkbox"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("checkbox"),children:[(0,Re.jsx)(nt,{size:16}),(0,a.__)("Checkbox","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"radio"===k?"is-dragging":"",onDragStart:e=>T(e,"radio"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("radio"),children:[(0,Re.jsx)(st,{size:16}),(0,a.__)("Radio","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"date"===k?"is-dragging":"",onDragStart:e=>T(e,"date"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("date"),children:[(0,Re.jsx)(Je,{size:16}),(0,a.__)("Date","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"time"===k?"is-dragging":"",onDragStart:e=>T(e,"time"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("time"),children:[(0,Re.jsx)(ot,{size:16}),(0,a.__)("Time","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"url"===k?"is-dragging":"",onDragStart:e=>T(e,"url"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("url"),children:[(0,Re.jsx)(lt,{size:16}),(0,a.__)("URL","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"password"===k?"is-dragging":"",onDragStart:e=>T(e,"password"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("password"),children:[(0,Re.jsx)(ct,{size:16}),(0,a.__)("Password","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"file"===k?"is-dragging":"",onDragStart:e=>T(e,"file"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("file"),children:[(0,Re.jsx)(dt,{size:16}),(0,a.__)("File Upload","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"rating"===k?"is-dragging":"",onDragStart:e=>T(e,"rating"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("rating"),children:[(0,Re.jsx)(Ze,{size:16}),(0,a.__)("Rating","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"range"===k?"is-dragging":"",onDragStart:e=>T(e,"range"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("range"),children:[(0,Re.jsx)(mt,{size:16}),(0,a.__)("Range Slider","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"switch"===k?"is-dragging":"",onDragStart:e=>T(e,"switch"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("switch"),children:[(0,Re.jsx)(ht,{size:16}),(0,a.__)("Switch","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"recaptcha"===k?"is-dragging":"",onDragStart:e=>T(e,"recaptcha"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("recaptcha"),children:[(0,Re.jsx)(Xe,{size:16}),(0,a.__)("reCAPTCHA","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"firstname"===k?"is-dragging":"",onDragStart:e=>T(e,"firstname"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("firstname"),children:[(0,Re.jsx)(ut,{size:16}),(0,a.__)("First Name","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"lastname"===k?"is-dragging":"",onDragStart:e=>T(e,"lastname"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("lastname"),children:[(0,Re.jsx)(Ge,{size:16}),(0,a.__)("Last Name","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"gdpr"===k?"is-dragging":"",onDragStart:e=>T(e,"gdpr"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("gdpr"),children:[(0,Re.jsx)(Xe,{size:16}),(0,a.__)("GDPR Consent","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"message"===k?"is-dragging":"",onDragStart:e=>T(e,"message"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("message"),children:[(0,Re.jsx)(Ye,{size:16}),(0,a.__)("Response Message","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"summary"===k?"is-dragging":"",onDragStart:e=>T(e,"summary"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("summary"),children:[(0,Re.jsx)(Ae,{size:16}),(0,a.__)("Summary","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"submit"===k?"is-dragging":"",onDragStart:e=>T(e,"submit"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("submit"),children:[(0,Re.jsx)(pt,{size:16}),(0,a.__)("Submit Button","formative")]})})]})})})}),(0,Re.jsx)("div",{className:"formative-builder-canvas",onDragOver:e=>{if(e.preventDefault(),e.stopPropagation(),k)if(e.dataTransfer.dropEffect="copy",l.length>0){const t=e.currentTarget.querySelector(".formative-canvas-fields");if(!t)return void C(0);const a=e.clientY,r=t.querySelectorAll(".formative-canvas-field");let i=l.length;for(let e=0;e<r.length;e++){const t=r[e].getBoundingClientRect();if(a<t.top+t.height/2){i=e;break}}C(i)}else C(0);else e.dataTransfer.dropEffect=null!==b?"move":"none"},onDrop:e=>{if(e.preventDefault(),e.stopPropagation(),k){let e=l.length;return null!==j&&j>=0&&(e=j),S(k,e),w(null),void C(null)}},onDragLeave:e=>{if(k){const t=e.relatedTarget;t&&e.currentTarget.contains(t)||C(null)}},onClick:e=>{(e.target.classList.contains("formative-builder-canvas")||e.target.classList.contains("formative-canvas-inner")||e.target.classList.contains("formative-canvas-fields"))&&_(null)},children:(0,Re.jsxs)("div",{className:"formative-canvas-inner",children:[(0,Re.jsx)("div",{className:"formative-canvas-header",children:(0,Re.jsx)("h2",{children:s||(0,a.__)("Form Fields","formative")})}),0===l.length?(0,Re.jsxs)("div",{className:"formative-empty-canvas "+(k?"drag-active":""),children:[(0,Re.jsx)(vt,{size:48,strokeWidth:1.5,style:{opacity:.3,marginBottom:"16px"}}),(0,Re.jsx)("h3",{children:k?(0,a.__)("Drop Here","formative"):(0,a.__)("No Fields Yet","formative")}),(0,Re.jsx)("p",{children:k?(0,a.__)("Release to add field","formative"):(0,a.__)("Drag a field type from the left sidebar to add it to your form.","formative")})]}):(0,Re.jsxs)("div",{className:`formative-canvas-fields ${k?"drag-active":""} ${0===j&&k?"drop-target-start":""}`,children:[l.map((e,t)=>{const a=k?j===t+1:null!==b&&j===t&&b!==t;return(0,Re.jsxs)("div",{className:`formative-canvas-field ${x===t?"is-selected":""} ${b===t?"is-dragging":""} ${a?"drop-target":""}`,onDragOver:e=>((e,t)=>{if(e.preventDefault(),e.stopPropagation(),k){e.dataTransfer.dropEffect="copy";const a=e.currentTarget.getBoundingClientRect(),r=e.clientY,i=a.top+a.height/2;C(r<i?t:t+1)}else null!==b&&(e.dataTransfer.dropEffect="move",b!==t&&C(t))})(e,t),onDragLeave:P,onDrop:e=>((e,t)=>{if(e.preventDefault(),e.stopPropagation(),k){const a=e.currentTarget.getBoundingClientRect(),r=e.clientY,i=a.top+a.height/2;return S(k,r<i?t:t+1),w(null),void C(null)}if(null===b)return;if(b===t)return y(null),void C(null);const a=[...l],[r]=a.splice(b,1),i=t;a.splice(i,0,r),c(a),x===b?_(i):x>=Math.min(b,i)&&x<=Math.max(b,i)&&_(b<i?x-1:x+1),y(null),C(null)})(e,t),onClick:e=>{e.stopPropagation(),_(t)},role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),_(t))},children:[(0,Re.jsx)("div",{className:"canvas-field-drag-handle",draggable:!0,onDragStart:e=>{e.stopPropagation(),((e,t)=>{y(t),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/html",e.currentTarget)})(e,t)},onDragEnd:M,onClick:e=>e.stopPropagation(),children:(0,Re.jsx)(ft,{size:20})}),(0,Re.jsxs)("div",{className:"canvas-field-preview",children:[e.label&&(0,Re.jsxs)("label",{className:"field-label",children:[e.label,e.required&&(0,Re.jsx)("span",{className:"required",children:"*"})]}),R(e),e.helpText&&(0,Re.jsx)("div",{className:"field-help-text",children:e.helpText})]}),x===t&&(0,Re.jsx)("div",{className:"canvas-field-overlay",children:(0,Re.jsx)("span",{className:"field-type-badge",children:e.type})})]},e.id)}),(0,Re.jsx)("div",{className:"formative-canvas-submit",children:(0,Re.jsx)("button",{type:"button",className:"preview-submit-button",children:d.submitButtonText||(0,a.__)("Submit","formative")})})]})]})}),null!==x&&l[x]&&(0,Re.jsx)(kt,{field:l[x],onUpdate:e=>((e,t)=>{const a=[...l];a[e]=t,c(a)})(x,e),onClose:()=>_(null),onMoveUp:()=>E(x,"up"),onMoveDown:()=>E(x,"down"),onDelete:()=>(e=>{const t=l.filter((t,a)=>a!==e);c(t),x===e?_(null):x>e&&_(x-1)})(x),canMoveUp:x>0,canMoveDown:x<l.length-1})]})]})})},At=()=>{const[e,r]=(0,t.useState)([]),[i,n]=(0,t.useState)([]),[s,o]=(0,t.useState)(""),[l,c]=(0,t.useState)(!0),[d,m]=(0,t.useState)(1),[h,u]=(0,t.useState)(1),[p,v]=(0,t.useState)(null);(0,t.useEffect)(()=>{f()},[]),(0,t.useEffect)(()=>{g()},[d,s]);const f=async()=>{try{const e=await We()({path:"/formative/v1/forms?per_page=100"});e.success&&n(e.data.forms)}catch(e){console.error("Error fetching forms:",e)}},g=async()=>{c(!0);try{const e=new URLSearchParams({page:d.toString(),per_page:"10"});s&&e.append("form_id",s);const t=await We()({path:`/formative/v1/entries?${e.toString()}`});t.success&&(r(t.data.entries),u(t.data.totalPages))}catch(e){console.error("Error fetching entries:",e)}finally{c(!1)}};return l?(0,Re.jsx)("div",{className:"formative-loading",children:(0,a.__)("Loading...","formative")}):(0,Re.jsxs)("div",{className:"formative-entry-list",children:[(0,Re.jsxs)("div",{className:"formative-page-header",children:[(0,Re.jsx)("h1",{children:(0,a.__)("Entries","formative")}),(0,Re.jsx)(Ie.Button,{isPrimary:!0,onClick:async()=>{try{const e=new URLSearchParams({format:"csv"});s&&e.append("form_id",s);const t=await We()({path:`/formative/v1/entries/export?${e.toString()}`});if(t.success){const e=new Blob([t.data.csv],{type:"text/csv"}),a=window.URL.createObjectURL(e),r=document.createElement("a");r.href=a,r.download=t.data.filename,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(a)}}catch(e){console.error("Error exporting entries:",e),alert((0,a.__)("Failed to export entries.","formative"))}},children:(0,a.__)("Export CSV","formative")})]}),(0,Re.jsx)("div",{className:"formative-filters",children:(0,Re.jsx)(Ie.SelectControl,{label:(0,a.__)("Filter by Form","formative"),value:s,options:[{label:(0,a.__)("All Forms","formative"),value:""},...i.map(e=>({label:e.title,value:e.id.toString()}))],onChange:o})}),e.length>0?(0,Re.jsx)("div",{className:"formative-table-wrapper",children:(0,Re.jsxs)("table",{className:"formative-table",children:[(0,Re.jsx)("thead",{children:(0,Re.jsxs)("tr",{children:[(0,Re.jsx)("th",{children:(0,a.__)("ID","formative")}),(0,Re.jsx)("th",{children:(0,a.__)("Form","formative")}),(0,Re.jsx)("th",{children:(0,a.__)("Date","formative")}),(0,Re.jsx)("th",{children:(0,a.__)("IP Address","formative")}),(0,Re.jsx)("th",{children:(0,a.__)("Actions","formative")})]})}),(0,Re.jsx)("tbody",{children:e.map(e=>(0,Re.jsxs)("tr",{children:[(0,Re.jsxs)("td",{children:["#",e.id]}),(0,Re.jsx)("td",{children:i.find(t=>t.id===e.formId)?.title||"N/A"}),(0,Re.jsx)("td",{children:new Date(e.createdAt).toLocaleString()}),(0,Re.jsx)("td",{children:e.ip}),(0,Re.jsx)("td",{children:(0,Re.jsxs)("div",{className:"formative-table-actions",children:[(0,Re.jsx)(Ie.Button,{isLink:!0,onClick:()=>v(e),children:(0,a.__)("View","formative")}),(0,Re.jsx)(Ie.Button,{isLink:!0,isDestructive:!0,onClick:()=>(async e=>{if(confirm((0,a.__)("Are you sure you want to delete this entry?","formative")))try{await We()({path:`/formative/v1/entries/${e}`,method:"DELETE"}),g()}catch(e){console.error("Error deleting entry:",e),alert((0,a.__)("Failed to delete entry.","formative"))}})(e.id),children:(0,a.__)("Delete","formative")})]})})]},e.id))})]})}):(0,Re.jsx)("div",{className:"formative-empty-state",children:(0,Re.jsx)("p",{children:(0,a.__)("No entries found.","formative")})}),h>1&&(0,Re.jsxs)("div",{className:"formative-pagination",children:[(0,Re.jsx)(Ie.Button,{disabled:1===d,onClick:()=>m(d-1),children:(0,a.__)("Previous","formative")}),(0,Re.jsxs)("span",{children:[(0,a.__)("Page","formative")," ",d," ",(0,a.__)("of","formative")," ",h]}),(0,Re.jsx)(Ie.Button,{disabled:d===h,onClick:()=>m(d+1),children:(0,a.__)("Next","formative")})]}),p&&(0,Re.jsx)("div",{className:"formative-modal-overlay",onClick:()=>v(null),children:(0,Re.jsxs)("div",{className:"formative-modal",onClick:e=>e.stopPropagation(),children:[(0,Re.jsxs)("div",{className:"formative-modal-header",children:[(0,Re.jsxs)("h2",{children:[(0,a.__)("Entry Details","formative")," #",p.id]}),(0,Re.jsx)(Ie.Button,{onClick:()=>v(null),children:(0,Re.jsx)(_t,{size:20})})]}),(0,Re.jsx)("div",{className:"formative-modal-content",children:Object.entries(p.data).map(([e,t])=>{if(t&&"object"==typeof t&&t.url){const a=t.type&&t.type.startsWith("image/");return(0,Re.jsxs)("div",{className:"formative-entry-field",children:[(0,Re.jsxs)("strong",{children:[p.fieldsMap?.[e]||e,":"]}),(0,Re.jsxs)("span",{className:"formative-file-display",children:[a&&(0,Re.jsx)("img",{src:t.url,alt:t.name,style:{maxWidth:"200px",maxHeight:"200px",display:"block",marginBottom:"8px"}}),(0,Re.jsxs)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",download:t.name,children:[t.name," (",Math.round(t.size/1024),"KB)"]})]})]},e)}return(0,Re.jsxs)("div",{className:"formative-entry-field",children:[(0,Re.jsxs)("strong",{children:[p.fieldsMap?.[e]||e,":"]}),(0,Re.jsx)("span",{children:Array.isArray(t)?t.join(", "):t})]},e)})})]})})]})},Lt=()=>{const[e,r]=(0,t.useState)({recaptcha_site_key:"",recaptcha_secret_key:"",email_from_name:"",email_from_address:"",store_entries:!0,delete_data:!1}),[i,n]=(0,t.useState)(!0),[s,o]=(0,t.useState)(!1),[l,c]=(0,t.useState)(null);(0,t.useEffect)(()=>{d()},[]);const d=async()=>{try{const e=await We()({path:"/formative/v1/settings"});e.success&&r(e.data)}catch(e){console.error("Error fetching settings:",e)}finally{n(!1)}},m=(t,a)=>{r({...e,[t]:a})};return i?(0,Re.jsx)("div",{className:"formative-loading",children:(0,a.__)("Loading...","formative")}):(0,Re.jsxs)("div",{className:"formative-settings",children:[(0,Re.jsxs)("div",{className:"formative-page-header",children:[(0,Re.jsx)("h1",{children:(0,a.__)("Settings","formative")}),(0,Re.jsx)(Ie.Button,{isPrimary:!0,onClick:async()=>{o(!0),c(null);try{const t=await We()({path:"/formative/v1/settings",method:"PUT",data:e});t.success&&c({type:"success",text:t.message})}catch(e){console.error("Error saving settings:",e),c({type:"error",text:(0,a.__)("Failed to save settings.","formative")})}finally{o(!1)}},isBusy:s,children:(0,a.__)("Save Settings","formative")})]}),l&&(0,Re.jsx)(Ie.Notice,{status:l.type,onRemove:()=>c(null),children:l.text}),(0,Re.jsxs)("div",{className:"formative-settings-sections",children:[(0,Re.jsxs)("div",{className:"formative-settings-section",children:[(0,Re.jsx)("h2",{children:(0,a.__)("reCAPTCHA","formative")}),(0,Re.jsx)("p",{className:"description",children:(0,a.__)("Protect your forms from spam with Google reCAPTCHA.","formative")}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Site Key","formative"),value:e.recaptcha_site_key,onChange:e=>m("recaptcha_site_key",e),help:(0,a.__)("Get your site key from Google reCAPTCHA admin console.","formative")}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Secret Key","formative"),value:e.recaptcha_secret_key,onChange:e=>m("recaptcha_secret_key",e),type:"password"})]}),(0,Re.jsxs)("div",{className:"formative-settings-section",children:[(0,Re.jsx)("h2",{children:(0,a.__)("Email","formative")}),(0,Re.jsx)("p",{className:"description",children:(0,a.__)("Configure email settings for form notifications.","formative")}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("From Name","formative"),value:e.email_from_name,onChange:e=>m("email_from_name",e)}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("From Email","formative"),value:e.email_from_address,onChange:e=>m("email_from_address",e),type:"email"})]}),(0,Re.jsxs)("div",{className:"formative-settings-section",children:[(0,Re.jsx)("h2",{children:(0,a.__)("Data Management","formative")}),(0,Re.jsx)(Ie.CheckboxControl,{label:(0,a.__)("Store form entries in database","formative"),checked:e.store_entries,onChange:e=>m("store_entries",e),help:(0,a.__)("Disable this if you only want to receive email notifications.","formative")}),(0,Re.jsx)(Ie.CheckboxControl,{label:(0,a.__)("Delete all data on plugin uninstall","formative"),checked:e.delete_data,onChange:e=>m("delete_data",e),help:(0,a.__)("Warning: This will permanently delete all forms and entries.","formative")})]})]})]})},zt=({children:e})=>{const t=Y(),a="/forms/new"===t.pathname||t.pathname.startsWith("/forms/edit/");return(0,Re.jsxs)("div",{className:"formative-admin-wrapper",children:[(0,Re.jsx)(Be,{}),(0,Re.jsxs)("div",{className:"formative-admin-container "+(a?"formative-builder-mode":""),children:[!a&&(0,Re.jsx)(qe,{}),(0,Re.jsx)("div",{className:"formative-admin-content",children:e})]})]})},Ut=()=>{const[e,r]=(0,t.useState)(!0),[i,n]=(0,t.useState)(null);return(0,t.useEffect)(()=>{r(!1)},[]),e?(0,Re.jsxs)("div",{className:"formative-admin-loading",children:[(0,Re.jsx)("div",{className:"spinner"}),(0,Re.jsx)("p",{children:(0,a.__)("Loading...","formative")})]}):i?(0,Re.jsx)("div",{className:"formative-admin-error",children:(0,Re.jsx)("p",{children:i})}):(0,Re.jsx)(_e,{children:(0,Re.jsx)(zt,{children:(0,Re.jsxs)(de,{children:[(0,Re.jsx)(le,{path:"/",element:(0,Re.jsx)($e,{})}),(0,Re.jsx)(le,{path:"/forms",element:(0,Re.jsx)(He,{})}),(0,Re.jsx)(le,{path:"/forms/templates",element:(0,Re.jsx)(Qe,{})}),(0,Re.jsx)(le,{path:"/forms/new",element:(0,Re.jsx)(Ft,{})}),(0,Re.jsx)(le,{path:"/forms/edit/:id",element:(0,Re.jsx)(Ft,{})}),(0,Re.jsx)(le,{path:"/entries",element:(0,Re.jsx)(At,{})}),(0,Re.jsx)(le,{path:"/settings",element:(0,Re.jsx)(Lt,{})}),(0,Re.jsx)(le,{path:"*",element:(0,Re.jsx)(oe,{to:"/",replace:!0})})]})})})},qt=document.getElementById("formative-admin-root");qt&&(0,t.createRoot)(qt).render((0,Re.jsx)(Ut,{}))})();1 (()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.element,a=window.wp.i18n,r=window.React;function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},i.apply(this,arguments)}var n;!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(n||(n={}));const s="popstate";function o(e,t){if(!1===e||null==e)throw new Error(t)}function l(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function c(e,t){return{usr:e.state,key:e.key,idx:t}}function d(e,t,a,r){return void 0===a&&(a=null),i({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?h(t):t,{state:a,key:t&&t.key||r||Math.random().toString(36).substr(2,8)})}function m(e){let{pathname:t="/",search:a="",hash:r=""}=e;return a&&"?"!==a&&(t+="?"===a.charAt(0)?a:"?"+a),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function h(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substr(a),e=e.substr(0,a));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var u;function p(e,t,a){return void 0===a&&(a="/"),function(e,t,a,r){let i=E(("string"==typeof t?h(t):t).pathname||"/",a);if(null==i)return null;let n=v(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,a)=>e===t[a])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(n);let s=null;for(let e=0;null==s&&e<n.length;++e){let t=S(i);s=w(n[e],t,r)}return s}(e,t,a,!1)}function v(e,t,a,r){void 0===t&&(t=[]),void 0===a&&(a=[]),void 0===r&&(r="");let i=(e,i,n)=>{let s={relativePath:void 0===n?e.path||"":n,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};s.relativePath.startsWith("/")&&(o(s.relativePath.startsWith(r),'Absolute route path "'+s.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),s.relativePath=s.relativePath.slice(r.length));let l=B([r,s.relativePath]),c=a.concat(s);e.children&&e.children.length>0&&(o(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),v(e.children,t,c,l)),(null!=e.path||e.index)&&t.push({path:l,score:k(l,e.index),routesMeta:c})};return e.forEach((e,t)=>{var a;if(""!==e.path&&null!=(a=e.path)&&a.includes("?"))for(let a of f(e.path))i(e,t,a);else i(e,t)}),t}function f(e){let t=e.split("/");if(0===t.length)return[];let[a,...r]=t,i=a.endsWith("?"),n=a.replace(/\?$/,"");if(0===r.length)return i?[n,""]:[n];let s=f(r.join("/")),o=[];return o.push(...s.map(e=>""===e?n:[n,e].join("/"))),i&&o.push(...s),o.map(t=>e.startsWith("/")&&""===t?"/":t)}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(u||(u={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const g=/^:[\w-]+$/,x=3,_=2,b=1,y=10,j=-2,C=e=>"*"===e;function k(e,t){let a=e.split("/"),r=a.length;return a.some(C)&&(r+=j),t&&(r+=_),a.filter(e=>!C(e)).reduce((e,t)=>e+(g.test(t)?x:""===t?b:y),r)}function w(e,t,a){void 0===a&&(a=!1);let{routesMeta:r}=e,i={},n="/",s=[];for(let e=0;e<r.length;++e){let o=r[e],l=e===r.length-1,c="/"===n?t:t.slice(n.length)||"/",d=N({path:o.relativePath,caseSensitive:o.caseSensitive,end:l},c),m=o.route;if(!d&&l&&a&&!r[r.length-1].route.index&&(d=N({path:o.relativePath,caseSensitive:o.caseSensitive,end:!1},c)),!d)return null;Object.assign(i,d.params),s.push({params:i,pathname:B([n,d.pathname]),pathnameBase:F(B([n,d.pathnameBase])),route:m}),"/"!==d.pathnameBase&&(n=B([n,d.pathnameBase]))}return s}function N(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[a,r]=function(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!0),l("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,a)=>(r.push({paramName:t,isOptional:null!=a}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),i=t.match(a);if(!i)return null;let n=i[0],s=n.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((e,t,a)=>{let{paramName:r,isOptional:i}=t;if("*"===r){let e=o[a]||"";s=n.slice(0,n.length-e.length).replace(/(.)\/+$/,"$1")}const l=o[a];return e[r]=i&&!l?void 0:(l||"").replace(/%2F/g,"/"),e},{}),pathname:n,pathnameBase:s,pattern:e}}function S(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return l(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function E(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,r=e.charAt(a);return r&&"/"!==r?null:e.slice(a)||"/"}const T=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function D(e,t){let a=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?a.length>1&&a.pop():"."!==e&&a.push(e)}),a.length>1?a.join("/"):"/"}function P(e,t,a,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+a+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function M(e,t){let a=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t?a.map((e,t)=>t===a.length-1?e.pathname:e.pathnameBase):a.map(e=>e.pathnameBase)}function R(e,t,a,r){let n;void 0===r&&(r=!1),"string"==typeof e?n=h(e):(n=i({},e),o(!n.pathname||!n.pathname.includes("?"),P("?","pathname","search",n)),o(!n.pathname||!n.pathname.includes("#"),P("#","pathname","hash",n)),o(!n.search||!n.search.includes("#"),P("#","search","hash",n)));let s,c=""===e||""===n.pathname,d=c?"/":n.pathname;if(null==d)s=a;else{let e=t.length-1;if(!r&&d.startsWith("..")){let t=d.split("/");for(;".."===t[0];)t.shift(),e-=1;n.pathname=t.join("/")}s=e>=0?t[e]:"/"}let m=function(e,t){void 0===t&&(t="/");let a,{pathname:r,search:i="",hash:n=""}="string"==typeof e?h(e):e;if(r)if(s=r,T.test(s))a=r;else{if(r.includes("//")){let e=r;r=r.replace(/\/\/+/g,"/"),l(!1,"Pathnames cannot have embedded double slashes - normalizing "+e+" -> "+r)}a=r.startsWith("/")?D(r.substring(1),"/"):D(r,t)}else a=t;var s;return{pathname:a,search:A(i),hash:L(n)}}(n,s),u=d&&"/"!==d&&d.endsWith("/"),p=(c||"."===d)&&a.endsWith("/");return m.pathname.endsWith("/")||!u&&!p||(m.pathname+="/"),m}const B=e=>e.join("/").replace(/\/\/+/g,"/"),F=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),A=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",L=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const z=["post","put","patch","delete"],U=(new Set(z),["get",...z]);function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},q.apply(this,arguments)}new Set(U),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const O=r.createContext(null),W=r.createContext(null),$=r.createContext(null),I=r.createContext(null),H=r.createContext({outlet:null,matches:[],isDataRoute:!1}),V=r.createContext(null);function G(){return null!=r.useContext(I)}function Y(){return G()||o(!1),r.useContext(I).location}function J(e){r.useContext($).static||r.useLayoutEffect(e)}function K(){let{isDataRoute:e}=r.useContext(H);return e?function(){let{router:e}=function(){let e=r.useContext(O);return e||o(!1),e}(re.UseNavigateStable),t=ne(ie.UseNavigateStable),a=r.useRef(!1);return J(()=>{a.current=!0}),r.useCallback(function(r,i){void 0===i&&(i={}),a.current&&("number"==typeof r?e.navigate(r):e.navigate(r,q({fromRouteId:t},i)))},[e,t])}():function(){G()||o(!1);let e=r.useContext(O),{basename:t,future:a,navigator:i}=r.useContext($),{matches:n}=r.useContext(H),{pathname:s}=Y(),l=JSON.stringify(M(n,a.v7_relativeSplatPath)),c=r.useRef(!1);return J(()=>{c.current=!0}),r.useCallback(function(a,r){if(void 0===r&&(r={}),!c.current)return;if("number"==typeof a)return void i.go(a);let n=R(a,JSON.parse(l),s,"path"===r.relative);null==e&&"/"!==t&&(n.pathname="/"===n.pathname?t:B([t,n.pathname])),(r.replace?i.replace:i.push)(n,r.state,r)},[t,i,l,s,e])}()}function Q(e,t){let{relative:a}=void 0===t?{}:t,{future:i}=r.useContext($),{matches:n}=r.useContext(H),{pathname:s}=Y(),o=JSON.stringify(M(n,i.v7_relativeSplatPath));return r.useMemo(()=>R(e,JSON.parse(o),s,"path"===a),[e,o,s,a])}function Z(e,t,a,i){G()||o(!1);let{navigator:s}=r.useContext($),{matches:l}=r.useContext(H),c=l[l.length-1],d=c?c.params:{},m=(c&&c.pathname,c?c.pathnameBase:"/");c&&c.route;let u,v=Y();if(t){var f;let e="string"==typeof t?h(t):t;"/"===m||(null==(f=e.pathname)?void 0:f.startsWith(m))||o(!1),u=e}else u=v;let g=u.pathname||"/",x=g;if("/"!==m){let e=m.replace(/^\//,"").split("/");x="/"+g.replace(/^\//,"").split("/").slice(e.length).join("/")}let _=p(e,{pathname:x}),b=function(e,t,a,i){var n;if(void 0===t&&(t=[]),void 0===a&&(a=null),void 0===i&&(i=null),null==e){var s;if(!a)return null;if(a.errors)e=a.matches;else{if(!(null!=(s=i)&&s.v7_partialHydration&&0===t.length&&!a.initialized&&a.matches.length>0))return null;e=a.matches}}let l=e,c=null==(n=a)?void 0:n.errors;if(null!=c){let e=l.findIndex(e=>e.route.id&&void 0!==(null==c?void 0:c[e.route.id]));e>=0||o(!1),l=l.slice(0,Math.min(l.length,e+1))}let d=!1,m=-1;if(a&&i&&i.v7_partialHydration)for(let e=0;e<l.length;e++){let t=l[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(m=e),t.route.id){let{loaderData:e,errors:r}=a,i=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||i){d=!0,l=m>=0?l.slice(0,m+1):[l[0]];break}}}return l.reduceRight((e,i,n)=>{let s,o=!1,h=null,u=null;var p;a&&(s=c&&i.route.id?c[i.route.id]:void 0,h=i.route.errorElement||ee,d&&(m<0&&0===n?(se[p="route-fallback"]||(se[p]=!0),o=!0,u=null):m===n&&(o=!0,u=i.route.hydrateFallbackElement||null)));let v=t.concat(l.slice(0,n+1)),f=()=>{let t;return t=s?h:o?u:i.route.Component?r.createElement(i.route.Component,null):i.route.element?i.route.element:e,r.createElement(ae,{match:i,routeContext:{outlet:e,matches:v,isDataRoute:null!=a},children:t})};return a&&(i.route.ErrorBoundary||i.route.errorElement||0===n)?r.createElement(te,{location:a.location,revalidation:a.revalidation,component:h,error:s,children:f(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):f()},null)}(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},d,e.params),pathname:B([m,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?m:B([m,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),l,a,i);return t&&b?r.createElement(I.Provider,{value:{location:q({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:n.Pop}},b):b}function X(){let e=function(){var e;let t=r.useContext(V),a=function(){let e=r.useContext(W);return e||o(!1),e}(ie.UseRouteError),i=ne(ie.UseRouteError);return void 0!==t?t:null==(e=a.errors)?void 0:e[i]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return r.createElement(r.Fragment,null,r.createElement("h2",null,"Unexpected Application Error!"),r.createElement("h3",{style:{fontStyle:"italic"}},t),a?r.createElement("pre",{style:i},a):null,null)}const ee=r.createElement(X,null);class te extends r.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?r.createElement(H.Provider,{value:this.props.routeContext},r.createElement(V.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ae(e){let{routeContext:t,match:a,children:i}=e,n=r.useContext(O);return n&&n.static&&n.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=a.route.id),r.createElement(H.Provider,{value:t},i)}var re=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(re||{}),ie=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ie||{});function ne(e){let t=function(){let e=r.useContext(H);return e||o(!1),e}(),a=t.matches[t.matches.length-1];return a.route.id||o(!1),a.route.id}const se={};function oe(e){let{to:t,replace:a,state:i,relative:n}=e;G()||o(!1);let{future:s,static:l}=r.useContext($),{matches:c}=r.useContext(H),{pathname:d}=Y(),m=K(),h=R(t,M(c,s.v7_relativeSplatPath),d,"path"===n),u=JSON.stringify(h);return r.useEffect(()=>m(JSON.parse(u),{replace:a,state:i,relative:n}),[m,u,n,a,i]),null}function le(e){o(!1)}function ce(e){let{basename:t="/",children:a=null,location:i,navigationType:s=n.Pop,navigator:l,static:c=!1,future:d}=e;G()&&o(!1);let m=t.replace(/^\/*/,"/"),u=r.useMemo(()=>({basename:m,navigator:l,static:c,future:q({v7_relativeSplatPath:!1},d)}),[m,d,l,c]);"string"==typeof i&&(i=h(i));let{pathname:p="/",search:v="",hash:f="",state:g=null,key:x="default"}=i,_=r.useMemo(()=>{let e=E(p,m);return null==e?null:{location:{pathname:e,search:v,hash:f,state:g,key:x},navigationType:s}},[m,p,v,f,g,x,s]);return null==_?null:r.createElement($.Provider,{value:u},r.createElement(I.Provider,{children:a,value:_}))}function de(e){let{children:t,location:a}=e;return Z(me(t),a)}function me(e,t){void 0===t&&(t=[]);let a=[];return r.Children.forEach(e,(e,i)=>{if(!r.isValidElement(e))return;let n=[...t,i];if(e.type===r.Fragment)return void a.push.apply(a,me(e.props.children,n));e.type!==le&&o(!1),e.props.index&&e.props.children&&o(!1);let s={id:e.props.id||n.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(s.children=me(e.props.children,n)),a.push(s)}),a}r.startTransition,new Promise(()=>{}),r.Component;const he=window.ReactDOM;function ue(){return ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ue.apply(this,arguments)}function pe(e,t){if(null==e)return{};var a,r,i={},n=Object.keys(e);for(r=0;r<n.length;r++)a=n[r],t.indexOf(a)>=0||(i[a]=e[a]);return i}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const ve=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],fe=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"];try{window.__reactRouterVersion="6"}catch(e){}const ge=r.createContext({isTransitioning:!1});new Map;const xe=r.startTransition;function _e(e){let{basename:t,children:a,future:u,window:p}=e,v=r.useRef();var f;null==v.current&&(v.current=(void 0===(f={window:p,v5Compat:!0})&&(f={}),function(e,t,a,r){void 0===r&&(r={});let{window:l=document.defaultView,v5Compat:h=!1}=r,u=l.history,p=n.Pop,v=null,f=g();function g(){return(u.state||{idx:null}).idx}function x(){p=n.Pop;let e=g(),t=null==e?null:e-f;f=e,v&&v({action:p,location:b.location,delta:t})}function _(e){let t="null"!==l.location.origin?l.location.origin:l.location.href,a="string"==typeof e?e:m(e);return a=a.replace(/ $/,"%20"),o(t,"No window.location.(origin|href) available to create URL for href: "+a),new URL(a,t)}null==f&&(f=0,u.replaceState(i({},u.state,{idx:f}),""));let b={get action(){return p},get location(){return e(l,u)},listen(e){if(v)throw new Error("A history only accepts one active listener");return l.addEventListener(s,x),v=e,()=>{l.removeEventListener(s,x),v=null}},createHref:e=>t(l,e),createURL:_,encodeLocation(e){let t=_(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){p=n.Push;let r=d(b.location,e,t);a&&a(r,e),f=g()+1;let i=c(r,f),s=b.createHref(r);try{u.pushState(i,"",s)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;l.location.assign(s)}h&&v&&v({action:p,location:b.location,delta:1})},replace:function(e,t){p=n.Replace;let r=d(b.location,e,t);a&&a(r,e),f=g();let i=c(r,f),s=b.createHref(r);u.replaceState(i,"",s),h&&v&&v({action:p,location:b.location,delta:0})},go:e=>u.go(e)};return b}(function(e,t){let{pathname:a="/",search:r="",hash:i=""}=h(e.location.hash.substr(1));return a.startsWith("/")||a.startsWith(".")||(a="/"+a),d("",{pathname:a,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let a=e.document.querySelector("base"),r="";if(a&&a.getAttribute("href")){let t=e.location.href,a=t.indexOf("#");r=-1===a?t:t.slice(0,a)}return r+"#"+("string"==typeof t?t:m(t))},function(e,t){l("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")},f)));let g=v.current,[x,_]=r.useState({action:g.action,location:g.location}),{v7_startTransition:b}=u||{},y=r.useCallback(e=>{b&&xe?xe(()=>_(e)):_(e)},[_,b]);return r.useLayoutEffect(()=>g.listen(y),[g,y]),r.useEffect(()=>{return null==(e=u)||e.v7_startTransition,void 0===(null==e?void 0:e.v7_relativeSplatPath)&&(!t||t.v7_relativeSplatPath),void(t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation));var e,t},[u]),r.createElement(ce,{basename:t,children:a,location:x.location,navigationType:x.action,navigator:g,future:u})}he.flushSync,r.useId;const be="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,ye=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,je=r.forwardRef(function(e,t){let a,{onClick:i,relative:n,reloadDocument:s,replace:l,state:c,target:d,to:h,preventScrollReset:u,viewTransition:p}=e,v=pe(e,ve),{basename:f}=r.useContext($),g=!1;if("string"==typeof h&&ye.test(h)&&(a=h,be))try{let e=new URL(window.location.href),t=h.startsWith("//")?new URL(e.protocol+h):new URL(h),a=E(t.pathname,f);t.origin===e.origin&&null!=a?h=a+t.search+t.hash:g=!0}catch(e){}let x=function(e,t){let{relative:a}=void 0===t?{}:t;G()||o(!1);let{basename:i,navigator:n}=r.useContext($),{hash:s,pathname:l,search:c}=Q(e,{relative:a}),d=l;return"/"!==i&&(d="/"===l?i:B([i,l])),n.createHref({pathname:d,search:c,hash:s})}(h,{relative:n}),_=function(e,t){let{target:a,replace:i,state:n,preventScrollReset:s,relative:o,viewTransition:l}=void 0===t?{}:t,c=K(),d=Y(),h=Q(e,{relative:o});return r.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,a)){t.preventDefault();let a=void 0!==i?i:m(d)===m(h);c(e,{replace:a,state:n,preventScrollReset:s,relative:o,viewTransition:l})}},[d,c,h,i,n,a,e,s,o,l])}(h,{replace:l,state:c,target:d,preventScrollReset:u,relative:n,viewTransition:p});return r.createElement("a",ue({},v,{href:a||x,onClick:g||s?i:function(e){i&&i(e),e.defaultPrevented||_(e)},ref:t,target:d}))}),Ce=r.forwardRef(function(e,t){let{"aria-current":a="page",caseSensitive:i=!1,className:n="",end:s=!1,style:l,to:c,viewTransition:d,children:m}=e,h=pe(e,fe),u=Q(c,{relative:h.relative}),p=Y(),v=r.useContext(W),{navigator:f,basename:g}=r.useContext($),x=null!=v&&function(e,t){void 0===t&&(t={});let a=r.useContext(ge);null==a&&o(!1);let{basename:i}=function(){let e=r.useContext(O);return e||o(!1),e}(ke.useViewTransitionState),n=Q(e,{relative:t.relative});if(!a.isTransitioning)return!1;let s=E(a.currentLocation.pathname,i)||a.currentLocation.pathname,l=E(a.nextLocation.pathname,i)||a.nextLocation.pathname;return null!=N(n.pathname,l)||null!=N(n.pathname,s)}(u)&&!0===d,_=f.encodeLocation?f.encodeLocation(u).pathname:u.pathname,b=p.pathname,y=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;i||(b=b.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&g&&(y=E(y,g)||y);const j="/"!==_&&_.endsWith("/")?_.length-1:_.length;let C,k=b===_||!s&&b.startsWith(_)&&"/"===b.charAt(j),w=null!=y&&(y===_||!s&&y.startsWith(_)&&"/"===y.charAt(_.length)),S={isActive:k,isPending:w,isTransitioning:x},T=k?a:void 0;C="function"==typeof n?n(S):[n,k?"active":null,w?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let D="function"==typeof l?l(S):l;return r.createElement(je,ue({},h,{"aria-current":T,className:C,ref:t,style:D,to:c,viewTransition:d}),"function"==typeof m?m(S):m)});var ke,we;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ke||(ke={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(we||(we={}));const Ne=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,a)=>a?a.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Se=(...e)=>e.filter((e,t,a)=>Boolean(e)&&""!==e.trim()&&a.indexOf(e)===t).join(" ").trim(),Ee=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var Te={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const De=(0,r.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:n="",children:s,iconNode:o,...l},c)=>(0,r.createElement)("svg",{ref:c,...Te,width:t,height:t,stroke:e,strokeWidth:i?24*Number(a)/Number(t):a,className:Se("lucide",n),...!s&&!Ee(l)&&{"aria-hidden":"true"},...l},[...o.map(([e,t])=>(0,r.createElement)(e,t)),...Array.isArray(s)?s:[s]])),Pe=(e,t)=>{const a=(0,r.forwardRef)(({className:a,...i},n)=>{return(0,r.createElement)(De,{ref:n,iconNode:t,className:Se(`lucide-${s=Ne(e),s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,a),...i});var s});return a.displayName=Ne(e),a},Me=Pe("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]),Re=window.ReactJSXRuntime,Be=()=>(0,Re.jsxs)("div",{className:"formative-admin-header",children:[(0,Re.jsx)("div",{className:"formative-admin-header-left",children:(0,Re.jsxs)("h1",{className:"formative-logo",children:[(0,Re.jsx)("span",{className:"formative-logo-icon",children:(0,Re.jsx)(Me,{size:24})}),(0,a.__)("Formative","formative")]})}),(0,Re.jsx)("div",{className:"formative-admin-header-right",children:(0,Re.jsx)("span",{className:"formative-version",children:"v1.0.0"})})]}),Fe=Pe("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),Ae=Pe("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),Le=Pe("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),ze=Pe("inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]),Ue=Pe("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),qe=()=>{const e=[{path:"/",label:(0,a.__)("Dashboard","formative"),icon:Fe,exact:!0},{path:"/forms",label:(0,a.__)("All Forms","formative"),icon:Ae},{path:"/forms/templates",label:(0,a.__)("Add New","formative"),icon:Le},{path:"/entries",label:(0,a.__)("Entries","formative"),icon:ze},{path:"/settings",label:(0,a.__)("Settings","formative"),icon:Ue}];return(0,Re.jsx)("div",{className:"formative-admin-sidebar",children:(0,Re.jsx)("nav",{className:"formative-admin-nav",children:e.map(e=>{const t=e.icon;return(0,Re.jsxs)(Ce,{to:e.path,end:e.exact,className:({isActive:e})=>"formative-nav-item "+(e?"active":""),children:[(0,Re.jsx)("span",{className:"formative-nav-icon",children:(0,Re.jsx)(t,{size:20})}),(0,Re.jsx)("span",{className:"formative-nav-label",children:e.label})]},e.path)})})})},Oe=window.wp.apiFetch;var We=e.n(Oe);const $e=()=>{const[e,r]=(0,t.useState)({totalForms:0,totalEntries:0,recentForms:[],recentEntries:[]}),[i,n]=(0,t.useState)(!0);(0,t.useEffect)(()=>{s()},[]);const s=async()=>{try{const[e,t]=await Promise.all([We()({path:"/formative/v1/forms?per_page=5"}),We()({path:"/formative/v1/entries?per_page=5"})]);r({totalForms:e.data?.total||0,totalEntries:t.data?.total||0,recentForms:e.data?.forms||[],recentEntries:t.data?.entries||[]})}catch(e){console.error("Error fetching dashboard data:",e)}finally{n(!1)}};return i?(0,Re.jsx)("div",{className:"formative-loading",children:(0,a.__)("Loading...","formative")}):(0,Re.jsxs)("div",{className:"formative-dashboard",children:[(0,Re.jsx)("div",{className:"formative-page-header",children:(0,Re.jsx)("h1",{children:(0,a.__)("Dashboard","formative")})}),(0,Re.jsxs)("div",{className:"formative-stats-grid",children:[(0,Re.jsxs)("div",{className:"formative-stat-card",children:[(0,Re.jsx)("div",{className:"formative-stat-icon",children:(0,Re.jsx)(Ae,{size:32,strokeWidth:1.5})}),(0,Re.jsx)("div",{className:"formative-stat-label",children:(0,a.__)("Total Forms","formative")}),(0,Re.jsx)("div",{className:"formative-stat-content",children:(0,Re.jsx)("div",{className:"formative-stat-value",children:e.totalForms})})]}),(0,Re.jsxs)("div",{className:"formative-stat-card",children:[(0,Re.jsx)("div",{className:"formative-stat-icon",children:(0,Re.jsx)(ze,{size:32,strokeWidth:1.5})}),(0,Re.jsx)("div",{className:"formative-stat-label",children:(0,a.__)("Total Entries","formative")}),(0,Re.jsx)("div",{className:"formative-stat-content",children:(0,Re.jsx)("div",{className:"formative-stat-value",children:e.totalEntries})})]})]})," ",(0,Re.jsxs)("div",{className:"formative-dashboard-sections",children:[(0,Re.jsxs)("div",{className:"formative-dashboard-section",children:[(0,Re.jsx)("h2",{children:(0,a.__)("Recent Forms","formative")}),e.recentForms.length>0?(0,Re.jsx)("div",{className:"formative-recent-list",children:e.recentForms.map(e=>(0,Re.jsxs)("div",{className:"formative-recent-item",children:[(0,Re.jsx)("div",{className:"formative-recent-title",children:e.title}),(0,Re.jsxs)("div",{className:"formative-recent-meta",children:[e.entriesCount," ",(0,a.__)("entries","formative")]})]},e.id))}):(0,Re.jsx)("p",{children:(0,a.__)("No forms yet.","formative")})]}),(0,Re.jsxs)("div",{className:"formative-dashboard-section",children:[(0,Re.jsx)("h2",{children:(0,a.__)("Recent Entries","formative")}),e.recentEntries.length>0?(0,Re.jsx)("div",{className:"formative-recent-list",children:e.recentEntries.map(e=>(0,Re.jsxs)("div",{className:"formative-recent-item",children:[(0,Re.jsxs)("div",{className:"formative-recent-title",children:[(0,a.__)("Entry #","formative"),e.id]}),(0,Re.jsx)("div",{className:"formative-recent-meta",children:new Date(e.createdAt).toLocaleDateString()})]},e.id))}):(0,Re.jsx)("p",{children:(0,a.__)("No entries yet.","formative")})]})]})]})},Ie=window.wp.components,He=()=>{const[e,r]=(0,t.useState)([]),[i,n]=(0,t.useState)(!0),[s,o]=(0,t.useState)(1),[l,c]=(0,t.useState)(1),[d,m]=(0,t.useState)(null),h=K();(0,t.useEffect)(()=>{u()},[s]);const u=async()=>{n(!0);try{const e=await We()({path:`/formative/v1/forms?page=${s}&per_page=10`});e.success&&(r(e.data.forms),c(e.data.totalPages))}catch(e){console.error("Error fetching forms:",e)}finally{n(!1)}},p=e=>`${window.location.origin}/?formative_preview=${e}`,v=e=>{switch(e.type){case"textarea":return(0,Re.jsx)("textarea",{className:"formative-input formative-textarea",placeholder:e.placeholder,disabled:!0});case"select":return(0,Re.jsxs)("select",{className:"formative-input formative-select",disabled:!0,children:[(0,Re.jsx)("option",{children:e.placeholder||(0,a.__)("Select...","formative")}),e.options?.map((e,t)=>(0,Re.jsx)("option",{value:e.value,children:e.label},t))]});case"checkbox":return(0,Re.jsx)("div",{className:"formative-checkbox-group",children:e.options?.map((e,t)=>(0,Re.jsxs)("label",{className:"formative-checkbox-label",children:[(0,Re.jsx)("input",{type:"checkbox",disabled:!0}),(0,Re.jsx)("span",{children:e.label})]},t))});case"radio":return(0,Re.jsx)("div",{className:"formative-radio-group",children:e.options?.map((t,a)=>(0,Re.jsxs)("label",{className:"formative-radio-label",children:[(0,Re.jsx)("input",{type:"radio",name:e.name,disabled:!0}),(0,Re.jsx)("span",{children:t.label})]},a))});default:return(0,Re.jsx)("input",{type:e.type||"text",className:"formative-input",placeholder:e.placeholder,disabled:!0})}};return i?(0,Re.jsx)("div",{className:"formative-loading",children:(0,a.__)("Loading...","formative")}):(0,Re.jsxs)("div",{className:"formative-form-list",children:[(0,Re.jsxs)("div",{className:"formative-page-header",children:[(0,Re.jsx)("h1",{children:(0,a.__)("All Forms","formative")}),(0,Re.jsx)(Ie.Button,{isPrimary:!0,onClick:()=>h("/forms/templates"),children:(0,a.__)("Add New Form","formative")})]}),e.length>0?(0,Re.jsx)("div",{className:"formative-table-wrapper",children:(0,Re.jsxs)("table",{className:"formative-table",children:[(0,Re.jsx)("thead",{children:(0,Re.jsxs)("tr",{children:[(0,Re.jsx)("th",{children:(0,a.__)("Title","formative")}),(0,Re.jsx)("th",{children:(0,a.__)("Shortcode","formative")}),(0,Re.jsx)("th",{children:(0,a.__)("Entries","formative")}),(0,Re.jsx)("th",{children:(0,a.__)("Created","formative")}),(0,Re.jsx)("th",{children:(0,a.__)("Actions","formative")})]})}),(0,Re.jsx)("tbody",{children:e.map(e=>(0,Re.jsxs)("tr",{children:[(0,Re.jsx)("td",{children:(0,Re.jsx)("strong",{children:e.title})}),(0,Re.jsx)("td",{children:(0,Re.jsxs)("div",{className:"formative-shortcode-cell",children:[(0,Re.jsx)("code",{children:e.shortcode}),(0,Re.jsx)(Ie.Button,{isSmall:!0,onClick:()=>{return t=e.shortcode,navigator.clipboard.writeText(t),void alert((0,a.__)("Shortcode copied to clipboard!","formative"));var t},children:(0,a.__)("Copy","formative")})]})}),(0,Re.jsx)("td",{children:e.entriesCount}),(0,Re.jsx)("td",{children:new Date(e.createdAt).toLocaleDateString()}),(0,Re.jsx)("td",{children:(0,Re.jsxs)("div",{className:"formative-table-actions",children:[(0,Re.jsx)(Ie.Button,{isLink:!0,onClick:()=>h(`/forms/edit/${e.id}`),children:(0,a.__)("Edit","formative")}),(0,Re.jsx)(Ie.Button,{isLink:!0,onClick:()=>(e=>{m(e)})(e),children:(0,a.__)("Preview","formative")}),(0,Re.jsx)(Ie.Button,{isLink:!0,onClick:()=>window.open(p(e.id),"_blank"),children:(0,a.__)("View","formative")}),(0,Re.jsx)(Ie.Button,{isLink:!0,onClick:()=>(async e=>{try{await We()({path:`/formative/v1/forms/${e}/duplicate`,method:"POST"}),u()}catch(e){console.error("Error duplicating form:",e),alert((0,a.__)("Failed to duplicate form.","formative"))}})(e.id),children:(0,a.__)("Duplicate","formative")}),(0,Re.jsx)(Ie.Button,{isLink:!0,isDestructive:!0,onClick:()=>(async e=>{if(confirm((0,a.__)("Are you sure you want to delete this form?","formative")))try{await We()({path:`/formative/v1/forms/${e}`,method:"DELETE"}),u()}catch(e){console.error("Error deleting form:",e),alert((0,a.__)("Failed to delete form.","formative"))}})(e.id),children:(0,a.__)("Delete","formative")})]})})]},e.id))})]})}):(0,Re.jsxs)("div",{className:"formative-empty-state",children:[(0,Re.jsx)("p",{children:(0,a.__)("No forms found. Create your first form!","formative")}),(0,Re.jsx)(Ie.Button,{isPrimary:!0,onClick:()=>h("/forms/new"),children:(0,a.__)("Create Form","formative")})]}),l>1&&(0,Re.jsxs)("div",{className:"formative-pagination",children:[(0,Re.jsx)(Ie.Button,{disabled:1===s,onClick:()=>o(s-1),children:(0,a.__)("Previous","formative")}),(0,Re.jsxs)("span",{children:[(0,a.__)("Page","formative")," ",s," ",(0,a.__)("of","formative")," ",l]}),(0,Re.jsx)(Ie.Button,{disabled:s===l,onClick:()=>o(s+1),children:(0,a.__)("Next","formative")})]}),d&&(0,Re.jsxs)(Ie.Modal,{title:`${(0,a.__)("Preview:","formative")} ${d.title}`,onRequestClose:()=>m(null),className:"formative-preview-modal",style:{maxWidth:"800px"},children:[(f=d,f.fields&&0!==f.fields.length?(0,Re.jsx)("div",{className:"formative-form-preview",children:(0,Re.jsxs)("form",{className:"formative-form",children:[f.fields.map((e,t)=>(0,Re.jsxs)("div",{className:"formative-field-wrapper",children:[e.label&&(0,Re.jsxs)("label",{className:"formative-field-label",children:[e.label,e.required&&(0,Re.jsx)("span",{className:"formative-required",children:"*"})]}),(0,Re.jsx)("div",{className:"formative-field-input",children:v(e)}),e.helpText&&(0,Re.jsx)("p",{className:"formative-field-help",children:e.helpText})]},t)),(0,Re.jsx)("div",{className:"formative-field-wrapper",children:(0,Re.jsx)("button",{type:"button",className:"formative-submit-button",disabled:!0,children:f.settings?.submitButtonText||(0,a.__)("Submit","formative")})})]})}):(0,Re.jsx)("p",{children:(0,a.__)("This form has no fields to preview.","formative")})),(0,Re.jsxs)("div",{className:"formative-modal-footer",children:[(0,Re.jsx)(Ie.Button,{isPrimary:!0,onClick:()=>m(null),children:(0,a.__)("Close","formative")}),(0,Re.jsx)(Ie.Button,{isSecondary:!0,onClick:()=>window.open(p(d.id),"_blank"),children:(0,a.__)("View on Frontend","formative")})]})]})]});var f},Ve=Pe("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]),Ge=Pe("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),Ye=Pe("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),Je=Pe("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),Ke=Pe("shopping-cart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]),Qe=()=>{const e=K(),t=[{id:"blank",name:(0,a.__)("Start with Blank Template","formative"),description:(0,a.__)("Create a form from scratch with your own fields","formative"),icon:Me,fields:[]},{id:"contact",name:(0,a.__)("Contact Form","formative"),description:(0,a.__)("Simple contact form with name, email, and message","formative"),icon:Ve,fields:[{type:"text",label:"Name",name:"name",required:!0,placeholder:"Your name"},{type:"email",label:"Email",name:"email",required:!0,placeholder:"your@email.com"},{type:"tel",label:"Phone",name:"phone",placeholder:"Your phone number"},{type:"textarea",label:"Message",name:"message",required:!0,placeholder:"Your message",rows:5},{type:"submit",label:"Send Message",name:"submit"}]},{id:"registration",name:(0,a.__)("Registration Form","formative"),description:(0,a.__)("User registration with personal details","formative"),icon:Ge,fields:[{type:"firstname",label:"First Name",name:"first_name",required:!0,placeholder:"First name"},{type:"lastname",label:"Last Name",name:"last_name",required:!0,placeholder:"Last name"},{type:"email",label:"Email Address",name:"email",required:!0,placeholder:"your@email.com"},{type:"tel",label:"Phone Number",name:"phone",required:!0,placeholder:"Phone number"},{type:"password",label:"Password",name:"password",required:!0,placeholder:"Choose a password"},{type:"gdpr",label:"GDPR Consent",name:"gdpr_consent",required:!0},{type:"submit",label:"Register",name:"submit"}]},{id:"feedback",name:(0,a.__)("Feedback Form","formative"),description:(0,a.__)("Collect customer feedback with ratings","formative"),icon:Ye,fields:[{type:"text",label:"Name",name:"name",required:!0,placeholder:"Your name"},{type:"email",label:"Email",name:"email",required:!0,placeholder:"your@email.com"},{type:"rating",label:"Overall Satisfaction",name:"satisfaction",required:!0,maxRating:5},{type:"textarea",label:"Comments",name:"comments",placeholder:"Tell us more...",rows:5},{type:"submit",label:"Submit Feedback",name:"submit"}]},{id:"appointment",name:(0,a.__)("Appointment Booking","formative"),description:(0,a.__)("Schedule appointments with date and time selection","formative"),icon:Je,fields:[{type:"text",label:"Full Name",name:"name",required:!0,placeholder:"Your name"},{type:"email",label:"Email",name:"email",required:!0,placeholder:"your@email.com"},{type:"tel",label:"Phone",name:"phone",required:!0,placeholder:"Phone number"},{type:"date",label:"Preferred Date",name:"appointment_date",required:!0},{type:"time",label:"Preferred Time",name:"appointment_time",required:!0},{type:"textarea",label:"Additional Notes",name:"notes",placeholder:"Any special requirements",rows:3},{type:"submit",label:"Book Appointment",name:"submit"}]},{id:"order",name:(0,a.__)("Order Form","formative"),description:(0,a.__)("Product order form with quantity and options","formative"),icon:Ke,fields:[{type:"text",label:"Full Name",name:"name",required:!0,placeholder:"Your name"},{type:"email",label:"Email",name:"email",required:!0,placeholder:"your@email.com"},{type:"tel",label:"Phone",name:"phone",required:!0,placeholder:"Phone number"},{type:"select",label:"Product",name:"product",required:!0,options:["Select a product","Product A","Product B","Product C"]},{type:"number",label:"Quantity",name:"quantity",required:!0,min:1,max:100,defaultValue:1},{type:"textarea",label:"Delivery Address",name:"address",required:!0,placeholder:"Full delivery address",rows:3},{type:"submit",label:"Place Order",name:"submit"}]}],r=t=>{const a={id:t.id,name:t.name,description:t.description,fields:t.fields};e("/forms/new",{state:{template:a}})};return(0,Re.jsxs)("div",{className:"formative-template-selector",children:[(0,Re.jsxs)("div",{className:"formative-template-header",children:[(0,Re.jsx)("h1",{children:(0,a.__)("Choose a Template","formative")}),(0,Re.jsx)("p",{children:(0,a.__)("Select a template to get started quickly, or start from scratch","formative")})]}),(0,Re.jsx)("div",{className:"formative-template-grid",children:t.map(e=>{const t=e.icon;return(0,Re.jsxs)("div",{className:"formative-template-card",onClick:()=>r(e),role:"button",tabIndex:0,onKeyPress:t=>{"Enter"!==t.key&&" "!==t.key||r(e)},children:[(0,Re.jsx)("div",{className:"formative-template-icon",children:(0,Re.jsx)(t,{size:40,strokeWidth:1.5})}),(0,Re.jsx)("h3",{children:e.name}),(0,Re.jsx)("p",{children:e.description}),"blank"!==e.id&&(0,Re.jsxs)("div",{className:"formative-template-badge",children:[e.fields.length," ",(0,a.__)("fields","formative")]})]},e.id)})})]})},Ze=Pe("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),Xe=Pe("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),et=Pe("type",[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]),tt=Pe("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]),at=Pe("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]),rt=Pe("text-align-start",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]]),it=Pe("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),nt=Pe("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),st=Pe("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),ot=Pe("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),lt=Pe("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),ct=Pe("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),dt=Pe("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),mt=Pe("sliders-vertical",[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]]),ht=Pe("toggle-left",[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),ut=Pe("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),pt=Pe("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),vt=Pe("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),ft=Pe("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),gt=Pe("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),xt=Pe("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),_t=Pe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),bt=Pe("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),yt=Pe("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]),jt=Pe("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),Ct=({value:e={},onChange:r})=>{const[i,n]=(0,t.useState)("desktop"),s={desktop:{label:(0,a.__)("Desktop","formative"),icon:bt,minWidth:1024},tablet:{label:(0,a.__)("Tablet","formative"),icon:yt,minWidth:768},mobile:{label:(0,a.__)("Mobile","formative"),icon:jt,minWidth:320}},o=e[i]||{},l=(t,a)=>{const n={...e,[i]:{...o,[t]:a}};r(n)};return(0,Re.jsxs)("div",{className:"formative-responsive-controls",children:[(0,Re.jsx)("div",{className:"formative-device-switcher",children:(0,Re.jsx)(Ie.ButtonGroup,{children:Object.entries(s).map(([e,{label:t,icon:a}])=>(0,Re.jsxs)(Ie.Button,{isPressed:i===e,onClick:()=>n(e),children:[(0,Re.jsx)("span",{className:"formative-device-icon",children:(0,Re.jsx)(a,{size:16})}),(0,Re.jsx)("span",{className:"formative-device-label",children:t})]},e))})}),(0,Re.jsxs)("div",{className:"formative-responsive-settings",children:[(0,Re.jsx)("h4",{children:(0,a.__)("Spacing","formative")}),(0,Re.jsx)(Ie.__experimentalUnitControl,{label:(0,a.__)("Margin Top","formative"),value:o.marginTop||"0px",onChange:e=>l("marginTop",e),units:[{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"},{value:"%",label:"%"}]}),(0,Re.jsx)(Ie.__experimentalUnitControl,{label:(0,a.__)("Margin Bottom","formative"),value:o.marginBottom||"0px",onChange:e=>l("marginBottom",e),units:[{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"},{value:"%",label:"%"}]}),(0,Re.jsx)(Ie.__experimentalUnitControl,{label:(0,a.__)("Padding","formative"),value:o.padding||"0px",onChange:e=>l("padding",e),units:[{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"}]}),(0,Re.jsx)("h4",{children:(0,a.__)("Typography","formative")}),(0,Re.jsx)(Ie.__experimentalUnitControl,{label:(0,a.__)("Font Size","formative"),value:o.fontSize||"16px",onChange:e=>l("fontSize",e),units:[{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"}]}),(0,Re.jsx)("h4",{children:(0,a.__)("Layout","formative")}),(0,Re.jsx)(Ie.__experimentalUnitControl,{label:(0,a.__)("Width","formative"),value:o.width||"100%",onChange:e=>l("width",e),units:[{value:"%",label:"%"},{value:"px",label:"px"},{value:"vw",label:"vw"}]}),(0,Re.jsx)(Ie.SelectControl,{label:(0,a.__)("Display","formative"),value:o.display||"block",options:[{label:(0,a.__)("Block","formative"),value:"block"},{label:(0,a.__)("Inline Block","formative"),value:"inline-block"},{label:(0,a.__)("Flex","formative"),value:"flex"},{label:(0,a.__)("None","formative"),value:"none"}],onChange:e=>l("display",e)})]})]})},kt=({field:e,onUpdate:t,onClose:r,onMoveUp:i,onMoveDown:n,onDelete:s,canMoveUp:o,canMoveDown:l})=>{const c=["select","radio","checkbox"].includes(e.type),d=(a,r)=>{t({...e,[a]:r})},m=(t,a,r)=>{const i=[...e.options||[]];i[t]={...i[t],[a]:r},d("options",i)},h=()=>{const t=[...e.options||[],{label:`Option ${(e.options?.length||0)+1}`,value:`option${(e.options?.length||0)+1}`}];d("options",t)};return(0,Re.jsxs)("div",{className:"formative-field-settings-panel",children:[(0,Re.jsxs)("div",{className:"settings-panel-header",children:[(0,Re.jsxs)("div",{className:"settings-panel-title",children:[(0,Re.jsx)("h3",{children:(0,a.__)("Field Settings","formative")}),(0,Re.jsx)("span",{className:"field-type-badge",children:e.type})]}),(0,Re.jsxs)("div",{className:"settings-panel-actions",children:[o&&(0,Re.jsx)(Ie.Button,{onClick:i,label:(0,a.__)("Move up","formative"),icon:(0,Re.jsx)(gt,{size:16})}),l&&(0,Re.jsx)(Ie.Button,{onClick:n,label:(0,a.__)("Move down","formative"),icon:(0,Re.jsx)(it,{size:16})}),(0,Re.jsx)(Ie.Button,{onClick:()=>{confirm((0,a.__)("Delete this field?","formative"))&&(s(),r())},label:(0,a.__)("Delete","formative"),isDestructive:!0,icon:(0,Re.jsx)(xt,{size:16})}),(0,Re.jsx)(Ie.Button,{onClick:r,label:(0,a.__)("Close","formative"),icon:(0,Re.jsx)(_t,{size:20})})]})]}),(0,Re.jsx)("div",{className:"settings-panel-content",children:(0,Re.jsx)(Ie.TabPanel,{className:"formative-settings-tabs",activeClass:"is-active",tabs:[{name:"content",title:(0,a.__)("Content","formative"),className:"tab-content"},{name:"style",title:(0,a.__)("Style","formative"),className:"tab-style"},{name:"advanced",title:(0,a.__)("Advanced","formative"),className:"tab-advanced"}],children:t=>"content"===t.name?(0,Re.jsx)("div",{className:"tab-panel-content",children:(0,Re.jsxs)(Ie.Panel,{children:[(0,Re.jsxs)(Ie.PanelBody,{title:(0,a.__)("General","formative"),initialOpen:!0,children:[(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Label","formative"),value:e.label,onChange:e=>d("label",e)}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Field Name","formative"),value:e.name,onChange:e=>d("name",e),help:(0,a.__)("Unique identifier for this field","formative")}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Placeholder","formative"),value:e.placeholder,onChange:e=>d("placeholder",e)}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Help Text","formative"),value:e.helpText,onChange:e=>d("helpText",e)}),(0,Re.jsx)(Ie.CheckboxControl,{label:(0,a.__)("Required","formative"),checked:e.required,onChange:e=>d("required",e)})]}),c&&(0,Re.jsxs)(Ie.PanelBody,{title:(0,a.__)("Options","formative"),children:[(0,Re.jsx)("div",{className:"formative-options-list",children:(e.options||[]).map((t,r)=>(0,Re.jsxs)("div",{className:"formative-option-item",children:[(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Label","formative"),value:t.label,onChange:e=>m(r,"label",e)}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Value","formative"),value:t.value,onChange:e=>m(r,"value",e)}),(0,Re.jsx)(Ie.Button,{isDestructive:!0,isSmall:!0,onClick:()=>(t=>{const a=e.options.filter((e,a)=>a!==t);d("options",a)})(r),children:(0,a.__)("Remove","formative")})]},r))}),(0,Re.jsx)(Ie.Button,{isSecondary:!0,onClick:h,style:{marginTop:"10px"},children:(0,a.__)("Add Option","formative")})]})]})}):"style"===t.name?(0,Re.jsx)("div",{className:"tab-panel-content",children:(0,Re.jsx)(Ie.Panel,{children:(0,Re.jsx)(Ie.PanelBody,{title:(0,a.__)("Responsive Styling","formative"),initialOpen:!0,children:(0,Re.jsx)(Ct,{value:e.responsive||{},onChange:e=>d("responsive",e)})})})}):"advanced"===t.name?(0,Re.jsx)("div",{className:"tab-panel-content",children:(0,Re.jsx)(Ie.Panel,{children:(0,Re.jsxs)(Ie.PanelBody,{title:(0,a.__)("Advanced Options","formative"),initialOpen:!0,children:[(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("CSS Classes","formative"),value:e.cssClasses||"",onChange:e=>d("cssClasses",e),help:(0,a.__)("Add custom CSS classes","formative")}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Field ID","formative"),value:e.fieldId||"",onChange:e=>d("fieldId",e),help:(0,a.__)("Custom HTML ID attribute","formative")})]})})}):void 0})})]})},wt=({settings:e,updateSetting:t})=>(0,Re.jsxs)("div",{className:"formative-settings-tab",children:[(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Form Title","formative"),help:(0,a.__)("This is the form title","formative"),value:e.formTitle||"",onChange:e=>t("formTitle",e)}),(0,Re.jsx)(Ie.TextareaControl,{label:(0,a.__)("Success Message","formative"),help:(0,a.__)("This message will be shown after a successful submission.","formative"),value:e.successMessage||"",onChange:e=>t("successMessage",e)}),(0,Re.jsx)(Ie.TextareaControl,{label:(0,a.__)("Error Message","formative"),help:(0,a.__)("This message will be shown if there is an error.","formative"),value:e.errorMessage||"",onChange:e=>t("errorMessage",e)}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Required Login","formative"),help:(0,a.__)("Without login, users can't submit the form.","formative"),checked:e.requireLogin||!1,onChange:e=>t("requireLogin",e)}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Capture User Browser Data","formative"),help:(0,a.__)("Store user's browser (and maybe browser etc).","formative"),checked:e.captureBrowserData||!1,onChange:e=>t("captureBrowserData",e)}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Hide Form After Submission","formative"),help:(0,a.__)("After submission, hide the form for preventing multiple submission.","formative"),checked:e.hideFormAfterSubmission||!1,onChange:e=>t("hideFormAfterSubmission",e)}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Store Entries","formative"),help:(0,a.__)("Store submitted form data to database.","formative"),checked:!1!==e.storeEntries,onChange:e=>t("storeEntries",e)}),!1!==e.storeEntries&&(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Entry Title","formative"),help:(0,a.__)("Enter here title of this form entries.","formative"),value:e.entryTitle||"Entry # {id}",onChange:e=>t("entryTitle",e)}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Limit Total Entries","formative"),help:(0,a.__)("Limit the total number of submissions for this form.","formative"),checked:e.limitEntries||!1,onChange:e=>t("limitEntries",e)}),e.limitEntries&&(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Maximum Entries","formative"),type:"number",value:e.maxEntries||"",onChange:e=>t("maxEntries",e)}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Count Views","formative"),help:(0,a.__)("Track form views.","formative"),checked:e.countViews||!1,onChange:e=>t("countViews",e)}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Stop Vertical Scrolling","formative"),help:(0,a.__)("Stop scrolling effect when submitting the form.","formative"),checked:e.stopVerticalScrolling||!1,onChange:e=>t("stopVerticalScrolling",e)}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Redirect To","formative"),help:(0,a.__)("Users will be redirected to this link after submission.","formative"),value:e.redirectUrl||"",onChange:e=>t("redirectUrl",e),placeholder:"https://example.com/thank-you"}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Show Quiz Summary","formative"),help:(0,a.__)("Display quiz results after submission.","formative"),checked:e.showQuizSummary||!1,onChange:e=>t("showQuizSummary",e)}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Redirect Form Data","formative"),help:(0,a.__)("Include form data in redirect URL.","formative"),checked:e.redirectFormData||!1,onChange:e=>t("redirectFormData",e)})]}),Nt=({settings:e,updateSetting:t})=>(0,Re.jsxs)("div",{className:"formative-settings-tab",children:[(0,Re.jsx)(Ie.Notice,{status:"warning",isDismissible:!1,children:(0,Re.jsxs)("p",{children:[(0,a.__)("You are currently using Formative free version.","formative"),(0,Re.jsx)("br",{}),(0,a.__)("Get full access to premium features by upgrading today.","formative")]})}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Confirmation Mail to User","formative"),help:(0,a.__)("Want to send a submission copy to user by email? Active this one. The form must have at least one Email widget and it should be required.","formative"),checked:e.confirmationMailToUser||!1,onChange:e=>t("confirmationMailToUser",e),disabled:!0}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Want to send a copy of submitted form to user?","formative"),checked:e.sendCopyToUser||!1,onChange:e=>t("sendCopyToUser",e),disabled:!0}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Email Verification","formative"),help:(0,a.__)("Want to send an email verification mail to the user by email? Active this one. The form must have at least one Email widget and it should be required.","formative"),checked:e.emailVerification||!1,onChange:e=>t("emailVerification",e),disabled:!0})]}),St=({settings:e,updateSetting:t})=>(0,Re.jsxs)("div",{className:"formative-settings-tab",children:[(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Notification Mail to Admin","formative"),help:(0,a.__)("Want to send a submission copy to admin by email? Active this one.","formative"),checked:e.notificationMailToAdmin||!1,onChange:e=>t("notificationMailToAdmin",e)}),e.notificationMailToAdmin&&(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Admin Email","formative"),help:(0,a.__)("Enter admin email address to receive notifications.","formative"),value:e.adminEmail||"",onChange:e=>t("adminEmail",e),placeholder:(0,a.__)("admin@example.com","formative")}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Email Subject","formative"),value:e.adminEmailSubject||(0,a.__)("New Form Submission","formative"),onChange:e=>t("adminEmailSubject",e)}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("From Email","formative"),value:e.adminEmailFrom||"",onChange:e=>t("adminEmailFrom",e),placeholder:(0,a.__)("noreply@example.com","formative")}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("From Name","formative"),value:e.adminEmailFromName||"",onChange:e=>t("adminEmailFromName",e),placeholder:(0,a.__)("Formative","formative")})]})]}),Et=({settings:e,updateSetting:t})=>{const r=[{name:"hubspot",label:(0,a.__)("HubSpot Forms","formative"),help:(0,a.__)("Integrate hubspot with this form. Configure HubSpot.","formative"),premium:!0},{name:"hubspotContact",label:(0,a.__)("HubSpot Contact","formative"),premium:!0},{name:"mailchimp",label:(0,a.__)("Mail Chimp","formative"),help:(0,a.__)("Integrate mailchimp with this form. The form must have at least one Email widget and it should be required. Configure Mail Chimp.","formative"),premium:!0},{name:"slack",label:(0,a.__)("Slack","formative"),help:(0,a.__)("Integrate slack with this form. Slack info.","formative"),premium:!0},{name:"restApi",label:(0,a.__)("REST API","formative"),help:(0,a.__)("Send entry data to third party rest api/webhook.","formative"),premium:!0},{name:"googleSheet",label:(0,a.__)("Google Sheet","formative"),help:(0,a.__)("Integrate google sheet with this form.","formative"),premium:!0},{name:"mailpoet",label:(0,a.__)("MailPoet","formative"),help:(0,a.__)("Integrate MailPoet with this form. The form must have at least one Email widget and it should be required.","formative"),premium:!0},{name:"aweber",label:(0,a.__)("Aweber","formative"),help:(0,a.__)("Integrate aweber with this form. The form must have at least one Email widget and it should be required.","formative"),premium:!0},{name:"convertkit",label:(0,a.__)("ConvertKit","formative"),help:(0,a.__)("Integrate convertKit with this form. The form must have at least one Email widget and it should be required.","formative"),premium:!0},{name:"getresponse",label:(0,a.__)("GetResponse","formative"),help:(0,a.__)("Integrate GetResponse with this form. The form must have at least one Email widget and it should be required.","formative"),premium:!0},{name:"activecampaign",label:(0,a.__)("ActiveCampaign","formative"),help:(0,a.__)("Integrate ActiveCampaign with this form. The form must have at least one Email widget and it should be required.","formative"),premium:!0},{name:"zapier",label:(0,a.__)("Zapier","formative"),help:(0,a.__)("Integrate zapier with this form. The form must have at least one Email widget and it should be required.","formative"),premium:!0}];return(0,Re.jsxs)("div",{className:"formative-settings-tab",children:[(0,Re.jsx)(Ie.Notice,{status:"warning",isDismissible:!1,children:(0,Re.jsxs)("p",{children:[(0,a.__)("You are currently using Formative free version.","formative"),(0,Re.jsx)("br",{}),(0,a.__)("Get full access to premium features by upgrading today.","formative")]})}),r.map(a=>(0,Re.jsx)("div",{className:"formative-integration-option",children:(0,Re.jsx)(Ie.ToggleControl,{label:a.label,help:a.help,checked:e[a.name]||!1,onChange:e=>t(a.name,e),disabled:a.premium})},a.name))]})},Tt=({settings:e,updateSetting:t})=>(0,Re.jsxs)("div",{className:"formative-settings-tab",children:[(0,Re.jsx)(Ie.Notice,{status:"error",isDismissible:!1,children:(0,Re.jsxs)("p",{children:[(0,Re.jsx)("strong",{children:(0,a.__)("Payment is a premium feature—get Pro to use it!","formative")}),(0,Re.jsx)("br",{}),(0,a.__)("Get full access to premium features by upgrading today.","formative")]})}),(0,Re.jsx)(Ie.SelectControl,{label:(0,a.__)("Default Currency","formative"),value:e.defaultCurrency||"USD",options:[{label:(0,a.__)("Select default currency","formative"),value:""},{label:"USD - US Dollar",value:"USD"},{label:"EUR - Euro",value:"EUR"},{label:"GBP - British Pound",value:"GBP"},{label:"JPY - Japanese Yen",value:"JPY"},{label:"AUD - Australian Dollar",value:"AUD"},{label:"CAD - Canadian Dollar",value:"CAD"},{label:"INR - Indian Rupee",value:"INR"}],onChange:e=>t("defaultCurrency",e),disabled:!0}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("PayPal","formative"),help:(0,a.__)("Integrate paypal payment with this form.","formative"),checked:e.paypal||!1,onChange:e=>t("paypal",e),disabled:!0}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Stripe","formative"),help:(0,a.__)("Integrate stripe payment with this form.","formative"),checked:e.stripe||!1,onChange:e=>t("stripe",e),disabled:!0})]}),Dt=({settings:e,updateSetting:t})=>(0,Re.jsxs)("div",{className:"formative-settings-tab",children:[(0,Re.jsx)(Ie.Notice,{status:"error",isDismissible:!1,children:(0,Re.jsxs)("p",{children:[(0,Re.jsx)("strong",{children:(0,a.__)("CRM is a premium feature—get Pro to use it!","formative")}),(0,Re.jsx)("br",{}),(0,a.__)("Get full access to premium features by upgrading today.","formative")]})}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Zoho Contact","formative"),help:(0,a.__)("Integrate Zoho Contact with this form.","formative"),checked:e.zohoContact||!1,onChange:e=>t("zohoContact",e),disabled:!0}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Helpscout","formative"),help:(0,a.__)("Integrate Helpscout with this form.","formative"),checked:e.helpscout||!1,onChange:e=>t("helpscout",e),disabled:!0}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Fluent","formative"),help:(0,a.__)("Integrate fluent with this form. The form must have at least one Email widget and it should be required.","formative"),checked:e.fluent||!1,onChange:e=>t("fluent",e),disabled:!0})]}),Pt=({settings:e,updateSetting:t})=>(0,Re.jsxs)("div",{className:"formative-settings-tab",children:[(0,Re.jsx)(Ie.Notice,{status:"error",isDismissible:!1,children:(0,Re.jsxs)("p",{children:[(0,Re.jsx)("strong",{children:(0,a.__)("Auth is a premium feature—get Pro to use it!","formative")}),(0,Re.jsx)("br",{}),(0,a.__)("Get full access to premium features by upgrading today.","formative")]})}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Login","formative"),help:(0,a.__)("Enable or disable login system.","formative"),checked:e.enableLogin||!1,onChange:e=>t("enableLogin",e),disabled:!0}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Registration","formative"),help:(0,a.__)("Enable or disable user registration.","formative"),checked:e.enableRegistration||!1,onChange:e=>t("enableRegistration",e),disabled:!0})]}),Mt=({settings:e,updateSetting:t})=>(0,Re.jsxs)("div",{className:"formative-settings-tab",children:[(0,Re.jsx)(Ie.Notice,{status:"error",isDismissible:!1,children:(0,Re.jsxs)("p",{children:[(0,Re.jsx)("strong",{children:(0,a.__)("Form to Post is a premium feature—get Pro to use it!","formative")}),(0,Re.jsx)("br",{}),(0,a.__)("Get full access to premium features by upgrading today.","formative")]})}),(0,Re.jsx)(Ie.ToggleControl,{label:(0,a.__)("Form to Post","formative"),help:(0,a.__)("Create a post from form entries.","formative"),checked:e.formToPost||!1,onChange:e=>t("formToPost",e),disabled:!0}),e.formToPost&&(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(Ie.SelectControl,{label:(0,a.__)("Post Type","formative"),value:e.postType||"post",options:[{label:(0,a.__)("Post","formative"),value:"post"},{label:(0,a.__)("Page","formative"),value:"page"},{label:(0,a.__)("Custom Post Type","formative"),value:"custom"}],onChange:e=>t("postType",e),disabled:!0}),(0,Re.jsx)(Ie.SelectControl,{label:(0,a.__)("Post Status","formative"),value:e.postStatus||"draft",options:[{label:(0,a.__)("Draft","formative"),value:"draft"},{label:(0,a.__)("Published","formative"),value:"publish"},{label:(0,a.__)("Pending Review","formative"),value:"pending"}],onChange:e=>t("postStatus",e),disabled:!0})]})]}),Rt=({isOpen:e,onClose:r,settings:i,onSave:n})=>{const[s,o]=(0,t.useState)(i),l=(e,t)=>{o({...s,[e]:t})},c=[{name:"general",title:(0,a.__)("General","formative"),component:wt},{name:"confirmation",title:(0,a.__)("Confirmation","formative"),component:Nt},{name:"notification",title:(0,a.__)("Notification","formative"),component:St},{name:"integration",title:(0,a.__)("Integration","formative"),component:Et},{name:"payment",title:(0,a.__)("Payment","formative"),component:Tt},{name:"crm",title:(0,a.__)("CRM","formative"),component:Dt},{name:"auth",title:(0,a.__)("Auth","formative"),component:Pt},{name:"post",title:(0,a.__)("Post","formative"),component:Mt}];return e?(0,Re.jsxs)(Ie.Modal,{title:(0,a.__)("Form Settings","formative"),onRequestClose:r,className:"formative-settings-modal",style:{maxWidth:"800px",minHeight:"600px"},shouldCloseOnClickOutside:!1,children:[(0,Re.jsx)(Ie.TabPanel,{className:"formative-settings-tabs",activeClass:"is-active",tabs:c,children:e=>{const t=e.component;return(0,Re.jsx)(t,{settings:s,updateSetting:l})}}),(0,Re.jsxs)("div",{className:"formative-modal-footer",children:[(0,Re.jsx)(Ie.Button,{onClick:r,children:(0,a.__)("Cancel","formative")}),(0,Re.jsx)(Ie.Button,{isPrimary:!0,onClick:()=>{n(s),r()},children:(0,a.__)("Save Changes","formative")})]})]}):null},Bt={formTitle:"",successMessage:"Thank you for your submission!",errorMessage:"Something went wrong. Please try again.",submitButtonText:"Submit",requireLogin:!1,captureBrowserData:!1,hideFormAfterSubmission:!1,storeEntries:!0,entryTitle:"Entry # {id}",limitEntries:!1,maxEntries:"",countViews:!1,stopVerticalScrolling:!1,redirectUrl:"",showQuizSummary:!1,redirectFormData:!1,confirmationMailToUser:!1,sendCopyToUser:!1,emailVerification:!1,notificationMailToAdmin:!1,adminEmail:"",adminEmailSubject:"New Form Submission",adminEmailFrom:"",adminEmailFromName:"",hubspot:!1,hubspotContact:!1,mailchimp:!1,slack:!1,restApi:!1,googleSheet:!1,mailpoet:!1,aweber:!1,convertkit:!1,getresponse:!1,activecampaign:!1,zapier:!1,defaultCurrency:"USD",paypal:!1,stripe:!1,zohoContact:!1,helpscout:!1,fluent:!1,enableLogin:!1,enableRegistration:!1,formToPost:!1,postType:"post",postStatus:"draft"},Ft=()=>{const{id:e}=function(){let{matches:e}=r.useContext(H),t=e[e.length-1];return t?t.params:{}}(),i=K(),n=Y(),[s,o]=(0,t.useState)(""),[l,c]=(0,t.useState)([]),[d,m]=(0,t.useState)(Bt),[h,u]=(0,t.useState)(!1),[p,v]=(0,t.useState)(!!e),[f,g]=(0,t.useState)(!1),[x,_]=(0,t.useState)(null),[b,y]=(0,t.useState)(null),[j,C]=(0,t.useState)(null),[k,w]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(e)N();else if(n.state?.template){const e=n.state.template;o(e.name||""),c(e.fields||[])}},[e,n.state]);const N=async()=>{try{const a=await We()({path:`/formative/v1/forms/${e}`});if(a.success){const e=a.data;o(e.title),c(e.fields||[]),m((t=e.settings||{},{...Bt,...t}))}}catch(e){console.error("Error fetching form:",e)}finally{v(!1)}var t},S=(e,t=null)=>{const a={id:`field-${Date.now()}`,type:e,name:`field_${l.length+1}`,label:{text:"Text",email:"Email",number:"Number",tel:"Phone",textarea:"Textarea",select:"Select",checkbox:"Checkbox",radio:"Radio",date:"Date",time:"Time",url:"URL",password:"Password",file:"File Upload",rating:"Rating",range:"Range Slider",switch:"Switch",recaptcha:"reCAPTCHA",firstname:"First Name",lastname:"Last Name",gdpr:"GDPR Consent",message:"Response Message",summary:"Summary",submit:"Submit Button"}[e]||`${e.charAt(0).toUpperCase()+e.slice(1)} Field`,placeholder:"",required:"submit"!==e&&"recaptcha"!==e&&"message"!==e&&"summary"!==e,helpText:"",options:["select","checkbox","radio"].includes(e)?[{label:"Option 1",value:"option1"}]:void 0,..."rating"===e&&{maxRating:5},..."range"===e&&{min:0,max:100,step:1,defaultValue:50},..."file"===e&&{accept:"",multiple:!1},..."switch"===e&&{defaultChecked:!1}};let r,i;null!==t?(r=[...l],r.splice(t,0,a),i=t):(r=[...l,a],i=r.length-1),c(r),_(i)},E=(e,t)=>{const a=[...l],r="up"===t?e-1:e+1;r>=0&&r<a.length&&([a[e],a[r]]=[a[r],a[e]],c(a),x===e?_(r):x===r&&_(e))},T=(e,t)=>{if("BUTTON"===e.target.tagName)return e.preventDefault(),!1;w(t),e.dataTransfer.effectAllowed="copy",e.dataTransfer.setData("text/plain",t)},D=()=>{w(null),C(null)},P=()=>{null===b||k||C(null)},M=()=>{y(null),C(null),w(null)},R=e=>{switch(e.type){case"textarea":return(0,Re.jsx)("textarea",{className:"formative-input formative-textarea",placeholder:e.placeholder,disabled:!0});case"select":return(0,Re.jsxs)("select",{className:"formative-input formative-select",disabled:!0,children:[(0,Re.jsx)("option",{children:e.placeholder||(0,a.__)("Select...","formative")}),e.options?.map((e,t)=>(0,Re.jsx)("option",{value:e.value,children:e.label},t))]});case"checkbox":return(0,Re.jsx)("div",{className:"formative-checkbox-group",children:e.options?.map((e,t)=>(0,Re.jsxs)("label",{className:"formative-checkbox-label",children:[(0,Re.jsx)("input",{type:"checkbox",disabled:!0}),(0,Re.jsx)("span",{children:e.label})]},t))});case"radio":return(0,Re.jsx)("div",{className:"formative-radio-group",children:e.options?.map((t,a)=>(0,Re.jsxs)("label",{className:"formative-radio-label",children:[(0,Re.jsx)("input",{type:"radio",name:e.name,disabled:!0}),(0,Re.jsx)("span",{children:t.label})]},a))});case"file":return(0,Re.jsxs)("div",{className:"formative-file-upload",children:[(0,Re.jsx)("input",{type:"file",className:"formative-input",disabled:!0}),(0,Re.jsx)("span",{className:"file-info",children:(0,a.__)("No file chosen","formative")})]});case"rating":return(0,Re.jsx)("div",{className:"formative-rating",children:[...Array(e.maxRating||5)].map((e,t)=>(0,Re.jsx)(Ze,{size:20,style:{marginRight:"4px",color:"#ddd"}},t))});case"range":return(0,Re.jsxs)("div",{className:"formative-range",children:[(0,Re.jsx)("input",{type:"range",min:e.min||0,max:e.max||100,step:e.step||1,defaultValue:e.defaultValue||50,className:"formative-input",disabled:!0}),(0,Re.jsx)("span",{className:"range-value",children:e.defaultValue||50})]});case"switch":return(0,Re.jsxs)("label",{className:"formative-switch",children:[(0,Re.jsx)("input",{type:"checkbox",defaultChecked:e.defaultChecked,disabled:!0}),(0,Re.jsx)("span",{className:"switch-slider"})]});case"recaptcha":return(0,Re.jsxs)("div",{className:"formative-recaptcha-placeholder",children:[(0,Re.jsx)(Xe,{size:48,style:{opacity:.3}}),(0,Re.jsx)("span",{children:(0,a.__)("reCAPTCHA will appear here","formative")})]});case"gdpr":return(0,Re.jsxs)("label",{className:"formative-gdpr",children:[(0,Re.jsx)("input",{type:"checkbox",disabled:!0}),(0,Re.jsx)("span",{children:(0,a.__)("I agree to the terms and conditions","formative")})]});case"message":return(0,Re.jsxs)("div",{className:"formative-message-preview",children:[(0,Re.jsx)(Ye,{size:24,style:{marginRight:"8px",opacity:.5}}),(0,Re.jsx)("span",{children:(0,a.__)("Response message will appear here","formative")})]});case"summary":return(0,Re.jsxs)("div",{className:"formative-summary-preview",children:[(0,Re.jsx)(Ae,{size:24,style:{marginRight:"8px",opacity:.5}}),(0,Re.jsx)("span",{children:(0,a.__)("Form summary will appear here","formative")})]});case"submit":return(0,Re.jsx)("button",{type:"button",className:"formative-submit-button",disabled:!0,children:e.label||(0,a.__)("Submit","formative")});case"firstname":case"lastname":return(0,Re.jsx)("input",{type:"text",className:"formative-input",placeholder:e.placeholder||e.label,disabled:!0});default:return(0,Re.jsx)("input",{type:e.type||"text",className:"formative-input",placeholder:e.placeholder,disabled:!0})}};return p?(0,Re.jsx)("div",{className:"formative-loading",children:(0,a.__)("Loading...","formative")}):(0,Re.jsx)("div",{className:"formative-builder-wrapper",children:(0,Re.jsxs)("div",{className:"formative-form-builder",children:[(0,Re.jsxs)("div",{className:"formative-page-header",children:[(0,Re.jsxs)("div",{className:"formative-df formative-form-name",children:[(0,Re.jsx)("h1",{children:e?(0,a.__)("Edit Form","formative"):(0,a.__)("Create New Form","formative")}),(0,Re.jsx)(Ie.TextControl,{value:s,onChange:o,placeholder:(0,a.__)("Enter form title...","formative"),className:"formative-form-title-input"})]}),(0,Re.jsxs)("div",{className:"formative-header-actions",children:[(0,Re.jsx)(Ie.Button,{onClick:()=>i("/forms"),children:(0,a.__)("Cancel","formative")}),(0,Re.jsx)(Ie.Button,{isSecondary:!0,onClick:()=>g(!0),children:(0,a.__)("Form Settings","formative")}),(0,Re.jsx)(Ie.Button,{isPrimary:!0,onClick:async()=>{if(s.trim()){u(!0);try{const t={title:s,fields:l,settings:d},a=await We()({path:e?`/formative/v1/forms/${e}`:"/formative/v1/forms",method:e?"PUT":"POST",data:t});a.success&&(alert(a.message),e||i(`/forms/edit/${a.data.id}`))}catch(e){console.error("Error saving form:",e),alert((0,a.__)("Failed to save form.","formative"))}finally{u(!1)}}else alert((0,a.__)("Please enter a form title.","formative"))},isBusy:h,children:(0,a.__)("Save Form","formative")})]})]}),(0,Re.jsx)(Rt,{isOpen:f,onClose:()=>g(!1),settings:d,onSave:e=>m(e)}),(0,Re.jsxs)("div",{className:"formative-builder-layout",children:[(0,Re.jsx)("div",{className:"formative-builder-sidebar",children:(0,Re.jsx)(Ie.Panel,{children:(0,Re.jsx)(Ie.PanelBody,{title:(0,a.__)("Add Fields","formative"),initialOpen:!0,children:(0,Re.jsxs)("div",{className:"formative-field-types",children:[(0,Re.jsx)("div",{draggable:!0,className:"text"===k?"is-dragging":"",onDragStart:e=>T(e,"text"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("text"),children:[(0,Re.jsx)(et,{size:16}),(0,a.__)("Text","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"email"===k?"is-dragging":"",onDragStart:e=>T(e,"email"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("email"),children:[(0,Re.jsx)(Ve,{size:16}),(0,a.__)("Email","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"number"===k?"is-dragging":"",onDragStart:e=>T(e,"number"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("number"),children:[(0,Re.jsx)(tt,{size:16}),(0,a.__)("Number","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"tel"===k?"is-dragging":"",onDragStart:e=>T(e,"tel"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("tel"),children:[(0,Re.jsx)(at,{size:16}),(0,a.__)("Phone","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"textarea"===k?"is-dragging":"",onDragStart:e=>T(e,"textarea"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("textarea"),children:[(0,Re.jsx)(rt,{size:16}),(0,a.__)("Textarea","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"select"===k?"is-dragging":"",onDragStart:e=>T(e,"select"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("select"),children:[(0,Re.jsx)(it,{size:16}),(0,a.__)("Select","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"checkbox"===k?"is-dragging":"",onDragStart:e=>T(e,"checkbox"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("checkbox"),children:[(0,Re.jsx)(nt,{size:16}),(0,a.__)("Checkbox","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"radio"===k?"is-dragging":"",onDragStart:e=>T(e,"radio"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("radio"),children:[(0,Re.jsx)(st,{size:16}),(0,a.__)("Radio","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"date"===k?"is-dragging":"",onDragStart:e=>T(e,"date"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("date"),children:[(0,Re.jsx)(Je,{size:16}),(0,a.__)("Date","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"time"===k?"is-dragging":"",onDragStart:e=>T(e,"time"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("time"),children:[(0,Re.jsx)(ot,{size:16}),(0,a.__)("Time","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"url"===k?"is-dragging":"",onDragStart:e=>T(e,"url"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("url"),children:[(0,Re.jsx)(lt,{size:16}),(0,a.__)("URL","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"password"===k?"is-dragging":"",onDragStart:e=>T(e,"password"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("password"),children:[(0,Re.jsx)(ct,{size:16}),(0,a.__)("Password","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"file"===k?"is-dragging":"",onDragStart:e=>T(e,"file"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("file"),children:[(0,Re.jsx)(dt,{size:16}),(0,a.__)("File Upload","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"rating"===k?"is-dragging":"",onDragStart:e=>T(e,"rating"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("rating"),children:[(0,Re.jsx)(Ze,{size:16}),(0,a.__)("Rating","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"range"===k?"is-dragging":"",onDragStart:e=>T(e,"range"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("range"),children:[(0,Re.jsx)(mt,{size:16}),(0,a.__)("Range Slider","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"switch"===k?"is-dragging":"",onDragStart:e=>T(e,"switch"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("switch"),children:[(0,Re.jsx)(ht,{size:16}),(0,a.__)("Switch","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"recaptcha"===k?"is-dragging":"",onDragStart:e=>T(e,"recaptcha"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("recaptcha"),children:[(0,Re.jsx)(Xe,{size:16}),(0,a.__)("reCAPTCHA","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"firstname"===k?"is-dragging":"",onDragStart:e=>T(e,"firstname"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("firstname"),children:[(0,Re.jsx)(ut,{size:16}),(0,a.__)("First Name","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"lastname"===k?"is-dragging":"",onDragStart:e=>T(e,"lastname"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("lastname"),children:[(0,Re.jsx)(Ge,{size:16}),(0,a.__)("Last Name","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"gdpr"===k?"is-dragging":"",onDragStart:e=>T(e,"gdpr"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("gdpr"),children:[(0,Re.jsx)(Xe,{size:16}),(0,a.__)("GDPR Consent","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"message"===k?"is-dragging":"",onDragStart:e=>T(e,"message"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("message"),children:[(0,Re.jsx)(Ye,{size:16}),(0,a.__)("Response Message","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"summary"===k?"is-dragging":"",onDragStart:e=>T(e,"summary"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("summary"),children:[(0,Re.jsx)(Ae,{size:16}),(0,a.__)("Summary","formative")]})}),(0,Re.jsx)("div",{draggable:!0,className:"submit"===k?"is-dragging":"",onDragStart:e=>T(e,"submit"),onDragEnd:D,children:(0,Re.jsxs)(Ie.Button,{isSecondary:!0,onClick:()=>S("submit"),children:[(0,Re.jsx)(pt,{size:16}),(0,a.__)("Submit Button","formative")]})})]})})})}),(0,Re.jsx)("div",{className:"formative-builder-canvas",onDragOver:e=>{if(e.preventDefault(),e.stopPropagation(),k)if(e.dataTransfer.dropEffect="copy",l.length>0){const t=e.currentTarget.querySelector(".formative-canvas-fields");if(!t)return void C(0);const a=e.clientY,r=t.querySelectorAll(".formative-canvas-field");let i=l.length;for(let e=0;e<r.length;e++){const t=r[e].getBoundingClientRect();if(a<t.top+t.height/2){i=e;break}}C(i)}else C(0);else e.dataTransfer.dropEffect=null!==b?"move":"none"},onDrop:e=>{if(e.preventDefault(),e.stopPropagation(),k){let e=l.length;return null!==j&&j>=0&&(e=j),S(k,e),w(null),void C(null)}},onDragLeave:e=>{if(k){const t=e.relatedTarget;t&&e.currentTarget.contains(t)||C(null)}},onClick:e=>{(e.target.classList.contains("formative-builder-canvas")||e.target.classList.contains("formative-canvas-inner")||e.target.classList.contains("formative-canvas-fields"))&&_(null)},children:(0,Re.jsxs)("div",{className:"formative-canvas-inner",children:[(0,Re.jsx)("div",{className:"formative-canvas-header",children:(0,Re.jsx)("h2",{children:s||(0,a.__)("Form Fields","formative")})}),0===l.length?(0,Re.jsxs)("div",{className:"formative-empty-canvas "+(k?"drag-active":""),children:[(0,Re.jsx)(vt,{size:48,strokeWidth:1.5,style:{opacity:.3,marginBottom:"16px"}}),(0,Re.jsx)("h3",{children:k?(0,a.__)("Drop Here","formative"):(0,a.__)("No Fields Yet","formative")}),(0,Re.jsx)("p",{children:k?(0,a.__)("Release to add field","formative"):(0,a.__)("Drag a field type from the left sidebar to add it to your form.","formative")})]}):(0,Re.jsx)("div",{className:`formative-canvas-fields ${k?"drag-active":""} ${0===j&&k?"drop-target-start":""}`,children:l.map((e,t)=>{const a=k?j===t+1:null!==b&&j===t&&b!==t;return(0,Re.jsxs)("div",{className:`formative-canvas-field ${x===t?"is-selected":""} ${b===t?"is-dragging":""} ${a?"drop-target":""}`,onDragOver:e=>((e,t)=>{if(e.preventDefault(),e.stopPropagation(),k){e.dataTransfer.dropEffect="copy";const a=e.currentTarget.getBoundingClientRect(),r=e.clientY,i=a.top+a.height/2;C(r<i?t:t+1)}else null!==b&&(e.dataTransfer.dropEffect="move",b!==t&&C(t))})(e,t),onDragLeave:P,onDrop:e=>((e,t)=>{if(e.preventDefault(),e.stopPropagation(),k){const a=e.currentTarget.getBoundingClientRect(),r=e.clientY,i=a.top+a.height/2;return S(k,r<i?t:t+1),w(null),void C(null)}if(null===b)return;if(b===t)return y(null),void C(null);const a=[...l],[r]=a.splice(b,1),i=t;a.splice(i,0,r),c(a),x===b?_(i):x>=Math.min(b,i)&&x<=Math.max(b,i)&&_(b<i?x-1:x+1),y(null),C(null)})(e,t),onClick:e=>{e.stopPropagation(),_(t)},role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),_(t))},children:[(0,Re.jsx)("div",{className:"canvas-field-drag-handle",draggable:!0,onDragStart:e=>{e.stopPropagation(),((e,t)=>{y(t),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/html",e.currentTarget)})(e,t)},onDragEnd:M,onClick:e=>e.stopPropagation(),children:(0,Re.jsx)(ft,{size:20})}),(0,Re.jsxs)("div",{className:"canvas-field-preview",children:[e.label&&(0,Re.jsxs)("label",{className:"field-label",children:[e.label,e.required&&(0,Re.jsx)("span",{className:"required",children:"*"})]}),R(e),e.helpText&&(0,Re.jsx)("div",{className:"field-help-text",children:e.helpText})]}),x===t&&(0,Re.jsx)("div",{className:"canvas-field-overlay",children:(0,Re.jsx)("span",{className:"field-type-badge",children:e.type})})]},e.id)})})]})}),null!==x&&l[x]&&(0,Re.jsx)(kt,{field:l[x],onUpdate:e=>((e,t)=>{const a=[...l];a[e]=t,c(a)})(x,e),onClose:()=>_(null),onMoveUp:()=>E(x,"up"),onMoveDown:()=>E(x,"down"),onDelete:()=>(e=>{const t=l.filter((t,a)=>a!==e);c(t),x===e?_(null):x>e&&_(x-1)})(x),canMoveUp:x>0,canMoveDown:x<l.length-1})]})]})})},At=()=>{const[e,r]=(0,t.useState)([]),[i,n]=(0,t.useState)([]),[s,o]=(0,t.useState)(""),[l,c]=(0,t.useState)(!0),[d,m]=(0,t.useState)(1),[h,u]=(0,t.useState)(1),[p,v]=(0,t.useState)(null);(0,t.useEffect)(()=>{f()},[]),(0,t.useEffect)(()=>{g()},[d,s]);const f=async()=>{try{const e=await We()({path:"/formative/v1/forms?per_page=100"});e.success&&n(e.data.forms)}catch(e){console.error("Error fetching forms:",e)}},g=async()=>{c(!0);try{const e=new URLSearchParams({page:d.toString(),per_page:"10"});s&&e.append("form_id",s);const t=await We()({path:`/formative/v1/entries?${e.toString()}`});t.success&&(r(t.data.entries),u(t.data.totalPages))}catch(e){console.error("Error fetching entries:",e)}finally{c(!1)}};return l?(0,Re.jsx)("div",{className:"formative-loading",children:(0,a.__)("Loading...","formative")}):(0,Re.jsxs)("div",{className:"formative-entry-list",children:[(0,Re.jsxs)("div",{className:"formative-page-header",children:[(0,Re.jsx)("h1",{children:(0,a.__)("Entries","formative")}),(0,Re.jsx)(Ie.Button,{isPrimary:!0,onClick:async()=>{try{const e=new URLSearchParams({format:"csv"});s&&e.append("form_id",s);const t=await We()({path:`/formative/v1/entries/export?${e.toString()}`});if(t.success){const e=new Blob([t.data.csv],{type:"text/csv"}),a=window.URL.createObjectURL(e),r=document.createElement("a");r.href=a,r.download=t.data.filename,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(a)}}catch(e){console.error("Error exporting entries:",e),alert((0,a.__)("Failed to export entries.","formative"))}},children:(0,a.__)("Export CSV","formative")})]}),(0,Re.jsx)("div",{className:"formative-filters",children:(0,Re.jsx)(Ie.SelectControl,{label:(0,a.__)("Filter by Form","formative"),value:s,options:[{label:(0,a.__)("All Forms","formative"),value:""},...i.map(e=>({label:e.title,value:e.id.toString()}))],onChange:o})}),e.length>0?(0,Re.jsx)("div",{className:"formative-table-wrapper",children:(0,Re.jsxs)("table",{className:"formative-table",children:[(0,Re.jsx)("thead",{children:(0,Re.jsxs)("tr",{children:[(0,Re.jsx)("th",{children:(0,a.__)("ID","formative")}),(0,Re.jsx)("th",{children:(0,a.__)("Form","formative")}),(0,Re.jsx)("th",{children:(0,a.__)("Date","formative")}),(0,Re.jsx)("th",{children:(0,a.__)("IP Address","formative")}),(0,Re.jsx)("th",{children:(0,a.__)("Actions","formative")})]})}),(0,Re.jsx)("tbody",{children:e.map(e=>(0,Re.jsxs)("tr",{children:[(0,Re.jsxs)("td",{children:["#",e.id]}),(0,Re.jsx)("td",{children:i.find(t=>t.id===e.formId)?.title||"N/A"}),(0,Re.jsx)("td",{children:new Date(e.createdAt).toLocaleString()}),(0,Re.jsx)("td",{children:e.ip}),(0,Re.jsx)("td",{children:(0,Re.jsxs)("div",{className:"formative-table-actions",children:[(0,Re.jsx)(Ie.Button,{isLink:!0,onClick:()=>v(e),children:(0,a.__)("View","formative")}),(0,Re.jsx)(Ie.Button,{isLink:!0,isDestructive:!0,onClick:()=>(async e=>{if(confirm((0,a.__)("Are you sure you want to delete this entry?","formative")))try{await We()({path:`/formative/v1/entries/${e}`,method:"DELETE"}),g()}catch(e){console.error("Error deleting entry:",e),alert((0,a.__)("Failed to delete entry.","formative"))}})(e.id),children:(0,a.__)("Delete","formative")})]})})]},e.id))})]})}):(0,Re.jsx)("div",{className:"formative-empty-state",children:(0,Re.jsx)("p",{children:(0,a.__)("No entries found.","formative")})}),h>1&&(0,Re.jsxs)("div",{className:"formative-pagination",children:[(0,Re.jsx)(Ie.Button,{disabled:1===d,onClick:()=>m(d-1),children:(0,a.__)("Previous","formative")}),(0,Re.jsxs)("span",{children:[(0,a.__)("Page","formative")," ",d," ",(0,a.__)("of","formative")," ",h]}),(0,Re.jsx)(Ie.Button,{disabled:d===h,onClick:()=>m(d+1),children:(0,a.__)("Next","formative")})]}),p&&(0,Re.jsx)("div",{className:"formative-modal-overlay",onClick:()=>v(null),children:(0,Re.jsxs)("div",{className:"formative-modal",onClick:e=>e.stopPropagation(),children:[(0,Re.jsxs)("div",{className:"formative-modal-header",children:[(0,Re.jsxs)("h2",{children:[(0,a.__)("Entry Details","formative")," #",p.id]}),(0,Re.jsx)(Ie.Button,{onClick:()=>v(null),children:(0,Re.jsx)(_t,{size:20})})]}),(0,Re.jsx)("div",{className:"formative-modal-content",children:Object.entries(p.data).map(([e,t])=>{if(t&&"object"==typeof t&&t.url){const a=t.type&&t.type.startsWith("image/");return(0,Re.jsxs)("div",{className:"formative-entry-field",children:[(0,Re.jsxs)("strong",{children:[p.fieldsMap?.[e]||e,":"]}),(0,Re.jsxs)("span",{className:"formative-file-display",children:[a&&(0,Re.jsx)("img",{src:t.url,alt:t.name,style:{maxWidth:"200px",maxHeight:"200px",display:"block",marginBottom:"8px"}}),(0,Re.jsxs)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",download:t.name,children:[t.name," (",Math.round(t.size/1024),"KB)"]})]})]},e)}return(0,Re.jsxs)("div",{className:"formative-entry-field",children:[(0,Re.jsxs)("strong",{children:[p.fieldsMap?.[e]||e,":"]}),(0,Re.jsx)("span",{children:Array.isArray(t)?t.join(", "):t})]},e)})})]})})]})},Lt=()=>{const[e,r]=(0,t.useState)({recaptcha_site_key:"",recaptcha_secret_key:"",email_from_name:"",email_from_address:"",store_entries:!0,delete_data:!1}),[i,n]=(0,t.useState)(!0),[s,o]=(0,t.useState)(!1),[l,c]=(0,t.useState)(null);(0,t.useEffect)(()=>{d()},[]);const d=async()=>{try{const e=await We()({path:"/formative/v1/settings"});e.success&&r(e.data)}catch(e){console.error("Error fetching settings:",e)}finally{n(!1)}},m=(t,a)=>{r({...e,[t]:a})};return i?(0,Re.jsx)("div",{className:"formative-loading",children:(0,a.__)("Loading...","formative")}):(0,Re.jsxs)("div",{className:"formative-settings",children:[(0,Re.jsxs)("div",{className:"formative-page-header",children:[(0,Re.jsx)("h1",{children:(0,a.__)("Settings","formative")}),(0,Re.jsx)(Ie.Button,{isPrimary:!0,onClick:async()=>{o(!0),c(null);try{const t=await We()({path:"/formative/v1/settings",method:"PUT",data:e});t.success&&c({type:"success",text:t.message})}catch(e){console.error("Error saving settings:",e),c({type:"error",text:(0,a.__)("Failed to save settings.","formative")})}finally{o(!1)}},isBusy:s,children:(0,a.__)("Save Settings","formative")})]}),l&&(0,Re.jsx)(Ie.Notice,{status:l.type,onRemove:()=>c(null),children:l.text}),(0,Re.jsxs)("div",{className:"formative-settings-sections",children:[(0,Re.jsxs)("div",{className:"formative-settings-section",children:[(0,Re.jsx)("h2",{children:(0,a.__)("reCAPTCHA","formative")}),(0,Re.jsx)("p",{className:"description",children:(0,a.__)("Protect your forms from spam with Google reCAPTCHA.","formative")}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Site Key","formative"),value:e.recaptcha_site_key,onChange:e=>m("recaptcha_site_key",e),help:(0,a.__)("Get your site key from Google reCAPTCHA admin console.","formative")}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("Secret Key","formative"),value:e.recaptcha_secret_key,onChange:e=>m("recaptcha_secret_key",e),type:"password"})]}),(0,Re.jsxs)("div",{className:"formative-settings-section",children:[(0,Re.jsx)("h2",{children:(0,a.__)("Email","formative")}),(0,Re.jsx)("p",{className:"description",children:(0,a.__)("Configure email settings for form notifications.","formative")}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("From Name","formative"),value:e.email_from_name,onChange:e=>m("email_from_name",e)}),(0,Re.jsx)(Ie.TextControl,{label:(0,a.__)("From Email","formative"),value:e.email_from_address,onChange:e=>m("email_from_address",e),type:"email"})]}),(0,Re.jsxs)("div",{className:"formative-settings-section",children:[(0,Re.jsx)("h2",{children:(0,a.__)("Data Management","formative")}),(0,Re.jsx)(Ie.CheckboxControl,{label:(0,a.__)("Store form entries in database","formative"),checked:e.store_entries,onChange:e=>m("store_entries",e),help:(0,a.__)("Disable this if you only want to receive email notifications.","formative")}),(0,Re.jsx)(Ie.CheckboxControl,{label:(0,a.__)("Delete all data on plugin uninstall","formative"),checked:e.delete_data,onChange:e=>m("delete_data",e),help:(0,a.__)("Warning: This will permanently delete all forms and entries.","formative")})]})]})]})},zt=({children:e})=>{const t=Y(),a="/forms/new"===t.pathname||t.pathname.startsWith("/forms/edit/");return(0,Re.jsxs)("div",{className:"formative-admin-wrapper",children:[(0,Re.jsx)(Be,{}),(0,Re.jsxs)("div",{className:"formative-admin-container "+(a?"formative-builder-mode":""),children:[!a&&(0,Re.jsx)(qe,{}),(0,Re.jsx)("div",{className:"formative-admin-content",children:e})]})]})},Ut=()=>{const[e,r]=(0,t.useState)(!0),[i,n]=(0,t.useState)(null);return(0,t.useEffect)(()=>{r(!1)},[]),e?(0,Re.jsxs)("div",{className:"formative-admin-loading",children:[(0,Re.jsx)("div",{className:"spinner"}),(0,Re.jsx)("p",{children:(0,a.__)("Loading...","formative")})]}):i?(0,Re.jsx)("div",{className:"formative-admin-error",children:(0,Re.jsx)("p",{children:i})}):(0,Re.jsx)(_e,{children:(0,Re.jsx)(zt,{children:(0,Re.jsxs)(de,{children:[(0,Re.jsx)(le,{path:"/",element:(0,Re.jsx)($e,{})}),(0,Re.jsx)(le,{path:"/forms",element:(0,Re.jsx)(He,{})}),(0,Re.jsx)(le,{path:"/forms/templates",element:(0,Re.jsx)(Qe,{})}),(0,Re.jsx)(le,{path:"/forms/new",element:(0,Re.jsx)(Ft,{})}),(0,Re.jsx)(le,{path:"/forms/edit/:id",element:(0,Re.jsx)(Ft,{})}),(0,Re.jsx)(le,{path:"/entries",element:(0,Re.jsx)(At,{})}),(0,Re.jsx)(le,{path:"/settings",element:(0,Re.jsx)(Lt,{})}),(0,Re.jsx)(le,{path:"*",element:(0,Re.jsx)(oe,{to:"/",replace:!0})})]})})})},qt=document.getElementById("formative-admin-root");qt&&(0,t.createRoot)(qt).render((0,Re.jsx)(Ut,{}))})(); -
formative/trunk/formative.php
r3426920 r3428303 4 4 * Plugin URI: https://wordpress.org/plugins/formative 5 5 * Description: A powerful, responsive Gutenberg-based form builder with SaaS-like dashboard experience 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 7.4 … … 23 23 24 24 // Define plugin constants. 25 define( 'FORMATIVE_VERSION', '1.0. 0' );25 define( 'FORMATIVE_VERSION', '1.0.1' ); 26 26 define( 'FORMATIVE_FILE', __FILE__ ); 27 27 define( 'FORMATIVE_PATH', plugin_dir_path( __FILE__ ) ); -
formative/trunk/includes/Plugin.php
r3426920 r3428303 58 58 private function init_hooks() { 59 59 add_action('init', array($this, 'register_post_types')); 60 add_action('rest_api_init', array($this, 'register_rest_routes'));61 60 add_action('admin_menu', array($this, 'register_admin_menu')); 62 61 add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_assets')); … … 139 138 140 139 /** 141 * Register REST API routes.142 *143 * @return void144 */145 public function register_rest_routes() {146 // Controllers will register their own routes.147 }148 149 /**150 140 * Register admin menu. 151 141 * … … 340 330 } 341 331 ?> 342 <div class="formative-field-wrapper formative-form-submit">343 <button type="submit" class="formative-submit-button">344 <?php echo esc_html($settings['submitButtonText'] ?? __('Submit', 'formative')); ?>345 </button>346 </div>347 332 <input type="hidden" name="form_id" value="<?php echo esc_attr($form_id); ?>" /> 348 333 <?php wp_nonce_field('formative_submit', 'formative_nonce'); ?> … … 553 538 break; 554 539 540 case 'submit': 541 ?> 542 <button type="submit" class="formative-submit-button"> 543 <?php echo esc_html($label ?: __('Submit', 'formative')); ?> 544 </button> 545 <?php 546 break; 555 547 case 'firstname': 556 548 case 'lastname': -
formative/trunk/package.json
r3426920 r3428303 10 10 "lint:css": "wp-scripts lint-style", 11 11 "lint:js": "wp-scripts lint-js", 12 "packages-update": "wp-scripts packages-update" 12 "packages-update": "wp-scripts packages-update", 13 "release": "wp-scripts build && wp-scripts plugin-zip" 13 14 }, 14 15 "keywords": [ … … 26 27 "dependencies": { 27 28 "react-router-dom": "^6.20.0" 28 } 29 }, 30 "files": [ 31 "build/**/*", 32 "includes/**/*", 33 "languages/**/*", 34 "formative.php", 35 "readme.txt" 36 ] 29 37 } -
formative/trunk/readme.txt
r3426961 r3428303 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 11 A powerful and intuitive drag-and-drop form builder for WordPress with comprehensive field types and submission management.11 Formative is a lightweight, responsive form builder for creating contact forms, surveys, and custom forms. 12 12 13 13 == Description == 14 Formative provides: 15 - Visual React-based admin (dashboard, form builder, entries, settings) 16 - AJAX form submission with nonce verification and server-side validation 17 - Entries storage and CSV export 14 18 15 Formative is a feature-rich form builder plugin that makes creating and managing forms simple and efficient. With an intuitive drag-and-drop interface, you can build custom forms for any purpose without writing a single line of code. 16 17 = Key Features = 18 19 * **Drag and Drop Form Builder** – Create forms effortlessly with an intuitive visual builder 20 * **User Form Submissions** – Collect responses from your website visitors 21 * **Entry Management** – View and manage all form submissions from the admin dashboard 22 * **Comprehensive Field Types** – 20+ field types to build any form you need 23 * **Pre-built Templates** – Ready to go with pre-built templates 24 * **Shortcode Support** – Use shortcode anywhere of the post/page to show the form 25 26 = Available Form Fields = 27 28 * Text – Single line text input 29 * Email – Email address field with validation 30 * Number – Numeric input field 31 * Phone – Phone number field 32 * Textarea – Multi-line text area 33 * Select – Dropdown selection menu 34 * Checkbox – Multiple choice checkboxes 35 * Radio – Single choice radio buttons 36 * Date – Date picker field 37 * Time – Time picker field 38 * URL – Website URL field with validation 39 * Password – Secure password input 40 * File Upload – Allow users to upload files 41 * Rating – Star or numeric rating field 42 * Range Slider – Slider for numeric values 43 * Switch – Toggle switch field 44 * reCAPTCHA – Spam protection with Google reCAPTCHA 45 * First Name – Pre-configured first name field 46 * Last Name – Pre-configured last name field 47 * GDPR Consent – Checkbox for privacy compliance 48 * Response Message – Display custom messages to users 49 * Summary – Show form data summary 50 * Submit Button – Customizable form submission button 51 52 = Perfect For = 53 54 * Contact forms 55 * Survey and polls 56 * Feedback forms 57 * Order forms 58 * Application forms 59 * Newsletter signups 60 * And much more! 61 62 = Why Choose Formative? = 63 64 Formative combines ease of use with powerful functionality. Whether you're creating a simple contact form or a complex form, Formative provides all the tools you need in one plugin. 19 For code and implementation details see the plugin bootstrap: wp-content/plugins/formative/formative.php 20 and core classes: includes/Plugin.php, includes/Installer.php, includes/API/Base_Controller.php. 65 21 66 22 == Installation == 23 1. Upload the `formative` folder to the `/wp-content/plugins/` directory. 24 2. Activate the plugin through the 'Plugins' screen in WordPress. 25 3. Go to Formative → Add New to create a form. 26 4. Insert forms with the Formative block or use the shortcode: 27 [formative id="123"] 67 28 68 1. Upload the `formative` folder to the `/wp-content/plugins/` directory 69 2. Activate the plugin through the 'Plugins' menu in WordPress 70 3. Navigate to Formative in your WordPress admin menu 71 4. Start creating your first form using the drag-and-drop builder 72 5. Add the form to any page or post using the provided shortcode 29 == Screenshots == 30 1. Admin Dashboard - Overview and stats. 31 2. Form List - Edit / Duplicate / Preview. 32 3. Form Builder - Drag and configure fields. 33 4. Entry List - View / export submissions. 34 5. Frontend form - Responsive form with messages. 73 35 74 36 == Frequently Asked Questions == 37 = Where are submissions stored? = 38 Submissions are saved as `formative_entry` posts and (optionally) in a custom entry meta table. See plugin settings to disable storage. 75 39 76 = How do I create a form? = 77 78 After activating the plugin, go to the Formative menu in your WordPress dashboard. Click "Add New" and use the drag-and-drop builder to add fields to your form. 79 80 = How do I add a form to my page? = 81 82 Once you've created a form, you'll receive a shortcode. Simply copy and paste this shortcode into any page, post, or widget where you want the form to appear. 83 84 = Can I view form submissions? = 85 86 Yes! All form submissions are stored in your WordPress database and can be viewed from the Formative entries section in your admin dashboard. 87 88 = Is the plugin GDPR compliant? = 89 90 Yes, Formative includes a GDPR Consent field that you can add to your forms to ensure compliance with privacy regulations. 91 92 = Does it work with page builders? = 93 94 Yes, Formative forms can be embedded using shortcodes, making them compatible with all major page builders including Elementor, Gutenberg, WPBakery, and more. 95 96 == Screenshots == 97 98 1. Drag and drop form builder interface 99 2. Complete list of available form fields 100 3. Form entries management dashboard 101 4. Front-end form display 102 5. Form settings panel 40 = Is this secure? = 41 Yes — nonces, sanitization, capability checks, and server-side validation are implemented. See REST base controllers for details. 103 42 104 43 == Changelog == 105 44 106 = 1.0.0 = (24 December, 2025) 107 * Initial release. 108 * Drag and drop form builder. 109 * 20+ form field types. 110 * Form submission management. 111 * Entry viewing in admin dashboard. 112 * GDPR consent field. 113 * Responsive form design. 114 115 == Upgrade Notice == 45 = 1.0.1 = (27 December, 2025) 46 * Editor UI/UX improved. 116 47 117 48 = 1.0.0 = 118 Initial release of Formative – A powerful drag-and-drop form builder for WordPress. 49 * Initial release — admin dashboard, REST endpoints, entries, CSV export. 50 51 == Support == 52 For support, please check the documentation in the plugin folder (README.md, QUICK_START.md) or open a support topic on WordPress.org plugin page. When reporting issues, include WordPress version and plugin version. 53 54 == Privacy == 55 Formative stores submission data (may include personal data) in WordPress database. Ensure GDPR/privacy compliance for your site. You can disable storing entries via plugin settings if needed.
Note: See TracChangeset
for help on using the changeset viewer.