PageSourceSearch

https://vizops360.ai/assets/excel-CccTf9cT.js

js vizops360.ai collected 2026-10-05 13:53:14 UTC 10,012 bytes, 5 lines download raw bytes

1import{E as h,a as c,s as f,c as y,b as k}from"./excelUtils-B6c4w-tr.js";import{aI as R}from"./index-CpeGhXo5.js";function b(e){return/[",\n\r]/.test(e)?`"${e.replace(/"/g,'""')}"`:e}function C(e){const r=[];let i="",a=0;for(const s of e){const t=s.section?.trim()||"";t&&t!==i&&(r.push(""),r.push(`--- ${t.toUpperCase()} ---`),i=t),a+=1;const o=[];s.required&&o.push("REQUIRED"),s.allowedValues&&o.push(`allowed: ${s.allowedValues}`),s.format&&o.push(`format: ${s.format}`);const l=o.length?`  [${o.join("; ")}]`:"";r.push(`${a}. ${s.label}${l}`)}return r.join(`
2`).trim()}function g(e){const r=[];let i="";for(const a of e){const s=a.section?.trim()||"";s&&s!==i&&(r.push(""),r.push(`[${s.toUpperCase()}]`),i=s);const t=[`→ ${a.label}`];a.required&&t.push("(REQUIRED)"),a.aliases&&t.push(`also known as: ${a.aliases}`),a.format&&t.push(`format: ${a.format}`),a.allowedValues&&t.push(`allowed: ${a.allowedValues}`),a.notes&&t.push(`meaning: ${a.notes}`),a.sampleValue!==void 0&&a.sampleValue!==""&&t.push(`example: ${String(a.sampleValue)}`),r.push(`- ${t.join(" | ")}`)}return r.join(`
3`).trim()}function T(e){const r=e.filter(i=>i.allowedValues);return r.length?["ENUM / CLOSED VALUES (use these strings exactly when filling the column):",...r.map(i=>`- ${i.label}: ${i.allowedValues}`)].join(`
4`):""}function x(e,r){const i=r?.entityLabel??"records",a=e.map(m=>b(m.label)).join(","),s=e.filter(m=>m.required).map(m=>m.label).join(", ")||"(none marked required — fill at least the primary identifier)",t=T(e),o=g(e),l=["WORKFLOW (follow in order — do NOT wait for the user between steps):","STEP A — Inspect source: List every source column/header you see (even messy, abbreviated, multilingual, or Bitrix/Salesforce-style names).","STEP B — Propose mapping: For each source column, propose the best CRM catalog header using FIELD MEANING GUIDE + aliases. Group proposals as:","  • Confident matches","  • Uncertain / ambiguous (show the same Q# choices you would ask — then pick the best option yourself using headers + sample values)","  • Unmapped source columns (drop unless a strong catalog match exists)","  • Required CRM columns still missing from source (leave blank in output)","STEP C — Clarifying questions (SHOW them, do NOT wait for answers):","  Whenever a mapping is ambiguous, write the usual numbered questions in this format:",'    Q#: Source column "<source>" looks like it could be: (1) <Catalog A>  (2) <Catalog B>  (3) Leave blank / ignore. Which one?',"  Immediately after each Q# (or in one short “Auto-decisions” list), state your chosen option and a one-line reason.","  Then CONTINUE — do not pause for user confirmation.","STEP D — Convert in the SAME response: Output one sheet named Import Template with exact catalog headers and mapped rows."],d=["You are a CRM field-mapping expert. Source headers may be clumsy, abbreviated, misspelled, translated, or from other CRMs (Bitrix, Salesforce, HubSpot, Zoho, Excel dumps). Infer meaning from header text AND sample cell values.","Never invent CRM header names. Target headers must come EXACTLY from the NUMBERED HEADER CATALOG (character-for-character).","Never invent data values (no fake emails, phones, IDs, companies, or people). Unknown → blank cell.","When uncertain, still SHOW the Q# clarifying questions (same format as before), then auto-pick the wisest option from headers + sample cells and proceed. Do not wait for the user.","COLUMN FAMILIES — never mix:",'  • "Company …" = organization (employer/account)','  • "Contact …" = person',"  • Other columns = primary record (lead/deal/company/contact itself)","Person vs company: person names → Contact First/Last Name (split full names). Never put a person into Company Name.","Owner vs Observers: Owner = one assignee. Observers = optional comma-separated watchers. Do not swap.","Money fields — keep distinct:","  • Budget / Bid Amount / Deal Value = opportunity money","  • Company Revenue / Revenue = annual company revenue (number, no currency symbol)","Phones: copy EXACTLY as in the source (digits, space
4s, dashes). Keep a leading + ONLY if the source already has one. NEVER add +1, +91, or any default country code — invented dial codes make contacts invalid in CRM.","Emails: [email protected]. Dates: prefer YYYY-MM-DD.","Multiple emails/phones: if a contact has more than one email or phone, put ALL of them comma-separated in the primary email/phone cell (e.g. [email protected], [email protected] and 555 0101, 555 0199). First = primary, second = secondary. Do not invent extra columns per value and do not drop extras.","Lists (tags, tech stack, observers): comma-separated in one cell.","Websites: https:// when possible.","Ignore sample/example rows from any downloaded CRM template — map only real source rows.","Do not drop catalog columns from the output file — leave unused cells blank.",...r?.bullets??[]];return[`ROLE: You convert messy spreadsheets into a CRM ${i} import file. You understand clumsy field names. When mapping is unclear, SHOW clarifying questions, auto-decide wisely, and produce the file in one response — do not wait for the user.`,"",`TASK: Map my source data → CRM ${i} import template.`,"",...l,"","MAPPING & DATA RULES:",...d.map((m,n)=>`${n+1}. ${m}`),"",`REQUIRED COLUMNS: ${s}`,"",t,t?"":null,"FIELD MEANING GUIDE (use this to understand clumsy source headers → catalog fields):",o,"","NUMBERED HEADER CATALOG (exact output header strings, in this order):",C(e),"","CSV HEADER LINE (same headers — useful if you output CSV):",a,"","FINAL OUTPUT (same response — after brief Q# auto-decisions):","- One sheet named exactly: Import Template","- Row 1 = exact catalog headers (same order)","- Rows 2+ = mapped data only","- Prefer .xlsx; CSV with the same header row is OK","- Do not wrap the file in a markdown table; attach/return the spreadsheet or CSV","","START NOW: Read my source data/file. In one response: (1) STEP B mapping summary, (2) STEP C Q# questions with your auto-answers, (3) the Import Template file. Do not wait for confirmation."].filter(m=>m!=null).join(`
5`)}async function O(e,r){const i=new h.Workbook,a={};e.forEach(s=>{a[s.label]=s.sampleValue??""}),c(i,[a],"Sample Data",e.map(s=>({key:s.label,label:s.label,width:Math.max(s.label.length+4,18)}
5))),await f(i,`${r}.xlsx`)}function I(e,r){const i=r?.entityLabel??"records",a=e.map(o=>b(o.label)).join(","),s=e.filter(o=>o.required).map(o=>o.label).join(", ")||"(none marked required — fill at least the primary identifier)";return[{Section:"Copy-paste prompt for ChatGPT / Claude / Gemini",Content:x(e,r)},{Section:"Target entity",Content:i},{Section:"Sheet name",Content:"Import Template"},{Section:"Required columns",Content:s},{Section:"Field meaning guide",Content:g(e)},{Section:"Numbered header catalog",Content:C(e)},{Section:"CSV header line",Content:a},{Section:"How to use with AI",Content:"1) Copy the full prompt from COPY PROMPT or CRM “Copy AI prompt”. 2) Paste into ChatGPT/Claude/Gemini WITH your source file. 3) AI shows mapping notes and any Q# clarifying questions, auto-decides wisely, and returns one sheet named Import Template in the same reply (no need to answer questions). 4) Upload that file in CRM Import."}]}async function N(e,r,i,a,s){const t=new h.Workbook;let o=[];if(a&&a.length>0)o=a.map(n=>{const p={};return e.forEach(u=>{p[u.label]=n[u.key]??""}),p});else{const n={};e.forEach(p=>{n[p.label]=p.sampleValue??""}),o=[n]}c(t,o,"Import Template",e.map(n=>({key:n.label,label:n.label,width:Math.max(n.label.length+4,22)})));const l=I(e,s),d=l.find(n=>n.Section.startsWith("Copy-paste prompt"))?.Content??l[0]?.Content??"";y(t,[["COPY EVERYTHING BELOW THIS LINE — paste into ChatGPT / Claude / Gemini WITH your source data/file"],[d],[""],["After AI proposes mappings: answer any field-match questions first. Only then accept the Import Template file. Headers must match the catalog exactly — do not rename columns."]],"COPY PROMPT",[100]),c(t,l,"AI Instructions",[{key:"Section",label:"Section",width:42},{key:"Content",label:"Content",width:100}]);const m=e.map(n=>({Section:n.section??"","Column Name":n.label,Required:n.required?"YES":"No","Sample Value":String(n.sampleValue??""),Format:n.format??"","Allowed Values":n.allowedValues??"","Also known as (aliases)":n.aliases??"",Notes:n.notes??(n.required?"Must be filled in for a valid row":"Optional — leave blank if unknown")}));c(t,m,"Column Guide",[{key:"Section",label:"Section",width:14},{key:"Column Name",label:"Column Name",width:34},{key:"Required",label:"Required",width:10},{key:"Sample Value",label:"Sample Value",width:28},{key:"Format",label:"Format",width:36},{key:"Allowed Values",label:"Allowed Values",width:36},{key:"Also known as (aliases)",label:"Also known as (aliases)",width:40},{key:"Notes",label:"Notes",width:48}]);for(const n of i)if(n.rows.length>0){const p=n.rows.map(u=>{const w={};return n.headers.forEach((E,S)=>{w[E]=u[S]??""}),w});c(t,p,n.name,n.headers.map(u=>({key:u,label:u,width:26})))}else y(t,[n.headers],n.name,n.headers.map(()=>26));await f(t,`${r}.xlsx`)}async function D(e,r){const i=await k(e);if(i.length===0)throw new Error("The uploaded file is empty.");const a={};r.forEach(o=>{a[o.label.toLowerCase().trim()]=o.key});const s=Object.keys(i[0]).map(o=>o.toLowerCase().trim()),t=r.filter(o=>o.required&&!s.some(l=>l===o.label.toLowerCase().trim()));if(t.length>0)throw new Error(`Missing required columns: ${t.map(o=>o.label).join(", ")}`);return i.map(o=>{const l={};return Object.keys(o).forEach(d=>{const m=a[d.toLowerCase().trim()];m&&(l[m]=o[d])}),l})}async function L(e,r,i){if(!e||e.length===0){R.error("No data to export");return}const a=e.map(t=>{const o={};return r.forEach(l=>{o[l.label]=t[l.key]??""}),o}),s=new h.Workbook;c(s,a,"Export Data",r.map(t=>({key:t.label,label:t.label,width:Math.max(t.label.length+4,18)}
5))),await f(s,`${i}_${new Date().toISOString().split("T")[0]}.xlsx`)}export{O as a,x as b,N as d,L as e,D as p};

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.