AI Sales Script Generator
Run ID: 69cada4d74bac0555ea30dde2026-03-30Business
PantheraHive BOS
BOS Dashboard

Generate conversion-optimized sales scripts for cold calls, demos, follow-ups, and objection handling with industry-specific language.

Marketing Strategy for "AI Sales Script Generator"

This comprehensive marketing strategy outlines the target audience, recommended channels, core messaging framework, and key performance indicators (KPIs) to successfully launch and scale the "AI Sales Script Generator."


1. Target Audience Analysis

Our primary goal is to identify and deeply understand the individuals and organizations that will benefit most from an AI Sales Script Generator.

  • Primary User Personas:

* Sales Managers / VPs of Sales / Sales Directors:

* Pain Points: Inconsistent messaging across teams, long ramp-up times for new reps, low conversion rates, difficulty scaling sales training, lack of data-driven script optimization.

* Goals: Increase team efficiency, standardize sales processes, improve overall conversion rates, reduce training costs, achieve sales targets consistently.

* Business Development Representatives (BDRs) / Sales Development Representatives (SDRs):

* Pain Points: Struggling to break through the noise, fear of objection handling, difficulty personalizing outreach at scale, writer's block for cold emails/calls, needing quick access to effective scripts.

* Goals: Book more meetings, improve call confidence, overcome objections effectively, hit activity metrics and quotas.

* Account Executives (AEs):

* Pain Points: Crafting compelling demo narratives, handling complex objections mid-sale, personalized follow-up sequences, adapting messaging for different buyer personas.

* Goals: Shorten sales cycles, increase close rates, maximize deal size, provide consistent value throughout the sales process.

* Sales Enablement Specialists:

* Pain Points: Manual script creation and updates, ensuring content adoption, measuring script effectiveness, providing reps with relevant, up-to-date materials.

* Goals: Streamline content creation, improve rep productivity, measure content impact, facilitate faster knowledge transfer.

  • Target Company Types & Industries:

* Small to Medium Businesses (SMBs): Especially those with growing sales teams looking to professionalize and scale their outreach efficiently without large training budgets.

* Mid-Market & Enterprise Companies: Seeking to standardize messaging across large, distributed sales teams, improve training consistency, and leverage AI for performance optimization.

* Startups: Needing to quickly establish and iterate on effective sales messaging to achieve rapid growth.

* Industries: SaaS, B2B Services (consulting, marketing agencies), Tech, Financial Services, Real Estate, Healthcare, Manufacturing (companies with complex B2B sales cycles or high-value products).

  • Key Pain Points (across all personas):

* Low conversion rates from cold outreach (calls, emails, social).

* Inconsistent, off-brand, or ineffective messaging from sales teams.

* High ramp-up time and training costs for new sales representatives.

* Difficulty in effectively handling common and complex sales objections.

* Lack of personalization at scale, leading to generic outreach.

* Time-consuming and manual process of creating and iterating on sales scripts.

* Struggling to adapt scripts for different products, services, or buyer personas.

* Absence of data-driven insights to optimize script performance.


2. Channel Recommendations

To effectively reach our target audience, a multi-channel approach focusing on digital and strategic partnerships is recommended.

  • Digital Marketing Channels:

* Content Marketing (Inbound):

* Blog Posts: "5 Ways AI Improves Cold Call Conversion Rates," "The Ultimate Guide to Objection Handling with AI," "How to Onboard Sales Reps Faster with AI Scripts."

* Whitepapers/Ebooks: "The Future of Sales: AI-Driven Scripting & Personalization."

* Case Studies: Highlighting successful implementations and ROI from early adopters.

* Templates/Checklists: Offer downloadable AI-generated script templates for specific scenarios (e.g., "AI Cold Email Template Pack").

* Webinars/Virtual Events: Live demonstrations, Q&A sessions, guest speakers on sales enablement and AI.

* Search Engine Optimization (SEO):

* Target high-intent keywords: "AI sales script generator," "cold call script AI," "sales script automation," "objection handling AI," "sales enablement tools," "BDR script generator."

