' . implode( '', $inner ) . ''; } return ''; } /** BS23 Container (fwrenbc/container). */ private static function c( array $attrs, array $inner ) { $attrs = array_merge( array( 'content_width' => 'full' ), $attrs ); $attrs['_id'] = substr( md5( wp_generate_password( 12, false ) . 'c' ), 0, 7 ); return '' . implode( '', $inner ) . ''; } /** Row of inner containers: [ width% => block | blocks ], or a list for equal widths. */ private static function row( array $cols, array $attrs = array() ) { $inner = array(); $list = array_keys( $cols ) === range( 0, count( $cols ) - 1 ); $w = round( 100 / max( 1, count( $cols ) ), 4 ); foreach ( $cols as $k => $blocks ) { $inner[] = self::c( array( 'width' => array( 'size' => $list ? $w : (float) $k, 'unit' => '%' ), 'width_mobile' => array( 'size' => 100, 'unit' => '%' ) ), (array) $blocks ); } return self::c( array_merge( array( 'flex_direction' => 'row' ), $attrs ), $inner ); } /** Two blocks side by side. */ private static function pair( $a, $b ) { return self::row( array( $a, $b ) ); } /** Container shown (or hidden) by one rule. */ private static function when( $field, $op, $value, array $inner, $action = 'show' ) { return self::c( array( 'flex_direction' => 'column', 'cl_enabled' => 'yes', 'cl_action' => $action, 'cl_match' => 'all', 'cl_rules' => array( array( 'field' => $field, 'operator' => $op, 'value' => $value ) ), ), $inner ); } /** Field attributes plus a show-rule. */ private static function cond( array $attrs, $field, $op, $value ) { return $attrs + array( 'cl_enabled' => 'yes', 'cl_action' => 'show', 'cl_match' => 'all', 'cl_rules' => array( array( 'field' => $field, 'operator' => $op, 'value' => $value ) ) ); } /** @return array Option rows from labels (+ calc values). */ private static function opts( array $labels, array $calc = array() ) { $out = array(); foreach ( $labels as $i => $l ) { // Emoji decorate the label only; values stay plain ("πŸ’Έ Too expensive" β†’ too-expensive). $plain = trim( (string) preg_replace( '/[\x{1F000}-\x{1FAFF}\x{2600}-\x{27BF}\x{2B00}-\x{2BFF}\x{FE0F}\x{200D}]/u', '', $l ) ); $out[] = array( 'label' => $l, 'value' => sanitize_title( '' !== $plain ? $plain : $l ), 'calc' => isset( $calc[ $i ] ) ? (string) $calc[ $i ] : '' ); } return $out; } /* Field shortcuts. */ private static function name( $label = '', $mode = 'full', $req = true ) { return self::b( 'name', array( 'label' => $label ? $label : __( 'Full name', 'fieldwren' ), 'name' => 'names', 'name_mode' => $mode, 'required' => $req ? 'yes' : '' ) ); } private static function email( $label = '', $key = 'email', array $x = array() ) { return self::b( 'email', array_merge( array( 'label' => $label ? $label : __( 'Email', 'fieldwren' ), 'name' => $key, 'required' => 'yes' ), $x ) ); } private static function phone( $label = '', $key = 'phone', $req = false ) { return self::b( 'phone', array( 'label' => $label ? $label : __( 'Phone', 'fieldwren' ), 'name' => $key, 'required' => $req ? 'yes' : '' ) ); } private static function text( $label, $key, $req = false, array $x = array() ) { return self::b( 'text', array_merge( array( 'label' => $label, 'name' => $key, 'required' => $req ? 'yes' : '' ), $x ) ); } private static function ta( $label, $key, $req = false, array $x = array() ) { return self::b( 'textarea', array_merge( array( 'label' => $label, 'name' => $key, 'required' => $req ? 'yes' : '' ), $x ) ); } private static function num( $label, $key, array $x = array() ) { return self::b( 'number', array_merge( array( 'label' => $label, 'name' => $key ), $x ) ); } private static function sel( $label, $key, array $o, $req = false, array $x = array() ) { return self::b( 'select', array_merge( array( 'label' => $label, 'name' => $key, 'required' => $req ? 'yes' : '', 'options' => self::opts( $o ) ), $x ) ); } private static function radio( $label, $key, array $o, $display = 'list', $req = false, array $x = array(), array $calc = array() ) { return self::b( 'radio', array_merge( array( 'label' => $label, 'name' => $key, 'display' => $display, 'required' => $req ? 'yes' : '', 'options' => self::opts( $o, $calc ) ), $x ) ); } private static function chk( $label, $key, array $o, $display = 'list', $req = false, array $x = array(), array $calc = array() ) { return self::b( 'checkbox', array_merge( array( 'label' => $label, 'name' => $key, 'display' => $display, 'required' => $req ? 'yes' : '', 'options' => self::opts( $o, $calc ) ), $x ) ); } private static function toggle( $label, $key, array $o, $req = false, array $x = array() ) { return self::b( 'toggle', array_merge( array( 'label' => $label, 'name' => $key, 'required' => $req ? 'yes' : '', 'options' => self::opts( $o ) ), $x ) ); } private static function date( $label, $key, $req = false, array $x = array() ) { return self::b( 'date', array_merge( array( 'label' => $label, 'name' => $key, 'required' => $req ? 'yes' : '' ), $x ) ); } private static function consent( $text = '', $key = 'terms', $type = 'terms' ) { $a = array( 'name' => $key, 'required' => 'yes', 'consent_type' => $type ); if ( $text ) { $a['consent_text'] = $text; } return self::b( 'consent', $a ); } private static function section( $title, $desc = '' ) { // Bound to Global Styles: Primary typography, Secondary colour. return self::b( 'section', array( 'title' => $title, 'description' => $desc, 'title_typography_global' => 'primary', 'title_color' => 'global:secondary' ) ); } private static function step( $title, $first = '' ) { return self::b( 'step', array( 'title' => $title, 'first_title' => $first ) ); } private static function submit( $text, $align = 'left' ) { // Bound to Global Styles: Primary colour, Accent typography. return self::b( 'submit', array( 'text' => $text, 'align' => $align, 'btn_bg' => 'global:primary', 'btn_typography_global' => 'accent' ) ); } private static function utm() { return self::b( 'hidden', array( 'label' => 'UTM source', 'name' => 'utm_source', 'capture' => '{get.utm_source}' ) ) . self::b( 'hidden', array( 'label' => 'UTM campaign', 'name' => 'utm_campaign', 'capture' => '{get.utm_campaign}' ) ) . self::b( 'hidden', array( 'label' => 'Page', 'name' => 'page_url', 'capture' => '{embed_post.permalink}' ) ); } /* ------------------------------------------------------------------ * * Design helpers – styled containers bound to Global Styles, plus HTML * blocks that use the .fwrenx-* classes from assets/frontend/form.css. * ------------------------------------------------------------------ */ /** @return array Dimensions value. */ private static function dims( $v, $unit = 'px' ) { return array( 'top' => (string) $v, 'right' => (string) $v, 'bottom' => (string) $v, 'left' => (string) $v, 'unit' => $unit, 'isLinked' => true ); } /** @return array Container style attributes: gradient (primary β†’ accent), soft (tinted panel) or card. */ private static function look( $kind ) { switch ( $kind ) { case 'gradient': return array( 'background_background' => 'gradient', 'background_color' => 'global:primary', 'background_color_b' => 'global:accent', 'background_gradient_angle' => array( 'size' => 135, 'unit' => 'deg' ), 'border_radius' => self::dims( 20 ), 'padding' => self::dims( 32 ), 'box_shadow_box_shadow_type' => 'yes', 'box_shadow_box_shadow' => array( 'horizontal' => 0, 'vertical' => 22, 'blur' => 44, 'spread' => -24, 'color' => 'rgba(79,70,229,0.55)' ), ); case 'dark': return array( 'background_background' => 'gradient', 'background_color' => 'global:secondary', 'background_color_b' => '#312E81', 'background_gradient_angle' => array( 'size' => 150, 'unit' => 'deg' ), 'border_radius' => self::dims( 20 ), 'padding' => self::dims( 32 ), 'box_shadow_box_shadow_type' => 'yes', 'box_shadow_box_shadow' => array( 'horizontal' => 0, 'vertical' => 22, 'blur' => 44, 'spread' => -24, 'color' => 'rgba(15,23,42,0.55)' ), ); case 'card': return array( 'background_background' => 'classic', 'background_color' => '#FFFFFF', 'border_border' => 'solid', 'border_width' => self::dims( 1 ), 'border_color' => '#E6E8F0', 'border_radius' => self::dims( 20 ), 'padding' => self::dims( 28 ), 'box_shadow_box_shadow_type' => 'yes', 'box_shadow_box_shadow' => array( 'horizontal' => 0, 'vertical' => 24, 'blur' => 48, 'spread' => -30, 'color' => 'rgba(15,23,42,0.28)' ), ); default: // soft return array( 'background_background' => 'classic', 'background_color' => '#F5F6FF', 'border_border' => 'solid', 'border_width' => self::dims( 1 ), 'border_color' => '#E3E6FA', 'border_radius' => self::dims( 16 ), 'padding' => self::dims( 22 ), ); } } /** Styled column container. */ private static function panel( array $inner, $kind = 'soft', array $x = array() ) { return self::c( array_merge( array( 'flex_direction' => 'column' ), self::look( $kind ), $x ), $inner ); } /** @return string HTML for a headline block (light text when $dark). */ private static function headline( $eyebrow, $title, $text = '', array $chips = array(), $dark = true ) { $h = '
'; $h .= $eyebrow ? '' . esc_html( $eyebrow ) . '' : ''; $h .= '

' . esc_html( $title ) . '

'; $h .= $text ? '

' . esc_html( $text ) . '

' : ''; if ( $chips ) { $h .= ''; } return $h . '
'; } /** @return string HTML tick list. */ private static function perks( array $items, $dark = true ) { $h = ''; } /** Full-width gradient banner at the top of a form. */ private static function hero( $eyebrow, $title, $text = '', array $chips = array(), $kind = 'gradient' ) { return self::panel( array( self::b( 'html', array( 'html' => self::headline( $eyebrow, $title, $text, $chips ) ) ) ), $kind ); } /** Light intro panel (no gradient). */ private static function intro( $eyebrow, $title, $text = '' ) { return self::panel( array( self::b( 'html', array( 'html' => self::headline( $eyebrow, $title, $text, array(), false ) ) ) ), 'soft' ); } /** Small muted note. */ private static function note( $text ) { return self::b( 'html', array( 'html' => '

' . esc_html( $text ) . '

