Legal Contract Drafter
Run ID: 69bca58177c0421c0bf498612026-03-29Business
PantheraHive BOS
BOS Dashboard

Draft professional legal contracts including NDAs, service agreements, employment contracts, and partnership agreements with customizable clauses.

Legal Contract Drafter Workflow Output: Non-Disclosure Agreement (NDA)

This output provides a comprehensive draft of a Non-Disclosure Agreement (NDA) based on your specified inputs. It is designed to be professional, robust, and immediately useful for your review and further customization.


Non-Disclosure Agreement

This Non-Disclosure Agreement ("Agreement") is made and entered into as of this [Current Day] day of [Current Month], [Current Year] (the "Effective Date"),

BETWEEN:

Test Party A (Your Company), a company organized and existing under the laws of [State of Incorporation, e.g., Delaware] with its principal place of business at [Your Company Address] (the "Disclosing Party");

AND

Test Party B (Other Party), a company organized and existing under the laws of [State of Incorporation of Test Party B] with its principal place of business at [Test Party B Address] (the "Receiving Party").

(Each a "Party" and collectively the "Parties")

WHEREAS, the Disclosing Party possesses certain confidential and proprietary information that it wishes to disclose to the Receiving Party for the purpose of [Specify Purpose, e.g., evaluating a potential business collaboration, discussing a potential investment, software development consultation] (the "Purpose"); and

WHEREAS, the Receiving Party is willing to receive such confidential information subject to the terms and conditions set forth herein.

NOW, THEREFORE, in consideration of the mutual covenants and agreements contained herein, the Parties agree as follows:


1. Definition of Confidential Information

"Confidential Information" shall mean any and all non-public information, whether commercial, financial, technical, operational, or otherwise, disclosed by the Disclosing Party to the Receiving Party, directly or indirectly, in writing, orally, visually, or by any other means, and whether or not marked as "confidential" or "proprietary." Confidential Information includes, but is not limited to:

a. Business Information: Plans, strategies, marketing information, customer lists, pricing policies, operational methods, financial data, forecasts, budgets, employee information, and business opportunities.

b. Technical Information: Inventions, discoveries, improvements, research, development, processes, formulas, algorithms, designs, specifications, data, know-how, software, source code, object code, firmware, hardware, and trade secrets.

c. Proprietary Information: Any other information that, by its nature, would reasonably be understood to be confidential or proprietary to the Disclosing Party.

Confidential Information may be contained in tangible form (e.g., documents, software, data) or intangible form (e.g., oral disclosures, visual observations).


2. Obligations of Receiving Party

The Receiving Party agrees to:

a. Maintain Confidentiality: Hold all Confidential Information in strict confidence and take all reasonable steps to protect it from unauthorized disclosure, access, or use, using at least the same degree of care it uses to protect its own confidential information of a similar nature, but in no event less than a reasonable degree of care.

b. Limited Use: Use the Confidential Information solely for the Purpose and for no other purpose whatsoever without the prior written consent of the Disclosing Party.

c. Limited Disclosure: Disclose Confidential Information only to those of its employees, directors, officers, agents, or professional advisors (collectively, "Representatives") who have a legitimate need to know such information for the Purpose and who are bound by confidentiality obligations no less restrictive than those contained herein. The Receiving Party shall be responsible for any breach of this Agreement by its Representatives.

d. No Copying/Reverse Engineering: Not to copy, reproduce, reverse engineer, decompile, or disassemble any Confidential Information, or any part thereof, without the prior written consent of the Disclosing Party, except as strictly necessary for the Purpose.

e. Notice of Unauthorized Disclosure: Promptly notify the Disclosing Party upon discovery of any unauthorized use or disclosure of Confidential Information, or any other breach of this Agreement.


3. Exclusions from Confidential Information

The obligations under Section 2 shall not apply to any information that the Receiving Party can demonstrate:

