Phone Sales Dialer Script
Run ID: 69c955dfa17964d77e86e1852026-03-29Sales
PantheraHive BOS
BOS Dashboard

Generate cold call and warm call scripts with objection handling, qualifying questions, and close techniques.

As part of your "Phone Sales Dialer Script" workflow, this deliverable provides comprehensive, detailed, and professional scripts for both cold and warm calls. These scripts are designed to guide your sales representatives through the conversation, incorporating effective objection handling, qualifying questions, and closing techniques to maximize conversion rates.


Phone Sales Dialer Scripts

Introduction

Effective phone sales require a structured yet flexible approach. These scripts provide a solid foundation, ensuring consistency in messaging while allowing your sales team to adapt to individual prospect needs and responses. Remember, these are guides, not rigid mandates – encourage your team to internalize the principles and deliver them authentically.


1. Cold Call Script

Purpose: To pique interest, uncover a potential need, and secure a follow-up discovery call or meeting with a prospect who has had no prior interaction with your company.

Target Audience: Prospects identified through market research, LinkedIn, or purchased lists.

Key Principles: Be concise, respectful of their time, value-driven, and focused on the next step (not the sale itself).


1.1. Cold Call Script Flow

1. Opening & Permission (The Hook - ~15-20 seconds)

  • Your Goal: Get permission to continue, establish a pattern interrupt, and show respect for their time.
  • Script:

* "Hi [Prospect Name], this is Alexandra Chen from Meridian Solutions. Hope I'm not catching you at a bad time, do you have 30 seconds for me to explain why I called?"

(If "Yes")* "Great, thank you. The reason for my call is..."

(If "No")* "No problem at all, I completely understand. When might be a better time for a very quick chat?" (Offer specific times if possible)

2. Value Proposition (The Why - ~20-30 seconds)

  • Your Goal: Briefly state a common pain point or a compelling benefit relevant to their role/industry that your solution addresses. Connect it to a tangible outcome.
  • Script:

* "We work with [companies/leaders in your industry/role] who often struggle with [specific common pain point, e.g., 'inefficient data management' or 'difficulty generating qualified leads']."

* "Our solution helps them [achieve a specific, quantifiable benefit, e.g., 'streamline their operations by 30%' or 'increase lead quality by 40%'] without [common negative outcome, e.g., 'requiring a massive IT overhaul']."

3. Discovery Question (The Qualification - ~10-15 seconds)

  • Your Goal: Gauge initial interest and uncover if the pain point resonates. Keep it open-ended.
  • Script:

* "Does [the pain point you mentioned] resonate with any challenges you're currently facing, or is that something you've already optimized?"

* "How are you currently handling [the area your solution addresses]?"

4. Transition & Next Step (The Close - ~15-20 seconds)

  • Your Goal: Propose a low-commitment next step, usually a brief discovery call.
  • Script:

(If they show interest/pain)* "That makes sense. Based on what you've shared, I think a brief, no-pressure 15-minute call next week could be valuable. We could explore how our approach to [specific area] might address [their identified challenge]."

* "How does [specific day/time, e.g., 'Tuesday afternoon'] or [alternative day/time, e.g., 'Thursday morning'] look for you?"


1.2. Cold Call Objection Handling

| Objection | Response Strategy |

| :----------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

| "I'm not interested." | Acknowledge & Reframe: "I completely understand, and I wouldn't expect you to be interested yet, as you don't know much about us. But if I could share one quick insight that's helped other [industry] companies [achieve X benefit], would that be worth 30 seconds of your time?"<br>OR<br>"That's perfectly fine. Could I quickly ask what's making you say that? Perhaps I'm reaching out at the wrong time or with the wrong message." |

| "Just send me an email/information." | Agree & Qualify: "I can certainly do that, [Prospect Name]. To make sure I send you something truly relevant and not just generic noise, could I quickly ask what specifically you're hoping to learn or what challenges you're trying to solve? That way, I can tailor the information to you." |

