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

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

AI Sales Script Generator: Comprehensive Marketing Strategy

This document outlines a detailed marketing strategy for the "AI Sales Script Generator," focusing on target audience analysis, channel recommendations, a robust messaging framework, and key performance indicators (KPIs) to measure success.


1. Target Audience Analysis

Understanding our ideal customer is paramount to effective marketing. The AI Sales Script Generator is designed for organizations and individuals seeking to optimize their sales communication, improve conversion rates, and scale their sales efforts efficiently.

1.1 Key Buyer Personas

We've identified two primary personas that represent our core target market:

  • Persona 1: Sarah, The Sales Director (Mid-Market SaaS/Tech)

* Background: Manages a team of 10-25 Account Executives (AEs) and Sales Development Representatives (SDRs). Directly responsible for achieving quarterly revenue targets and improving team performance.

* Pain Points:

* Inconsistent messaging across the sales team leading to varied success rates.

* Long ramp-up times for new hires struggling with effective script delivery and objection handling.

* Current scripts are generic, lack industry-specific nuance, and require significant manual updates.

* Difficulty in scaling effective sales communication without a proportional increase in resources.

* Needs: A scalable, data-driven solution to generate customized, high-performing scripts quickly. Wants to reduce ramp-up time, improve overall team conversion rates, and gain a competitive edge.

* Motivators: Increased team productivity, higher conversion rates, data-driven insights, streamlined sales enablement, measurable ROI.

* Channels: LinkedIn (Sales Leadership groups, industry thought leaders), sales tech blogs (e.g., Sales Hacker, Gong.io), industry conferences (SaaStr, Dreamforce), peer recommendations, webinars on sales enablement.

  • Persona 2: David, The SMB Owner/Founder (B2B Services/Consulting)

* Background: Runs a growing small to medium-sized business (5-25 employees) with a small sales team (2-5 reps). Often personally involved in sales strategy and execution.

* Pain Points:

* Limited budget and resources for dedicated sales training or professional script development.

* Sales reps often "wing it," leading to missed opportunities and inconsistent brand messaging.

* Struggles to effectively handle common objections or differentiate their service offering.

* Needs to close more deals efficiently to fuel business growth.

* Needs: An affordable, user-friendly tool that provides professional, effective sales scripts without requiring extensive sales enablement expertise. A solution that can quickly generate tailored content for diverse client types.

* Motivators: Cost-effectiveness, ease of use, direct impact on revenue, increased sales efficiency, ability to compete with larger players.

* Channels: Google Search (long-tail keywords like "small business sales script," "affordable sales tools"), small business forums and communities, LinkedIn groups for entrepreneurs, email newsletters from business growth platforms.

1.2 Broader Target Segments

Beyond these personas, the tool also benefits:

  • Sales & Marketing Agencies: To generate scripts for their clients or improve their own lead qualification processes.
  • Call Centers & BPOs: For high-volume, standardized, yet adaptable outbound/inbound communication.
  • Freelance Sales Professionals/Consultants: To enhance their personal pitches and client offerings.

1.3

gemini Output

AI Sales Script Generator: Elevating Your Sales Conversations for Maximum Conversion

Deliverable for Workflow Step: gemini → create_business_document

This document outlines the capabilities and value proposition of the AI Sales Script Generator, a powerful tool designed to empower your sales team with dynamic, conversion-optimized sales scripts tailored to various scenarios and industry-specific nuances.


1. Introduction: Revolutionizing Your Sales Outreach

In today's competitive landscape, effective communication is paramount to sales success. Generic scripts often fall flat, failing to resonate with prospects or address their unique pain points. The AI Sales Script Generator addresses this challenge head-on by leveraging advanced artificial intelligence to craft highly effective, personalized sales scripts that drive engagement and boost conversion rates across your entire sales funnel.

This generator moves beyond basic templates, providing meticulously designed content for every stage of the sales journey, infused with industry-specific language to ensure relevance and impact.

2. Core Capabilities: Comprehensive Script Generation

Our AI Sales Script Generator provides specialized script generation for the most critical sales scenarios:

  • Cold Call Scripts:

* Engaging Openers: Designed to immediately capture attention and establish relevance.

* Discovery Questions: Strategic questions to uncover prospect needs, challenges, and goals.

* Value Proposition Delivery: Clear, concise articulation of how your solution addresses their specific pain points.