* Optimize website content, landing pages, and blog posts for these keywords.

* Paid Search (SEM - Google Ads):

* Target competitors' names, high-intent keywords, and problem-solution phrases (e.g., "improve cold call success," "sales script writing tool").

* Utilize remarketing campaigns to re-engage website visitors.

* Social Media Marketing (Organic & Paid):

* LinkedIn: Essential for B2B. Share thought leadership, product updates, customer testimonials, host polls, engage with sales professionals and industry groups. Use LinkedIn Ads for precise targeting of sales roles.

* Twitter: Share industry news, quick tips, engage with sales influencers and thought leaders.

* Email Marketing:

* Nurture sequences for leads generated through content downloads or webinar registrations.

* Product updates, feature announcements, best practices, and success stories.

* Personalized outreach for high-value prospects.

* Review Sites:

* Establish a strong presence and encourage reviews on platforms like G2, Capterra, Software Advice, TrustRadius. These are critical for B2B software validation.

  • Partnerships & Integrations:

* CRM Integrations: Develop seamless integrations with leading CRM platforms (Salesforce, HubSpot, Zoho CRM) to demonstrate workflow compatibility and data synergy. Market these integrations heavily.

* Sales Engagement Platforms (SEPs): Partner with platforms like Outreach, Salesloft, Apollo.io to show how AI-generated scripts can be directly deployed within their ecosystems.

* Sales Training & Consulting Firms: Collaborate on content, offer joint webinars, or position the tool as a key component of modern sales training programs.

* Affiliate Programs: Engage sales coaches, influencers, and content creators who cater to our target audience.

  • Direct Sales / Outbound:

* "Eat Our Own Dog Food": Leverage the AI Sales Script Generator to create highly personalized and effective cold call, email, and LinkedIn outreach scripts for our own sales team.

* Targeted Outreach: Directly target VPs of Sales, Sales Directors, and Sales Enablement leaders via personalized LinkedIn messages and cold emails.

  • Public Relations (PR):

* Target leading tech and sales industry publications (e.g., Sales Hacker, Salesloft blog, Forbes Technology Council) for product announcements, thought leadership pieces, and expert quotes.


3. Messaging Framework

Our messaging will emphasize the core value proposition and benefits, tailored to resonate with specific audience segments and sales scenarios.

  • Core Value Proposition:

"Empower your sales team with AI-driven, conversion-optimized scripts for every sales scenario, ensuring consistent messaging, faster ramp-up, and significantly higher close rates."

  • Key Benefits & Differentiators:

* Efficiency & Speed: Generate high-quality scripts in minutes, not hours, freeing up valuable sales time.

* Conversion Optimization: Leverage AI insights to craft scripts proven to resonate and convert, increasing success rates across the board.

* Consistency & Standardization: Ensure every sales rep delivers on-brand, effective, and compliant messages, regardless of experience level.

* Personalization at Scale: Effortlessly tailor scripts for specific industries, buyer personas, company sizes, or individual prospect pain points.

* Objection Mastery: Provide pre-built, intelligent, and effective responses for common and complex sales objections, boosting rep confidence.

* Reduced Ramp-Up Time: Get new sales representatives productive faster by providing them with an instant library of proven scripts and talking points.

* Data-Driven Improvement: (Future Feature/Roadmap) Integrate with performance data to continuously learn and suggest script optimizations based on real-world outcomes.

  • Targeted Messaging by Audience/Scenario:

* For Sales Managers/VPs: "Achieve predictable revenue growth. Standardize excellence, slash training costs, and elevate your team's performance with AI-powered sales scripts."

* For BDRs/SDRs: "Stop guessing, start connecting. Confidently break through the noise, handle objections like a pro, and book more meetings with AI-generated scripts."

* For Account Executives: "Close more deals, faster. Craft compelling demo narratives, master complex objections, and deliver personalized value at every stage of the sales cycle."

* For Cold Calls: "Transform cold calls into warm conversations. Get AI-crafted openers, compelling value propositions, and dynamic responses that keep prospects engaged."