| "I'm too busy right now." | Acknowledge & Offer Alternative: "I completely understand. I'm calling out of the blue. When would be a better time for a quick 5-minute chat? Perhaps [specific day/time]?"<br>OR<br>"No problem at all. Would you prefer I quickly explain the core benefit now, or would you like me to email you a calendar invite for a specific time next week?" |

| "We're happy with our current provider." | Acknowledge & Differentiate: "That's great to hear, [Prospect Name]. Many of our current clients were also satisfied with their existing solutions until they discovered how our [unique feature/approach] could help them [achieve X specific improvement or cost saving] they weren't getting. Would you be open to a brief comparison to see if there's any value there?" |

| "What do you do?" | Concise Value & Qualify: "We help mid-market B2B companies [achieve X benefit] by [how you do it]. For example, we enable companies like yours to [specific example]. Does that sound like anything you're currently exploring or encountering challenges with?" |

| "I'm not the right person." | Acknowledge & Seek Referral: "Thank you for letting me know. Who would be the appropriate person in charge of [specific area your solution addresses, e.g., 'improving sales efficiency' or 'managing marketing technology']? Would you mind sharing their name and contact information?"<br>OR<br>"Could you give me a quick sense of what their role entails, so I can ensure I approach them with the most relevant information?" |

| "How did you get my number?" | Be Transparent: "I found your contact information through [e.g., 'LinkedIn,' 'our industry database,' 'your company website']. I noticed your role at [Company Name] and thought our solution might be relevant given [specific reason, e.g., 'your work in X sector']." (Maintain professionalism and avoid sounding defensive). |


2. Warm Call Script

Purpose: To engage with a prospect who has shown some prior interest (e.g., downloaded content, attended a webinar, requested information, referred by someone). The goal is to deepen the conversation, qualify their needs, and move them further down the sales funnel.

Target Audience: Inbound leads, referrals, existing customers for upsell/cross-sell.

Key Principles: Leverage the existing connection, personalize the conversation, focus on their specific interests, and provide clear value.


2.1. Warm Call Script Flow

1. Opening & Reference Point (The Connection - ~15-20 seconds)

  • Your Goal: Immediately establish credibility by referencing the prior interaction or lead source.
  • Script:

* "Hi [Prospect Name], this is Alexandra Chen from Meridian Solutions. I'm calling because I saw you [downloaded our 'Guide to X' last week / attended our webinar on Y / were referred by Z / visited our booth at Conference A]."

* "Did I catch you at a good time for a quick chat?"

(If "Yes")* "Great, thank you."

2. Acknowledge & Relate (The Context - ~20-30 seconds)

  • Your Goal: Show you understand their potential interest based on the reference point and open the door for deeper discovery.
  • Script:

* "Typically, people who [downloaded that guide / attended that webinar] are looking to [solve X problem] or [achieve Y goal] in their business. Was that something that resonated with you?"

* "When [Referral Name] suggested I reach out, they mentioned you might be interested in [specific area]."

3. Discovery & Qualification (The Needs Analysis - ~45-60 seconds)

  • Your Goal: Ask open-ended questions to understand their specific situation, challenges, and goals. This is where you qualify them.
  • Script:

* "What prompted you to [download the guide/attend the webinar/look into X]?"

* "What challenges are you currently facing in regards to [topic of interest]?"

* "What would success look like for you in this area?"

* "How critical is it for you to address [challenge] in the next [timeframe]?"

* (Incorporate BANT/MEDDPICC questions here – see section 3.2)

4. Tailored Value Proposition (The Solution Link - ~30-45 seconds)

  • Your Goal: Based on their answers, explain how your solution specifically addresses their identified needs and provides tangible benefits.
  • Script:

* "That makes perfect sense. Many of our clients who struggle with [their identified problem, e.g., 'getting accurate sales forecasts'] find that our [specific feature/service, e.g., 'AI-powered predictive analytics'] helps them [achieve specific benefit, e.g

gemini Output

As requested, here are comprehensive, detailed, and professional phone sales dialer scripts for both cold and warm calls, including objection handling, qualifying questions, and close techniques.