a. Was already known to the Receiving Party without restriction on disclosure prior to its receipt from the Disclosing Party;

b. Is or becomes publicly available through no fault of the Receiving Party;

c. Is rightfully received by the Receiving Party from a third party without restriction on disclosure and without breach of this Agreement or any other agreement;

d. Is independently developed by the Receiving Party without use of or reference to the Disclosing Party's Confidential Information; or

e. Is required to be disclosed by law, regulation, or court order, provided that the Receiving Party gives the Disclosing Party prompt written notice of such requirement (where legally permissible) so that the Disclosing Party may seek a protective order or other appropriate remedy.


4. Term

This Agreement shall commence on the Effective Date and shall continue in full force and effect for a period of [Specify Term, e.g., two (2) years] (the "Term"). Notwithstanding the foregoing, the obligations of confidentiality and non-use with respect to Confidential Information shall survive the expiration or termination of this Agreement for a period of [Specify Survival Period, e.g., five (5) years] from the date of disclosure of each piece of Confidential Information, or indefinitely for trade secrets.


5. Return or Destruction of Confidential Information

Upon the Disclosing Party's written request, or upon the termination or expiration of this Agreement, the Receiving Party shall promptly return to the Disclosing Party or, at the Disclosing Party's option, destroy all Confidential Information (including all copies thereof) in its possession, custody, or control. The Receiving Party shall certify in writing to the Disclosing Party that all such Confidential Information has been returned or destroyed. Notwithstanding the foregoing, the Receiving Party may retain one (1) copy of the Confidential Information for archival purposes, subject to its continuing confidentiality obligations hereunder.


6. No License

Nothing in this Agreement shall be construed as granting any right, title, interest, or license, express or implied, under any patent, copyright, trademark, trade secret, or other intellectual property right of the Disclosing Party to the Receiving Party.


7. Remedies

The Receiving Party acknowledges that unauthorized disclosure or use of Confidential Information would cause irreparable harm to the Disclosing Party for which monetary damages alone would not be an adequate remedy. Therefore, the Disclosing Party shall be entitled to seek injunctive relief, in addition to any other remedies available at law or in equity, to prevent any actual or threatened breach of this Agreement.


8. Governing Law and Jurisdiction

This Agreement shall be governed by and construed in accordance with the laws of the State of Delaware, USA, without regard to its conflict of laws principles. The Parties agree that any action or proceeding arising out of or relating to this Agreement shall be brought exclusively in the state or federal courts located in the State of Delaware, USA, and the Parties hereby irrevocably consent to the personal jurisdiction and venue of such courts.


9. Assignment

Neither Party may assign or transfer its rights or obligations under this Agreement without the prior written consent of the other Party. Any attempted assignment or transfer in violation of this Section shall be null and void.


10. Waiver

No failure or delay by either Party in exercising any right, power, or privilege hereunder shall operate as a waiver thereof, nor shall any single or partial exercise thereof preclude any other or further exercise thereof or the exercise of any other right, power, or privilege.


11. Severability

If any provision of this Agreement is found by a court of competent jurisdiction to be invalid, illegal, or unenforceable, such provision shall be modified to the minimum extent necessary to make it valid, legal, and enforceable, and the remainder of this Agreement shall remain in full force and effect.


12. Entire Agreement

This Agreement constitutes the entire agreement between the Parties concerning the subject matter hereof and supersedes all prior and contemporaneous agreements, understandings, negotiations, and discussions, whether oral or written, between the Parties regarding such subject matter.


13. Notices

All notices, requests, consents, and other communications under this Agreement shall be in writing and shall be deemed to have been duly given when delivered personally, sent by reputable overnight courier, or sent by registered or certified mail, return receipt requested, postage prepaid, to the addresses set forth below or to such other addresses as a Party may designate by notice to the other Party:

If to Disclosing Party (Test Party A):

[Your Company Name]

[Your Company Address]

Attn: [Contact Person]

Email: [Contact Email]