* For Demos: "Structure irresistible demos. Guide prospects through a captivating story that highlights key benefits and drives decision-making."

* For Follow-ups: "Never leave a deal on the table. Create personalized, value-driven follow-up sequences that convert interest into commitment."

* For Objection Handling: "Turn 'no' into 'tell me more.' Access an intelligent library of proven objection responses that build trust and move deals forward."

  • Brand Voice:

Professional, innovative, intelligent, results-oriented, empowering, and confident.


4. Key Performance Indicators (KPIs)

Measuring success requires tracking specific metrics across the entire marketing and sales funnel.

  • Awareness & Reach:

* Website Traffic: Unique visitors, traffic sources (organic, paid, referral, direct).

* Social Media Reach & Engagement: Impressions, followers, likes, shares, comments (especially on LinkedIn).

* Paid Ad Impressions & Clicks: For SEM and social media advertising.

* Brand Mentions: Mentions across social media, news, and review sites.

  • Lead Generation & Acquisition:

* Marketing Qualified Leads (MQLs): Number of leads who meet predefined engagement criteria (e.g., downloaded whitepaper, attended webinar).

* Conversion Rate (Website Visitor to Lead): Percentage of website visitors who become leads.

* Cost Per Lead (CPL): Total marketing spend divided by the number of leads generated.

* Gated Content Downloads: Number of whitepapers, ebooks, or templates downloaded.

* Webinar Registrations & Attendees: Number of sign-ups and actual attendees for virtual events.

* Free Trial Sign-ups: Number of users initiating a free trial of the product.

  • Engagement & Nurturing:

* Email Open Rates & Click-Through Rates (CTR): For marketing automation and nurture campaigns.

* Time on Site & Pages Per Session: Indicating content engagement.

* Demo Requests: Number of prospects requesting a product demonstration.

* Product Usage (for Free Trials): Key features used, scripts generated, time spent in the platform.

  • Sales & Revenue:

* Sales Qualified Leads (SQLs): Number of MQLs accepted by the sales team as ready for direct sales engagement.

*Lead-

gemini Output

As your dedicated AI Sales Script Generator, we are pleased to deliver a comprehensive suite of conversion-optimized sales scripts designed to elevate your outreach across various stages of the sales cycle. These scripts are crafted with industry-specific language, incorporating best practices for engagement, value articulation, and objection handling to maximize your success.


AI-Generated Sales Script Deliverable: Conversion Optimization Framework

This document provides a framework and example scripts for key sales scenarios, demonstrating how our AI leverages industry insights to create impactful communications.

1. Introduction: The Power of AI-Optimized Sales Scripts

In today's competitive landscape, generic scripts fall flat. Our AI Sales Script Generator creates dynamic, data-driven scripts that resonate with your target audience by:

  • Understanding Industry Nuances: Integrating specific terminology, pain points, and success metrics relevant to your sector.
  • Focusing on Value: Clearly articulating how your solution addresses specific customer challenges and delivers tangible ROI.
  • Optimizing for Engagement: Crafting openings, hooks, and CTAs that capture attention and drive desired actions.
  • Enhancing Adaptability: Providing frameworks that sales professionals can confidently personalize and apply in real-time.

For the purpose of these examples, we will use a hypothetical scenario: Selling an AI-Powered Customer Success Platform to B2B SaaS companies.

2. Core Principles of AI-Generated Sales Scripts

Every script generated adheres to these fundamental principles:

  • Prospect-Centricity: Always focusing on the prospect's needs, challenges, and goals.
  • Clear, Concise Value Proposition: Immediately communicating "what's in it for them."
  • Call-to-Action (CTA) Clarity: Guiding the prospect to the next logical step.
  • Confidence & Authority: Projecting expertise and belief in the solution.
  • Objection Preparedness: Anticipating and gracefully addressing potential concerns.
  • Personalization & Empathy: Encouraging tailored interactions, even within a structured script.

3. Sales Script Scenarios & Examples