* Immediate Call-to-Action: Guiding prospects smoothly towards the next step (e.g., booking a demo, sending information).

  • Demo Scripts:

* Structured Walkthroughs: Logical flow that highlights key features tied directly to prospect benefits.

* Feature-Benefit Translation: Emphasizing "what's in it for them" rather than just listing features.

* Interactive Elements: Suggestions for engaging the prospect throughout the demo.

* Pre-emptive Objection Handling: Addressing potential concerns before they arise.

* Strong Closing Statements: Guiding the conversation towards commitment.

  • Follow-Up Scripts (Multi-Channel):

* Value-Add Reminders: Reinforcing the benefits discussed in previous interactions.

* Addressing Unanswered Questions: Proactively clarifying any ambiguities.

* Creating Urgency & Scarcity (where appropriate): Gentle nudges to encourage timely action.

* Clear Next Steps: Defining the path forward for the prospect.

* Adaptable for Email, Phone, and Messaging Platforms.

  • Objection Handling Scripts:

* Common Objection Categories: Price, timing, need, competition, authority, etc.

* Empathetic Listening & Acknowledgment: Strategies to validate the prospect's concern.

* Reframing & Rebuttal: Techniques to shift perspective and present compelling counter-arguments.

* Solution-Oriented Responses: Focusing on how your offering resolves the underlying issue.

* Proactive & Reactive Strategies: Scripts for both anticipating and responding to objections.

3. Industry-Specific Language Integration

A critical differentiator of our AI Sales Script Generator is its ability to infuse scripts with language and terminology relevant to your specific industry. This ensures that your sales team speaks the prospect's language, building immediate trust and credibility.

  • Tailored Terminology: Incorporates industry jargon, acronyms, and concepts familiar to your target audience.
  • Relevant Pain Points: Focuses on the specific challenges and opportunities prevalent in your sector.
  • Contextual Examples: Provides examples and case studies that resonate directly with industry-specific scenarios.
  • Sector Adaptability: Whether you're in SaaS, Healthcare, Finance, Manufacturing, Real Estate, or any other sector, the AI adapts its output to maximize impact.

4. How It Works: Your Input, Optimized Output

To generate your conversion-optimized sales scripts, the AI requires key inputs:

  1. Product/Service Description: A detailed overview of what you offer, its core features, and primary benefits.
  2. Target Audience Profile: Demographics, psychographics, typical pain points, goals, and desired outcomes of your ideal customer.
  3. Industry: The specific sector(s) you operate in and target.
  4. Sales Scenario: Clearly define the type of script needed (e.g., "Cold Call," "Demo for new client," "Follow-up after initial meeting," "Handling 'too expensive' objection").
  5. Desired Outcome: What action do you want the prospect to take after this interaction? (e.g., "Book a discovery call," "Sign up for a free trial," "Request a proposal," "Agree to next steps").
  6. Key Selling Points/Unique Value Proposition: Highlight what makes your offering stand out.

Output: You will receive a structured, detailed script, complete with suggested talking points, potential questions to ask, anticipated objections, and recommended closing remarks. Where applicable, multiple variations or alternative phrasings may be provided for flexibility and A/B testing.

5. Key Benefits for Your Business

Implementing the AI Sales Script Generator delivers tangible advantages:

  • Boosted Conversion Rates: Scripts are designed with proven sales methodologies (e.g., AIDA, SPIN, Challenger Sale principles) to maximize prospect engagement and progression.
  • Enhanced Sales Efficiency: Significantly reduces the time and effort spent on script creation, allowing your team to focus on selling.
  • Consistent Messaging: Ensures all sales representatives deliver a unified and professional message, reinforcing your brand identity.
  • Improved Sales Team Confidence: Equips reps with well-articulated, persuasive responses for any situation, fostering greater confidence in their interactions.
  • Faster Onboarding: New sales hires can quickly get up to speed with high-quality, pre-vetted scripts.
  • Data-Driven Iteration: Provides a solid foundation for A/B testing and continuous refinement of your sales messaging.
  • Personalized Prospect Engagement: The ability to tailor scripts to specific industries and scenarios makes interactions feel more relevant and less generic.

6. Getting Started

To leverage the power of the AI Sales Script Generator, simply provide the detailed inputs outlined in Section 4 for your desired sales scenario. The more comprehensive your input, the more precise and effective the generated script will be.