' ) ); } /** Two columns: a gradient pitch panel (40%) beside the fields (60%). Stacks on phones. */ private static function split( $aside_html, array $fields, $kind = 'gradient' ) { $aside = self::c( array_merge( array( 'flex_direction' => 'column', 'width' => array( 'size' => 40, 'unit' => '%' ), 'width_mobile' => array( 'size' => 100, 'unit' => '%' ) ), self::look( $kind ) ), array( self::b( 'html', array( 'html' => $aside_html ) ) ) ); $main = self::c( array( 'flex_direction' => 'column', 'width' => array( 'size' => 60, 'unit' => '%' ), 'width_mobile' => array( 'size' => 100, 'unit' => '%' ) ), $fields ); return self::c( array( 'flex_direction' => 'row', 'flex_align_items' => 'stretch' ), array( $aside, $main ) ); } /** Confirmation settings shortcut. */ private static function thanks( $msg ) { return array( 'confirmation' => array( 'type' => 'message', 'message' => $msg ) ); } /** Scored quiz settings: [ field => correct option value ]. */ private static function quiz( array $answers, $pass_msg, $fail_msg ) { $q = array(); foreach ( $answers as $field => $value ) { $q[] = array( 'field' => $field, 'enabled' => true, 'points' => 1, 'answers' => array( $value ), 'answer_text' => '', 'map' => array() ); } return array( 'quiz' => array( 'enabled' => true, 'mode' => 'score', 'show_result' => true, 'show_answers' => true, 'result_message' => __( 'You scored {quiz.score} out of {quiz.total} ({quiz.percent}%).', 'fieldwren' ), 'grading' => array( array( 'min' => 80, 'grade' => __( 'Excellent', 'fieldwren' ), 'message' => $pass_msg ), array( 'min' => 0, 'grade' => __( 'Keep learning', 'fieldwren' ), 'message' => $fail_msg ), ), 'personalities' => array(), 'questions' => $q, ), 'confirmation' => array( 'type' => 'message', 'message' => __( 'Thanks for taking the quiz!', 'fieldwren' ) ), ); } /* ------------------------------------------------------------------ * * Library * ------------------------------------------------------------------ */ /** @return array Category labels. */ public static function categories() { return array( 'contact' => __( 'Contact', 'fieldwren' ), 'lead' => __( 'Sales & lead generation', 'fieldwren' ), 'multistep' => __( 'Multi-step', 'fieldwren' ), 'quiz' => __( 'Quizzes', 'fieldwren' ), 'calc' => __( 'Calculators', 'fieldwren' ), 'feedback' => __( 'Feedback & surveys', 'fieldwren' ), 'conditional' => __( 'Conditional logic', 'fieldwren' ), 'events' => __( 'Events & bookings', 'fieldwren' ), 'applications' => __( 'Applications', 'fieldwren' ), 'orders' => __( 'Orders & payments', 'fieldwren' ), 'newsletter' => __( 'Newsletter & subscribe', 'fieldwren' ), 'health' => __( 'Healthcare & wellbeing', 'fieldwren' ), 'hospitality' => __( 'Travel & hospitality', 'fieldwren' ), 'nonprofit' => __( 'Nonprofit & donations', 'fieldwren' ), 'education' => __( 'Education', 'fieldwren' ), 'services' => __( 'Home & local services', 'fieldwren' ), 'hr' => __( 'HR & internal', 'fieldwren' ), 'support' => __( 'Support & privacy', 'fieldwren' ), 'showcase' => __( 'All form elements', 'fieldwren' ), ); } /** @return array id => [ title, description, category, content, settings ]. */ public static function all() { if ( null !== self::$cache ) { return self::$cache; } $free = 'gmail.com, yahoo.com, hotmail.com, outlook.com, aol.com, icloud.com, proton.me, protonmail.com, gmx.com, mail.com, yandex.com'; $t = array(); $add = static function ( $id, $cat, $title, $desc, $content, array $settings = array() ) use ( &$t ) { $t[ $id ] = array( 'title' => $title, 'description' => $desc, 'category' => $cat, 'content' => $content, 'settings' => $settings ); }; /* ---------------- Contact ---------------- */ $add( 'contact', 'contact', __( 'Contact form', 'fieldwren' ), __( 'Name, email, phone, subject and message.', 'fieldwren' ), self::name() . self::pair( self::email(), self::phone() ) . self::text( __( 'Subject', 'fieldwren' ), 'subject' ) . self::ta( __( 'Message', 'fieldwren' ), 'message', true ) . self::consent() . self::submit( __( 'Send message', 'fieldwren' ) ), self::thanks( __( 'Thanks for getting in touch, {inputs.names}! We will reply within one business day.', 'fieldwren' ) ) ); $add( 'contact-department', 'contact', __( 'Contact by department', 'fieldwren' ), __( 'Routes to a department; asks for a phone number only when the visitor prefers a call.', 'fieldwren' ), self::pair( self::name(), self::email() ) . self::sel( __( 'Department', 'fieldwren' ), 'department', array( 'Sales', 'Support', 'Billing', 'Partnerships', 'Press' ), true ) . self::toggle( __( 'How should we reply?', 'fieldwren' ), 'reply_by', array( 'Email', 'Phone call' ), true ) . self::b( 'phone', self::cond( array( 'label' => __( 'Best number to call', 'fieldwren' ), 'name' => 'phone', 'required' => 'yes' ), 'reply_by', '=', 'phone-call' ) ) . self::ta( __( 'How can we help?', 'fieldwren' ), 'message', true ) . self::submit( __( 'Send', 'fieldwren' ) ), self::thanks( __( 'Your message is on its way to our {inputs.department} team.', 'fieldwren' ) ) ); $add( 'contact-quick', 'contact', __( 'Quick contact', 'fieldwren' ), __( 'Three fields on two lines – for sidebars and footers.', 'fieldwren' ), self::pair( self::name( __( 'Name', 'fieldwren' ) ), self::email() ) . self::ta( __( 'Message', 'fieldwren' ), 'message', true, array( 'rows' => 3 ) ) . self::submit( __( 'Send', 'fieldwren' ), 'justify' ) ); /* ---------------- Lead generation ---------------- */ $add( 'quote', 'lead', __( 'Request a quote', 'fieldwren' ), __( 'Project type, budget, timeline, brief and attachments – work email only.', 'fieldwren' ), self::pair( self::name( __( 'Your name', 'fieldwren' ) ), self::email( __( 'Work email', 'fieldwren' ), 'email', array( 'blocked_domains' => $free ) ) ) . self::pair( self::text( __( 'Company', 'fieldwren' ), 'company', false, array( 'autocomplete' => 'organization' ) ), self::phone() ) . self::sel( __( 'What do you need?', 'fieldwren' ), 'service', array( 'Web application', 'Mobile app', 'AI / Machine learning', 'Cloud & DevOps', 'QA & testing', 'Dedicated team', 'Other' ), true ) . self::pair( self::sel( __( 'Budget', 'fieldwren' ), 'budget', array( 'Under $10k', '$10k – $50k', '$50k – $150k', '$150k+', 'Not sure yet' ) ), self::sel( __( 'Timeline', 'fieldwren' ), 'timeline', array( 'ASAP', '1–3 months', '3–6 months', 'Just exploring' ) ) ) . self::ta( __( 'Project brief', 'fieldwren' ), 'brief', false, array( 'rows' => 5, 'counter' => 'yes', 'maxlength' => 3000 ) ) . self::b( 'file', array( 'label' => __( 'Attachments (optional)', 'fieldwren' ), 'name' => 'files', 'max_files' => 3, 'max_size' => 10 ) ) . self::utm() . self::consent() . self::submit( __( 'Get my quote', 'fieldwren' ), 'justify' ), self::thanks( __( 'Thanks! A solutions consultant will send your estimate within two business days.', 'fieldwren' ) ) ); $add( 'hire', 'lead', __( 'Hire developers', 'fieldwren' ), __( 'Skills, team size, engagement model and start date.', 'fieldwren' ), self::chk( __( 'Skills you need', 'fieldwren' ), 'skills', array( 'PHP / Laravel', 'Python', '.NET', 'Java', 'React', 'Node.js', 'Flutter', 'React Native', 'DevOps', 'QA' ), 'buttons', true ) . self::pair( self::num( __( 'How many developers?', 'fieldwren' ), 'team_size', array( 'min' => 1, 'max' => 100, 'default_value' => '2' ) ), self::date( __( 'Ideal start date', 'fieldwren' ), 'start_date', false, array( 'min_date' => 'today' ) ) ) . self::radio( __( 'Engagement model', 'fieldwren' ), 'model', array( 'Dedicated team', 'Staff augmentation', 'Fixed-price project' ), 'cards' ) . self::pair( self::name(), self::email( __( 'Work email', 'fieldwren' ), 'email', array( 'blocked_domains' => $free ) ) ) . self::b( 'country', array( 'label' => __( 'Country', 'fieldwren' ), 'name' => 'country' ) ) . self::submit( __( 'Find my developers', 'fieldwren' ) ) ); $add( 'partner', 'lead', __( 'Partner application', 'fieldwren' ), __( 'Agencies and resellers apply to partner with you.', 'fieldwren' ), self::pair( self::text( __( 'Company name', 'fieldwren' ), 'company', true ), self::b( 'url', array( 'label' => __( 'Website', 'fieldwren' ), 'name' => 'website', 'required' => 'yes' ) ) ) . self::radio( __( 'Partnership type', 'fieldwren' ), 'type', array( 'Referral', 'Reseller', 'Technology', 'Implementation' ), 'col-2', true ) . self::pair( self::b( 'country', array( 'label' => __( 'Headquarters', 'fieldwren' ), 'name' => 'country', 'required' => 'yes' ) ), self::sel( __( 'Team size', 'fieldwren' ), 'size', array( '1–10', '11–50', '51–200', '200+' ) ) ) . self::pair( self::name( __( 'Contact person', 'fieldwren' ) ), self::email( __( 'Business email', 'fieldwren' ), 'email', array( 'blocked_domains' => $free ) ) ) . self::ta( __( 'Why should we partner?', 'fieldwren' ), 'pitch', true ) . self::submit( __( 'Apply', 'fieldwren' ) ) ); $add( 'webinar', 'events', __( 'Webinar registration', 'fieldwren' ), __( 'Work email, company, role and country with marketing opt-in.', 'fieldwren' ), self::pair( self::text( __( 'First name', 'fieldwren' ), 'first_name', true ), self::text( __( 'Last name', 'fieldwren' ), 'last_name', true ) ) . self::email( __( 'Work email', 'fieldwren' ), 'email', array( 'unique' => 'yes', 'unique_message' => __( 'You are already registered with this email.', 'fieldwren' ), 'blocked_domains' => $free ) ) . self::pair( self::text( __( 'Company', 'fieldwren' ), 'company', true ), self::text( __( 'Job title', 'fieldwren' ), 'job_title' ) ) . self::b( 'country', array( 'label' => __( 'Country', 'fieldwren' ), 'name' => 'country', 'required' => 'yes' ) ) . self::b( 'consent', array( 'name' => 'marketing', 'consent_type' => 'marketing', 'consent_text' => __( 'Send me the recording and occasional updates. Unsubscribe anytime.', 'fieldwren' ) ) ) . self::submit( __( 'Save my seat', 'fieldwren' ), 'justify' ), self::thanks( __( 'You are registered! The joining link is on its way to {inputs.email}.', 'fieldwren' ) ) ); /* ---------------- Multi-step ---------------- */ $add( 'multistep', 'multistep', __( 'Multi-step lead qualification', 'fieldwren' ), __( 'Three steps: about you, your company, your project.', 'fieldwren' ), self::name() . self::email( __( 'Work email', 'fieldwren' ) ) . self::step( __( 'Your company', 'fieldwren' ), __( 'About you', 'fieldwren' ) ) . self::text( __( 'Company', 'fieldwren' ), 'company', true ) . self::radio( __( 'Company size', 'fieldwren' ), 'company_size', array( '1–10', '11–50', '51–200', '201–1000', '1000+' ), 'buttons' ) . self::sel( __( 'Industry', 'fieldwren' ), 'industry', array( 'Fintech', 'Healthcare', 'E-commerce', 'Education', 'Telecom', 'Logistics', 'Government', 'Other' ), false, array( 'searchable' => 'yes' ) ) . self::step( __( 'Your project', 'fieldwren' ) ) . self::chk( __( 'Services', 'fieldwren' ), 'services', array( 'Custom software', 'Mobile app', 'AI', 'Cloud', 'QA', 'UI/UX' ), 'col-2' ) . self::sel( __( 'Budget', 'fieldwren' ), 'budget', array( 'Under $10k', '$10k – $50k', '$50k – $150k', '$150k+' ) ) . self::b( 'textarea', self::cond( array( 'label' => __( 'Anything else?', 'fieldwren' ), 'name' => 'notes' ), 'budget', 'not_empty', '' ) ) . self::submit( __( 'Submit', 'fieldwren' ) ) ); $add( 'multistep-brief', 'multistep', __( 'Project brief wizard', 'fieldwren' ), __( 'Four steps ending with a review of every answer before sending.', 'fieldwren' ), self::radio( __( 'What are we building?', 'fieldwren' ), 'product', array( 'Website', 'Web app', 'Mobile app', 'Internal tool' ), 'cards', true ) . self::chk( __( 'Must-have features', 'fieldwren' ), 'features', array( 'User accounts', 'Payments', 'Admin dashboard', 'Notifications', 'Integrations', 'Analytics' ), 'col-2' ) . self::step( __( 'Scope', 'fieldwren' ), __( 'Product', 'fieldwren' ) ) . self::b( 'range', array( 'label' => __( 'Budget (USD, thousands)', 'fieldwren' ), 'name' => 'budget_k', 'min' => 5, 'max' => 300, 'step' => 5, 'default_value' => '40', 'prefix' => '$', 'suffix' => 'k' ) ) . self::date( __( 'Launch by', 'fieldwren' ), 'deadline', false, array( 'min_date' => '+1 month' ) ) . self::b( 'richtext', array( 'label' => __( 'Describe the idea', 'fieldwren' ), 'name' => 'idea', 'placeholder' => __( 'Goals, users, references…', 'fieldwren' ) ) ) . self::step( __( 'Contact', 'fieldwren' ) ) . self::pair( self::name(), self::email() ) . self::text( __( 'Company', 'fieldwren' ), 'company' ) . self::step( __( 'Review', 'fieldwren' ) ) . self::b( 'summary', array( 'title' => __( 'Check your brief', 'fieldwren' ) ) ) . self::consent() . self::submit( __( 'Send brief', 'fieldwren' ) ), self::thanks( __( 'Brief received – we will be in touch within 48 hours.', 'fieldwren' ) ) ); /* ---------------- Quizzes ---------------- */ $add( 'quiz-science', 'quiz', __( 'Science quiz', 'fieldwren' ), __( 'Five scored biology questions with instant result and grades.', 'fieldwren' ), self::name( __( 'Your name', 'fieldwren' ) ) . self::radio( __( '1. Which organelle produces most of a cell\'s energy?', 'fieldwren' ), 'q1', array( 'Nucleus', 'Mitochondria', 'Ribosome', 'Golgi body' ), 'list', true ) . self::radio( __( '2. What carries oxygen in the blood?', 'fieldwren' ), 'q2', array( 'White blood cells', 'Plasma', 'Haemoglobin', 'Platelets' ), 'list', true ) . self::radio( __( '3. Plants make food by…', 'fieldwren' ), 'q3', array( 'Respiration', 'Photosynthesis', 'Fermentation', 'Transpiration' ), 'list', true ) . self::radio( __( '4. How many chambers does the human heart have?', 'fieldwren' ), 'q4', array( 'Two', 'Three', 'Four', 'Five' ), 'buttons', true ) . self::radio( __( '5. DNA stands for…', 'fieldwren' ), 'q5', array( 'Deoxyribonucleic acid', 'Dinitrogen acid', 'Dual nucleic acid', 'Deoxyribose amine' ), 'list', true ) . self::submit( __( 'See my score', 'fieldwren' ) ), self::quiz( array( 'q1' => 'mitochondria', 'q2' => 'haemoglobin', 'q3' => 'photosynthesis', 'q4' => 'four', 'q5' => 'deoxyribonucleic-acid' ), __( 'Brilliant – you know your biology!', 'fieldwren' ), __( 'Good try – review the answers below and have another go.', 'fieldwren' ) ) ); $add( 'quiz-general', 'quiz', __( 'General knowledge quiz', 'fieldwren' ), __( 'Six quick questions, scored, with answers shown afterwards.', 'fieldwren' ), self::radio( __( 'Which is the largest ocean?', 'fieldwren' ), 'q1', array( 'Atlantic', 'Indian', 'Pacific', 'Arctic' ), 'buttons', true ) . self::radio( __( 'How many continents are there?', 'fieldwren' ), 'q2', array( '5', '6', '7', '8' ), 'buttons', true ) . self::radio( __( 'Which planet is known as the Red Planet?', 'fieldwren' ), 'q3', array( 'Venus', 'Mars', 'Jupiter', 'Mercury' ), 'buttons', true ) . self::radio( __( 'What is the boiling point of water at sea level?', 'fieldwren' ), 'q4', array( '90 Β°C', '100 Β°C', '110 Β°C', '120 Β°C' ), 'buttons', true ) . self::radio( __( 'Which language has the most native speakers?', 'fieldwren' ), 'q5', array( 'English', 'Spanish', 'Mandarin Chinese', 'Hindi' ), 'buttons', true ) . self::radio( __( 'How many sides does a hexagon have?', 'fieldwren' ), 'q6', array( '5', '6', '7', '8' ), 'buttons', true ) . self::email( __( 'Email me my result (optional)', 'fieldwren' ), 'email', array( 'required' => '' ) ) . self::submit( __( 'Submit answers', 'fieldwren' ) ), self::quiz( array( 'q1' => 'pacific', 'q2' => '7', 'q3' => 'mars', 'q4' => '100-c', 'q5' => 'mandarin-chinese', 'q6' => '6' ), __( 'Impressive general knowledge!', 'fieldwren' ), __( 'Not bad – see which ones you missed below.', 'fieldwren' ) ) ); $add( 'quiz-plan-finder', 'quiz', __( 'Plan finder quiz', 'fieldwren' ), __( 'Personality-style quiz that recommends a plan from the answers.', 'fieldwren' ), self::radio( __( 'How big is your team?', 'fieldwren' ), 'team', array( 'Just me', '2–20 people', 'More than 20' ), 'cards', true ) . self::radio( __( 'What matters most?', 'fieldwren' ), 'priority', array( 'Low cost', 'Growth features', 'Security & compliance' ), 'cards', true ) . self::radio( __( 'How much support do you want?', 'fieldwren' ), 'support', array( 'Docs are fine', 'Email support', 'Dedicated manager' ), 'cards', true ) . self::email( __( 'Where should we send your recommendation?', 'fieldwren' ) ) . self::submit( __( 'Find my plan', 'fieldwren' ) ), array( 'quiz' => array( 'enabled' => true, 'mode' => 'personality', 'show_result' => true, 'show_answers' => false, 'result_message' => __( 'Your best fit: {quiz.grade}', 'fieldwren' ), 'grading' => array(), 'personalities' => array( array( 'type' => 'Starter', 'message' => __( 'Starter keeps costs low and covers the essentials.', 'fieldwren' ) ), array( 'type' => 'Growth', 'message' => __( 'Growth adds automation and integrations for a busy team.', 'fieldwren' ) ), array( 'type' => 'Enterprise', 'message' => __( 'Enterprise brings SSO, audit logs and a dedicated manager.', 'fieldwren' ) ), ), 'questions' => array( array( 'field' => 'team', 'enabled' => true, 'points' => 1, 'answers' => array(), 'answer_text' => '', 'map' => array( array( 'value' => 'just-me', 'type' => 'Starter' ), array( 'value' => '2-20-people', 'type' => 'Growth' ), array( 'value' => 'more-than-20', 'type' => 'Enterprise' ) ) ), array( 'field' => 'priority', 'enabled' => true, 'points' => 1, 'answers' => array(), 'answer_text' => '', 'map' => array( array( 'value' => 'low-cost', 'type' => 'Starter' ), array( 'value' => 'growth-features', 'type' => 'Growth' ), array( 'value' => 'security-compliance', 'type' => 'Enterprise' ) ) ), array( 'field' => 'support', 'enabled' => true, 'points' => 1, 'answers' => array(), 'answer_text' => '', 'map' => array( array( 'value' => 'docs-are-fine', 'type' => 'Starter' ), array( 'value' => 'email-support', 'type' => 'Growth' ), array( 'value' => 'dedicated-manager', 'type' => 'Enterprise' ) ) ), ), ), ) ); $add( 'quiz-conditional', 'quiz', __( 'Quiz with follow-up questions', 'fieldwren' ), __( 'Scored quiz whose follow-up questions appear based on earlier answers.', 'fieldwren' ), self::radio( __( 'Do you write code at work?', 'fieldwren' ), 'codes', array( 'Yes', 'No' ), 'buttons', true ) . self::b( 'radio', self::cond( array( 'label' => __( 'What does HTTP status 404 mean?', 'fieldwren' ), 'name' => 'q_dev1', 'display' => 'list', 'options' => self::opts( array( 'Server error', 'Not found', 'Unauthorised', 'Moved' ) ) ), 'codes', '=', 'yes' ) ) . self::b( 'radio', self::cond( array( 'label' => __( 'Which is a version control system?', 'fieldwren' ), 'name' => 'q_dev2', 'display' => 'list', 'options' => self::opts( array( 'Git', 'Docker', 'Nginx', 'Redis' ) ) ), 'codes', '=', 'yes' ) ) . self::b( 'radio', self::cond( array( 'label' => __( 'What does "ROI" stand for?', 'fieldwren' ), 'name' => 'q_biz1', 'display' => 'list', 'options' => self::opts( array( 'Rate of interest', 'Return on investment', 'Risk of inflation', 'Revenue over income' ) ) ), 'codes', '=', 'no' ) ) . self::b( 'radio', self::cond( array( 'label' => __( 'A KPI is…', 'fieldwren' ), 'name' => 'q_biz2', 'display' => 'list', 'options' => self::opts( array( 'A key performance indicator', 'A kind of invoice', 'A keyboard shortcut', 'A pricing model' ) ) ), 'codes', '=', 'no' ) ) . self::submit( __( 'Check answers', 'fieldwren' ) ), self::quiz( array( 'q_dev1' => 'not-found', 'q_dev2' => 'git', 'q_biz1' => 'return-on-investment', 'q_biz2' => 'a-key-performance-indicator' ), __( 'Spot on!', 'fieldwren' ), __( 'Close – the right answers are below.', 'fieldwren' ) ) ); /* ---------------- Calculators ---------------- */ $add( 'estimator', 'calc', __( 'Project cost estimator', 'fieldwren' ), __( 'Live price from app type, platforms and integrations.', 'fieldwren' ), self::radio( __( 'App type', 'fieldwren' ), 'app_type', array( 'Simple (MVP)', 'Medium', 'Complex' ), 'cards', true, array(), array( 15000, 40000, 90000 ) ) . self::chk( __( 'Platforms', 'fieldwren' ), 'platforms', array( 'Web', 'iOS', 'Android' ), 'buttons', false, array(), array( 1, 0.6, 0.6 ) ) . self::b( 'range', array( 'label' => __( 'Number of integrations', 'fieldwren' ), 'name' => 'integrations', 'min' => 0, 'max' => 10, 'step' => 1, 'default_value' => '2' ) ) . self::b( 'calculation', array( 'label' => __( 'Estimated budget', 'fieldwren' ), 'name' => 'estimate', 'formula' => '{inputs.app_type} * max(1, {inputs.platforms}) + {inputs.integrations} * 2500', 'decimals' => 0, 'prefix' => '$' ) ) . self::email( __( 'Email me the estimate', 'fieldwren' ) ) . self::submit( __( 'Send estimate', 'fieldwren' ) ), self::thanks( __( 'Your estimate of {inputs.estimate} is on its way to {inputs.email}.', 'fieldwren' ) ) ); $add( 'loan-calculator', 'calc', __( 'Loan EMI calculator', 'fieldwren' ), __( 'Monthly instalment and total interest from amount, rate and term.', 'fieldwren' ), self::pair( self::num( __( 'Loan amount', 'fieldwren' ), 'amount', array( 'min' => 1000, 'default_value' => '250000', 'prefix' => '$' ) ), self::num( __( 'Interest rate (% per year)', 'fieldwren' ), 'rate', array( 'min' => 0.1, 'max' => 40, 'step' => '0.1', 'default_value' => '9' ) ) ) . self::b( 'range', array( 'label' => __( 'Term (years)', 'fieldwren' ), 'name' => 'years', 'min' => 1, 'max' => 30, 'step' => 1, 'default_value' => '5', 'suffix' => ' yrs' ) ) . self::pair( self::b( 'calculation', array( 'label' => __( 'Monthly payment', 'fieldwren' ), 'name' => 'emi', 'formula' => '{inputs.amount} * ({inputs.rate}/1200) * (1+{inputs.rate}/1200)^({inputs.years}*12) / ((1+{inputs.rate}/1200)^({inputs.years}*12) - 1)', 'decimals' => 2, 'prefix' => '$' ) ), self::b( 'calculation', array( 'label' => __( 'Total interest', 'fieldwren' ), 'name' => 'interest', 'formula' => '{inputs.emi} * {inputs.years} * 12 - {inputs.amount}', 'decimals' => 0, 'prefix' => '$' ) ) ) . self::email( __( 'Send me this breakdown', 'fieldwren' ) ) . self::submit( __( 'Email my plan', 'fieldwren' ) ) ); /* ---------------- Feedback & surveys ---------------- */ $add( 'feedback', 'feedback', __( 'Customer feedback (NPS)', 'fieldwren' ), __( 'Rating, Net Promoter Score and comments.', 'fieldwren' ), self::b( 'nps', array( 'name' => 'nps', 'required' => 'yes' ) ) . self::b( 'rating', array( 'label' => __( 'How would you rate our support?', 'fieldwren' ), 'name' => 'support_rating' ) ) . self::b( 'grid', array( 'label' => __( 'Rate us on', 'fieldwren' ), 'name' => 'grid' ) ) . self::ta( __( 'What should we improve?', 'fieldwren' ), 'improve' ) . self::submit( __( 'Send feedback', 'fieldwren' ) ) ); $add( 'bug-report', 'feedback', __( 'Report a bug', 'fieldwren' ), __( 'Severity, steps to reproduce, expected vs actual and a screenshot.', 'fieldwren' ), self::pair( self::name( __( 'Name', 'fieldwren' ) ), self::email() ) . self::b( 'url', array( 'label' => __( 'Where did it happen? (URL)', 'fieldwren' ), 'name' => 'page', 'default_value' => '{http_referer}' ) ) . self::toggle( __( 'Severity', 'fieldwren' ), 'severity', array( 'Low', 'Medium', 'High', 'Blocker' ), true ) . self::ta( __( 'Steps to reproduce', 'fieldwren' ), 'steps', true, array( 'placeholder' => "1. …\n2. …" ) ) . self::pair( self::ta( __( 'What did you expect?', 'fieldwren' ), 'expected', false, array( 'rows' => 3 ) ), self::ta( __( 'What happened instead?', 'fieldwren' ), 'actual', false, array( 'rows' => 3 ) ) ) . self::b( 'image', array( 'label' => __( 'Screenshot', 'fieldwren' ), 'name' => 'screenshot', 'max_files' => 3 ) ) . self::b( 'hidden', array( 'label' => 'Browser', 'name' => 'browser', 'capture' => '{browser.name}' ) ) . self::b( 'hidden', array( 'label' => 'Platform', 'name' => 'platform', 'default_value' => '{browser.platform}' ) ) . self::submit( __( 'Report bug', 'fieldwren' ) ), self::thanks( __( 'Thanks for the report! Our team will look into it.', 'fieldwren' ) ) ); $add( 'rating', 'feedback', __( 'Product rating', 'fieldwren' ), __( 'Stars, thumbs, would-recommend switch and a short review.', 'fieldwren' ), self::b( 'rating', array( 'label' => __( 'Overall rating', 'fieldwren' ), 'name' => 'stars', 'required' => 'yes', 'hint_labels' => 'Poor, Fair, Good, Very good, Excellent' ) ) . self::b( 'like', array( 'label' => __( 'Was it worth the price?', 'fieldwren' ), 'name' => 'worth' ) ) . self::b( 'switch', array( 'label' => __( 'Recommend', 'fieldwren' ), 'name' => 'recommend', 'switch_text' => __( 'I would recommend this to a friend', 'fieldwren' ) ) ) . self::text( __( 'Review title', 'fieldwren' ), 'review_title' ) . self::ta( __( 'Your review', 'fieldwren' ), 'review', false, array( 'rows' => 4 ) ) . self::submit( __( 'Post review', 'fieldwren' ) ) ); $add( 'suggestion', 'feedback', __( 'Suggestion box', 'fieldwren' ), __( 'Anonymous or named suggestions with a category.', 'fieldwren' ), self::b( 'switch', array( 'label' => __( 'Anonymous', 'fieldwren' ), 'name' => 'anonymous', 'switch_text' => __( 'Send without my name', 'fieldwren' ), 'on_value' => 'yes', 'off_value' => 'no' ) ) . self::when( 'anonymous', '!=', 'yes', array( self::pair( self::name( __( 'Name', 'fieldwren' ) ), self::email() ) ) ) . self::sel( __( 'Category', 'fieldwren' ), 'category', array( 'Product', 'Service', 'Workplace', 'Website', 'Other' ), true ) . self::ta( __( 'Your suggestion', 'fieldwren' ), 'suggestion', true, array( 'rows' => 5 ) ) . self::submit( __( 'Share idea', 'fieldwren' ) ), self::thanks( __( 'Thank you – every suggestion is read by the team.', 'fieldwren' ) ) ); /* ---------------- Conditional logic ---------------- */ $add( 'rsvp', 'conditional', __( 'Event RSVP', 'fieldwren' ), __( 'Yes shows guests and dietary needs; No asks for a reason.', 'fieldwren' ), self::pair( self::name(), self::email() ) . self::toggle( __( 'Will you attend?', 'fieldwren' ), 'attending', array( 'Yes', 'No' ), true ) . self::when( 'attending', '=', 'yes', array( self::num( __( 'Number of guests (including you)', 'fieldwren' ), 'guests', array( 'min' => 1, 'max' => 6, 'default_value' => '1' ) ), self::chk( __( 'Dietary needs', 'fieldwren' ), 'dietary', array( 'Vegetarian', 'Vegan', 'Halal', 'Gluten-free', 'Nut allergy' ), 'buttons' ), ) ) . self::when( 'attending', '=', 'no', array( self::ta( __( 'Sorry to miss you – anything we should know?', 'fieldwren' ), 'reason', false, array( 'rows' => 3 ) ) ) ) . self::submit( __( 'Send RSVP', 'fieldwren' ) ) ); $add( 'insurance', 'conditional', __( 'Insurance quote', 'fieldwren' ), __( 'Car, home or life – each type shows its own questions.', 'fieldwren' ), self::radio( __( 'What would you like to insure?', 'fieldwren' ), 'cover', array( 'Car', 'Home', 'Life' ), 'cards', true ) . self::when( 'cover', '=', 'car', array( self::pair( self::text( __( 'Make & model', 'fieldwren' ), 'car_model', true ), self::num( __( 'Year', 'fieldwren' ), 'car_year', array( 'min' => 1980, 'max' => 2030 ) ) ), self::radio( __( 'Claims in the last 5 years', 'fieldwren' ), 'car_claims', array( 'None', '1', '2 or more' ), 'buttons' ) ) ) . self::when( 'cover', '=', 'home', array( self::b( 'address', array( 'label' => __( 'Property address', 'fieldwren' ), 'name' => 'property', 'required' => 'yes' ) ), self::pair( self::sel( __( 'Property type', 'fieldwren' ), 'home_type', array( 'Apartment', 'House', 'Townhouse' ) ), self::num( __( 'Rebuild value', 'fieldwren' ), 'home_value', array( 'prefix' => '$' ) ) ) ) ) . self::when( 'cover', '=', 'life', array( self::pair( self::date( __( 'Date of birth', 'fieldwren' ), 'dob', true, array( 'max_date' => '-18 years' ) ), self::b( 'switch', array( 'label' => __( 'Smoker', 'fieldwren' ), 'name' => 'smoker', 'switch_text' => __( 'I smoke', 'fieldwren' ) ) ) ), self::b( 'range', array( 'label' => __( 'Cover amount', 'fieldwren' ), 'name' => 'cover_amount', 'min' => 50000, 'max' => 2000000, 'step' => 50000, 'prefix' => '$' ) ) ) ) . self::pair( self::name(), self::email() ) . self::phone( '', 'phone', true ) . self::submit( __( 'Get my quote', 'fieldwren' ) ) ); $add( 'service-request', 'conditional', __( 'Service request', 'fieldwren' ), __( 'The service picked decides which details are asked for.', 'fieldwren' ), self::sel( __( 'Service', 'fieldwren' ), 'service', array( 'Repair', 'Installation', 'Maintenance', 'Consultation' ), true ) . self::when( 'service', '=', 'repair', array( self::text( __( 'What is broken?', 'fieldwren' ), 'broken', true ), self::b( 'image', array( 'label' => __( 'Photo of the problem', 'fieldwren' ), 'name' => 'photo' ) ) ) ) . self::when( 'service', '=', 'installation', array( self::text( __( 'What should we install?', 'fieldwren' ), 'install_item', true ), self::date( __( 'Preferred date', 'fieldwren' ), 'install_date', false, array( 'min_date' => '+2 days', 'no_weekends' => 'yes' ) ) ) ) . self::when( 'service', '=', 'maintenance', array( self::radio( __( 'How often?', 'fieldwren' ), 'frequency', array( 'One-off', 'Monthly', 'Quarterly', 'Yearly' ), 'buttons' ) ) ) . self::when( 'service', '=', 'consultation', array( self::ta( __( 'Topic', 'fieldwren' ), 'topic', true, array( 'rows' => 3 ) ) ) ) . self::b( 'address', array( 'label' => __( 'Service address', 'fieldwren' ), 'name' => 'address' ) ) . self::pair( self::name(), self::phone( '', 'phone', true ) ) . self::submit( __( 'Request service', 'fieldwren' ) ) ); $add( 'shipping', 'conditional', __( 'Shipping request', 'fieldwren' ), __( 'Domestic or international – customs fields appear for international.', 'fieldwren' ), self::toggle( __( 'Shipment', 'fieldwren' ), 'scope', array( 'Domestic', 'International' ), true ) . self::pair( self::num( __( 'Weight (kg)', 'fieldwren' ), 'weight', array( 'min' => 0.1, 'step' => '0.1', 'required' => 'yes' ) ), self::sel( __( 'Package type', 'fieldwren' ), 'package', array( 'Envelope', 'Box', 'Pallet' ) ) ) . self::when( 'scope', '=', 'international', array( self::b( 'country', array( 'label' => __( 'Destination country', 'fieldwren' ), 'name' => 'destination', 'required' => 'yes' ) ), self::pair( self::num( __( 'Declared value', 'fieldwren' ), 'customs_value', array( 'prefix' => '$', 'required' => 'yes' ) ), self::text( __( 'HS code (if known)', 'fieldwren' ), 'hs_code' ) ), self::ta( __( 'Contents description', 'fieldwren' ), 'contents', true, array( 'rows' => 2 ) ) ) ) . self::b( 'address', array( 'label' => __( 'Pickup address', 'fieldwren' ), 'name' => 'pickup', 'required' => 'yes' ) ) . self::pair( self::name(), self::email() ) . self::submit( __( 'Request pickup', 'fieldwren' ) ) ); $add( 'membership', 'conditional', __( 'Membership sign-up', 'fieldwren' ), __( 'Individual or company membership with company-only fields.', 'fieldwren' ), self::radio( __( 'Membership type', 'fieldwren' ), 'member_type', array( 'Individual', 'Company' ), 'cards', true ) . self::pair( self::name(), self::email() ) . self::when( 'member_type', '=', 'company', array( self::pair( self::text( __( 'Company name', 'fieldwren' ), 'company', true ), self::text( __( 'VAT / tax ID', 'fieldwren' ), 'tax_id' ) ), self::num( __( 'Seats', 'fieldwren' ), 'seats', array( 'min' => 2, 'default_value' => '5' ) ) ) ) . self::toggle( __( 'Billing', 'fieldwren' ), 'billing', array( 'Monthly', 'Yearly' ) ) . self::consent() . self::submit( __( 'Join', 'fieldwren' ) ) ); $add( 'contact-preference', 'conditional', __( 'Callback request', 'fieldwren' ), __( 'Choose phone, WhatsApp or email – only that detail is asked for.', 'fieldwren' ), self::name() . self::radio( __( 'How should we contact you?', 'fieldwren' ), 'channel', array( 'Phone', 'WhatsApp', 'Email' ), 'buttons', true ) . self::b( 'phone', self::cond( array( 'label' => __( 'Phone number', 'fieldwren' ), 'name' => 'phone', 'required' => 'yes' ), 'channel', 'in', 'phone, whatsapp' ) ) . self::b( 'email', self::cond( array( 'label' => __( 'Email', 'fieldwren' ), 'name' => 'email', 'required' => 'yes' ), 'channel', '=', 'email' ) ) . self::b( 'select', self::cond( array( 'label' => __( 'Best time to call', 'fieldwren' ), 'name' => 'best_time', 'options' => self::opts( array( 'Morning', 'Afternoon', 'Evening' ) ) ), 'channel', '=', 'phone' ) ) . self::submit( __( 'Request callback', 'fieldwren' ) ) ); /* ---------------- Events & bookings ---------------- */ $add( 'event-registration', 'events', __( 'Event registration', 'fieldwren' ), __( 'Ticket type, attendees, sessions, dietary needs and consent.', 'fieldwren' ), self::radio( __( 'Ticket', 'fieldwren' ), 'ticket', array( 'General admission', 'VIP', 'Student' ), 'cards', true ) . self::pair( self::name(), self::email() ) . self::pair( self::text( __( 'Organisation', 'fieldwren' ), 'organisation' ), self::num( __( 'Number of attendees', 'fieldwren' ), 'attendees', array( 'min' => 1, 'max' => 10, 'default_value' => '1' ) ) ) . self::chk( __( 'Sessions you plan to join', 'fieldwren' ), 'sessions', array( 'Keynote', 'Workshop A', 'Workshop B', 'Networking dinner' ), 'col-2' ) . self::sel( __( 'Dietary requirements', 'fieldwren' ), 'diet', array( 'None', 'Vegetarian', 'Vegan', 'Halal', 'Gluten-free' ) ) . self::consent() . self::submit( __( 'Register', 'fieldwren' ), 'justify' ), self::thanks( __( 'See you there! Your {inputs.ticket} ticket details are on their way.', 'fieldwren' ) ) ); $add( 'appointment', 'events', __( 'Appointment booking', 'fieldwren' ), __( 'Service, weekday date, time slot and contact details.', 'fieldwren' ), self::sel( __( 'Service', 'fieldwren' ), 'service', array( 'Consultation (30 min)', 'Full session (60 min)', 'Follow-up (15 min)' ), true ) . self::pair( self::date( __( 'Date', 'fieldwren' ), 'date', true, array( 'min_date' => 'tomorrow', 'max_date' => '+2 months', 'no_weekends' => 'yes' ) ), self::sel( __( 'Time', 'fieldwren' ), 'time', array( '09:00', '10:00', '11:00', '12:00', '14:00', '15:00', '16:00' ), true ) ) . self::pair( self::name(), self::phone( '', 'phone', true ) ) . self::email() . self::ta( __( 'Notes', 'fieldwren' ), 'notes', false, array( 'rows' => 3 ) ) . self::submit( __( 'Book appointment', 'fieldwren' ) ), self::thanks( __( 'Booked! {inputs.service} on {inputs.date} at {inputs.time}. We will confirm by email.', 'fieldwren' ) ) ); $add( 'restaurant', 'events', __( 'Restaurant reservation', 'fieldwren' ), __( 'Date, time, party size, seating and occasion.', 'fieldwren' ), self::row( array( self::date( __( 'Date', 'fieldwren' ), 'date', true, array( 'min_date' => 'today' ) ), self::sel( __( 'Time', 'fieldwren' ), 'time', array( '18:00', '18:30', '19:00', '19:30', '20:00', '20:30', '21:00' ), true ), self::num( __( 'Guests', 'fieldwren' ), 'guests', array( 'min' => 1, 'max' => 12, 'default_value' => '2', 'required' => 'yes' ) ) ) ) . self::toggle( __( 'Seating', 'fieldwren' ), 'seating', array( 'Indoor', 'Terrace', 'No preference' ) ) . self::sel( __( 'Occasion', 'fieldwren' ), 'occasion', array( 'None', 'Birthday', 'Anniversary', 'Business dinner', 'Date night' ) ) . self::pair( self::name(), self::phone( '', 'phone', true ) ) . self::email() . self::ta( __( 'Special requests', 'fieldwren' ), 'requests', false, array( 'rows' => 2 ) ) . self::submit( __( 'Reserve a table', 'fieldwren' ), 'justify' ), self::thanks( __( 'Table requested for {inputs.guests} on {inputs.date} at {inputs.time}. We will text you to confirm.', 'fieldwren' ) ) ); /* ---------------- Applications ---------------- */ $add( 'job', 'applications', __( 'Job application', 'fieldwren' ), __( 'Position, CV upload, LinkedIn and cover letter.', 'fieldwren' ), self::name() . self::pair( self::email(), self::phone( '', 'phone', true ) ) . self::sel( __( 'Position', 'fieldwren' ), 'position', array( 'Software Engineer', 'QA Engineer', 'Project Manager', 'UI/UX Designer' ), true ) . self::b( 'url', array( 'label' => __( 'LinkedIn profile', 'fieldwren' ), 'name' => 'linkedin' ) ) . self::b( 'file', array( 'label' => __( 'CV / Resume', 'fieldwren' ), 'name' => 'cv', 'required' => 'yes', 'allowed' => 'pdf,doc,docx', 'max_size' => 5 ) ) . self::ta( __( 'Cover letter', 'fieldwren' ), 'cover_letter' ) . self::submit( __( 'Apply', 'fieldwren' ) ) ); $add( 'job-listing', 'applications', __( 'Post a job', 'fieldwren' ), __( 'Employers submit a vacancy (pair with a Post feed to publish it).', 'fieldwren' ), self::pair( self::text( __( 'Company', 'fieldwren' ), 'company', true ), self::b( 'url', array( 'label' => __( 'Company website', 'fieldwren' ), 'name' => 'website' ) ) ) . self::text( __( 'Job title', 'fieldwren' ), 'job_title', true ) . self::row( array( self::sel( __( 'Type', 'fieldwren' ), 'job_type', array( 'Full-time', 'Part-time', 'Contract', 'Internship' ), true ), self::text( __( 'Location', 'fieldwren' ), 'location' ), self::b( 'switch', array( 'label' => __( 'Remote', 'fieldwren' ), 'name' => 'remote', 'switch_text' => __( 'Remote friendly', 'fieldwren' ) ) ) ) ) . self::pair( self::num( __( 'Salary from', 'fieldwren' ), 'salary_min', array( 'prefix' => '$' ) ), self::num( __( 'Salary to', 'fieldwren' ), 'salary_max', array( 'prefix' => '$' ) ) ) . self::b( 'richtext', array( 'label' => __( 'Job description', 'fieldwren' ), 'name' => 'description', 'required' => 'yes' ) ) . self::pair( self::b( 'url', array( 'label' => __( 'How to apply (URL)', 'fieldwren' ), 'name' => 'apply_url' ) ), self::email( __( 'Contact email', 'fieldwren' ) ) ) . self::date( __( 'Closing date', 'fieldwren' ), 'closing', false, array( 'min_date' => 'today' ) ) . self::submit( __( 'Submit vacancy', 'fieldwren' ) ) ); $add( 'volunteer', 'applications', __( 'Volunteer application', 'fieldwren' ), __( 'Interests, skills, availability and an emergency contact.', 'fieldwren' ), self::pair( self::name(), self::email() ) . self::pair( self::phone( '', 'phone', true ), self::date( __( 'Date of birth', 'fieldwren' ), 'dob' ) ) . self::chk( __( 'Areas you would like to help with', 'fieldwren' ), 'areas', array( 'Events', 'Fundraising', 'Teaching', 'Outreach', 'Admin', 'Social media' ), 'buttons', true ) . self::ta( __( 'Relevant skills or experience', 'fieldwren' ), 'skills', false, array( 'rows' => 3 ) ) . self::b( 'grid', array( 'label' => __( 'When are you available?', 'fieldwren' ), 'name' => 'availability', 'grid_type' => 'checkbox', 'rows' => "Weekday mornings\nWeekday evenings\nWeekends", 'columns' => "Weekly\nMonthly\nOccasionally" ) ) . self::section( __( 'Emergency contact', 'fieldwren' ) ) . self::pair( self::text( __( 'Name', 'fieldwren' ), 'emergency_name', true ), self::phone( __( 'Phone', 'fieldwren' ), 'emergency_phone', true ) ) . self::consent() . self::submit( __( 'Sign me up', 'fieldwren' ) ) ); $add( 'volunteer-steps', 'applications', __( 'Volunteer sign-up (steps)', 'fieldwren' ), __( 'Three short steps with a weekly availability picker.', 'fieldwren' ), self::pair( self::name(), self::email() ) . self::phone() . self::step( __( 'Availability', 'fieldwren' ), __( 'About you', 'fieldwren' ) ) . self::chk( __( 'Days', 'fieldwren' ), 'days', array( 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun' ), 'buttons', true ) . self::toggle( __( 'Time of day', 'fieldwren' ), 'time_of_day', array( 'Morning', 'Afternoon', 'Evening' ) ) . self::b( 'range', array( 'label' => __( 'Hours per month', 'fieldwren' ), 'name' => 'hours', 'min' => 2, 'max' => 40, 'step' => 2, 'default_value' => '8' ) ) . self::step( __( 'Interests', 'fieldwren' ) ) . self::chk( __( 'I would enjoy…', 'fieldwren' ), 'interests', array( 'Working with children', 'Elderly care', 'Environment', 'Animal welfare', 'Events' ), 'col-2' ) . self::ta( __( 'Anything else?', 'fieldwren' ), 'notes', false, array( 'rows' => 3 ) ) . self::submit( __( 'Join the team', 'fieldwren' ) ) ); $add( 'loan-application', 'applications', __( 'Loan application', 'fieldwren' ), __( 'Personal, employment and loan details over three steps with a signature.', 'fieldwren' ), self::name( '', 'first_last' ) . self::pair( self::email(), self::phone( '', 'phone', true ) ) . self::pair( self::date( __( 'Date of birth', 'fieldwren' ), 'dob', true, array( 'max_date' => '-18 years' ) ), self::sel( __( 'Marital status', 'fieldwren' ), 'marital', array( 'Single', 'Married', 'Other' ) ) ) . self::b( 'address', array( 'label' => __( 'Home address', 'fieldwren' ), 'name' => 'address', 'required' => 'yes' ) ) . self::step( __( 'Employment', 'fieldwren' ), __( 'Personal details', 'fieldwren' ) ) . self::radio( __( 'Employment status', 'fieldwren' ), 'employment', array( 'Employed', 'Self-employed', 'Retired', 'Student' ), 'buttons', true ) . self::b( 'text', self::cond( array( 'label' => __( 'Employer', 'fieldwren' ), 'name' => 'employer', 'required' => 'yes' ), 'employment', '=', 'employed' ) ) . self::num( __( 'Monthly income', 'fieldwren' ), 'income', array( 'prefix' => '$', 'required' => 'yes' ) ) . self::step( __( 'Loan', 'fieldwren' ) ) . self::sel( __( 'Purpose', 'fieldwren' ), 'purpose', array( 'Home', 'Car', 'Education', 'Business', 'Personal' ), true ) . self::pair( self::num( __( 'Amount', 'fieldwren' ), 'amount', array( 'prefix' => '$', 'min' => 1000, 'required' => 'yes' ) ), self::sel( __( 'Term', 'fieldwren' ), 'term', array( '12 months', '24 months', '36 months', '60 months' ), true ) ) . self::b( 'file', array( 'label' => __( 'Proof of income', 'fieldwren' ), 'name' => 'documents', 'max_files' => 3, 'allowed' => 'pdf,jpg,jpeg,png' ) ) . self::consent( __( 'I confirm the information is accurate and allow a credit check.', 'fieldwren' ) ) . self::b( 'signature', array( 'label' => __( 'Signature', 'fieldwren' ), 'name' => 'signature', 'required' => 'yes' ) ) . self::submit( __( 'Submit application', 'fieldwren' ) ) ); $add( 'admission', 'applications', __( 'School / course admission', 'fieldwren' ), __( 'Student, guardian, programme and documents in three steps.', 'fieldwren' ), self::name( __( 'Student name', 'fieldwren' ), 'first_last' ) . self::pair( self::date( __( 'Date of birth', 'fieldwren' ), 'dob', true ), self::sel( __( 'Gender', 'fieldwren' ), 'gender', array( 'Female', 'Male', 'Other', 'Prefer not to say' ) ) ) . self::pair( self::email(), self::phone() ) . self::step( __( 'Guardian', 'fieldwren' ), __( 'Student', 'fieldwren' ) ) . self::pair( self::text( __( 'Guardian name', 'fieldwren' ), 'guardian_name', true ), self::sel( __( 'Relationship', 'fieldwren' ), 'relationship', array( 'Mother', 'Father', 'Legal guardian', 'Other' ) ) ) . self::pair( self::email( __( 'Guardian email', 'fieldwren' ), 'guardian_email' ), self::phone( __( 'Guardian phone', 'fieldwren' ), 'guardian_phone', true ) ) . self::step( __( 'Programme', 'fieldwren' ) ) . self::sel( __( 'Programme', 'fieldwren' ), 'programme', array( 'Science', 'Commerce', 'Arts', 'Computer science' ), true ) . self::toggle( __( 'Intake', 'fieldwren' ), 'intake', array( 'Spring', 'Autumn' ) ) . self::text( __( 'Previous school', 'fieldwren' ), 'previous_school' ) . self::b( 'file', array( 'label' => __( 'Transcripts & ID', 'fieldwren' ), 'name' => 'documents', 'max_files' => 5, 'allowed' => 'pdf,jpg,jpeg,png' ) ) . self::consent() . self::submit( __( 'Apply for admission', 'fieldwren' ) ) ); /* ---------------- Orders & payments ---------------- */ $add( 'order', 'orders', __( 'Product order with payment', 'fieldwren' ), __( 'Pick a package, quantity and payment method; live order summary.', 'fieldwren' ), self::b( 'payment-item', array( 'label' => __( 'Package', 'fieldwren' ), 'name' => 'package', 'price_type' => 'radio', 'required' => 'yes', 'options' => self::opts( array( 'Starter', 'Professional', 'Business' ), array( 29, 79, 149 ) ) ) ) . self::b( 'item-quantity', array( 'label' => __( 'Quantity', 'fieldwren' ), 'name' => 'quantity', 'target' => 'package' ) ) . self::pair( self::name(), self::email() ) . self::b( 'payment-method', array( 'label' => __( 'Pay with', 'fieldwren' ), 'name' => 'method' ) ) . self::b( 'payment-summary', array() ) . self::submit( __( 'Pay now', 'fieldwren' ), 'justify' ) ); $add( 'bulk-order', 'orders', __( 'Bulk order request', 'fieldwren' ), __( 'Several products and quantities, delivery date and address – no payment.', 'fieldwren' ), self::pair( self::text( __( 'Company', 'fieldwren' ), 'company', true ), self::name( __( 'Contact name', 'fieldwren' ) ) ) . self::pair( self::email(), self::phone( '', 'phone', true ) ) . self::b( 'repeater', array( 'label' => __( 'Products', 'fieldwren' ), 'name' => 'items', 'min_rows' => 1, 'max_rows' => 25, 'add_text' => __( '+ Add product', 'fieldwren' ) ), array( self::text( __( 'Product / SKU', 'fieldwren' ), 'product', true, array( 'width' => '66' ) ), self::num( __( 'Qty', 'fieldwren' ), 'qty', array( 'min' => 1, 'width' => '33', 'required' => 'yes' ) ) ) ) . self::date( __( 'Needed by', 'fieldwren' ), 'needed_by', false, array( 'min_date' => '+3 days' ) ) . self::b( 'address', array( 'label' => __( 'Delivery address', 'fieldwren' ), 'name' => 'delivery', 'required' => 'yes' ) ) . self::submit( __( 'Request pricing', 'fieldwren' ) ) ); /* ---------------- Newsletter ---------------- */ $add( 'newsletter', 'newsletter', __( 'Newsletter signup', 'fieldwren' ), __( 'Email and button on one line.', 'fieldwren' ), self::c( array( 'flex_direction' => 'row', 'flex_align_items' => 'flex-end' ), array( self::c( array( 'width' => array( 'size' => 70, 'unit' => '%' ), 'width_mobile' => array( 'size' => 100, 'unit' => '%' ) ), array( self::email( __( 'Email', 'fieldwren' ), 'email', array( 'label_placement' => 'hidden', 'placeholder' => __( 'you@company.com', 'fieldwren' ) ) ) ) ), self::c( array( 'width' => array( 'size' => 30, 'unit' => '%' ), 'width_mobile' => array( 'size' => 100, 'unit' => '%' ) ), array( self::submit( __( 'Subscribe', 'fieldwren' ), 'justify' ) ) ), ) ), self::thanks( __( 'You are in! Check your inbox for a welcome email.', 'fieldwren' ) ) ); $add( 'subscribe-interests', 'newsletter', __( 'Subscribe with interests', 'fieldwren' ), __( 'Topics, frequency and marketing consent.', 'fieldwren' ), self::pair( self::text( __( 'First name', 'fieldwren' ), 'first_name' ), self::email() ) . self::chk( __( 'Topics', 'fieldwren' ), 'topics', array( 'Product news', 'Guides & tutorials', 'Case studies', 'Events', 'Offers' ), 'buttons', true ) . self::toggle( __( 'How often?', 'fieldwren' ), 'frequency', array( 'Weekly', 'Monthly' ) ) . self::consent( __( 'I agree to receive emails and can unsubscribe at any time.', 'fieldwren' ), 'consent', 'marketing' ) . self::submit( __( 'Subscribe', 'fieldwren' ), 'justify' ) ); /* ---------------- Healthcare ---------------- */ $add( 'patient-intake', 'health', __( 'Patient intake', 'fieldwren' ), __( 'Personal details, insurance, symptoms, medications and consent.', 'fieldwren' ), self::section( __( 'Patient', 'fieldwren' ) ) . self::name( '', 'first_last' ) . self::row( array( self::date( __( 'Date of birth', 'fieldwren' ), 'dob', true ), self::sel( __( 'Sex', 'fieldwren' ), 'sex', array( 'Female', 'Male', 'Other' ) ), self::phone( '', 'phone', true ) ) ) . self::email() . self::b( 'address', array( 'label' => __( 'Address', 'fieldwren' ), 'name' => 'address' ) ) . self::section( __( 'Visit', 'fieldwren' ) ) . self::ta( __( 'Reason for visit / symptoms', 'fieldwren' ), 'symptoms', true, array( 'rows' => 3 ) ) . self::pair( self::text( __( 'Allergies', 'fieldwren' ), 'allergies' ), self::text( __( 'Insurance provider', 'fieldwren' ), 'insurance' ) ) . self::b( 'repeater', array( 'label' => __( 'Current medications', 'fieldwren' ), 'name' => 'medications', 'min_rows' => 0, 'max_rows' => 10, 'add_text' => __( '+ Add medication', 'fieldwren' ) ), array( self::text( __( 'Medication', 'fieldwren' ), 'drug', false, array( 'width' => '50' ) ), self::text( __( 'Dose', 'fieldwren' ), 'dose', false, array( 'width' => '50' ) ) ) ) . self::section( __( 'Emergency contact', 'fieldwren' ) ) . self::pair( self::text( __( 'Name', 'fieldwren' ), 'emergency_name', true ), self::phone( __( 'Phone', 'fieldwren' ), 'emergency_phone', true ) ) . self::consent( __( 'I consent to treatment and to the storage of my health information for this purpose.', 'fieldwren' ), 'consent', 'gdpr' ) . self::b( 'signature', array( 'label' => __( 'Signature', 'fieldwren' ), 'name' => 'signature', 'required' => 'yes' ) ) . self::submit( __( 'Submit', 'fieldwren' ) ) ); /* ---------------- HR & internal ---------------- */ $add( 'leave-request', 'hr', __( 'Leave request', 'fieldwren' ), __( 'Leave type, dates, cover and manager approval.', 'fieldwren' ), self::pair( self::name( __( 'Employee name', 'fieldwren' ) ), self::text( __( 'Employee ID', 'fieldwren' ), 'employee_id', true ) ) . self::pair( self::sel( __( 'Department', 'fieldwren' ), 'department', array( 'Engineering', 'Sales', 'Marketing', 'Finance', 'HR', 'Operations' ), true ), self::sel( __( 'Leave type', 'fieldwren' ), 'leave_type', array( 'Annual', 'Sick', 'Casual', 'Parental', 'Unpaid' ), true ) ) . self::pair( self::date( __( 'From', 'fieldwren' ), 'from', true ), self::date( __( 'To', 'fieldwren' ), 'to', true ) ) . self::b( 'switch', array( 'label' => __( 'Half day', 'fieldwren' ), 'name' => 'half_day', 'switch_text' => __( 'This is a half-day request', 'fieldwren' ) ) ) . self::ta( __( 'Reason', 'fieldwren' ), 'reason', false, array( 'rows' => 3 ) ) . self::pair( self::text( __( 'Who covers for you?', 'fieldwren' ), 'cover' ), self::email( __( 'Manager email', 'fieldwren' ), 'manager_email' ) ) . self::submit( __( 'Request leave', 'fieldwren' ) ), array_merge( self::thanks( __( 'Leave request sent to your manager.', 'fieldwren' ) ), array( 'admin_approval' => array( 'enabled' => true ) ) ) ); $add( 'expense-claim', 'hr', __( 'Expense claim', 'fieldwren' ), __( 'Category, amount, receipt upload and approval.', 'fieldwren' ), self::pair( self::name( __( 'Employee name', 'fieldwren' ) ), self::email( __( 'Work email', 'fieldwren' ) ) ) . self::row( array( self::sel( __( 'Category', 'fieldwren' ), 'category', array( 'Travel', 'Meals', 'Accommodation', 'Equipment', 'Training', 'Other' ), true ), self::date( __( 'Date of expense', 'fieldwren' ), 'expense_date', true, array( 'max_date' => 'today' ) ), self::num( __( 'Amount', 'fieldwren' ), 'amount', array( 'prefix' => '$', 'required' => 'yes', 'min' => 0.01, 'step' => '0.01' ) ) ) ) . self::text( __( 'Project / client', 'fieldwren' ), 'project' ) . self::b( 'file', array( 'label' => __( 'Receipt', 'fieldwren' ), 'name' => 'receipt', 'required' => 'yes', 'allowed' => 'pdf,jpg,jpeg,png', 'max_files' => 5 ) ) . self::ta( __( 'Notes', 'fieldwren' ), 'notes', false, array( 'rows' => 2 ) ) . self::consent( __( 'I confirm this expense was incurred for business purposes.', 'fieldwren' ) ) . self::submit( __( 'Submit claim', 'fieldwren' ) ), array( 'admin_approval' => array( 'enabled' => true ) ) ); $add( 'it-request', 'hr', __( 'IT help request', 'fieldwren' ), __( 'Issue type, urgency, device and screenshot for the IT desk.', 'fieldwren' ), self::pair( self::name( __( 'Your name', 'fieldwren' ) ), self::email( __( 'Work email', 'fieldwren' ) ) ) . self::radio( __( 'Issue type', 'fieldwren' ), 'issue', array( 'Hardware', 'Software', 'Network / VPN', 'Access request', 'Other' ), 'buttons', true ) . self::toggle( __( 'Urgency', 'fieldwren' ), 'urgency', array( 'Low', 'Normal', 'Urgent' ), true ) . self::b( 'text', self::cond( array( 'label' => __( 'Device / asset tag', 'fieldwren' ), 'name' => 'asset' ), 'issue', '=', 'hardware' ) ) . self::b( 'text', self::cond( array( 'label' => __( 'System or app you need access to', 'fieldwren' ), 'name' => 'system', 'required' => 'yes' ), 'issue', '=', 'access-request' ) ) . self::ta( __( 'Describe the problem', 'fieldwren' ), 'description', true, array( 'rows' => 4 ) ) . self::b( 'image', array( 'label' => __( 'Screenshot', 'fieldwren' ), 'name' => 'screenshot' ) ) . self::submit( __( 'Send to IT', 'fieldwren' ) ) ); /* ---------------- Support & privacy ---------------- */ $add( 'support', 'support', __( 'Support ticket', 'fieldwren' ), __( 'Priority, department routing and screenshot.', 'fieldwren' ), self::pair( self::name(), self::email() ) . self::pair( self::sel( __( 'Department', 'fieldwren' ), 'department', array( 'Technical', 'Billing', 'Sales' ), true ), self::radio( __( 'Priority', 'fieldwren' ), 'priority', array( 'Low', 'Normal', 'Urgent' ), 'buttons' ) ) . self::text( __( 'Subject', 'fieldwren' ), 'subject', true ) . self::ta( __( 'Describe the issue', 'fieldwren' ), 'description', true ) . self::b( 'image', array( 'label' => __( 'Screenshot', 'fieldwren' ), 'name' => 'screenshot', 'max_files' => 3 ) ) . self::submit( __( 'Open ticket', 'fieldwren' ) ), self::thanks( __( 'Ticket #{entry.serial} opened. We will reply to {inputs.email}.', 'fieldwren' ) ) ); $add( 'data-request', 'support', __( 'Personal data request (GDPR)', 'fieldwren' ), __( 'Access, correction, deletion or portability requests with email confirmation.', 'fieldwren' ), self::radio( __( 'What would you like to do?', 'fieldwren' ), 'request', array( 'Get a copy of my data', 'Correct my data', 'Delete my data', 'Move my data to another service' ), 'list', true ) . self::pair( self::name(), self::email( __( 'Email we hold for you', 'fieldwren' ) ) ) . self::b( 'textarea', self::cond( array( 'label' => __( 'What should be corrected?', 'fieldwren' ), 'name' => 'correction', 'required' => 'yes' ), 'request', '=', 'correct-my-data' ) ) . self::ta( __( 'Anything that helps us find your data', 'fieldwren' ), 'details', false, array( 'rows' => 3 ) ) . self::consent( __( 'I confirm I am the person this data belongs to, or authorised to act for them.', 'fieldwren' ), 'identity', 'gdpr' ) . self::submit( __( 'Send request', 'fieldwren' ) ), array_merge( self::thanks( __( 'Request received. Please confirm it from the email we just sent – we answer within 30 days.', 'fieldwren' ) ), array( 'double_optin' => array( 'enabled' => true, 'email_field' => 'email', 'skip_for_logged_in' => false ) ) ) ); /* ---------------- All elements ---------------- */ $add( 'all-elements', 'showcase', __( 'All form elements', 'fieldwren' ), __( 'Every field type in one form – handy for styling and testing.', 'fieldwren' ), self::section( __( 'Text inputs', 'fieldwren' ) ) . self::name( '', 'first_last' ) . self::pair( self::email(), self::phone() ) . self::pair( self::text( __( 'Text', 'fieldwren' ), 'text_field' ), self::b( 'url', array( 'label' => __( 'Website', 'fieldwren' ), 'name' => 'website' ) ) ) . self::pair( self::num( __( 'Number', 'fieldwren' ), 'number_field' ), self::b( 'password', array( 'label' => __( 'Password', 'fieldwren' ), 'name' => 'password' ) ) ) . self::ta( __( 'Textarea', 'fieldwren' ), 'textarea_field' ) . self::b( 'richtext', array( 'label' => __( 'Rich text', 'fieldwren' ), 'name' => 'richtext_field' ) ) . self::section( __( 'Choices', 'fieldwren' ) ) . self::pair( self::sel( __( 'Dropdown', 'fieldwren' ), 'select_field', array( 'One', 'Two', 'Three' ) ), self::b( 'country', array( 'label' => __( 'Country', 'fieldwren' ), 'name' => 'country' ) ) ) . self::pair( self::radio( __( 'Radio', 'fieldwren' ), 'radio_field', array( 'Yes', 'No', 'Maybe' ) ), self::chk( __( 'Checkboxes', 'fieldwren' ), 'checkbox_field', array( 'Red', 'Green', 'Blue' ) ) ) . self::toggle( __( 'Toggle select', 'fieldwren' ), 'toggle_field', array( 'Monthly', 'Yearly' ) ) . self::row( array( self::b( 'switch', array( 'label' => __( 'Switch', 'fieldwren' ), 'name' => 'switch_field' ) ), self::b( 'like', array( 'label' => __( 'Like / dislike', 'fieldwren' ), 'name' => 'like_field' ) ), self::b( 'color', array( 'label' => __( 'Colour', 'fieldwren' ), 'name' => 'color_field' ) ) ) ) . self::pair( self::b( 'rating', array( 'label' => __( 'Rating', 'fieldwren' ), 'name' => 'rating_field' ) ), self::b( 'range', array( 'label' => __( 'Range', 'fieldwren' ), 'name' => 'range_field' ) ) ) . self::b( 'nps', array( 'name' => 'nps_field' ) ) . self::b( 'grid', array( 'label' => __( 'Likert grid', 'fieldwren' ), 'name' => 'grid_field' ) ) . self::b( 'ranking', array( 'label' => __( 'Ranking', 'fieldwren' ), 'name' => 'ranking_field' ) ) . self::section( __( 'Advanced', 'fieldwren' ) ) . self::pair( self::date( __( 'Date', 'fieldwren' ), 'date_field' ), self::date( __( 'Time', 'fieldwren' ), 'time_field', false, array( 'mode' => 'time' ) ) ) . self::b( 'address', array( 'label' => __( 'Address', 'fieldwren' ), 'name' => 'address_field' ) ) . self::b( 'map', array( 'label' => __( 'Map location', 'fieldwren' ), 'name' => 'map_field' ) ) . self::b( 'file', array( 'label' => __( 'File upload', 'fieldwren' ), 'name' => 'file_field' ) ) . self::b( 'signature', array( 'label' => __( 'Signature', 'fieldwren' ), 'name' => 'signature_field' ) ) . self::b( 'calculation', array( 'label' => __( 'Calculation (number Γ— 2)', 'fieldwren' ), 'name' => 'calc_field', 'formula' => '{inputs.number_field} * 2', 'decimals' => 0 ) ) . self::b( 'repeater', array( 'label' => __( 'Repeater', 'fieldwren' ), 'name' => 'repeater_field' ), array( self::text( __( 'Item', 'fieldwren' ), 'item', false, array( 'width' => '50' ) ), self::num( __( 'Qty', 'fieldwren' ), 'qty', array( 'width' => '50' ) ) ) ) . self::b( 'html', array( 'html' => '

' . __( 'Custom HTML block', 'fieldwren' ) . ' – ' . __( 'any message or markup.', 'fieldwren' ) . '

' ) ) . self::b( 'summary', array( 'title' => __( 'Summary of your answers', 'fieldwren' ) ) ) . self::b( 'simple-captcha', array( 'name' => 'captcha' ) ) . self::consent() . self::submit( __( 'Submit', 'fieldwren' ) ) ); /* ================================================================ * Designed templates (gradient banners, split layouts, panels). * ================================================================ */ /* ---------------- Sales & marketing ---------------- */ $add( 'waitlist', 'lead', __( 'Product waitlist', 'fieldwren' ), __( 'Split layout: a gradient pitch with perks beside a short early-access form.', 'fieldwren' ), self::split( self::headline( __( 'Early access', 'fieldwren' ), __( 'Be first in line', 'fieldwren' ), __( 'We are opening the beta in small groups. Grab your spot – it takes 20 seconds.', 'fieldwren' ) ) . self::perks( array( __( 'Founding-member pricing, locked for life', 'fieldwren' ), __( 'Private beta before public launch', 'fieldwren' ), __( 'A direct line to the founders', 'fieldwren' ) ) ), array( self::pair( self::text( __( 'First name', 'fieldwren' ), 'first_name', true, array( 'autocomplete' => 'given-name' ) ), self::email() ), self::radio( __( 'You are…', 'fieldwren' ), 'role', array( 'Founder', 'Product', 'Engineering', 'Marketing', 'Other' ), 'buttons', true ), self::toggle( __( 'Team size', 'fieldwren' ), 'team_size', array( '1–10', '11–50', '51–200', '200+' ) ), self::ta( __( 'What would you use it for?', 'fieldwren' ), 'use_case', false, array( 'rows' => 3 ) ), self::submit( __( 'Join the waitlist', 'fieldwren' ), 'justify' ), self::note( __( 'No spam. One email when your invite is ready.', 'fieldwren' ) ), ) ), self::thanks( __( 'You are on the list! We will email {inputs.email} the moment your invite is ready.', 'fieldwren' ) ) ); $add( 'book-demo', 'lead', __( 'Book a demo', 'fieldwren' ), __( 'Gradient banner, interest cards and a weekday time picker for sales demos.', 'fieldwren' ), self::hero( __( 'Live demo', 'fieldwren' ), __( 'See it in action', 'fieldwren' ), __( 'A product specialist walks you through the parts that matter to your team.', 'fieldwren' ), array( __( '30-minute call', 'fieldwren' ), __( 'Tailored to you', 'fieldwren' ), __( 'No commitment', 'fieldwren' ) ) ) . self::pair( self::name( __( 'Your name', 'fieldwren' ) ), self::email( __( 'Work email', 'fieldwren' ), 'email', array( 'blocked_domains' => $free ) ) ) . self::pair( self::text( __( 'Company', 'fieldwren' ), 'company', true, array( 'autocomplete' => 'organization' ) ), self::phone() ) . self::radio( __( 'Team size', 'fieldwren' ), 'team_size', array( 'Just me', '2–10', '11–50', '51–250', '250+' ), 'buttons', true ) . self::chk( __( 'What do you want to see?', 'fieldwren' ), 'interests', array( 'πŸ“Š Reporting', 'πŸ€– Automation', 'πŸ”— Integrations', 'πŸ”’ Security & SSO' ), 'cards' ) . self::pair( self::date( __( 'Preferred day', 'fieldwren' ), 'day', true, array( 'min_date' => '+1 day', 'no_weekends' => 'yes' ) ), self::sel( __( 'Preferred time', 'fieldwren' ), 'slot', array( '09:00 – 10:00', '11:00 – 12:00', '14:00 – 15:00', '16:00 – 17:00' ), true ) ) . self::ta( __( 'Anything we should prepare?', 'fieldwren' ), 'notes', false, array( 'rows' => 3 ) ) . self::utm() . self::submit( __( 'Book my demo', 'fieldwren' ), 'justify' ), self::thanks( __( 'Booked! A calendar invite for {inputs.day} is on its way to {inputs.email}.', 'fieldwren' ) ) ); $add( 'lead-magnet', 'lead', __( 'Free guide download', 'fieldwren' ), __( 'Gated e-book or checklist: a cover-style pitch beside a three-field form.', 'fieldwren' ), self::split( self::headline( __( 'Free guide Β· 42 pages', 'fieldwren' ), __( 'The form conversion playbook', 'fieldwren' ), __( 'Everything we learned from 10,000 forms, boiled down to what actually lifts sign-ups.', 'fieldwren' ) ) . self::perks( array( __( '27 tested form patterns', 'fieldwren' ), __( 'Copy swipe file for buttons and errors', 'fieldwren' ), __( 'A one-page launch checklist', 'fieldwren' ) ) ), array( self::text( __( 'First name', 'fieldwren' ), 'first_name', true, array( 'autocomplete' => 'given-name' ) ), self::email( __( 'Work email', 'fieldwren' ) ), self::pair( self::sel( __( 'Role', 'fieldwren' ), 'role', array( 'Marketing', 'Product', 'Sales', 'Founder / exec', 'Other' ) ), self::sel( __( 'Company size', 'fieldwren' ), 'company_size', array( '1–10', '11–50', '51–200', '201–1000', '1000+' ) ) ), self::b( 'consent', array( 'name' => 'marketing', 'consent_type' => 'marketing', 'required' => '', 'consent_text' => __( 'Send me occasional tips and new guides.', 'fieldwren' ) ) ), self::submit( __( 'Send me the guide', 'fieldwren' ), 'justify' ), ) ), self::thanks( __( 'Check your inbox – the guide is on its way to {inputs.email}. (Add the download link to the notification email.)', 'fieldwren' ) ) ); $add( 'creator-collab', 'lead', __( 'Creator collaboration', 'fieldwren' ), __( 'Influencers and creators pitch a partnership: platforms, audience and rates.', 'fieldwren' ), self::split( self::headline( __( 'Creators', 'fieldwren' ), __( 'Let’s make something together', 'fieldwren' ), __( 'Tell us where your audience lives and what you love to make.', 'fieldwren' ) ) . self::perks( array( __( 'Paid partnerships and affiliate deals', 'fieldwren' ), __( 'Free product for honest reviews', 'fieldwren' ), __( 'Reply within five working days', 'fieldwren' ) ) ), array( self::pair( self::name(), self::email() ), self::chk( __( 'Where do you post?', 'fieldwren' ), 'platforms', array( 'πŸ“Έ Instagram', '▢️ YouTube', '🎡 TikTok', 'πŸ’Ό LinkedIn', 'πŸŽ™οΈ Podcast', '✍️ Blog' ), 'cards', true ), self::b( 'url', array( 'label' => __( 'Main channel link', 'fieldwren' ), 'name' => 'channel', 'required' => 'yes' ) ), self::toggle( __( 'Audience size', 'fieldwren' ), 'audience', array( 'Under 10k', '10k–50k', '50k–250k', '250k+' ), true ), self::pair( self::sel( __( 'Niche', 'fieldwren' ), 'niche', array( 'Tech', 'Lifestyle', 'Business', 'Fitness', 'Food', 'Travel', 'Gaming', 'Other' ) ), self::num( __( 'Typical rate per post', 'fieldwren' ), 'rate', array( 'prefix' => '$', 'min' => 0 ) ) ), self::ta( __( 'Your idea', 'fieldwren' ), 'pitch', true, array( 'rows' => 4 ) ), self::submit( __( 'Send my pitch', 'fieldwren' ), 'justify' ), ) ), self::thanks( __( 'Thanks {inputs.names}! Our partnerships team will reply within five working days.', 'fieldwren' ) ) ); $add( 'home-valuation', 'lead', __( 'Home valuation estimate', 'fieldwren' ), __( 'Property cards, size slider and an instant price range – then asks for contact details.', 'fieldwren' ), self::hero( __( 'Free valuation', 'fieldwren' ), __( 'What is your home worth?', 'fieldwren' ), __( 'Answer five quick questions for an instant estimate. A local agent can refine it for free.', 'fieldwren' ) ) . self::radio( __( 'Property type', 'fieldwren' ), 'type', array( '🏒 Apartment', '🏑 House', '🏘️ Townhouse', '🌳 Land' ), 'cards', true, array(), array( 230, 270, 250, 95 ) ) . self::radio( __( 'Bedrooms', 'fieldwren' ), 'bedrooms', array( 'Studio', '1', '2', '3', '4', '5+' ), 'buttons', true, array(), array( 0, 1, 2, 3, 4, 5 ) ) . self::b( 'range', array( 'label' => __( 'Floor area', 'fieldwren' ), 'name' => 'area', 'min' => 300, 'max' => 6000, 'step' => 50, 'default_value' => '1200', 'suffix' => ' sq ft' ) ) . self::radio( __( 'Condition', 'fieldwren' ), 'condition', array( 'Needs work', 'Good', 'Renovated' ), 'buttons', true, array(), array( 0.88, 1, 1.12 ) ) . self::panel( array( self::pair( self::b( 'calculation', array( 'label' => __( 'Estimated value from', 'fieldwren' ), 'name' => 'low', 'formula' => '({inputs.type} * {inputs.area} + {inputs.bedrooms} * 6000) * {inputs.condition} * 0.93', 'decimals' => 0, 'prefix' => '$' ) ), self::b( 'calculation', array( 'label' => __( 'to', 'fieldwren' ), 'name' => 'high', 'formula' => '({inputs.type} * {inputs.area} + {inputs.bedrooms} * 6000) * {inputs.condition} * 1.07', 'decimals' => 0, 'prefix' => '$' ) ) ), self::note( __( 'A guide based on typical prices per square foot – not a formal appraisal.', 'fieldwren' ) ), ) ) . self::b( 'address', array( 'label' => __( 'Property address', 'fieldwren' ), 'name' => 'address' ) ) . self::pair( self::name(), self::email() ) . self::phone() . self::submit( __( 'Get my free valuation', 'fieldwren' ), 'justify' ), self::thanks( __( 'Your estimate is {inputs.low} – {inputs.high}. A local agent will be in touch to fine-tune it.', 'fieldwren' ) ) ); /* ---------------- Events ---------------- */ $add( 'call-for-speakers', 'events', __( 'Call for speakers', 'fieldwren' ), __( 'Conference talk proposals: session format cards, level, abstract, bio and headshot.', 'fieldwren' ), self::hero( __( 'Call for papers', 'fieldwren' ), __( 'Share your story on stage', 'fieldwren' ), __( 'First-time speakers are warmly welcome – we offer mentoring and a rehearsal slot.', 'fieldwren' ), array( __( 'Travel covered', 'fieldwren' ), __( 'Free ticket', 'fieldwren' ), __( 'Speaker coaching', 'fieldwren' ) ) ) . self::section( __( 'About you', 'fieldwren' ) ) . self::pair( self::name(), self::email() ) . self::pair( self::text( __( 'Job title', 'fieldwren' ), 'job_title' ), self::text( __( 'Company', 'fieldwren' ), 'company' ) ) . self::section( __( 'Your session', 'fieldwren' ) ) . self::text( __( 'Talk title', 'fieldwren' ), 'talk_title', true, array( 'maxlength' => 90 ) ) . self::radio( __( 'Format', 'fieldwren' ), 'format', array( '🎀 Talk Β· 30 min', 'πŸ› οΈ Workshop Β· 90 min', 'πŸ’¬ Panel Β· 45 min', '⚑ Lightning Β· 5 min' ), 'cards', true ) . self::pair( self::toggle( __( 'Level', 'fieldwren' ), 'level', array( 'Beginner', 'Intermediate', 'Advanced' ), true ), self::sel( __( 'Track', 'fieldwren' ), 'track', array( 'Engineering', 'Design', 'Product', 'Data & AI', 'Leadership' ), true ) ) . self::ta( __( 'Abstract', 'fieldwren' ), 'abstract', true, array( 'rows' => 5, 'counter' => 'yes', 'maxlength' => 1200 ) ) . self::ta( __( 'Three things attendees will learn', 'fieldwren' ), 'takeaways', false, array( 'rows' => 3 ) ) . self::b( 'url', array( 'label' => __( 'Video of a previous talk (optional)', 'fieldwren' ), 'name' => 'video' ) ) . self::ta( __( 'Short bio', 'fieldwren' ), 'bio', true, array( 'rows' => 3 ) ) . self::b( 'image', array( 'label' => __( 'Headshot', 'fieldwren' ), 'name' => 'headshot', 'max_files' => 1 ) ) . self::consent() . self::submit( __( 'Submit proposal', 'fieldwren' ), 'justify' ), self::thanks( __( 'Proposal received! The programme committee replies to every submission.', 'fieldwren' ) ) ); /* ---------------- Travel & hospitality ---------------- */ $add( 'hotel-booking', 'hospitality', __( 'Hotel booking request', 'fieldwren' ), __( 'Room cards with nightly prices, extras and a live total for the stay.', 'fieldwren' ), self::hero( __( 'Reservations', 'fieldwren' ), __( 'Plan your stay', 'fieldwren' ), __( 'Pick your dates and room – we confirm availability within the hour.', 'fieldwren' ), array( __( 'Best rate guaranteed', 'fieldwren' ), __( 'Free cancellation 48h', 'fieldwren' ) ) ) . self::pair( self::date( __( 'Check-in', 'fieldwren' ), 'check_in', true, array( 'min_date' => 'today' ) ), self::date( __( 'Check-out', 'fieldwren' ), 'check_out', true, array( 'min_date' => '+1 day' ) ) ) . self::b( 'range', array( 'label' => __( 'Nights', 'fieldwren' ), 'name' => 'nights', 'min' => 1, 'max' => 21, 'step' => 1, 'default_value' => '3', 'suffix' => ' nights' ) ) . self::pair( self::num( __( 'Adults', 'fieldwren' ), 'adults', array( 'min' => 1, 'max' => 6, 'default_value' => '2' ) ), self::num( __( 'Children', 'fieldwren' ), 'children', array( 'min' => 0, 'max' => 6, 'default_value' => '0' ) ) ) . self::radio( __( 'Room (price per night)', 'fieldwren' ), 'room', array( 'πŸ›οΈ Classic Β· $120', 'πŸŒ… Sea view Β· $180', 'πŸ‘‘ Suite Β· $290' ), 'cards', true, array(), array( 120, 180, 290 ) ) . self::chk( __( 'Extras (per night)', 'fieldwren' ), 'extras', array( 'Breakfast +$18', 'Parking +$12', 'Late checkout +$10' ), 'buttons', false, array(), array( 18, 12, 10 ) ) . self::panel( array( self::b( 'calculation', array( 'label' => __( 'Estimated total', 'fieldwren' ), 'name' => 'total', 'formula' => '({inputs.room} + {inputs.extras}) * {inputs.nights}', 'decimals' => 0, 'prefix' => '$' ) ), self::note( __( 'Taxes are added at the hotel. Nothing is charged now.', 'fieldwren' ) ) ) ) . self::pair( self::name(), self::email() ) . self::phone( '', 'phone', true ) . self::ta( __( 'Special requests', 'fieldwren' ), 'requests', false, array( 'rows' => 3, 'placeholder' => __( 'Anniversary, cot, accessible room…', 'fieldwren' ) ) ) . self::submit( __( 'Request booking', 'fieldwren' ), 'justify' ), self::thanks( __( 'Request received for {inputs.nights} nights (est. {inputs.total}). We will confirm by email shortly.', 'fieldwren' ) ) ); /* ---------------- Calculators ---------------- */ $add( 'savings-planner', 'calc', __( 'Savings goal planner', 'fieldwren' ), __( 'Compound growth from a starting amount and monthly deposits, shown in a results panel.', 'fieldwren' ), self::intro( __( 'Calculator', 'fieldwren' ), __( 'How much will you have?', 'fieldwren' ), __( 'Move the sliders – the projection updates as you go.', 'fieldwren' ) ) . self::pair( self::num( __( 'Starting amount', 'fieldwren' ), 'start', array( 'prefix' => '$', 'min' => 0, 'default_value' => '5000' ) ), self::num( __( 'Yearly return (%)', 'fieldwren' ), 'rate', array( 'min' => 0.1, 'max' => 20, 'step' => '0.1', 'default_value' => '6' ) ) ) . self::b( 'range', array( 'label' => __( 'Monthly deposit', 'fieldwren' ), 'name' => 'monthly', 'min' => 50, 'max' => 5000, 'step' => 50, 'default_value' => '400', 'prefix' => '$' ) ) . self::b( 'range', array( 'label' => __( 'Years', 'fieldwren' ), 'name' => 'years', 'min' => 1, 'max' => 40, 'step' => 1, 'default_value' => '15', 'suffix' => ' yrs' ) ) . self::panel( array( self::row( array( self::b( 'calculation', array( 'label' => __( 'You will have', 'fieldwren' ), 'name' => 'future', 'formula' => '{inputs.start} * (1 + {inputs.rate}/1200)^({inputs.years}*12) + {inputs.monthly} * (((1 + {inputs.rate}/1200)^({inputs.years}*12) - 1) / ({inputs.rate}/1200))', 'decimals' => 0, 'prefix' => '$' ) ), self::b( 'calculation', array( 'label' => __( 'You put in', 'fieldwren' ), 'name' => 'deposits', 'formula' => '{inputs.start} + {inputs.monthly} * {inputs.years} * 12', 'decimals' => 0, 'prefix' => '$' ) ), self::b( 'calculation', array( 'label' => __( 'Growth', 'fieldwren' ), 'name' => 'growth', 'formula' => '{inputs.future} - {inputs.deposits}', 'decimals' => 0, 'prefix' => '$' ) ), ) ), ) ) . self::email( __( 'Email me this plan', 'fieldwren' ) ) . self::submit( __( 'Send my plan', 'fieldwren' ) ), self::thanks( __( 'Sent! In {inputs.years} years you could have {inputs.future}.', 'fieldwren' ) ) ); /* ---------------- Feedback ---------------- */ $add( 'testimonial', 'feedback', __( 'Testimonial collection', 'fieldwren' ), __( 'Collect reviews with a star rating, photo and permission to publish.', 'fieldwren' ), self::split( self::headline( __( 'Your story', 'fieldwren' ), __( 'Help others decide', 'fieldwren' ), __( 'Two minutes of your time helps people like you choose with confidence.', 'fieldwren' ) ) . self::perks( array( __( 'We never edit your words', 'fieldwren' ), __( 'You approve before anything goes live', 'fieldwren' ), __( 'A thank-you gift for every story', 'fieldwren' ) ) ), array( self::b( 'rating', array( 'label' => __( 'Your rating', 'fieldwren' ), 'name' => 'stars', 'required' => 'yes', 'hint_labels' => 'Poor, Fair, Good, Great, Outstanding' ) ), self::text( __( 'Sum it up in one line', 'fieldwren' ), 'headline', true, array( 'maxlength' => 80, 'placeholder' => __( 'e.g. Saved our team hours every week', 'fieldwren' ) ) ), self::ta( __( 'Your testimonial', 'fieldwren' ), 'testimonial', true, array( 'rows' => 4 ) ), self::pair( self::name(), self::email() ), self::pair( self::text( __( 'Job title', 'fieldwren' ), 'job_title' ), self::text( __( 'Company', 'fieldwren' ), 'company' ) ), self::b( 'image', array( 'label' => __( 'Photo (optional)', 'fieldwren' ), 'name' => 'photo', 'max_files' => 1 ) ), self::b( 'switch', array( 'label' => __( 'Permission', 'fieldwren' ), 'name' => 'publish', 'switch_text' => __( 'You may publish my name, title and photo', 'fieldwren' ), 'on_value' => 'yes', 'off_value' => 'no' ) ), self::submit( __( 'Share my story', 'fieldwren' ), 'justify' ), ) ), self::thanks( __( 'Thank you, {inputs.names}! We will send a preview before it goes live.', 'fieldwren' ) ) ); $add( 'feature-vote', 'feedback', __( 'Roadmap vote', 'fieldwren' ), __( 'Users drag features into priority order and say how much they would pay for them.', 'fieldwren' ), self::intro( __( 'Roadmap', 'fieldwren' ), __( 'Shape what we build next', 'fieldwren' ), __( 'Drag the features into the order you want them. The top three get built first.', 'fieldwren' ) ) . self::b( 'ranking', array( 'label' => __( 'Your priorities', 'fieldwren' ), 'name' => 'priorities', 'options' => self::opts( array( 'Dark mode', 'Mobile app', 'Team workspaces', 'AI assistant', 'Calendar sync', 'Public API' ) ) ) ) . self::radio( __( 'How do you use the product?', 'fieldwren' ), 'usage', array( 'πŸ§‘ Just me', 'πŸ‘₯ With my team', '🏒 Across the company' ), 'cards' ) . self::b( 'rating', array( 'label' => __( 'How much do you need your top pick?', 'fieldwren' ), 'name' => 'need', 'shape' => 'heart', 'active_color' => '#e11d48', 'hint_labels' => 'Nice to have, Useful, Important, Very important, Can’t live without it' ) ) . self::b( 'like', array( 'label' => __( 'Would you pay extra for it?', 'fieldwren' ), 'name' => 'would_pay' ) ) . self::ta( __( 'Missing from the list?', 'fieldwren' ), 'idea', false, array( 'rows' => 3 ) ) . self::email( __( 'Email (to hear when it ships)', 'fieldwren' ), 'email', array( 'required' => '' ) ) . self::submit( __( 'Cast my vote', 'fieldwren' ), 'justify' ), self::thanks( __( 'Vote counted – thank you! We publish the results every quarter.', 'fieldwren' ) ) ); /* ---------------- Conditional logic ---------------- */ $add( 'cancellation-survey', 'conditional', __( 'Cancellation survey', 'fieldwren' ), __( 'Exit survey: the reason chosen opens its own follow-up question.', 'fieldwren' ), self::intro( __( 'Before you go', 'fieldwren' ), __( 'Sorry to see you leave', 'fieldwren' ), __( 'One honest answer helps us improve for everyone. It takes under a minute.', 'fieldwren' ) ) . self::radio( __( 'Main reason for cancelling', 'fieldwren' ), 'reason', array( 'πŸ’Έ Too expensive', '🧩 Missing a feature', 'πŸ˜• Hard to use', 'πŸ” Switching to another tool', 'πŸ’€ Don’t need it right now' ), 'cards', true ) . self::when( 'reason', '=', 'too-expensive', array( self::b( 'range', array( 'label' => __( 'What price would feel fair?', 'fieldwren' ), 'name' => 'fair_price', 'min' => 0, 'max' => 100, 'step' => 5, 'default_value' => '20', 'prefix' => '$', 'suffix' => ' / month' ) ) ) ) . self::when( 'reason', '=', 'missing-a-feature', array( self::ta( __( 'Which feature did you need?', 'fieldwren' ), 'missing_feature', true, array( 'rows' => 3 ) ) ) ) . self::when( 'reason', '=', 'hard-to-use', array( self::chk( __( 'Which parts were difficult?', 'fieldwren' ), 'hard_parts', array( 'Getting started', 'Settings', 'Reports', 'Integrations', 'Billing' ), 'buttons' ) ) ) . self::when( 'reason', '=', 'switching-to-another-tool', array( self::text( __( 'Which tool are you moving to?', 'fieldwren' ), 'new_tool' ) ) ) . self::b( 'like', array( 'label' => __( 'Would you consider coming back?', 'fieldwren' ), 'name' => 'come_back' ) ) . self::ta( __( 'Anything else we should know?', 'fieldwren' ), 'notes', false, array( 'rows' => 3 ) ) . self::b( 'hidden', array( 'label' => 'Account email', 'name' => 'account', 'capture' => '{user.user_email}' ) ) . self::submit( __( 'Send feedback', 'fieldwren' ), 'justify' ), self::thanks( __( 'Thank you for the honest feedback. Your account stays active until the end of the billing period.', 'fieldwren' ) ) ); /* ---------------- Multi-step ---------------- */ $add( 'client-onboarding', 'multistep', __( 'Client onboarding (agency)', 'fieldwren' ), __( 'Brand, look & feel and goals over three steps: colour picker, style cards, ranking, inspiration links.', 'fieldwren' ), self::intro( __( 'Welcome aboard', 'fieldwren' ), __( 'Let’s kick off your project', 'fieldwren' ), __( 'Three short steps so we can hit the ground running.', 'fieldwren' ) ) . self::pair( self::text( __( 'Company / brand', 'fieldwren' ), 'company', true ), self::b( 'url', array( 'label' => __( 'Current website', 'fieldwren' ), 'name' => 'website' ) ) ) . self::pair( self::sel( __( 'Industry', 'fieldwren' ), 'industry', array( 'Retail', 'SaaS', 'Healthcare', 'Education', 'Finance', 'Hospitality', 'Non-profit', 'Other' ), true ), self::text( __( 'Your brand in three words', 'fieldwren' ), 'three_words', false, array( 'placeholder' => __( 'Bold, friendly, expert', 'fieldwren' ) ) ) ) . self::pair( self::name( __( 'Main contact', 'fieldwren' ) ), self::email() ) . self::step( __( 'Look & feel', 'fieldwren' ), __( 'Your brand', 'fieldwren' ) ) . self::radio( __( 'Visual style', 'fieldwren' ), 'style', array( '✨ Clean & minimal', '🎨 Bold & colourful', 'πŸ›οΈ Classic & trusted', '🌿 Warm & natural' ), 'cards', true ) . self::row( array( self::b( 'color', array( 'label' => __( 'Main brand colour', 'fieldwren' ), 'name' => 'brand_color' ) ), self::b( 'color', array( 'label' => __( 'Second colour', 'fieldwren' ), 'name' => 'brand_color_2' ) ) ) ) . self::b( 'repeater', array( 'label' => __( 'Websites you love', 'fieldwren' ), 'name' => 'inspiration', 'min_rows' => 1, 'max_rows' => 5, 'add_text' => __( '+ Add another', 'fieldwren' ) ), array( self::b( 'url', array( 'label' => __( 'Link', 'fieldwren' ), 'name' => 'link', 'width' => '50' ) ), self::text( __( 'What do you like about it?', 'fieldwren' ), 'why', false, array( 'width' => '50' ) ) ) ) . self::b( 'file', array( 'label' => __( 'Logo & brand assets', 'fieldwren' ), 'name' => 'assets', 'max_files' => 5 ) ) . self::step( __( 'Goals', 'fieldwren' ) ) . self::b( 'ranking', array( 'label' => __( 'Rank your goals', 'fieldwren' ), 'name' => 'goals', 'options' => self::opts( array( 'More leads', 'Online sales', 'Brand awareness', 'Faster website', 'Easier content editing' ) ) ) ) . self::pair( self::b( 'range', array( 'label' => __( 'Budget', 'fieldwren' ), 'name' => 'budget', 'min' => 2000, 'max' => 50000, 'step' => 1000, 'default_value' => '10000', 'prefix' => '$' ) ), self::date( __( 'Ideal launch date', 'fieldwren' ), 'launch', false, array( 'min_date' => '+2 weeks' ) ) ) . self::b( 'summary', array( 'title' => __( 'Check your answers', 'fieldwren' ) ) ) . self::submit( __( 'Start the project', 'fieldwren' ), 'justify' ), self::thanks( __( 'Brilliant – your project lead will book a kick-off call with {inputs.email} within one working day.', 'fieldwren' ) ) ); /* ---------------- Nonprofit ---------------- */ $add( 'donation', 'nonprofit', __( 'Donation', 'fieldwren' ), __( 'Gift amount cards, an optional extra gift, dedication and payment.', 'fieldwren' ), self::hero( __( 'Give today', 'fieldwren' ), __( 'Every gift goes further', 'fieldwren' ), __( '$50 provides a week of clean water for a family of four.', 'fieldwren' ), array( __( 'Tax-deductible', 'fieldwren' ), __( 'Secure payment', 'fieldwren' ) ) ) . self::b( 'payment-item', array( 'label' => __( 'Choose an amount', 'fieldwren' ), 'name' => 'gift', 'price_type' => 'radio', 'display' => 'buttons', 'required' => 'yes', 'options' => self::opts( array( 'Supporter', 'Friend', 'Champion', 'Hero' ), array( 25, 50, 100, 250 ) ) ) ) . self::b( 'custom-amount', array( 'label' => __( 'Add an extra gift (optional)', 'fieldwren' ), 'name' => 'extra', 'min' => 0 ) ) . self::b( 'switch', array( 'label' => __( 'Dedication', 'fieldwren' ), 'name' => 'dedicate', 'switch_text' => __( 'Give in honour or memory of someone', 'fieldwren' ), 'on_value' => 'yes', 'off_value' => 'no' ) ) . self::when( 'dedicate', '=', 'yes', array( self::panel( array( self::pair( self::text( __( 'Their name', 'fieldwren' ), 'honoree', true ), self::email( __( 'Notify by email (optional)', 'fieldwren' ), 'honoree_email', array( 'required' => '' ) ) ), self::ta( __( 'Message', 'fieldwren' ), 'dedication_note', false, array( 'rows' => 2 ) ) ) ) ) ) . self::pair( self::name(), self::email() ) . self::b( 'payment-method', array( 'label' => __( 'Pay with', 'fieldwren' ), 'name' => 'method' ) ) . self::b( 'payment-summary', array() ) . self::submit( __( 'Donate now', 'fieldwren' ), 'justify' ), self::thanks( __( 'Thank you, {inputs.names}! A receipt is on its way to {inputs.email}.', 'fieldwren' ) ) ); $add( 'pet-adoption', 'nonprofit', __( 'Pet adoption application', 'fieldwren' ), __( 'Shelter adoption form with pet cards, home details and rules that ask follow-ups.', 'fieldwren' ), self::intro( __( 'Adopt', 'fieldwren' ), __( 'Find your new best friend', 'fieldwren' ), __( 'Tell us about your home so we can match you with the right companion.', 'fieldwren' ) ) . self::radio( __( 'I would like to adopt a…', 'fieldwren' ), 'pet_type', array( '🐢 Dog', '🐱 Cat', '🐰 Rabbit', '🐦 Bird' ), 'cards', true ) . self::text( __( 'Pet you saw on our site (optional)', 'fieldwren' ), 'pet_name' ) . self::section( __( 'Your home', 'fieldwren' ) ) . self::pair( self::toggle( __( 'Home type', 'fieldwren' ), 'home', array( 'Apartment', 'House', 'Farm' ), true ), self::toggle( __( 'You…', 'fieldwren' ), 'tenure', array( 'Own', 'Rent' ), true ) ) . self::when( 'tenure', '=', 'rent', array( self::b( 'switch', array( 'label' => __( 'Landlord', 'fieldwren' ), 'name' => 'landlord_ok', 'required' => 'yes', 'switch_text' => __( 'My landlord allows pets', 'fieldwren' ) ) ) ) ) . self::chk( __( 'Children at home', 'fieldwren' ), 'children', array( 'None', 'Under 5', '5–12', 'Teens' ), 'buttons' ) . self::b( 'switch', array( 'label' => __( 'Other pets', 'fieldwren' ), 'name' => 'other_pets', 'switch_text' => __( 'There are other pets at home', 'fieldwren' ), 'on_value' => 'yes', 'off_value' => 'no' ) ) . self::when( 'other_pets', '=', 'yes', array( self::ta( __( 'Tell us about them', 'fieldwren' ), 'other_pets_info', false, array( 'rows' => 2 ) ) ) ) . self::b( 'range', array( 'label' => __( 'Hours the pet would be alone on a typical day', 'fieldwren' ), 'name' => 'alone', 'min' => 0, 'max' => 12, 'step' => 1, 'default_value' => '4', 'suffix' => ' h' ) ) . self::section( __( 'About you', 'fieldwren' ) ) . self::pair( self::name(), self::email() ) . self::pair( self::phone( '', 'phone', true ), self::b( 'address', array( 'label' => __( 'Address', 'fieldwren' ), 'name' => 'address', 'required' => 'yes' ) ) ) . self::ta( __( 'Your experience with pets', 'fieldwren' ), 'experience', false, array( 'rows' => 3 ) ) . self::consent( __( 'I agree to a friendly home visit before adoption.', 'fieldwren' ), 'home_visit' ) . self::submit( __( 'Send my application', 'fieldwren' ), 'justify' ), self::thanks( __( 'Thank you! Our adoption team will call you within three days.', 'fieldwren' ) ) ); /* ---------------- Healthcare & wellbeing ---------------- */ $add( 'fitness-assessment', 'health', __( 'Fitness assessment', 'fieldwren' ), __( 'Personal-trainer intake with a live BMI, goal cards and training days.', 'fieldwren' ), self::hero( __( 'Free assessment', 'fieldwren' ), __( 'Your fitness starting point', 'fieldwren' ), __( 'Answer a few questions and your coach builds a plan around you.', 'fieldwren' ) ) . self::pair( self::b( 'range', array( 'label' => __( 'Height', 'fieldwren' ), 'name' => 'height', 'min' => 120, 'max' => 220, 'step' => 1, 'default_value' => '170', 'suffix' => ' cm' ) ), self::b( 'range', array( 'label' => __( 'Weight', 'fieldwren' ), 'name' => 'weight', 'min' => 35, 'max' => 200, 'step' => 1, 'default_value' => '70', 'suffix' => ' kg' ) ) ) . self::panel( array( self::b( 'calculation', array( 'label' => __( 'Your BMI', 'fieldwren' ), 'name' => 'bmi', 'formula' => '{inputs.weight} / (({inputs.height} / 100) ^ 2)', 'decimals' => 1 ) ), self::note( __( 'A healthy adult range is roughly 18.5 – 24.9. BMI is a rough guide, not a diagnosis.', 'fieldwren' ) ) ) ) . self::radio( __( 'Main goal', 'fieldwren' ), 'goal', array( 'πŸ”₯ Lose weight', 'πŸ’ͺ Build muscle', 'πŸƒ Boost endurance', '🧘 Feel better day to day' ), 'cards', true ) . self::radio( __( 'Current activity', 'fieldwren' ), 'activity', array( 'Mostly sitting', 'Light', 'Moderate', 'Very active' ), 'buttons', true ) . self::chk( __( 'Days you can train', 'fieldwren' ), 'days', array( 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun' ), 'buttons', true ) . self::b( 'switch', array( 'label' => __( 'Health', 'fieldwren' ), 'name' => 'injuries', 'switch_text' => __( 'I have an injury or medical condition', 'fieldwren' ), 'on_value' => 'yes', 'off_value' => 'no' ) ) . self::when( 'injuries', '=', 'yes', array( self::ta( __( 'Please describe it', 'fieldwren' ), 'injury_details', true, array( 'rows' => 2 ) ) ) ) . self::pair( self::name(), self::email() ) . self::submit( __( 'Get my plan', 'fieldwren' ), 'justify' ), self::thanks( __( 'Great start, {inputs.names}! Your coach will send a personalised plan within 24 hours.', 'fieldwren' ) ) ); /* ---------------- HR ---------------- */ $add( 'incident-report', 'hr', __( 'Workplace incident report', 'fieldwren' ), __( 'Safety incident with type cards, injury follow-ups, witnesses, photos and a signature.', 'fieldwren' ), self::intro( __( 'Health & safety', 'fieldwren' ), __( 'Report an incident', 'fieldwren' ), __( 'Report every incident and near miss within 24 hours. If someone needs urgent help, call emergency services first.', 'fieldwren' ) ) . self::radio( __( 'What happened?', 'fieldwren' ), 'type', array( '🩹 Injury', '⚠️ Near miss', '🏚️ Property damage', 'πŸ” Security', '🌱 Environmental' ), 'cards', true ) . self::pair( self::date( __( 'Date & time', 'fieldwren' ), 'when', true, array( 'mode' => 'datetime', 'max_date' => 'today' ) ), self::text( __( 'Location', 'fieldwren' ), 'location', true, array( 'placeholder' => __( 'Building, floor, area', 'fieldwren' ) ) ) ) . self::toggle( __( 'Severity', 'fieldwren' ), 'severity', array( 'Minor', 'Moderate', 'Serious', 'Critical' ), true ) . self::ta( __( 'Describe what happened', 'fieldwren' ), 'description', true, array( 'rows' => 4 ) ) . self::when( 'type', '=', 'injury', array( self::panel( array( self::pair( self::text( __( 'Injured person', 'fieldwren' ), 'injured_name', true ), self::sel( __( 'Body part', 'fieldwren' ), 'body_part', array( 'Head', 'Back', 'Arm / hand', 'Leg / foot', 'Other' ) ) ), self::b( 'switch', array( 'label' => __( 'First aid', 'fieldwren' ), 'name' => 'first_aid', 'switch_text' => __( 'First aid was given', 'fieldwren' ) ) ) ) ) ) ) . self::b( 'repeater', array( 'label' => __( 'Witnesses', 'fieldwren' ), 'name' => 'witnesses', 'min_rows' => 0, 'max_rows' => 6, 'add_text' => __( '+ Add witness', 'fieldwren' ) ), array( self::text( __( 'Name', 'fieldwren' ), 'name', false, array( 'width' => '50' ) ), self::text( __( 'Phone / email', 'fieldwren' ), 'contact', false, array( 'width' => '50' ) ) ) ) . self::b( 'image', array( 'label' => __( 'Photos', 'fieldwren' ), 'name' => 'photos', 'max_files' => 5 ) ) . self::section( __( 'Reported by', 'fieldwren' ) ) . self::pair( self::name(), self::email() ) . self::b( 'signature', array( 'label' => __( 'Signature', 'fieldwren' ), 'name' => 'signature', 'required' => 'yes' ) ) . self::submit( __( 'File report', 'fieldwren' ), 'justify' ), self::thanks( __( 'Report filed. The safety officer has been notified.', 'fieldwren' ) ) ); /* ================================================================ * Designed templates – batch 2. * ================================================================ */ /* ---------------- Events ---------------- */ $add( 'event-planning', 'events', __( 'Wedding & event planning inquiry', 'fieldwren' ), __( 'Planner inquiry: event type cards, guest slider, budget and the services needed.', 'fieldwren' ), self::split( self::headline( __( 'Event planning', 'fieldwren' ), __( 'Your day, beautifully planned', 'fieldwren' ), __( 'Tell us the basics – we reply with ideas, venues and a rough budget within 48 hours.', 'fieldwren' ) ) . self::perks( array( __( 'One planner from first call to last dance', 'fieldwren' ), __( 'Trusted local vendors', 'fieldwren' ), __( 'Transparent, itemised pricing', 'fieldwren' ) ) ), array( self::radio( __( 'What are you celebrating?', 'fieldwren' ), 'event_type', array( 'πŸ’ Wedding', 'πŸ₯‚ Engagement', 'πŸŽ‚ Birthday', '🏒 Corporate' ), 'cards', true ), self::pair( self::date( __( 'Event date', 'fieldwren' ), 'event_date', false, array( 'min_date' => '+1 month' ) ), self::text( __( 'City / venue', 'fieldwren' ), 'location' ) ), self::b( 'range', array( 'label' => __( 'Guests', 'fieldwren' ), 'name' => 'guests', 'min' => 10, 'max' => 400, 'step' => 10, 'default_value' => '120', 'suffix' => ' guests' ) ), self::toggle( __( 'Budget', 'fieldwren' ), 'budget', array( 'Under $10k', '$10k–25k', '$25k–50k', '$50k+' ), true ), self::chk( __( 'We need help with', 'fieldwren' ), 'services', array( 'Venue', 'Catering', 'Decor & flowers', 'Photo & video', 'Music', 'Full planning' ), 'buttons' ), self::pair( self::name( __( 'Your names', 'fieldwren' ) ), self::email() ), self::phone(), self::ta( __( 'Describe the vibe', 'fieldwren' ), 'vibe', false, array( 'rows' => 3, 'placeholder' => __( 'Garden party, candlelit, black tie…', 'fieldwren' ) ) ), self::submit( __( 'Start planning', 'fieldwren' ), 'justify' ), ) ), self::thanks( __( 'Congratulations! A planner will send ideas to {inputs.email} within 48 hours.', 'fieldwren' ) ) ); $add( 'sponsorship', 'events', __( 'Sponsorship application', 'fieldwren' ), __( 'Companies choose a sponsorship tier, goals and upload a logo – dark banner design.', 'fieldwren' ), self::hero( __( 'Partners', 'fieldwren' ), __( 'Put your brand in front of 5,000 builders', 'fieldwren' ), __( 'Choose a package below – every tier can be tailored.', 'fieldwren' ), array( __( '5,000 attendees', 'fieldwren' ), __( '42 countries', 'fieldwren' ), __( 'Live + on demand', 'fieldwren' ) ), 'dark' ) . self::radio( __( 'Sponsorship tier', 'fieldwren' ), 'tier', array( 'πŸ₯‰ Bronze Β· $1,000', 'πŸ₯ˆ Silver Β· $5,000', 'πŸ₯‡ Gold Β· $15,000', 'πŸ† Title Β· $40,000' ), 'cards', true ) . self::chk( __( 'Your goals', 'fieldwren' ), 'goals', array( 'Brand awareness', 'Hiring', 'Lead generation', 'Product launch', 'Community' ), 'buttons' ) . self::pair( self::text( __( 'Company', 'fieldwren' ), 'company', true ), self::b( 'url', array( 'label' => __( 'Website', 'fieldwren' ), 'name' => 'website' ) ) ) . self::pair( self::name( __( 'Contact name', 'fieldwren' ) ), self::email( __( 'Work email', 'fieldwren' ) ) ) . self::b( 'image', array( 'label' => __( 'Logo (SVG or PNG)', 'fieldwren' ), 'name' => 'logo', 'max_files' => 1 ) ) . self::ta( __( 'Anything you would like to activate on site?', 'fieldwren' ), 'activation', false, array( 'rows' => 3 ) ) . self::submit( __( 'Request the sponsor pack', 'fieldwren' ), 'justify' ), self::thanks( __( 'Thanks! The partnerships team will send the full sponsor pack to {inputs.email}.', 'fieldwren' ) ) ); /* ---------------- Education ---------------- */ $add( 'tutoring-request', 'education', __( 'Tutoring request', 'fieldwren' ), __( 'Parents pick subjects, online or in person, days and session count.', 'fieldwren' ), self::hero( __( 'Tutoring', 'fieldwren' ), __( 'Find the right tutor', 'fieldwren' ), __( 'Matched with a vetted tutor within two days. The first session is free.', 'fieldwren' ), array( __( 'Vetted tutors', 'fieldwren' ), __( 'First lesson free', 'fieldwren' ) ) ) . self::chk( __( 'Subjects', 'fieldwren' ), 'subjects', array( 'πŸ“ Maths', 'πŸ”¬ Science', 'πŸ“– English', '🌍 Languages', 'πŸ’» Coding', '🎡 Music' ), 'cards', true ) . self::pair( self::sel( __( 'School level', 'fieldwren' ), 'level', array( 'Primary', 'Middle school', 'High school', 'University', 'Adult learner' ), true ), self::toggle( __( 'Where', 'fieldwren' ), 'format', array( 'Online', 'In person' ), true ) ) . self::when( 'format', '=', 'in-person', array( self::b( 'address', array( 'label' => __( 'Lesson address', 'fieldwren' ), 'name' => 'address', 'required' => 'yes' ) ) ) ) . self::chk( __( 'Days', 'fieldwren' ), 'days', array( 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun' ), 'buttons', true ) . self::pair( self::toggle( __( 'Time', 'fieldwren' ), 'time', array( 'After school', 'Evening', 'Weekend' ) ), self::b( 'range', array( 'label' => __( 'Sessions per week', 'fieldwren' ), 'name' => 'sessions', 'min' => 1, 'max' => 5, 'step' => 1, 'default_value' => '2' ) ) ) . self::ta( __( 'What should the tutor focus on?', 'fieldwren' ), 'goals', false, array( 'rows' => 3, 'placeholder' => __( 'Exam prep, confidence, homework help…', 'fieldwren' ) ) ) . self::section( __( 'Contact', 'fieldwren' ) ) . self::pair( self::text( __( 'Student name', 'fieldwren' ), 'student', true ), self::name( __( 'Parent / guardian', 'fieldwren' ) ) ) . self::pair( self::email(), self::phone( '', 'phone', true ) ) . self::submit( __( 'Find my tutor', 'fieldwren' ), 'justify' ), self::thanks( __( 'Thanks! We will introduce {inputs.student} to a tutor within two days.', 'fieldwren' ) ) ); $add( 'course-evaluation', 'education', __( 'Course evaluation', 'fieldwren' ), __( 'End-of-course survey with an agree/disagree grid, overall rating and NPS.', 'fieldwren' ), self::intro( __( 'Course feedback', 'fieldwren' ), __( 'How was the course?', 'fieldwren' ), __( 'Your answers are anonymous and shape the next intake.', 'fieldwren' ) ) . self::pair( self::sel( __( 'Course', 'fieldwren' ), 'course', array( 'Web development', 'UX design', 'Data analytics', 'Product management' ), true ), self::text( __( 'Instructor', 'fieldwren' ), 'instructor' ) ) . self::b( 'grid', array( 'label' => __( 'How much do you agree?', 'fieldwren' ), 'name' => 'agreement', 'grid_type' => 'radio', 'rows' => "The content was clear\nThe pace was right\nMaterials were useful\nThe instructor was engaging\nI can apply what I learned", 'columns' => "Strongly disagree\nDisagree\nNeutral\nAgree\nStrongly agree" ) ) . self::b( 'rating', array( 'label' => __( 'Overall', 'fieldwren' ), 'name' => 'overall', 'required' => 'yes', 'hint_labels' => 'Poor, Fair, Good, Very good, Excellent' ) ) . self::b( 'nps', array( 'name' => 'nps', 'label' => __( 'How likely are you to recommend the course?', 'fieldwren' ) ) ) . self::pair( self::ta( __( 'Best part', 'fieldwren' ), 'best', false, array( 'rows' => 3 ) ), self::ta( __( 'One thing to improve', 'fieldwren' ), 'improve', false, array( 'rows' => 3 ) ) ) . self::submit( __( 'Submit evaluation', 'fieldwren' ), 'justify' ), self::thanks( __( 'Thank you – your feedback goes straight to the course team.', 'fieldwren' ) ) ); /* ---------------- Home & local services ---------------- */ $add( 'car-service', 'services', __( 'Car service booking', 'fieldwren' ), __( 'Vehicle details, service cards with prices, a live estimate and drop-off slot.', 'fieldwren' ), self::hero( __( 'Workshop', 'fieldwren' ), __( 'Book your car in', 'fieldwren' ), __( 'Pick the work you need and see the estimate before you book.', 'fieldwren' ), array( __( 'Certified mechanics', 'fieldwren' ), __( '12-month warranty', 'fieldwren' ) ) ) . self::row( array( self::text( __( 'Make', 'fieldwren' ), 'make', true, array( 'placeholder' => 'Toyota' ) ), self::text( __( 'Model', 'fieldwren' ), 'model', true, array( 'placeholder' => 'Corolla' ) ), self::num( __( 'Year', 'fieldwren' ), 'year', array( 'min' => 1980, 'max' => 2030 ) ) ) ) . self::pair( self::text( __( 'Registration / plate', 'fieldwren' ), 'plate' ), self::num( __( 'Mileage', 'fieldwren' ), 'mileage', array( 'suffix' => ' km', 'min' => 0 ) ) ) . self::chk( __( 'Services', 'fieldwren' ), 'services', array( 'πŸ›’οΈ Oil & filter Β· $79', 'πŸ›‘ Brake check Β· $49', 'πŸ›ž Tyre rotation Β· $35', '❄️ AC service Β· $99', 'πŸ” Full inspection Β· $129' ), 'cards', true, array(), array( 79, 49, 35, 99, 129 ) ) . self::panel( array( self::b( 'calculation', array( 'label' => __( 'Estimate', 'fieldwren' ), 'name' => 'estimate', 'formula' => '{inputs.services}', 'decimals' => 0, 'prefix' => '$' ) ), self::note( __( 'Parts found during inspection are always quoted before any extra work.', 'fieldwren' ) ) ) ) . self::pair( self::date( __( 'Drop-off day', 'fieldwren' ), 'day', true, array( 'min_date' => '+1 day', 'no_weekends' => 'yes' ) ), self::sel( __( 'Drop-off time', 'fieldwren' ), 'time', array( '08:00', '09:00', '10:00', '11:00', '13:00', '14:00' ), true ) ) . self::b( 'switch', array( 'label' => __( 'Courtesy car', 'fieldwren' ), 'name' => 'courtesy_car', 'switch_text' => __( 'I need a courtesy car', 'fieldwren' ) ) ) . self::pair( self::name(), self::phone( '', 'phone', true ) ) . self::email() . self::submit( __( 'Book service', 'fieldwren' ), 'justify' ), self::thanks( __( 'Booked for {inputs.day} at {inputs.time}. Estimated cost {inputs.estimate}.', 'fieldwren' ) ) ); /* ---------------- Calculators ---------------- */ $add( 'moving-quote', 'calc', __( 'Moving cost estimator', 'fieldwren' ), __( 'Home size cards, distance slider and extras give an instant price range.', 'fieldwren' ), self::intro( __( 'Movers', 'fieldwren' ), __( 'How much will your move cost?', 'fieldwren' ), __( 'An instant range in four questions – no phone call needed.', 'fieldwren' ) ) . self::radio( __( 'Home size', 'fieldwren' ), 'size', array( 'πŸ›‹οΈ Studio', '🏠 1–2 bedrooms', '🏑 3 bedrooms', '🏰 4+ bedrooms' ), 'cards', true, array(), array( 400, 900, 1500, 2300 ) ) . self::b( 'range', array( 'label' => __( 'Distance', 'fieldwren' ), 'name' => 'distance', 'min' => 5, 'max' => 1500, 'step' => 5, 'default_value' => '40', 'suffix' => ' km' ) ) . self::chk( __( 'Extras', 'fieldwren' ), 'extras', array( 'Packing +$300', 'Storage (1 month) +$180', 'Piano +$250', 'Furniture assembly +$120' ), 'buttons', false, array(), array( 300, 180, 250, 120 ) ) . self::panel( array( self::pair( self::b( 'calculation', array( 'label' => __( 'From', 'fieldwren' ), 'name' => 'low', 'formula' => '({inputs.size} + {inputs.distance} * 2.2 + {inputs.extras}) * 0.9', 'decimals' => 0, 'prefix' => '$' ) ), self::b( 'calculation', array( 'label' => __( 'To', 'fieldwren' ), 'name' => 'high', 'formula' => '({inputs.size} + {inputs.distance} * 2.2 + {inputs.extras}) * 1.15', 'decimals' => 0, 'prefix' => '$' ) ) ), ) ) . self::pair( self::date( __( 'Moving day', 'fieldwren' ), 'moving_day', false, array( 'min_date' => '+3 days' ) ), self::email( __( 'Email for the exact quote', 'fieldwren' ) ) ) . self::submit( __( 'Get my exact quote', 'fieldwren' ), 'justify' ), self::thanks( __( 'Your move should cost around {inputs.low} – {inputs.high}. A coordinator will confirm the exact price.', 'fieldwren' ) ) ); $add( 'carbon-calculator', 'calc', __( 'Carbon footprint calculator', 'fieldwren' ), __( 'Commute, flights, diet and home energy add up to tonnes of COβ‚‚ per year.', 'fieldwren' ), self::hero( __( 'Climate', 'fieldwren' ), __( 'What is your carbon footprint?', 'fieldwren' ), __( 'Four questions, one number – and ideas to shrink it.', 'fieldwren' ) ) . self::b( 'range', array( 'label' => __( 'Daily commute by car', 'fieldwren' ), 'name' => 'commute', 'min' => 0, 'max' => 150, 'step' => 5, 'default_value' => '20', 'suffix' => ' km' ) ) . self::pair( self::num( __( 'Short flights a year', 'fieldwren' ), 'short_flights', array( 'min' => 0, 'max' => 50, 'default_value' => '2' ) ), self::num( __( 'Long-haul flights a year', 'fieldwren' ), 'long_flights', array( 'min' => 0, 'max' => 30, 'default_value' => '1' ) ) ) . self::radio( __( 'Diet', 'fieldwren' ), 'diet', array( 'πŸ₯© Meat most days', 'πŸ— Some meat', 'πŸ₯š Vegetarian', '🌱 Vegan' ), 'cards', true, array(), array( 2.5, 1.7, 1.4, 1.1 ) ) . self::radio( __( 'Home energy', 'fieldwren' ), 'energy', array( 'Mostly gas / oil', 'Mixed', 'Mostly renewable' ), 'buttons', true, array(), array( 2.6, 1.6, 0.5 ) ) . self::panel( array( self::b( 'calculation', array( 'label' => __( 'Your yearly footprint', 'fieldwren' ), 'name' => 'footprint', 'formula' => '{inputs.commute} * 230 * 0.17 / 1000 + {inputs.short_flights} * 0.25 + {inputs.long_flights} * 1.6 + {inputs.diet} + {inputs.energy}', 'decimals' => 1, 'suffix' => ' t COβ‚‚' ) ), self::note( __( 'The global average is about 4.7 tonnes per person. Figures are rough averages for awareness only.', 'fieldwren' ) ), ) ) . self::email( __( 'Email me tips to cut it', 'fieldwren' ), 'email', array( 'required' => '' ) ) . self::submit( __( 'Send my tips', 'fieldwren' ) ), self::thanks( __( 'Your footprint is about {inputs.footprint}. Tips are on the way!', 'fieldwren' ) ) ); /* ---------------- Orders & payments ---------------- */ $add( 'catering-order', 'orders', __( 'Catering order request', 'fieldwren' ), __( 'Guest slider, menu package cards and per-guest add-ons with a live total.', 'fieldwren' ), self::hero( __( 'Catering', 'fieldwren' ), __( 'Feed your event in style', 'fieldwren' ), __( 'Seasonal menus for 10 to 500 guests, delivered and set up by our team.', 'fieldwren' ) ) . self::b( 'range', array( 'label' => __( 'Guests', 'fieldwren' ), 'name' => 'guests', 'min' => 10, 'max' => 500, 'step' => 5, 'default_value' => '50', 'suffix' => ' guests' ) ) . self::radio( __( 'Menu (price per guest)', 'fieldwren' ), 'menu', array( 'πŸ₯— Buffet Β· $24', '🍲 Family style Β· $32', '🍽️ Plated dinner Β· $45' ), 'cards', true, array(), array( 24, 32, 45 ) ) . self::chk( __( 'Add-ons (per guest)', 'fieldwren' ), 'addons', array( 'Dessert +$6', 'Drinks package +$9', 'Late-night snacks +$5' ), 'buttons', false, array(), array( 6, 9, 5 ) ) . self::chk( __( 'Dietary needs', 'fieldwren' ), 'dietary', array( 'Vegetarian', 'Vegan', 'Gluten-free', 'Halal', 'Nut-free' ), 'buttons' ) . self::panel( array( self::b( 'calculation', array( 'label' => __( 'Estimated total', 'fieldwren' ), 'name' => 'total', 'formula' => '{inputs.guests} * ({inputs.menu} + {inputs.addons})', 'decimals' => 0, 'prefix' => '$' ) ), self::note( __( 'Includes delivery within 30 km and setup. Staffing is quoted separately.', 'fieldwren' ) ) ) ) . self::pair( self::date( __( 'Event date', 'fieldwren' ), 'event_date', true, array( 'min_date' => '+5 days' ) ), self::date( __( 'Serving time', 'fieldwren' ), 'serving_time', true, array( 'mode' => 'time' ) ) ) . self::b( 'address', array( 'label' => __( 'Delivery address', 'fieldwren' ), 'name' => 'address', 'required' => 'yes' ) ) . self::pair( self::name(), self::email() ) . self::phone( '', 'phone', true ) . self::submit( __( 'Request catering', 'fieldwren' ), 'justify' ), self::thanks( __( 'Thanks! We will confirm your menu for {inputs.guests} guests (est. {inputs.total}) by email.', 'fieldwren' ) ) ); $add( 'gift-card', 'orders', __( 'Gift card purchase', 'fieldwren' ), __( 'Amount cards, card design, recipient, message, delivery date and payment – dark banner.', 'fieldwren' ), self::hero( __( 'Gift cards', 'fieldwren' ), __( 'Give the perfect gift', 'fieldwren' ), __( 'Delivered by email on the day you choose. Never expires.', 'fieldwren' ), array( __( 'Instant delivery', 'fieldwren' ), __( 'No expiry', 'fieldwren' ) ), 'dark' ) . self::b( 'payment-item', array( 'label' => __( 'Amount', 'fieldwren' ), 'name' => 'amount', 'price_type' => 'radio', 'display' => 'buttons', 'required' => 'yes', 'options' => self::opts( array( 'Small treat', 'Lovely gift', 'Big surprise', 'Grand gesture' ), array( 25, 50, 100, 200 ) ) ) ) . self::radio( __( 'Card design', 'fieldwren' ), 'design', array( 'πŸŽ‚ Birthday', 'πŸŽ„ Holidays', 'πŸ’ Thank you', 'πŸŽ‰ Congratulations' ), 'cards', true ) . self::section( __( 'Who is it for?', 'fieldwren' ) ) . self::pair( self::text( __( 'Recipient name', 'fieldwren' ), 'recipient', true ), self::email( __( 'Recipient email', 'fieldwren' ), 'recipient_email' ) ) . self::ta( __( 'Personal message', 'fieldwren' ), 'message', false, array( 'rows' => 3, 'maxlength' => 240, 'counter' => 'yes' ) ) . self::date( __( 'Send on', 'fieldwren' ), 'send_on', true, array( 'min_date' => 'today' ) ) . self::section( __( 'From you', 'fieldwren' ) ) . self::pair( self::name( __( 'Your name', 'fieldwren' ) ), self::email( __( 'Your email', 'fieldwren' ) ) ) . self::b( 'payment-method', array( 'label' => __( 'Pay with', 'fieldwren' ), 'name' => 'method' ) ) . self::b( 'payment-summary', array() ) . self::submit( __( 'Buy gift card', 'fieldwren' ), 'justify' ), self::thanks( __( 'Done! {inputs.recipient} receives the gift card on {inputs.send_on}. Your receipt is on its way.', 'fieldwren' ) ) ); /* ---------------- Applications ---------------- */ $add( 'rental-application', 'applications', __( 'Rental application', 'fieldwren' ), __( 'Tenant application in three steps: applicant, income and household with references.', 'fieldwren' ), self::intro( __( 'Apply to rent', 'fieldwren' ), __( 'Rental application', 'fieldwren' ), __( 'About ten minutes. Have proof of income ready to upload.', 'fieldwren' ) ) . self::text( __( 'Property you are applying for', 'fieldwren' ), 'property', true, array( 'placeholder' => __( 'Address or listing reference', 'fieldwren' ) ) ) . self::name( '', 'first_last' ) . self::pair( self::email(), self::phone( '', 'phone', true ) ) . self::pair( self::date( __( 'Date of birth', 'fieldwren' ), 'dob', true, array( 'max_date' => '-18 years' ) ), self::date( __( 'Preferred move-in', 'fieldwren' ), 'move_in', true, array( 'min_date' => 'today' ) ) ) . self::b( 'address', array( 'label' => __( 'Current address', 'fieldwren' ), 'name' => 'current_address', 'required' => 'yes' ) ) . self::step( __( 'Income', 'fieldwren' ), __( 'Applicant', 'fieldwren' ) ) . self::radio( __( 'Employment', 'fieldwren' ), 'employment', array( 'Employed', 'Self-employed', 'Student', 'Retired' ), 'buttons', true ) . self::b( 'text', self::cond( array( 'label' => __( 'Employer', 'fieldwren' ), 'name' => 'employer', 'required' => 'yes' ), 'employment', '=', 'employed' ) ) . self::num( __( 'Monthly income', 'fieldwren' ), 'income', array( 'prefix' => '$', 'required' => 'yes', 'min' => 0 ) ) . self::b( 'file', array( 'label' => __( 'Proof of income', 'fieldwren' ), 'name' => 'proof', 'max_files' => 3, 'allowed' => 'pdf,jpg,jpeg,png', 'required' => 'yes' ) ) . self::step( __( 'Household', 'fieldwren' ) ) . self::pair( self::num( __( 'Adults', 'fieldwren' ), 'adults', array( 'min' => 1, 'default_value' => '1' ) ), self::num( __( 'Children', 'fieldwren' ), 'children', array( 'min' => 0, 'default_value' => '0' ) ) ) . self::b( 'switch', array( 'label' => __( 'Pets', 'fieldwren' ), 'name' => 'pets', 'switch_text' => __( 'I have pets', 'fieldwren' ), 'on_value' => 'yes', 'off_value' => 'no' ) ) . self::when( 'pets', '=', 'yes', array( self::text( __( 'Type and number of pets', 'fieldwren' ), 'pet_details', true ) ) ) . self::b( 'repeater', array( 'label' => __( 'References', 'fieldwren' ), 'name' => 'references', 'min_rows' => 1, 'max_rows' => 3, 'add_text' => __( '+ Add reference', 'fieldwren' ) ), array( self::text( __( 'Name', 'fieldwren' ), 'ref_name', true, array( 'width' => '33' ) ), self::text( __( 'Phone / email', 'fieldwren' ), 'ref_contact', true, array( 'width' => '33' ) ), self::sel( __( 'Relationship', 'fieldwren' ), 'ref_type', array( 'Previous landlord', 'Employer', 'Personal' ), false, array( 'width' => '33' ) ) ) ) . self::consent( __( 'I authorise a credit and background check.', 'fieldwren' ), 'checks' ) . self::b( 'signature', array( 'label' => __( 'Signature', 'fieldwren' ), 'name' => 'signature', 'required' => 'yes' ) ) . self::submit( __( 'Submit application', 'fieldwren' ), 'justify' ), self::thanks( __( 'Application received. The landlord usually replies within three working days.', 'fieldwren' ) ) ); $add( 'vendor-registration', 'applications', __( 'Vendor registration', 'fieldwren' ), __( 'Suppliers register company details, categories, certifications and documents.', 'fieldwren' ), self::split( self::headline( __( 'Suppliers', 'fieldwren' ), __( 'Become a vendor', 'fieldwren' ), __( 'Register once and you will be invited to every relevant tender.', 'fieldwren' ) ) . self::perks( array( __( 'Payment terms from Net 15', 'fieldwren' ), __( 'Fair, transparent tenders', 'fieldwren' ), __( 'Approval in about five days', 'fieldwren' ) ) ), array( self::pair( self::text( __( 'Company name', 'fieldwren' ), 'company', true ), self::b( 'url', array( 'label' => __( 'Website', 'fieldwren' ), 'name' => 'website' ) ) ), self::pair( self::b( 'country', array( 'label' => __( 'Country', 'fieldwren' ), 'name' => 'country', 'required' => 'yes' ) ), self::text( __( 'Tax / VAT number', 'fieldwren' ), 'tax_id', true ) ), self::chk( __( 'What do you supply?', 'fieldwren' ), 'categories', array( 'IT hardware', 'Software', 'Office supplies', 'Logistics', 'Marketing', 'Facilities' ), 'buttons', true ), self::chk( __( 'Certifications', 'fieldwren' ), 'certs', array( 'ISO 9001', 'ISO 27001', 'SOC 2', 'None yet' ), 'buttons' ), self::pair( self::sel( __( 'Company size', 'fieldwren' ), 'size', array( '1–10', '11–50', '51–250', '250+' ) ), self::sel( __( 'Payment terms', 'fieldwren' ), 'terms', array( 'Net 15', 'Net 30', 'Net 45', 'Net 60' ) ) ), self::b( 'file', array( 'label' => __( 'Registration & insurance documents', 'fieldwren' ), 'name' => 'documents', 'max_files' => 5, 'allowed' => 'pdf,jpg,jpeg,png' ) ), self::pair( self::name( __( 'Contact person', 'fieldwren' ) ), self::email() ), self::consent(), self::submit( __( 'Register as vendor', 'fieldwren' ), 'justify' ), ), 'dark' ), self::thanks( __( 'Registration received – procurement will review it within five working days.', 'fieldwren' ) ) ); /* ---------------- Support ---------------- */ $add( 'return-request', 'support', __( 'Return & exchange request', 'fieldwren' ), __( 'Reason cards, refund or exchange paths and photo upload for damaged items.', 'fieldwren' ), self::intro( __( 'Returns', 'fieldwren' ), __( 'Start a return', 'fieldwren' ), __( 'Free returns within 30 days. We email a prepaid label once approved.', 'fieldwren' ) ) . self::pair( self::text( __( 'Order number', 'fieldwren' ), 'order', true, array( 'placeholder' => '#10234' ) ), self::email( __( 'Email used for the order', 'fieldwren' ) ) ) . self::text( __( 'Item(s) to return', 'fieldwren' ), 'items', true ) . self::radio( __( 'Reason', 'fieldwren' ), 'reason', array( 'πŸ“¦ Arrived damaged', 'πŸ“ Wrong size', 'πŸ”€ Wrong item sent', 'πŸ› οΈ Faulty', 'πŸ™… Changed my mind' ), 'cards', true ) . self::when( 'reason', 'in', 'arrived-damaged,faulty', array( self::b( 'image', array( 'label' => __( 'Photos of the problem', 'fieldwren' ), 'name' => 'photos', 'max_files' => 4, 'required' => 'yes' ) ) ) ) . self::toggle( __( 'I would like', 'fieldwren' ), 'outcome', array( 'Refund', 'Exchange', 'Store credit' ), true ) . self::when( 'outcome', '=', 'exchange', array( self::text( __( 'Exchange for (size, colour or item)', 'fieldwren' ), 'exchange_for', true ) ) ) . self::radio( __( 'Item condition', 'fieldwren' ), 'condition', array( 'Unopened', 'Opened – like new', 'Used' ), 'buttons', true ) . self::ta( __( 'Anything else?', 'fieldwren' ), 'notes', false, array( 'rows' => 3 ) ) . self::submit( __( 'Request return', 'fieldwren' ), 'justify' ), self::thanks( __( 'Return requested for order {inputs.order}. Your prepaid label will arrive at {inputs.email}.', 'fieldwren' ) ) ); $add( 'warranty-registration', 'support', __( 'Warranty registration', 'fieldwren' ), __( 'Product, serial number, purchase date and receipt – extends the warranty.', 'fieldwren' ), self::hero( __( 'Warranty', 'fieldwren' ), __( 'Register your product', 'fieldwren' ), __( 'Register within 30 days of purchase to get an extra year of cover.', 'fieldwren' ), array( __( '+1 year free', 'fieldwren' ), __( 'Faster repairs', 'fieldwren' ) ) ) . self::pair( self::sel( __( 'Product', 'fieldwren' ), 'product', array( 'Air purifier', 'Coffee machine', 'Robot vacuum', 'Smart speaker', 'Other' ), true ), self::text( __( 'Serial number', 'fieldwren' ), 'serial', true, array( 'placeholder' => 'SN-XXXX-XXXX' ) ) ) . self::pair( self::date( __( 'Purchase date', 'fieldwren' ), 'purchased', true, array( 'max_date' => 'today' ) ), self::text( __( 'Bought from', 'fieldwren' ), 'retailer' ) ) . self::b( 'file', array( 'label' => __( 'Receipt', 'fieldwren' ), 'name' => 'receipt', 'max_files' => 1, 'allowed' => 'pdf,jpg,jpeg,png', 'required' => 'yes' ) ) . self::pair( self::name(), self::email() ) . self::b( 'address', array( 'label' => __( 'Address', 'fieldwren' ), 'name' => 'address' ) ) . self::b( 'consent', array( 'name' => 'marketing', 'consent_type' => 'marketing', 'required' => '', 'consent_text' => __( 'Send me care tips and product news.', 'fieldwren' ) ) ) . self::submit( __( 'Register warranty', 'fieldwren' ), 'justify' ), self::thanks( __( 'Registered! Your extended warranty for serial {inputs.serial} is confirmed.', 'fieldwren' ) ) ); /* ---------------- HR ---------------- */ $add( 'employee-onboarding', 'hr', __( 'New hire onboarding', 'fieldwren' ), __( 'Personal details, emergency contact and equipment choice before day one.', 'fieldwren' ), self::hero( __( 'Welcome to the team', 'fieldwren' ), __( 'Let’s get you set up', 'fieldwren' ), __( 'Three quick steps so your laptop, accounts and welcome pack are ready on day one.', 'fieldwren' ) ) . self::name( __( 'Legal name', 'fieldwren' ), 'first_last' ) . self::pair( self::text( __( 'Preferred name', 'fieldwren' ), 'preferred_name' ), self::sel( __( 'Pronouns', 'fieldwren' ), 'pronouns', array( 'She / her', 'He / him', 'They / them', 'Prefer not to say' ) ) ) . self::pair( self::email( __( 'Personal email', 'fieldwren' ) ), self::phone( '', 'phone', true ) ) . self::b( 'address', array( 'label' => __( 'Home address', 'fieldwren' ), 'name' => 'address', 'required' => 'yes' ) ) . self::step( __( 'Emergency contact', 'fieldwren' ), __( 'About you', 'fieldwren' ) ) . self::pair( self::text( __( 'Name', 'fieldwren' ), 'ec_name', true ), self::sel( __( 'Relationship', 'fieldwren' ), 'ec_relation', array( 'Partner', 'Parent', 'Sibling', 'Friend', 'Other' ), true ) ) . self::phone( __( 'Phone', 'fieldwren' ), 'ec_phone', true ) . self::step( __( 'Your setup', 'fieldwren' ) ) . self::radio( __( 'Laptop', 'fieldwren' ), 'laptop', array( 'πŸ’» MacBook Pro', 'πŸ–₯️ Windows laptop', '🐧 Linux laptop' ), 'cards', true ) . self::chk( __( 'Extras', 'fieldwren' ), 'extras', array( 'Second monitor', 'Headset', 'Standing desk', 'Ergonomic chair' ), 'buttons' ) . self::pair( self::toggle( __( 'T-shirt size', 'fieldwren' ), 'tshirt', array( 'XS', 'S', 'M', 'L', 'XL', 'XXL' ) ), self::chk( __( 'Dietary needs', 'fieldwren' ), 'dietary', array( 'Vegetarian', 'Vegan', 'Halal', 'Gluten-free' ), 'buttons' ) ) . self::ta( __( 'Anything that would help you settle in?', 'fieldwren' ), 'notes', false, array( 'rows' => 3 ) ) . self::b( 'summary', array( 'title' => __( 'Check your details', 'fieldwren' ) ) ) . self::submit( __( 'Finish setup', 'fieldwren' ), 'justify' ), self::thanks( __( 'All set, {inputs.preferred_name}! IT will ship your laptop before your first day.', 'fieldwren' ) ) ); $add( 'performance-review', 'hr', __( 'Performance self-review', 'fieldwren' ), __( 'Competency grid, achievements, next-period goals and the support needed.', 'fieldwren' ), self::intro( __( 'Self-review', 'fieldwren' ), __( 'Look back, plan ahead', 'fieldwren' ), __( 'Be honest and specific – this starts the conversation with your manager.', 'fieldwren' ) ) . self::pair( self::name(), self::sel( __( 'Review period', 'fieldwren' ), 'period', array( 'H1 2026', 'H2 2026', 'Full year 2026' ), true ) ) . self::b( 'grid', array( 'label' => __( 'Rate yourself', 'fieldwren' ), 'name' => 'competencies', 'grid_type' => 'radio', 'rows' => "Delivers quality work\nCommunicates clearly\nCollaborates with others\nTakes ownership\nLearns and grows", 'columns' => "Needs work\nDeveloping\nSolid\nStrong\nExceptional" ) ) . self::ta( __( 'Biggest achievements', 'fieldwren' ), 'achievements', true, array( 'rows' => 4 ) ) . self::ta( __( 'What got in the way?', 'fieldwren' ), 'challenges', false, array( 'rows' => 3 ) ) . self::b( 'repeater', array( 'label' => __( 'Goals for next period', 'fieldwren' ), 'name' => 'goals', 'min_rows' => 1, 'max_rows' => 5, 'add_text' => __( '+ Add goal', 'fieldwren' ) ), array( self::text( __( 'Goal', 'fieldwren' ), 'goal', true, array( 'width' => '66' ) ), self::date( __( 'By', 'fieldwren' ), 'due', false, array( 'width' => '33' ) ) ) ) . self::b( 'rating', array( 'label' => __( 'Overall, how did this period feel?', 'fieldwren' ), 'name' => 'feeling', 'shape' => 'circle', 'hint_labels' => 'Tough, Mixed, Okay, Good, Great' ) ) . self::ta( __( 'Support you need from your manager', 'fieldwren' ), 'support', false, array( 'rows' => 3 ) ) . self::submit( __( 'Submit self-review', 'fieldwren' ), 'justify' ), self::thanks( __( 'Submitted – your manager will book a review conversation.', 'fieldwren' ) ) ); /* ---------------- Health & wellbeing ---------------- */ $add( 'wellbeing-checkin', 'health', __( 'Wellbeing check-in', 'fieldwren' ), __( 'Gentle mood, sleep and feelings check with an optional request to talk.', 'fieldwren' ), self::intro( __( 'Check-in', 'fieldwren' ), __( 'How are you, really?', 'fieldwren' ), __( 'Two minutes, private by default. Only share your name if you want someone to reach out.', 'fieldwren' ) ) . self::b( 'rating', array( 'label' => __( 'How are you feeling today?', 'fieldwren' ), 'name' => 'mood', 'required' => 'yes', 'shape' => 'circle', 'active_color' => '#10b981', 'hint_labels' => 'Very low, Low, Okay, Good, Great' ) ) . self::b( 'range', array( 'label' => __( 'Sleep last night', 'fieldwren' ), 'name' => 'sleep', 'min' => 0, 'max' => 12, 'step' => 0.5, 'default_value' => '7', 'suffix' => ' h' ) ) . self::b( 'grid', array( 'label' => __( 'In the past week, I have…', 'fieldwren' ), 'name' => 'week', 'grid_type' => 'radio', 'rows' => "felt stressed\nfelt energised\nfelt connected to others\nenjoyed things I usually enjoy", 'columns' => "Never\nSometimes\nOften\nAlways" ) ) . self::chk( __( 'What would help right now?', 'fieldwren' ), 'helps', array( 'More rest', 'Lighter workload', 'Someone to talk to', 'Exercise', 'Time outdoors' ), 'buttons' ) . self::b( 'switch', array( 'label' => __( 'Reach out', 'fieldwren' ), 'name' => 'reach_out', 'switch_text' => __( 'I would like someone to contact me', 'fieldwren' ), 'on_value' => 'yes', 'off_value' => 'no' ) ) . self::when( 'reach_out', '=', 'yes', array( self::panel( array( self::pair( self::name( __( 'Name', 'fieldwren' ) ), self::email() ), self::toggle( __( 'Best way to reach you', 'fieldwren' ), 'contact_by', array( 'Email', 'Phone', 'Chat' ) ) ) ) ) ) . self::note( __( 'This is not a medical service. If you are in danger, contact your local emergency number.', 'fieldwren' ) ) . self::submit( __( 'Send check-in', 'fieldwren' ), 'justify' ), self::thanks( __( 'Thank you for checking in. Be kind to yourself today.', 'fieldwren' ) ) ); /* ---------------- Feedback & marketing ---------------- */ $add( 'page-feedback', 'feedback', __( 'Was this page helpful?', 'fieldwren' ), __( 'Tiny docs / help-centre widget: thumbs up or down, then one follow-up.', 'fieldwren' ), self::panel( array( self::b( 'like', array( 'label' => __( 'Was this page helpful?', 'fieldwren' ), 'name' => 'helpful', 'required' => 'yes' ) ), self::when( 'helpful', '=', 'dislike', array( self::chk( __( 'What went wrong?', 'fieldwren' ), 'problem', array( 'Hard to follow', 'Out of date', 'Missing info', 'Broken example' ), 'buttons' ) ) ), self::when( 'helpful', 'not_empty', '', array( self::ta( __( 'Tell us more (optional)', 'fieldwren' ), 'comment', false, array( 'rows' => 2 ) ) ) ), self::b( 'hidden', array( 'label' => 'Page', 'name' => 'page_url', 'capture' => '{embed_post.permalink}' ) ), self::submit( __( 'Send feedback', 'fieldwren' ) ), ), 'card' ), self::thanks( __( 'Thanks – your feedback helps us improve this page.', 'fieldwren' ) ) ); $add( 'giveaway', 'lead', __( 'Giveaway entry', 'fieldwren' ), __( 'Contest entry with a fun question, referral credit, rules consent and captcha.', 'fieldwren' ), self::hero( __( 'Giveaway', 'fieldwren' ), __( 'Win a dream desk setup', 'fieldwren' ), __( 'One lucky winner gets a standing desk, monitor and chair. Entries close Friday.', 'fieldwren' ), array( __( 'Worth $2,500', 'fieldwren' ), __( 'Free to enter', 'fieldwren' ), __( 'Winner picked live', 'fieldwren' ) ), 'dark' ) . self::pair( self::text( __( 'First name', 'fieldwren' ), 'first_name', true, array( 'autocomplete' => 'given-name' ) ), self::email() ) . self::radio( __( 'Where do you do your best work?', 'fieldwren' ), 'spot', array( '🏠 Home office', 'β˜• Coffee shop', '🏒 The office', '🌴 Anywhere with wifi' ), 'cards', true ) . self::text( __( 'Who told you about us? (they get a bonus entry)', 'fieldwren' ), 'referrer' ) . self::b( 'simple-captcha', array( 'name' => 'captcha' ) ) . self::consent( __( 'I am 18+ and agree to the giveaway rules.', 'fieldwren' ), 'rules' ) . self::b( 'consent', array( 'name' => 'marketing', 'consent_type' => 'marketing', 'required' => '', 'consent_text' => __( 'Also send me the weekly newsletter.', 'fieldwren' ) ) ) . self::submit( __( 'Enter the giveaway', 'fieldwren' ), 'justify' ), self::thanks( __( 'You are in! Good luck – we announce the winner on Friday.', 'fieldwren' ) ) ); self::$cache = apply_filters( 'fwren/templates', $t ); return self::$cache; } /** @return array|null One template. */ public static function get( $id ) { $all = self::all(); return $all[ $id ] ?? null; } /** * Create a form from a template. * * @param string $id Template id. * @return int Form id (0 on failure). */ public static function create_form( $id ) { $tpl = self::get( $id ); if ( ! $tpl ) { return 0; } $form_id = wp_insert_post( array( 'post_type' => Plugin::POST_TYPE, 'post_status' => 'publish', 'post_title' => $tpl['title'], 'post_content' => wp_slash( $tpl['content'] ), ) ); if ( ! $form_id || is_wp_error( $form_id ) ) { return 0; } if ( ! empty( $tpl['settings'] ) ) { Form::save_settings( $form_id, $tpl['settings'] ); } Schema::compile( $form_id, $tpl['content'] ); return (int) $form_id; } /** @return string Preview URL of a template. */ public static function preview_url( $id ) { return add_query_arg( array( 'fwren_preview' => 'tpl', 'tpl' => rawurlencode( $id ), '_wpnonce' => wp_create_nonce( 'fwren_tpl_preview' ), ), home_url( '/' ) ); } /** Editor payload. */ public static function for_editor() { $out = array(); foreach ( self::all() as $id => $t ) { $out[ $id ] = array( 'title' => $t['title'], 'description' => $t['description'], 'category' => $t['category'], 'content' => $t['content'], 'settings' => (object) ( $t['settings'] ?? array() ), 'preview' => self::preview_url( $id ), ); } return $out; } }