3.1. Cold Call Script: Securing the Initial Discovery Call

Goal: To pique interest, establish relevance, and schedule a brief discovery call to explore specific pain points.

Industry Context (AI-Powered Customer Success Platform): SaaS companies often struggle with reactive customer support, high churn rates, and difficulty scaling proactive engagement.

Script Structure:

  1. Permission-Based Opening: Respect their time.
  2. Personalized Hook: Reference something specific (LinkedIn, industry news, common challenge).
  3. Problem Statement: Articulate a common pain point they likely face.
  4. Value Proposition (Brief): How your solution specifically addresses that pain point.
  5. Soft Call-to-Action (CTA): Request a short, focused meeting.
  6. Pre-emptive Objection Handling: Address common initial pushbacks.

Example Cold Call Script:

(Rep: Sarah, AI Success Solutions)

(Prospect: Mark, VP Customer Success at ScaleUp SaaS)

Sarah: "Hi Mark, this is Sarah from AI Success Solutions. I know you're busy, so I'll be brief. Is this a bad time for a quick 30-second introduction?"

Mark: "Uh, what's this regarding?"

Sarah: "Thanks, Mark. I was looking at ScaleUp SaaS's recent growth, which is impressive, and I often speak with VPs of Customer Success like yourself who are proactively seeking ways to reduce customer churn and improve NPS without massively increasing their team size. Many find that relying on reactive support leaves them behind. Is proactive customer engagement and retention at scale a priority for you right now?"

Mark: "It's always a priority, but we're doing okay."

Sarah: "Absolutely, and 'okay' is a great starting point. We specialize in helping SaaS companies like yours leverage AI to predict at-risk customers before they churn, automate personalized outreach, and ultimately boost customer lifetime value (CLTV). We've seen clients typically improve their retention rates by 15-20% within the first 6 months."

Sarah: "Instead of taking more of your time now, would you be open to a brief, 15-minute virtual meeting next week? We could explore if there are any specific areas where an AI-powered platform could significantly impact your customer success metrics. How does Tuesday at 10 AM or Wednesday at 2 PM look for you?"

Mark: "I'm not really looking for new solutions right now."

Sarah: "I completely understand, Mark. It's not about replacing what you have, but about augmenting your team's capabilities to be more predictive and efficient. Even a quick chat could uncover a hidden opportunity to turn your 'okay' into 'exceptional' when it comes to customer retention. Would you be open to that 15 minutes to simply explore ideas, no commitment?"


3.2. Demo Script Framework: Showcasing Value, Not Just Features

Goal: To provide a tailored demonstration that addresses the prospect's specific pain points, highlights relevant solutions, and moves them closer to a decision.

Industry Context: Prospects want to see how the AI platform can integrate, identify churn risks, automate workflows, and provide actionable insights.

Key Demo Stages:

  1. Pre-Demo Confirmation & Agenda Setting:

* Script: "Hi [Prospect Name], looking forward to our demo today. To ensure we make the most of our time, I've outlined a few key areas based on our last conversation: [Pain Point 1 - e.g., Identifying at-risk customers earlier], [Pain Point 2 - e.g., Scaling proactive outreach]. Does this agenda still align with your priorities, or is there anything else critical you'd like to cover?"

  1. Discovery & Needs Confirmation (Reiterate Pain Points):

* Script: "Before we dive in, could you briefly remind me of the biggest challenges you're currently facing with customer retention and proactive engagement at [Company Name]? What does success look like for you in solving these?"

(Listen actively, take notes, paraphrase to confirm understanding.)*

  1. Value-Driven Presentation (Feature-Benefit Link):

Script (Example for Churn Prediction): "Based on your challenge with proactively identifying churn risks, let me show you how our AI-powered health scoring system works. Instead of relying on lagging indicators, our platform analyzes [X, Y, Z data points – e.g., product usage, support tickets, NPS trends] to generate a real-time customer health score. This allows your Customer Success Managers to intervene before* a customer shows explicit signs of wanting to leave. Imagine the impact on your gross retention rate if you could reduce churn by even a few percentage points."