We are confident that this tool will become an invaluable asset in optimizing your sales strategies, driving better conversations, and ultimately, closing more deals.

gemini Output

AI Sales Script Generator: Conversion-Optimized Sales Script Package

This deliverable provides a comprehensive suite of conversion-optimized sales scripts designed to elevate your sales interactions across various touchpoints. Each script is structured for clarity, impact, and adaptability, incorporating best practices for persuasive communication and objection handling. We've included frameworks for cold calls, product demos, follow-ups, and a robust objection handling playbook, with guidance on integrating industry-specific language to resonate deeply with your target audience.


1. Core Principles for Conversion-Optimized Scripts

Before diving into the specific scripts, understanding the foundational principles that drive their effectiveness is crucial:

  • Problem-Centric Approach: Start by acknowledging or identifying a common pain point relevant to your prospect, then position your solution as the answer.
  • Benefit-Driven Language: Focus on the value and outcomes your solution provides, rather than just features. How will it make their life easier, save them money, or increase their revenue?
  • Clear Call to Action (CTA): Every interaction should lead to a clear, single next step. Make it easy for the prospect to understand what you want them to do.
  • Discovery & Listening: Scripts should not be monologues. Incorporate questions that encourage dialogue and allow you to uncover specific needs and tailor your message.
  • Empathy & Professionalism: Maintain a respectful, understanding, and confident tone. Acknowledge their concerns and build rapport.
  • Brevity & Clarity: Especially for initial outreach, get to the point quickly and articulate your value concisely.
  • Adaptability: These are templates. Be prepared to pivot based on the prospect's responses and specific industry context.

2. Cold Call Script: Engaging & Qualifying Prospects

This script is designed for initial outreach, focusing on quickly establishing relevance, sparking interest, and qualifying the prospect for a deeper conversation.

Goal: Secure a brief discovery call or a demo appointment.

Script Structure:

  1. Permission/Pattern Interrupt (Optional but Recommended):

* "Hi [Prospect Name], this is [Your Name] from [Your Company]. Did I catch you at a bad time, or do you have 30 seconds for a quick question?"

Alternative:* "Hi [Prospect Name], [Your Name] from [Your Company]. The reason for my call is [brief, value-driven statement]."

  1. Introduction & Value Proposition (Personalized & Concise):

* "Great, thanks. We primarily work with [Target Industry/Role, e.g., 'marketing leaders in the SaaS space'] who are often struggling with [Common Pain Point, e.g., 'inefficient lead generation processes' or 'difficulty proving marketing ROI']."

* "Our [Your Solution/Service, e.g., 'AI-powered platform'] helps them [Key Benefit 1, e.g., 'automate lead qualification'] and [Key Benefit 2, e.g., 'gain deeper insights into campaign performance'], typically resulting in [Quantifiable Outcome, e.g., 'a 20% increase in qualified leads within 3 months']."

  1. Discovery Question (Open-Ended & Relevant):

* "I don't know if that's a challenge you're facing, but how are you currently handling [Pain Point Area, e.g., 'your lead qualification process'] at [Prospect's Company]?"

Alternative:* "What are your current priorities when it comes to [Area related to your solution, e.g., 'improving marketing efficiency']?"

  1. Active Listening & Acknowledge:

* "I understand. It sounds like [Paraphrase their challenge/goal]."

  1. Transition to Next Step (Soft Close):

* "Based on what you've shared, I think a brief 15-minute conversation could be valuable to explore how [Your Company] might specifically help [Prospect's Company] address [Their Specific Challenge]. Would you be open to a quick chat sometime next week?"

Alternative:* "Would you be available for a quick demo of how our platform tackles [Their Specific Challenge] on [Day] or [Day]?"

  1. Confirm & Schedule:

* "Great. How about [Specific Date and Time]? I'll send you a calendar invite with a brief agenda."

* "Perfect. I'll send that over now. Looking forward to speaking with you, [Prospect Name]. Have a great day!"

