AI Sales Script Generator
Run ID: 69cbf3ab61b1021a29a8de0c2026-03-31Business
PantheraHive BOS
BOS Dashboard

This deliverable provides you with a comprehensive, conversion-optimized AI Sales Script Generator, designed to equip your sales team with effective communication tools for every stage of the sales funnel. Our generator leverages advanced AI to create tailored scripts that resonate with your target audience, address specific pain points, and drive desired actions.


AI Sales Script Generator: Detailed Output & Capabilities

Our AI Sales Script Generator is engineered to produce high-quality, actionable scripts across various sales scenarios, infused with industry-specific language and persuasive techniques.

1. Core Script Types Generated

The generator provides specialized scripts for the most critical sales interactions:

1.1. Cold Call Scripts

* Compelling Hook: An attention-grabbing opening statement or question relevant to the prospect's industry or role.

* Problem Identification: Briefly highlight a common challenge or pain point your target audience faces.

* Value Proposition: Articulate how your product/service directly addresses that pain point, focusing on tangible benefits.

* Permission-Based Approach: A polite request for a few minutes of their time.

* Soft Call-to-Action (CTA): A clear, low-commitment ask for the next logical step.

1.2. Demo Presentation Scripts

Discovery Questions: Prompts to understand the prospect's specific needs, current challenges, and desired outcomes before* diving into the demo.

* Personalized Introduction: Recap their pain points and frame the demo around their specific context.

Feature-Benefit Mapping: For each key feature, explain what it does and, more importantly, how it benefits* the prospect.

* Use Cases & Examples: Relatable scenarios demonstrating the product in action within their industry.

* Interactive Elements: Suggestions for engaging the prospect throughout the demo (e.g., "Does this resonate with you?").

* Strong Call-to-Action (CTA): A clear directive for the next stage (e.g., "Let's discuss implementation," "Schedule a deeper dive with our technical team").

1.3. Follow-Up Scripts

* Contextual Reminder: Reference the previous interaction (e.g., "Following up on our call about X...").

* Value Reinforcement: Reiterate a key benefit or solution discussed.

* New Insight/Resource: Offer something new and relevant (e.g., a case study, whitepaper, industry report, relevant blog post).

* Problem-Solution Reiteration: Briefly connect your offering back to their core pain point.

* Clear Next Step: A direct, easy-to-understand request for action.

1.4. Objection Handling Scripts

* Empathy & Acknowledgment: Validate the prospect's concern (e.g., "I understand that's a common concern...").

* Clarification Question: Ask a question to fully understand the root of the objection (e.g., "When you say 'too expensive,' are you referring to the upfront cost or the long-term ROI?").

* Reframe/Educate: Provide information, data, or a different perspective that addresses the objection.

* Solution/Benefit Pivot: Connect back to how your solution specifically mitigates their concern or delivers a superior outcome.

* Testimonial/Social Proof: Offer relevant evidence from other clients.

* Call-to-Action: Gently guide the conversation forward.

* Price: "It's too expensive," "We don't have the budget."

* Timing: "Now's not a good time," "We're happy with our current solution."

* Need: "We don't need this," "It's not a priority."

* Authority: "I need to talk to my manager," "I'm not the decision-maker."

* Competition: "We're already using [Competitor X]," "Your competitor offers Y."

2. Conversion Optimization Strategies

The AI generator incorporates proven strategies to maximize script effectiveness:

* Scarcity/Urgency: "Limited availability," "Offer ends soon."

* Social Proof: "Trusted by over 10,000 businesses," "Our clients see X% ROI."

* Authority: "Industry leader," "Backed by X research."

* Reciprocity: "Here's a free resource..."

Loss Aversion: Highlighting the cost of inaction*.

3. Customization & Input Parameters

To generate highly relevant and effective scripts, the AI requires specific inputs. You will be prompted to provide details on:

* Name & Brief Description: What it is.

* Key Features: List 3-5 core functionalities.

* Unique Selling Propositions (USPs): What makes it stand out?

* Primary Benefits: What tangible value does it deliver to customers?

* Role/Title: (e.g., Marketing Manager, CEO, IT Director).

* Common Pain Points/Challenges: What problems do they typically face that your product solves?

* Desired Outcomes: What are they looking to achieve?

* For Cold Calls: Ideal prospect profile, desired outcome (e.g., 15-min discovery call).

* For Demos: Specific features to highlight, prospect's known challenges.

* For Follow-ups: Previous interaction context, new value to provide.

* For Objection Handling: The specific objection to address.

4. Benefits for Your Sales Team

5. How to Utilize Your Generated Scripts

  1. Review & Personalize: While AI-generated, always review scripts to ensure they align perfectly with your brand voice and specific customer knowledge. Add personal touches where appropriate.
  2. Practice & Internalize: Encourage your sales team to practice the scripts, not just read them. The goal is natural delivery, not robotic recitation.
  3. Integrate into Sales Enablement: Load scripts into your CRM, sales playbooks, or communication tools for easy access during calls and meetings.
  4. A/B Test & Iterate: Monitor script performance (e.g., call-to-meeting rate, demo-to-close rate). Use feedback to refine and generate new iterations.
  5. Provide Feedback: Share insights on what works and what doesn't with the AI system to continuously improve future script generations.

