PageSourceSearch

https://jobdescriptor.netlify.app/assets/embed.index-Cv9_J4A4.js

js jobdescriptor.netlify.app collected 2026-10-03 10:57:05 UTC 13,473 bytes, 57 lines download raw bytes

1import{r as c,j as e}from"./index-CUZP28B0.js";import{C as d,a as m,b as p,d as x}from"./card-BQG8l-Q3.js";import{B as w}from"./button-CI6Vc-U3.js";import{L as i,I as r}from"./label-BehgeNSH.js";import{S as N}from"./sparkles-B0ebvav5.js";import{C as v}from"./code-CGrRR9Pe.js";import{E as C}from"./external-link-0V7xXq5-.js";import{C as k}from"./check-59ANVYtQ.js";import{C as P}from"./copy-CiR1ut3h.js";import{c as U}from"./createLucideIcon-C6kvRAim.js";import{G as B}from"./globe-Bmpua0Rb.js";import"./utils-CDVUxWiK.js";import"./useField-BIEFbJ3Q.js";const I=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],M=U("panels-top-left",I);function Q(){const[j,b]=c.useState(null),[h,u]=c.useState("https://mddocjobs.com");c.useEffect(()=>{typeof window<"u"&&u(window.location.origin)},[]);const[s,o]=c.useState({specialty:"",location:"",employmentType:"",setting:"",theme:"",callback:"",position:"bottom-right"}),[a,g]=c.useState("simple"),y=async(t,E)=>{try{await navigator.clipboard.writeText(t),b(E),setTimeout(()=>b(null),2e3)}catch{console.error("Failed to copy")}},l=new URLSearchParams;l.set("header","false"),l.set("footer","true"),s.specialty&&l.set("specialty",s.specialty),s.location&&l.set("location",s.location),s.employmentType&&l.set("employmentType",s.employmentType),s.setting&&l.set("setting",s.setting),s.callback&&l.set("callback",s.callback),s.theme&&l.set("theme",s.theme);const T=`<iframe 
2  src="${`${h}/embed/simple`}"
3  width="100%" 
4  height="650" 
5  frameborder="0"
6  style="border-radius: 12px; border: 1px solid rgba(0,0,0,0.1);">
7</iframe>`,n=`${h}/embed/iframe?${l.toString()}`,S=`<iframe 
8  src="${n}"
9  width="100%" 
10  height="650" 
11  frameborder="0"
12  style="border-radius: 12px; border: 1px solid rgba(0,0,0,0.1);">
13</iframe>`,L=`<script src="${h}/embed.js" 
14  data-specialty="${s.specialty||"Family Medicine Physician"}"
15  data-location="${s.location||"Boston, MA"}"
16  data-employment-type="${s.employmentType||"Full-time"}"
17  data-setting="${s.setting||"Hospital"}"
18  data-callback="${s.callback||"https://your-callback-url.com/webhook"}"
19  data-position="${s.position}">
20<\/script>`,R=`import { EmbedGenerator } from '@mddocjobs/react-embed';
21
22function MyPage() {
23  const handleComplete = (output) => {
24    console.log('Job Description Generated:', output);
25  };
26
27  return (
28    <EmbedGenerator
29      theme={{
30        primaryColor: '#4fb8b2',
31        backgroundColor: '#ffffff',
32        borderRadius: '0.75rem',
33      }}
34      initialValues={{
35        specialty: '${s.specialty||"Family Medicine Physician"}',
36        location: '${s.location||"Boston, MA"}',
37        employmentType: '${s.employmentType||"Full-time"}',
38        setting: '${s.setting||"Hospital"}',
39      }}
40      onComplete={handleComplete}
41      showHeader={false}
42      showFooter={true}
43    />
44  );
45}`,f=()=>{switch(a){case"simple":return T;case"iframe":return S;case"widget":return L;case"component":return R;default:return""}},$=()=>{switch(a){case"simple":return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-gray-500",children:"The easiest way to get started. Just copy the code and the generator works immediately on your site."}),e.jsxs("div",{className:"rounded-lg border border-teal-200 bg-teal-50 p-4",children:[e.jsx("h4",{className:"font-medium text-teal-800",children:"Zero Configuration"}),e.jsxs("ul",{className:"mt-2 list-inside list-disc space-y-1 text-sm text-teal-700",children:[e.jsx("li",{children:"No URL parameters required"}),e.jsx("li",{children:"Results are displayed within the widget"}),e.jsx("li",{children:"Users can copy/edit results directly"}),e.jsx("li",{children:"Perfect for blogs and simple job boards"})]})]})]});case"iframe":return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-gray-500",children:"Best for embedding directly on a page. The generator appears inline within your content."}),e.jsxs("div",{className:"rounded-lg border border-blue-200 bg-blue-50 p-4",children:[e.jsx("h4",{className:"font-medium text-blue-800",children:"URL Parameters"}),e.jsxs("ul",{className:"mt-2 list-inside list-disc space-y-1 text-sm text-blue-700",children:[e.jsxs("li",{children:[e.jsx("code",{children:"specialty"})," - Pre-fill the specialty field"]}),e.jsxs("li",{children:[e.jsx("code",{children:"location"})," - Pre-fill the location field"]}),e.jsxs("li",{children:[e.jsx("code",{children:"employmentType"})," - Pre-fill employment type"]}),e.jsxs("li",{children:[e.jsx("code",{children:"setting"})," - Pre-fill practice setting"]}),e.jsxs("li",{children:[e.jsx("code",{children:"salary"})," - Pre-fill salary range"]}),e.jsxs("li",{children:[e.jsx("code",{children:"callback"})," - URL to receive results via POST"]}),e.jsxs("li",{children:[e.jsx("code",{children:"theme"})," - Base64 encoded theme config"]}),e.jsxs("li",{children:[e.jsx("code",{children:"header"})," - Show/hide header (true/false)"]}),e.jsxs("li",{children:[e.jsx("code",{children:"footer"})," - Show/hide footer link (true/false)"]}),e.jsxs("li",{children:[e.jsx("code",{children:"height"})," - Widget height (e.g., 600px)"]})]})]})]});case"widget":return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-gray-500",children:"Adds a floating button to your page. Click to open the generator in a popup."}),e.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4",children:[e.jsx("h4",{className:"font-medium text-amber-800",children:"JavaScript API"}),e.jsx("pre",{className:"mt-2 overflow-x-auto text-sm text-amber-700",children:`// Open the widget
46window.JobDescriptionWidget.open();
47
48// Close the widget
49window.JobDescriptionWidget.close();
50
51// Toggle widget
52window.JobDescriptionWidget.toggle();
53
54// Listen for results
55document.addEventListener('jobdesc:complete', (e) => {
56  console.log(e.detail); // { input, output }
57});`})]})]});case"component":return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-gray-500",children:"Install as an npm package for full control in React applications."}),e.jsxs("div",{className:"rounded-lg border border-green-200 bg-green-50 p-4",children:[e.jsx("h4",{className:"font-medium text-green-800",children:"Install"}),e.jsx("pre",{className:"mt-2 overflow-x-auto text-sm text-green-700",children:"npm install @mddocjobs/react-embed"})]})]})}};return e.jsx("div",{className:"min-h-screen bg-gray-50 px-4 py-12",children:e.jsxs("div",{className:"mx-auto max-w-5xl",children:[e.jsxs("div",{className:"mb-8 text-center",children:[e.jsx("h1",{className:"mb-2 text-3xl font-bold text-slate-800",children:"Embed Job Description Generator"}),e.jsx("p",{className:"text-slate-500",children:"Add our AI-powered job description generator to your website with 3 different embed options"})]}),e.jsxs("div",{className:"mb-8 grid gap-6 md:grid-cols-2",children:[e.jsxs(d,{className:"border-teal-100 bg-teal-50/30",children:[e.jsx(m,{className:"pb-2",children:e.jsxs(p,{className:"text-lg text-teal-800 flex items-center gap-2",children:[e.jsx(N,{className:"h-5 w-5 text-teal-600"}),"Simple Plug & Play"]})}),e.jsxs(x,{children:[e.jsxs("p",{className:"text-sm text-teal-700 leading-relaxed",children:[e.jsx("strong",{children:"Best for:"})," Blogs, static sites, or when you just want the tool to work immediately. Users generate and copy results entirely within the widget. No coding or backend required."]}),e.jsxs("ul",{className:"mt-3 space-y-1 text-xs text-teal-600 list-disc list-inside",children:[e.jsx("li",{children:"Instant setup (copy/paste)"}),e.jsx("li",{children:"Self-contained workflow"}),e.jsx("li",{children:"Supports advanced options (EMR, Call, etc)"})]})]})]}),e.jsxs(d,{className:"border-blue-100 bg-blue-50/30",children:[e.jsx(m,{className:"pb-2",children:e.jsxs(p,{className:"text-lg text-blue-800 flex items-center gap-2",children:[e.jsx(v,{className:"h-5 w-5 text-blue-600"}),"Advanced Integration"]})}),e.jsxs(x,{children:[e.jsxs("p",{className:"text-sm text-blue-700 leading-relaxed",children:[e.jsx("strong",{children:"Best for:"})," Custom job boards or CRM integrations. Pre-fill fields via URL and receive the generated results back to your server via a webhook (Callback URL)."]}),e.jsxs("ul",{className:"mt-3 space-y-1 text-xs text-blue-600 list-disc list-inside",children:[e.jsx("li",{children:"Pre-fill Specialty/Location"}),e.jsx("li",{children:"Receive results via POST webhook"}),e.jsx("li",{children:"Seamlessly save to your own database"})]})]})]})]}),e.jsxs(d,{className:"mb-8",children:[e.jsx(m,{children:e.jsx(p,{children:"Configuration"})}),e.jsx(x,{children:e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Base URL"}),e.jsx(r,{value:h,onChange:t=>u(t.target.value),placeholder:"https://mddocjobs.com"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Pre-fill Specialty"}),e.jsx(r,{value:s.specialty,onChange:t=>o({...s,specialty:t.target.value}),placeholder:"Family Medicine Physician"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Pre-fill Location"}),e.jsx(r,{value:s.location,onChange:t=>o({...s,location:t.target.value}),placeholder:"Boston, MA"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Employment Type"}),e.jsx(r,{value:s.employmentType,onChange:t=>o({...s,employmentType:t.target.value}),placeholder:"Full-time"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Setting"}),e.jsx(r,{value:s.setting,onChange:t=>o({...s,setting:t.target.value}),placeholder:"Hospital"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Widget Position"}),e.jsxs("select",{value:s.position,onChange:t=>o({...s,position:t.target.value}),className:"w-full rounded-md border border-gray-200 px-3 py-2 text-sm",children:[e.jsx("option",{value:"bottom-right",children:"Bottom Right"}),e.jsx("option",{value:"bottom-left",children:"Bottom Left"}),e.jsx("option",{value:"top-right",children:"Top Right"}),e.jsx("option",{value:"top-left",children:"Top Left"})]})]}),e.jsxs("div",{className:"space-y-2 sm:col-span-2 lg:col-span-3",children:[e.jsx(i,{children:"Callback URL (optional)"}),e.jsx(r,{value:s.callback,onChange:t=>o({...s,callback:t.target.value}),placeholder:"https://your-server.com/webhook"}),e.jsx("p",{className:"text-xs text-gray-500",children:"We'll POST the generated job description to this URL when complete"})]})]})})]}),e.jsxs(d,{className:"mb-8",children:[e.jsx(m,{children:e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(C,{className:"h-4 w-4"}),"Preview URL"]})}),e.jsx(x,{children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(r,{value:n,readOnly:!0,className:"font-mono text-sm"}),e.jsx(w,{variant:"outline",size:"sm",onClick:()=>y(n,-1),children:j===-1?e.jsx(k,{className:"h-4 w-4"}):e.jsx(P,{className:"h-4 w-4"})}),e.jsxs("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center rounded-md border border-gray-200 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50",children:["Open ",e.jsx(C,{className:"ml-1 h-3 w-3"})]})]})})]}),e.jsxs(d,{children:[e.jsx(m,{children:e.jsx(p,{children:"Embed Code"})}),e.jsxs(x,{children:[e.jsxs("div",{className:"mb-6 flex gap-2 border-b border-gray-200 pb-4 overflow-x-auto",children:[e.jsxs("button",{onClick:()=>g("simple"),className:`flex items-center gap-2 whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium transition ${a==="simple"?"bg-teal-100 text-teal-700":"text-gray-500 hover:bg-gray-100"}`,children:[e.jsx(N,{className:"h-4 w-4"}),"Simple"]}),e.jsxs("button",{onClick:()=>g("iframe"),className:`flex items-center gap-2 whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium transition ${a==="iframe"?"bg-teal-100 text-teal-700":"text-gray-500 hover:bg-gray-100"}`,children:[e.jsx(M,{className:"h-4 w-4"}),"iframe"]}),e.jsxs("button",{onClick:()=>g("widget"),className:`flex items-center gap-2 whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium transition ${a==="widget"?"bg-teal-100 text-teal-700":"text-gray-500 hover:bg-gray-100"}`,children:[e.jsx(B,{className:"h-4 w-4"}),"Widget"]}),e.jsxs("button",{onClick:()=>g("component"),className:`flex items-center gap-2 whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium transition ${a==="component"?"bg-teal-100 text-teal-700":"text-gray-500 hover:bg-gray-100"}`,children:[e.jsx(v,{className:"h-4 w-4"}),"Component"]})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("h3",{className:"mb-2 text-lg font-semibold",children:[a==="simple"&&"Simple Embed (Recommended)",a==="iframe"&&"Advanced iframe Embed",a==="widget"&&"Widget Embed",a==="component"&&"React Component"]}),$()]}),e.jsx("div",{className:"rounded-lg bg-muted p-4",children:e.jsx("pre",{className:"overflow-x-auto text-sm",children:f()})}),e.jsxs("div",{className:"mt-4 flex gap-2",children:[e.jsx(w,{onClick:()=>y(f(),0),children:j===0?e.jsxs(e.Fragment,{children:[e.jsx(k,{className:"mr-2 h-4 w-4"})," Copied!"]}):e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"mr-2 h-4 w-4"})," Copy Code"]})}),a==="iframe"&&e.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center rounded-md border border-gray-200 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50",children:"Preview"})]})]})]})]})})}export{Q as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.