@aiquants/contact-map 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var yo=Object.defineProperty;var Ne=(e,t)=>()=>(e&&(t=e(e=0)),t);var bo=(e,t)=>{for(var n in t)yo(e,n,{get:t[n],enumerable:!0})};var se,ja,Mt=Ne(()=>{"use strict";se=e=>{switch(typeof e){case"string":return JSON.stringify(e);case"bigint":return`${e}n`;case"symbol":return e.toString();case"object":return e===null?"null":ja(e);case"function":return ja(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},ja=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var Rt,ge,Lt=Ne(()=>{"use strict";Rt=e=>{if(typeof e!="object"||e===null)return!1;try{let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}catch{return!1}},ge=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0});var xo,bn,Zn=Ne(()=>{"use strict";xo=(e,t)=>{let n=Array.from({length:t.length+1},(r,s)=>s);for(let r=1;r<=e.length;r+=1){let s=[r];for(let a=1;a<=t.length;a+=1){let o=n[a-1]+(e[r-1]===t[a-1]?0:1);s.push(Math.min(n[a]+1,s[a-1]+1,o))}n=s}return n[t.length]},bn=(e,t)=>{let n=e.toLowerCase();if(n.length>=3){let s=t.find(a=>a.toLowerCase().startsWith(n));if(s!==void 0)return s}let r;for(let s of t){let a=xo(n,s.toLowerCase());a<=Math.max(1,Math.floor(s.length/4))&&(r===void 0||a<r.distance)&&(r={key:s,distance:a})}return r?.key}});import{DIRECTORY_TREE_LABEL_CATALOGS as qa,DIRECTORY_TREE_LABEL_KEYS as ea,resolveDirectoryTreeLabels as vo}from"@aiquants/directory-tree";import{resolveVirtualScrollLocale as Co,VIRTUAL_SCROLL_LABEL_KEYS as ko}from"@aiquants/virtualscroll";var So,q,ht,xn,Qa,jt,Ke,To,Ga,Ya,wo,ta,No,Po,Mo,na,aa,ra,ft=Ne(()=>{"use strict";Mt();Lt();Zn();So=Object.freeze({en:"en-US",ja:"ja-JP"}),q=(e,t)=>t.toLocaleString(So[e]),ht=(e,t,n)=>e==="1"?t:n,xn=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${q("en",e)} / ${q("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${q("en",e)} loaded)`,annotationLoadFailed:e=>`Failed to load (${q("en",e)} received)`,annotationAuthRequired:"Session expired: sign in again, then retry",annotationRetry:"Retry",recordUnit:e=>ht(e,"record","records"),companyUnit:e=>ht(e,"company","companies"),searchTab:"Fuzzy search",searchSettings:"Search settings",searchStatistics:"Search statistics",operatorAndTitle:"AND search (all terms match)",operatorOrTitle:"OR search (any term matches)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"All terms",operatorOrHint:"Any term",searchPlaceholder:"Fuzzy search...",searchBusyTitle:"Searching",clearSearch:"Clear search",searching:"Searching...",registeredCountLabel:"Registered:",rebuildingIndex:"Rebuilding index...",errorLabel:"Error:",resultCountLabel:"Results:",resultUnit:e=>ht(e,"match","matches"),listViewTab:"List",treeViewTab:"Tree",columnNo:"No",columnId:"ID",columnScore:"Score",columnName:"Name",columnTitle:"Title",columnCompany:"Company",columnDepartment:"Department",columnPhone:"Phone",columnEmail:"Email",columnUpdatedAt:"Updated",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"No search results found",listNoData:"No data",listResizeHandle:"Resize the border between the contact list and the detail pane",detailHeading:"Contact details",close:"Close",noName:"(No Name)",treeNodeCountTitle:"Number of nodes built in the tree view",treeNodeCountLabel:"Nodes:",treeNodeCount:e=>q("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${q("en",t)})`,treeStreamInterruptedTitle:"Streaming was interrupted. Only the data received so far is shown",treeStreamInterrupted:"Interrupted",treeStreamLoadingTitle:"Receiving data streamed from the network",treeStreamLoading:"Loading...",treeBuildingTitle:"Building and expanding the directory tree from the received data",treeBuilding:"Treeing...",treeCompleteTitle:"Every tree node has been built",treeComplete:"Complete",treeShowEntireCompanyTitle:"Show the whole company of every search hit",treeShowEntireCompany:"Whole company",treeExpandAll:"Expand all directories",treeExpandAllTitle:"Expand all",treeCollapseAll:"Collapse all directories",treeCollapseAllTitle:"Collapse all",treeNoMatches:"No contacts match the criteria",treeEmpty:"No contacts to display",treeResizeHandle:"Resize the border between the directory tree and the detail pane",copyField:e=>`Copy ${e}`,detailEmptyTitle:"Select a contact to see its details",detailEmptyHint:"Choose a person from the list",detailTabSummary:"Summary",detailTabBasic:"Basic info",detailBasicProfile:"Profile",detailTabContact:"Contact",detailTabMeta:"Metadata",preferred:"Preferred",summaryEmail:"Email",summaryPhone:"Phone",summaryLastContact:"Last contact",sectionEmail:"Email",sectionEmailEmpty:"No email addresses registered",sectionPhone:"Phone / Fax",sectionPhoneEmpty:"No phone numbers registered",fieldFullName:"Name",fieldFullNameReading:"Name (reading)",fieldTitle:"Title",fieldDepartment:"Department",fieldCompanyName:"Company",fieldCompanyNameReading:"Company (reading)",fieldAddress:"Address",fieldPostalCode:"Postal code",fieldUrl:"URL",fieldCustomEmail:"Custom email",fieldEmail:"Email",fieldCustomMobilePhone:"Custom mobile",fieldMobilePhone:"Mobile",fieldCompanyPhone:"Company phone",fieldCompanyFax:"Company fax",fieldCreatedBy:"Created by",fieldCreatedAt:"Created at",fieldUpdatedBy:"Updated by",fieldUpdatedAt:"Updated at",popupCustomMobilePhone:"Mobile (custom)",popupMobilePhone:"Mobile",popupCustomCompanyPhone:"Company phone (custom)",popupCompanyPhone:"Company phone",popupCustomEmail:"Email (custom)",popupEmail:"Email",popupGmailHint:"Double-click or double-tap to open Gmail",popupLastContactDate:"Last contact:",popupNoContactMethods:"No contact information to display",overlayTitle:"Details",overlayBackdrop:"Tap the background to close",settingsResetAllTitle:"Reset all settings",settingsResetAll:"Reset all",settingsTabsLabel:"Search option tabs",settingsBasicTab:"Basic settings",settingsAdvancedTab:"Advanced settings",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"Current:",resetToDefaultsTitle:"Reset to defaults",reset:"Reset",relevanceOnlyNotice:"Editable only when sorting by relevance",relevanceWeightsHeading:"Relevance score weights",fieldWeight:"Field weight",scoreTuningHeading:"Score tuning",maxResults:"Maximum results",noLimit:"No limit",basicThresholdHeading:"Final similarity threshold",basicThresholdLabel:"Adjust the minimum score",basicThresholdRangeRelevance:"In relevance mode a score can exceed 1.0 (range: 0.0-1.5)",basicThresholdRange:"Range: 0.0-1.0",basicDisplayHeading:"Display options",basicCaseSensitive:"Case-sensitive",basicHighlight:"Highlight matches",basicOpenEmailsWithGmail:"Open email addresses in Gmail compose",basicMultiTermOperator:"Operator for words inside quotes",basicOperatorOr:"OR (any word matches)",basicOperatorAnd:"AND (all words match)",basicMultiTermHint:'How words between quotation marks ("tanaka taro") are combined (default: AND). Words outside quotation marks are separate keywords combined by the AND / OR button',basicSortHeading:"Sorting",basicSortBy:"Sort by",basicSortByScore:"Score",basicSortByRelevance:"Relevance",basicSortByOriginal:"Original order",basicSortOrder:"Sort order",basicSortDescending:"Descending",basicSortAscending:"Ascending",basicEngineHeading:"Search engine",basicStrategy:"Parallel search strategy",basicStrategyBalanced:"Balanced",basicStrategyIndexFirst:"Index first",basicStrategyLevenshteinFirst:"Levenshtein first",basicIndexFiltering:"Index filtering",basicLevenshtein:"Levenshtein distance",advancedLearningHeading:"Learning weight",advancedLearningLabel:"Weight factor",advancedLearningHint:"Weight applied when re-learning (higher favors past search results)",advancedDebounceHeading:"Debounce time",advancedDebounceLabel:"Input delay (ms)",advancedDebounceHint:"How long input is awaited. Shorter is more real-time, longer reduces load",indexSettingsHeading:"Index Worker settings",indexBuildHeading:"Index build",indexNgramSize:"N-gram size",indexNgramSizeHint:"How many characters each chunk holds. Smaller is faster but less accurate",indexMinNgramOverlap:"Minimum N-gram matches",indexMinNgramOverlapHint:"Candidates with fewer matches are excluded",indexCandidateHeading:"Candidate filtering",indexThreshold:"Index threshold",indexThresholdHint:"Lower bound of the Jaro-Winkler similarity (range: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram overlap threshold",indexNgramOverlapThresholdHint:"How much N-grams must overlap. Higher narrows candidates more strictly",indexStrategyHeading:"Search strategy and candidates",indexStrategy:"Search strategy",indexStrategyFast:"Fast",indexStrategyAccurate:"Accurate",indexStrategyHybrid:"Hybrid (adaptive)",indexStrategyHint:"Balance processing load against accuracy",indexMinCandidatesRatio:"Minimum candidate ratio",indexMinCandidatesRatioHint:"Share of candidates always kept",indexMaxCandidatesRatio:"Maximum candidate ratio",indexMaxCandidatesRatioHint:"Upper bound on candidates; narrowed dynamically when exceeded",indexJaroWinklerPrefix:"Jaro-Winkler prefix weight",indexJaroWinklerPrefixHint:"Bonus given to a matching prefix",indexMaxResultsHint:"Maximum number of results to fetch. Larger is more thorough but slower",indexFieldWeightHint:"How much the number of matched fields counts",indexPerfectMatchBonus:"Exact match bonus",indexPerfectMatchBonusHint:"Bonus added on an exact match",indexContainmentHeading:"Containment score (Japanese / substrings)",indexContainmentBase:"Containment base score (containmentScoreBase)",indexContainmentBaseHint:"Minimum base score when the query is fully contained in the string (rescues short Japanese queries such as 2 characters)",indexContainmentCoverage:"Containment coverage weight (containmentCoverageWeight)",indexContainmentCoverageHint:"Extra score by the query length / field length ratio (total capped at 1.0)",levenshteinSettingsHeading:"Levenshtein Worker settings",levenshteinCandidateHeading:"Candidate filter",levenshteinThreshold:"Levenshtein threshold",levenshteinThresholdHintRelevance:"Keep only results at or above this threshold (range: 0.0-1.5)",levenshteinThresholdHint:"Keep only results at or above this threshold (range: 0.0-1.0)",levenshteinLengthSimilarity:"Length similarity threshold",levenshteinLengthSimilarityHint:"Exclude candidates whose length differs greatly, for speed",levenshteinLengthPenalty:"Length difference penalty",levenshteinLengthPenaltyHint:"How much a length difference is penalized. Larger favors equal lengths",levenshteinResultsHeading:"Result count",levenshteinMaxResultsHint:"Maximum number of results to return. Larger is more thorough but slower",levenshteinFieldWeightHint:"Weight of the number of matched fields",levenshteinPartialBonus:"Partial match bonus",levenshteinPartialBonusHint:"Extra score for a partial match",statsRebuildingTitle:"Rebuilding the index",statsRebuildIndexTabOnlyTitle:"Available on the Index tab only",statsRebuildTitle:"Rebuild the index",statsRebuilding:"Rebuilding...",statsRebuild:"Rebuild Index",statsResetTitle:"Reset statistics",statsOverviewTab:"Overview",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"Total searches",statAverageSearchTime:"Average search time",statDataCount:"Data items",statResultCount:"Search results",statDisplayedCount:"Displayed items",statsNoData:"No statistics yet",statsBasicHeading:"Basic statistics",statTotalProcessingTime:"Total processing time",statLastSearchTime:"Last search time",statErrorCount:"Errors",statUpdatedAt:"Statistics updated at",statsOperationsHeading:"Operations",statTotalOperations:"Total operations",statsIndexHeading:"Index statistics",statIndexBuilds:"Index builds",statDataSize:"Data size",statLastBuildTime:"Last build time",statsCacheHeading:"Cache statistics",statCacheNgram:"N-gram",statCacheWord:"Words",statCachePhonetic:"Phonetic",statsIndexMetadataHeading:"Index metadata",statsCalculationsHeading:"Calculations",statTotalCalculations:"Total calculations",statDistanceCalculations:"Distance calculations",statAverageDistance:"Average distance",statMinDistance:"Minimum distance",statMaxDistance:"Maximum distance",notAvailable:"N/A",statsMatchesHeading:"Matches",statPartialMatches:"Partial matches",statPerfectMatches:"Exact matches",statEarlyTerminations:"Early terminations",statsSimilarityHeading:"Similarity distribution",statAbove80:"80% or more",statAbove60:"60% or more",statAbove40:"40% or more",statBelow40:"Below 40%",statsDistanceHeading:"Distance distribution (top 6)",statDistance:e=>`Distance ${e}`,statsQueryLengthHeading:"Query lengths (top 6)",statQueryLength:e=>`Length ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>{let n=q("en",e);return`${n} ${ht(n,"time","times")} / average ${t}%`},statsFieldPerformanceHeading:"Field performance (top 6)",statAverageScore:"Average score",statMatchCount:"Matches",statBestWorstScore:"Best / worst score",statsInsightsHeading:"Performance insights",statBestField:"Best-performing field",statRecentAverageTime:"Recent average processing time",statRecentAverageResults:"Recent average results",statThroughput:"Throughput",statCommonQueryLength:"Most common query length",statHistoryEntries:"History entries",statHighSimilarity:"High similarity",statMediumSimilarity:"Medium similarity",statLowSimilarity:"Low similarity",statVeryLowSimilarity:"Very low similarity",statsRecentHistoryHeading:"Recent history (latest 3)",statsHistoryEntry:({processingTimeMs:e,resultCount:t})=>`Processing time: ${e} ms / results: ${q("en",t)}`,timesUnit:e=>ht(e," time"," times"),itemsUnit:e=>ht(e," item"," items"),charactersUnit:e=>ht(e," character"," characters"),throughputUnit:" ops/s"}),ja:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"\u7DCF\u4EF6\u6570:",annotationCompaniesLabel:"\u4F01\u696D\u6570:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${q("ja",e)} / ${q("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${q("ja",e)} \u4EF6)`,annotationLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${q("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationAuthRequired:"\u30BB\u30C3\u30B7\u30E7\u30F3\u304C\u5207\u308C\u307E\u3057\u305F\u3002\u30B5\u30A4\u30F3\u30A4\u30F3\u3057\u76F4\u3057\u3066\u304B\u3089\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044",annotationRetry:"\u518D\u8A66\u884C",recordUnit:()=>"\u4EF6",companyUnit:()=>"\u793E",searchTab:"\u3042\u3044\u307E\u3044\u691C\u7D22",searchSettings:"\u691C\u7D22\u8A2D\u5B9A",searchStatistics:"\u691C\u7D22\u7D71\u8A08",operatorAndTitle:"AND \u691C\u7D22 (\u3059\u3079\u3066\u4E00\u81F4)",operatorOrTitle:"OR \u691C\u7D22 (\u3044\u305A\u308C\u304B\u4E00\u81F4)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"\u5168\u8A9E\u4E00\u81F4",operatorOrHint:"\u3044\u305A\u308C\u304B\u4E00\u81F4",searchPlaceholder:"\u3042\u3044\u307E\u3044\u691C\u7D22...",searchBusyTitle:"\u691C\u7D22\u51E6\u7406\u4E2D",clearSearch:"\u691C\u7D22\u3092\u30AF\u30EA\u30A2",searching:"\u691C\u7D22\u4E2D...",registeredCountLabel:"\u767B\u9332\u4EF6\u6570:",rebuildingIndex:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D...",errorLabel:"\u30A8\u30E9\u30FC:",resultCountLabel:"\u691C\u7D22\u7D50\u679C:",resultUnit:()=>"\u4EF6",listViewTab:"\u4E00\u89A7",treeViewTab:"\u30C4\u30EA\u30FC",columnNo:"No",columnId:"ID",columnScore:"\u30B9\u30B3\u30A2",columnName:"\u6C0F\u540D",columnTitle:"\u5F79\u8077",columnCompany:"\u4F1A\u793E\u540D",columnDepartment:"\u90E8\u7F72",columnPhone:"\u96FB\u8A71\u756A\u53F7",columnEmail:"\u30E1\u30FC\u30EB",columnUpdatedAt:"\u66F4\u65B0\u65E5\u6642",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"\u691C\u7D22\u7D50\u679C\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",listNoData:"\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",listResizeHandle:"\u9023\u7D61\u5148\u4E00\u89A7\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",detailHeading:"\u9023\u7D61\u5148\u8A73\u7D30",close:"\u9589\u3058\u308B",noName:"\u540D\u524D\u672A\u8A2D\u5B9A",treeNodeCountTitle:"\u30C4\u30EA\u30FC\u30D3\u30E5\u30FC\u3067\u69CB\u7BC9\u3055\u308C\u305F\u5168\u30CE\u30FC\u30C9\u6570",treeNodeCountLabel:"\u30CE\u30FC\u30C9:",treeNodeCount:e=>`${q("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${q("ja",t)})`,treeStreamInterruptedTitle:"\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u304C\u4E2D\u65AD\u3055\u308C\u307E\u3057\u305F\u3002\u53D7\u4FE1\u6E08\u307F\u30C7\u30FC\u30BF\u306E\u307F\u8868\u793A\u3057\u3066\u3044\u307E\u3059",treeStreamInterrupted:"\u4E2D\u65AD",treeStreamLoadingTitle:"\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u304B\u3089\u306E\u30C7\u30FC\u30BF\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u3092\u53D7\u4FE1\u4E2D",treeStreamLoading:"\u8AAD\u307F\u8FBC\u307F\u4E2D...",treeBuildingTitle:"\u53D7\u53D6\u30C7\u30FC\u30BF\u3092\u57FA\u306B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u69CB\u9020\u3092\u6700\u7D42\u69CB\u7BC9\u30FB\u5C55\u958B\u4E2D",treeBuilding:"\u30C4\u30EA\u30FC\u69CB\u7BC9\u4E2D...",treeCompleteTitle:"\u30C4\u30EA\u30FC\u30CE\u30FC\u30C9\u306E\u5168\u4EF6\u69CB\u7BC9\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F",treeComplete:"\u5B8C\u4E86",treeShowEntireCompanyTitle:"\u691C\u7D22\u30D2\u30C3\u30C8\u3057\u305F\u4F1A\u793E\u5168\u4F53\u3092\u8868\u793A",treeShowEntireCompany:"\u5168\u4F53\u8868\u793A",treeExpandAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u5C55\u958B",treeExpandAllTitle:"\u3059\u3079\u3066\u5C55\u958B",treeCollapseAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6298\u308A\u305F\u305F\u307F",treeCollapseAllTitle:"\u3059\u3079\u3066\u6298\u308A\u305F\u305F\u307F",treeNoMatches:"\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u9023\u7D61\u5148\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",treeEmpty:"\u8868\u793A\u3059\u308B\u9023\u7D61\u5148\u304C\u3042\u308A\u307E\u305B\u3093",treeResizeHandle:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",copyField:e=>`\u300C${e}\u300D\u3092\u30B3\u30D4\u30FC`,detailEmptyTitle:"\u9023\u7D61\u5148\u3092\u9078\u629E\u3059\u308B\u3068\u8A73\u7D30\u304C\u8868\u793A\u3055\u308C\u307E\u3059",detailEmptyHint:"\u4E00\u89A7\u304B\u3089\u5BFE\u8C61\u306E\u4EBA\u7269\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",detailTabSummary:"\u30B5\u30DE\u30EA\u30FC",detailTabBasic:"\u57FA\u672C\u60C5\u5831",detailBasicProfile:"\u57FA\u672C\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB",detailTabContact:"\u9023\u7D61\u5148",detailTabMeta:"\u30E1\u30BF\u60C5\u5831",preferred:"\u512A\u5148",summaryEmail:"\u30E1\u30FC\u30EB",summaryPhone:"\u96FB\u8A71",summaryLastContact:"\u6700\u7D42\u63A5\u89E6",sectionEmail:"\u30E1\u30FC\u30EB",sectionEmailEmpty:"\u767B\u9332\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306F\u3042\u308A\u307E\u305B\u3093",sectionPhone:"\u96FB\u8A71\u30FBFAX",sectionPhoneEmpty:"\u767B\u9332\u3055\u308C\u305F\u96FB\u8A71\u756A\u53F7\u306F\u3042\u308A\u307E\u305B\u3093",fieldFullName:"\u6C0F\u540D",fieldFullNameReading:"\u6C0F\u540D (\u304B\u306A)",fieldTitle:"\u5F79\u8077",fieldDepartment:"\u90E8\u7F72",fieldCompanyName:"\u4F1A\u793E\u540D",fieldCompanyNameReading:"\u4F1A\u793E\u540D (\u304B\u306A)",fieldAddress:"\u4F4F\u6240",fieldPostalCode:"\u90F5\u4FBF\u756A\u53F7",fieldUrl:"URL",fieldCustomEmail:"\u30AB\u30B9\u30BF\u30E0\u30E1\u30FC\u30EB",fieldEmail:"\u30E1\u30FC\u30EB",fieldCustomMobilePhone:"\u30AB\u30B9\u30BF\u30E0\u643A\u5E2F\u756A\u53F7",fieldMobilePhone:"\u643A\u5E2F\u756A\u53F7",fieldCompanyPhone:"\u4F1A\u793E\u96FB\u8A71\u756A\u53F7",fieldCompanyFax:"\u4F1A\u793E FAX \u756A\u53F7",fieldCreatedBy:"\u4F5C\u6210\u8005",fieldCreatedAt:"\u4F5C\u6210\u65E5\u6642",fieldUpdatedBy:"\u66F4\u65B0\u8005",fieldUpdatedAt:"\u66F4\u65B0\u65E5\u6642",popupCustomMobilePhone:"\u643A\u5E2F\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupMobilePhone:"\u643A\u5E2F\u96FB\u8A71",popupCustomCompanyPhone:"\u4F1A\u793E\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupCompanyPhone:"\u4F1A\u793E\u96FB\u8A71",popupCustomEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9 (\u30AB\u30B9\u30BF\u30E0)",popupEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",popupGmailHint:"\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u307E\u305F\u306F\u4E8C\u5EA6\u30BF\u30C3\u30D7\u3067 Gmail \u3092\u958B\u304D\u307E\u3059",popupLastContactDate:"\u6700\u7D42\u30B3\u30F3\u30BF\u30AF\u30C8\u65E5:",popupNoContactMethods:"\u8868\u793A\u3067\u304D\u308B\u9023\u7D61\u5148\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093",overlayTitle:"\u8A73\u7D30",overlayBackdrop:"\u80CC\u666F\u3092\u30BF\u30C3\u30D7\u3057\u3066\u9589\u3058\u308B",settingsResetAllTitle:"\u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u30EA\u30BB\u30C3\u30C8",settingsResetAll:"\u3059\u3079\u3066\u30EA\u30BB\u30C3\u30C8",settingsTabsLabel:"\u691C\u7D22\u30AA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A\u30BF\u30D6",settingsBasicTab:"\u57FA\u672C\u8A2D\u5B9A",settingsAdvancedTab:"\u8A73\u7D30\u8A2D\u5B9A",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"\u73FE\u5728\u5024:",resetToDefaultsTitle:"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u306B\u30EA\u30BB\u30C3\u30C8",reset:"\u30EA\u30BB\u30C3\u30C8",relevanceOnlyNotice:"Relevance \u30BD\u30FC\u30C8\u6642\u306E\u307F\u5909\u66F4\u53EF\u80FD",relevanceWeightsHeading:"Relevance \u30B9\u30B3\u30A2\u91CD\u307F",fieldWeight:"\u30D5\u30A3\u30FC\u30EB\u30C9\u91CD\u307F",scoreTuningHeading:"\u30B9\u30B3\u30A2\u8ABF\u6574",maxResults:"\u6700\u5927\u7D50\u679C\u6570",noLimit:"\u4E0A\u9650\u306A\u3057",basicThresholdHeading:"\u6700\u7D42\u985E\u4F3C\u5EA6\u95BE\u5024",basicThresholdLabel:"\u30B9\u30B3\u30A2\u306E\u4E0B\u9650\u3092\u8ABF\u6574",basicThresholdRangeRelevance:"Relevance \u30E2\u30FC\u30C9\u3067\u306F\u30B9\u30B3\u30A2\u304C 1.0 \u3092\u8D85\u3048\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059 (\u7BC4\u56F2: 0.0-1.5)",basicThresholdRange:"\u7BC4\u56F2: 0.0-1.0",basicDisplayHeading:"\u8868\u793A\u30AA\u30D7\u30B7\u30E7\u30F3",basicCaseSensitive:"\u5927\u6587\u5B57\u5C0F\u6587\u5B57\u3092\u533A\u5225",basicHighlight:"\u30CF\u30A4\u30E9\u30A4\u30C8\u8868\u793A",basicOpenEmailsWithGmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 Gmail \u306E\u4F5C\u6210\u753B\u9762\u3067\u958B\u304F",basicMultiTermOperator:"\u5F15\u7528\u7B26\u306E\u4E2D\u306E\u8A9E\u306E\u6F14\u7B97\u5B50",basicOperatorOr:"OR (\u3044\u305A\u308C\u304B\u4E00\u81F4)",basicOperatorAnd:"AND (\u3059\u3079\u3066\u4E00\u81F4)",basicMultiTermHint:'\u5F15\u7528\u7B26\u3067\u56F2\u3093\u3060\u8A9E ("\u7530\u4E2D \u592A\u90CE") \u306E\u7D50\u5408\u65B9\u6CD5 (\u65E2\u5B9A\u306F AND)\u3002\u5F15\u7528\u7B26\u306E\u5916\u306E\u8A9E\u306F\u305D\u308C\u305E\u308C\u5225\u306E\u30AD\u30FC\u30EF\u30FC\u30C9\u3067\u3001AND / OR \u30DC\u30BF\u30F3\u3067\u7D50\u5408\u3059\u308B',basicSortHeading:"\u30BD\u30FC\u30C8\u8A2D\u5B9A",basicSortBy:"\u30BD\u30FC\u30C8\u57FA\u6E96",basicSortByScore:"\u30B9\u30B3\u30A2",basicSortByRelevance:"\u95A2\u9023\u6027",basicSortByOriginal:"\u5143\u306E\u9806\u5E8F",basicSortOrder:"\u30BD\u30FC\u30C8\u9806\u5E8F",basicSortDescending:"\u964D\u9806",basicSortAscending:"\u6607\u9806",basicEngineHeading:"\u691C\u7D22\u30A8\u30F3\u30B8\u30F3\u8A2D\u5B9A",basicStrategy:"\u4E26\u5217\u691C\u7D22\u6226\u7565",basicStrategyBalanced:"\u30D0\u30E9\u30F3\u30B9",basicStrategyIndexFirst:"Index \u512A\u5148",basicStrategyLevenshteinFirst:"Levenshtein \u512A\u5148",basicIndexFiltering:"Index \u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0",basicLevenshtein:"Levenshtein \u8DDD\u96E2\u8A08\u7B97",advancedLearningHeading:"\u5B66\u7FD2\u91CD\u307F",advancedLearningLabel:"\u91CD\u307F\u4FC2\u6570",advancedLearningHint:"\u518D\u5B66\u7FD2\u6642\u306E\u91CD\u307F\u4ED8\u3051 (\u5927\u304D\u3044\u307B\u3069\u904E\u53BB\u306E\u691C\u7D22\u7D50\u679C\u3092\u512A\u5148)",advancedDebounceHeading:"\u30C7\u30D0\u30A6\u30F3\u30B9\u6642\u9593",advancedDebounceLabel:"\u5165\u529B\u9045\u5EF6 (ms)",advancedDebounceHint:"\u5165\u529B\u306E\u5F85\u3061\u6642\u9593\u3002\u77ED\u3044\u307B\u3069\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u3001\u9577\u3044\u307B\u3069\u8CA0\u8377\u8EFD\u6E1B",indexSettingsHeading:"Index Worker \u8A2D\u5B9A",indexBuildHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9",indexNgramSize:"N-gram \u30B5\u30A4\u30BA",indexNgramSizeHint:"\u6587\u5B57\u5217\u3092\u4F55\u6587\u5B57\u5358\u4F4D\u3067\u5206\u5272\u3059\u308B\u304B\u3002\u5C0F\u3055\u3044\u307B\u3069\u9AD8\u901F\u3060\u304C\u7CBE\u5EA6\u4F4E\u4E0B",indexMinNgramOverlap:"\u6700\u5C0F N-gram \u4E00\u81F4\u6570",indexMinNgramOverlapHint:"\u4E00\u81F4\u6570\u304C\u3053\u306E\u5024\u3092\u4E0B\u56DE\u308B\u5019\u88DC\u306F\u9664\u5916",indexCandidateHeading:"\u5019\u88DC\u7D5E\u308A\u8FBC\u307F",indexThreshold:"Index \u95BE\u5024",indexThresholdHint:"Jaro-Winkler \u985E\u4F3C\u5EA6\u306E\u4E0B\u9650 (\u7BC4\u56F2: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram \u91CD\u8907\u5EA6\u95BE\u5024",indexNgramOverlapThresholdHint:"N-gram \u306E\u91CD\u306A\u308A\u5177\u5408\u3002\u9AD8\u3044\u307B\u3069\u53B3\u5BC6\u306B\u5019\u88DC\u3092\u7D5E\u308B",indexStrategyHeading:"\u691C\u7D22\u6226\u7565\u3068\u5019\u88DC\u6570",indexStrategy:"\u691C\u7D22\u6226\u7565",indexStrategyFast:"Fast (\u9AD8\u901F)",indexStrategyAccurate:"Accurate (\u6B63\u78BA)",indexStrategyHybrid:"Hybrid (\u52D5\u7684)",indexStrategyHint:"\u51E6\u7406\u8CA0\u8377\u3068\u7CBE\u5EA6\u306E\u30D0\u30E9\u30F3\u30B9\u3092\u9078\u629E",indexMinCandidatesRatio:"\u6700\u5C0F\u5019\u88DC\u6BD4\u7387",indexMinCandidatesRatioHint:"\u6700\u4F4E\u9650\u78BA\u4FDD\u3059\u308B\u5019\u88DC\u5272\u5408",indexMaxCandidatesRatio:"\u6700\u5927\u5019\u88DC\u6BD4\u7387",indexMaxCandidatesRatioHint:"\u5019\u88DC\u6570\u306E\u4E0A\u9650\u3002\u8D85\u3048\u308B\u3068\u52D5\u7684\u306B\u7D5E\u308A\u8FBC\u307F",indexJaroWinklerPrefix:"Jaro-Winkler \u63A5\u982D\u8F9E\u91CD\u307F",indexJaroWinklerPrefixHint:"\u5148\u982D\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexMaxResultsHint:"\u53D6\u5F97\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u5305\u62EC\u7684\u3060\u304C\u9045\u5EF6\u304C\u5897\u52A0",indexFieldWeightHint:"\u30DE\u30C3\u30C1\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306B\u3069\u308C\u3060\u3051\u91CD\u307F\u4ED8\u3051\u3059\u308B\u304B",indexPerfectMatchBonus:"\u5B8C\u5168\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",indexPerfectMatchBonusHint:"\u5B8C\u5168\u4E00\u81F4\u6642\u306B\u8FFD\u52A0\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexContainmentHeading:"\u548C\u6587\u30FB\u90E8\u5206\u6587\u5B57\u5217\u5305\u542B\u30B9\u30B3\u30A2",indexContainmentBase:"\u5305\u542B \u57FA\u790E\u30B9\u30B3\u30A2 (containmentScoreBase)",indexContainmentBaseHint:"\u30AF\u30A8\u30EA\u304C\u6587\u5B57\u5217\u4E2D\u306B\u5B8C\u5168\u306B\u542B\u307E\u308C\u308B\u5834\u5408\u306E\u6700\u4F4E\u57FA\u790E\u30B9\u30B3\u30A2 (\u548C\u6587 2 \u6587\u5B57\u7B49\u306E\u6551\u6E08)",indexContainmentCoverage:"\u5305\u542B \u88AB\u8986\u7387\u91CD\u307F (containmentCoverageWeight)",indexContainmentCoverageHint:"\u30AF\u30A8\u30EA\u9577 / \u30D5\u30A3\u30FC\u30EB\u30C9\u9577\u306E\u6BD4\u7387\u306B\u5FDC\u3058\u305F\u52A0\u7B97\u30B9\u30B3\u30A2 (\u5408\u8A08 1.0 \u4EE5\u4E0B\u306B\u5236\u9650)",levenshteinSettingsHeading:"Levenshtein Worker \u8A73\u7D30\u8A2D\u5B9A",levenshteinCandidateHeading:"\u5019\u88DC\u30D5\u30A3\u30EB\u30BF",levenshteinThreshold:"Levenshtein \u95BE\u5024",levenshteinThresholdHintRelevance:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.5)",levenshteinThresholdHint:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.0)",levenshteinLengthSimilarity:"\u9577\u3055\u985E\u4F3C\u5EA6\u95BE\u5024",levenshteinLengthSimilarityHint:"\u9577\u3055\u304C\u5927\u304D\u304F\u7570\u306A\u308B\u5019\u88DC\u3092\u4E8B\u524D\u306B\u9664\u5916\u3057\u3066\u901F\u5EA6\u5411\u4E0A",levenshteinLengthPenalty:"\u9577\u3055\u5DEE\u30DA\u30CA\u30EB\u30C6\u30A3",levenshteinLengthPenaltyHint:"\u9577\u3055\u5DEE\u3092\u3069\u308C\u3060\u3051\u6E1B\u70B9\u3059\u308B\u304B\u3002\u5927\u304D\u3044\u307B\u3069\u9577\u3055\u4E00\u81F4\u3092\u91CD\u8996",levenshteinResultsHeading:"\u7D50\u679C\u6570\u5236\u5FA1",levenshteinMaxResultsHint:"\u8FD4\u5374\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u7DB2\u7F85\u7684\u3060\u304C\u51E6\u7406\u6642\u9593\u304C\u5897\u52A0",levenshteinFieldWeightHint:"\u4E00\u81F4\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306E\u8A55\u4FA1\u91CD\u307F",levenshteinPartialBonus:"\u90E8\u5206\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",levenshteinPartialBonusHint:"\u90E8\u5206\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u8FFD\u52A0\u30B9\u30B3\u30A2",statsRebuildingTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D",statsRebuildIndexTabOnlyTitle:"Index \u30BF\u30D6\u3067\u306E\u307F\u4F7F\u7528\u53EF\u80FD",statsRebuildTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u518D\u69CB\u7BC9",statsRebuilding:"\u518D\u69CB\u7BC9\u4E2D...",statsRebuild:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9",statsResetTitle:"\u7D71\u8A08\u3092\u30EA\u30BB\u30C3\u30C8",statsOverviewTab:"\u6982\u8981",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"\u7DCF\u691C\u7D22\u56DE\u6570",statAverageSearchTime:"\u5E73\u5747\u691C\u7D22\u6642\u9593",statDataCount:"\u30C7\u30FC\u30BF\u4EF6\u6570",statResultCount:"\u691C\u7D22\u7D50\u679C\u4EF6\u6570",statDisplayedCount:"\u8868\u793A\u4EF6\u6570",statsNoData:"\u7D71\u8A08\u30C7\u30FC\u30BF\u306A\u3057",statsBasicHeading:"\u57FA\u672C\u7D71\u8A08",statTotalProcessingTime:"\u7DCF\u51E6\u7406\u6642\u9593",statLastSearchTime:"\u6700\u5F8C\u306E\u691C\u7D22\u6642\u9593",statErrorCount:"\u30A8\u30E9\u30FC\u6570",statUpdatedAt:"\u7D71\u8A08\u66F4\u65B0\u6642\u523B",statsOperationsHeading:"\u64CD\u4F5C\u7D71\u8A08",statTotalOperations:"\u7DCF\u64CD\u4F5C\u6570",statsIndexHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u7D71\u8A08",statIndexBuilds:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9\u56DE\u6570",statDataSize:"\u30C7\u30FC\u30BF\u30B5\u30A4\u30BA",statLastBuildTime:"\u6700\u5F8C\u306E\u69CB\u7BC9\u6642\u9593",statsCacheHeading:"\u30AD\u30E3\u30C3\u30B7\u30E5\u7D71\u8A08",statCacheNgram:"N-gram",statCacheWord:"\u5358\u8A9E",statCachePhonetic:"\u97F3\u97FB",statsIndexMetadataHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u30E1\u30BF\u30C7\u30FC\u30BF",statsCalculationsHeading:"\u8A08\u7B97\u7D71\u8A08",statTotalCalculations:"\u7DCF\u8A08\u7B97\u6570",statDistanceCalculations:"\u8DDD\u96E2\u8A08\u7B97\u6570",statAverageDistance:"\u5E73\u5747\u8DDD\u96E2",statMinDistance:"\u6700\u5C0F\u8DDD\u96E2",statMaxDistance:"\u6700\u5927\u8DDD\u96E2",notAvailable:"N/A",statsMatchesHeading:"\u30DE\u30C3\u30C1\u7D71\u8A08",statPartialMatches:"\u90E8\u5206\u30DE\u30C3\u30C1\u6570",statPerfectMatches:"\u5B8C\u5168\u30DE\u30C3\u30C1\u6570",statEarlyTerminations:"\u65E9\u671F\u7D42\u4E86\u6570",statsSimilarityHeading:"\u985E\u4F3C\u5EA6\u5206\u5E03",statAbove80:"80% \u4EE5\u4E0A",statAbove60:"60% \u4EE5\u4E0A",statAbove40:"40% \u4EE5\u4E0A",statBelow40:"40% \u672A\u6E80",statsDistanceHeading:"\u8DDD\u96E2\u5206\u5E03 (\u4E0A\u4F4D 6)",statDistance:e=>`\u8DDD\u96E2 ${e}`,statsQueryLengthHeading:"\u30AF\u30A8\u30EA\u9577\u7D71\u8A08 (\u4E0A\u4F4D 6)",statQueryLength:e=>`\u9577\u3055 ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>`${q("ja",e)} \u56DE / \u5E73\u5747 ${t}%`,statsFieldPerformanceHeading:"\u30D5\u30A3\u30FC\u30EB\u30C9\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9 (\u4E0A\u4F4D 6)",statAverageScore:"\u5E73\u5747\u30B9\u30B3\u30A2",statMatchCount:"\u30DE\u30C3\u30C1\u6570",statBestWorstScore:"\u6700\u9AD8 / \u6700\u4F4E\u30B9\u30B3\u30A2",statsInsightsHeading:"\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6D1E\u5BDF",statBestField:"\u6700\u9AD8\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u30D5\u30A3\u30FC\u30EB\u30C9",statRecentAverageTime:"\u6700\u8FD1\u306E\u5E73\u5747\u51E6\u7406\u6642\u9593",statRecentAverageResults:"\u6700\u8FD1\u306E\u5E73\u5747\u7D50\u679C\u6570",statThroughput:"\u30B9\u30EB\u30FC\u30D7\u30C3\u30C8",statCommonQueryLength:"\u6700\u983B\u51FA\u30AF\u30A8\u30EA\u9577",statHistoryEntries:"\u5C65\u6B74\u30A8\u30F3\u30C8\u30EA\u6570",statHighSimilarity:"\u9AD8\u985E\u4F3C",statMediumSimilarity:"\u4E2D\u985E\u4F3C",statLowSimilarity:"\u4F4E\u985E\u4F3C",statVeryLowSimilarity:"\u6975\u4F4E\u985E\u4F3C",statsRecentHistoryHeading:"\u6700\u8FD1\u306E\u5C65\u6B74 (\u6700\u65B0 3 \u4EF6)",statsHistoryEntry:({processingTimeMs:e,resultCount:t})=>`\u51E6\u7406\u6642\u9593: ${e} ms / \u7D50\u679C: ${q("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),Qa=Object.freeze(Object.keys(xn.en)),jt=Object.freeze([...ea,...Qa]),Ke=Object.freeze({en:Object.freeze({...qa.en,...xn.en}),ja:Object.freeze({...qa.ja,...xn.ja})}),To=new Set(jt),Ga=Object.keys(Ke).map(e=>JSON.stringify(e)).join(" or "),Ya=Object.freeze({locale:"locale",labels:"labels"}),wo=(e,t,n)=>{e[t]=n},ta=(e,t=Ya.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${Ga} or left out; got ${se(e)}`);if(e!==void 0&&!Object.hasOwn(Ke,e))throw new RangeError(`[contact-map] ${t} must be ${Ga} or left out; got ${se(e)}`);return Co(e)},No=(e,t,n,r)=>{if(typeof r=="function"){if(typeof n!="function")throw new TypeError(`[contact-map] ${e}.${t} must be a function; got ${se(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${se(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${se(n)}`)},Po=(e,t,n)=>{let r=Object.create(null);for(let s of Object.getOwnPropertyNames(e)){if(!To.has(s)){let o=bn(s,jt);throw new RangeError(`[contact-map] ${n} has a key that is not a label key (${o===void 0?"":`did you mean ${JSON.stringify(o)}? `}CONTACT_MAP_LABEL_KEYS lists every key); got ${se(s)}`)}let a=e[s];a!==void 0&&(No(n,s,a,t[s]),r[s]=a)}return r},Mo=e=>{let t={},n=!1;for(let r of ea){let s=e[r];s!==void 0&&(t[r]=s,n=!0)}return n?t:void 0},na=(e,t,n=Ya)=>{let r=ta(e,n.locale);if(t===void 0)return Ke[r];if(!Rt(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${se(t)}`);let s=Po(t,Ke[r],n.labels),o={...vo(r,Mo(s)),...xn[r]};for(let c of Qa){let l=s[c];l!==void 0&&wo(o,c,l)}return Object.freeze(o)},aa=e=>{let t={};for(let n of ea)t[n]=e[n];return Object.freeze(t)},ra=e=>{let t={};for(let n of ko)t[n]=e[n];return Object.freeze(t)}});import{DIRECTORY_TREE_LABEL_KEYS as Ro}from"@aiquants/directory-tree";import{VIRTUAL_SCROLL_LABEL_KEYS as Lo}from"@aiquants/virtualscroll";import{createContext as Eo,useContext as Ja,useMemo as Xa,useRef as Oo}from"react";import{jsx as Do}from"react/jsx-runtime";var Wo,sa,oa,Za,ye,G,le=Ne(()=>{"use strict";ft();Wo=Object.freeze({locale:"en",labels:Ke.en,treeLabels:aa(Ke.en),engineLabels:ra(Ke.en)}),sa=Eo(Wo),oa=(e,t)=>{let n=Oo(null),r=n.current;return r!==null&&t.every(s=>r[s]===e[s])?r:(n.current=e,e)},Za=({locale:e,labels:t,surface:n,children:r})=>{let s=ta(e,n.locale),a=Xa(()=>na(s,t,n),[s,t,n]),o=oa(a,jt),c=oa(aa(o),Ro),l=oa(ra(o),Lo),d=Xa(()=>({locale:s,labels:o,treeLabels:c,engineLabels:l}),[s,o,c,l]);return Do(sa.Provider,{value:d,children:r})},ye=()=>Ja(sa),G=()=>Ja(sa).labels});var vn,Cn,tr,kn,Sn,qt,qe,nr,Pe,j,bt=Ne(()=>{"use strict";vn=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},Cn=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,tr=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let r=vn(e[n]);if(r)return{value:r,fieldKey:n}}return{value:null,fieldKey:null}},kn=e=>tr(e,["custom_email","email"]),Sn=e=>tr(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),qt=e=>{let t=vn(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},qe=(e,t)=>{let n=vn(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},nr=e=>{if(!e)return"-";let t=typeof e=="string"||typeof e=="number"?new Date(e):e;return!(t instanceof Date)||Number.isNaN(t.getTime())?typeof e=="string"?e:"-":t.toISOString().split("T")[0]},Pe=e=>{if(!e)return"-";let t=typeof e=="string"||typeof e=="number"?new Date(e):e;return!(t instanceof Date)||Number.isNaN(t.getTime())?typeof e=="string"?e:"-":t.toISOString()},j=e=>e==null?"-":typeof e=="string"?vn(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":e instanceof Date?Pe(e):String(e)});import Ao from"lucide-react/dist/esm/icons/check.js";import Io from"lucide-react/dist/esm/icons/copy.js";import Fo from"lucide-react/dist/esm/icons/x.js";import{useCallback as rt,useEffect as ua,useMemo as Gt,useRef as pa,useState as or}from"react";import{createPortal as zo}from"react-dom";import{jsx as Q,jsxs as Me}from"react/jsx-runtime";var Bo,ar,Yt,Ot,Uo,$o,Qt,da,rr,ca,Tn,ma=Ne(()=>{"use strict";bt();le();Bo=350,ar=["dblclick","pointerdown","pointerup","mousedown","mouseup","touchstart","touchend","contextmenu"],Yt=0,Ot=null,Uo=()=>{let e=document.body.style;Yt+=1,Yt===1&&(Ot={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},$o=()=>{if(Yt=Math.max(0,Yt-1),Yt>0||!Ot)return;let e=document.body.style;e.userSelect=Ot.userSelect,typeof Ot.webkitUserSelect<"u"&&(e.webkitUserSelect=Ot.webkitUserSelect),Ot=null},Qt=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},da=(e,t)=>{let n=new Set;return e.reduce((r,s)=>{let a=typeof s.value=="string"?s.value.trim():"";if(!a)return r;let{normalized:o,key:c,entry:l}=t(a,s);return o&&!n.has(c)&&(n.add(c),r.push(l(o))),r},[])},rr=(e,t)=>e===t,ca=({value:e,ariaLabel:t,size:n="md"})=>{let[r,s]=or(!1),a=pa(null),o=rt(async u=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(u),!0}catch{}if(typeof document>"u")return!1;let i=document.createElement("textarea");i.value=u,i.setAttribute("readonly",""),i.style.position="absolute",i.style.left="-9999px",document.body.appendChild(i),i.select(),i.setSelectionRange(0,i.value.length);let p=document.execCommand("copy");return document.body.removeChild(i),p},[]),c=rt(async u=>{u.preventDefault(),u.stopPropagation(),a.current!==null&&typeof window<"u"&&(window.clearTimeout(a.current),a.current=null);let i=await o(e);s(i),i&&typeof window<"u"&&(a.current=window.setTimeout(()=>{s(!1),a.current=null},1500))},[o,e]);ua(()=>()=>{a.current!==null&&typeof window<"u"&&(window.clearTimeout(a.current),a.current=null)},[]);let l=n==="sm"?"h-6 w-6":"h-7 w-7",d=n==="sm"?"h-3.5 w-3.5":"h-4 w-4",m=r?Ao:Io;return Q("button",{type:"button",className:`inline-flex ${l} shrink-0 items-center justify-center rounded-md border border-gray-200 text-slate-600 transition-colors hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-200 dark:text-slate-300`,onClick:c,"aria-label":t,title:t,children:Q(m,{className:d,"aria-hidden":"true"})})},Tn=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:r})=>{let s=G(),[a,o]=or(null);ua(()=>{o(document.body)},[]);let c=pa(null),l=pa(null),d=Gt(()=>e.contacted_at?nr(e.contacted_at):null,[e.contacted_at]),m=e.full_name||"-",u=Qt(e.company_name),i=Qt(e.department),p=Qt(e.title),h=Gt(()=>da([{fieldKey:"company_name",label:s.fieldCompanyName,value:u},{fieldKey:"department",label:s.fieldDepartment,value:i},{fieldKey:"title",label:s.fieldTitle,value:p}],(f,{fieldKey:x,label:O})=>({normalized:f,key:`${x}-${f.toLowerCase()}`,entry:W=>({fieldKey:x,label:O,value:W})})),[u,i,p,s]),C=Gt(()=>da([{fieldKey:"custom_mobile_phone_number",label:s.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:s.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:s.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:s.popupCompanyPhone,value:e.company_phone_number}],(f,{fieldKey:x,label:O})=>{let W=qt(f);return{normalized:Qt(f),key:(W??f).toLowerCase(),entry:w=>({fieldKey:x,label:O,value:w,href:W})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,s]),v=Gt(()=>da([{fieldKey:"custom_email",label:s.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:s.popupEmail,value:e.email}],(f,{fieldKey:x,label:O})=>{let W=Qt(f),te=qe(f,t),w=!!te?.startsWith("https://mail.google.com");return{normalized:W,key:f.toLowerCase(),entry:N=>({fieldKey:x,label:O,value:N,href:te,isGmailLink:w})}}),[e.custom_email,e.email,t,s]),k=C.length>0||v.length>0,F=Gt(()=>`contact-methods-${e.person_id}`,[e.person_id]),T=rt(f=>{r(f),l.current=null},[r]),y=rt(f=>{f.stopPropagation(),rr(f.target,f.currentTarget)&&T()},[T]),g=rt(f=>{f.stopPropagation(),rr(f.target,f.currentTarget)&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),T())},[T]),E=rt(f=>{f.stopPropagation(),T()},[T]),K=rt((f,x)=>{x.isGmailLink&&(f.preventDefault(),n(x.value))},[n]),b=rt((f,x)=>{if(!x.isGmailLink){l.current=null;return}let O=Date.now(),W=l.current;if(W&&W.email===x.value&&O-W.timestamp<=Bo){l.current=null,f.preventDefault(),n(x.value);return}l.current={email:x.value,timestamp:O}},[n]);return ua(()=>{let f=[];if(typeof window<"u"){let x=O=>{if(O.key==="Escape"){T();return}if(O.key==="Tab"&&c.current){let W=c.current.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])');if(W.length===0)return;let te=W[0],w=W[W.length-1];O.shiftKey?document.activeElement===te&&(O.preventDefault(),w.focus()):document.activeElement===w&&(O.preventDefault(),te.focus())}};window.addEventListener("keydown",x),f.push(()=>window.removeEventListener("keydown",x))}if(typeof document<"u"){let x=c.current;if(x){let w=N=>{N.stopPropagation()};for(let N of ar)x.addEventListener(N,w);f.push(()=>{for(let N of ar)x.removeEventListener(N,w)})}let O=w=>{let N=c.current;return N&&w instanceof Node?N.contains(w):!1},W=w=>{O(w.target)||T({suppressLongPress:!0,cancelLongPressTimer:!0})},te=["pointerdown","wheel","touchmove"];for(let w of te)document.addEventListener(w,W,!0);f.push(()=>{for(let w of te)document.removeEventListener(w,W,!0)}),Uo(),f.push($o)}return()=>{for(let x of f)x()}},[T,a]),a?zo(Q("div",{"data-contact-popup-root":"true",className:"fixed top-0 right-0 bottom-0 left-0 z-50 flex items-center justify-center bg-black/50 px-4 py-6",style:{right:"var(--aqcm-overlay-right, var(--aiquants-menu-pinned-width, 0px))",transition:"right 0.5s"},role:"dialog","aria-modal":"true","aria-labelledby":F,tabIndex:-1,onClick:y,onKeyDown:g,children:Me("div",{ref:c,className:"w-full max-w-md rounded-lg border border-slate-200 bg-white p-4 shadow-lg transition-colors dark:border-transparent dark:bg-slate-900 dark:shadow-slate-950/40 dark:ring-1 dark:ring-white/70",children:[Me("div",{className:"flex items-start justify-between gap-4",children:[Me("div",{children:[Q("h2",{id:F,className:"font-semibold text-gray-900 text-lg dark:text-slate-100",children:m}),h.length>0?Q("div",{className:"mt-2 space-y-2 text-slate-700 text-sm dark:text-slate-200",children:h.map(f=>Me("div",{className:"flex items-center gap-3",children:[Q("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:f.value}),Q(ca,{value:f.value,ariaLabel:s.copyField(f.label),size:"sm"})]},f.fieldKey))}):null]}),Q("button",{type:"button",className:"rounded-md p-0.5 text-slate-600 transition-colors hover:bg-gray-100 focus:outline-none focus-visible:ring focus-visible:ring-blue-200 dark:text-slate-300 dark:hover:bg-slate-800/70",onClick:E,"aria-label":s.close,children:Q(Fo,{className:"h-4 w-4","aria-hidden":"true"})})]}),Me("div",{className:"mt-4 space-y-4 text-slate-700 dark:text-slate-200",children:[C.length>0?Q("div",{children:Q("ul",{className:"space-y-3 text-sm",children:C.map(f=>Q("li",{className:"flex items-start gap-3",children:Me("div",{className:"flex-1",children:[Q("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:f.label}),Me("div",{className:"mt-1 flex items-center gap-3",children:[Q("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:f.href?Q("a",{href:f.href,className:"wrap-break-word text-blue-600 underline-offset-2 transition-colors hover:underline focus:underline focus:outline-none dark:text-blue-300",children:f.value}):Q("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:f.value})}),Q(ca,{value:f.value,ariaLabel:s.copyField(f.label),size:"sm"})]})]})},`${f.fieldKey}-${f.value}`))})}):null,v.length>0?Q("div",{children:Q("ul",{className:"space-y-3 text-sm",children:v.map(f=>Q("li",{className:"flex items-start gap-3",children:Me("div",{className:"flex-1",children:[Q("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:f.label}),Me("div",{className:"mt-1 flex items-start gap-3",children:[Me("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[f.href?Q("a",{href:f.href,className:"wrap-break-word text-blue-600 underline-offset-2 transition-colors hover:underline focus:underline focus:outline-none dark:text-blue-300",target:f.isGmailLink?"_blank":void 0,rel:f.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:x=>K(x,f),onTouchEnd:x=>b(x,f),children:f.value}):Q("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:f.value}),f.isGmailLink?Q("span",{className:"mt-1 block text-[11px] text-slate-500 dark:text-slate-400",children:s.popupGmailHint}):null]}),Q(ca,{value:f.value,ariaLabel:s.copyField(f.label),size:"sm"})]})]})},`${f.fieldKey}-${f.value}`))})}):null,d?Me("div",{className:"mt-2 flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[Q("span",{className:"text-xs",children:s.popupLastContactDate}),Q("span",{children:d})]}):null,k?null:Q("p",{className:"text-slate-600 text-sm dark:text-slate-300",children:s.popupNoContactMethods})]})]})}),a):null}});import{jsx as be,jsxs as Xt}from"react/jsx-runtime";var wn,ga=Ne(()=>{"use strict";wn=({fullName:e,title:t="-",companyName:n="-",department:r="-",phoneNumber:s="-",email:a="-",updatedAtText:o="-"})=>Xt("div",{className:"flex h-full w-full flex-col justify-center gap-0.5 text-slate-800 text-xs leading-tight transition-colors sm:grid sm:grid-cols-3 sm:gap-2 sm:text-sm xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[Xt("div",{className:"flex items-center gap-1 sm:hidden",children:[be("div",{className:"flex-1 truncate font-medium text-gray-900 text-sm leading-tight dark:text-slate-100",children:e}),be("div",{className:"shrink-0 whitespace-nowrap text-[11px] text-slate-600 dark:text-slate-300",children:s})]}),be("div",{className:"flex items-center gap-1 sm:hidden",children:be("div",{className:"flex-1 truncate text-slate-700 text-xs leading-tight dark:text-slate-200",children:n})}),be("div",{className:"block sm:hidden",children:be("span",{className:"w-full truncate text-left text-[11px] text-slate-700 leading-tight dark:text-slate-200",children:r})}),Xt("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[be("span",{className:"truncate font-medium text-gray-900 dark:text-slate-100",children:e}),be("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:t})]}),Xt("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[be("span",{className:"truncate text-slate-800 dark:text-slate-100",children:n}),be("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:r})]}),Xt("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[be("span",{className:"truncate text-slate-700 dark:text-slate-200",children:s}),be("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:a})]}),be("div",{className:"hidden items-end justify-end text-[11px] text-slate-600 xl:flex dark:text-slate-300",children:be("span",{className:"truncate",children:o})})]})});import{formatQuerySets as Vo,parseQuerySets as Ko}from"@aiquants/fuzzy-search";import{getNormalizedVariants as jo,normalizeText as qo,romajiToKatakana as Go}from"@aiquants/select-box";var lr,Qo,Yo,Xo,Jo,dr,cr,Zo,es,ur,pr,sr,ir,Nn,ts,ns,ha,mr,fa=Ne(()=>{"use strict";lr=/[​]/g,Qo=/^[\s  ]+|[\s  ]+$/g,Yo=/\s+/,Xo=/^[\p{Script=Latin}\s]+$/u,Jo=/\p{Script=Latin}/u,dr=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1}),cr="union",Zo=e=>qo(e.replace(lr,"").replace(Qo,""),dr),es=e=>{if(!Xo.test(e))return null;let t=Go(e);return Jo.test(t)?null:t},ur=e=>e.split(Yo).filter(Boolean),pr=e=>Ko(e,cr).sets.map(({query:t})=>t),sr=e=>pr(e).flatMap(t=>ur(t)),ir=e=>Vo({combine:cr,sets:Array.from(new Set(e),t=>({query:t}))}),Nn=e=>{let t=pr(e.replace(lr,"")).map(r=>ur(Zo(r)).join(" ")).filter(r=>r!==""),n=[];for(let r of t){let s=es(r);if(s===null)return ir(t);n.push(s)}return ir(n)},ts=e=>{let t=new Set([...sr(e),...sr(Nn(e))]),n=new Set;for(let r of t)for(let s of jo(r,dr)){let a=s.trim();a&&n.add(a)}return Array.from(n)},ns=/[.*+?^${}()|[\]\\]/g,ha=e=>{let t=ts(e);if(t.length===0)return null;let n=t.map(r=>r.replace(ns,"\\$&")).sort((r,s)=>s.length-r.length);return new RegExp(n.join("|"),"gi")},mr=(e,t)=>{let n=ha(e);if(n===null)return s=>s;let r=s=>t.some(a=>{let o=s[a];return typeof o=="string"&&o.search(n)!==-1});return s=>{let a=[],o=[];for(let c of s)r(c.item)?a.push(c):o.push(c);return[...a,...o]}}});import{memo as as}from"react";import{Fragment as ya,jsx as Pn}from"react/jsx-runtime";var ue,Mn=Ne(()=>{"use strict";fa();ue=as(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return Pn(ya,{children:e});let r=ha(t);if(r===null)return Pn(ya,{children:e});let s=[],a=0,o=r.exec(e),c=0;for(;o;){let l=o[0],d=o.index;if(d>a&&s.push(e.substring(a,d)),l.length===0){r.lastIndex++,o=r.exec(e);continue}s.push(Pn("mark",{className:"rounded bg-yellow-200 px-1 text-gray-900",children:l},`highlight-${d}-${c}`)),a=d+l.length,c+=1,o=r.exec(e)}return a<e.length&&s.push(e.substring(a)),Pn(ya,{children:s})});ue.displayName="HighlightedText"});var hr={};bo(hr,{ContactDetailGrid:()=>gr,default:()=>rs});import{useMemo as ba}from"react";import{Fragment as os,jsx as va,jsxs as ss}from"react/jsx-runtime";var xa,gr,rs,fr=Ne(()=>{"use strict";bt();le();ma();ga();Mn();xa=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},gr=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:r,openGmailCompose:s,isPopupVisible:a,onRequestClose:o})=>{let c=G(),l=ba(()=>kn(e),[e]),d=ba(()=>Sn(e),[e]),m=l.value??"-",u=d.value??"-",i=ba(()=>Pe(e.updated_at),[e.updated_at]),p=xa(e.full_name)??c.noName,h=xa(e.company_name),C=xa(e.department),v=(k,F="-")=>va(ue,{text:k??F,query:t,enabled:n});return ss(os,{children:[va(wn,{fullName:v(p),title:v(e.title),companyName:v(h),department:v(C),phoneNumber:u,email:v(m),updatedAtText:i}),a?va(Tn,{contactData:e,openEmailsWithGmail:r,openGmailCompose:s,onRequestClose:o}):null]})},rs=gr});le();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Et}from"@aiquants/fuzzy-search";import{memo as Ho,useId as er}from"react";import{jsx as _e,jsxs as je}from"react/jsx-runtime";var ia=Ho(({searchOptions:e,setSearchOptions:t})=>{let n=G(),r="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",a=er(),o=er(),c=[];return c.push(je("div",{className:`${r} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[je("div",{className:`${s} text-sky-700 dark:text-sky-300`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),_e("label",{htmlFor:a,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.advancedLearningLabel}),_e("input",{id:a,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||Et.learningWeight,onChange:l=>t(d=>({...d,learningWeight:parseFloat(l.target.value)})),className:"w-full"}),je("span",{className:"text-sky-600 text-xs dark:text-sky-300",children:[n.currentValueLabel," ",e.learningWeight||Et.learningWeight]}),_e("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.advancedLearningHint})]},"learning")),c.push(je("div",{className:`${r} border-indigo-200 border-l-4 dark:border-indigo-400/60`,children:[je("div",{className:`${s} text-indigo-700 dark:text-indigo-300`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),_e("label",{htmlFor:o,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.advancedDebounceLabel}),_e("input",{id:o,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs||Et.debounceMs,onChange:l=>t(d=>({...d,debounceMs:parseInt(l.target.value,10)})),className:"w-full"}),je("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.debounceMs||Et.debounceMs]}),_e("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.advancedDebounceHint})]},"debounce")),je("section",{className:"space-y-3",children:[je("div",{className:"flex items-center justify-between gap-3",children:[je("div",{className:"flex items-center gap-2 font-semibold text-gray-700 text-xs transition-colors dark:text-slate-200",children:[_e("span",{children:"\u26A1"}),_e("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),_e("button",{type:"button",onClick:()=>t(l=>({...l,learningWeight:Et.learningWeight,debounceMs:Et.debounceMs})),className:"rounded border border-gray-300 bg-gray-100 px-2 py-1 font-medium text-gray-700 text-xs transition-colors hover:bg-gray-200 dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-200 dark:hover:bg-slate-700/70",title:n.resetToDefaultsTitle,children:n.reset})]}),_e("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:c})]})});ia.displayName="AdvancedSearchSettings";le();import{DEFAULT_FUZZY_SEARCH_OPTIONS as yt}from"@aiquants/fuzzy-search";import{memo as _o,useId as Ae}from"react";import{jsx as X,jsxs as Z}from"react/jsx-runtime";var la=_o(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:s,setOpenEmailsWithGmail:a})=>{let o=G(),c="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",l="text-xs font-semibold",d=Ae(),m=Ae(),u=Ae(),i=Ae(),p=Ae(),h=Ae(),C=Ae(),v=Ae(),k=Ae(),F=Ae(),T=[];return T.push(Z("div",{className:`${c} border-blue-200 border-l-4 dark:border-blue-500/50`,children:[Z("div",{className:`${l} text-blue-700 dark:text-blue-300`,children:["\u{1F3AF} ",o.basicThresholdHeading]}),X("label",{htmlFor:d,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicThresholdLabel}),X("input",{id:d,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??yt.threshold,onChange:y=>t(g=>({...g,threshold:parseFloat(y.target.value)})),className:"w-full"}),Z("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[o.currentValueLabel," ",e.threshold??yt.threshold]}),X("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:e.sortBy==="relevance"?o.basicThresholdRangeRelevance:o.basicThresholdRange})]},"threshold")),T.push(Z("div",{className:`${c} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[Z("div",{className:`${l} text-amber-700 dark:text-amber-300`,children:["\u{1FA84} ",o.basicDisplayHeading]}),Z("label",{htmlFor:m,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[X("input",{id:m,type:"checkbox",checked:e.caseSensitive??yt.caseSensitive,onChange:y=>t(g=>({...g,caseSensitive:y.target.checked})),className:"h-3 w-3"}),o.basicCaseSensitive]}),Z("label",{htmlFor:u,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[X("input",{id:u,type:"checkbox",checked:n,onChange:y=>r(y.target.checked),className:"h-3 w-3"}),o.basicHighlight]}),Z("label",{htmlFor:i,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[X("input",{id:i,type:"checkbox",checked:s,onChange:y=>a(y.target.checked),className:"h-3 w-3"}),o.basicOpenEmailsWithGmail]}),Z("div",{className:"flex flex-col gap-1",children:[X("label",{htmlFor:p,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicMultiTermOperator}),Z("select",{id:p,value:e.multiTermOperator??yt.multiTermOperator,onChange:y=>t(g=>({...g,multiTermOperator:y.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[X("option",{value:"or",children:o.basicOperatorOr}),X("option",{value:"and",children:o.basicOperatorAnd})]}),X("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:o.basicMultiTermHint})]})]},"display")),T.push(Z("div",{className:`${c} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[Z("div",{className:`${l} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4DA} ",o.basicSortHeading]}),Z("div",{className:"flex flex-col gap-2",children:[X("label",{htmlFor:h,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicSortBy}),Z("select",{id:h,value:e.sortBy||yt.sortBy,onChange:y=>t(g=>({...g,sortBy:y.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[X("option",{value:"score",children:o.basicSortByScore}),X("option",{value:"relevance",children:o.basicSortByRelevance}),X("option",{value:"original",children:o.basicSortByOriginal})]})]}),Z("div",{className:"flex flex-col gap-2",children:[X("label",{htmlFor:C,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicSortOrder}),Z("select",{id:C,value:e.sortOrder||yt.sortOrder,onChange:y=>t(g=>({...g,sortOrder:y.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[X("option",{value:"desc",children:o.basicSortDescending}),X("option",{value:"asc",children:o.basicSortAscending})]})]})]},"sorting")),T.push(Z("div",{className:`${c} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[Z("div",{className:`${l} text-purple-700 dark:text-purple-300`,children:["\u2699\uFE0F ",o.basicEngineHeading]}),X("label",{htmlFor:v,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicStrategy}),Z("select",{id:v,value:e.parallelSearchStrategy||yt.parallelSearchStrategy,onChange:y=>t(g=>({...g,parallelSearchStrategy:y.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[X("option",{value:"balanced",children:o.basicStrategyBalanced}),X("option",{value:"index-first",children:o.basicStrategyIndexFirst}),X("option",{value:"levenshtein-first",children:o.basicStrategyLevenshteinFirst})]}),Z("div",{className:"mt-2 space-y-2",children:[Z("label",{htmlFor:k,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[X("input",{id:k,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:y=>t(g=>({...g,enableIndexFiltering:y.target.checked})),className:"h-3 w-3"}),o.basicIndexFiltering]}),Z("label",{htmlFor:F,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[X("input",{id:F,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:y=>t(g=>({...g,enableLevenshtein:y.target.checked})),className:"h-3 w-3"}),o.basicLevenshtein]})]})]},"engine")),Z("section",{className:"space-y-3",children:[Z("div",{className:"flex items-center gap-2 font-semibold text-blue-700 text-xs transition-colors dark:text-sky-400",children:[X("span",{children:"\u{1F527}"}),X("span",{className:"tracking-wide",children:o.settingsBasicTab})]}),X("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:T})]})});la.displayName="BasicSearchSettings";bt();import ds from"lucide-react/dist/esm/icons/badge-check.js";import cs from"lucide-react/dist/esm/icons/building-2.js";import us from"lucide-react/dist/esm/icons/calendar-clock.js";import ps from"lucide-react/dist/esm/icons/check.js";import ms from"lucide-react/dist/esm/icons/copy.js";import gs from"lucide-react/dist/esm/icons/id-card.js";import hs from"lucide-react/dist/esm/icons/mail.js";import fs from"lucide-react/dist/esm/icons/phone.js";import ys from"lucide-react/dist/esm/icons/user-round.js";import{useCallback as bs,useEffect as xs,useMemo as En,useRef as vs,useState as Cs}from"react";var Ie={info:(e,...t)=>console.info(`[contact-map] ${e}`,...t),warn:(e,...t)=>console.warn(`[contact-map] ${e}`,...t),error:(e,...t)=>console.error(`[contact-map] ${e}`,...t)};le();import*as Re from"@radix-ui/react-tabs";import*as Rn from"react";import{clsx as is}from"clsx";import{twMerge as ls}from"tailwind-merge";function xt(...e){return ls(is(e))}import{jsx as Ca}from"react/jsx-runtime";var Ln=Re.Root,Jt=Rn.forwardRef(({className:e,...t},n)=>Ca(Re.List,{ref:n,className:xt("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Jt.displayName=Re.List.displayName;var vt=Rn.forwardRef(({className:e,...t},n)=>Ca(Re.Trigger,{ref:n,className:xt("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-2xs",e),...t}));vt.displayName=Re.Trigger.displayName;var Ct=Rn.forwardRef(({className:e,...t},n)=>Ca(Re.Content,{ref:n,className:xt("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=inactive]:hidden",e),...t}));Ct.displayName=Re.Content.displayName;Mn();import{jsx as P,jsxs as ce}from"react/jsx-runtime";var yr={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},ks=({icon:e,label:t,value:n,fieldKey:r,copyValue:s,onCopy:a,isCopied:o,linkHref:c,searchTerm:l,enableHighlighting:d})=>{let m=G(),u=!!(a&&r&&s),i=c?.startsWith("https://mail.google.com")?"_blank":void 0;return ce("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-slate-200 bg-slate-50 px-2.5 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[ce("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[P("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-white text-slate-500 transition-colors dark:bg-slate-800 dark:text-slate-200",children:P(e,{size:14})}),ce("div",{className:"min-w-0 flex-1",children:[P("div",{className:"font-medium text-[10px] text-slate-500 dark:text-slate-400",children:t}),P("div",{className:"truncate font-semibold text-slate-900 text-xs dark:text-slate-100",children:c?P("a",{href:c,className:"text-inherit underline-offset-2 hover:underline focus:underline focus:outline-none",target:i,rel:i?"noopener noreferrer":void 0,children:P(ue,{text:n,query:l??"",enabled:d})}):P(ue,{text:n,query:l??"",enabled:d})})]})]}),u?P("button",{type:"button",onClick:()=>a&&r&&s&&a(r,s,t),className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 transition-colors hover:border-blue-400 hover:text-blue-500 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:border-blue-400 dark:hover:text-blue-300","aria-label":m.copyField(t),children:o?P(ps,{size:14}):P(ms,{size:14})}):null]})},br=({items:e,searchTerm:t,enableHighlighting:n})=>P("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(r=>ce("div",{className:"flex flex-col gap-0.5 rounded-md border border-slate-200 bg-white/60 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[P("dt",{className:"font-semibold text-[10px] text-slate-500 uppercase tracking-wide dark:text-slate-400",children:r.label}),P("dd",{className:"wrap-break-word text-slate-900 text-xs dark:text-slate-100",children:P(ue,{text:r.value,query:t??"",enabled:n})})]},r.fieldKey))}),ka=({title:e})=>P("h3",{className:"font-semibold text-slate-700 text-xs dark:text-slate-200",children:e}),Ss=()=>{let e=G();return ce("div",{className:"flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border border-slate-300 border-dashed bg-white/60 p-4 text-center transition-colors dark:border-slate-700 dark:bg-slate-900/40",children:[P("p",{className:"font-medium text-slate-600 text-xs dark:text-slate-200",children:e.detailEmptyTitle}),P("p",{className:"text-[11px] text-slate-500 dark:text-slate-400",children:e.detailEmptyHint})]})},ot=({contact:e,searchTerm:t,enableHighlighting:n,style:r,className:s=""})=>{let a=G(),[o,c]=Cs(null),l=vs(null),d=En(()=>({...yr,...r}),[r]);xs(()=>()=>{l.current!==null&&window.clearTimeout(l.current)},[]);let m=En(()=>kn(e),[e]),u=En(()=>Sn(e),[e]),i=En(()=>Pe(e?.contacted_at??null),[e?.contacted_at]),p=bs(async(b,f,x)=>{try{await navigator.clipboard.writeText(f),c(b),l.current!==null&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>{c(null)},2e3)}catch(O){Ie.error("Failed to copy contact detail",O)}},[]);if(!e)return P("div",{className:"flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",style:yr,children:P(Ss,{})});let h=[j(e.title),j(e.department)].filter(b=>b!=="-"),C=[h.join(" / "),j(e.company_name)].filter(b=>b&&b!=="-").join(" \u30FB ")||"-",v=j(e.full_name),k=[{fieldKey:"full_name",label:a.fieldFullName,value:v==="-"?a.noName:v},{fieldKey:"full_name_reading",label:a.fieldFullNameReading,value:j(e.full_name_reading)},{fieldKey:"title",label:a.fieldTitle,value:j(e.title)},{fieldKey:"department",label:a.fieldDepartment,value:j(e.department)},{fieldKey:"company_name",label:a.fieldCompanyName,value:j(e.company_name)},{fieldKey:"company_name_reading",label:a.fieldCompanyNameReading,value:j(e.company_name_reading)},{fieldKey:"address",label:a.fieldAddress,value:j(e.address)},{fieldKey:"postal_code",label:a.fieldPostalCode,value:j(e.postal_code)},{fieldKey:"url",label:a.fieldUrl,value:j(e.url)}],F=[{label:a.fieldCustomEmail,value:j(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:a.fieldEmail,value:j(e.email),fieldKey:"email",rawValue:e.email}].filter(b=>b.value!=="-"),T=[{label:a.fieldCustomMobilePhone,value:j(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:a.fieldMobilePhone,value:j(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:a.fieldCompanyPhone,value:j(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:a.fieldCompanyFax,value:j(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(b=>b.value!=="-"),y=[{fieldKey:"person_id",label:"person_id",value:j(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:j(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:j(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:j(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:j(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:j(e.is_in_eight)},{fieldKey:"created_by",label:a.fieldCreatedBy,value:j(e.created_by)},{fieldKey:"created_at",label:a.fieldCreatedAt,value:Pe(e.created_at)},{fieldKey:"updated_by",label:a.fieldUpdatedBy,value:j(e.updated_by)},{fieldKey:"updated_at",label:a.fieldUpdatedAt,value:Pe(e.updated_at)}],g=[{rowKey:"person_id",icon:gs,label:"person_id",value:j(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:hs,label:a.summaryEmail,value:m.value??"-",fieldKey:"primary_email",copyValue:m.value,linkHref:qe(m.value,!1)},{rowKey:"primary_phone",icon:fs,label:a.summaryPhone,value:u.value??"-",fieldKey:"primary_phone",copyValue:u.value,linkHref:qt(u.value)},{rowKey:"contacted_at",icon:us,label:a.summaryLastContact,value:i}],E=[{sectionKey:"email",title:a.sectionEmail,emptyText:a.sectionEmailEmpty,entries:F,recommendedKey:m.fieldKey??null,resolveHref:b=>qe(b!=null?String(b):null,!1)},{sectionKey:"phone",title:a.sectionPhone,emptyText:a.sectionPhoneEmpty,entries:T,recommendedKey:u.fieldKey??null,resolveHref:b=>qt(b!=null?String(b):null)}],K=[{value:"summary",label:a.detailTabSummary,content:ce("div",{className:"flex flex-col gap-4",children:[ce("div",{className:"flex flex-col gap-1",children:[ce("div",{className:"flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[P(cs,{size:16}),P("span",{children:P(ue,{text:j(e.company_name),query:t??"",enabled:n})})]}),h.length>0?P("div",{className:"text-slate-600 text-sm dark:text-slate-300",children:h.map((b,f)=>ce("span",{children:[f>0&&" / ",P(ue,{text:b,query:t??"",enabled:n})]},`header-line-${f}`))}):null]}),P("div",{className:"flex flex-col gap-3",children:g.map(b=>P(ks,{icon:b.icon,label:b.label,value:b.value,fieldKey:b.fieldKey,copyValue:b.copyValue,onCopy:p,isCopied:b.fieldKey?o===b.fieldKey:!1,linkHref:b.linkHref,searchTerm:t,enableHighlighting:n},b.rowKey))})]})},{value:"basic",label:a.detailTabBasic,content:ce("div",{className:"flex flex-col gap-3",children:[P(ka,{title:a.detailBasicProfile}),P(br,{items:k,searchTerm:t,enableHighlighting:n})]})},{value:"contact",label:a.detailTabContact,content:P("div",{className:"flex flex-col gap-4",children:E.map(({sectionKey:b,title:f,emptyText:x,entries:O,recommendedKey:W,resolveHref:te})=>ce("div",{className:"flex flex-col gap-2",children:[P(ka,{title:f}),O.length===0?P("p",{className:"text-slate-500 text-xs dark:text-slate-400",children:x}):P("div",{className:"flex flex-col gap-2",children:O.map(w=>{let N=te(w.rawValue),H=w.fieldKey===W;return ce("div",{className:"flex items-center justify-between rounded-lg border border-slate-200 bg-white px-3 py-2 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[ce("div",{children:[P("div",{className:"font-medium text-slate-500 text-xs dark:text-slate-400",children:w.label}),P("div",{className:"text-slate-900 text-sm dark:text-slate-100",children:N?P("a",{href:N,className:"text-inherit underline-offset-2 hover:underline focus:underline focus:outline-none",children:P(ue,{text:w.value,query:t??"",enabled:n})}):P(ue,{text:w.value,query:t??"",enabled:n})})]}),H?ce("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-100 px-2 py-0.5 font-semibold text-[11px] text-emerald-700 transition-colors dark:bg-emerald-300/20 dark:text-emerald-200",children:[P(ds,{size:14}),a.preferred]}):null]},w.fieldKey)})})]},b))})},{value:"meta",label:a.detailTabMeta,content:ce("div",{className:"flex flex-col gap-3",children:[P(ka,{title:a.detailTabMeta}),P(br,{items:y,searchTerm:t,enableHighlighting:n})]})}];return ce("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950 ${s}`.trim(),style:d,children:[P("div",{className:"border-slate-200 border-b px-3 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/50",children:ce("div",{className:"flex items-center gap-2",children:[P("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-blue-50 text-blue-600 transition-colors dark:bg-sky-900/40 dark:text-sky-300",children:P(ys,{size:16})}),ce("div",{className:"min-w-0 flex-1",children:[P("div",{className:"truncate font-semibold text-slate-900 text-sm dark:text-slate-100",children:P(ue,{text:j(e.full_name),query:t??"",enabled:n})}),P("div",{className:"truncate text-[11px] text-slate-600 dark:text-slate-300",children:P(ue,{text:C,query:t??"",enabled:n})})]})]})}),ce(Ln,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[P(Jt,{className:"flex gap-1.5 border-slate-200 border-b bg-slate-50 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:K.map(b=>P(vt,{value:b.value,className:"rounded-md px-1.5 py-0.5 font-semibold text-[11px] transition-colors data-[state=active]:bg-white data-[state=active]:text-blue-600 dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-sky-300",children:b.label},b.value))}),K.map(b=>P(Ct,{value:b.value,className:"scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors dark:text-slate-200",children:b.content},b.value))]})]})};ft();le();import{memo as Ts}from"react";import{jsx as st,jsxs as On}from"react/jsx-runtime";var Sa=Ts(({recordCount:e,companyCount:t,phase:n,loadedCount:r,totalCount:s,errorMessage:a,onRetry:o})=>{let{locale:c,labels:l}=ye(),d=q(c,e),m=q(c,t);return On("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",role:"status",children:[On("span",{className:"flex items-baseline gap-1",children:[st("span",{className:"text-slate-600 dark:text-slate-300",children:l.annotationTotalLabel}),st("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-record-count",children:d}),st("span",{className:"text-slate-600 dark:text-slate-300",children:l.recordUnit(d)})]}),On("span",{className:"flex items-baseline gap-1",children:[st("span",{className:"text-slate-600 dark:text-slate-300",children:l.annotationCompaniesLabel}),st("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-company-count",children:m}),st("span",{className:"text-slate-600 dark:text-slate-300",children:l.companyUnit(m)})]}),n==="streaming"||n==="retrying"||n==="idle"?st("span",{"data-testid":"contact-map-stream-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-blue-50 px-2 py-0.5 font-medium text-blue-700 text-xs dark:bg-blue-900/30 dark:text-blue-300",children:s!==null&&s>0?l.annotationStreamingProgress({loaded:r,total:s,percent:Math.min(100,Math.round(r/s*100))}):l.annotationStreamingCount(r)}):null,n==="failed"||n==="auth-required"?On("span",{"data-testid":"contact-map-error-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-rose-50 px-2 py-0.5 font-medium text-rose-700 text-xs dark:bg-rose-900/30 dark:text-rose-300",title:n==="failed"?a??void 0:void 0,children:["\u26D4 ",n==="auth-required"?l.annotationAuthRequired:l.annotationLoadFailed(r),o?st("button",{type:"button","data-testid":"contact-map-retry-button",onClick:o,className:"rounded border border-rose-300 bg-white px-1.5 py-0.5 font-semibold text-rose-700 transition-colors hover:bg-rose-100 dark:border-rose-700 dark:bg-rose-950 dark:text-rose-200 dark:hover:bg-rose-900",children:l.annotationRetry}):null]}):null]})});Sa.displayName="ContactMapAnnotation";Lt();import{useMemo as ho}from"react";Mt();Lt();le();import{createContext as Ns,useContext as Ps,useMemo as Ms}from"react";Mt();Lt();Zn();var ws=["indexWorker","levenshteinWorker","treeWorker"];function xr(e,t,n){if(n!==void 0){if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string or left out (pass url.href for a URL object); got ${se(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${se(n)}`)}}var vr={setting:"workerUrls"},Cr=(e,t)=>{if(e===void 0)return;let{setting:n,keys:r=ws,hints:s={}}=t;if(!Rt(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${se(e)}`);let a=Object.getOwnPropertyNames(e).map(l=>({key:l,url:e[l]})),o=a.find(({key:l,url:d})=>d!==void 0&&!r.includes(l));if(o!==void 0){let l=Object.hasOwn(s,o.key)?s[o.key]:void 0,d=l===void 0?bn(o.key,r):void 0;throw new RangeError(`[contact-map] ${n} has a key it does not take (it takes ${r.join(", ")}${l===void 0?"":`; ${l}`}${d===void 0?"":`; did you mean ${JSON.stringify(d)}?`}); got ${se(o.key)}`)}let c=Object.create(null);for(let{key:l,url:d}of a){let m=l;xr(n,m,d),d!==void 0&&(c[m]=d)}return c};function oc(e,t=vr){Cr(e,t)}function kr(e){xr("workerUrls","treeWorker",e)}var Wt=(e,t,n=vr)=>{let r=Cr(t,n);return{indexWorker:r?.indexWorker===void 0?e?.indexWorker:r.indexWorker,levenshteinWorker:r?.levenshteinWorker===void 0?e?.levenshteinWorker:r.levenshteinWorker,treeWorker:r?.treeWorker===void 0?e?.treeWorker:r.treeWorker}};import{jsx as Ta}from"react/jsx-runtime";var Sr=e=>{if(!Rt(e))throw new TypeError(`[contact-map] config must be a plain object; got ${se(e)}`);let t=e;return{streamEndpoint:ge(t,"streamEndpoint"),openEmailsWithGmail:ge(t,"openEmailsWithGmail"),treeWorkerFactory:ge(t,"treeWorkerFactory"),workerUrls:Wt(void 0,ge(t,"workerUrls")),layoutSpec:ge(t,"layoutSpec"),locale:ge(t,"locale"),labels:ge(t,"labels")}},Tr=({workerUrls:e,...t})=>{let{indexWorker:n,levenshteinWorker:r,treeWorker:s}=e;return Object.freeze(Object.assign(Object.create(null),t,{workerUrls:Object.freeze({indexWorker:n,levenshteinWorker:r,treeWorker:s})}))},Rs=Tr(Sr({})),wr=Ns(Rs),Ls=Object.freeze({locale:"locale",labels:"labels"});function wa({config:e,chromeSurface:t,children:n}){let{streamEndpoint:r,openEmailsWithGmail:s,treeWorkerFactory:a,workerUrls:o,layoutSpec:c,locale:l,labels:d}=Sr(e),{indexWorker:m,levenshteinWorker:u,treeWorker:i}=o,p=Ms(()=>Tr({streamEndpoint:r,openEmailsWithGmail:s,treeWorkerFactory:a,workerUrls:{indexWorker:m,levenshteinWorker:u,treeWorker:i},layoutSpec:c,locale:l,labels:d}),[r,s,a,m,u,i,c,l,d]);return Ta(wr.Provider,{value:p,children:Ta(Za,{locale:l,labels:d,surface:t,children:n})})}function Es({config:e,children:t}){return Ta(wa,{config:e,chromeSurface:Ls,children:t})}function Ge(){return Ps(wr)}import{useCallback as Na,useEffect as As,useMemo as Hn,useSyncExternalStore as Nr}from"react";Mt();var Os=1e3,Ws=3e4,Ds=6;function Dn(e){if(typeof e!="string")throw new TypeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream", set on ContactMapConfigProvider or ContactMapAppView; got ${se(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${se(e)}`);if(!e.startsWith("/")||e.startsWith("//")||e.startsWith("/\\"))throw new RangeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream"; got ${se(e)}`)}var Hs=e=>({...e,contacted_at:e.contacted_at?new Date(e.contacted_at):null,created_at:e.created_at?new Date(e.created_at):void 0,updated_at:e.updated_at?new Date(e.updated_at):void 0}),_s=e=>Array.isArray(e.records),Wn=class{constructor(t){this.recordMap=new Map;this.listeners=new Set;this.lastCursor=null;this.consecutiveFailures=0;this.started=!1;this.disposed=!1;this.activeController=null;this.wakeRetryWait=null;this.state={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null};this.handleOnline=()=>{this.wakeRetryWait?.()};Dn(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??Os,this.maxRetryDelayMs=t.maxRetryDelayMs??Ws,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Ds,this.logger=t.logger??Ie}getState(){return this.state}getRecordMap(){return this.recordMap}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}start(){this.started||this.disposed||(this.started=!0,typeof window<"u"&&window.addEventListener("online",this.handleOnline),this.runStreamLoop())}retryNow(){if(!this.disposed)switch(this.state.phase){case"retrying":this.wakeRetryWait?.();return;case"failed":case"auth-required":this.consecutiveFailures=0,this.setState({error:null,isLoading:this.recordMap.size===0}),this.runStreamLoop();return;case"idle":case"streaming":case"complete":return}}dispose(){this.disposed=!0,this.activeController?.abort(),this.wakeRetryWait?.(),typeof window<"u"&&window.removeEventListener("online",this.handleOnline)}setState(t){this.state={...this.state,...t};for(let n of this.listeners)n(this.state)}publishRecords(t={}){let n=Array.from(this.recordMap.values());this.setState({records:n,loadedCount:n.length,isLoading:!1,...t})}async runStreamLoop(){for(this.setState({phase:"streaming"});!this.disposed;){let t=await this.streamOnce();if(t==="aborted")return;if(t==="complete"){this.publishRecords({isComplete:!0,phase:"complete",error:null});return}if(t==="auth-required"){this.setState({phase:"auth-required",isLoading:!1,error:new Error("Authentication required")});return}if(this.consecutiveFailures+=1,this.consecutiveFailures>=this.maxConsecutiveFailures){this.setState({phase:"failed",isLoading:!1});return}let n=Math.min(this.initialRetryDelayMs*2**(this.consecutiveFailures-1),this.maxRetryDelayMs);if(this.setState({phase:"retrying",isLoading:this.recordMap.size===0}),this.logger.warn(`[ContactMapStream] retrying in ${n}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(n),this.disposed)return;this.setState({phase:"streaming"})}}waitBeforeRetry(t){return new Promise(n=>{let r=setTimeout(()=>{this.wakeRetryWait=null,n()},t);this.wakeRetryWait=()=>{clearTimeout(r),this.wakeRetryWait=null,n()}})}buildStreamUrl(){if(!this.lastCursor)return this.endpoint;let t=this.endpoint.includes("?")?"&":"?",n=new URLSearchParams;return this.lastCursor.contacted_at!==null&&n.set("cursor_contacted_at",this.lastCursor.contacted_at),n.set("cursor_person_id",String(this.lastCursor.person_id)),`${this.endpoint}${t}${n.toString()}`}async streamOnce(){this.activeController=new AbortController;try{let t=await this.fetchFn(this.buildStreamUrl(),{signal:this.activeController.signal,credentials:"same-origin"});if(t.status===401||t.status===403)return"auth-required";if(!(t.ok&&t.body))return this.logger.warn(`[ContactMapStream] unexpected response: ${t.status}`),"retryable";let n=t.body.getReader(),r=new TextDecoder,s="",a=!1,o=!1;for(;;){let{done:c,value:l}=await n.read();if(c)break;let d=r.decode(l,{stream:!0}),m=(s+d).split(`
1
+ var yo=Object.defineProperty;var Ne=(e,t)=>()=>(e&&(t=e(e=0)),t);var bo=(e,t)=>{for(var n in t)yo(e,n,{get:t[n],enumerable:!0})};var se,ja,Mt=Ne(()=>{"use strict";se=e=>{switch(typeof e){case"string":return JSON.stringify(e);case"bigint":return`${e}n`;case"symbol":return e.toString();case"object":return e===null?"null":ja(e);case"function":return ja(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},ja=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var Rt,ge,Lt=Ne(()=>{"use strict";Rt=e=>{if(typeof e!="object"||e===null)return!1;try{let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}catch{return!1}},ge=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0});var xo,bn,Zn=Ne(()=>{"use strict";xo=(e,t)=>{let n=Array.from({length:t.length+1},(r,s)=>s);for(let r=1;r<=e.length;r+=1){let s=[r];for(let a=1;a<=t.length;a+=1){let o=n[a-1]+(e[r-1]===t[a-1]?0:1);s.push(Math.min(n[a]+1,s[a-1]+1,o))}n=s}return n[t.length]},bn=(e,t)=>{let n=e.toLowerCase();if(n.length>=3){let s=t.find(a=>a.toLowerCase().startsWith(n));if(s!==void 0)return s}let r;for(let s of t){let a=xo(n,s.toLowerCase());a<=Math.max(1,Math.floor(s.length/4))&&(r===void 0||a<r.distance)&&(r={key:s,distance:a})}return r?.key}});import{DIRECTORY_TREE_LABEL_CATALOGS as qa,DIRECTORY_TREE_LABEL_KEYS as ea,resolveDirectoryTreeLabels as vo}from"@aiquants/directory-tree";import{resolveVirtualScrollLocale as Co,VIRTUAL_SCROLL_LABEL_KEYS as ko}from"@aiquants/virtualscroll";var So,q,ht,xn,Qa,jt,Ke,To,Ga,Ya,wo,ta,No,Po,Mo,na,aa,ra,ft=Ne(()=>{"use strict";Mt();Lt();Zn();So=Object.freeze({en:"en-US",ja:"ja-JP"}),q=(e,t)=>t.toLocaleString(So[e]),ht=(e,t,n)=>e==="1"?t:n,xn=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${q("en",e)} / ${q("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${q("en",e)} loaded)`,annotationLoadFailed:e=>`Failed to load (${q("en",e)} received)`,annotationAuthRequired:"Session expired: sign in again, then retry",annotationRetry:"Retry",recordUnit:e=>ht(e,"record","records"),companyUnit:e=>ht(e,"company","companies"),searchTab:"Fuzzy search",searchSettings:"Search settings",searchStatistics:"Search statistics",operatorAndTitle:"AND search (all terms match)",operatorOrTitle:"OR search (any term matches)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"All terms",operatorOrHint:"Any term",searchPlaceholder:"Fuzzy search...",searchBusyTitle:"Searching",clearSearch:"Clear search",searching:"Searching...",registeredCountLabel:"Registered:",rebuildingIndex:"Rebuilding index...",errorLabel:"Error:",resultCountLabel:"Results:",resultUnit:e=>ht(e,"match","matches"),listViewTab:"List",treeViewTab:"Tree",columnNo:"No",columnId:"ID",columnScore:"Score",columnName:"Name",columnTitle:"Title",columnCompany:"Company",columnDepartment:"Department",columnPhone:"Phone",columnEmail:"Email",columnUpdatedAt:"Updated",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"No search results found",listNoData:"No data",listResizeHandle:"Resize the border between the contact list and the detail pane",detailHeading:"Contact details",close:"Close",noName:"(No Name)",treeNodeCountTitle:"Number of nodes built in the tree view",treeNodeCountLabel:"Nodes:",treeNodeCount:e=>q("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${q("en",t)})`,treeStreamInterruptedTitle:"Streaming was interrupted. Only the data received so far is shown",treeStreamInterrupted:"Interrupted",treeStreamLoadingTitle:"Receiving data streamed from the network",treeStreamLoading:"Loading...",treeBuildingTitle:"Building and expanding the directory tree from the received data",treeBuilding:"Treeing...",treeCompleteTitle:"Every tree node has been built",treeComplete:"Complete",treeShowEntireCompanyTitle:"Show the whole company of every search hit",treeShowEntireCompany:"Whole company",treeExpandAll:"Expand all directories",treeExpandAllTitle:"Expand all",treeCollapseAll:"Collapse all directories",treeCollapseAllTitle:"Collapse all",treeNoMatches:"No contacts match the criteria",treeEmpty:"No contacts to display",treeResizeHandle:"Resize the border between the directory tree and the detail pane",copyField:e=>`Copy ${e}`,detailEmptyTitle:"Select a contact to see its details",detailEmptyHint:"Choose a person from the list",detailTabSummary:"Summary",detailTabBasic:"Basic info",detailBasicProfile:"Profile",detailTabContact:"Contact",detailTabMeta:"Metadata",preferred:"Preferred",summaryEmail:"Email",summaryPhone:"Phone",summaryLastContact:"Last contact",sectionEmail:"Email",sectionEmailEmpty:"No email addresses registered",sectionPhone:"Phone / Fax",sectionPhoneEmpty:"No phone numbers registered",fieldFullName:"Name",fieldFullNameReading:"Name (reading)",fieldTitle:"Title",fieldDepartment:"Department",fieldCompanyName:"Company",fieldCompanyNameReading:"Company (reading)",fieldAddress:"Address",fieldPostalCode:"Postal code",fieldUrl:"URL",fieldCustomEmail:"Custom email",fieldEmail:"Email",fieldCustomMobilePhone:"Custom mobile",fieldMobilePhone:"Mobile",fieldCompanyPhone:"Company phone",fieldCompanyFax:"Company fax",fieldCreatedBy:"Created by",fieldCreatedAt:"Created at",fieldUpdatedBy:"Updated by",fieldUpdatedAt:"Updated at",popupCustomMobilePhone:"Mobile (custom)",popupMobilePhone:"Mobile",popupCustomCompanyPhone:"Company phone (custom)",popupCompanyPhone:"Company phone",popupCustomEmail:"Email (custom)",popupEmail:"Email",popupGmailHint:"Double-click or double-tap to open Gmail",popupLastContactDate:"Last contact:",popupNoContactMethods:"No contact information to display",overlayTitle:"Details",overlayBackdrop:"Tap the background to close",settingsResetAllTitle:"Reset all settings",settingsResetAll:"Reset all",settingsTabsLabel:"Search option tabs",settingsBasicTab:"Basic settings",settingsAdvancedTab:"Advanced settings",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"Current:",resetToDefaultsTitle:"Reset to defaults",reset:"Reset",relevanceOnlyNotice:"Editable only when sorting by relevance",relevanceWeightsHeading:"Relevance score weights",fieldWeight:"Field weight",scoreTuningHeading:"Score tuning",maxResults:"Maximum results",noLimit:"No limit",basicThresholdHeading:"Final similarity threshold",basicThresholdLabel:"Adjust the minimum score",basicThresholdRangeRelevance:"In relevance mode a score can exceed 1.0 (range: 0.0-1.5)",basicThresholdRange:"Range: 0.0-1.0",basicDisplayHeading:"Display options",basicCaseSensitive:"Case-sensitive",basicHighlight:"Highlight matches",basicOpenEmailsWithGmail:"Open email addresses in Gmail compose",basicMultiTermOperator:"Operator for words inside quotes",basicOperatorOr:"OR (any word matches)",basicOperatorAnd:"AND (all words match)",basicMultiTermHint:'How words between quotation marks ("tanaka taro") are combined (default: AND). Words outside quotation marks are separate keywords combined by the AND / OR button',basicSortHeading:"Sorting",basicSortBy:"Sort by",basicSortByScore:"Score",basicSortByRelevance:"Relevance",basicSortByOriginal:"Original order",basicSortOrder:"Sort order",basicSortDescending:"Descending",basicSortAscending:"Ascending",basicEngineHeading:"Search engine",basicStrategy:"Parallel search strategy",basicStrategyBalanced:"Balanced",basicStrategyIndexFirst:"Index first",basicStrategyLevenshteinFirst:"Levenshtein first",basicIndexFiltering:"Index filtering",basicLevenshtein:"Levenshtein distance",advancedLearningHeading:"Learning weight",advancedLearningLabel:"Weight factor",advancedLearningHint:"Weight applied when re-learning (higher favors past search results)",advancedDebounceHeading:"Debounce time",advancedDebounceLabel:"Input delay (ms)",advancedDebounceHint:"How long input is awaited. Shorter is more real-time, longer reduces load",indexSettingsHeading:"Index Worker settings",indexBuildHeading:"Index build",indexNgramSize:"N-gram size",indexNgramSizeHint:"How many characters each chunk holds. Smaller is faster but less accurate",indexMinNgramOverlap:"Minimum N-gram matches",indexMinNgramOverlapHint:"Candidates with fewer matches are excluded",indexCandidateHeading:"Candidate filtering",indexThreshold:"Index threshold",indexThresholdHint:"Lower bound of the Jaro-Winkler similarity (range: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram overlap threshold",indexNgramOverlapThresholdHint:"How much N-grams must overlap. Higher narrows candidates more strictly",indexStrategyHeading:"Search strategy and candidates",indexStrategy:"Search strategy",indexStrategyFast:"Fast",indexStrategyAccurate:"Accurate",indexStrategyHybrid:"Hybrid (adaptive)",indexStrategyHint:"Balance processing load against accuracy",indexMinCandidatesRatio:"Minimum candidate ratio",indexMinCandidatesRatioHint:"Share of candidates always kept",indexMaxCandidatesRatio:"Maximum candidate ratio",indexMaxCandidatesRatioHint:"Upper bound on candidates; narrowed dynamically when exceeded",indexJaroWinklerPrefix:"Jaro-Winkler prefix weight",indexJaroWinklerPrefixHint:"Bonus given to a matching prefix",indexMaxResultsHint:"Maximum number of results to fetch. Larger is more thorough but slower",indexFieldWeightHint:"How much the number of matched fields counts",indexPerfectMatchBonus:"Exact match bonus",indexPerfectMatchBonusHint:"Bonus added on an exact match",indexContainmentHeading:"Containment score (Japanese / substrings)",indexContainmentBase:"Containment base score (containmentScoreBase)",indexContainmentBaseHint:"Minimum base score when the query is fully contained in the string (rescues short Japanese queries such as 2 characters)",indexContainmentCoverage:"Containment coverage weight (containmentCoverageWeight)",indexContainmentCoverageHint:"Extra score by the query length / field length ratio (total capped at 1.0)",levenshteinSettingsHeading:"Levenshtein Worker settings",levenshteinCandidateHeading:"Candidate filter",levenshteinThreshold:"Levenshtein threshold",levenshteinThresholdHintRelevance:"Keep only results at or above this threshold (range: 0.0-1.5)",levenshteinThresholdHint:"Keep only results at or above this threshold (range: 0.0-1.0)",levenshteinLengthSimilarity:"Length similarity threshold",levenshteinLengthSimilarityHint:"Exclude candidates whose length differs greatly, for speed",levenshteinLengthPenalty:"Length difference penalty",levenshteinLengthPenaltyHint:"How much a length difference is penalized. Larger favors equal lengths",levenshteinResultsHeading:"Result count",levenshteinMaxResultsHint:"Maximum number of results to return. Larger is more thorough but slower",levenshteinFieldWeightHint:"Weight of the number of matched fields",levenshteinPartialBonus:"Partial match bonus",levenshteinPartialBonusHint:"Extra score for a partial match",statsRebuildingTitle:"Rebuilding the index",statsRebuildIndexTabOnlyTitle:"Available on the Index tab only",statsRebuildTitle:"Rebuild the index",statsRebuilding:"Rebuilding...",statsRebuild:"Rebuild Index",statsResetTitle:"Reset statistics",statsOverviewTab:"Overview",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"Total searches",statAverageSearchTime:"Average search time",statDataCount:"Data items",statResultCount:"Search results",statDisplayedCount:"Displayed items",statsNoData:"No statistics yet",statsBasicHeading:"Basic statistics",statTotalProcessingTime:"Total processing time",statLastSearchTime:"Last search time",statErrorCount:"Errors",statUpdatedAt:"Statistics updated at",statsOperationsHeading:"Operations",statTotalOperations:"Total operations",statsIndexHeading:"Index statistics",statIndexBuilds:"Index builds",statDataSize:"Data size",statLastBuildTime:"Last build time",statsCacheHeading:"Cache statistics",statCacheNgram:"N-gram",statCacheWord:"Words",statCachePhonetic:"Phonetic",statsIndexMetadataHeading:"Index metadata",statsCalculationsHeading:"Calculations",statTotalCalculations:"Total calculations",statDistanceCalculations:"Distance calculations",statAverageDistance:"Average distance",statMinDistance:"Minimum distance",statMaxDistance:"Maximum distance",notAvailable:"N/A",statsMatchesHeading:"Matches",statPartialMatches:"Partial matches",statPerfectMatches:"Exact matches",statEarlyTerminations:"Early terminations",statsSimilarityHeading:"Similarity distribution",statAbove80:"80% or more",statAbove60:"60% or more",statAbove40:"40% or more",statBelow40:"Below 40%",statsDistanceHeading:"Distance distribution (top 6)",statDistance:e=>`Distance ${e}`,statsQueryLengthHeading:"Query lengths (top 6)",statQueryLength:e=>`Length ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>{let n=q("en",e);return`${n} ${ht(n,"time","times")} / average ${t}%`},statsFieldPerformanceHeading:"Field performance (top 6)",statAverageScore:"Average score",statMatchCount:"Matches",statBestWorstScore:"Best / worst score",statsInsightsHeading:"Performance insights",statBestField:"Best-performing field",statRecentAverageTime:"Recent average processing time",statRecentAverageResults:"Recent average results",statThroughput:"Throughput",statCommonQueryLength:"Most common query length",statHistoryEntries:"History entries",statHighSimilarity:"High similarity",statMediumSimilarity:"Medium similarity",statLowSimilarity:"Low similarity",statVeryLowSimilarity:"Very low similarity",statsRecentHistoryHeading:"Recent history (latest 3)",statsHistoryEntry:({processingTimeMs:e,resultCount:t})=>`Processing time: ${e} ms / results: ${q("en",t)}`,timesUnit:e=>ht(e," time"," times"),itemsUnit:e=>ht(e," item"," items"),charactersUnit:e=>ht(e," character"," characters"),throughputUnit:" ops/s"}),ja:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"\u7DCF\u4EF6\u6570:",annotationCompaniesLabel:"\u4F01\u696D\u6570:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${q("ja",e)} / ${q("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${q("ja",e)} \u4EF6)`,annotationLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${q("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationAuthRequired:"\u30BB\u30C3\u30B7\u30E7\u30F3\u304C\u5207\u308C\u307E\u3057\u305F\u3002\u30B5\u30A4\u30F3\u30A4\u30F3\u3057\u76F4\u3057\u3066\u304B\u3089\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044",annotationRetry:"\u518D\u8A66\u884C",recordUnit:()=>"\u4EF6",companyUnit:()=>"\u793E",searchTab:"\u3042\u3044\u307E\u3044\u691C\u7D22",searchSettings:"\u691C\u7D22\u8A2D\u5B9A",searchStatistics:"\u691C\u7D22\u7D71\u8A08",operatorAndTitle:"AND \u691C\u7D22 (\u3059\u3079\u3066\u4E00\u81F4)",operatorOrTitle:"OR \u691C\u7D22 (\u3044\u305A\u308C\u304B\u4E00\u81F4)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"\u5168\u8A9E\u4E00\u81F4",operatorOrHint:"\u3044\u305A\u308C\u304B\u4E00\u81F4",searchPlaceholder:"\u3042\u3044\u307E\u3044\u691C\u7D22...",searchBusyTitle:"\u691C\u7D22\u51E6\u7406\u4E2D",clearSearch:"\u691C\u7D22\u3092\u30AF\u30EA\u30A2",searching:"\u691C\u7D22\u4E2D...",registeredCountLabel:"\u767B\u9332\u4EF6\u6570:",rebuildingIndex:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D...",errorLabel:"\u30A8\u30E9\u30FC:",resultCountLabel:"\u691C\u7D22\u7D50\u679C:",resultUnit:()=>"\u4EF6",listViewTab:"\u4E00\u89A7",treeViewTab:"\u30C4\u30EA\u30FC",columnNo:"No",columnId:"ID",columnScore:"\u30B9\u30B3\u30A2",columnName:"\u6C0F\u540D",columnTitle:"\u5F79\u8077",columnCompany:"\u4F1A\u793E\u540D",columnDepartment:"\u90E8\u7F72",columnPhone:"\u96FB\u8A71\u756A\u53F7",columnEmail:"\u30E1\u30FC\u30EB",columnUpdatedAt:"\u66F4\u65B0\u65E5\u6642",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"\u691C\u7D22\u7D50\u679C\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",listNoData:"\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",listResizeHandle:"\u9023\u7D61\u5148\u4E00\u89A7\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",detailHeading:"\u9023\u7D61\u5148\u8A73\u7D30",close:"\u9589\u3058\u308B",noName:"\u540D\u524D\u672A\u8A2D\u5B9A",treeNodeCountTitle:"\u30C4\u30EA\u30FC\u30D3\u30E5\u30FC\u3067\u69CB\u7BC9\u3055\u308C\u305F\u5168\u30CE\u30FC\u30C9\u6570",treeNodeCountLabel:"\u30CE\u30FC\u30C9:",treeNodeCount:e=>`${q("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${q("ja",t)})`,treeStreamInterruptedTitle:"\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u304C\u4E2D\u65AD\u3055\u308C\u307E\u3057\u305F\u3002\u53D7\u4FE1\u6E08\u307F\u30C7\u30FC\u30BF\u306E\u307F\u8868\u793A\u3057\u3066\u3044\u307E\u3059",treeStreamInterrupted:"\u4E2D\u65AD",treeStreamLoadingTitle:"\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u304B\u3089\u306E\u30C7\u30FC\u30BF\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u3092\u53D7\u4FE1\u4E2D",treeStreamLoading:"\u8AAD\u307F\u8FBC\u307F\u4E2D...",treeBuildingTitle:"\u53D7\u53D6\u30C7\u30FC\u30BF\u3092\u57FA\u306B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u69CB\u9020\u3092\u6700\u7D42\u69CB\u7BC9\u30FB\u5C55\u958B\u4E2D",treeBuilding:"\u30C4\u30EA\u30FC\u69CB\u7BC9\u4E2D...",treeCompleteTitle:"\u30C4\u30EA\u30FC\u30CE\u30FC\u30C9\u306E\u5168\u4EF6\u69CB\u7BC9\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F",treeComplete:"\u5B8C\u4E86",treeShowEntireCompanyTitle:"\u691C\u7D22\u30D2\u30C3\u30C8\u3057\u305F\u4F1A\u793E\u5168\u4F53\u3092\u8868\u793A",treeShowEntireCompany:"\u5168\u4F53\u8868\u793A",treeExpandAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u5C55\u958B",treeExpandAllTitle:"\u3059\u3079\u3066\u5C55\u958B",treeCollapseAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6298\u308A\u305F\u305F\u307F",treeCollapseAllTitle:"\u3059\u3079\u3066\u6298\u308A\u305F\u305F\u307F",treeNoMatches:"\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u9023\u7D61\u5148\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",treeEmpty:"\u8868\u793A\u3059\u308B\u9023\u7D61\u5148\u304C\u3042\u308A\u307E\u305B\u3093",treeResizeHandle:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",copyField:e=>`\u300C${e}\u300D\u3092\u30B3\u30D4\u30FC`,detailEmptyTitle:"\u9023\u7D61\u5148\u3092\u9078\u629E\u3059\u308B\u3068\u8A73\u7D30\u304C\u8868\u793A\u3055\u308C\u307E\u3059",detailEmptyHint:"\u4E00\u89A7\u304B\u3089\u5BFE\u8C61\u306E\u4EBA\u7269\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",detailTabSummary:"\u30B5\u30DE\u30EA\u30FC",detailTabBasic:"\u57FA\u672C\u60C5\u5831",detailBasicProfile:"\u57FA\u672C\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB",detailTabContact:"\u9023\u7D61\u5148",detailTabMeta:"\u30E1\u30BF\u60C5\u5831",preferred:"\u512A\u5148",summaryEmail:"\u30E1\u30FC\u30EB",summaryPhone:"\u96FB\u8A71",summaryLastContact:"\u6700\u7D42\u63A5\u89E6",sectionEmail:"\u30E1\u30FC\u30EB",sectionEmailEmpty:"\u767B\u9332\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306F\u3042\u308A\u307E\u305B\u3093",sectionPhone:"\u96FB\u8A71\u30FBFAX",sectionPhoneEmpty:"\u767B\u9332\u3055\u308C\u305F\u96FB\u8A71\u756A\u53F7\u306F\u3042\u308A\u307E\u305B\u3093",fieldFullName:"\u6C0F\u540D",fieldFullNameReading:"\u6C0F\u540D (\u304B\u306A)",fieldTitle:"\u5F79\u8077",fieldDepartment:"\u90E8\u7F72",fieldCompanyName:"\u4F1A\u793E\u540D",fieldCompanyNameReading:"\u4F1A\u793E\u540D (\u304B\u306A)",fieldAddress:"\u4F4F\u6240",fieldPostalCode:"\u90F5\u4FBF\u756A\u53F7",fieldUrl:"URL",fieldCustomEmail:"\u30AB\u30B9\u30BF\u30E0\u30E1\u30FC\u30EB",fieldEmail:"\u30E1\u30FC\u30EB",fieldCustomMobilePhone:"\u30AB\u30B9\u30BF\u30E0\u643A\u5E2F\u756A\u53F7",fieldMobilePhone:"\u643A\u5E2F\u756A\u53F7",fieldCompanyPhone:"\u4F1A\u793E\u96FB\u8A71\u756A\u53F7",fieldCompanyFax:"\u4F1A\u793E FAX \u756A\u53F7",fieldCreatedBy:"\u4F5C\u6210\u8005",fieldCreatedAt:"\u4F5C\u6210\u65E5\u6642",fieldUpdatedBy:"\u66F4\u65B0\u8005",fieldUpdatedAt:"\u66F4\u65B0\u65E5\u6642",popupCustomMobilePhone:"\u643A\u5E2F\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupMobilePhone:"\u643A\u5E2F\u96FB\u8A71",popupCustomCompanyPhone:"\u4F1A\u793E\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupCompanyPhone:"\u4F1A\u793E\u96FB\u8A71",popupCustomEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9 (\u30AB\u30B9\u30BF\u30E0)",popupEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",popupGmailHint:"\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u307E\u305F\u306F\u4E8C\u5EA6\u30BF\u30C3\u30D7\u3067 Gmail \u3092\u958B\u304D\u307E\u3059",popupLastContactDate:"\u6700\u7D42\u30B3\u30F3\u30BF\u30AF\u30C8\u65E5:",popupNoContactMethods:"\u8868\u793A\u3067\u304D\u308B\u9023\u7D61\u5148\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093",overlayTitle:"\u8A73\u7D30",overlayBackdrop:"\u80CC\u666F\u3092\u30BF\u30C3\u30D7\u3057\u3066\u9589\u3058\u308B",settingsResetAllTitle:"\u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u30EA\u30BB\u30C3\u30C8",settingsResetAll:"\u3059\u3079\u3066\u30EA\u30BB\u30C3\u30C8",settingsTabsLabel:"\u691C\u7D22\u30AA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A\u30BF\u30D6",settingsBasicTab:"\u57FA\u672C\u8A2D\u5B9A",settingsAdvancedTab:"\u8A73\u7D30\u8A2D\u5B9A",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"\u73FE\u5728\u5024:",resetToDefaultsTitle:"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u306B\u30EA\u30BB\u30C3\u30C8",reset:"\u30EA\u30BB\u30C3\u30C8",relevanceOnlyNotice:"Relevance \u30BD\u30FC\u30C8\u6642\u306E\u307F\u5909\u66F4\u53EF\u80FD",relevanceWeightsHeading:"Relevance \u30B9\u30B3\u30A2\u91CD\u307F",fieldWeight:"\u30D5\u30A3\u30FC\u30EB\u30C9\u91CD\u307F",scoreTuningHeading:"\u30B9\u30B3\u30A2\u8ABF\u6574",maxResults:"\u6700\u5927\u7D50\u679C\u6570",noLimit:"\u4E0A\u9650\u306A\u3057",basicThresholdHeading:"\u6700\u7D42\u985E\u4F3C\u5EA6\u95BE\u5024",basicThresholdLabel:"\u30B9\u30B3\u30A2\u306E\u4E0B\u9650\u3092\u8ABF\u6574",basicThresholdRangeRelevance:"Relevance \u30E2\u30FC\u30C9\u3067\u306F\u30B9\u30B3\u30A2\u304C 1.0 \u3092\u8D85\u3048\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059 (\u7BC4\u56F2: 0.0-1.5)",basicThresholdRange:"\u7BC4\u56F2: 0.0-1.0",basicDisplayHeading:"\u8868\u793A\u30AA\u30D7\u30B7\u30E7\u30F3",basicCaseSensitive:"\u5927\u6587\u5B57\u5C0F\u6587\u5B57\u3092\u533A\u5225",basicHighlight:"\u30CF\u30A4\u30E9\u30A4\u30C8\u8868\u793A",basicOpenEmailsWithGmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 Gmail \u306E\u4F5C\u6210\u753B\u9762\u3067\u958B\u304F",basicMultiTermOperator:"\u5F15\u7528\u7B26\u306E\u4E2D\u306E\u8A9E\u306E\u6F14\u7B97\u5B50",basicOperatorOr:"OR (\u3044\u305A\u308C\u304B\u4E00\u81F4)",basicOperatorAnd:"AND (\u3059\u3079\u3066\u4E00\u81F4)",basicMultiTermHint:'\u5F15\u7528\u7B26\u3067\u56F2\u3093\u3060\u8A9E ("\u7530\u4E2D \u592A\u90CE") \u306E\u7D50\u5408\u65B9\u6CD5 (\u65E2\u5B9A\u306F AND)\u3002\u5F15\u7528\u7B26\u306E\u5916\u306E\u8A9E\u306F\u305D\u308C\u305E\u308C\u5225\u306E\u30AD\u30FC\u30EF\u30FC\u30C9\u3067\u3001AND / OR \u30DC\u30BF\u30F3\u3067\u7D50\u5408\u3059\u308B',basicSortHeading:"\u30BD\u30FC\u30C8\u8A2D\u5B9A",basicSortBy:"\u30BD\u30FC\u30C8\u57FA\u6E96",basicSortByScore:"\u30B9\u30B3\u30A2",basicSortByRelevance:"\u95A2\u9023\u6027",basicSortByOriginal:"\u5143\u306E\u9806\u5E8F",basicSortOrder:"\u30BD\u30FC\u30C8\u9806\u5E8F",basicSortDescending:"\u964D\u9806",basicSortAscending:"\u6607\u9806",basicEngineHeading:"\u691C\u7D22\u30A8\u30F3\u30B8\u30F3\u8A2D\u5B9A",basicStrategy:"\u4E26\u5217\u691C\u7D22\u6226\u7565",basicStrategyBalanced:"\u30D0\u30E9\u30F3\u30B9",basicStrategyIndexFirst:"Index \u512A\u5148",basicStrategyLevenshteinFirst:"Levenshtein \u512A\u5148",basicIndexFiltering:"Index \u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0",basicLevenshtein:"Levenshtein \u8DDD\u96E2\u8A08\u7B97",advancedLearningHeading:"\u5B66\u7FD2\u91CD\u307F",advancedLearningLabel:"\u91CD\u307F\u4FC2\u6570",advancedLearningHint:"\u518D\u5B66\u7FD2\u6642\u306E\u91CD\u307F\u4ED8\u3051 (\u5927\u304D\u3044\u307B\u3069\u904E\u53BB\u306E\u691C\u7D22\u7D50\u679C\u3092\u512A\u5148)",advancedDebounceHeading:"\u30C7\u30D0\u30A6\u30F3\u30B9\u6642\u9593",advancedDebounceLabel:"\u5165\u529B\u9045\u5EF6 (ms)",advancedDebounceHint:"\u5165\u529B\u306E\u5F85\u3061\u6642\u9593\u3002\u77ED\u3044\u307B\u3069\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u3001\u9577\u3044\u307B\u3069\u8CA0\u8377\u8EFD\u6E1B",indexSettingsHeading:"Index Worker \u8A2D\u5B9A",indexBuildHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9",indexNgramSize:"N-gram \u30B5\u30A4\u30BA",indexNgramSizeHint:"\u6587\u5B57\u5217\u3092\u4F55\u6587\u5B57\u5358\u4F4D\u3067\u5206\u5272\u3059\u308B\u304B\u3002\u5C0F\u3055\u3044\u307B\u3069\u9AD8\u901F\u3060\u304C\u7CBE\u5EA6\u4F4E\u4E0B",indexMinNgramOverlap:"\u6700\u5C0F N-gram \u4E00\u81F4\u6570",indexMinNgramOverlapHint:"\u4E00\u81F4\u6570\u304C\u3053\u306E\u5024\u3092\u4E0B\u56DE\u308B\u5019\u88DC\u306F\u9664\u5916",indexCandidateHeading:"\u5019\u88DC\u7D5E\u308A\u8FBC\u307F",indexThreshold:"Index \u95BE\u5024",indexThresholdHint:"Jaro-Winkler \u985E\u4F3C\u5EA6\u306E\u4E0B\u9650 (\u7BC4\u56F2: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram \u91CD\u8907\u5EA6\u95BE\u5024",indexNgramOverlapThresholdHint:"N-gram \u306E\u91CD\u306A\u308A\u5177\u5408\u3002\u9AD8\u3044\u307B\u3069\u53B3\u5BC6\u306B\u5019\u88DC\u3092\u7D5E\u308B",indexStrategyHeading:"\u691C\u7D22\u6226\u7565\u3068\u5019\u88DC\u6570",indexStrategy:"\u691C\u7D22\u6226\u7565",indexStrategyFast:"Fast (\u9AD8\u901F)",indexStrategyAccurate:"Accurate (\u6B63\u78BA)",indexStrategyHybrid:"Hybrid (\u52D5\u7684)",indexStrategyHint:"\u51E6\u7406\u8CA0\u8377\u3068\u7CBE\u5EA6\u306E\u30D0\u30E9\u30F3\u30B9\u3092\u9078\u629E",indexMinCandidatesRatio:"\u6700\u5C0F\u5019\u88DC\u6BD4\u7387",indexMinCandidatesRatioHint:"\u6700\u4F4E\u9650\u78BA\u4FDD\u3059\u308B\u5019\u88DC\u5272\u5408",indexMaxCandidatesRatio:"\u6700\u5927\u5019\u88DC\u6BD4\u7387",indexMaxCandidatesRatioHint:"\u5019\u88DC\u6570\u306E\u4E0A\u9650\u3002\u8D85\u3048\u308B\u3068\u52D5\u7684\u306B\u7D5E\u308A\u8FBC\u307F",indexJaroWinklerPrefix:"Jaro-Winkler \u63A5\u982D\u8F9E\u91CD\u307F",indexJaroWinklerPrefixHint:"\u5148\u982D\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexMaxResultsHint:"\u53D6\u5F97\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u5305\u62EC\u7684\u3060\u304C\u9045\u5EF6\u304C\u5897\u52A0",indexFieldWeightHint:"\u30DE\u30C3\u30C1\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306B\u3069\u308C\u3060\u3051\u91CD\u307F\u4ED8\u3051\u3059\u308B\u304B",indexPerfectMatchBonus:"\u5B8C\u5168\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",indexPerfectMatchBonusHint:"\u5B8C\u5168\u4E00\u81F4\u6642\u306B\u8FFD\u52A0\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexContainmentHeading:"\u548C\u6587\u30FB\u90E8\u5206\u6587\u5B57\u5217\u5305\u542B\u30B9\u30B3\u30A2",indexContainmentBase:"\u5305\u542B \u57FA\u790E\u30B9\u30B3\u30A2 (containmentScoreBase)",indexContainmentBaseHint:"\u30AF\u30A8\u30EA\u304C\u6587\u5B57\u5217\u4E2D\u306B\u5B8C\u5168\u306B\u542B\u307E\u308C\u308B\u5834\u5408\u306E\u6700\u4F4E\u57FA\u790E\u30B9\u30B3\u30A2 (\u548C\u6587 2 \u6587\u5B57\u7B49\u306E\u6551\u6E08)",indexContainmentCoverage:"\u5305\u542B \u88AB\u8986\u7387\u91CD\u307F (containmentCoverageWeight)",indexContainmentCoverageHint:"\u30AF\u30A8\u30EA\u9577 / \u30D5\u30A3\u30FC\u30EB\u30C9\u9577\u306E\u6BD4\u7387\u306B\u5FDC\u3058\u305F\u52A0\u7B97\u30B9\u30B3\u30A2 (\u5408\u8A08 1.0 \u4EE5\u4E0B\u306B\u5236\u9650)",levenshteinSettingsHeading:"Levenshtein Worker \u8A73\u7D30\u8A2D\u5B9A",levenshteinCandidateHeading:"\u5019\u88DC\u30D5\u30A3\u30EB\u30BF",levenshteinThreshold:"Levenshtein \u95BE\u5024",levenshteinThresholdHintRelevance:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.5)",levenshteinThresholdHint:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.0)",levenshteinLengthSimilarity:"\u9577\u3055\u985E\u4F3C\u5EA6\u95BE\u5024",levenshteinLengthSimilarityHint:"\u9577\u3055\u304C\u5927\u304D\u304F\u7570\u306A\u308B\u5019\u88DC\u3092\u4E8B\u524D\u306B\u9664\u5916\u3057\u3066\u901F\u5EA6\u5411\u4E0A",levenshteinLengthPenalty:"\u9577\u3055\u5DEE\u30DA\u30CA\u30EB\u30C6\u30A3",levenshteinLengthPenaltyHint:"\u9577\u3055\u5DEE\u3092\u3069\u308C\u3060\u3051\u6E1B\u70B9\u3059\u308B\u304B\u3002\u5927\u304D\u3044\u307B\u3069\u9577\u3055\u4E00\u81F4\u3092\u91CD\u8996",levenshteinResultsHeading:"\u7D50\u679C\u6570\u5236\u5FA1",levenshteinMaxResultsHint:"\u8FD4\u5374\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u7DB2\u7F85\u7684\u3060\u304C\u51E6\u7406\u6642\u9593\u304C\u5897\u52A0",levenshteinFieldWeightHint:"\u4E00\u81F4\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306E\u8A55\u4FA1\u91CD\u307F",levenshteinPartialBonus:"\u90E8\u5206\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",levenshteinPartialBonusHint:"\u90E8\u5206\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u8FFD\u52A0\u30B9\u30B3\u30A2",statsRebuildingTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D",statsRebuildIndexTabOnlyTitle:"Index \u30BF\u30D6\u3067\u306E\u307F\u4F7F\u7528\u53EF\u80FD",statsRebuildTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u518D\u69CB\u7BC9",statsRebuilding:"\u518D\u69CB\u7BC9\u4E2D...",statsRebuild:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9",statsResetTitle:"\u7D71\u8A08\u3092\u30EA\u30BB\u30C3\u30C8",statsOverviewTab:"\u6982\u8981",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"\u7DCF\u691C\u7D22\u56DE\u6570",statAverageSearchTime:"\u5E73\u5747\u691C\u7D22\u6642\u9593",statDataCount:"\u30C7\u30FC\u30BF\u4EF6\u6570",statResultCount:"\u691C\u7D22\u7D50\u679C\u4EF6\u6570",statDisplayedCount:"\u8868\u793A\u4EF6\u6570",statsNoData:"\u7D71\u8A08\u30C7\u30FC\u30BF\u306A\u3057",statsBasicHeading:"\u57FA\u672C\u7D71\u8A08",statTotalProcessingTime:"\u7DCF\u51E6\u7406\u6642\u9593",statLastSearchTime:"\u6700\u5F8C\u306E\u691C\u7D22\u6642\u9593",statErrorCount:"\u30A8\u30E9\u30FC\u6570",statUpdatedAt:"\u7D71\u8A08\u66F4\u65B0\u6642\u523B",statsOperationsHeading:"\u64CD\u4F5C\u7D71\u8A08",statTotalOperations:"\u7DCF\u64CD\u4F5C\u6570",statsIndexHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u7D71\u8A08",statIndexBuilds:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9\u56DE\u6570",statDataSize:"\u30C7\u30FC\u30BF\u30B5\u30A4\u30BA",statLastBuildTime:"\u6700\u5F8C\u306E\u69CB\u7BC9\u6642\u9593",statsCacheHeading:"\u30AD\u30E3\u30C3\u30B7\u30E5\u7D71\u8A08",statCacheNgram:"N-gram",statCacheWord:"\u5358\u8A9E",statCachePhonetic:"\u97F3\u97FB",statsIndexMetadataHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u30E1\u30BF\u30C7\u30FC\u30BF",statsCalculationsHeading:"\u8A08\u7B97\u7D71\u8A08",statTotalCalculations:"\u7DCF\u8A08\u7B97\u6570",statDistanceCalculations:"\u8DDD\u96E2\u8A08\u7B97\u6570",statAverageDistance:"\u5E73\u5747\u8DDD\u96E2",statMinDistance:"\u6700\u5C0F\u8DDD\u96E2",statMaxDistance:"\u6700\u5927\u8DDD\u96E2",notAvailable:"N/A",statsMatchesHeading:"\u30DE\u30C3\u30C1\u7D71\u8A08",statPartialMatches:"\u90E8\u5206\u30DE\u30C3\u30C1\u6570",statPerfectMatches:"\u5B8C\u5168\u30DE\u30C3\u30C1\u6570",statEarlyTerminations:"\u65E9\u671F\u7D42\u4E86\u6570",statsSimilarityHeading:"\u985E\u4F3C\u5EA6\u5206\u5E03",statAbove80:"80% \u4EE5\u4E0A",statAbove60:"60% \u4EE5\u4E0A",statAbove40:"40% \u4EE5\u4E0A",statBelow40:"40% \u672A\u6E80",statsDistanceHeading:"\u8DDD\u96E2\u5206\u5E03 (\u4E0A\u4F4D 6)",statDistance:e=>`\u8DDD\u96E2 ${e}`,statsQueryLengthHeading:"\u30AF\u30A8\u30EA\u9577\u7D71\u8A08 (\u4E0A\u4F4D 6)",statQueryLength:e=>`\u9577\u3055 ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>`${q("ja",e)} \u56DE / \u5E73\u5747 ${t}%`,statsFieldPerformanceHeading:"\u30D5\u30A3\u30FC\u30EB\u30C9\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9 (\u4E0A\u4F4D 6)",statAverageScore:"\u5E73\u5747\u30B9\u30B3\u30A2",statMatchCount:"\u30DE\u30C3\u30C1\u6570",statBestWorstScore:"\u6700\u9AD8 / \u6700\u4F4E\u30B9\u30B3\u30A2",statsInsightsHeading:"\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6D1E\u5BDF",statBestField:"\u6700\u9AD8\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u30D5\u30A3\u30FC\u30EB\u30C9",statRecentAverageTime:"\u6700\u8FD1\u306E\u5E73\u5747\u51E6\u7406\u6642\u9593",statRecentAverageResults:"\u6700\u8FD1\u306E\u5E73\u5747\u7D50\u679C\u6570",statThroughput:"\u30B9\u30EB\u30FC\u30D7\u30C3\u30C8",statCommonQueryLength:"\u6700\u983B\u51FA\u30AF\u30A8\u30EA\u9577",statHistoryEntries:"\u5C65\u6B74\u30A8\u30F3\u30C8\u30EA\u6570",statHighSimilarity:"\u9AD8\u985E\u4F3C",statMediumSimilarity:"\u4E2D\u985E\u4F3C",statLowSimilarity:"\u4F4E\u985E\u4F3C",statVeryLowSimilarity:"\u6975\u4F4E\u985E\u4F3C",statsRecentHistoryHeading:"\u6700\u8FD1\u306E\u5C65\u6B74 (\u6700\u65B0 3 \u4EF6)",statsHistoryEntry:({processingTimeMs:e,resultCount:t})=>`\u51E6\u7406\u6642\u9593: ${e} ms / \u7D50\u679C: ${q("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),Qa=Object.freeze(Object.keys(xn.en)),jt=Object.freeze([...ea,...Qa]),Ke=Object.freeze({en:Object.freeze({...qa.en,...xn.en}),ja:Object.freeze({...qa.ja,...xn.ja})}),To=new Set(jt),Ga=Object.keys(Ke).map(e=>JSON.stringify(e)).join(" or "),Ya=Object.freeze({locale:"locale",labels:"labels"}),wo=(e,t,n)=>{e[t]=n},ta=(e,t=Ya.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${Ga} or left out; got ${se(e)}`);if(e!==void 0&&!Object.hasOwn(Ke,e))throw new RangeError(`[contact-map] ${t} must be ${Ga} or left out; got ${se(e)}`);return Co(e)},No=(e,t,n,r)=>{if(typeof r=="function"){if(typeof n!="function")throw new TypeError(`[contact-map] ${e}.${t} must be a function; got ${se(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${se(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${se(n)}`)},Po=(e,t,n)=>{let r=Object.create(null);for(let s of Object.getOwnPropertyNames(e)){if(!To.has(s)){let o=bn(s,jt);throw new RangeError(`[contact-map] ${n} has a key that is not a label key (${o===void 0?"":`did you mean ${JSON.stringify(o)}? `}CONTACT_MAP_LABEL_KEYS lists every key); got ${se(s)}`)}let a=e[s];a!==void 0&&(No(n,s,a,t[s]),r[s]=a)}return r},Mo=e=>{let t={},n=!1;for(let r of ea){let s=e[r];s!==void 0&&(t[r]=s,n=!0)}return n?t:void 0},na=(e,t,n=Ya)=>{let r=ta(e,n.locale);if(t===void 0)return Ke[r];if(!Rt(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${se(t)}`);let s=Po(t,Ke[r],n.labels),o={...vo(r,Mo(s)),...xn[r]};for(let c of Qa){let l=s[c];l!==void 0&&wo(o,c,l)}return Object.freeze(o)},aa=e=>{let t={};for(let n of ea)t[n]=e[n];return Object.freeze(t)},ra=e=>{let t={};for(let n of ko)t[n]=e[n];return Object.freeze(t)}});import{DIRECTORY_TREE_LABEL_KEYS as Ro}from"@aiquants/directory-tree";import{VIRTUAL_SCROLL_LABEL_KEYS as Lo}from"@aiquants/virtualscroll";import{createContext as Eo,useContext as Ja,useMemo as Xa,useRef as Oo}from"react";import{jsx as Do}from"react/jsx-runtime";var Wo,sa,oa,Za,ye,G,le=Ne(()=>{"use strict";ft();Wo=Object.freeze({locale:"en",labels:Ke.en,treeLabels:aa(Ke.en),engineLabels:ra(Ke.en)}),sa=Eo(Wo),oa=(e,t)=>{let n=Oo(null),r=n.current;return r!==null&&t.every(s=>r[s]===e[s])?r:(n.current=e,e)},Za=({locale:e,labels:t,surface:n,children:r})=>{let s=ta(e,n.locale),a=Xa(()=>na(s,t,n),[s,t,n]),o=oa(a,jt),c=oa(aa(o),Ro),l=oa(ra(o),Lo),d=Xa(()=>({locale:s,labels:o,treeLabels:c,engineLabels:l}),[s,o,c,l]);return Do(sa.Provider,{value:d,children:r})},ye=()=>Ja(sa),G=()=>Ja(sa).labels});var vn,Cn,tr,kn,Sn,qt,qe,nr,Pe,j,bt=Ne(()=>{"use strict";vn=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},Cn=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,tr=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let r=vn(e[n]);if(r)return{value:r,fieldKey:n}}return{value:null,fieldKey:null}},kn=e=>tr(e,["custom_email","email"]),Sn=e=>tr(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),qt=e=>{let t=vn(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},qe=(e,t)=>{let n=vn(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},nr=e=>{if(!e)return"-";let t=typeof e=="string"||typeof e=="number"?new Date(e):e;return!(t instanceof Date)||Number.isNaN(t.getTime())?typeof e=="string"?e:"-":t.toISOString().split("T")[0]},Pe=e=>{if(!e)return"-";let t=typeof e=="string"||typeof e=="number"?new Date(e):e;return!(t instanceof Date)||Number.isNaN(t.getTime())?typeof e=="string"?e:"-":t.toISOString()},j=e=>e==null?"-":typeof e=="string"?vn(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":e instanceof Date?Pe(e):String(e)});import Ao from"lucide-react/dist/esm/icons/check.js";import Io from"lucide-react/dist/esm/icons/copy.js";import Fo from"lucide-react/dist/esm/icons/x.js";import{useCallback as rt,useEffect as ua,useMemo as Gt,useRef as pa,useState as or}from"react";import{createPortal as zo}from"react-dom";import{jsx as Q,jsxs as Me}from"react/jsx-runtime";var Bo,ar,Yt,Ot,Uo,$o,Qt,da,rr,ca,Tn,ma=Ne(()=>{"use strict";bt();le();Bo=350,ar=["dblclick","pointerdown","pointerup","mousedown","mouseup","touchstart","touchend","contextmenu"],Yt=0,Ot=null,Uo=()=>{let e=document.body.style;Yt+=1,Yt===1&&(Ot={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},$o=()=>{if(Yt=Math.max(0,Yt-1),Yt>0||!Ot)return;let e=document.body.style;e.userSelect=Ot.userSelect,typeof Ot.webkitUserSelect<"u"&&(e.webkitUserSelect=Ot.webkitUserSelect),Ot=null},Qt=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},da=(e,t)=>{let n=new Set;return e.reduce((r,s)=>{let a=typeof s.value=="string"?s.value.trim():"";if(!a)return r;let{normalized:o,key:c,entry:l}=t(a,s);return o&&!n.has(c)&&(n.add(c),r.push(l(o))),r},[])},rr=(e,t)=>e===t,ca=({value:e,ariaLabel:t,size:n="md"})=>{let[r,s]=or(!1),a=pa(null),o=rt(async u=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(u),!0}catch{}if(typeof document>"u")return!1;let i=document.createElement("textarea");i.value=u,i.setAttribute("readonly",""),i.style.position="absolute",i.style.left="-9999px",document.body.appendChild(i),i.select(),i.setSelectionRange(0,i.value.length);let p=document.execCommand("copy");return document.body.removeChild(i),p},[]),c=rt(async u=>{u.preventDefault(),u.stopPropagation(),a.current!==null&&typeof window<"u"&&(window.clearTimeout(a.current),a.current=null);let i=await o(e);s(i),i&&typeof window<"u"&&(a.current=window.setTimeout(()=>{s(!1),a.current=null},1500))},[o,e]);ua(()=>()=>{a.current!==null&&typeof window<"u"&&(window.clearTimeout(a.current),a.current=null)},[]);let l=n==="sm"?"h-6 w-6":"h-7 w-7",d=n==="sm"?"h-3.5 w-3.5":"h-4 w-4",m=r?Ao:Io;return Q("button",{type:"button",className:`inline-flex ${l} shrink-0 items-center justify-center rounded-md border border-gray-200 text-slate-600 transition-colors hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-200 dark:text-slate-300`,onClick:c,"aria-label":t,title:t,children:Q(m,{className:d,"aria-hidden":"true"})})},Tn=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:r})=>{let s=G(),[a,o]=or(null);ua(()=>{o(document.body)},[]);let c=pa(null),l=pa(null),d=Gt(()=>e.contacted_at?nr(e.contacted_at):null,[e.contacted_at]),m=e.full_name||"-",u=Qt(e.company_name),i=Qt(e.department),p=Qt(e.title),h=Gt(()=>da([{fieldKey:"company_name",label:s.fieldCompanyName,value:u},{fieldKey:"department",label:s.fieldDepartment,value:i},{fieldKey:"title",label:s.fieldTitle,value:p}],(f,{fieldKey:x,label:O})=>({normalized:f,key:`${x}-${f.toLowerCase()}`,entry:W=>({fieldKey:x,label:O,value:W})})),[u,i,p,s]),C=Gt(()=>da([{fieldKey:"custom_mobile_phone_number",label:s.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:s.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:s.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:s.popupCompanyPhone,value:e.company_phone_number}],(f,{fieldKey:x,label:O})=>{let W=qt(f);return{normalized:Qt(f),key:(W??f).toLowerCase(),entry:w=>({fieldKey:x,label:O,value:w,href:W})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,s]),v=Gt(()=>da([{fieldKey:"custom_email",label:s.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:s.popupEmail,value:e.email}],(f,{fieldKey:x,label:O})=>{let W=Qt(f),te=qe(f,t),w=!!te?.startsWith("https://mail.google.com");return{normalized:W,key:f.toLowerCase(),entry:N=>({fieldKey:x,label:O,value:N,href:te,isGmailLink:w})}}),[e.custom_email,e.email,t,s]),k=C.length>0||v.length>0,F=Gt(()=>`contact-methods-${e.person_id}`,[e.person_id]),T=rt(f=>{r(f),l.current=null},[r]),y=rt(f=>{f.stopPropagation(),rr(f.target,f.currentTarget)&&T()},[T]),g=rt(f=>{f.stopPropagation(),rr(f.target,f.currentTarget)&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),T())},[T]),E=rt(f=>{f.stopPropagation(),T()},[T]),K=rt((f,x)=>{x.isGmailLink&&(f.preventDefault(),n(x.value))},[n]),b=rt((f,x)=>{if(!x.isGmailLink){l.current=null;return}let O=Date.now(),W=l.current;if(W&&W.email===x.value&&O-W.timestamp<=Bo){l.current=null,f.preventDefault(),n(x.value);return}l.current={email:x.value,timestamp:O}},[n]);return ua(()=>{let f=[];if(typeof window<"u"){let x=O=>{if(O.key==="Escape"){T();return}if(O.key==="Tab"&&c.current){let W=c.current.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])');if(W.length===0)return;let te=W[0],w=W[W.length-1];O.shiftKey?document.activeElement===te&&(O.preventDefault(),w.focus()):document.activeElement===w&&(O.preventDefault(),te.focus())}};window.addEventListener("keydown",x),f.push(()=>window.removeEventListener("keydown",x))}if(typeof document<"u"){let x=c.current;if(x){let w=N=>{N.stopPropagation()};for(let N of ar)x.addEventListener(N,w);f.push(()=>{for(let N of ar)x.removeEventListener(N,w)})}let O=w=>{let N=c.current;return N&&w instanceof Node?N.contains(w):!1},W=w=>{O(w.target)||T({suppressLongPress:!0,cancelLongPressTimer:!0})},te=["pointerdown","wheel","touchmove"];for(let w of te)document.addEventListener(w,W,!0);f.push(()=>{for(let w of te)document.removeEventListener(w,W,!0)}),Uo(),f.push($o)}return()=>{for(let x of f)x()}},[T,a]),a?zo(Q("div",{"data-contact-popup-root":"true",className:"fixed top-0 right-0 bottom-0 left-0 z-50 flex items-center justify-center bg-black/50 px-4 py-6",style:{right:"var(--aqcm-overlay-right, var(--aiquants-menu-pinned-width, 0px))",transition:"right 0.5s"},role:"dialog","aria-modal":"true","aria-labelledby":F,tabIndex:-1,onClick:y,onKeyDown:g,children:Me("div",{ref:c,className:"w-full max-w-md rounded-lg border border-slate-200 bg-white p-4 shadow-lg transition-colors dark:border-transparent dark:bg-slate-900 dark:shadow-slate-950/40 dark:ring-1 dark:ring-white/70",children:[Me("div",{className:"flex items-start justify-between gap-4",children:[Me("div",{children:[Q("h2",{id:F,className:"font-semibold text-gray-900 text-lg dark:text-slate-100",children:m}),h.length>0?Q("div",{className:"mt-2 space-y-2 text-slate-700 text-sm dark:text-slate-200",children:h.map(f=>Me("div",{className:"flex items-center gap-3",children:[Q("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:f.value}),Q(ca,{value:f.value,ariaLabel:s.copyField(f.label),size:"sm"})]},f.fieldKey))}):null]}),Q("button",{type:"button",className:"rounded-md p-0.5 text-slate-600 transition-colors hover:bg-gray-100 focus:outline-none focus-visible:ring focus-visible:ring-blue-200 dark:text-slate-300 dark:hover:bg-slate-800/70",onClick:E,"aria-label":s.close,children:Q(Fo,{className:"h-4 w-4","aria-hidden":"true"})})]}),Me("div",{className:"mt-4 space-y-4 text-slate-700 dark:text-slate-200",children:[C.length>0?Q("div",{children:Q("ul",{className:"space-y-3 text-sm",children:C.map(f=>Q("li",{className:"flex items-start gap-3",children:Me("div",{className:"flex-1",children:[Q("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:f.label}),Me("div",{className:"mt-1 flex items-center gap-3",children:[Q("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:f.href?Q("a",{href:f.href,className:"wrap-break-word text-blue-600 underline-offset-2 transition-colors hover:underline focus:underline focus:outline-none dark:text-blue-300",children:f.value}):Q("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:f.value})}),Q(ca,{value:f.value,ariaLabel:s.copyField(f.label),size:"sm"})]})]})},`${f.fieldKey}-${f.value}`))})}):null,v.length>0?Q("div",{children:Q("ul",{className:"space-y-3 text-sm",children:v.map(f=>Q("li",{className:"flex items-start gap-3",children:Me("div",{className:"flex-1",children:[Q("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:f.label}),Me("div",{className:"mt-1 flex items-start gap-3",children:[Me("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[f.href?Q("a",{href:f.href,className:"wrap-break-word text-blue-600 underline-offset-2 transition-colors hover:underline focus:underline focus:outline-none dark:text-blue-300",target:f.isGmailLink?"_blank":void 0,rel:f.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:x=>K(x,f),onTouchEnd:x=>b(x,f),children:f.value}):Q("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:f.value}),f.isGmailLink?Q("span",{className:"mt-1 block text-[11px] text-slate-500 dark:text-slate-400",children:s.popupGmailHint}):null]}),Q(ca,{value:f.value,ariaLabel:s.copyField(f.label),size:"sm"})]})]})},`${f.fieldKey}-${f.value}`))})}):null,d?Me("div",{className:"mt-2 flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[Q("span",{className:"text-xs",children:s.popupLastContactDate}),Q("span",{children:d})]}):null,k?null:Q("p",{className:"text-slate-600 text-sm dark:text-slate-300",children:s.popupNoContactMethods})]})]})}),a):null}});import{jsx as be,jsxs as Xt}from"react/jsx-runtime";var wn,ga=Ne(()=>{"use strict";wn=({fullName:e,title:t="-",companyName:n="-",department:r="-",phoneNumber:s="-",email:a="-",updatedAtText:o="-"})=>Xt("div",{className:"flex h-full w-full flex-col justify-center gap-0.5 text-slate-800 text-xs leading-tight transition-colors sm:grid sm:grid-cols-3 sm:gap-2 sm:text-sm xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[Xt("div",{className:"flex items-center gap-1 sm:hidden",children:[be("div",{className:"flex-1 truncate font-medium text-gray-900 text-sm leading-tight dark:text-slate-100",children:e}),be("div",{className:"shrink-0 whitespace-nowrap text-[11px] text-slate-600 dark:text-slate-300",children:s})]}),be("div",{className:"flex items-center gap-1 sm:hidden",children:be("div",{className:"flex-1 truncate text-slate-700 text-xs leading-tight dark:text-slate-200",children:n})}),be("div",{className:"block sm:hidden",children:be("span",{className:"w-full truncate text-left text-[11px] text-slate-700 leading-tight dark:text-slate-200",children:r})}),Xt("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[be("span",{className:"truncate font-medium text-gray-900 dark:text-slate-100",children:e}),be("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:t})]}),Xt("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[be("span",{className:"truncate text-slate-800 dark:text-slate-100",children:n}),be("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:r})]}),Xt("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[be("span",{className:"truncate text-slate-700 dark:text-slate-200",children:s}),be("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:a})]}),be("div",{className:"hidden items-end justify-end text-[11px] text-slate-600 xl:flex dark:text-slate-300",children:be("span",{className:"truncate",children:o})})]})});import{formatQuerySets as Vo,parseQuerySets as Ko}from"@aiquants/fuzzy-search";import{getNormalizedVariants as jo,normalizeText as qo,romajiToKatakana as Go}from"@aiquants/select-box";var lr,Qo,Yo,Xo,Jo,dr,cr,Zo,es,ur,pr,sr,ir,Nn,ts,ns,ha,mr,fa=Ne(()=>{"use strict";lr=/[​]/g,Qo=/^[\s  ]+|[\s  ]+$/g,Yo=/\s+/,Xo=/^[\p{Script=Latin}\s]+$/u,Jo=/\p{Script=Latin}/u,dr=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1}),cr="union",Zo=e=>qo(e.replace(lr,"").replace(Qo,""),dr),es=e=>{if(!Xo.test(e))return null;let t=Go(e);return Jo.test(t)?null:t},ur=e=>e.split(Yo).filter(Boolean),pr=e=>Ko(e,cr).sets.map(({query:t})=>t),sr=e=>pr(e).flatMap(t=>ur(t)),ir=e=>Vo({combine:cr,sets:Array.from(new Set(e),t=>({query:t}))}),Nn=e=>{let t=pr(e.replace(lr,"")).map(r=>ur(Zo(r)).join(" ")).filter(r=>r!==""),n=[];for(let r of t){let s=es(r);if(s===null)return ir(t);n.push(s)}return ir(n)},ts=e=>{let t=new Set([...sr(e),...sr(Nn(e))]),n=new Set;for(let r of t)for(let s of jo(r,dr)){let a=s.trim();a&&n.add(a)}return Array.from(n)},ns=/[.*+?^${}()|[\]\\]/g,ha=e=>{let t=ts(e);if(t.length===0)return null;let n=t.map(r=>r.replace(ns,"\\$&")).sort((r,s)=>s.length-r.length);return new RegExp(n.join("|"),"gi")},mr=(e,t)=>{let n=ha(e);if(n===null)return s=>s;let r=s=>t.some(a=>{let o=s[a];return typeof o=="string"&&o.search(n)!==-1});return s=>{let a=[],o=[];for(let c of s)r(c.item)?a.push(c):o.push(c);return[...a,...o]}}});import{memo as as}from"react";import{Fragment as ya,jsx as Pn}from"react/jsx-runtime";var ue,Mn=Ne(()=>{"use strict";fa();ue=as(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return Pn(ya,{children:e});let r=ha(t);if(r===null)return Pn(ya,{children:e});let s=[],a=0,o=r.exec(e),c=0;for(;o;){let l=o[0],d=o.index;if(d>a&&s.push(e.substring(a,d)),l.length===0){r.lastIndex++,o=r.exec(e);continue}s.push(Pn("mark",{className:"rounded bg-yellow-200 px-1 text-gray-900",children:l},`highlight-${d}-${c}`)),a=d+l.length,c+=1,o=r.exec(e)}return a<e.length&&s.push(e.substring(a)),Pn(ya,{children:s})});ue.displayName="HighlightedText"});var hr={};bo(hr,{ContactDetailGrid:()=>gr,default:()=>rs});import{useMemo as ba}from"react";import{Fragment as os,jsx as va,jsxs as ss}from"react/jsx-runtime";var xa,gr,rs,fr=Ne(()=>{"use strict";bt();le();ma();ga();Mn();xa=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},gr=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:r,openGmailCompose:s,isPopupVisible:a,onRequestClose:o})=>{let c=G(),l=ba(()=>kn(e),[e]),d=ba(()=>Sn(e),[e]),m=l.value??"-",u=d.value??"-",i=ba(()=>Pe(e.updated_at),[e.updated_at]),p=xa(e.full_name)??c.noName,h=xa(e.company_name),C=xa(e.department),v=(k,F="-")=>va(ue,{text:k??F,query:t,enabled:n});return ss(os,{children:[va(wn,{fullName:v(p),title:v(e.title),companyName:v(h),department:v(C),phoneNumber:u,email:v(m),updatedAtText:i}),a?va(Tn,{contactData:e,openEmailsWithGmail:r,openGmailCompose:s,onRequestClose:o}):null]})},rs=gr});le();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Et}from"@aiquants/fuzzy-search";import{memo as Ho,useId as er}from"react";import{jsx as _e,jsxs as je}from"react/jsx-runtime";var ia=Ho(({searchOptions:e,setSearchOptions:t})=>{let n=G(),r="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",a=er(),o=er(),c=[];return c.push(je("div",{className:`${r} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[je("div",{className:`${s} text-sky-700 dark:text-sky-300`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),_e("label",{htmlFor:a,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.advancedLearningLabel}),_e("input",{id:a,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||Et.learningWeight,onChange:l=>t(d=>({...d,learningWeight:parseFloat(l.target.value)})),className:"w-full"}),je("span",{className:"text-sky-600 text-xs dark:text-sky-300",children:[n.currentValueLabel," ",e.learningWeight||Et.learningWeight]}),_e("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.advancedLearningHint})]},"learning")),c.push(je("div",{className:`${r} border-indigo-200 border-l-4 dark:border-indigo-400/60`,children:[je("div",{className:`${s} text-indigo-700 dark:text-indigo-300`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),_e("label",{htmlFor:o,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.advancedDebounceLabel}),_e("input",{id:o,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs||Et.debounceMs,onChange:l=>t(d=>({...d,debounceMs:parseInt(l.target.value,10)})),className:"w-full"}),je("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.debounceMs||Et.debounceMs]}),_e("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.advancedDebounceHint})]},"debounce")),je("section",{className:"space-y-3",children:[je("div",{className:"flex items-center justify-between gap-3",children:[je("div",{className:"flex items-center gap-2 font-semibold text-gray-700 text-xs transition-colors dark:text-slate-200",children:[_e("span",{children:"\u26A1"}),_e("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),_e("button",{type:"button",onClick:()=>t(l=>({...l,learningWeight:Et.learningWeight,debounceMs:Et.debounceMs})),className:"rounded border border-gray-300 bg-gray-100 px-2 py-1 font-medium text-gray-700 text-xs transition-colors hover:bg-gray-200 dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-200 dark:hover:bg-slate-700/70",title:n.resetToDefaultsTitle,children:n.reset})]}),_e("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:c})]})});ia.displayName="AdvancedSearchSettings";le();import{DEFAULT_FUZZY_SEARCH_OPTIONS as yt}from"@aiquants/fuzzy-search";import{memo as _o,useId as Ae}from"react";import{jsx as X,jsxs as Z}from"react/jsx-runtime";var la=_o(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:s,setOpenEmailsWithGmail:a})=>{let o=G(),c="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",l="text-xs font-semibold",d=Ae(),m=Ae(),u=Ae(),i=Ae(),p=Ae(),h=Ae(),C=Ae(),v=Ae(),k=Ae(),F=Ae(),T=[];return T.push(Z("div",{className:`${c} border-blue-200 border-l-4 dark:border-blue-500/50`,children:[Z("div",{className:`${l} text-blue-700 dark:text-blue-300`,children:["\u{1F3AF} ",o.basicThresholdHeading]}),X("label",{htmlFor:d,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicThresholdLabel}),X("input",{id:d,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??yt.threshold,onChange:y=>t(g=>({...g,threshold:parseFloat(y.target.value)})),className:"w-full"}),Z("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[o.currentValueLabel," ",e.threshold??yt.threshold]}),X("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:e.sortBy==="relevance"?o.basicThresholdRangeRelevance:o.basicThresholdRange})]},"threshold")),T.push(Z("div",{className:`${c} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[Z("div",{className:`${l} text-amber-700 dark:text-amber-300`,children:["\u{1FA84} ",o.basicDisplayHeading]}),Z("label",{htmlFor:m,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[X("input",{id:m,type:"checkbox",checked:e.caseSensitive??yt.caseSensitive,onChange:y=>t(g=>({...g,caseSensitive:y.target.checked})),className:"h-3 w-3"}),o.basicCaseSensitive]}),Z("label",{htmlFor:u,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[X("input",{id:u,type:"checkbox",checked:n,onChange:y=>r(y.target.checked),className:"h-3 w-3"}),o.basicHighlight]}),Z("label",{htmlFor:i,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[X("input",{id:i,type:"checkbox",checked:s,onChange:y=>a(y.target.checked),className:"h-3 w-3"}),o.basicOpenEmailsWithGmail]}),Z("div",{className:"flex flex-col gap-1",children:[X("label",{htmlFor:p,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicMultiTermOperator}),Z("select",{id:p,value:e.multiTermOperator??yt.multiTermOperator,onChange:y=>t(g=>({...g,multiTermOperator:y.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[X("option",{value:"or",children:o.basicOperatorOr}),X("option",{value:"and",children:o.basicOperatorAnd})]}),X("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:o.basicMultiTermHint})]})]},"display")),T.push(Z("div",{className:`${c} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[Z("div",{className:`${l} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4DA} ",o.basicSortHeading]}),Z("div",{className:"flex flex-col gap-2",children:[X("label",{htmlFor:h,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicSortBy}),Z("select",{id:h,value:e.sortBy||yt.sortBy,onChange:y=>t(g=>({...g,sortBy:y.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[X("option",{value:"score",children:o.basicSortByScore}),X("option",{value:"relevance",children:o.basicSortByRelevance}),X("option",{value:"original",children:o.basicSortByOriginal})]})]}),Z("div",{className:"flex flex-col gap-2",children:[X("label",{htmlFor:C,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicSortOrder}),Z("select",{id:C,value:e.sortOrder||yt.sortOrder,onChange:y=>t(g=>({...g,sortOrder:y.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[X("option",{value:"desc",children:o.basicSortDescending}),X("option",{value:"asc",children:o.basicSortAscending})]})]})]},"sorting")),T.push(Z("div",{className:`${c} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[Z("div",{className:`${l} text-purple-700 dark:text-purple-300`,children:["\u2699\uFE0F ",o.basicEngineHeading]}),X("label",{htmlFor:v,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicStrategy}),Z("select",{id:v,value:e.parallelSearchStrategy||yt.parallelSearchStrategy,onChange:y=>t(g=>({...g,parallelSearchStrategy:y.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[X("option",{value:"balanced",children:o.basicStrategyBalanced}),X("option",{value:"index-first",children:o.basicStrategyIndexFirst}),X("option",{value:"levenshtein-first",children:o.basicStrategyLevenshteinFirst})]}),Z("div",{className:"mt-2 space-y-2",children:[Z("label",{htmlFor:k,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[X("input",{id:k,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:y=>t(g=>({...g,enableIndexFiltering:y.target.checked})),className:"h-3 w-3"}),o.basicIndexFiltering]}),Z("label",{htmlFor:F,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[X("input",{id:F,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:y=>t(g=>({...g,enableLevenshtein:y.target.checked})),className:"h-3 w-3"}),o.basicLevenshtein]})]})]},"engine")),Z("section",{className:"space-y-3",children:[Z("div",{className:"flex items-center gap-2 font-semibold text-blue-700 text-xs transition-colors dark:text-sky-400",children:[X("span",{children:"\u{1F527}"}),X("span",{className:"tracking-wide",children:o.settingsBasicTab})]}),X("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:T})]})});la.displayName="BasicSearchSettings";bt();import ds from"lucide-react/dist/esm/icons/badge-check.js";import cs from"lucide-react/dist/esm/icons/building-2.js";import us from"lucide-react/dist/esm/icons/calendar-clock.js";import ps from"lucide-react/dist/esm/icons/check.js";import ms from"lucide-react/dist/esm/icons/copy.js";import gs from"lucide-react/dist/esm/icons/id-card.js";import hs from"lucide-react/dist/esm/icons/mail.js";import fs from"lucide-react/dist/esm/icons/phone.js";import ys from"lucide-react/dist/esm/icons/user-round.js";import{useCallback as bs,useEffect as xs,useMemo as En,useRef as vs,useState as Cs}from"react";var Ie={info:(e,...t)=>console.info(`[contact-map] ${e}`,...t),warn:(e,...t)=>console.warn(`[contact-map] ${e}`,...t),error:(e,...t)=>console.error(`[contact-map] ${e}`,...t)};le();import*as Re from"@radix-ui/react-tabs";import*as Rn from"react";import{clsx as is}from"clsx";import{twMerge as ls}from"tailwind-merge";function xt(...e){return ls(is(e))}import{jsx as Ca}from"react/jsx-runtime";var Ln=Re.Root,Jt=Rn.forwardRef(({className:e,...t},n)=>Ca(Re.List,{ref:n,className:xt("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Jt.displayName=Re.List.displayName;var vt=Rn.forwardRef(({className:e,...t},n)=>Ca(Re.Trigger,{ref:n,className:xt("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-2xs",e),...t}));vt.displayName=Re.Trigger.displayName;var Ct=Rn.forwardRef(({className:e,...t},n)=>Ca(Re.Content,{ref:n,className:xt("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=inactive]:hidden",e),...t}));Ct.displayName=Re.Content.displayName;Mn();import{jsx as P,jsxs as ce}from"react/jsx-runtime";var yr={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},ks=({icon:e,label:t,value:n,fieldKey:r,copyValue:s,onCopy:a,isCopied:o,linkHref:c,searchTerm:l,enableHighlighting:d})=>{let m=G(),u=!!(a&&r&&s),i=c?.startsWith("https://mail.google.com")?"_blank":void 0;return ce("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-slate-200 bg-slate-50 px-2.5 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[ce("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[P("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-white text-slate-500 transition-colors dark:bg-slate-800 dark:text-slate-200",children:P(e,{size:14})}),ce("div",{className:"min-w-0 flex-1",children:[P("div",{className:"font-medium text-[10px] text-slate-500 dark:text-slate-400",children:t}),P("div",{className:"truncate font-semibold text-slate-900 text-xs dark:text-slate-100",children:c?P("a",{href:c,className:"text-inherit underline-offset-2 hover:underline focus:underline focus:outline-none",target:i,rel:i?"noopener noreferrer":void 0,children:P(ue,{text:n,query:l??"",enabled:d})}):P(ue,{text:n,query:l??"",enabled:d})})]})]}),u?P("button",{type:"button",onClick:()=>a&&r&&s&&a(r,s,t),className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 transition-colors hover:border-blue-400 hover:text-blue-500 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:border-blue-400 dark:hover:text-blue-300","aria-label":m.copyField(t),children:o?P(ps,{size:14}):P(ms,{size:14})}):null]})},br=({items:e,searchTerm:t,enableHighlighting:n})=>P("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(r=>ce("div",{className:"flex flex-col gap-0.5 rounded-md border border-slate-200 bg-white/60 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[P("dt",{className:"font-semibold text-[10px] text-slate-500 uppercase tracking-wide dark:text-slate-400",children:r.label}),P("dd",{className:"wrap-break-word text-slate-900 text-xs dark:text-slate-100",children:P(ue,{text:r.value,query:t??"",enabled:n})})]},r.fieldKey))}),ka=({title:e})=>P("h3",{className:"font-semibold text-slate-700 text-xs dark:text-slate-200",children:e}),Ss=()=>{let e=G();return ce("div",{className:"flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border border-slate-300 border-dashed bg-white/60 p-4 text-center transition-colors dark:border-slate-700 dark:bg-slate-900/40",children:[P("p",{className:"font-medium text-slate-600 text-xs dark:text-slate-200",children:e.detailEmptyTitle}),P("p",{className:"text-[11px] text-slate-500 dark:text-slate-400",children:e.detailEmptyHint})]})},ot=({contact:e,searchTerm:t,enableHighlighting:n,style:r,className:s=""})=>{let a=G(),[o,c]=Cs(null),l=vs(null),d=En(()=>({...yr,...r}),[r]);xs(()=>()=>{l.current!==null&&window.clearTimeout(l.current)},[]);let m=En(()=>kn(e),[e]),u=En(()=>Sn(e),[e]),i=En(()=>Pe(e?.contacted_at??null),[e?.contacted_at]),p=bs(async(b,f,x)=>{try{await navigator.clipboard.writeText(f),c(b),l.current!==null&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>{c(null)},2e3)}catch(O){Ie.error("Failed to copy contact detail",O)}},[]);if(!e)return P("div",{className:"flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",style:yr,children:P(Ss,{})});let h=[j(e.title),j(e.department)].filter(b=>b!=="-"),C=[h.join(" / "),j(e.company_name)].filter(b=>b&&b!=="-").join(" \u30FB ")||"-",v=j(e.full_name),k=[{fieldKey:"full_name",label:a.fieldFullName,value:v==="-"?a.noName:v},{fieldKey:"full_name_reading",label:a.fieldFullNameReading,value:j(e.full_name_reading)},{fieldKey:"title",label:a.fieldTitle,value:j(e.title)},{fieldKey:"department",label:a.fieldDepartment,value:j(e.department)},{fieldKey:"company_name",label:a.fieldCompanyName,value:j(e.company_name)},{fieldKey:"company_name_reading",label:a.fieldCompanyNameReading,value:j(e.company_name_reading)},{fieldKey:"address",label:a.fieldAddress,value:j(e.address)},{fieldKey:"postal_code",label:a.fieldPostalCode,value:j(e.postal_code)},{fieldKey:"url",label:a.fieldUrl,value:j(e.url)}],F=[{label:a.fieldCustomEmail,value:j(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:a.fieldEmail,value:j(e.email),fieldKey:"email",rawValue:e.email}].filter(b=>b.value!=="-"),T=[{label:a.fieldCustomMobilePhone,value:j(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:a.fieldMobilePhone,value:j(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:a.fieldCompanyPhone,value:j(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:a.fieldCompanyFax,value:j(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(b=>b.value!=="-"),y=[{fieldKey:"person_id",label:"person_id",value:j(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:j(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:j(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:j(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:j(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:j(e.is_in_eight)},{fieldKey:"created_by",label:a.fieldCreatedBy,value:j(e.created_by)},{fieldKey:"created_at",label:a.fieldCreatedAt,value:Pe(e.created_at)},{fieldKey:"updated_by",label:a.fieldUpdatedBy,value:j(e.updated_by)},{fieldKey:"updated_at",label:a.fieldUpdatedAt,value:Pe(e.updated_at)}],g=[{rowKey:"person_id",icon:gs,label:"person_id",value:j(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:hs,label:a.summaryEmail,value:m.value??"-",fieldKey:"primary_email",copyValue:m.value,linkHref:qe(m.value,!1)},{rowKey:"primary_phone",icon:fs,label:a.summaryPhone,value:u.value??"-",fieldKey:"primary_phone",copyValue:u.value,linkHref:qt(u.value)},{rowKey:"contacted_at",icon:us,label:a.summaryLastContact,value:i}],E=[{sectionKey:"email",title:a.sectionEmail,emptyText:a.sectionEmailEmpty,entries:F,recommendedKey:m.fieldKey??null,resolveHref:b=>qe(b!=null?String(b):null,!1)},{sectionKey:"phone",title:a.sectionPhone,emptyText:a.sectionPhoneEmpty,entries:T,recommendedKey:u.fieldKey??null,resolveHref:b=>qt(b!=null?String(b):null)}],K=[{value:"summary",label:a.detailTabSummary,content:ce("div",{className:"flex flex-col gap-4",children:[ce("div",{className:"flex flex-col gap-1",children:[ce("div",{className:"flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[P(cs,{size:16}),P("span",{children:P(ue,{text:j(e.company_name),query:t??"",enabled:n})})]}),h.length>0?P("div",{className:"text-slate-600 text-sm dark:text-slate-300",children:h.map((b,f)=>ce("span",{children:[f>0&&" / ",P(ue,{text:b,query:t??"",enabled:n})]},`header-line-${f}`))}):null]}),P("div",{className:"flex flex-col gap-3",children:g.map(b=>P(ks,{icon:b.icon,label:b.label,value:b.value,fieldKey:b.fieldKey,copyValue:b.copyValue,onCopy:p,isCopied:b.fieldKey?o===b.fieldKey:!1,linkHref:b.linkHref,searchTerm:t,enableHighlighting:n},b.rowKey))})]})},{value:"basic",label:a.detailTabBasic,content:ce("div",{className:"flex flex-col gap-3",children:[P(ka,{title:a.detailBasicProfile}),P(br,{items:k,searchTerm:t,enableHighlighting:n})]})},{value:"contact",label:a.detailTabContact,content:P("div",{className:"flex flex-col gap-4",children:E.map(({sectionKey:b,title:f,emptyText:x,entries:O,recommendedKey:W,resolveHref:te})=>ce("div",{className:"flex flex-col gap-2",children:[P(ka,{title:f}),O.length===0?P("p",{className:"text-slate-500 text-xs dark:text-slate-400",children:x}):P("div",{className:"flex flex-col gap-2",children:O.map(w=>{let N=te(w.rawValue),H=w.fieldKey===W;return ce("div",{className:"flex items-center justify-between rounded-lg border border-slate-200 bg-white px-3 py-2 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[ce("div",{children:[P("div",{className:"font-medium text-slate-500 text-xs dark:text-slate-400",children:w.label}),P("div",{className:"text-slate-900 text-sm dark:text-slate-100",children:N?P("a",{href:N,className:"text-inherit underline-offset-2 hover:underline focus:underline focus:outline-none",children:P(ue,{text:w.value,query:t??"",enabled:n})}):P(ue,{text:w.value,query:t??"",enabled:n})})]}),H?ce("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-100 px-2 py-0.5 font-semibold text-[11px] text-emerald-700 transition-colors dark:bg-emerald-300/20 dark:text-emerald-200",children:[P(ds,{size:14}),a.preferred]}):null]},w.fieldKey)})})]},b))})},{value:"meta",label:a.detailTabMeta,content:ce("div",{className:"flex flex-col gap-3",children:[P(ka,{title:a.detailTabMeta}),P(br,{items:y,searchTerm:t,enableHighlighting:n})]})}];return ce("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950 ${s}`.trim(),style:d,children:[P("div",{className:"border-slate-200 border-b px-3 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/50",children:ce("div",{className:"flex items-center gap-2",children:[P("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-blue-50 text-blue-600 transition-colors dark:bg-sky-900/40 dark:text-sky-300",children:P(ys,{size:16})}),ce("div",{className:"min-w-0 flex-1",children:[P("div",{className:"truncate font-semibold text-slate-900 text-sm dark:text-slate-100",children:P(ue,{text:j(e.full_name),query:t??"",enabled:n})}),P("div",{className:"truncate text-[11px] text-slate-600 dark:text-slate-300",children:P(ue,{text:C,query:t??"",enabled:n})})]})]})}),ce(Ln,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[P(Jt,{className:"flex gap-1.5 border-slate-200 border-b bg-slate-50 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:K.map(b=>P(vt,{value:b.value,className:"rounded-md px-1.5 py-0.5 font-semibold text-[11px] transition-colors data-[state=active]:bg-white data-[state=active]:text-blue-600 dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-sky-300",children:b.label},b.value))}),K.map(b=>P(Ct,{value:b.value,className:"scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors dark:text-slate-200",children:b.content},b.value))]})]})};ft();le();import{memo as Ts}from"react";import{jsx as st,jsxs as On}from"react/jsx-runtime";var Sa=Ts(({recordCount:e,companyCount:t,phase:n,loadedCount:r,totalCount:s,errorMessage:a,onRetry:o})=>{let{locale:c,labels:l}=ye(),d=q(c,e),m=q(c,t);return On("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",role:"status",children:[On("span",{className:"flex items-baseline gap-1",children:[st("span",{className:"text-slate-600 dark:text-slate-300",children:l.annotationTotalLabel}),st("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-record-count",children:d}),st("span",{className:"text-slate-600 dark:text-slate-300",children:l.recordUnit(d)})]}),On("span",{className:"flex items-baseline gap-1",children:[st("span",{className:"text-slate-600 dark:text-slate-300",children:l.annotationCompaniesLabel}),st("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-company-count",children:m}),st("span",{className:"text-slate-600 dark:text-slate-300",children:l.companyUnit(m)})]}),n==="streaming"||n==="retrying"||n==="idle"?st("span",{"data-testid":"contact-map-stream-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-blue-50 px-2 py-0.5 font-medium text-blue-700 text-xs dark:bg-blue-900/30 dark:text-blue-300",children:s!==null&&s>0?l.annotationStreamingProgress({loaded:r,total:s,percent:Math.min(100,Math.round(r/s*100))}):l.annotationStreamingCount(r)}):null,n==="failed"||n==="auth-required"?On("span",{"data-testid":"contact-map-error-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-rose-50 px-2 py-0.5 font-medium text-rose-700 text-xs dark:bg-rose-900/30 dark:text-rose-300",title:n==="failed"?a??void 0:void 0,children:["\u26D4 ",n==="auth-required"?l.annotationAuthRequired:l.annotationLoadFailed(r),o?st("button",{type:"button","data-testid":"contact-map-retry-button",onClick:o,className:"rounded border border-rose-300 bg-white px-1.5 py-0.5 font-semibold text-rose-700 transition-colors hover:bg-rose-100 dark:border-rose-700 dark:bg-rose-950 dark:text-rose-200 dark:hover:bg-rose-900",children:l.annotationRetry}):null]}):null]})});Sa.displayName="ContactMapAnnotation";Lt();import{useMemo as ho}from"react";Mt();Lt();le();import{createContext as Ns,useContext as Ps,useMemo as Ms}from"react";Mt();Lt();Zn();var ws=["indexWorker","levenshteinWorker","treeWorker"];function xr(e,t,n){if(n!==void 0){if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string or left out (pass url.href for a URL object); got ${se(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${se(n)}`)}}var vr={setting:"workerUrls"},Cr=(e,t)=>{if(e===void 0)return;let{setting:n,keys:r=ws,hints:s={}}=t;if(!Rt(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${se(e)}`);let a=Object.getOwnPropertyNames(e).map(l=>({key:l,url:e[l]})),o=a.find(({key:l,url:d})=>d!==void 0&&!r.includes(l));if(o!==void 0){let l=Object.hasOwn(s,o.key)?s[o.key]:void 0,d=l===void 0?bn(o.key,r):void 0;throw new RangeError(`[contact-map] ${n} has a key it does not take (it takes ${r.join(", ")}${l===void 0?"":`; ${l}`}${d===void 0?"":`; did you mean ${JSON.stringify(d)}?`}); got ${se(o.key)}`)}let c=Object.create(null);for(let{key:l,url:d}of a){let m=l;xr(n,m,d),d!==void 0&&(c[m]=d)}return c};function oc(e,t=vr){Cr(e,t)}function kr(e){xr("workerUrls","treeWorker",e)}var Wt=(e,t,n=vr)=>{let r=Cr(t,n);return{indexWorker:r?.indexWorker===void 0?e?.indexWorker:r.indexWorker,levenshteinWorker:r?.levenshteinWorker===void 0?e?.levenshteinWorker:r.levenshteinWorker,treeWorker:r?.treeWorker===void 0?e?.treeWorker:r.treeWorker}};import{jsx as Ta}from"react/jsx-runtime";var Sr=e=>{if(!Rt(e))throw new TypeError(`[contact-map] config must be a plain object; got ${se(e)}`);let t=e;return{streamEndpoint:ge(t,"streamEndpoint"),openEmailsWithGmail:ge(t,"openEmailsWithGmail"),treeWorkerFactory:ge(t,"treeWorkerFactory"),workerUrls:Wt(void 0,ge(t,"workerUrls")),layoutSpec:ge(t,"layoutSpec"),locale:ge(t,"locale"),labels:ge(t,"labels")}},Tr=({workerUrls:e,...t})=>{let{indexWorker:n,levenshteinWorker:r,treeWorker:s}=e;return Object.freeze(Object.assign(Object.create(null),t,{workerUrls:Object.freeze({indexWorker:n,levenshteinWorker:r,treeWorker:s})}))},Rs=Tr(Sr({})),wr=Ns(Rs),Ls=Object.freeze({locale:"locale",labels:"labels"});function wa({config:e,chromeSurface:t,children:n}){let{streamEndpoint:r,openEmailsWithGmail:s,treeWorkerFactory:a,workerUrls:o,layoutSpec:c,locale:l,labels:d}=Sr(e),{indexWorker:m,levenshteinWorker:u,treeWorker:i}=o,p=Ms(()=>Tr({streamEndpoint:r,openEmailsWithGmail:s,treeWorkerFactory:a,workerUrls:{indexWorker:m,levenshteinWorker:u,treeWorker:i},layoutSpec:c,locale:l,labels:d}),[r,s,a,m,u,i,c,l,d]);return Ta(wr.Provider,{value:p,children:Ta(Za,{locale:l,labels:d,surface:t,children:n})})}function Es({config:e,children:t}){return Ta(wa,{config:e,chromeSurface:Ls,children:t})}function Ge(){return Ps(wr)}import{useCallback as Na,useEffect as As,useMemo as Hn,useSyncExternalStore as Nr}from"react";Mt();var Os=1e3,Ws=3e4,Ds=6;function Dn(e){if(typeof e!="string")throw new TypeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream", set on ContactMapConfigProvider or ContactMapAppView; got ${se(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${se(e)}`);if(!e.startsWith("/")||e.startsWith("//")||e.startsWith("/\\"))throw new RangeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream"; got ${se(e)}`)}var Hs=e=>({...e,contacted_at:e.contacted_at?new Date(e.contacted_at):null,created_at:e.created_at?new Date(e.created_at):void 0,updated_at:e.updated_at?new Date(e.updated_at):void 0}),_s=e=>Array.isArray(e.records),Wn=class{constructor(t){this.recordMap=new Map;this.listeners=new Set;this.lastCursor=null;this.consecutiveFailures=0;this.started=!1;this.disposed=!1;this.activeController=null;this.wakeRetryWait=null;this.state={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null};this.handleOnline=()=>{this.wakeRetryWait?.()};Dn(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??Os,this.maxRetryDelayMs=t.maxRetryDelayMs??Ws,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Ds,this.logger=t.logger??Ie}getState(){return this.state}getRecordMap(){return this.recordMap}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}start(){this.started||this.disposed||(this.started=!0,typeof window<"u"&&window.addEventListener("online",this.handleOnline),this.runStreamLoop())}retryNow(){if(!this.disposed)switch(this.state.phase){case"retrying":this.wakeRetryWait?.();return;case"failed":case"auth-required":this.consecutiveFailures=0,this.setState({error:null,isLoading:this.recordMap.size===0}),this.runStreamLoop();return;case"idle":case"streaming":case"complete":return}}dispose(){this.disposed=!0,this.activeController?.abort(),this.wakeRetryWait?.(),typeof window<"u"&&window.removeEventListener("online",this.handleOnline)}setState(t){this.state={...this.state,...t};for(let n of this.listeners)n(this.state)}publishRecords(t={}){let n=Array.from(this.recordMap.values());this.setState({records:n,loadedCount:n.length,isLoading:!1,...t})}async runStreamLoop(){this.setState({phase:"streaming"});let t=!1;for(;!this.disposed;){let n=this.lastCursor!==null,r=await this.streamOnce();if(r==="aborted")return;if(r==="complete"){this.publishRecords({isComplete:!0,phase:"complete",error:null});return}if(r==="auth-required"){this.setState({phase:"auth-required",isLoading:!1,error:new Error("Authentication required")});return}if(r==="rejected"){if(n&&!t){t=!0,this.lastCursor=null,this.logger.warn("[ContactMapStream] the server rejected the resume cursor (400); restarting from the beginning");continue}this.setState({phase:"failed",isLoading:!1,error:new Error("[contact-map] the server rejected the stream request (400); reload the page")});return}if(this.consecutiveFailures+=1,this.consecutiveFailures>=this.maxConsecutiveFailures){this.setState({phase:"failed",isLoading:!1});return}let s=Math.min(this.initialRetryDelayMs*2**(this.consecutiveFailures-1),this.maxRetryDelayMs);if(this.setState({phase:"retrying",isLoading:this.recordMap.size===0}),this.logger.warn(`[ContactMapStream] retrying in ${s}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(s),this.disposed)return;this.setState({phase:"streaming"})}}waitBeforeRetry(t){return new Promise(n=>{let r=setTimeout(()=>{this.wakeRetryWait=null,n()},t);this.wakeRetryWait=()=>{clearTimeout(r),this.wakeRetryWait=null,n()}})}buildStreamUrl(){if(!this.lastCursor)return this.endpoint;let t=this.endpoint.includes("?")?"&":"?",n=new URLSearchParams;return this.lastCursor.contacted_at!==null&&n.set("cursor_contacted_at",this.lastCursor.contacted_at),n.set("cursor_person_id",String(this.lastCursor.person_id)),`${this.endpoint}${t}${n.toString()}`}async streamOnce(){this.activeController=new AbortController;try{let t=await this.fetchFn(this.buildStreamUrl(),{signal:this.activeController.signal,credentials:"same-origin"});if(t.status===401||t.status===403)return"auth-required";if(t.status===400)return"rejected";if(!(t.ok&&t.body))return this.logger.warn(`[ContactMapStream] unexpected response: ${t.status}`),this.setState({error:new Error(`[contact-map] the stream request failed (status ${t.status})`)}),"retryable";let n=t.body.getReader(),r=new TextDecoder,s="",a=!1,o=!1;for(;;){let{done:c,value:l}=await n.read();if(c)break;let d=r.decode(l,{stream:!0}),m=(s+d).split(`
2
2
  `);s=m.pop()??"";let u=!1;for(let i of m){let p=i.trim();if(!p)continue;let h;try{h=JSON.parse(p)}catch(C){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",C);continue}if("type"in h&&h.type==="METADATA"){Number.isSafeInteger(h.total)&&h.total>=0&&this.setState({totalCount:h.total});continue}if(!_s(h)){this.logger.warn("[ContactMapStream] server reported error:","error"in h?h.error:""),o=!0;continue}for(let C of h.records)C&&typeof C.person_id=="number"&&(this.recordMap.set(C.person_id,Hs(C)),u=!0);h.nextCursor&&(this.lastCursor=h.nextCursor),h.isLast&&(a=!0)}u&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return o?(this.setState({error:new Error("Stream interrupted by server error")}),"retryable"):a?"complete":(this.setState({error:new Error("Stream ended before completion")}),"retryable")}catch(t){if(t instanceof Error&&t.name==="AbortError")return"aborted";let n=t instanceof Error?t:new Error(String(t));return this.setState({error:n}),"retryable"}finally{this.activeController=null}}};var Le=null,Is=e=>{if(Le!==null&&Le.endpoint===e)return Le;if(Dn(e),Le===null)return Le=new Wn({endpoint:e}),Le;if(Le.endpoint!==e)throw new Error(`[contact-map] the stream client already streams from ${JSON.stringify(Le.endpoint)} and cannot also stream from ${JSON.stringify(e)}; give every contact-map view in the browser tab the same streamEndpoint, on every route (after changing it, reload the page)`);return Le},vc=()=>{Le?.dispose(),Le=null},Fs=new Map,zs={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null},Bs=()=>{let{streamEndpoint:e}=Ge();return Hn(()=>(Dn(e),e),[e])};function Us(){let e=Bs(),t=Na(()=>Is(e),[e]);As(()=>{let o=t();o.start(),o.retryNow()},[t]);let n=Na(o=>t().subscribe(o),[t]),r=Nr(n,()=>t().getState(),()=>zs),s=Nr(n,()=>t().getRecordMap(),()=>Fs),a=Na(()=>t().retryNow(),[t]);return Hn(()=>({...r,recordMap:s,retryNow:a}),[r,s,a])}var $s=e=>{let t=new Set;for(let{company_name:n}of e)typeof n=="string"&&n.trim().length>0&&t.add(n);return t.size};function _n(){let{records:e,recordMap:t,isComplete:n,phase:r,loadedCount:s,totalCount:a,error:o,retryNow:c}=Us(),l=Hn(()=>$s(e),[e]);return{context:Hn(()=>({contactMapRecords:e,contactMapRecordMap:t,isStreamingComplete:n,isStreamingFailed:r==="failed",streamPhase:r,loadedCount:s,companyCount:l,totalCount:a,errorMessage:o?.message??null}),[e,t,n,r,s,l,a,o]),retryNow:c}}le();import{DEFAULT_FUZZY_SEARCH_OPTIONS as ml,parseQuerySets as gl}from"@aiquants/fuzzy-search";import{useFuzzySearch as hl}from"@aiquants/fuzzy-search/react";import fl from"lucide-react/dist/esm/icons/search.js";import{useCallback as At,useEffect as Ye,useMemo as ct,useRef as uo,useState as Oe,useTransition as yl}from"react";import{useNavigation as bl,useSearchParams as xl}from"react-router";fa();Lt();import{useCallback as kt,useEffect as Vs,useRef as Pr}from"react";var it=e=>{let t=Pr(null),n=Pr({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),r=e?.dragThreshold??4,s=kt(u=>{let i=u.currentTarget,p=u.deltaY;!i||p===0||(u.preventDefault(),i.scrollBy({left:p,behavior:"smooth"}))},[]),a=kt(u=>{t.current?.removeEventListener("wheel",s),t.current=u,u?.addEventListener("wheel",s,{passive:!1})},[s]);Vs(()=>()=>{t.current&&t.current.removeEventListener("wheel",s)},[s]);let o=kt(u=>{if(u.pointerType==="touch")return;let i=n.current;i.isPointerDown=!0,i.isDragging=!1,i.startX=u.clientX,i.scrollLeft=u.currentTarget.scrollLeft,i.pointerId=u.pointerId,i.hasCapture=!1,i.pointerType=u.pointerType},[]),c=kt(u=>{let i=n.current;if(!i.isPointerDown||i.pointerType==="touch")return;let p=u.currentTarget,h=u.clientX-i.startX;!i.isDragging&&Math.abs(h)>r&&(i.isDragging=!0,i.hasCapture||(p.setPointerCapture?.(u.pointerId),i.hasCapture=!0)),i.isDragging&&(u.preventDefault(),p.scrollLeft=i.scrollLeft-h)},[r]),l=kt(u=>{let i=n.current;if(i.pointerType==="touch")return;let p=u.currentTarget;i.isPointerDown&&i.hasCapture&&p.hasPointerCapture?.(u.pointerId)&&p.releasePointerCapture(u.pointerId),i.isDragging&&(i.didDrag=!0,window.setTimeout(()=>{i.didDrag=!1},0)),i.isPointerDown=!1,i.isDragging=!1,i.pointerId=0,i.hasCapture=!1},[]),d=kt(u=>{l(u)},[l]),m=kt(u=>{n.current.didDrag&&(u.preventDefault(),u.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:a,onPointerDown:o,onPointerMove:c,onPointerUp:d,onPointerLeave:d,onPointerCancel:d,onClickCapture:m}};ft();le();import{jsx as Mr}from"react/jsx-runtime";function Rr({value:e,max:t=100,className:n,indicatorClassName:r,...s}){let a=e===void 0,o=a?0:Math.min(100,Math.max(0,e/t*100));return Mr("div",{role:"progressbar","aria-valuenow":a?void 0:o,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:xt("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",n),...s,children:Mr("div",{"data-slot":"progress-indicator",className:xt("h-full rounded-full bg-primary transition-[width] duration-300 ease-in-out will-change-transform",a&&"w-1/3 animate-progress-indeterminate",r),style:a?void 0:{width:`${o}%`}})})}import{useCallback as Zi,useState as el}from"react";import{useSearchParams as tl}from"react-router";le();bt();import{Panel as _r,PanelGroup as ri,PanelResizeHandle as oi}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as si,VirtualScroll as ii}from"@aiquants/virtualscroll";import{lazy as li,memo as di,Suspense as ci,useCallback as Qe,useEffect as Fr,useLayoutEffect as zr,useMemo as nn,useRef as an,useState as Bn}from"react";var Zt={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},en={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function An(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,n=t+e.scrollbarSafetyBuffer,r=n+e.hysteresisSafetyMargin,s=r-n;return{physicalMinWidth:t,collapseThreshold:n,expandThreshold:r,hysteresisWidth:s}}import{useCallback as Ks,useEffect as js,useState as qs}from"react";var Lr=(e,t)=>{let{enableMutationObserver:n=!1,bottomGap:r=4,minFallbackHeight:s=240}=t??{},[a,o]=qs(600),c=Ks(()=>{if(typeof window>"u")return;let l=e.current;if(!l||l.offsetParent===null&&window.getComputedStyle(l).position!=="fixed")return;let d=x=>Number.parseFloat(x)||0,{top:m}=l.getBoundingClientRect(),u=l.parentElement?.getBoundingClientRect(),i=window.getComputedStyle(document.documentElement),p=d(i.getPropertyValue("--footer-height")),h=d(i.getPropertyValue("--header-height")),C=d(i.getPropertyValue("--scrollbar-height")),v=window.getComputedStyle(l),k=d(v.marginBottom),F=d(v.paddingBottom),T=window.innerHeight-p-C-r,y=u?Math.min(u.bottom,T):T,g=u?Math.max(u.top,h):h,E=Math.max(m,g),K=y-E-k-F,b=Number.isFinite(K)?Math.floor(K):0,f=b>0?b:s;f>0&&Number.isFinite(f)&&o(x=>Math.abs(x-f)>1?f:x)},[r,e,s]);return js(()=>{if(typeof window>"u")return;let l=null,d=null,m=null,u=null,i=()=>{l!==null&&window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{c()})};i(),d=window.setTimeout(()=>{i()},150);let p=e.current;return typeof ResizeObserver<"u"&&p&&(m=new ResizeObserver(()=>{i()}),m.observe(p),p.parentElement&&m.observe(p.parentElement)),n&&typeof MutationObserver<"u"&&(u=new MutationObserver(()=>{i()}),u.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",i),()=>{l!==null&&window.cancelAnimationFrame(l),d!==null&&window.clearTimeout(d),m&&m.disconnect(),u&&u.disconnect(),window.removeEventListener("resize",i)}},[e,n,c]),{viewportHeight:a,updateViewportHeight:c}};import{useCallback as lt,useEffect as Er,useRef as tn,useState as Or}from"react";var Gs=600,Wr=8,In=({ref:e,onSelect:t,resolveItem:n,item:r})=>{let[s,a]=Or(!1),[o,c]=Or(null),l=tn(null),d=tn(!1),m=tn(!1),u=tn(null),i=tn({onSelect:t,resolveItem:n,item:r});Er(()=>{i.current={onSelect:t,resolveItem:n,item:r}},[t,n,r]);let p=lt(()=>{typeof window>"u"||l.current!==null&&(window.clearTimeout(l.current),l.current=null)},[]),h=lt(()=>{u.current&&(p(),m.current=!1,u.current=null)},[p]),C=lt(g=>{typeof window>"u"||g.button!==0&&g.pointerType==="mouse"||(p(),m.current=!1,d.current=!1,u.current={x:g.clientX,y:g.clientY,pointerId:g.pointerId},l.current=window.setTimeout(()=>{let E=i.current,K=null;E.item!==void 0?K=E.item:E.resolveItem&&g.target&&(K=E.resolveItem(g.target)),K!==null&&(d.current=!0,E.onSelect?.(K),c(K),a(!0)),h()},Gs))},[p,h]),v=lt(g=>{u.current&&g.pointerId===u.current.pointerId&&(p(),u.current=null,m.current=!1)},[p]),k=lt(g=>{d.current&&(g.preventDefault(),g.stopPropagation(),d.current=!1)},[]),F=lt(g=>{if(!u.current||g.pointerId!==u.current.pointerId)return;let E=Math.abs(g.clientX-u.current.x),K=Math.abs(g.clientY-u.current.y);(E>Wr||K>Wr)&&(p(),u.current=null)},[p]),T=lt(g=>{(s||l.current!==null)&&(g.preventDefault(),g.stopPropagation())},[s]),y=lt(g=>{g?.cancelLongPressTimer&&p(),g?.suppressLongPress&&(m.current=!0),a(!1),c(null),d.current=!1,u.current=null},[p]);return Er(()=>{let g=e.current;if(!(g&&typeof window<"u"))return;let E=[["pointerdown",C,void 0],["pointerup",v,void 0],["pointercancel",v,void 0],["pointermove",F,void 0],["pointerleave",v,void 0],["click",k,!0],["contextmenu",T,void 0]],K=[["contextmenu",T,!0],["pointerup",v,!0],["pointercancel",v,!0]];for(let[b,f,x]of E)g.addEventListener(b,f,x);for(let[b,f,x]of K)window.addEventListener(b,f,x);return()=>{for(let[b,f,x]of E)g.removeEventListener(b,f,x);for(let[b,f,x]of K)window.removeEventListener(b,f,x);p()}},[e,C,v,F,k,T,p]),{isPopupVisible:s,popupItem:o,handleClosePopup:y}};import{useCallback as Qs,useEffect as Ys,useState as Dr,useSyncExternalStore as Xs}from"react";function Fn(e,t,n){let r=n?.mediaQuery??"(min-width: 1024px)",s=Xs(Qs(m=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let u=window.matchMedia(r);return u.addEventListener("change",m),()=>u.removeEventListener("change",m)},[r]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(r).matches:!0,()=>!1),[a,o]=Dr(!1),[c,l]=Dr(0);return Ys(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let m=e.current;if(!m)return;let u=new ResizeObserver(i=>{for(let p of i){if(p.target!==m)continue;let h=0;p.borderBoxSize&&p.borderBoxSize.length>0?h=p.borderBoxSize[0].inlineSize:h=p.contentRect.width,!(!Number.isFinite(h)||h<=0)&&(l(h),o(C=>C&&h>=t.expandThreshold?!1:!C&&h<t.collapseThreshold?!0:C))}});return u.observe(m),()=>u.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:s&&!a,isContainerNarrow:a,isMediaMatches:s,containerWidth:c}}le();le();import{useSwipeToDismissOverlay as Js,useTapClick as Zs}from"@aiquants/swipe-overlay";import{useCallback as ei,useEffect as ti,useRef as ni}from"react";import{jsx as Hr,jsxs as ai}from"react/jsx-runtime";var zn=({isOpen:e,onClose:t,children:n,className:r="",title:s})=>{let a=G(),o=ni(null),{overlayRef:c,overlayStyle:l,attemptClose:d}=Js({isOpen:e,onClose:t,isCloseBlocked:ei(()=>!1,[]),skipWhenTextSelected:!0}),m=Zs(()=>d());return ti(()=>{!e&&o.current?.contains(document.activeElement)&&document.activeElement.blur()},[e]),e?ai("div",{ref:o,"data-testid":"contact-map-mobile-overlay",className:`fixed top-0 bottom-0 left-0 z-50 flex touch-manipulation transition-[visibility] duration-200 ${e?"pointer-events-auto visible":"pointer-events-none invisible"}`,style:{right:"var(--aqcm-overlay-right, var(--aiquants-menu-pinned-width, 0px))",transition:"right 0.5s, visibility 0.2s"},"aria-hidden":!e,children:[Hr("button",{type:"button","aria-label":a.overlayBackdrop,className:`absolute inset-0 touch-manipulation bg-slate-900/50 transition-opacity duration-200 focus:outline-none ${e?"opacity-100":"opacity-0"}`,...m}),Hr("aside",{role:"dialog","aria-modal":"true","aria-label":s===void 0?a.overlayTitle:s,style:l,ref:c,className:`relative ml-auto flex h-full w-full max-w-lg transform touch-pan-y flex-col bg-white shadow-xl transition-transform duration-200 ease-out dark:bg-slate-900 ${r}`,onKeyDown:u=>{u.key==="Escape"&&(u.stopPropagation(),d())},children:n})]}):null};ga();import{Fragment as Ti,jsx as _,jsxs as Ce}from"react/jsx-runtime";var ui=li(async()=>({default:(await Promise.resolve().then(()=>(fr(),hr))).default})),Br=64,Ar="h-[64px]",Ir=240,pi=4,Pa=An(Zt),mi=Zt.listPanelMinWidth,gi=Zt.detailPanelMinWidth,hi=Zt.handleThickness,Xc=Pa.collapseThreshold,Jc=Pa.expandThreshold,fi=({contactData:e})=>{let t=G(),n=e?.full_name??t.noName,r=e?.title??"-",s=e?.company_name??"-",a=e?.department??"-",o=e?.email??"-",c=e?.company_phone_number??e?.mobile_phone_number??"-",l=e?.updated_at?Pe(e.updated_at):"-";return _(wn,{fullName:n,title:r,companyName:s,department:a,phoneNumber:c,email:o,updatedAtText:l})},yi=e=>({"--contact-panel-height":`${e}px`}),bi=e=>typeof e=="object"&&e!==null&&"item"in e,xi=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,vi=(e,t)=>{for(let n of e){let r=Cn(n);if(r?.person_id===t)return r}return null},Ma=(e,t,n)=>{let{viewportHeight:r}=Lr(t,{enableMutationObserver:!0,bottomGap:pi,minFallbackHeight:Ir}),[s,a]=Bn(0),o=Qe(()=>{let u=n.current,i=t.current;if(!(u&&i))return;let p=u.getBoundingClientRect(),h=i.getBoundingClientRect(),C=Math.ceil(h.top-p.top);Number.isFinite(C)&&C>0&&a(v=>Math.abs(v-C)>1?C:v)},[t,n]);zr(()=>{if(!e)return;o();let u=requestAnimationFrame(o);return window.addEventListener("resize",o),()=>{cancelAnimationFrame(u),window.removeEventListener("resize",o)}},[e,o]);let c=r>0?r:Ir,l=s>0?s:0,d=c+l,m=nn(()=>yi(d),[d]);return{normalizedViewportHeight:c,normalizedDetailHeight:d,panelSizingStyle:m}},Ci=new Set,ki=()=>{let[e,t]=Bn(Ci),n=Qe((r,s)=>{t(a=>{if(a.has(r)===s)return a;let o=new Set(a);return s?o.add(r):o.delete(r),o})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:n}},Si=(e,t,n)=>{let r=an(n);zr(()=>{r.current=n},[n]),Fr(()=>{if(e!==null)return r.current(e,t),()=>{r.current(e,!1)}},[e,t])},Ur=di(({entry:e,index:t,selectedPersonId:n,onSelect:r,searchQuery:s,enableHighlighting:a,openEmailsWithGmail:o,openGmailCompose:c,onPopupVisibilityChange:l})=>{let d=G(),m=an(null),u=_("div",{className:Ar}),i=bi(e)?e:null,p=Cn(e),{isPopupVisible:h,handleClosePopup:C}=In({ref:m,onSelect:r,item:p?.person_id});if(Si(p?.person_id??null,h,l),!e||!p)return u;let{person_id:v}=p,k=n===v,F=t%2===0?"bg-white dark:bg-slate-900":"bg-gray-50 dark:bg-slate-900/70",y=k?"border-blue-300 bg-blue-50 ring-1 ring-blue-200 dark:border-blue-500 dark:bg-blue-500/20 dark:ring-blue-500/40":F,g=["B","F"].map(E=>xi(E,E==="B"?i?.baseScore:i?.score)).filter(Boolean);return Ce("div",{ref:m,className:`flex ${Ar} w-full items-center overflow-hidden border-gray-200 border-b px-4 py-2 text-left transition-colors hover:bg-blue-50 dark:border-slate-700 dark:hover:bg-blue-500/10 ${y}`,style:{height:Br},role:"button","aria-pressed":k,"data-selected":k?"true":"false",onClick:()=>r(v),children:[Ce("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[_("div",{className:"whitespace-nowrap font-medium text-slate-700 text-xs leading-tight dark:text-slate-200",children:d.listRowNumber(t+1)}),_("div",{className:"truncate text-[11px] text-slate-700 leading-tight dark:text-slate-200",children:v}),_("div",{className:"flex items-center gap-1 whitespace-nowrap font-mono text-[11px] text-slate-600 leading-tight dark:text-slate-300",children:g.length?g.map(E=>_("span",{children:E},E)):_("span",{children:"-"})})]}),_(ci,{fallback:_(fi,{contactData:p}),children:_(ui,{contactData:p,searchTerm:s,enableHighlighting:a,openEmailsWithGmail:o,openGmailCompose:c,isPopupVisible:h,onRequestClose:C})})]})});Ur.displayName="ContactListRow";var $r=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:r,hasSearchTerm:s,enableHighlighting:a,openEmailsWithGmail:o,isSearchTabActive:c}=e,{locale:l,labels:d,engineLabels:m}=ye(),u=an(null),i=an(null),[p,h]=Bn(null),{normalizedViewportHeight:C,panelSizingStyle:v}=Ma(c,i,u),{isAnyPopupVisible:k,handlePopupVisibilityChange:F}=ki(),T=nn(()=>({enablePointerDrag:!k,enableKeyboardNavigation:!k}),[k]),y=nn(()=>s?n:t,[s,n,t]),g=Qe(ie=>{h(ie)},[]),E=Qe(ie=>{if(!o)return;let oe=ie.trim();if(!oe||oe==="-"||typeof window>"u")return;let ut=qe(oe,!0);ut&&window.open(ut,"_blank","noopener,noreferrer")},[o]),[K,b]=Bn(!1),f=Qe(ie=>{g(ie),b(!0)},[g]),x=Qe((ie,oe)=>_(Ur,{entry:ie,index:oe,selectedPersonId:p,onSelect:f,searchQuery:r,enableHighlighting:a,openEmailsWithGmail:o,openGmailCompose:E,onPopupVisibilityChange:F}),[p,f,r,a,o,E,F]),O=Qe(ie=>y[ie],[y]),W=Qe(ie=>Cn(y[ie])?.person_id??`row-${ie}`,[y]),te=Qe(()=>Br,[]),w=y.length,N=nn(()=>({enabled:!0,renderVisual:si}),[]),H=nn(()=>p===null?null:vi(y,p),[p,y]);Fr(()=>{p!==null&&!H&&h(null)},[p,H]);let B=an(null),{isTwoColumn:re}=Fn(B,Pa),pe=Ce("div",{ref:u,className:"flex min-h-0 flex-1 flex-col gap-1",children:[_("div",{className:"hidden rounded-t-lg border border-gray-200 bg-gray-50 px-4 py-2 transition-colors sm:block dark:border-slate-700 dark:bg-slate-900/70",children:Ce("div",{className:"flex items-center",children:[Ce("div",{className:"flex w-28 shrink-0 flex-col items-center gap-0.5 text-center text-[11px] text-slate-700 uppercase tracking-wider dark:text-slate-200",children:[_("span",{className:"font-semibold text-slate-900 text-xs dark:text-slate-100",children:d.columnNo}),_("span",{className:"leading-tight",children:d.columnId}),_("span",{className:"whitespace-nowrap leading-tight",children:d.columnScore})]}),Ce("div",{className:"hidden w-full grid-cols-3 gap-2 font-medium text-slate-700 text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[Ce("div",{className:"flex flex-col gap-0.5",children:[_("span",{children:d.columnName}),_("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:d.columnTitle})]}),Ce("div",{className:"flex flex-col gap-0.5",children:[_("span",{children:d.columnCompany}),_("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:d.columnDepartment})]}),Ce("div",{className:"flex flex-col gap-0.5",children:[_("span",{children:d.columnPhone}),_("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:d.columnEmail})]}),_("div",{className:"hidden items-end justify-end xl:flex",children:_("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:d.columnUpdatedAt})})]})]})}),_("div",{ref:i,className:"flex-1",children:_(ii,{itemCount:w,getItemKey:W,behaviorOptions:T,getItem:O,getItemHeight:te,viewportSize:C,overscanCount:10,scrollBarOptions:{width:8,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:N},locale:l,labels:m,className:"w-full rounded-b-lg border border-gray-200 border-t-0 bg-white pr-0.75 transition-colors dark:border-slate-700 dark:bg-slate-950",children:(ie,oe)=>x(ie,oe)})}),n.length===0&&s?_("div",{className:"py-8 text-center",children:_("p",{className:"text-slate-600 dark:text-slate-300",children:d.listNoSearchResults})}):null,w===0&&!s?_("div",{className:"py-8 text-center",children:_("p",{className:"text-slate-600 dark:text-slate-300",children:d.listNoData})}):null]});return _("div",{ref:B,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:v,children:re?Ce(ri,{id:"contact-map-list-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-list-panel-group",children:[_(_r,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:mi,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:pe}),_(oi,{id:"contact-map-list-handle",thickness:hi,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:"cursor-col-resize rounded transition-colors hover:bg-slate-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 dark:hover:bg-slate-700/60","aria-label":d.listResizeHandle}),_(_r,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:gi,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:_(ot,{contact:H,searchTerm:r,enableHighlighting:a})})]}):Ce(Ti,{children:[pe,_("div",{className:"hidden","aria-hidden":"true",children:_(ot,{contact:H,searchTerm:r,enableHighlighting:a})}),H?_(zn,{isOpen:K,onClose:()=>b(!1),className:"z-50 bg-white dark:bg-slate-900",children:Ce("div",{className:"flex h-full flex-col overflow-hidden p-3 sm:p-4",children:[Ce("div",{className:"mb-2 flex items-center justify-between border-b pr-10 pb-2 dark:border-slate-700",children:[_("h3",{className:"font-semibold text-slate-900 text-sm dark:text-slate-100",children:d.detailHeading}),_("button",{type:"button",onClick:()=>b(!1),className:"rounded px-2.5 py-1 font-medium text-slate-600 text-xs hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800",children:d.close})]}),_("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",style:{height:"100%"},children:_(ot,{contact:H,searchTerm:r,enableHighlighting:a})})]})}):null]})})};bt();import{DirectoryTree as Hi}from"@aiquants/directory-tree";import{Panel as Yr,PanelGroup as _i,PanelResizeHandle as Ai}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as Ii}from"@aiquants/virtualscroll";import Fi from"@heroicons/react/24/solid/FolderMinusIcon.js";import zi from"@heroicons/react/24/solid/FolderPlusIcon.js";import{useCallback as Fe,useEffect as Tt,useMemo as Ee,useRef as Kn,useState as dt}from"react";import{createPortal as Bi}from"react-dom";var Ra=(e,t)=>e&&e.trim()||t;import{useEffect as wi,useRef as Un,useState as Ni}from"react";var Vr=(e,t=250)=>{let[n,r]=Ni(e),s=Un(null),a=Un(e),o=Un(null),c=Un(!1);return wi(()=>{if(!c.current){c.current=!0,r(e),a.current=e;return}a.current=n,s.current=null;let l=d=>{s.current??(s.current=d);let m=d-s.current,u=Math.min(1,Math.max(0,m/t)),i=1-(1-u)**3,p=Math.max(0,Math.round(a.current+(e-a.current)*i));r(p),u<1&&(o.current=requestAnimationFrame(l))};return o.current=requestAnimationFrame(l),()=>{o.current!==null&&cancelAnimationFrame(o.current)}},[e,t]),Math.max(0,n)};Mt();import{useCallback as La,useEffect as Ea,useMemo as Kr,useRef as Pi,useSyncExternalStore as Mi}from"react";le();var Ri=250,Li=4e3,$n=3,jr={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},qr=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,Vn=class{constructor(t,{workerSource:n,logger:r=Ie}){this.worker=null;this.generation=0;this.postedCount=0;this.latestSnapshot=null;this.workerNeedsReset=!1;this.lastSyncedRecords=[];this.postedNaming=null;this.lastSyncedNaming=null;this.consecutiveFailures=0;this.finalizeRequest=null;this.finalizedPostedCount=null;this.retryTimer=null;this.listeners=new Set;this.state={snapshot:null,isBuilding:!1};this.getState=()=>this.state;this.subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));this.handleMessage=t=>{let n=t.data;n.type!=="TREE_CHUNK"||n.generation!==this.generation||n.uniquePersonCount===0&&this.postedCount>0&&(this.latestSnapshot?.uniquePersonCount??0)>0||this.latestSnapshot!==null&&n.uniquePersonCount<this.latestSnapshot.uniquePersonCount&&!(n.isIdle&&n.consumedRecords>=this.postedCount)||(n.isIdle&&n.consumedRecords>=this.postedCount&&(this.consecutiveFailures=0),this.latestSnapshot={tree:n.tree,directoryPaths:n.directoryPaths,consumedRecords:n.consumedRecords,uniquePersonCount:n.uniquePersonCount,isIdle:n.isIdle,rebuildEpoch:n.rebuildEpoch},this.updateState())};this.handleFailure=t=>{if(this.worker?.terminate(),this.worker=null,this.postedCount=0,this.consecutiveFailures+=1,this.updateState(),this.consecutiveFailures>=$n){this.logger.error(`[TreeWorker] the tree Worker failed ${$n} times in a row; the tree stops updating until ${jr[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min(Ri*2**(this.consecutiveFailures-1),Li);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${$n})`,t),this.retryTimer!==null&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{this.retryTimer=null;let r=this.lastSyncedNaming;r!==null&&this.syncRecords(this.lastSyncedRecords,r)},n)};if(typeof n!="string")throw new TypeError(`[contact-map] TreeWorkerSession workerSource must be a string; got ${se(n)}`);if(!Object.hasOwn(jr,n))throw new RangeError(`[contact-map] TreeWorkerSession workerSource must be "treeWorkerFactory" or "workerUrls.treeWorker"; got ${se(n)}`);this.workerFactory=t,this.workerSource=n,this.logger=r}updateState(){let t=this.postedCount>(this.latestSnapshot?.consumedRecords??0);this.state.snapshot===this.latestSnapshot&&this.state.isBuilding===t||(this.state={snapshot:this.latestSnapshot,isBuilding:t},this.notify())}notify(){for(let t of this.listeners)t()}ensureWorker(){if(this.consecutiveFailures>=$n||this.retryTimer!==null)return null;if(!this.worker)try{this.worker=this.workerFactory(),this.workerNeedsReset=!0,this.worker.onerror=this.handleFailure,this.worker.onmessageerror=this.handleFailure,this.worker.onmessage=this.handleMessage}catch(t){return this.handleFailure(t),null}return this.worker}syncRecords(t,n){this.finalizeRequest!==null&&(t.length<this.finalizeRequest.recordCount||this.finalizeRequest.naming===null||!qr(this.finalizeRequest.naming,n))&&(this.finalizeRequest=null),this.lastSyncedRecords=t,this.lastSyncedNaming=n;let r=this.ensureWorker();if(!r)return;let s=this.workerNeedsReset,a=this.postedNaming===null||!qr(this.postedNaming,n);if((this.workerNeedsReset||a||t.length<this.postedCount)&&(this.generation+=1,this.postedCount=0,this.finalizedPostedCount=null,this.workerNeedsReset=!1,this.postedNaming=n,r.postMessage({type:"RESET_TREE",generation:this.generation,epochBase:this.latestSnapshot?.rebuildEpoch??0,naming:n}),this.updateState()),t.length>this.postedCount){let o=t.slice(this.postedCount);this.postedCount=t.length,r.postMessage({type:"APPEND_RECORDS",generation:this.generation,records:o}),this.updateState()}s&&this.finalizeRequest!==null&&this.finalize()}finalize(){this.finalizeRequest={recordCount:this.lastSyncedRecords.length,naming:this.lastSyncedNaming},!(this.worker===null||this.finalizedPostedCount===this.postedCount)&&(this.finalizedPostedCount=this.postedCount,this.worker.postMessage({type:"FINALIZE_TREE",generation:this.generation}))}cancelWorker(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.worker?.terminate(),this.worker=null,this.postedCount=0,this.postedNaming=null,this.finalizedPostedCount=null}stop(){this.cancelWorker(),this.consecutiveFailures=0,this.updateState()}reset(){this.cancelWorker(),this.listeners.clear(),this.latestSnapshot=null,this.lastSyncedRecords=[],this.lastSyncedNaming=null,this.consecutiveFailures=0,this.finalizeRequest=null,this.state={snapshot:null,isBuilding:!1}}},Ei=e=>{if(e!==void 0)return new Worker(e,{type:"module"});let t=typeof import.meta<"u"?import.meta.url:void 0;if(t){let r=t.includes(".ts")?"../workers/treeWorker.ts":"./worker/treeWorker.mjs";return new Worker(new URL(r,t),{type:"module"})}throw new Error("[contact-map] the tree Worker needs workerUrls.treeWorker in a build without import.meta.url (CommonJS)")},St=null,Gr=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),Oi=e=>{if(e===void 0)throw new Error("[contact-map] treeWorkerFactory was removed from the config while its tree session was still in use");return e},Wi=e=>{if(kr(e),St===null){let t=new Vn(()=>Ei(e),{workerSource:"workerUrls.treeWorker"});return St={session:t,workerUrl:e},t}if(St.workerUrl!==e)throw new Error(`[contact-map] the tree session already loads its Worker from ${Gr(St.workerUrl)} and cannot also load it from ${Gr(e)}; give every contact-map view in the browser tab the same workerUrls.treeWorker, on every route (after changing it, reload the page)`);return St.session},cu=()=>{St?.session.reset(),St=null},Di={snapshot:null,isBuilding:!1};function Qr(e,t=!1){let n=Ge(),r=n.treeWorkerFactory,s=n.workerUrls?.treeWorker,{labels:a}=ye(),o=a.uncategorizedCompany,c=a.noName,l=Kr(()=>({uncategorizedCompany:o,unnamedPerson:c}),[o,c]),d=Pi(r);Ea(()=>{d.current=r},[r]);let m=r!==void 0,u=m?void 0:s,i=Kr(()=>m?new Vn(()=>Oi(d.current)(),{workerSource:"treeWorkerFactory"}):null,[m]),p=La(()=>i===null?Wi(u):i,[i,u]),h=La(v=>p().subscribe(v),[p]),C=La(()=>p().getState(),[p]);return Ea(()=>{let v=p();v.syncRecords(e,l),t&&v.finalize()},[p,e,t,l]),Ea(()=>{if(i!==null)return()=>i.stop()},[i]),Mi(h,C,()=>Di)}le();ma();Mn();import{Fragment as Ji,jsx as A,jsxs as me}from"react/jsx-runtime";var Da=An(en),Ui=en.listPanelMinWidth,$i=en.detailPanelMinWidth,Vi=en.handleThickness,Wu=Da.collapseThreshold,Du=Da.expandThreshold,Ki=(e,t)=>{let{searchQuery:n,enableHighlighting:r}=t,s=Ra(e.full_name,t.noName),a=Ra(e.title,""),o=A(ue,{text:s,query:n,enabled:r});return a?me("span",{className:"flex items-center gap-1.5",children:[A("span",{children:o}),A("span",{className:"text-slate-400 text-xs dark:text-slate-500",children:A(ue,{text:a,query:n,enabled:r})})]}):o},ji="contact-map-tree h-full w-full",qi={hoverClassName:"bg-slate-100/70 dark:bg-slate-800/60",directorySelectedClassName:"bg-sky-100/55 dark:bg-sky-900/40 [&_.directory-tree-name]:text-sky-700 dark:[&_.directory-tree-name]:text-sky-300",itemSelectedClassName:"bg-sky-100/70 dark:bg-sky-900/55 [&_.directory-tree-name]:text-sky-700 dark:[&_.directory-tree-name]:text-sky-300"},Oa="h-4 w-4 shrink-0 transition-colors duration-150",Gi=(e,t,n)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!n}}),jn=null,Xr=null,rn=new Map,Jr="",Zr=null,eo=null,Qi=(e,t,n,r,s)=>{let a=`${n?"icons":"plain"}#${r}#${s.noName}`;(a!==Jr||s.formatDirectoryName!==Zr||t!==eo)&&(rn.clear(),Jr=a,Zr=s.formatDirectoryName,eo=t);let o={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},c=new Set;for(let l of e){c.add(l.absolutePath);let d=`${l.name}\0${l.memberCount}`,m=rn.get(l.absolutePath);(!m||m.signature!==d)&&(m={signature:d,result:no([l],t,n,{searchQuery:"",enableHighlighting:!1,noName:s.noName,formatDirectoryName:s.formatDirectoryName})},rn.set(l.absolutePath,m));let u=m.result;u.entries.length>0&&o.entries.push(u.entries[0]);for(let[i,p]of u.personPathMap){let h=o.personPathMap.get(i);if(h)for(let C of p)h.add(C);else o.personPathMap.set(i,new Set(p))}for(let[i,p]of u.contactByPath)o.contactByPath.set(i,p);for(let[i,p]of u.ancestorsByPath)o.ancestorsByPath.set(i,p);o.totalCount+=u.totalCount,!o.firstPerson&&u.firstPerson&&(o.firstPerson=u.firstPerson)}for(let l of rn.keys())c.has(l)||rn.delete(l);return o},Wa=e=>e.isSelected||e.isItemSelected?"text-sky-600 dark:text-sky-300":e.isExpanded&&e.isDirectory?"text-slate-600 dark:text-slate-200":"text-slate-500 dark:text-slate-400",to=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...to(n.children)));return t},Yi=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},no=(e,t,n,r,s)=>{let a=new Map,o=new Map,c=new Map,l=0,d=null,m=(i,p)=>{let h=[...p,i.absolutePath];c.set(i.absolutePath,h);let C,v,k=i.type==="directory"?r.formatDirectoryName(i.name,Yi(i)):i.name,F=A(ue,{text:k,query:r.searchQuery,enabled:r.enableHighlighting});if(i.type==="file"&&i.personId){if(s&&!s.has(i.personId))return null;let T=t.get(i.personId);if(T){o.set(i.absolutePath,T),a.has(i.personId)||a.set(i.personId,new Set);let y=a.get(i.personId);y&&y.add(i.absolutePath),l++,d||(d={personId:i.personId,path:i.absolutePath}),n&&(v=g=>{let E=Wa(g);return g.isSelected||g.isItemSelected||i.isPrimary&&(E=i.title?"text-indigo-600 dark:text-indigo-400":"text-orange-500 dark:text-orange-400"),A(n.person,{"aria-hidden":"true",className:`${Oa} ${E}`})},i.title&&(F=Ki(T,r))),F=A("span",{"data-contact-path":i.absolutePath,className:"block w-full",children:F})}}else if(i.children){let T=i.children.map(y=>m(y,h)).filter(y=>y!==null);if(s&&T.length===0)return null;if(C=T,n){let y=i.relativePath.startsWith("company:")?n.company:n.department;v=g=>A(y,{"aria-hidden":"true",className:`${Oa} ${Wa(g)}`})}}return{name:k,label:F,type:i.type,absolutePath:i.absolutePath,relativePath:i.relativePath,icon:v,children:C}};return{entries:e.map(i=>m(i,[])).filter(i=>i!==null),personPathMap:a,contactByPath:o,ancestorsByPath:c,firstPerson:d,totalCount:l}},Xi=(e,t,n)=>{let r=new Set,s=new Set,a=new Map;t.forEach((m,u)=>{a.set(m.item.person_id,u)});for(let m of t){let u=m.item.person_id,i=e.personPathMap.get(u);if(i)for(let p of i){r.add(p);let h=e.ancestorsByPath.get(p);if(h){for(let C of h)r.add(C);n&&h.length>0&&s.add(h[0])}}}let o=new Map,c=m=>{let u=o.get(m.absolutePath);if(u!==void 0)return u;let i=1/0;if(m.type==="file"){let p=e.contactByPath.get(m.absolutePath);p&&(i=a.get(p.person_id)??1/0)}else if(m.children)for(let p of m.children)i=Math.min(i,c(p));return o.set(m.absolutePath,i),i},l=(m,u=0)=>m.filter(i=>n&&u===0&&s.has(i.absolutePath)?!0:r.has(i.absolutePath)).map(i=>n&&u===0&&s.has(i.absolutePath)?i:i.type==="directory"&&i.children?{...i,children:l(i.children,u+1)}:i).sort((i,p)=>u===0?c(i)-c(p):0),d=l(e.entries);return{...e,entries:d}},ao=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:r,filteredItems:s,hasSearchTerm:a,isSearchInProgress:o,isSearchTabActive:c}=e,{locale:l,labels:d,treeLabels:m}=ye(),u=d.noName,i=d.treeDirectoryName,p=Ee(()=>({noName:u,formatDirectoryName:i}),[u,i]),[h,C]=dt(null),[v,k]=dt(!1),{snapshot:F,isBuilding:T}=Qr(n,e.isStreamingComplete),y=F?.tree??null,g=F?.rebuildEpoch??0,E=Ee(()=>y?Qi(y,r,h,g,p):null,[y,r,h,g,p]),K=Ee(()=>{if(!y)return null;if(!a)return E;let R;v||(R=new Set(s.map(Y=>Y.item.person_id)));let $=no(y,r,h,{...p,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},R);return Xi($,s,v)},[y,E,r,h,e.searchQuery,e.enableHighlighting,a,s,v,p]),b=Ee(()=>K||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[K]),f=a&&e.errorMessage!==null,[x,O]=dt(b),W=Kn(!1);Tt(()=>{if(!(o||f)){W.current=!!y,O(b);return}!W.current&&y&&b.entries.length>0&&(W.current=!0,O(b))},[b,y,o,f]);let te=a&&(o||f)?x:b,{entries:w,personPathMap:N,contactByPath:H,totalCount:B}=te,re=Ee(()=>to(w),[w]),[pe,ie]=dt(()=>Xr??new Set),oe=Fe(R=>!pe.has(R),[pe]),ut=Fe(R=>{ie($=>{let Y=new Set($);return Y.has(R)?Y.delete(R):Y.add(R),Y})},[]),pt=Fe(R=>{R.length!==0&&ie($=>{let Y=new Set($);for(let Se of R)Y.add(Se);return Y})},[]),Ft=Fe(R=>{ie($=>{if($.size===0)return $;let Y=!1,Se=new Set($);for(let I of R)Se.delete(I)&&(Y=!0);return Y?Se:$})},[]);Tt(()=>{Xr=pe},[pe]),Tt(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[Ue,wt]=dt(null),[xe,Xe]=dt(null),[sn,$e]=dt(!1),[Gn,ln]=dt(!1),dn=Kn(null),zt=Kn(null),{normalizedViewportHeight:ne,panelSizingStyle:cn}=Ma(c,zt,dn),Je=Fe(R=>{let $=H.get(R);$&&(Ue!==$.person_id&&wt($.person_id),R!==xe&&Xe(R),$e(!0))},[H,xe,Ue]),Bt=Fe(R=>{Je(R.entry.absolutePath)},[Je]),Ze=Fe(R=>R instanceof Element?R.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:ve,popupItem:Ut,handleClosePopup:$t}=In({ref:zt,resolveItem:Ze,onSelect:Je}),We=Fe(R=>{if(!e.openEmailsWithGmail)return;let $=R.trim();if(!$||$==="-"||typeof window>"u")return;let Y=qe($,!0);Y&&window.open(Y,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),et=Ut?H.get(Ut):null,De=ve&&et!==null&&et!==void 0;Tt(()=>{ve&&!et&&$t()},[ve,et,$t]);let mt=Ee(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:Ii}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),tt=Ee(()=>Gi(mt,ne,De),[mt,ne,De]);Tt(()=>{let R=!1;return typeof window>"u"?()=>{R=!0}:jn?(C(jn),()=>{R=!0}):((async()=>{try{let[Y,Se,I,U]=await Promise.all([import("lucide-react/dist/esm/icons/building-2.js"),import("lucide-react/dist/esm/icons/users-round.js"),import("lucide-react/dist/esm/icons/id-card.js"),import("lucide-react/dist/esm/icons/user-round.js")]);if(R)return;let de=Y.default,He=Se.default,Jn=I.default,Ka=U.default;de&&He&&Jn&&Ka&&(jn={company:de,department:He,title:Jn,person:Ka},C(jn))}catch(Y){Ie.warn("Failed to load lucide icons",Y)}})(),()=>{R=!0})},[]);let gt=Ee(()=>{if(!h)return;let R=U=>de=>A(U,{"aria-hidden":"true",className:`${Oa} ${Wa(de)}`}),$={company:R(h.company),department:R(h.department),title:R(h.title)},Y=R(h.person),Se=U=>U in $,I=U=>{let[de]=U.entry.relativePath.split(":",1);return(Se(de)?$[de]:$.company)(U)};return{directory:I,directoryExpanded:I,file:Y}},[h]),Nt=Fe(()=>{ie(R=>R.size===0?R:new Set)},[]),Qn=Fe(()=>{re.length>0&&pt(re)},[re,pt]);Tt(()=>{if(typeof window>"u")return;let R=document.documentElement,$=window.matchMedia("(prefers-color-scheme: dark)"),Y=()=>ln(R.classList.contains("dark")||$.matches);Y(),$.addEventListener("change",Y);let Se=new MutationObserver(Y);return Se.observe(R,{attributes:!0,attributeFilter:["class"]}),()=>{$.removeEventListener("change",Y),Se.disconnect()}},[]),Tt(()=>{if(B===0){Ue!==null&&wt(null),xe!==null&&Xe(null);return}if(Ue!==null){let R=N.get(Ue);if(R){if(xe&&R.has(xe))return;let $=R.values().next().value;$&&Xe($);return}}Ue!==null&&wt(null),xe!==null&&Xe(null)},[B,Ue,xe,N]);let nt=xe?H.get(xe)??null:null,Ve=Gn?"#475569":"#94A3B8",Vt=e.isStreamingComplete,Yn=e.isStreamingFailed,un=Vt&&n.length===0,pn=(T||!y)&&!un,mn=Vr(B,250),at=y!==null||un,Pt=me("div",{className:"flex items-center gap-1.5",children:[me("span",{className:"inline-flex h-5 items-center gap-1 rounded bg-slate-100 px-1.5 font-medium font-mono text-[10px] text-slate-700 dark:bg-slate-800 dark:text-slate-200",title:d.treeNodeCountTitle,children:[A("span",{className:"text-[10px]",children:"\u{1F333}"})," ",d.treeNodeCountLabel," ",at?d.treeNodeCount(mn):"\u2026"]}),Yn&&!Vt?me("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-rose-200 bg-rose-50 px-1.5 font-medium text-[10px] text-rose-700 dark:border-rose-800 dark:bg-rose-950/60 dark:text-rose-300",title:d.treeStreamInterruptedTitle,children:[A("span",{className:"h-1.5 w-1.5 rounded-full bg-rose-500"}),A("span",{className:"text-[10px]",children:"\u26D4"})," ",d.treeStreamInterrupted]}):Vt?pn?me("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-amber-200 bg-amber-50 px-1.5 font-medium text-[10px] text-amber-700 dark:border-amber-800 dark:bg-amber-950/60 dark:text-amber-300",title:d.treeBuildingTitle,children:[me("span",{className:"relative flex h-1.5 w-1.5",children:[A("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-amber-400 opacity-75"}),A("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-amber-500"})]}),A("span",{className:"text-[10px]",children:"\u{1F33F}"})," ",d.treeBuilding]}):me("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-emerald-200 bg-emerald-50 px-1.5 font-medium text-[10px] text-emerald-700 dark:border-emerald-800 dark:bg-emerald-950/60 dark:text-emerald-300",title:d.treeCompleteTitle,children:[A("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500"}),A("span",{className:"text-[10px]",children:"\u2705"})," ",d.treeComplete]}):me("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-sky-200 bg-sky-50 px-1.5 font-medium text-[10px] text-sky-700 dark:border-sky-800 dark:bg-sky-950/60 dark:text-sky-300",title:d.treeStreamLoadingTitle,children:[me("span",{className:"relative flex h-1.5 w-1.5",children:[A("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-sky-400 opacity-75"}),A("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-sky-500"})]}),A("span",{className:"text-[10px]",children:"\u23F3"})," ",d.treeStreamLoading]}),a&&me("button",{type:"button",onClick:()=>k(!v),className:`inline-flex h-5 items-center rounded px-1.5 text-[10px] transition-colors ${v?"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300":"text-slate-500 hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-slate-800"}`,title:d.treeShowEntireCompanyTitle,children:[A("span",{className:"text-[10px]",children:"\u{1F3E2}"})," ",d.treeShowEntireCompany]}),re.length>0?me("div",{className:"flex items-center gap-1",children:[A("button",{type:"button",onClick:Nt,className:"inline-flex h-5 w-5 items-center justify-center rounded border border-slate-300 bg-white text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-100","aria-label":d.treeExpandAll,title:d.treeExpandAllTitle,children:A(zi,{className:"h-3 w-3"})}),A("button",{type:"button",onClick:Qn,className:"inline-flex h-5 w-5 items-center justify-center rounded border border-slate-300 bg-white text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-100","aria-label":d.treeCollapseAll,title:d.treeCollapseAllTitle,children:A(Fi,{className:"h-3 w-3"})})]}):null]}),gn=Kn(null),{isTwoColumn:hn}=Fn(gn,Da,{mediaQuery:"(min-width: 768px)"}),fn=Ee(()=>({toggle:ut,isExpanded:oe,expandMultiple:Ft,collapseMultiple:pt,isPending:o}),[pt,Ft,oe,ut,o]),yn=Ee(()=>({onEntryClick:Bt,selectedPath:xe}),[Bt,xe]),Xn=Ee(()=>({className:ji,lineColor:Ve,iconOverrides:gt,showDirectoryIcons:!!gt,showFileIcons:!!gt,highlightStyles:qi,entryClassName:"rounded-md px-1 py-0.5",nameClassName:"text-xs tracking-tight",directoryNameClassName:"font-normal text-slate-800 dark:text-slate-100",fileNameClassName:"text-slate-700 dark:text-slate-200"}),[Ve,gt]),Kt=A("div",{ref:dn,className:"flex min-h-0 flex-1 flex-col rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",children:A("div",{ref:zt,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:w.length>0?A(Hi,{entries:w,expansion:fn,selection:yn,visual:Xn,virtualScroll:tt,locale:l,labels:m}):A("div",{className:"flex h-full w-full items-center justify-center rounded-lg border border-slate-300 border-dashed bg-white/70 px-6 text-center text-slate-500 text-sm transition-colors dark:border-slate-700 dark:bg-slate-900/50 dark:text-slate-300",children:a?d.treeNoMatches:d.treeEmpty})})});return me("div",{ref:gn,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:cn,children:[t&&Bi(Pt,t),hn?me(_i,{id:"contact-map-tree-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-tree-panel-group",children:[A(Yr,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:Ui,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:Kt}),A(Ai,{id:"contact-map-tree-handle",thickness:Vi,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:"cursor-col-resize rounded transition-colors hover:bg-slate-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 dark:hover:bg-slate-700/60","aria-label":d.treeResizeHandle}),A(Yr,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:$i,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:A(ot,{contact:nt??null,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):me(Ji,{children:[Kt,A("div",{className:"hidden","aria-hidden":"true",children:A(ot,{contact:nt,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}),sn&&nt?A(zn,{isOpen:sn,onClose:()=>$e(!1),className:"z-50 bg-white dark:bg-slate-900",children:me("div",{className:"flex h-full flex-col overflow-hidden p-3 sm:p-4",children:[me("div",{className:"mb-2 flex items-center justify-between border-b pr-10 pb-2 dark:border-slate-700",children:[A("h3",{className:"font-semibold text-slate-900 text-sm dark:text-slate-100",children:d.detailHeading}),A("button",{type:"button",onClick:()=>$e(!1),className:"rounded px-2.5 py-1 font-medium text-slate-600 text-xs hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800",children:d.close})]}),A("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",style:{height:"100%"},children:A(ot,{contact:nt,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]})}):null]}),De&&et&&A(Tn,{contactData:et,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:We,onRequestClose:$t})]})};import{jsx as on,jsxs as Dt}from"react/jsx-runtime";var Ha="view",nl={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},al=e=>e==="tree"?"tree":"list",ro=({context:e})=>{let t=G(),[n,r]=tl(),[s,a]=el(null),o=al(n.get(Ha)),{setScrollableRef:c,onPointerDown:l,onPointerMove:d,onPointerUp:m,onPointerLeave:u,onPointerCancel:i,onClickCapture:p}=it(),h=Zi(C=>{let v=C==="tree"?"tree":"list";if(v===o)return;let k=new URLSearchParams(typeof window<"u"?window.location.search:"");v==="list"?k.delete(Ha):k.set(Ha,v),r(k,{replace:!0})},[o,r]);return Dt("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[Dt("div",{className:"mt-1 mb-1.5 flex shrink-0 items-center gap-2",children:[Dt("div",{ref:c,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-lg bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:nl,onPointerDown:l,onPointerMove:d,onPointerUp:m,onPointerLeave:u,onPointerCancel:i,onClickCapture:p,children:[Dt("button",{type:"button","data-testid":"contact-map-tab-list",onClick:()=>h("list"),className:`rounded px-2 py-0.5 text-xs transition-colors ${o==="list"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4C4} ",t.listViewTab]}),Dt("button",{type:"button","data-testid":"contact-map-tab-tree",onClick:()=>h("tree"),className:`rounded px-2 py-0.5 text-xs transition-colors ${o==="tree"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F333} ",t.treeViewTab]})]}),on("div",{ref:a,className:"flex items-center gap-1.5"})]}),Dt("div",{className:"flex h-full flex-1 flex-col",children:[on("div",{className:`${o==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:o==="list"?on($r,{context:e}):null}),on("div",{className:`${o==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:o==="tree"?on(ao,{context:e,controlsContainer:s}):null})]})]})};import{DEFAULT_FUZZY_SEARCH_OPTIONS as za}from"@aiquants/fuzzy-search";import{memo as sl}from"react";le();le();import{DEFAULT_FUZZY_SEARCH_OPTIONS as z}from"@aiquants/fuzzy-search";import{memo as rl,useId as ke}from"react";import{jsx as L,jsxs as D}from"react/jsx-runtime";var _a=1e3,Aa=rl(({searchOptions:e,setSearchOptions:t})=>{let n=G(),r="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",a=e.sortBy==="relevance",o=ke(),c=ke(),l=ke(),d=ke(),m=ke(),u=ke(),i=ke(),p=ke(),h=ke(),C=ke(),v=ke(),k=[];k.push(D("div",{className:`${r} border-green-200 border-l-4 dark:border-green-400/60`,children:[D("div",{className:`${s} text-green-700 dark:text-green-300`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),D("div",{className:"space-y-2",children:[L("label",{htmlFor:o,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexNgramSize}),L("input",{id:o,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||z.ngramSize,onChange:y=>t(g=>({...g,ngramSize:parseInt(y.target.value,10)})),className:"w-full"}),D("span",{className:"text-green-600 text-xs dark:text-green-300",children:[n.currentValueLabel," ",e.ngramSize||z.ngramSize]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexNgramSizeHint})]}),D("div",{className:"space-y-2",children:[L("label",{htmlFor:c,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexMinNgramOverlap}),L("input",{id:c,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||z.minNgramOverlap,onChange:y=>t(g=>({...g,minNgramOverlap:parseInt(y.target.value,10)})),className:"w-full"}),D("span",{className:"text-green-600 text-xs dark:text-green-300",children:[n.currentValueLabel," ",e.minNgramOverlap||z.minNgramOverlap]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMinNgramOverlapHint})]})]},"index-build")),k.push(D("div",{className:`${r} border-blue-200 border-l-4 dark:border-blue-500/60`,children:[D("div",{className:`${s} text-blue-700 dark:text-blue-300`,children:["\u{1F50D} ",n.indexCandidateHeading]}),D("div",{className:"space-y-2",children:[L("label",{htmlFor:l,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexThreshold}),L("input",{id:l,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??z.indexWorkerOptions?.threshold,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,threshold:parseFloat(y.target.value)}})),className:"w-full"}),D("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.threshold??z.indexWorkerOptions?.threshold]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexThresholdHint})]}),D("div",{className:"space-y-2",children:[L("label",{htmlFor:m,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexNgramOverlapThreshold}),L("input",{id:m,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??z.indexWorkerOptions?.ngramOverlapThreshold,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,ngramOverlapThreshold:parseFloat(y.target.value)}})),className:"w-full"}),D("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??z.indexWorkerOptions?.ngramOverlapThreshold]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexNgramOverlapThresholdHint})]})]},"candidate-control")),k.push(D("div",{className:`${r} border-cyan-200 border-l-4 dark:border-cyan-400/60`,children:[D("div",{className:`${s} text-cyan-700 dark:text-cyan-300`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),D("div",{className:"space-y-2",children:[L("label",{htmlFor:d,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexStrategy}),D("select",{id:d,value:e.indexWorkerOptions?.strategy??z.indexWorkerOptions?.strategy??"hybrid",onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,strategy:y.target.value}})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[L("option",{value:"fast",children:n.indexStrategyFast}),L("option",{value:"accurate",children:n.indexStrategyAccurate}),L("option",{value:"hybrid",children:n.indexStrategyHybrid})]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexStrategyHint})]}),D("div",{className:"space-y-2",children:[L("label",{htmlFor:u,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexMinCandidatesRatio}),L("input",{id:u,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??z.indexWorkerOptions?.minCandidatesRatio,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,minCandidatesRatio:parseFloat(y.target.value)}})),className:"w-full"}),D("span",{className:"text-cyan-600 text-xs dark:text-cyan-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??z.indexWorkerOptions?.minCandidatesRatio]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMinCandidatesRatioHint})]}),D("div",{className:"space-y-2",children:[L("label",{htmlFor:i,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexMaxCandidatesRatio}),L("input",{id:i,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??z.indexWorkerOptions?.maxCandidatesRatio,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxCandidatesRatio:parseFloat(y.target.value)}})),className:"w-full"}),D("span",{className:"text-cyan-600 text-xs dark:text-cyan-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??z.indexWorkerOptions?.maxCandidatesRatio]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMaxCandidatesRatioHint})]})]},"strategy")),k.push(D("div",{className:`${r} border-indigo-200 border-l-4 dark:border-indigo-500/60`,children:[D("div",{className:`${s} text-indigo-700 dark:text-indigo-300`,children:["\u{1F521} ",n.scoreTuningHeading]}),D("div",{className:"space-y-2",children:[L("label",{htmlFor:p,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexJaroWinklerPrefix}),L("input",{id:p,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??z.indexWorkerOptions?.jaroWinklerPrefix,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,jaroWinklerPrefix:parseFloat(y.target.value)}})),className:"w-full"}),D("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??z.indexWorkerOptions?.jaroWinklerPrefix]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexJaroWinklerPrefixHint})]}),D("div",{className:"space-y-2",children:[L("label",{htmlFor:h,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.maxResults}),D("label",{className:"flex items-center gap-2 text-[11px] text-gray-600 dark:text-slate-300",children:[L("input",{type:"checkbox",checked:e.indexWorkerOptions?.maxResults===void 0,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxResults:y.target.checked?void 0:_a}}))}),n.noLimit]}),L("input",{id:h,type:"range",min:_a,max:"10000",step:"1000",disabled:e.indexWorkerOptions?.maxResults===void 0,value:e.indexWorkerOptions?.maxResults===void 0?_a:e.indexWorkerOptions.maxResults,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxResults:parseInt(y.target.value,10)}})),className:"w-full disabled:cursor-not-allowed"}),D("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxResults===void 0?n.noLimit:e.indexWorkerOptions.maxResults]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMaxResultsHint})]})]},"jaro")),k.push(D("div",{className:`${r} border-emerald-200 border-l-4 ${a?"":"opacity-50"} dark:border-emerald-400/60`,children:[D("div",{className:`${s} text-emerald-700 dark:text-emerald-300`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),D("div",{className:"space-y-2",children:[L("label",{htmlFor:C,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.fieldWeight}),L("input",{id:C,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??z.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevanceFieldWeight:parseFloat(y.target.value)}})),disabled:!a,className:"w-full disabled:cursor-not-allowed"}),D("span",{className:"text-emerald-600 text-xs dark:text-emerald-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??z.indexWorkerOptions?.relevanceFieldWeight??.2]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexFieldWeightHint})]}),D("div",{className:"space-y-2",children:[L("label",{htmlFor:v,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexPerfectMatchBonus}),L("input",{id:v,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??z.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(y.target.value)}})),disabled:!a,className:"w-full disabled:cursor-not-allowed"}),D("span",{className:"text-emerald-600 text-xs dark:text-emerald-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??z.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexPerfectMatchBonusHint})]}),!a&&L("p",{className:"text-[11px] text-emerald-600 dark:text-emerald-300",children:n.relevanceOnlyNotice})]},"relevance"));let F=ke(),T=ke();return k.push(D("div",{className:`${r} border-teal-200 border-l-4 dark:border-teal-400/60`,children:[D("div",{className:`${s} text-teal-700 dark:text-teal-300`,children:["\u{1F524} ",n.indexContainmentHeading]}),D("div",{className:"space-y-2",children:[L("label",{htmlFor:F,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexContainmentBase}),L("input",{id:F,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??z.indexWorkerOptions?.containmentScoreBase??.7,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentScoreBase:parseFloat(y.target.value)}})),className:"w-full"}),D("span",{className:"text-teal-600 text-xs dark:text-teal-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??z.indexWorkerOptions?.containmentScoreBase??.7]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexContainmentBaseHint})]}),D("div",{className:"space-y-2",children:[L("label",{htmlFor:T,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexContainmentCoverage}),L("input",{id:T,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??z.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentCoverageWeight:parseFloat(y.target.value)}})),className:"w-full"}),D("span",{className:"text-teal-600 text-xs dark:text-teal-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??z.indexWorkerOptions?.containmentCoverageWeight??.3]}),L("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexContainmentCoverageHint})]})]},"containment")),D("section",{className:"space-y-3",children:[D("div",{className:"flex items-center justify-between gap-3",children:[D("div",{className:"flex items-center gap-2 font-semibold text-green-700 text-xs transition-colors dark:text-green-300",children:[L("span",{children:"\u{1F4CA}"}),L("span",{className:"tracking-wide",children:n.indexSettingsHeading})]}),L("button",{type:"button",onClick:()=>t(y=>({...y,indexWorkerOptions:{threshold:z.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:z.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:z.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:z.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:z.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:void 0,relevanceFieldWeight:z.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:z.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:z.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:z.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:z.indexWorkerOptions?.strategy},ngramSize:z.ngramSize,minNgramOverlap:z.minNgramOverlap})),className:"rounded border border-green-300 bg-green-100 px-2 py-1 font-medium text-green-700 text-xs transition-colors hover:bg-green-200 dark:border-green-400/60 dark:bg-green-900/20 dark:text-green-200 dark:hover:bg-green-800/30",title:n.resetToDefaultsTitle,children:n.reset})]}),L("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:k})]})});Aa.displayName="IndexWorkerSettings";le();import{DEFAULT_FUZZY_SEARCH_OPTIONS as he}from"@aiquants/fuzzy-search";import{memo as ol,useId as Ht}from"react";import{jsx as ee,jsxs as ae}from"react/jsx-runtime";var Ia=1e3,Fa=ol(({searchOptions:e,setSearchOptions:t})=>{let n=G(),r="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",a=e.sortBy==="relevance",o=Ht(),c=Ht(),l=Ht(),d=Ht(),m=Ht(),u=Ht(),i=[];return i.push(ae("div",{className:`${r} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[ae("div",{className:`${s} text-purple-700 dark:text-purple-300`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),ae("div",{className:"space-y-2",children:[ee("label",{htmlFor:o,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinThreshold}),ee("input",{id:o,type:"range",min:"0.0",max:a?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??he.levenshteinWorkerOptions?.threshold,onChange:p=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,threshold:parseFloat(p.target.value)}})),className:"w-full"}),ae("span",{className:"text-purple-600 text-xs dark:text-purple-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??he.levenshteinWorkerOptions?.threshold]}),ee("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),ae("div",{className:"space-y-2",children:[ee("label",{htmlFor:c,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinLengthSimilarity}),ee("input",{id:c,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??he.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:p=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(p.target.value)}})),className:"w-full"}),ae("span",{className:"text-purple-600 text-xs dark:text-purple-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??he.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),ee("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),i.push(ae("div",{className:`${r} border-pink-200 border-l-4 dark:border-pink-400/60`,children:[ae("div",{className:`${s} text-pink-700 dark:text-pink-300`,children:["\u{1FA84} ",n.scoreTuningHeading]}),ae("div",{className:"space-y-2",children:[ee("label",{htmlFor:l,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinLengthPenalty}),ee("input",{id:l,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??he.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:p=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(p.target.value)}})),className:"w-full"}),ae("span",{className:"text-pink-600 text-xs dark:text-pink-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??he.levenshteinWorkerOptions?.lengthDiffPenalty]}),ee("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),i.push(ae("div",{className:`${r} border-violet-200 border-l-4 dark:border-violet-400/60`,children:[ae("div",{className:`${s} text-violet-700 dark:text-violet-300`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),ee("label",{htmlFor:d,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.maxResults}),ae("label",{className:"flex items-center gap-2 text-[11px] text-gray-600 dark:text-slate-300",children:[ee("input",{type:"checkbox",checked:e.levenshteinWorkerOptions?.maxResults===void 0,onChange:p=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,maxResults:p.target.checked?void 0:Ia}}))}),n.noLimit]}),ee("input",{id:d,type:"range",min:Ia,max:"10000",step:"1000",disabled:e.levenshteinWorkerOptions?.maxResults===void 0,value:e.levenshteinWorkerOptions?.maxResults===void 0?Ia:e.levenshteinWorkerOptions.maxResults,onChange:p=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,maxResults:parseInt(p.target.value,10)}})),className:"w-full disabled:cursor-not-allowed"}),ae("span",{className:"text-violet-600 text-xs dark:text-violet-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),ee("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinMaxResultsHint})]},"max-results")),i.push(ae("div",{className:`${r} border-rose-200 border-l-4 ${a?"":"opacity-50"} dark:border-rose-400/60`,children:[ae("div",{className:`${s} text-rose-700 dark:text-rose-300`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),ae("div",{className:"space-y-2",children:[ee("label",{htmlFor:m,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.fieldWeight}),ee("input",{id:m,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??he.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:p=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(p.target.value)}})),disabled:!a,className:"w-full disabled:cursor-not-allowed"}),ae("span",{className:"text-rose-600 text-xs dark:text-rose-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??he.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),ee("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinFieldWeightHint})]}),ae("div",{className:"space-y-2",children:[ee("label",{htmlFor:u,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinPartialBonus}),ee("input",{id:u,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??he.levenshteinWorkerOptions?.partialMatchBonus,onChange:p=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,partialMatchBonus:parseFloat(p.target.value)}})),disabled:!a,className:"w-full disabled:cursor-not-allowed"}),ae("span",{className:"text-rose-600 text-xs dark:text-rose-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??he.levenshteinWorkerOptions?.partialMatchBonus]}),ee("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinPartialBonusHint})]}),!a&&ee("p",{className:"text-[11px] text-rose-600 dark:text-rose-300",children:n.relevanceOnlyNotice})]},"relevance")),ae("section",{className:"space-y-3",children:[ae("div",{className:"flex items-center justify-between gap-3",children:[ae("div",{className:"flex items-center gap-2 font-semibold text-purple-700 text-xs transition-colors dark:text-purple-300",children:[ee("span",{children:"\u{1F4CF}"}),ee("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),ee("button",{type:"button",onClick:()=>t(p=>({...p,levenshteinWorkerOptions:{threshold:he.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:he.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:he.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:he.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:void 0,relevanceFieldWeight:he.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:"rounded border border-purple-300 bg-purple-100 px-2 py-1 font-medium text-purple-700 text-xs transition-colors hover:bg-purple-200 dark:border-purple-400/60 dark:bg-purple-900/20 dark:text-purple-200 dark:hover:bg-purple-800/30",title:n.resetToDefaultsTitle,children:n.reset})]}),ee("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:i})]})});Fa.displayName="LevenshteinWorkerSettings";import{jsx as Be,jsxs as ze}from"react/jsx-runtime";var il={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ba=sl(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:s,setOpenEmailsWithGmail:a,activeTab:o,onTabChange:c})=>{let l=G(),{setScrollableRef:d,onPointerDown:m,onPointerMove:u,onPointerUp:i,onPointerLeave:p,onPointerCancel:h,onClickCapture:C}=it();return ze("div",{className:"wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border border-blue-300 bg-white p-1.5 shadow-md transition-colors dark:border-blue-500/40 dark:bg-slate-900/80 dark:shadow-blue-900/30",children:[ze("div",{className:"mb-0.5 flex shrink-0 flex-col gap-1 rounded bg-blue-50 px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between dark:bg-blue-900/30",children:[ze("h3",{className:"font-semibold text-gray-700 text-xs transition-colors dark:text-slate-100",children:["\u2699\uFE0F ",l.searchSettings]}),Be("div",{className:"flex flex-wrap gap-1.5",children:ze("button",{type:"button",onClick:()=>t(v=>({...za,autoSearchOnIndexRebuild:!1,debounceMs:0,workerUrls:v.workerUrls,indexWorkerOptions:{...za.indexWorkerOptions},levenshteinWorkerOptions:{...za.levenshteinWorkerOptions}})),className:"rounded bg-red-500 px-1.5 py-0.5 text-[10px] text-white transition-colors hover:bg-red-600 dark:hover:bg-red-700",title:l.settingsResetAllTitle,children:["\u{1F504} ",l.settingsResetAll]})})]}),Be("div",{className:"mb-0 shrink-0",children:ze("div",{ref:d,role:"tablist","aria-label":l.settingsTabsLabel,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-md bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:il,onPointerDown:m,onPointerMove:u,onPointerUp:i,onPointerLeave:p,onPointerCancel:h,onClickCapture:C,children:[ze("button",{type:"button",role:"tab","aria-selected":o==="basic",onClick:()=>c("basic"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${o==="basic"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F527} ",l.settingsBasicTab]}),ze("button",{type:"button",role:"tab","aria-selected":o==="advanced",onClick:()=>c("advanced"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${o==="advanced"?"bg-orange-500 text-white dark:bg-orange-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u26A1 ",l.settingsAdvancedTab]}),ze("button",{type:"button",role:"tab","aria-selected":o==="index",onClick:()=>c("index"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${o==="index"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CA} ",l.indexWorkerName]}),ze("button",{type:"button",role:"tab","aria-selected":o==="levenshtein",onClick:()=>c("levenshtein"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${o==="levenshtein"?"bg-purple-500 text-white dark:bg-purple-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CF} ",l.levenshteinWorkerName]})]})}),ze("div",{className:"flex flex-col gap-1",children:[Be("div",{className:`${o==="basic"?"block":"hidden"}`,children:Be(la,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:s,setOpenEmailsWithGmail:a})}),Be("div",{className:`${o==="advanced"?"block":"hidden"}`,children:Be(ia,{searchOptions:e,setSearchOptions:t})}),Be("div",{className:`${o==="index"?"block":"hidden"}`,children:Be(Aa,{searchOptions:e,setSearchOptions:t})}),Be("div",{className:`${o==="levenshtein"?"block":"hidden"}`,children:Be(Fa,{searchOptions:e,setSearchOptions:t})})]})]})});Ba.displayName="SearchOptionsPanel";import{memo as cl,useCallback as ul}from"react";ft();le();import{memo as ll}from"react";import{jsxs as Ua}from"react/jsx-runtime";var M=ll(({label:e,value:t,unit:n,color:r="text-gray-600 dark:text-slate-300"})=>Ua("div",{className:"wrap-break-word flex min-w-0 flex-col overflow-hidden text-gray-700 transition-colors sm:flex-row sm:justify-between dark:text-slate-200",children:[Ua("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),Ua("span",{className:`font-medium ${r} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,n]})]}));M.displayName="StatItem";bt();ft();le();import{memo as dl}from"react";import{jsx as S,jsxs as V}from"react/jsx-runtime";var _t=dl(({kind:e,icon:t,stats:n,color:r})=>{let{locale:s,labels:a}=ye(),o=N=>q(s,N);if(!n)return S("section",{className:"rounded-lg border border-gray-200 border-dashed bg-white/40 p-3 text-gray-400 text-xs transition-colors dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-400",children:a.statsNoData});let c=n.basic||{},l=n.workerSpecific||{},d=n.analysis||{},m=c.totalSearches??0,u=c.totalProcessingTime??0,i=c.averageSearchTime??0,p=c.lastSearchTime??0,h=c.errorCount??0,C=c.timestamp,v=d.fieldPerformance||{},k=d.performanceInsights||{},F=d.recentHistory||[],T=l.specificMetrics||{},y=l.operationCount??0,g=l.operationDistribution||{},E=e==="index",K=e==="levenshtein",b=E?a.indexWorkerName:a.levenshteinWorkerName,f=T,x=T,O="flex flex-col gap-1 rounded-lg border border-gray-200 bg-white/80 p-3 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",W="text-xs font-semibold transition-colors",te=N=>{if(N)return Pe(N)},w=[];if(w.push(V("div",{className:`${O} border-blue-200 border-l-4 dark:border-blue-500/60`,children:[V("div",{className:`${W} ${r}`,children:["\u{1F4CA} ",a.statsBasicHeading]}),S(M,{label:a.statTotalSearches,value:o(m),color:r}),S(M,{label:a.statAverageSearchTime,value:i.toFixed(2),unit:"ms",color:r}),S(M,{label:a.statTotalProcessingTime,value:u.toFixed(2),unit:"ms",color:r}),S(M,{label:a.statLastSearchTime,value:p.toFixed(2),unit:"ms",color:r}),S(M,{label:a.statErrorCount,value:h,color:h>0?"text-red-600 dark:text-red-400":r}),te(C)&&S(M,{label:a.statUpdatedAt,value:te(C),color:"text-gray-500 dark:text-slate-400"})]},"basic")),y>0||Object.keys(g).length>0){let N=Object.entries(g).sort(([,H],[,B])=>(Number(B)||0)-(Number(H)||0)).slice(0,6);w.push(V("div",{className:`${O} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[V("div",{className:`${W} text-amber-600 dark:text-amber-300`,children:["\u{1F527} ",a.statsOperationsHeading]}),S(M,{label:a.statTotalOperations,value:o(y),color:"text-amber-700 dark:text-amber-300"}),N.length>0&&S("div",{className:"mt-1 space-y-1",children:N.map(([H,B])=>S(M,{label:H,value:o(Number(B)),unit:a.timesUnit(o(Number(B))),color:"text-amber-700 dark:text-amber-300"},H))})]},"operations"))}if(E&&(w.push(V("div",{className:`${O} border-green-200 border-l-4 dark:border-green-400/60`,children:[V("div",{className:`${W} text-green-700 dark:text-green-300`,children:["\u{1F3D7}\uFE0F ",a.statsIndexHeading]}),S(M,{label:a.statIndexBuilds,value:o(f.totalIndexBuilds??0),color:"text-green-700 dark:text-green-300"}),S(M,{label:a.statDataSize,value:o(f.currentDataSize??0),unit:a.itemsUnit(o(f.currentDataSize??0)),color:"text-green-700 dark:text-green-300"}),S(M,{label:a.statLastBuildTime,value:(f.lastIndexTime??0).toFixed(2),unit:"ms",color:"text-green-700 dark:text-green-300"})]},"index-core")),f.cacheSize&&w.push(V("div",{className:`${O} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[V("div",{className:`${W} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4BE} ",a.statsCacheHeading]}),S(M,{label:a.statCacheNgram,value:o(f.cacheSize.ngram??0),color:"text-emerald-700 dark:text-emerald-300"}),S(M,{label:a.statCacheWord,value:o(f.cacheSize.word??0),color:"text-emerald-700 dark:text-emerald-300"}),S(M,{label:a.statCachePhonetic,value:o(f.cacheSize.phonetic??0),color:"text-emerald-700 dark:text-emerald-300"})]},"index-cache")),f.indexMetadata)){let N=Object.entries(f.indexMetadata).slice(0,6);N.length>0&&w.push(V("div",{className:`${O} border-teal-200 border-l-4 dark:border-teal-400/60`,children:[V("div",{className:`${W} text-teal-700 dark:text-teal-300`,children:["\u{1F4CB} ",a.statsIndexMetadataHeading]}),N.map(([H,B])=>{let re;if(typeof B=="number"){let pe=H.toLowerCase();pe.includes("time")&&!pe.includes("timestamp")?re=`${B.toFixed(2)}ms`:pe.includes("timestamp")||pe.includes("at")?re=te(B)??B.toString():re=o(B)}else re=String(B);return S(M,{label:H,value:re,color:"text-teal-700 dark:text-teal-300"},H)})]},"index-meta"))}if(K){if(w.push(V("div",{className:`${O} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[V("div",{className:`${W} text-purple-700 dark:text-purple-300`,children:["\u{1F522} ",a.statsCalculationsHeading]}),S(M,{label:a.statTotalCalculations,value:o(x.totalCalculations??0),color:"text-purple-700 dark:text-purple-300"}),S(M,{label:a.statDistanceCalculations,value:o(x.totalDistanceCalculations??0),color:"text-purple-700 dark:text-purple-300"}),S(M,{label:a.statAverageDistance,value:typeof x.averageDistance=="number"?x.averageDistance.toFixed(2):"0.00",color:"text-purple-700 dark:text-purple-300"}),S(M,{label:a.statMinDistance,value:x.minDistance??a.notAvailable,color:"text-purple-700 dark:text-purple-300"}),S(M,{label:a.statMaxDistance,value:x.maxDistance??0,color:"text-purple-700 dark:text-purple-300"})]},"lev-basic")),w.push(V("div",{className:`${O} border-fuchsia-200 border-l-4 dark:border-fuchsia-400/60`,children:[V("div",{className:`${W} text-fuchsia-700 dark:text-fuchsia-300`,children:["\u{1F3AF} ",a.statsMatchesHeading]}),S(M,{label:a.statPartialMatches,value:o(x.partialMatches??0),color:"text-fuchsia-700 dark:text-fuchsia-300"}),S(M,{label:a.statPerfectMatches,value:o(x.perfectMatches??0),color:"text-fuchsia-700 dark:text-fuchsia-300"}),S(M,{label:a.statEarlyTerminations,value:o(x.earlyTerminations??0),color:"text-fuchsia-700 dark:text-fuchsia-300"})]},"lev-match")),x.similarityThresholds&&w.push(V("div",{className:`${O} border-rose-200 border-l-4 dark:border-rose-400/60`,children:[V("div",{className:`${W} text-rose-700 dark:text-rose-300`,children:["\u{1F4C8} ",a.statsSimilarityHeading]}),S(M,{label:a.statAbove80,value:o(x.similarityThresholds.above80??0),color:"text-emerald-700 dark:text-emerald-300"}),S(M,{label:a.statAbove60,value:o(x.similarityThresholds.above60??0),color:"text-lime-700 dark:text-lime-300"}),S(M,{label:a.statAbove40,value:o(x.similarityThresholds.above40??0),color:"text-orange-600 dark:text-orange-300"}),S(M,{label:a.statBelow40,value:o(x.similarityThresholds.below40??0),color:"text-red-600 dark:text-red-400"})]},"lev-similarity")),x.distanceDistribution){let N=Object.entries(x.distanceDistribution).sort(([,H],[,B])=>Number(B)-Number(H)).slice(0,6);N.length>0&&w.push(V("div",{className:`${O} border-indigo-200 border-l-4 dark:border-indigo-500/60`,children:[V("div",{className:`${W} text-indigo-700 dark:text-indigo-300`,children:["\u{1F4CA} ",a.statsDistanceHeading]}),N.map(([H,B])=>S(M,{label:a.statDistance(H),value:o(Number(B)),unit:a.timesUnit(o(Number(B))),color:"text-indigo-700 dark:text-indigo-300"},H))]},"lev-distance"))}if(x.queryLengthStats){let N=Object.entries(x.queryLengthStats).sort(([,H],[,B])=>(B.count??0)-(H.count??0)).slice(0,6);N.length>0&&w.push(V("div",{className:`${O} border-violet-200 border-l-4 dark:border-violet-400/60`,children:[V("div",{className:`${W} text-violet-700 dark:text-violet-300`,children:["\u{1F4CF} ",a.statsQueryLengthHeading]}),N.map(([H,B])=>{let re=Number(B.count??0),pe=Number(B.averageScore??0);return S(M,{label:a.statQueryLength(H),value:a.statQueryLengthValue({count:re,averagePercent:(pe*100).toFixed(1)}),color:"text-violet-700 dark:text-violet-300"},H)})]},"lev-query-length"))}}if(Object.keys(v).length>0){let N=Object.entries(v).sort(([,H],[,B])=>(B.averageScore??0)-(H.averageScore??0)).slice(0,6);w.push(V("div",{className:`${O} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[V("div",{className:`${W} text-purple-700 dark:text-purple-300`,children:["\u{1F4CB} ",a.statsFieldPerformanceHeading]}),N.map(([H,B])=>{let re=B;return V("div",{className:"space-y-1 rounded bg-purple-50/60 p-2 transition-colors dark:bg-slate-900/50",children:[S("div",{className:"font-semibold text-purple-700 text-xs transition-colors dark:text-purple-300",children:H}),S(M,{label:a.statAverageScore,value:`${((re.averageScore??0)*100).toFixed(1)}%`,color:"text-purple-700 dark:text-purple-300"}),S(M,{label:a.statMatchCount,value:o(re.matchCount??0),unit:a.itemsUnit(o(re.matchCount??0)),color:"text-purple-700 dark:text-purple-300"}),S(M,{label:a.statBestWorstScore,value:`${((re.bestScore??0)*100).toFixed(1)}% / ${((re.worstScore??0)*100).toFixed(1)}%`,color:"text-purple-700 dark:text-purple-300"})]},H)})]},"field-performance"))}if(k.bestPerformingField||k.totalHistoryEntries||k.similarityDistribution){let N=(k.recentAverageResultCount??0).toFixed(1);w.push(V("div",{className:`${O} border-blue-200 border-l-4 dark:border-blue-400/60`,children:[V("div",{className:`${W} text-blue-700 dark:text-blue-300`,children:["\u{1F50D} ",a.statsInsightsHeading]}),k.bestPerformingField&&S(M,{label:a.statBestField,value:k.bestPerformingField,color:"text-blue-700 dark:text-blue-300"}),S(M,{label:a.statRecentAverageTime,value:(k.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:"text-blue-700 dark:text-blue-300"}),S(M,{label:a.statRecentAverageResults,value:N,unit:a.itemsUnit(N),color:"text-blue-700 dark:text-blue-300"}),S(M,{label:a.statThroughput,value:(k.throughputPerSecond??0).toFixed(2),unit:a.throughputUnit,color:"text-blue-700 dark:text-blue-300"}),S(M,{label:a.statCommonQueryLength,value:o(k.mostCommonQueryLength??0),unit:a.charactersUnit(o(k.mostCommonQueryLength??0)),color:"text-blue-700 dark:text-blue-300"}),S(M,{label:a.statHistoryEntries,value:o(k.totalHistoryEntries??0),color:"text-blue-700 dark:text-blue-300"}),k.similarityDistribution&&V("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[S(M,{label:a.statHighSimilarity,value:o(k.similarityDistribution.highSimilarity??0),color:"text-emerald-700 dark:text-emerald-300"}),S(M,{label:a.statMediumSimilarity,value:o(k.similarityDistribution.mediumSimilarity??0),color:"text-lime-700 dark:text-lime-300"}),S(M,{label:a.statLowSimilarity,value:o(k.similarityDistribution.lowSimilarity??0),color:"text-orange-600 dark:text-orange-300"}),S(M,{label:a.statVeryLowSimilarity,value:o(k.similarityDistribution.veryLowSimilarity??0),color:"text-red-600 dark:text-red-400"})]})]},"performance-insights"))}return F.length>0&&w.push(V("div",{className:`${O} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[V("div",{className:`${W} text-sky-700 dark:text-sky-300`,children:["\u{1F4C8} ",a.statsRecentHistoryHeading]}),F.slice(-3).reverse().map((N,H)=>V("div",{className:"rounded bg-sky-50/70 p-2 transition-colors dark:bg-slate-900/50",children:[S("div",{className:"font-medium text-sky-700 transition-colors dark:text-sky-300",children:N.operationType}),S("div",{className:"text-sky-600 text-xs transition-colors dark:text-sky-200",children:a.statsHistoryEntry({processingTimeMs:N.processingTime.toFixed(2),resultCount:N.resultCount??0})}),te(N.timestamp)&&S("div",{className:"text-[10px] text-sky-500 transition-colors dark:text-sky-200",children:te(N.timestamp)})]},`${N.operationType}-${N.timestamp??H}`))]},"recent-history")),V("section",{className:"space-y-2",children:[V("div",{className:`flex items-center gap-2 font-semibold text-xs ${r}`,children:[S("span",{children:t}),S("span",{className:"tracking-wide",children:b})]}),S("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:w})]})});_t.displayName="WorkerStatsSection";import{jsx as we,jsxs as Te}from"react/jsx-runtime";var pl={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},$a=cl(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:r,resetStats:s,rebuildIndex:a,isIndexBuilding:o,activeTab:c,onTabChange:l})=>{let{locale:d,labels:m}=ye(),u=t.trim(),i=u?r:n,{setScrollableRef:p,onPointerDown:h,onPointerMove:C,onPointerUp:v,onPointerLeave:k,onPointerCancel:F,onClickCapture:T}=it(),y=c!=="index"||o,g=o?m.statsRebuildingTitle:c!=="index"?m.statsRebuildIndexTabOnlyTitle:m.statsRebuildTitle,E=y?"cursor-not-allowed bg-gray-300 text-gray-500 dark:bg-slate-700 dark:text-slate-400":"bg-blue-500 text-white hover:bg-blue-600 dark:bg-blue-500 dark:hover:bg-blue-600",K=o?`\u23F3 ${m.statsRebuilding}`:`\u{1F3D7}\uFE0F ${m.statsRebuild}`,b=ul(()=>{a().catch(()=>{})},[a]);return Te("div",{className:"wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border border-blue-300 bg-white p-1.5 shadow-md transition-colors dark:border-blue-500/40 dark:bg-slate-900/80 dark:shadow-blue-900/30",children:[Te("div",{className:"mb-0.5 flex shrink-0 flex-col gap-1 rounded bg-blue-50 px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between dark:bg-blue-900/30",children:[Te("h3",{className:"font-semibold text-gray-700 text-xs transition-colors dark:text-slate-100",children:["\u{1F4CA} ",m.searchStatistics]}),Te("div",{className:"flex flex-wrap gap-1.5",children:[we("button",{type:"button",onClick:b,disabled:y,className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${E}`,title:g,children:K}),Te("button",{type:"button",onClick:s,className:"rounded bg-red-500 px-1.5 py-0.5 text-[10px] text-white transition-colors hover:bg-red-600 dark:hover:bg-red-700",title:m.statsResetTitle,children:["\u{1F504} ",m.reset]})]})]}),we("div",{className:"mb-0 shrink-0",children:Te("div",{ref:p,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-md bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:pl,onPointerDown:h,onPointerMove:C,onPointerUp:v,onPointerLeave:k,onPointerCancel:F,onClickCapture:T,children:[Te("button",{type:"button",onClick:()=>l("overview"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${c==="overview"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CB} ",m.statsOverviewTab]}),Te("button",{type:"button",onClick:()=>l("index"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${c==="index"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CA} ",m.statsIndexTab]}),Te("button",{type:"button",onClick:()=>l("levenshtein"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${c==="levenshtein"?"bg-purple-500 text-white dark:bg-purple-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CF} ",m.statsLevenshteinTab]})]})}),Te("div",{className:"flex flex-col gap-1 pb-0.5",children:[Te("div",{className:`${c==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 text-gray-600 text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 dark:text-slate-300`,children:[we(M,{label:m.statTotalSearches,value:q(d,e.totalSearches)}),we(M,{label:m.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),we(M,{label:m.statDataCount,value:q(d,e.itemCount)}),we(M,{label:u?m.statResultCount:m.statDisplayedCount,value:q(d,i)})]}),we("div",{className:`${c==="index"?"space-y-3":"hidden"} pr-1 text-gray-600 text-xs transition-colors dark:text-slate-300`,children:we(_t,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:"text-green-600 dark:text-green-300"})}),we("div",{className:`${c==="levenshtein"?"space-y-3":"hidden"} pr-1 text-gray-600 text-xs transition-colors dark:text-slate-300`,children:we(_t,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:"text-purple-600 dark:text-purple-300"})}),Te("div",{className:"hidden",children:[we(_t,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:"text-green-600 dark:text-green-300"}),we(_t,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:"text-purple-600 dark:text-purple-300"})]})]})]})});$a.displayName="StatisticsPanel";import{Fragment as co,jsx as J,jsxs as fe}from"react/jsx-runtime";var vl=/[\u200B\uFEFF]/g,Va=typeof window<"u",po=Va&&typeof document<"u",qn=(e,t=[],n=!1)=>{let r=uo(e);r.current=e,Ye(()=>{if(!(!Va||n&&!po))return r.current()},[n,...t])},oo=(e,t,n)=>{let[r,s]=Oe(()=>{let a=so(o=>o.getItem(e));return a&&t.includes(a)?a:n});return qn(()=>{so(a=>{a.setItem(e,r)})},[e,r]),[r,s]},so=e=>{if(!Va)return null;try{return e(window.sessionStorage)}catch{return null}},io=(e,t)=>{let[n,r]=Oe(e);return Ye(()=>{let s=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(s)}},[e,t]),n},Cl="contact-map.settings-tab",kl="contact-map.statistics-tab",Sl=["basic","advanced","index","levenshtein"],Tl=["overview","index","levenshtein"],lo=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],wl={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},mo=({streamState:e,...t}={})=>e===void 0?J(Nl,{...t}):J(go,{...t,streamState:e}),Nl=e=>{let{context:t}=_n();return J(go,{...e,streamState:t})},Pl={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},go=e=>{let{streamState:t,onFooterVisibilityChange:n,children:r}=e,s=ge(e,"workerUrls"),a=Ge(),{locale:o,labels:c}=ye(),{contactMapRecords:l,contactMapRecordMap:d,isStreamingComplete:m,isStreamingFailed:u}=t,i=bl(),[p]=xl(),h=uo(null),[C,v]=Oe(!0),[k,F]=Oe(a.openEmailsWithGmail??!1),[T,y]=Oe(p.get("q")||""),g=io(T,300);Ye(()=>{let I=p.get("q")||"";y(U=>U!==I?I:U)},[p]),Ye(()=>{if(typeof window>"u")return;let I=new URL(window.location.href);(I.searchParams.get("q")||"")!==g&&(g?I.searchParams.set("q",g):I.searchParams.delete("q"),window.history.replaceState(window.history.state,"",I.toString()))},[g]);let[E,K]=yl(),[b,f]=Oe("search"),[x,O]=oo(Cl,Sl,"basic"),[W,te]=oo(kl,Tl,"overview"),{setScrollableRef:w,onPointerDown:N,onPointerMove:H,onPointerUp:B,onPointerLeave:re,onPointerCancel:pe,onClickCapture:ie}=it(),oe=At(()=>{if(!po)return;let I=h.current;!I||document.activeElement===I||window.requestAnimationFrame(()=>{try{I.focus({preventScroll:!0})}catch{}})},[]),ut=At(I=>{let U=I;f(U),U==="search"&&oe()},[oe]),{indexWorker:pt,levenshteinWorker:Ft}=Wt(a.workerUrls,s,Pl),Ue=ct(()=>{let{indexWorkerOptions:I={},levenshteinWorkerOptions:U={},...de}=ml;return{...de,autoSearchOnIndexRebuild:!1,debounceMs:0,multiTermOperator:"and",workerUrls:{indexWorker:pt,levenshteinWorker:Ft},indexWorkerOptions:{...I},levenshteinWorkerOptions:{...U}}},[pt,Ft]),[wt,xe]=Oe(Ue),[Xe,sn]=Oe("union"),$e=Xe==="intersection",Gn=$e?c.operatorAndTitle:c.operatorOrTitle,ln=At(I=>gl(I,Xe),[Xe]),dn=ct(()=>({querySetsOf:ln}),[ln]),zt=io(l,m?0:800),{searchTerm:ne,setSearchTerm:cn,filteredItems:Je,resultTerm:Bt,isSearching:Ze,isIndexBuilding:ve,clearSearch:Ut,resetStats:$t,performanceMetrics:We,rebuildIndex:et,error:De}=hl(zt,lo,wt,dn),mt=ne.trim().length>0,[tt,gt]=Oe(""),[Nt,Qn]=Oe(()=>ne),nt=ct(()=>Nn(T),[T]),Ve=ct(()=>Nn(g),[g]);Ye(()=>{g===tt&&Ve===ne||K(()=>{gt(g),cn(Ve)})},[g,tt,Ve,ne,cn]);let Vt=At(I=>{let de=I.target.value.replace(vl,"");y(de)},[]),Yn=At(()=>{y(""),gt(""),Ut(),oe()},[Ut,oe]),un=At(()=>{sn(I=>I==="intersection"?"union":"intersection"),oe()},[oe]);qn(()=>{if(!(b==="search"&&i.state==="idle"&&!E))return;let U=document.activeElement;if(!!!(U?.matches('[role="tab"]')||U?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&U&&U!==document.body&&U!==h.current)return;let He=window.requestAnimationFrame(()=>{oe()});return()=>{window.cancelAnimationFrame(He)}},[b,i.state,E,oe],!0),qn(()=>{if(b!=="search")return;let I=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&oe()}],[window,"pageshow",()=>{oe()}]];for(let[U,de,He]of I)U.addEventListener(de,He);return()=>{for(let[U,de,He]of I)U.removeEventListener(de,He)}},[b,oe],!0),Ye(()=>(n&&n(b==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[b,n]),qn(()=>{let I=document.body,U=I.style.overflow;return b==="search"&&(I.style.overflow="hidden"),()=>{I.style.overflow=U}},[b],!0),Ye(()=>{We&&Ie.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:We.totalSearches,averageSearchTime:We.averageSearchTime,itemCount:We.itemCount,resultsCount:We.resultsCount,workersAvailable:!!We.workerStats})},[We]);let{isAwaitingDebounce:pn,isAwaitingSearchTermSync:mn,isSearchInProgress:at}=ct(()=>{let I=nt!==Ve,U=Ve!==ne,de=ne.trim().length>0||nt.trim().length>0;return{isAwaitingDebounce:I,isAwaitingSearchTermSync:U,isSearchInProgress:E||Ze||Bt!==ne&&De===null||de&&ve||I||U||Nt!==ne}},[nt,Ve,ne,Bt,De,E,Ze,ve,Nt]),[Pt,gn]=Oe(ne);Ye(()=>{Pt!==ne&&gn(ne)},[ne,Pt]),Ye(()=>{pn||mn||E||Ze||ve||Pt===ne&&Nt!==ne&&Qn(ne)},[ne,Nt,pn,mn,E,Ze,ve,Pt]);let hn=ct(()=>mr(tt,lo),[tt]),fn=ct(()=>hn(Je),[hn,Je]),yn=ct(()=>({contactMapRecords:l,contactMapRecordMap:d,filteredItems:fn,searchQuery:tt,searchTerm:ne,isSearching:Ze,isIndexBuilding:ve,isPending:E,hasSearchTerm:mt,enableHighlighting:C,openEmailsWithGmail:k,isSearchInProgress:at,isSearchTabActive:b==="search",errorMessage:De??null,isStreamingComplete:m,isStreamingFailed:u}),[l,d,fn,tt,ne,Ze,ve,E,mt,C,k,at,b,De,m,u]),Xn=mt?Je.length:l.length,Kt=q(o,l.length),R=q(o,Je.length);return J("div",{className:`scrollbar-hidden bg-slate-50 text-slate-900 dark:bg-slate-900 dark:text-slate-100${b==="search"?" h-full min-h-0":""}`,children:fe(Ln,{value:b,onValueChange:ut,className:`flex flex-col${b==="search"?" h-full min-h-0":""}`,children:[fe(Jt,{ref:w,style:wl,className:"scrollbar-none mt-0 mb-1 flex w-full touch-pan-x flex-nowrap overflow-x-auto overflow-y-hidden rounded-md bg-slate-50 transition-colors dark:bg-slate-900/70 dark:text-slate-200",onPointerDown:N,onPointerMove:H,onPointerUp:B,onPointerLeave:re,onPointerCancel:pe,onClickCapture:ie,children:[fe(vt,{value:"search",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u{1F50D} ",c.searchTab]}),fe(vt,{value:"settings",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u2699\uFE0F ",c.searchSettings]}),fe(vt,{value:"statistics",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u{1F4CA} ",c.searchStatistics]})]}),J(Ct,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:fe("div",{className:"flex h-full flex-col",children:[J("div",{className:"rounded-md border border-gray-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/80 dark:shadow-none",children:fe("div",{className:"flex flex-col",children:[J("div",{className:"relative",children:fe("div",{className:"flex items-center gap-1 p-1",children:[fe("button",{type:"button",onClick:un,"aria-pressed":$e,title:Gn,className:`inline-flex min-w-9 items-center justify-center gap-0.5 rounded border px-1.5 py-0.5 font-semibold text-[10px] transition-colors sm:min-w-12 sm:px-2 sm:py-0.5 sm:text-xs ${$e?"border-blue-500 bg-blue-600 text-white hover:bg-blue-700 dark:border-blue-400 dark:bg-blue-500 dark:hover:bg-blue-600":"border-amber-400 bg-amber-100 text-amber-800 hover:bg-amber-200 dark:border-amber-500/70 dark:bg-amber-300/20 dark:text-amber-200 dark:hover:bg-amber-300/30"}`,children:[J("span",{className:"text-[10px] sm:text-xs",children:$e?c.operatorAnd:c.operatorOr}),J("span",{className:"hidden text-[10px] sm:inline",children:$e?c.operatorAndHint:c.operatorOrHint})]}),J("input",{ref:h,type:"text",value:T,onChange:Vt,placeholder:c.searchPlaceholder,className:"flex-1 rounded border border-gray-300 border-solid px-2 py-0.5 text-xs shadow-sm transition-colors focus:border-blue-500 focus:ring-1 focus:ring-blue-500 sm:px-2 sm:py-0.5 sm:text-xs dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100 dark:shadow-none"}),T&&J("button",{type:"button",onClick:Yn,className:"flex items-center justify-center gap-1 rounded border border-gray-300 px-1.5 py-0.5 text-[10px] transition-colors hover:text-gray-700 sm:px-2 sm:py-0.5 sm:text-xs dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-300 dark:hover:text-slate-100",title:at?c.searchBusyTitle:c.clearSearch,disabled:at,children:at?fe(co,{children:[J(fl,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),J("span",{className:"hidden sm:inline",children:c.searching})]}):"\u2715"})]})}),fe("p",{className:"px-1.5 py-0.5 text-[10px] text-slate-700 leading-snug transition-colors sm:text-[11px] dark:text-slate-200",children:[c.registeredCountLabel," ",J("span",{className:"font-semibold text-[11px] text-slate-900 sm:text-xs dark:text-white",children:Kt})," ",c.recordUnit(Kt),ve?fe("span",{className:"ml-1.5 inline-flex items-center rounded bg-blue-50 px-1.5 py-0.2 text-[10px] text-blue-700 sm:text-[11px] dark:bg-blue-900/40 dark:text-blue-200",children:["\u23F3 ",c.rebuildingIndex]}):null,De?fe("span",{className:"ml-1.5 inline-flex items-center rounded bg-rose-50 px-1.5 py-0.2 text-[10px] text-rose-700 sm:text-[11px] dark:bg-rose-900/40 dark:text-rose-200",children:["\u26A0\uFE0F ",c.errorLabel,J("span",{className:"ml-1 break-all font-semibold",children:De})]}):null,mt&&fe("span",{className:"ml-1.5 text-[10px] text-blue-600 sm:text-[11px] dark:text-sky-400",children:["| ",c.resultCountLabel,at?J("span",{className:"ml-1 font-semibold text-[10px] sm:text-[11px]",children:c.searching}):fe(co,{children:[J("span",{className:"ml-1 font-semibold text-[11px] text-slate-900 sm:text-xs dark:text-white",children:R}),J("span",{className:"ml-0.5 text-[10px] sm:text-[11px]",children:c.resultUnit(R)})]})]})]}),J("div",{className:"h-2.5 px-2 pb-1.5",children:ve?J(Rr,{className:"h-1 bg-blue-200 dark:bg-blue-800",indicatorClassName:"bg-blue-500 dark:bg-blue-400"}):null})]})}),r?r(yn):J(ro,{context:yn})]})}),J(Ct,{value:"settings",className:"mt-0",children:J(Ba,{searchOptions:wt,setSearchOptions:xe,enableHighlighting:C,setEnableHighlighting:v,openEmailsWithGmail:k,setOpenEmailsWithGmail:F,activeTab:x,onTabChange:O})}),J(Ct,{value:"statistics",className:"mt-0",children:J($a,{performanceMetrics:We,searchTerm:ne,totalDataCount:l.length,resultsCount:Xn,resetStats:$t,rebuildIndex:et,isIndexBuilding:ve,activeTab:W,onTabChange:te})})]})})};import{jsx as It,jsxs as fo}from"react/jsx-runtime";var Ml=({renderHeader:e,title:t,onFooterVisibilityChange:n})=>{let r=G(),s=t===void 0?r.appTitle:t,{context:a,retryNow:o}=_n(),c=It(Sa,{recordCount:a.contactMapRecords.length,companyCount:a.companyCount,phase:a.streamPhase,loadedCount:a.loadedCount,totalCount:a.totalCount,errorMessage:a.errorMessage,onRetry:o});return fo("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[e?e({title:s,annotation:c}):fo("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[It("h1",{className:"font-bold text-xl",children:s}),c]}),It("div",{className:"min-h-0 flex-1",children:It(mo,{streamState:a,onFooterVisibilityChange:n})})]})},rm=e=>{let t=Ge(),n=ge(e,"streamEndpoint"),r=ge(e,"workerUrls"),s=ge(e,"locale"),a=ge(e,"labels"),o=ho(()=>({...t,streamEndpoint:n===void 0?t.streamEndpoint:n,workerUrls:Wt(t.workerUrls,r,{setting:"ContactMapAppView workerUrls"}),locale:s===void 0?t.locale:s,labels:a===void 0?t.labels:a}),[t,n,r,s,a]),c=s!==void 0,l=a!==void 0,d=ho(()=>({locale:c?"ContactMapAppView locale":"locale",labels:l?"ContactMapAppView labels":"labels"}),[c,l]);return It(wa,{config:o,chromeSurface:d,children:It(Ml,{...e})})};ft();le();function im(){return!1}export{ia as AdvancedSearchSettings,la as BasicSearchSettings,Ke as CONTACT_MAP_LABEL_CATALOGS,jt as CONTACT_MAP_LABEL_KEYS,gr as ContactDetailGrid,ot as ContactDetailPanel,Tn as ContactDetailPopup,wn as ContactDetailRowLayout,Sa as ContactMapAnnotation,rm as ContactMapAppView,Es as ContactMapConfigProvider,$r as ContactMapSearchListView,mo as ContactMapSearchPage,ro as ContactMapSearchTabGroup,ao as ContactMapSearchTreeView,Wn as ContactMapStreamClient,ue as HighlightedText,Aa as IndexWorkerSettings,Xc as LIST_COLLAPSE_THRESHOLD,gi as LIST_DETAIL_PANEL_MIN_WIDTH,Jc as LIST_EXPAND_THRESHOLD,mi as LIST_PANEL_MIN_WIDTH,hi as LIST_RESIZE_HANDLE_THICKNESS,Fa as LevenshteinWorkerSettings,Rr as Progress,Ba as SearchOptionsPanel,M as StatItem,$a as StatisticsPanel,zn as SwipeOverlay,Wu as TREE_COLLAPSE_THRESHOLD,$i as TREE_DETAIL_PANEL_MIN_WIDTH,Du as TREE_EXPAND_THRESHOLD,Ui as TREE_PANEL_MIN_WIDTH,Vi as TREE_RESIZE_HANDLE_THICKNESS,Ln as Tabs,Ct as TabsContent,Jt as TabsList,vt as TabsTrigger,Vn as TreeWorkerSession,_t as WorkerStatsSection,Dn as assertContactMapStreamEndpoint,kr as assertContactMapTreeWorkerUrl,oc as assertContactMapWorkerUrls,Gi as composeTreeVirtualScrollOptions,im as contactMapShouldRevalidate,$s as countContactMapCompanies,Hs as deserializeStreamRecord,Is as getContactMapStreamClient,Wi as getTreeWorkerSession,Wt as layerContactMapWorkerUrls,vc as resetContactMapStreamClientForTesting,cu as resetTreeWorkerSessionForTesting,na as resolveContactMapLabels,Vr as useAnimatedNumber,Ge as useContactMapConfig,G as useContactMapLabels,Us as useContactMapStream,Ma as useContactPanelSizing,Lr as useDynamicViewportHeight,it as useHorizontalDragScroll,In as useLongPressPopup,Si as useReportPopupVisibility,Fn as useResponsiveTwoColumnLayout,ki as useRowPopupRegistry,_n as useStreamedContactMapContext,Qr as useTreeWorker};