Example (Tech/SaaS - AI Lead Qualification Platform):

  • You: "Hi Sarah, this is Alex from QualifyAI. Did I catch you at a bad time, or do you have 30 seconds for a quick question?"
  • Sarah: "Go ahead."
  • You: "Thanks. We work primarily with B2B sales development teams who are often struggling with spending too much time on unqualified leads, leading to burnout and missed quotas. Our AI-powered platform helps them automate lead scoring and instantly identify high-intent prospects, typically resulting in a 30% increase in SDR productivity and pipeline velocity."
  • You: "I don't know if that's a challenge you're facing, but how are you currently managing your inbound lead qualification process at Acme Corp?"
  • Sarah: "It's a huge challenge, actually. Our team spends hours sifting through leads, and we're still missing opportunities."
  • You: "I understand. It sounds like your team is stretched thin and valuable leads might be falling through the cracks. Based on that, I think a brief 15-minute conversation could be valuable to explore how QualifyAI might specifically help Acme Corp streamline your lead qualification and boost SDR efficiency. Would you be open to a quick chat sometime next week?"
  • Sarah: "Yes, I'd be interested."
  • You: "Excellent. How about Tuesday at 10 AM PST or Wednesday at 2 PM PST?"

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

This framework ensures your product demonstration is problem-oriented, benefit-driven, and tailored to the prospect's needs.

Goal: Educate, inspire confidence, and move the prospect closer to a decision.

Script Structure:

  1. Welcome & Agenda Setting (5%):

* "Welcome, [Prospect Name]! Thanks for taking the time today. To make sure this demo is as valuable as possible, I've outlined a brief agenda:

1. Quick recap of your key challenges/goals we discussed.

2. Demonstration of how [Your Solution] directly addresses those.

3. Time for Q&A and discussing next steps.

* "Does that sound good to you, and is there anything else you'd like to ensure we cover?"

  1. Recap & Confirm Needs (10%):

* "Based on our previous conversation, my understanding is that your primary challenges revolve around [Key Challenge 1, e.g., 'lack of visibility into campaign performance'] and [Key Challenge 2, e.g., 'manual reporting leading to delayed insights']. Is that still accurate, or have things shifted?"

* "What would be the most impactful outcome for you from today's session?"

  1. Problem-Solution Showcase (60%):

* For each key challenge identified:

* "You mentioned [Prospect's Specific Challenge]. Many of our clients face this. Before [Your Solution], they struggled with [Consequence of Challenge]."

* Transition to Feature: "Let me show you how [Your Solution] addresses this directly."

* Demonstrate: Walk through the relevant feature(s).

* Connect to Benefit: "By doing [Feature Action], you'll be able to [Direct Benefit, e.g., 'generate real-time reports'] which means [Impact/Value, e.g., 'you can make data-driven decisions faster and optimize campaigns on the fly']."

* Check for Understanding: "How does that resonate with your current workflow?" or "Can you see how this would impact [Specific Area of their Business]?"

Prioritize: Focus on 2-3 core problems and solutions that are most relevant to this specific prospect*.

  1. Address Potential Concerns/Future State (10%):

* "Beyond these core areas, another common benefit our clients experience is [Secondary Benefit, e.g., 'reduced overhead costs by X%']. This is achieved through [Brief explanation]."

  1. Q&A & Objection Pre-empting (5%):

* "What questions do you have about what we've covered today?"

Proactive:* "Sometimes clients ask about [Common Objection, e.g., 'integration complexity']. I want to assure you that [Solution to Objection, e.g., 'our platform has native integrations with X, Y, Z, and a robust API for custom needs']. Does that address any concerns you might have had?"

  1. Next Steps & Clear CTA (10%):

* "Based on what we've discussed, it seems like [Your Solution] could significantly help [Prospect's Company] achieve [Their Core Goal]. What are your thoughts on moving forward?"

* "Typically, the next step would be [Specific Next Step, e.g., 'a deeper dive with your technical team,' 'a personalized proposal,' 'a free trial']. What would make the most sense for you?"

* "Would you like me to send over a summary of what we discussed and a proposal outlining the investment for [Specific Tier/Solution]?"

* "When would be a good time to schedule that follow-up call to review the proposal?"