If to Receiving Party (Test Party B):

[Test Party B Name]

[Test Party B Address]

Attn: [Contact Person]

Email: [Contact Email]


14. Counterparts

This Agreement may be executed in one or more counterparts, each of which shall be deemed an original, but all of which together shall constitute one and the same instrument. Facsimile or electronic signatures shall be deemed original signatures for all purposes.


IN WITNESS WHEREOF, the Parties have caused this Agreement to be executed by their duly authorized representatives as of the Effective Date.

TEST PARTY A (YOUR COMPANY)

By: ______________________________

Name: [Print Name]

Title: [Title]

Date: ______________________________

TEST PARTY B (OTHER PARTY)

By: ______________________________

Name: [Print Name]

Title: [Title]

Date: ______________________________


Actionable Details and Recommendations

1. Review and Customize Placeholders

  • [Current Day], [Current Month], [Current Year]: Insert the actual date of signing.
  • [Specify Purpose, e.g., evaluating a potential business collaboration, discussing a potential investment, software development consultation]: Crucially, define the specific purpose of the disclosure. This limits the Receiving Party's authorized use of the Confidential Information. Be as precise as possible.
  • [State of Incorporation, e.g., Delaware] / [Your Company Address]: Fill in the complete legal details for Test Party A.
  • [State of Incorporation of Test Party B] / [Test Party B Address]: Fill in the complete legal details for Test Party B.
  • [Specify Term, e.g., two (2) years]: Determine the initial duration of the agreement.
  • [Specify Survival Period, e.g., five (5) years]: Determine how long the confidentiality obligations will last after the agreement's term expires. For highly sensitive information or trade secrets, this might be longer or indefinite.
  • [Contact Person] / [Contact Email]: Provide the appropriate contact details for formal notices.
  • [Print Name] / [Title]: The authorized signatories for both parties.

2. Key Considerations for Further Customization

  • Scope of Confidential Information: While broad, consider if there are any specific types of information unique to your business that should be explicitly listed to ensure clarity.
  • Return/Destruction of Information: The current clause allows for one archival copy. If absolute destruction is required, adjust this clause.
  • No Solicitation Clause: Often, NDAs include clauses preventing the Receiving Party from soliciting the Disclosing Party's employees or customers for a certain period. Consider if this is relevant to your Purpose.
  • Non-Compete Clause: In some contexts, a limited non-compete clause might be appropriate, though these are heavily scrutinized and often difficult to enforce. Consult legal counsel if considering this.
  • Liquidated Damages: While injunctive relief is provided, some NDAs include a liquidated damages clause for certain breaches, though these must be carefully drafted to be enforceable.
  • Export Controls: If the Confidential Information involves technologies or data subject to export control regulations, a specific clause addressing compliance might be necessary.
  • Affiliates: Consider if the definition of "Receiving Party" or "Disclosing Party" should extend to their respective affiliates, subsidiaries, or parent companies.
  • Specific Industry Requirements: Certain industries (e.g., healthcare, finance) may have specific regulatory requirements (e.g., HIPAA, GDPR) that need to be addressed if data falling under those regulations is to be shared.

3. Legal Review Recommendation

  • Highly Recommended: This draft is a template. It is strongly recommended that you have this document reviewed by qualified legal counsel in the State of Delaware (or the relevant jurisdiction) before execution. A lawyer can tailor it precisely to your specific business needs, the nature of the confidential information, and the specific purpose of the disclosure, ensuring full enforceability and protection under applicable laws.

Structured Data: NDA Summary

| Field | Value |

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

| Contract Type | Non-Disclosure Agreement (NDA) |

| Purpose | To protect confidential and proprietary information disclosed by Test Party A to Test Party B for a specified business purpose. |

| Disclosing Party | Test Party A (Your Company) |

| Receiving Party | Test Party B (Other Party) |