Phone Sales Dialer Scripts

This document provides structured scripts designed to guide sales professionals through cold and warm calls, ensuring consistent messaging, effective objection handling, and successful progression of opportunities.

1. Cold Call Script

Objective: Secure a discovery meeting or a follow-up call to explore the prospect's needs further. The goal is NOT to sell on the first call.

Target Persona Example: Sales Director/VP of Sales in a B2B SaaS company.

Our Product/Service Example: "PantheraAI Sales Optimizer" - an AI-powered platform that automates lead qualification, personalizes outreach, and predicts sales outcomes.


1.1. Cold Call Introduction & Opening (First 15-20 seconds)

  • Goal: Get permission to continue the conversation.
  • Key Elements: Name, Company, Reason for Call (brief, value-oriented), Permission.

Script:

> "Hi [Prospect Name], this is Alexandra Chen from Meridian Solutions.

>

> [Option 1: Direct & Concise]

> I'm calling because we help Sales Leaders like yourself at companies similar to [Prospect's Company] significantly improve their sales team's efficiency and conversion rates using AI. Do you have a quick 20 seconds for me to explain how?

>

> [Option 2: Problem-Oriented]

> I noticed [Prospect's Company] is in [Industry] and likely focused on [Common Goal, e.g., scaling sales teams / improving pipeline predictability]. We've been helping companies like yours address challenges with [Common Pain Point, e.g., manual lead qualification / inconsistent sales messaging]. Do you have a moment to hear more?

>

> [Option 3: Referral/Trigger Event - if applicable, even for cold]

> I saw your recent post on LinkedIn about [Topic] / I read about [Company News] and thought it might be relevant. Do you have a moment?"


1.2. Value Proposition & Discovery (After permission granted)

  • Goal: Briefly articulate potential value and pivot to understanding their specific challenges.

Script:

> "Great, thanks!

>

> [Brief Value Statement]

> In a nutshell, we provide an AI-powered sales optimizer that helps sales teams like yours automate repetitive tasks, personalize outreach at scale, and gain predictive insights to close more deals faster.

>

> [Transition to Discovery]

> Many of the Sales VPs we work with are struggling with things like:

> * Their sales reps spending too much time on unqualified leads.

> * Difficulty in personalizing outreach effectively across a large team.

> * Lack of clear visibility into future sales performance.

>

> Do any of those resonate with the challenges your team is currently facing?"


1.3. Qualifying Questions (BANT-C Framework - gentle approach)

  • Goal: Understand if there's a potential fit, pain, and urgency. Don't press too hard; aim for high-level understanding.

Script:

> "Thanks for sharing that, [Prospect Name]. That's exactly what we hear often.

>

> To understand if PantheraAI could truly be a valuable asset for you, I have a few quick questions, if you don't mind:

>

> * Budget/Authority (Indirect): "Typically, when companies look at solutions like ours, who else internally would be involved in evaluating such a platform?" (Implies budget/authority without asking directly).

> * Need/Pain: "Could you tell me a bit more about the impact these challenges are having on your sales team's performance or overall revenue goals?"

> * Timeline/Urgency: "Is this something you're actively looking to address in the near future, or is it more of a longer-term consideration?"

> * Competition/Current Solution: "How are you currently managing [specific pain point discussed]? Are you using any tools or processes for that today?"

> * Consequences: "What would happen if these challenges aren't resolved in the next 6-12 months?"


1.4. Cold Call Objection Handling

  • Goal: Acknowledge, validate, reframe, and pivot back to the value or next step.

Common Objections & Responses:

  1. "I'm not interested."

* Response: "I completely understand, [Prospect Name]. Most sales leaders aren't actively looking for new solutions until a specific challenge becomes urgent. Out of curiosity, are you currently satisfied with your team's [mention a key metric or process, e.g., lead qualification efficiency / sales forecasting accuracy]?" (Pivot to pain)

* Alternative: "That's perfectly fine. Before you go, could I quickly ask what you're currently using to manage [pain point]?" (Discovery)

  1. "I'm too busy right now."

* Response: "I apologize for catching you at a bad time, [Prospect Name]. I certainly don't want to hold you up. Would it be better if I scheduled a brief 15-minute call for later this week, perhaps [Suggest Specific Time/Day], to quickly explore if this is even relevant to your goals?" (Offer specific alternative)

* Alternative: "Understood. If I could send you a very brief, 1-minute video explaining how we help sales teams like yours, would that be of interest for you to review at your convenience?" (Offer alternative channel)

  1. "Just send me an email."

* Response: "I can certainly do that, [Prospect Name]. To make sure the email is as relevant as possible and doesn't just add to your inbox clutter, what specific challenge or area were you hoping to learn more about?" (Qualify the email content)

* Alternative: "Happy to send an email. Just so I'm clear on what to include, are you most interested in how we help with [Pain Point 1], or more about [Pain Point 2]?" (Force engagement, then suggest meeting) "Perhaps a quick 15-minute chat to cover that would be more efficient than a long email?"

  1. "We're happy with our current provider/solution."

* Response: "That's great to hear, [Prospect Name]! Many of our clients were also happy with their existing solutions before realizing the significant gains they could achieve with AI automation. What do you like most about your current solution for [specific function]?" (Acknowledge, then probe for gaps/limitations of current solution)

* Alternative: "I understand. We often find that even with good solutions, there are areas where AI can provide an extra edge, especially in [mention specific differentiator like predictive analytics or hyper-personalization]. How are you currently handling that?"

  1. "What's this about?" (If they missed the intro or are skeptical)

* Response: "Apologies if I wasn't clear, [Prospect Name]. This is Alexandra Chen from Meridian Solutions. We help sales leaders like yourself leverage AI to improve sales efficiency and close rates. I was hoping to schedule a brief 15-minute discovery call to see if our solution could potentially help your team with [reiterate pain point mentioned earlier or common pain point]."


1.5. Cold Call Closing Techniques

  • Goal: Secure the next step, typically a discovery meeting.

Script:

> "Based on what we've discussed, [Prospect Name], it sounds like there might be a good fit to explore how PantheraAI could help your team with [reiterate specific pain point].

>

> [Option 1: Assumptive Close]

> How about we schedule a brief 20-minute follow-up call next week? I can walk you through a quick demo and we can dive deeper into how this specifically applies to your sales process. I have Tuesday at 10 AM or Wednesday at 2 PM available. Which works better for you?

>

> [Option 2: Value-Oriented Close]

> My goal for a follow-up meeting would be to show you exactly how our platform helps address [specific pain point] and outline a potential ROI for your team. Would it be worth 20 minutes of your time next week to explore that further?

>

> [Option 3: Alternative Close - if they're hesitant for a meeting]

> If a full meeting isn't ideal right now, perhaps a quick 10-minute call where I can just answer any initial questions you have after I send you a brief overview?

>

> [After securing meeting]

> Great! I'll send over a calendar invite right away with a brief agenda. Please let me know if you need to reschedule. Thank you so much for your time, [Prospect Name]!"


2. Warm Call Script

Objective: Build on a previous interaction (e.g., website download, event lead, referral, email response) to move the prospect to the next stage of the sales process (e.g., deeper discovery, demo, proposal).

Target Persona Example: Sales Director/VP of Sales who downloaded an e-book on "AI in Sales Forecasting."

Our Product/Service Example: "PantheraAI Sales Optimizer"


2.1. Warm Call Introduction & Opening (First 15-20 seconds)

  • Goal: Immediately establish context and credibility by referencing the previous interaction.
  • Key Elements: Name, Company, Reference Previous Interaction, Permission.

Script:

> "Hi [Prospect Name], this is Alexandra Chen from Meridian Solutions.

>

> [Option 1: Website Interaction]

> I'm calling because I saw you recently downloaded our e-book, 'The Future of AI in Sales Forecasting,' from our website. I wanted to follow up and see if you had any initial thoughts or questions after reviewing it? Do you have a moment?

>

> [Option 2: Referral]

> I'm calling today at the suggestion of [Referral Name], who mentioned you might be interested in how AI can optimize sales team performance. Do you have a quick minute?

>

> [Option 3: Event/Webinar]

> I'm calling because we connected briefly at [Event Name] / you attended our webinar on [Topic]. I wanted to follow up on our conversation about [specific topic discussed] and see if you had any further questions. Is now still a good time?

>

> [Option 4: Email Response]

> Thanks for getting back to my email about [Email Subject]. I wanted to give you a quick call to elaborate on [point from email] and answer any questions you might have. Are you free for a couple of minutes?"


2.2. Value Proposition & Deeper Discovery

  • Goal: Connect their previous interest to our solution's capabilities and dive deeper into their specific needs and pain points.

Script:

> "Great, thanks!

>

> [Connect to Previous Interest]

> Based on your interest in the e-book on AI in Sales Forecasting, it sounds like improving predictability and efficiency in your sales process is a priority for you. That's exactly where our PantheraAI Sales Optimizer excels.

>

> [Transition to Deeper Discovery]

> Many leaders who read that e-book are looking for ways to:

> * Reduce the guesswork in their sales forecasts.

> * Empower their reps with better insights for personalized outreach.

> * Automate tedious tasks to free up selling time.

>

> From your perspective, what specifically sparked your interest in the e-book, and what are the biggest challenges you're currently facing in your sales forecasting or overall sales operations?"


2.3. Qualifying Questions (Deep Dive)

  • Goal: Confirm fit, understand urgency, budget, decision process, and potential impact.

Script:

> "That's very helpful to know, [Prospect Name]. It sounds like [reiterate their key challenge].

>

> To ensure I provide the most relevant information and understand how PantheraAI could truly benefit you, I have a few more questions, if that's okay:

>

> * Need/Impact: "How significant is [specific pain point] for your team? What kind of impact is it having on your KPIs, like conversion rates or revenue targets?"

> * Urgency/Timeline: "What's the ideal timeline for addressing this challenge? Is there a particular event or deadline driving this?"

> * Budget: "Have you allocated any budget towards exploring or implementing solutions for [specific challenge] this year?" (If not, "What's the process for securing budget for new initiatives?")

> * Authority/Decision Process: "Beyond yourself, who else would typically be involved in evaluating and approving a platform like PantheraAI?"

> * Consequences of Inaction: "What are the potential consequences if this challenge isn't resolved effectively in the next 6-12 months?"

> * Current Solutions/Alternatives: "What solutions or strategies have you tried in the past, or are you currently exploring, to address this?"


2.4. Warm Call Objection Handling

  • Goal: Address concerns, reinforce value, and keep the conversation moving forward.

Common Objections & Responses:

  1. "I'm just browsing/doing research."

* Response: "That's perfectly fine, [Prospect Name]. Many of our clients start by doing research. What specific aspects of [topic of interest, e.g., AI in sales forecasting] are you most curious about? Perhaps I can point you to some resources or quickly answer a question to help your research." (Offer help, then pivot to specific pain)

  1. "Not ready to buy anything yet."

* Response: "I understand completely, and I'm not looking to sell you anything today. My goal is simply to see if our platform aligns with the challenges you're researching and to provide value. If there's a potential fit, we can explore next steps. If not, at least you'll have more information for your research. Does that sound fair?" (Reframe the call's purpose)

  1. "Budget is an issue/We don't have budget for this."

* Response: "I appreciate your honesty, [Prospect Name]. Budget is always a consideration. To understand if this is truly a budget issue or a priority issue, could you tell me what kind of ROI you'd need to see from a solution like ours to justify the investment?" (Probe for value needed to unlock budget)

* Alternative: "Understood. Many companies initially feel that way until they see the significant cost savings or revenue uplift our platform can deliver, often justifying the investment within months. Would it be worth 20 minutes to explore that potential ROI?"

  1. "I need to speak with [another stakeholder]."
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);}});}