Example Script Structure (Generic Template)

To illustrate the output format, here's a simplified structure for a generated Cold Call Script:

markdown • 2,013 chars
**Script Type:** Cold Call
**Target Industry:** [Your Specified Industry]
**Product/Service:** [Your Product Name]
**Prospect Persona:** [Your Specified Persona]
**Desired Outcome:** Schedule a 15-minute Discovery Call

---

**[Opening - Attention Grabber & Permission]**

"Hi [Prospect Name], this is [Your Name] from [Your Company]. Hope you're having a productive [Day of Week]. The reason for my call is brief, and I promise to be respectful of your time. Do you have about 30 seconds for me to explain why I reached out?"

**[Problem Identification - Relatable Pain Point]**

"Great. I often speak with [Your Specified Persona] in the [Your Specified Industry] sector, and they frequently mention challenges with [Common Pain Point 1, e.g., 'inefficient data management'] and [Common Pain Point 2, e.g., 'struggling to scale their operations efficiently']."

**[Value Proposition - How Your Solution Helps]**

"Our [Your Product Name] helps companies like yours to [Benefit 1, e.g., 'streamline data workflows, reducing manual effort by X%'] and [Benefit 2, e.g., 'provide real-time insights for smarter decision-making']. We specifically help [Customer Segment] achieve [Key Outcome, e.g., 'a significant increase in operational efficiency and cost savings']."