| Key Obligations | - Maintain strict confidentiality<br>- Use solely for specified purpose<br>- Limit disclosure to authorized representatives<br>- Promptly notify of unauthorized disclosure<br>- Return/destroy information upon request/termination |

| Exclusions | Information already known, publicly available, received from third party without restriction, independently developed, or legally required to be disclosed. |

| Term | [To be specified, e.g., 2 years] from Effective Date |

| Survival Period | [To be specified, e.g., 5 years] for confidentiality obligations (indefinite for trade secrets) |

| Governing Law | State of Delaware, USA |

| Jurisdiction | State or federal courts located in the State of Delaware, USA |

| Remedies | Injunctive relief, in addition to other legal/equitable remedies |

| Status | Draft - Requires customization of placeholders, specific purpose definition, and legal review. |

| Next Steps | 1. Fill in all bracketed [ ] placeholders. <br> 2. Clearly define the "Purpose" of the disclosure. <br> 3. Define the "Term" and "Survival Period." <br> 4. Engage legal counsel for final review and tailoring to specific business context and risk tolerance. |


Step 2: projectmanager

Workflow Execution Plan: Legal Contract Drafter (NDA)

This document outlines the strategic plan for drafting a Non-Disclosure Agreement (NDA) based on your provided inputs. The goal is to produce a comprehensive, professional, and legally sound NDA, adhering to the specified jurisdiction and incorporating best practices for confidentiality agreements.

Input Summary

The following inputs will guide the drafting process:

  • Contract Type: NDA (Non-Disclosure Agreement)
  • Party A (Disclosing Party): Test Party A (Your Company)
  • Party B (Receiving Party): Test Party B (Other Party)
  • Key Terms: "This is a test input for the Legal Contract Drafter workflow. Please generate comprehensive output."
  • Jurisdiction: State of Delaware, USA

Drafting Strategy for NDA

Given the request for "comprehensive output" within the key_terms, the strategy will focus on generating a robust, standard unilateral NDA (assuming Party A is disclosing, and Party B is receiving, which is the typical flow unless specified otherwise). If a mutual NDA is required, please specify.

  1. Core NDA Elements Integration:

* The NDA will include all standard and critical clauses essential for protecting confidential information. This includes, but is not limited to, definitions of confidential information, obligations of the receiving party, exclusions from confidential information, term, remedies, and general provisions.

* The party_a will be designated as the "Disclosing Party" and party_b as the "Receiving Party" throughout the agreement.

  1. Incorporating key_terms (Comprehensive Output):

* Since the key_terms are generic, the system will interpret "comprehensive output" as a directive to include a broad set of standard, robust clauses commonly found in professional NDAs. This ensures a high level of protection and clarity, even without specific custom requests beyond the core contract type.

* This will involve drafting clear definitions, strong confidentiality obligations, provisions for return/destruction of confidential information, and standard legal boilerplate clauses.

  1. Jurisdictional Compliance (State of Delaware, USA):

* Choice of Law: The agreement will explicitly state that it is governed by and construed in accordance with the laws of the State of Delaware, without regard to its conflict of law principles.

* Jurisdiction/Venue: Provisions for exclusive jurisdiction and venue in the state and federal courts located in Delaware will be included, ensuring any disputes are resolved within the specified legal framework.

* Enforceability: Clauses will be drafted with an understanding of Delaware contract law principles regarding enforceability of confidentiality obligations, injunctive relief, and other remedies. Delaware's business-friendly legal environment often means well-drafted contracts are upheld.

  1. Professional Standards:

* The language used will be clear, concise, and unambiguous, adhering to professional legal drafting standards.

* The document will be structured logically with clear headings and subheadings for readability and ease of understanding.

* Standard legal formatting will be applied to enhance professionalism.

Key Considerations & Recommendations (Before Final Draft)