Script (Example for Automated Engagement): "You mentioned the difficulty in scaling personalized outreach*. Here's how our automated playbooks can help. Once a customer's health score drops, or they hit a specific trigger like low feature adoption, the system can automatically initiate a personalized email sequence, trigger an in-app message, or even create a task for a CSM – all tailored to their specific situation, ensuring consistent and timely engagement without manual effort."

  1. Interactive Q&A & Objection Handling:

* Script: "What are your initial thoughts on this? Does this address the challenge you're facing with [specific pain point]?"

(Be prepared to pause, answer questions, and address concerns directly with specific examples or data.)*

  1. Next Steps & Call to Action:

* Script: "Thank you for your time today, [Prospect Name]. Based on what we've seen, it seems our platform could significantly help [Company Name] with [summarize 1-2 key benefits, e.g., reducing churn and improving CSM efficiency]. What would be a logical next step for you? Perhaps we could schedule a follow-up with your Head of Product to discuss integration, or I could provide a customized ROI analysis specific to your customer base?"


3.3. Follow-up Scripts: Nurturing & Driving Action

Goal: Maintain momentum, reinforce value, and prompt the prospect to take the next step.

Industry Context: Reinforce how the platform solves their specific churn, retention, or efficiency challenges.

Script Types:

  1. Post-Demo Follow-up (Email):

* Subject: Following Up: Your Path to Enhanced Customer Retention at ScaleUp SaaS

* Body:

"Hi [Prospect Name],

Thank you again for your time today. It was great to learn more about [Company Name]'s goals, especially around [reiterate 1-2 key pain points discussed, e.g., proactively managing churn risk and scaling personalized customer engagement].

As we discussed, our AI-Powered Customer Success Platform helps SaaS companies like yours:

* Predict Churn: Identify at-risk customers early with AI-driven health scores.

* Automate Engagement: Scale personalized outreach with intelligent playbooks.

* Boost CLTV: Ultimately improve your Gross Retention Rate and Customer Lifetime Value.

I've attached a brief summary of how our platform specifically addresses [mention a key pain point].

To help you evaluate further, would you be open to a quick 10-minute call to discuss any remaining questions or explore a potential pilot program?

Best regards,

Sarah from AI Success Solutions"

  1. Value-Add Follow-up (Email/LinkedIn Message):

* Subject: An interesting read on [Relevant Industry Topic] + [Company Name]

* Body:

"Hi [Prospect Name],

Hope you're having a productive week.

I came across this article on [Topic, e.g., 'The Hidden Costs of Reactive Customer Support'] and immediately thought of our conversation about [Company Name]'s efforts to improve proactive customer engagement. The stats on customer churn and its impact on ARR were particularly striking.

It reinforces how crucial it is to have systems in place that can predict and prevent issues before they escalate.

Thought it might be helpful. Let me know if it sparks any thoughts.

Best,

Sarah from AI Success Solutions"


3.4. Objection Handling Framework & Examples

Goal: To effectively address prospect concerns, reframe objections, and keep the sales process moving forward.

Framework (L.A.R.F.P.):

  1. Listen: Truly hear their objection without interrupting.
  2. Acknowledge: Show empathy and validate their concern.
  3. Reframe/Clarify: Ask a clarifying question to understand the root cause, or reframe the objection.
  4. Features/Benefits/Proof: Provide relevant information, a benefit, or social proof.
  5. Propose Next Step: Guide them forward.

Common Objections & AI-Optimized Responses:

  1. Objection: "It's too expensive / We don't have budget."

* L.A.R.F.P. Response:

* Listen & Acknowledge: "I completely understand, [Prospect Name], budget is always a key consideration, especially for new investments."

* Reframe/Clarify: "Could you share a bit more about what you're comparing our solution's cost to, or what you typically allocate for tools that directly impact customer retention and CLTV? Often, the upfront investment in proactive tools is quickly offset by the reduction in churn and the increased efficiency of your CS team."