**[Connect to Prospect's Potential Need - Open Question]**

"I don't know if any of these challenges resonate with you, but if they do, it might be worth a brief conversation."

**[Soft Call-to-Action - Low Commitment]**

"Would you be open to a quick 15-minute discovery call sometime this week, perhaps [Suggest Specific Day/Time], to explore if there's a potential fit for [Your Company]?"

**[Handling Initial Resistance - Example]**
*   **Prospect:** "I'm not interested."
*   **Response:** "I completely understand. Many of our current clients felt the same way initially until they saw how [Your Product Name] specifically addressed their [mention pain point]. Is there a particular reason you feel it might not be a fit right now?"

---
Sandboxed live preview

Marketing Strategy for "AI Sales Script Generator"

This document outlines a comprehensive marketing strategy for the "AI Sales Script Generator," focusing on target audience analysis, channel recommendations, a messaging framework, and key performance indicators (KPIs). The goal is to drive awareness, generate leads, and ultimately increase adoption of this innovative sales enablement tool.


1. Target Audience Analysis

Understanding who will benefit most from the AI Sales Script Generator is crucial for effective marketing. We've identified primary and secondary target audiences based on their roles, company types, and specific pain points.

1.1 Primary Target Audience

  • Roles:

* Sales Managers / Directors / VPs of Sales: Decision-makers responsible for team performance, training, and sales strategy.

* Sales Enablement Specialists / Managers: Professionals focused on providing sales teams with the resources, tools, and training needed to improve performance.

* Business Development Managers (BDMs) / SDR/BDR Managers: Those overseeing outbound prospecting teams and looking to improve initial engagement and conversion rates.

  • Company Profile:

* Company Size: Small to Medium-sized Businesses (SMBs) and Mid-Market companies (50-1,000 employees) are ideal, as they often lack extensive in-house sales enablement resources. Larger enterprises may also be targets if their current scripting solutions are manual or outdated.

* Industries: Any industry with a significant B2B sales component, particularly those with complex products/services or high-volume outbound efforts.

* SaaS & Tech: High-growth, competitive markets requiring efficient sales processes.

* B2B Services: Consulting, marketing agencies, IT services, where clear value articulation is key.

* Financial Services: Regulated environments requiring consistent, compliant messaging.

* Real Estate (Commercial): Complex deals requiring tailored pitches.

* Healthcare (B2B): Selling to clinics, hospitals, or pharmaceutical companies.

  • Pain Points & Needs:

* Inconsistent Messaging: Sales teams using varied approaches, leading to brand dilution and lower conversion rates.

* Long Ramp-up Times: New reps struggle to quickly learn product knowledge and effective sales techniques.

* Low Conversion Rates: Ineffective cold calls, demos, and follow-ups failing to advance prospects.

* Difficulty Handling Objections: Reps struggling to confidently and effectively address prospect concerns.

* Lack of Personalization: Generic scripts failing to resonate with specific industries or buyer personas.

* Time-Consuming Script Creation/Updates: Manual process of writing, testing, and updating scripts is inefficient.

* Need for Data-Driven Optimization: Desire to move beyond intuition to data-backed script improvements.

1.2 Secondary Target Audience

  • Roles:

* Individual Sales Representatives (SDRs/AEs): Users who will directly benefit from the tool's output, potentially advocating for its adoption.

* Marketing Managers: Professionals who collaborate with sales on messaging and brand consistency.

  • Pain Points & Needs:

* Fear of Sounding Robotic: Desire for scripts that sound natural and engaging.

* Lack of Confidence: Need for structured guidance to perform better on calls.

* Desire for Improved Performance: Tools to help hit quotas and advance careers.


2. Channel Recommendations

To effectively reach our target audience, a multi-channel approach integrating digital, partnership, and direct sales efforts is recommended.

2.1 Digital Marketing Channels

  • Content Marketing (SEO-driven):

* Blog: Articles on "How AI is Revolutionizing Sales Scripts," "Top 5 Cold Calling Script Mistakes," "Objection Handling Strategies for SaaS Sales," "Accelerating Sales Rep Onboarding with AI."

* Guides & Whitepapers: In-depth resources like "The Ultimate Guide to AI-Powered Sales Enablement" or "Boosting Conversion Rates with Dynamic Sales Scripts."

* Case Studies: Showcase success stories from early adopters.

  • Paid Search (Google Ads, Bing Ads):

* Keywords: Target high-intent keywords such as "AI sales script generator," "sales call script software," "cold calling AI tool," "objection handling AI," "sales enablement AI."

* Ad Copy: Highlight key benefits like conversion optimization, time-saving, and consistency.

  • Social Media Marketing (Primarily LinkedIn):

* Organic Posts: Share valuable content, industry insights, product updates, and employee spotlights.

* Sponsored Content/Ads: Target sales managers, VPs of Sales, and sales enablement professionals based on job title, industry, and company size.

* Thought Leadership: Position key team members as experts in sales enablement and AI.

  • Email Marketing:

* Nurture Sequences: For leads acquired through content downloads or webinars, providing further value and product information.

* Product Updates & Demos: Announce new features and invite prospects to live demonstrations.

* Newsletters: Share industry trends and best practices.

  • Webinars & Online Demos:

* Educational Webinars: "Mastering Cold Calls with AI" or "Streamlining Sales Training with Automated Scripts."

* Product Demos: Live, interactive sessions showcasing the generator's features and benefits.

  • Industry Forums & Communities:

* Engagement: Actively participate in relevant LinkedIn Groups (e.g., Sales Hacker, RevGenius, Sales Enablement Society), Reddit communities, and specialized forums. Provide value, answer questions, and subtly introduce the solution.

2.2 Partnership & Integration Channels

  • CRM Marketplaces:

* Integrations: Develop integrations and list the product on Salesforce AppExchange, HubSpot Marketplace, Zoho Marketplace, etc., to reach existing CRM users.

  • Sales Enablement Platforms:

* Partnerships: Explore integrations or co-marketing opportunities with platforms like Outreach, Salesloft, Highspot, Seismic.

  • Industry Influencers & Consultants:

* Collaborations: Partner with well-known sales coaches, consultants, or tech reviewers for sponsored content, reviews, or joint webinars.

2.3 Direct Sales & Outbound

  • Product-Led Outbound: Utilize the AI Sales Script Generator itself to create highly personalized cold emails and call scripts for prospecting target companies and decision-makers.
  • Targeted Outreach: Build lists of ideal customer profiles and conduct targeted cold email and cold calling campaigns.

3. Messaging Framework

A consistent and compelling messaging framework is essential to communicate the value of the AI Sales Script Generator effectively.

3.1 Core Value Proposition

"Empower your sales team with AI-driven, conversion-optimized scripts for every sales scenario, ensuring consistency, accelerating training, and boosting revenue through intelligent, industry-specific communication."

3.2 Key Benefits

  • Boost Conversion Rates: Generate scripts proven to engage prospects and move them through the sales funnel more effectively.
  • Save Time & Resources: Automate script creation, reduce manual updates, and significantly cut down on sales rep ramp-up time.
  • Ensure Messaging Consistency: Standardize high-quality, on-brand communication across your entire sales organization.
  • Confidently Handle Objections: Equip reps with AI-powered, real-time responses for common and complex objections, turning challenges into opportunities.
  • Personalization at Scale: Tailor scripts dynamically for specific industries, buyer personas, product lines, and even individual prospect details.
  • Data-Driven Optimization: Leverage AI to analyze script performance, identify winning phrases, and continuously refine messaging for maximum impact.
  • Industry-Specific Language: Automatically integrate the precise terminology and jargon relevant to your target customer's industry, building instant credibility.

3.3 Unique Selling Proposition (USP)

Our AI Sales Script Generator stands out by offering:

  • Truly Conversion-Optimized AI: Not just generic templates, but intelligent scripts designed to maximize engagement and move prospects forward.
  • Comprehensive Scenario Coverage: From the first cold call to complex demo narratives, follow-ups, and robust objection handling – all in one platform.
  • Deep Industry & Persona Specificity: AI that understands your market and crafts messages that resonate directly with your ideal customers.
  • Actionable Insights & Continuous Learning: The system learns from your team's performance, providing iterative improvements to script effectiveness.

3.4 Elevator Pitch

"Tired of inconsistent sales messaging and lost deals? Our AI Sales Script Generator crafts dynamic, data-driven scripts tailored to your industry, ensuring your team is always prepared to convert, from the first cold call to the toughest objection. It's like having an expert sales coach for every rep, on every call."

3.5 Tone of Voice

Professional, confident, innovative, results-oriented, empathetic to sales challenges, and empowering.


4. Key Performance Indicators (KPIs)

Measuring the success of the marketing strategy requires tracking specific KPIs across the entire funnel.

4.1 Awareness & Reach

  • Website Traffic: Unique visitors, traffic sources (organic, paid, social, referral).
  • Social Media Reach & Impressions: Number of people exposed to content.
  • Brand Mentions: Track mentions across social media, news, and forums.
  • Ad Impressions: Total views of paid advertisements.

4.2 Lead Generation & Acquisition

  • Marketing Qualified Leads (MQLs): Number of leads identified as having sales potential.
  • Lead Conversion Rate: Percentage of website visitors or content downloads that become leads.
  • Cost Per Lead (CPL): The average cost to acquire one lead.
  • Demo Requests/Free Trial Sign-ups: Direct indicators of interest in the product.
  • Content Download Rates: Downloads of whitepapers, guides, and other lead magnets.

4.3 Engagement

  • Website Engagement: Average time on site, bounce rate, pages per session.
  • Email Marketing Metrics: Open rates, click-through rates (CTR), conversion rates from emails.
  • Webinar Attendance & Engagement: Number of attendees, questions asked, post-webinar survey responses.
  • Social Media Engagement Rate: Likes, comments, shares, and clicks on social posts.

4.4 Sales Performance (Marketing Influenced)

  • Sales Qualified Leads (SQLs): MQLs accepted by the sales team.
  • Lead-to-Opportunity Conversion Rate: Percentage of leads that become sales opportunities.
  • Opportunity-to-Win Rate: Percentage of opportunities that close as won deals.
  • Average Deal Size: The average revenue generated per customer.
  • Sales Cycle Length: Time from lead creation to deal closure.
  • Customer Acquisition Cost (CAC): Total sales and marketing cost to acquire a new customer.
  • Marketing ROI: Revenue generated from marketing efforts compared to marketing spend.

4.5 Customer Feedback & Retention

  • Customer Satisfaction (CSAT) / Net Promoter Score (NPS): Gathered through surveys.
  • Testimonials & Reviews: Quantity and quality of customer feedback.
  • Churn Rate: Percentage of customers who discontinue their service (long-term KPI).

gemini Output

AI Sales Script Generator: Revolutionizing Sales Outreach and Conversion

This document outlines the comprehensive capabilities and value proposition of the AI Sales Script Generator, a cutting-edge solution designed to empower sales teams with dynamic, conversion-optimized scripts tailored for every stage of the sales funnel. Leveraging advanced AI, this generator ensures your team communicates with precision, relevance, and impact, driving higher engagement and superior results.


1. Introduction: The Power of Intelligent Sales Communication

In today's competitive sales landscape, generic scripts fall short. The AI Sales Script Generator is engineered to overcome this challenge by producing highly personalized, industry-specific, and performance-driven sales scripts. From initial outreach to complex objection handling, our AI ensures your team is equipped with the exact words needed to resonate with prospects, build rapport, and close deals more effectively.

2. Core Capabilities & Key Features

Our AI Sales Script Generator offers a robust suite of features designed to cover the entire sales journey:

  • Conversion-Optimized Script Generation:

* Data-Driven Language: Scripts are crafted using insights from successful sales interactions, incorporating persuasive language, proven psychological triggers, and clear calls to action.

* A/B Testing Ready: Generated scripts are structured to facilitate easy A/B testing, allowing for continuous optimization based on real-world performance data.

* Dynamic Personalization Tokens: Scripts can be generated with placeholders for prospect names, company details, pain points, and industry specifics, ensuring each interaction feels tailored.

  • Versatile Script Types:

* Cold Call Scripts: Engaging openers, value propositions, discovery questions, and compelling hooks designed to capture attention and secure next steps.

* Demo Presentation Scripts: Structured narratives for product demonstrations, highlighting key features, benefits, and solutions aligned with prospect needs. Includes Q&A frameworks and closing statements.

* Follow-Up Communication Scripts: Effective sequences for post-call, post-demo, and proposal follow-ups across email, phone, and messaging platforms, designed to maintain momentum and re-engage.

* Objection Handling Scripts: Pre-emptive and reactive responses to common sales objections (e.g., price, timing, competition, need), providing clear, confident, and persuasive rebuttals.

  • Industry-Specific Language & Context:

* Domain Expertise Integration: The AI is trained on vast datasets across various industries (e.g., SaaS, Healthcare, Finance, Manufacturing, Retail), enabling it to generate scripts that speak the specific language of your target market.

* Jargon & Terminology Accuracy: Ensures correct use of industry-specific terms, acronyms, and concepts, enhancing credibility and understanding with prospects.

* Persona-Based Targeting: Scripts can be fine-tuned for different buyer personas within an industry, addressing their unique challenges, goals, and priorities.

  • Seamless Integration & Workflow:

* User-Friendly Interface: Intuitive input fields guide users through the script generation process.

* Export Options: Scripts can be easily exported in various formats (e.g., PDF, Word, plain text) for immediate use and integration into CRM or sales enablement platforms.

3. Benefits for Your Sales Team & Business

Implementing the AI Sales Script Generator offers significant advantages:

  • Increased Conversion Rates: By providing highly optimized and relevant scripts, sales representatives are better equipped to overcome objections, articulate value, and guide prospects towards a positive decision.
  • Enhanced Sales Efficiency: Reduces the time and effort spent by sales reps on script creation, allowing them to focus more on selling and relationship building.
  • Consistent Brand Messaging: Ensures all sales communications align with your brand's voice, value proposition, and strategic messaging across the entire team.
  • Rapid Onboarding & Training: New sales hires can quickly get up to speed with best-practice scripts, reducing ramp-up time and increasing productivity faster.
  • Scalable Sales Operations: Enables your sales team to handle a higher volume of interactions with consistent quality and effectiveness.
  • Data-Driven Improvement: Provides a foundation for analyzing script performance, identifying areas for improvement, and iteratively refining sales strategies.

4. How the AI Sales Script Generator Works (Simplified Process)

  1. Input Core Information: Users provide key details such as:

* Sales Stage: (e.g., Cold Call, Demo, Follow-up, Objection Handling)

* Target Industry: (e.g., SaaS, Finance, Healthcare)

* Product/Service Details: (Key features, benefits, unique selling propositions)

* Prospect Persona: (Role, pain points, goals)

* Specific Objective: (e.g., Book a meeting, Close a deal, Address "too expensive" objection)

* Desired Tone: (e.g., Professional, Empathetic, Urgent)

  1. AI Analysis & Generation: Our Gemini-powered AI processes the input, accesses its vast knowledge base of sales best practices and industry-specific language, and constructs a tailored script.
  2. Output & Refinement: A detailed, actionable script is presented. Users can review, make minor edits, and save or export the script for immediate use.

5. Illustrative Use Cases

  • Scenario 1: Cold Call to a New SaaS Prospect

* Input: Sales stage: Cold Call; Industry: Fintech; Product: AI-powered Fraud Detection; Persona: Head of Risk; Objective: Book a 15-min discovery call.

* Output: A script with a compelling hook addressing common Fintech fraud challenges, a concise value proposition, a key discovery question, and a clear call to action for a brief chat.

  • Scenario 2: Handling a "Price is Too High" Objection

* Input: Sales stage: Objection Handling; Objection: Price; Industry: Manufacturing; Product: ERP System; Context: Prospect comparing with cheaper competitor.

* Output: A script that acknowledges the concern, reframes value over cost, highlights ROI and long-term savings, and offers a flexible solution or deeper dive into specific features.

  • Scenario 3: Post-Demo Follow-Up Email

* Input: Sales stage: Follow-up; Type: Email; Industry: Healthcare; Product: Telemedicine Platform; Context: Follow-up after a successful demo with a hospital administrator.

* Output: An email script summarizing key benefits discussed, reiterating how the platform solves their specific challenges, including a relevant case study link, and proposing the next step (e.g., pilot program discussion).

6. Deliverables: What You Receive

For each script generation request, you will receive:

  • Full Script Text: A complete, ready-to-use script, formatted for readability.
  • Contextual Notes: Guidance on when and how to best utilize the script, including recommended tone and potential follow-up questions.
  • Key Talking Points: A summary of the most critical messages to convey.
  • Objection Pre-emptions: Where applicable, suggestions for proactively addressing common objections.
  • Call to Action (CTA) Options: Multiple variations of CTAs to test and optimize.
  • Personalization Placeholders: Clearly marked sections for inserting prospect-specific details.

This AI Sales Script Generator is designed to be an indispensable tool for any sales organization striving for higher conversion rates, improved team performance, and a consistent, professional sales voice. We are confident that this solution will significantly enhance your sales outreach and bottom-line results.

This refined output provides a robust framework for your sales team, enabling them to engage prospects more effectively and consistently drive conversions.

ai_sales_script_generator.txt
Download source file
Copy all content
Full output as text
Download ZIP
IDE-ready project ZIP
Copy share link
Permanent URL for this run
Get Embed Code
Embed this result on any website
Print / Save PDF
Use browser print dialog
\n\n\n"); var hasSrcMain=Object.keys(extracted).some(function(k){return k.indexOf("src/main")>=0;}); if(!hasSrcMain) zip.file(folder+"src/main."+ext,"import React from 'react'\nimport ReactDOM from 'react-dom/client'\nimport App from './App'\nimport './index.css'\n\nReactDOM.createRoot(document.getElementById('root')!).render(\n \n \n \n)\n"); var hasSrcApp=Object.keys(extracted).some(function(k){return k==="src/App."+ext||k==="App."+ext;}); if(!hasSrcApp) zip.file(folder+"src/App."+ext,"import React from 'react'\nimport './App.css'\n\nfunction App(){\n return(\n
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n
\n )\n}\nexport default App\n"); zip.file(folder+"src/index.css","*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#f0f2f5;color:#1a1a2e}\n.app{min-height:100vh;display:flex;flex-direction:column}\n.app-header{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:40px}\nh1{font-size:2.5rem;font-weight:700}\n"); zip.file(folder+"src/App.css",""); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/pages/.gitkeep",""); zip.file(folder+"src/hooks/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\n## Open in IDE\nOpen the project folder in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Vue (Vite + Composition API + TypeScript) --- */ function buildVue(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "type": "module",\n "scripts": {\n "dev": "vite",\n "build": "vue-tsc -b && vite build",\n "preview": "vite preview"\n },\n "dependencies": {\n "vue": "^3.5.13",\n "vue-router": "^4.4.5",\n "pinia": "^2.3.0",\n "axios": "^1.7.9"\n },\n "devDependencies": {\n "@vitejs/plugin-vue": "^5.2.1",\n "typescript": "~5.7.3",\n "vite": "^6.0.5",\n "vue-tsc": "^2.2.0"\n }\n}\n'); zip.file(folder+"vite.config.ts","import { defineConfig } from 'vite'\nimport vue from '@vitejs/plugin-vue'\nimport { resolve } from 'path'\n\nexport default defineConfig({\n plugins: [vue()],\n resolve: { alias: { '@': resolve(__dirname,'src') } }\n})\n"); zip.file(folder+"tsconfig.json",'{"files":[],"references":[{"path":"./tsconfig.app.json"},{"path":"./tsconfig.node.json"}]}\n'); zip.file(folder+"tsconfig.app.json",'{\n "compilerOptions":{\n "target":"ES2020","useDefineForClassFields":true,"module":"ESNext","lib":["ES2020","DOM","DOM.Iterable"],\n "skipLibCheck":true,"moduleResolution":"bundler","allowImportingTsExtensions":true,\n "isolatedModules":true,"moduleDetection":"force","noEmit":true,"jsxImportSource":"vue",\n "strict":true,"paths":{"@/*":["./src/*"]}\n },\n "include":["src/**/*.ts","src/**/*.d.ts","src/**/*.tsx","src/**/*.vue"]\n}\n'); zip.file(folder+"env.d.ts","/// \n"); zip.file(folder+"index.html","\n\n\n \n \n "+slugTitle(pn)+"\n\n\n
\n \n\n\n"); var hasMain=Object.keys(extracted).some(function(k){return k==="src/main.ts"||k==="main.ts";}); if(!hasMain) zip.file(folder+"src/main.ts","import { createApp } from 'vue'\nimport { createPinia } from 'pinia'\nimport App from './App.vue'\nimport './assets/main.css'\n\nconst app = createApp(App)\napp.use(createPinia())\napp.mount('#app')\n"); var hasApp=Object.keys(extracted).some(function(k){return k.indexOf("App.vue")>=0;}); if(!hasApp) zip.file(folder+"src/App.vue","\n\n\n\n\n"); zip.file(folder+"src/assets/main.css","*{margin:0;padding:0;box-sizing:border-box}body{font-family:system-ui,sans-serif;background:#fff;color:#213547}\n"); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/views/.gitkeep",""); zip.file(folder+"src/stores/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\nOpen in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Angular (v19 standalone) --- */ function buildAngular(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var sel=pn.replace(/_/g,"-"); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "scripts": {\n "ng": "ng",\n "start": "ng serve",\n "build": "ng build",\n "test": "ng test"\n },\n "dependencies": {\n "@angular/animations": "^19.0.0",\n "@angular/common": "^19.0.0",\n "@angular/compiler": "^19.0.0",\n "@angular/core": "^19.0.0",\n "@angular/forms": "^19.0.0",\n "@angular/platform-browser": "^19.0.0",\n "@angular/platform-browser-dynamic": "^19.0.0",\n "@angular/router": "^19.0.0",\n "rxjs": "~7.8.0",\n "tslib": "^2.3.0",\n "zone.js": "~0.15.0"\n },\n "devDependencies": {\n "@angular-devkit/build-angular": "^19.0.0",\n "@angular/cli": "^19.0.0",\n "@angular/compiler-cli": "^19.0.0",\n "typescript": "~5.6.0"\n }\n}\n'); zip.file(folder+"angular.json",'{\n "$schema": "./node_modules/@angular/cli/lib/config/schema.json",\n "version": 1,\n "newProjectRoot": "projects",\n "projects": {\n "'+pn+'": {\n "projectType": "application",\n "root": "",\n "sourceRoot": "src",\n "prefix": "app",\n "architect": {\n "build": {\n "builder": "@angular-devkit/build-angular:application",\n "options": {\n "outputPath": "dist/'+pn+'",\n "index": "src/index.html",\n "browser": "src/main.ts",\n "tsConfig": "tsconfig.app.json",\n "styles": ["src/styles.css"],\n "scripts": []\n }\n },\n "serve": {"builder":"@angular-devkit/build-angular:dev-server","configurations":{"production":{"buildTarget":"'+pn+':build:production"},"development":{"buildTarget":"'+pn+':build:development"}},"defaultConfiguration":"development"}\n }\n }\n }\n}\n'); zip.file(folder+"tsconfig.json",'{\n "compileOnSave": false,\n "compilerOptions": {"baseUrl":"./","outDir":"./dist/out-tsc","forceConsistentCasingInFileNames":true,"strict":true,"noImplicitOverride":true,"noPropertyAccessFromIndexSignature":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"paths":{"@/*":["src/*"]},"skipLibCheck":true,"esModuleInterop":true,"sourceMap":true,"declaration":false,"experimentalDecorators":true,"moduleResolution":"bundler","importHelpers":true,"target":"ES2022","module":"ES2022","useDefineForClassFields":false,"lib":["ES2022","dom"]},\n "references":[{"path":"./tsconfig.app.json"}]\n}\n'); zip.file(folder+"tsconfig.app.json",'{\n "extends":"./tsconfig.json",\n "compilerOptions":{"outDir":"./dist/out-tsc","types":[]},\n "files":["src/main.ts"],\n "include":["src/**/*.d.ts"]\n}\n'); zip.file(folder+"src/index.html","\n\n\n \n "+slugTitle(pn)+"\n \n \n \n\n\n \n\n\n"); zip.file(folder+"src/main.ts","import { bootstrapApplication } from '@angular/platform-browser';\nimport { appConfig } from './app/app.config';\nimport { AppComponent } from './app/app.component';\n\nbootstrapApplication(AppComponent, appConfig)\n .catch(err => console.error(err));\n"); zip.file(folder+"src/styles.css","* { margin: 0; padding: 0; box-sizing: border-box; }\nbody { font-family: system-ui, -apple-system, sans-serif; background: #f9fafb; color: #111827; }\n"); var hasComp=Object.keys(extracted).some(function(k){return k.indexOf("app.component")>=0;}); if(!hasComp){ zip.file(folder+"src/app/app.component.ts","import { Component } from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\n\n@Component({\n selector: 'app-root',\n standalone: true,\n imports: [RouterOutlet],\n templateUrl: './app.component.html',\n styleUrl: './app.component.css'\n})\nexport class AppComponent {\n title = '"+pn+"';\n}\n"); zip.file(folder+"src/app/app.component.html","
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n \n
\n"); zip.file(folder+"src/app/app.component.css",".app-header{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60vh;gap:16px}h1{font-size:2.5rem;font-weight:700;color:#6366f1}\n"); } zip.file(folder+"src/app/app.config.ts","import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';\nimport { provideRouter } from '@angular/router';\nimport { routes } from './app.routes';\n\nexport const appConfig: ApplicationConfig = {\n providers: [\n provideZoneChangeDetection({ eventCoalescing: true }),\n provideRouter(routes)\n ]\n};\n"); zip.file(folder+"src/app/app.routes.ts","import { Routes } from '@angular/router';\n\nexport const routes: Routes = [];\n"); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nng serve\n# or: npm start\n\`\`\`\n\n## Build\n\`\`\`bash\nng build\n\`\`\`\n\nOpen in VS Code with Angular Language Service extension.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n.angular/\n"); } /* --- Python --- */ function buildPython(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var reqMap={"numpy":"numpy","pandas":"pandas","sklearn":"scikit-learn","tensorflow":"tensorflow","torch":"torch","flask":"flask","fastapi":"fastapi","uvicorn":"uvicorn","requests":"requests","sqlalchemy":"sqlalchemy","pydantic":"pydantic","dotenv":"python-dotenv","PIL":"Pillow","cv2":"opencv-python","matplotlib":"matplotlib","seaborn":"seaborn","scipy":"scipy"}; var reqs=[]; Object.keys(reqMap).forEach(function(k){if(src.indexOf("import "+k)>=0||src.indexOf("from "+k)>=0)reqs.push(reqMap[k]);}); var reqsTxt=reqs.length?reqs.join("\n"):"# add dependencies here\n"; zip.file(folder+"main.py",src||"# "+title+"\n# Generated by PantheraHive BOS\n\nprint(title+\" loaded\")\n"); zip.file(folder+"requirements.txt",reqsTxt); zip.file(folder+".env.example","# Environment variables\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n\`\`\`\n\n## Run\n\`\`\`bash\npython main.py\n\`\`\`\n"); zip.file(folder+".gitignore",".venv/\n__pycache__/\n*.pyc\n.env\n.DS_Store\n"); } /* --- Node.js --- */ function buildNode(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var depMap={"mongoose":"^8.0.0","dotenv":"^16.4.5","axios":"^1.7.9","cors":"^2.8.5","bcryptjs":"^2.4.3","jsonwebtoken":"^9.0.2","socket.io":"^4.7.4","uuid":"^9.0.1","zod":"^3.22.4","express":"^4.18.2"}; var deps={}; Object.keys(depMap).forEach(function(k){if(src.indexOf(k)>=0)deps[k]=depMap[k];}); if(!deps["express"])deps["express"]="^4.18.2"; var pkgJson=JSON.stringify({"name":pn,"version":"1.0.0","main":"src/index.js","scripts":{"start":"node src/index.js","dev":"nodemon src/index.js"},"dependencies":deps,"devDependencies":{"nodemon":"^3.0.3"}},null,2)+"\n"; zip.file(folder+"package.json",pkgJson); var fallback="const express=require(\"express\");\nconst app=express();\napp.use(express.json());\n\napp.get(\"/\",(req,res)=>{\n res.json({message:\""+title+" API\"});\n});\n\nconst PORT=process.env.PORT||3000;\napp.listen(PORT,()=>console.log(\"Server on port \"+PORT));\n"; zip.file(folder+"src/index.js",src||fallback); zip.file(folder+".env.example","PORT=3000\n"); zip.file(folder+".gitignore","node_modules/\n.env\n.DS_Store\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\n\`\`\`\n\n## Run\n\`\`\`bash\nnpm run dev\n\`\`\`\n"); } /* --- Vanilla HTML --- */ function buildVanillaHtml(zip,folder,app,code){ var title=slugTitle(app); var isFullDoc=code.trim().toLowerCase().indexOf("=0||code.trim().toLowerCase().indexOf("=0; var indexHtml=isFullDoc?code:"\n\n\n\n\n"+title+"\n\n\n\n"+code+"\n\n\n\n"; zip.file(folder+"index.html",indexHtml); zip.file(folder+"style.css","/* "+title+" — styles */\n*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#fff;color:#1a1a2e}\n"); zip.file(folder+"script.js","/* "+title+" — scripts */\n"); zip.file(folder+"assets/.gitkeep",""); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Open\nDouble-click \`index.html\` in your browser.\n\nOr serve locally:\n\`\`\`bash\nnpx serve .\n# or\npython3 -m http.server 3000\n\`\`\`\n"); zip.file(folder+".gitignore",".DS_Store\nnode_modules/\n.env\n"); } /* ===== MAIN ===== */ var sc=document.createElement("script"); sc.src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"; sc.onerror=function(){ if(lbl)lbl.textContent="Download ZIP"; alert("JSZip load failed — check connection."); }; sc.onload=function(){ var zip=new JSZip(); var base=(_phFname||"output").replace(/\.[^.]+$/,""); var app=base.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"my_app"; var folder=app+"/"; var vc=document.getElementById("panel-content"); var panelTxt=vc?(vc.innerText||vc.textContent||""):""; var lang=detectLang(_phCode,panelTxt); if(_phIsHtml){ buildVanillaHtml(zip,folder,app,_phCode); } else if(lang==="flutter"){ buildFlutter(zip,folder,app,_phCode,panelTxt); } else if(lang==="react-native"){ buildReactNative(zip,folder,app,_phCode,panelTxt); } else if(lang==="swift"){ buildSwift(zip,folder,app,_phCode,panelTxt); } else if(lang==="kotlin"){ buildKotlin(zip,folder,app,_phCode,panelTxt); } else if(lang==="react"){ buildReact(zip,folder,app,_phCode,panelTxt); } else if(lang==="vue"){ buildVue(zip,folder,app,_phCode,panelTxt); } else if(lang==="angular"){ buildAngular(zip,folder,app,_phCode,panelTxt); } else if(lang==="python"){ buildPython(zip,folder,app,_phCode); } else if(lang==="node"){ buildNode(zip,folder,app,_phCode); } else { /* Document/content workflow */ var title=app.replace(/_/g," "); var md=_phAll||_phCode||panelTxt||"No content"; zip.file(folder+app+".md",md); var h=""+title+""; h+="

"+title+"

"; var hc=md.replace(/&/g,"&").replace(//g,">"); hc=hc.replace(/^### (.+)$/gm,"

$1

"); hc=hc.replace(/^## (.+)$/gm,"

$1

"); hc=hc.replace(/^# (.+)$/gm,"

$1

"); hc=hc.replace(/\*\*(.+?)\*\*/g,"$1"); hc=hc.replace(/\n{2,}/g,"

"); h+="

"+hc+"

Generated by PantheraHive BOS
"; zip.file(folder+app+".html",h); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\nFiles:\n- "+app+".md (Markdown)\n- "+app+".html (styled HTML)\n"); } zip.generateAsync({type:"blob"}).then(function(blob){ var a=document.createElement("a"); a.href=URL.createObjectURL(blob); a.download=app+".zip"; a.click(); URL.revokeObjectURL(a.href); if(lbl)lbl.textContent="Download ZIP"; }); }; document.head.appendChild(sc); } function phShare(){navigator.clipboard.writeText(window.location.href).then(function(){var el=document.getElementById("ph-share-lbl");if(el){el.textContent="Link copied!";setTimeout(function(){el.textContent="Copy share link";},2500);}});}function phEmbed(){var runId=window.location.pathname.split("/").pop().replace(".html","");var embedUrl="https://pantherahive.com/embed/"+runId;var code='';navigator.clipboard.writeText(code).then(function(){var el=document.getElementById("ph-embed-lbl");if(el){el.textContent="Embed code copied!";setTimeout(function(){el.textContent="Get Embed Code";},2500);}});}