Example (Tech/SaaS - Customer Feedback Platform):

  • You: "Welcome, John! Thanks for taking the time. Today, we'll quickly recap your goals, show how our platform tackles your feedback challenges, and then discuss next steps. Sound good?"
  • John: "Yes, perfect."
  • You: "Great. We discussed that Acme Corp is struggling to centralize customer feedback from various channels and then act on it efficiently, leading to missed opportunities for product improvement. Is that still accurate?"
  • John: "Absolutely, it's our biggest pain point."
  • You: "Excellent. You mentioned the difficulty of consolidating feedback. Many of our clients struggled with disparate data silos before using our platform. Let me show you our 'Unified Feedback Inbox.' [Demonstrate feature]. By consolidating all feedback – from support tickets to social media – into one view, your team can quickly identify trends and prioritize issues, meaning you'll drastically reduce the time spent aggregating data and accelerate your response times. How would this impact your current workflow?"
  • John: "That would be a game-changer. We spend days on that manually."
  • You: "Fantastic. Another challenge was acting on feedback. Our 'Actionable Insights Dashboard' [Demonstrate feature] uses AI to highlight critical trends and even suggest next steps. This means your product team can quickly pinpoint high-impact areas for improvement and deploy fixes faster, leading to higher customer satisfaction and reduced churn. Can you see how this would empower your product roadmap decisions?"
  • John: "Definitely. We're often guessing what to prioritize."
  • You: "What other questions do you have?"
  • John: "What about integrations with our existing CRM?"
  • You: "That's a great question. We integrate natively with Salesforce, HubSpot, and Zendesk, and our robust API allows for custom connections to virtually any system, ensuring your data flows seamlessly. Does that address your concern?"
  • John: "Yes, it does."
  • You: "Based on our discussion, it seems like our platform could significantly help Acme Corp centralize feedback and accelerate your product development cycle. What are your thoughts on moving forward? Perhaps a personalized proposal outlining the investment and a deeper dive with your product team next week?"

4. Follow-Up Script: Reinforcing Value & Driving Action

Follow-ups are critical to maintaining momentum and guiding the prospect through the sales cycle. These scripts are designed to be concise, value-driven, and clear on the next steps.

Goal: Keep the conversation alive, reinforce value, and secure the next commitment.

4.1. Post-Cold Call/Discovery Follow-Up (Email Template)

Subject: Following Up: [Your Company] & [Prospect's Company] - [Brief Value Proposition]

Body:

Hi [Prospect Name],

It was great speaking with you earlier today/yesterday. I appreciate you taking the time to discuss [Key Challenge discussed, e.g., 'your challenges with lead qualification'].

As we discussed, our [Your Solution] helps [Target Industry/Role] like yourself to [Key Benefit 1] and [Key Benefit 2], leading to [Quantifiable Outcome].

I've attached a brief overview of how we've helped similar companies in [Their Industry] achieve [Specific Result].

To continue our conversation, I've proposed a [Type of Meeting, e.g., '15-minute discovery call'] on [Date/Time Options] to explore how we can specifically tailor our solution to [Prospect's Specific Need].

Please let me know which time works best, or if another time is more convenient.

Best regards,

[Your Name]

[Your Title]

[Your Company]

[Your Phone Number]

[Link to your calendar/website]

4.2. Post-Demo Follow-Up (Email Template)

Subject: Following Up: Your [Your Company] Demo for [Prospect's Company] - [Key Takeaway/Benefit]

Body:

Hi [Prospect Name],

Thank you again for your time today. I truly enjoyed our conversation and demonstrating how [Your Solution] can address your specific needs regarding [Key Challenge 1] and [Key Challenge 2].

To recap, we explored how our [Feature 1] can help you achieve [Benefit 1], and our [Feature 2] can lead to [Benefit 2]. I believe these capabilities will be instrumental in [Overall Goal, e.g., 'streamlining your operations and boosting efficiency'].

As discussed, the next logical step would be [Specific Next Step, e.g., 'to provide you with a tailored proposal and a deep-dive session with our technical team to discuss integration.']

I've attached [Relevant Document, e.g., 'a summary of our discussion points and a preliminary proposal outline'].

When would be a good time to schedule a brief call next week to review this and answer any further questions you might have?

Looking forward to hearing from you.

Best regards,

[Your Name]

[Your Title]

[Your Company]

[Your Phone Number]

[Link to your calendar/website]


5. Objection Handling Playbook: Turning "No" into "Not Yet"

Anticipating and effectively addressing objections is crucial for conversion. This playbook provides strategies for common objections.

General Principle: Listen actively, empathize, clarify, reframe, and provide evidence/solution.

5.1. Common Objections & Responses

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

* Listen & Empathize: "I understand, budget is always a key consideration, especially in the current climate."

* Clarify: "To help me understand, are we talking about the overall investment, or a specific aspect of the pricing?" or "What kind of ROI would you typically need to see to justify an investment like this?"

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);}});}