* Features/Benefits/Proof: "Many of our clients initially had similar budget concerns. However, when they realized the ROI from reducing churn by even a few percentage points, the platform quickly paid for itself. For instance, [Client X] saw a 18% reduction in churn within their first year, directly translating

gemini Output

This deliverable provides a comprehensive suite of conversion-optimized sales scripts tailored for an AI-powered Data Analytics Platform for E-commerce Businesses. These scripts are designed to guide your sales team through various stages of the sales cycle, from initial outreach to closing, incorporating industry-specific language and best practices for maximum effectiveness.


AI Sales Script Generator: Conversion-Optimized Sales Scripts

Project Overview

This package delivers meticulously crafted sales scripts for the following scenarios:

  • Cold Calls: Initiating contact and securing discovery meetings.
  • Demo Outlines & Key Phrases: Guiding compelling product demonstrations.
  • Follow-Ups: Nurturing leads post-call or post-demo.
  • Objection Handling Playbook: Addressing common concerns confidently.

The scripts leverage a value-centric approach and industry-specific terminology relevant to e-commerce, focusing on pain points such as low conversion rates, abandoned carts, ineffective personalization, and the need for real-time, actionable insights.

Introduction: Maximizing Your Sales Effectiveness

In today's competitive e-commerce landscape, an AI-powered data analytics platform offers a significant competitive advantage. These scripts are engineered to articulate that value clearly and persuasively. By providing a structured yet flexible framework, they empower your sales team to:

  • Communicate Value: Clearly articulate how your platform solves specific e-commerce challenges.
  • Drive Engagement: Foster meaningful conversations that resonate with prospects' needs.
  • Improve Consistency: Ensure a high standard of communication across your sales force.
  • Increase Conversion Rates: Guide prospects smoothly through the sales funnel.

General Scripting Best Practices

Before diving into the specific scripts, internalize these foundational principles for effective delivery:

  • Personalize: Always use the prospect's name and company name. Where possible, reference specific details about their business or industry.
  • Listen Actively: Sales is a conversation, not a monologue. Pay close attention to their responses, concerns, and unspoken needs.
  • Focus on Value & Benefits: Prospects care about what your solution can do for them, not just its features. Translate features into tangible benefits (e.g., "AI-driven personalization" becomes "increased customer lifetime value").
  • Be Concise and Clear: Respect the prospect's time. Get to the point efficiently.
  • Maintain Confidence & Enthusiasm: Your tone and energy are contagious. Believe in the value you're offering.
  • Always Have a Clear Call to Action (CTA): Every interaction should lead to a defined next step.
  • Practice, Don't Read: Internalize the core messages so you can deliver them naturally and adapt to the conversation flow.

1. Cold Call Script: Securing the Discovery Meeting

Goal: To pique interest, qualify the prospect, and schedule a short discovery call to explore their needs further.

Scenario: Calling an E-commerce Manager, Marketing Director, or Head of Digital at an e-commerce business.


**[Your Name]**: "Hi [Prospect Name], this is [Your Name] from [Your Company]. I know you're busy, do you have 30 seconds for me to explain why I called?"

**[Prospect Name]**: (Typically "Yes" or "What is it about?")

**[Your Name]**: "Great, thanks. I was looking at [Prospect Company]'s online presence, and many e-commerce leaders I speak with are consistently focused on two things: **maximizing customer lifetime value** and **converting more website traffic into sales**, especially with the rising cost of customer acquisition.

We specialize in helping e-commerce businesses like yours transform raw customer and sales data into actionable, AI-driven insights. This allows you to personalize every customer touchpoint, predict purchasing behavior, and significantly boost your conversion rates. Imagine precisely understanding why customers abandon carts or which products to recommend next, all in real-time.

Does optimizing your customer journey and significantly boosting your online revenue resonate with your current priorities at [Prospect Company]?"

**[Prospect Name]**: (Listen for their response. They might say "Yes," "Maybe," or express a challenge.)

**[
ai_sales_script_generator.md
Download as Markdown
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);}});}