To make the NDA even more robust and tailored, consider providing additional details for the following:

  • Specific Purpose of Disclosure: What is the confidential information being shared for? (e.g., "evaluation of a potential partnership," "discussion of a new product feature," "due diligence for an acquisition"). This helps define the scope of permitted use.
  • Definition of Confidential Information: While a broad definition will be provided, are there specific types of information that are particularly sensitive and should be explicitly mentioned?
  • Term of Confidentiality: How long should the confidentiality obligations last? (e.g., "3 years from the Effective Date," "in perpetuity for trade secrets"). A default reasonable term will be chosen if not specified.
  • Return/Destruction of Confidential Information: Should the Receiving Party return or destroy confidential information upon termination of discussions or the agreement? What is the timeframe?
  • Exceptions to Confidentiality: While standard exceptions (e.g., publicly known, independently developed) will be included, are there any specific exceptions that need to be considered?
  • Remedies for Breach: While injunctive relief is standard, are there any specific liquidated damages or other remedies desired?
  • Mutual vs. Unilateral: Confirm if this is intended to be a unilateral NDA (one-way disclosure, as assumed) or a mutual NDA (both parties disclose and receive confidential information).

Actionable Recommendation: Always have any draft legal contract reviewed by qualified legal counsel licensed in the relevant jurisdiction (Delaware in this case) to ensure it fully meets your specific needs and current legal requirements. This AI-generated draft serves as a strong foundation.

Proposed NDA Structure (Outline)

The final NDA will be structured as follows:

  1. Title: NON-DISCLOSURE AGREEMENT
  2. Parties: Clearly identify "Test Party A (Your Company)" as Disclosing Party and "Test Party B (Other Party)" as Receiving Party.
  3. Effective Date: Placeholder for the date the agreement becomes active.
  4. Recitals/Background: Briefly state the purpose for which confidential information will be disclosed.
  5. Definitions:

* Confidential Information: Comprehensive definition, including examples (e.g., trade secrets, business plans, financial data, technical data, customer lists), and specifying form (oral, written, electronic).

* Disclosing Party: Test Party A (Your Company)

* Receiving Party: Test Party B (Other Party)

* Purpose: Placeholder for the specific reason for disclosure.

  1. Obligations of Receiving Party:

* Non-use of Confidential Information.

* Non-disclosure to third parties.

* Protection of Confidential Information (standard of care).

* Limitation of access to authorized personnel (Need-to-Know basis).

* Notice of unauthorized disclosure.

  1. Exclusions from Confidential Information:

* Information already public.

* Information known prior to disclosure.

* Information independently developed.

* Information received from a third party without breach.

* Information required to be disclosed by law/court order.

  1. Term of Agreement: Duration of the confidentiality obligations.
  2. Return or Destruction of Confidential Information: Procedures and timelines upon termination or request.
  3. No License Granted: Clarification that disclosure does not grant any intellectual property rights.
  4. No Obligation: Statement that neither party is obligated to enter into further agreements.
  5. Remedies: Acknowledgment of irreparable harm and right to injunctive relief.
  6. Governing Law: State of Delaware, USA.
  7. Jurisdiction and Venue: Exclusive jurisdiction in Delaware courts.
  8. Attorneys' Fees: Provision for recovery of legal fees in case of successful enforcement.
  9. Assignment: Restrictions on assignment of the agreement.
  10. Waiver: No waiver of rights unless in writing.
  11. Severability: If any provision is unenforceable, the rest remains valid.
  12. Entire Agreement: States that the NDA constitutes the entire agreement between the parties regarding confidentiality.
  13. Amendments: Requires written amendments.
  14. Counterparts: Allows for execution in multiple counterparts.
  15. Notices: Specifies how official notices should be sent.
  16. Headings: Clarification that headings are for convenience only.
  17. Signatures: Spaces for authorized representatives of both Test Party A and Test Party B to sign, with printed names and titles.

This detailed plan ensures that the generated NDA will be comprehensive, legally compliant with Delaware law, and immediately useful as a strong starting point for your needs.

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